From 62ddc37c0e1f1a25c272c087e92143cbb23bd353 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Mon, 27 Sep 2021 20:58:01 -0500 Subject: [PATCH 01/28] more matches --- include/functions.h | 14 +- include/variables.h | 19 +- include/z64.h | 17 +- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 2711 ++++++++++++++++- src/overlays/actors/ovl_Boss_07/z_boss_07.h | 157 +- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.h | 3 +- tools/disasm/functions.txt | 32 +- 7 files changed, 2824 insertions(+), 129 deletions(-) diff --git a/include/functions.h b/include/functions.h index bd61a60c4..6d6eff114 100644 --- a/include/functions.h +++ b/include/functions.h @@ -547,8 +547,8 @@ void func_800AE5A0(GlobalContext* globalCtx); // void func_800AE5E4(void); void func_800AE778(GlobalContext* globalCtx, Color_RGBA8* color, s16 param_3, s16 param_4); void func_800AE8EC(GlobalContext* globalCtx); -void func_800AE930(CollisionContext* colCtx, s32 param_2, float* param_3, f32 param_4, s16 param_5, CollisionPoly* param_6, s32 param_7); -// void func_800AEF44(void); +void func_800AE930(CollisionContext* colCtx, s32 param_2, Vec3f* param_3, f32 param_4, s16 param_5, CollisionPoly* param_6, s32 param_7); +void func_800AEF44(EffTireMarkParams* arg0); void EffectTireMark_InitParticle(EffTireMarkParticle* particle); void EffectTireMark_Init(EffTireMarkParams* params, EffTireMarkInit* init); void EffectTireMark_Destroy(EffTireMarkParams* params); @@ -729,7 +729,7 @@ void Actor_TitleCardDraw(GlobalContext* globalCtx, TitleCardContext* titleCardCt void func_800B6468(GlobalContext* globalCtx); void func_800B6474(GlobalContext* globalCtx); // UNK_TYPE4 func_800B648C(GlobalContext* globalCtx, UNK_TYPE1 param_2, UNK_TYPE1 param_3, f32 param_4, Vec3f* param_5); -f32 func_800B64FC(GlobalContext* globalCtx, f32 fParm2, Vec3f* pzParm3, u32* puParm4); +f32 func_800B64FC(GlobalContext* globalCtx, f32 fParm2, Vec3f* pzParm3, s32* puParm4); void* func_800B6584(GlobalContext* globalCtx, s16 sParm2, void* pvParm3, u32 uParm4); // UNK_TYPE4 func_800B6608(s32 iParm1, s16 sParm2); // void func_800B6680(void); @@ -2243,7 +2243,7 @@ void func_80123E90(GlobalContext* globalCtx, Actor* actor); // void func_80124020(void); u8 Player_GetMask(GlobalContext* globalCtx); void Player_RemoveMask(GlobalContext* globalCtx); -// void func_8012405C(void); +s32 func_8012405C(GlobalContext* globalCtx); // Player_HoldsMirrorShield // void func_80124088(void); s32 func_801240C8(Player* player); // void func_801240DC(void); @@ -3000,8 +3000,8 @@ void func_80165438(UNK_PTR param_1); // void func_80165608(void); // void func_80165630(void); // void func_80165658(void); -// void func_8016566C(void); -// void func_80165690(void); +void func_8016566C(s16); +void func_80165690(void); // void func_801656A4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8); // void func_80165DCC(void); // void func_80165DF0(void); @@ -3992,7 +3992,7 @@ UNK_TYPE func_801A51F0(UNK_TYPE arg0); void func_801A5BD0(s32 param_1); // void func_801A5C28(void); // void func_801A5C8C(void); -// void func_801A5CFC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); +void func_801A5CFC(u16 arg0, Vec3f* arg1, s32 arg2, f32* arg3, f32* arg4, s8* arg5); // void func_801A5DDC(void); // void func_801A5F7C(void); // void func_801A6430(void); diff --git a/include/variables.h b/include/variables.h index 0e17c2daa..ad68adca5 100644 --- a/include/variables.h +++ b/include/variables.h @@ -1876,8 +1876,8 @@ extern UNK_PTR D_801DB478[7]; // extern UNK_TYPE1 D_801DB49C; // extern UNK_TYPE2 D_801DB4A0; extern UNK_TYPE D_801DB4A4; -// extern UNK_TYPE1 D_801DB4B0; -// extern UNK_TYPE1 D_801DB4B8; +extern f32 D_801DB4B0; +extern s8 D_801DB4B8; // extern UNK_TYPE1 D_801DB4C0; // extern UNK_TYPE1 D_801DB4C4; // extern UNK_TYPE1 D_801DB4C8; @@ -3294,13 +3294,11 @@ extern u8 actorCutsceneNextCutscenes[16]; // extern UNK_TYPE1 D_801F4E20; // extern UNK_TYPE1 D_801F4E30; // extern UNK_TYPE1 D_801F4E31; -// extern UNK_TYPE1 D_801F4E32; -// extern UNK_TYPE1 D_801F4E38; -// extern UNK_TYPE1 D_801F4E3C; -// extern UNK_TYPE1 D_801F4E40; -// extern UNK_TYPE1 D_801F4E44; -// extern UNK_TYPE1 D_801F4E48; -// extern UNK_TYPE1 D_801F4E4C; +extern s8 D_801F4E32; +extern Vec3f D_801F4E38; +extern f32 D_801F4E44; +extern f32 D_801F4E48; +extern s16 D_801F4E4C; // extern UNK_TYPE1 D_801F4E4E; // extern UNK_TYPE1 D_801F4E50; // extern UNK_TYPE1 D_801F4E54; @@ -3974,7 +3972,8 @@ extern UNK_TYPE D_04023100; extern UNK_TYPE D_04023130; extern Gfx D_04023210[]; extern UNK_TYPE D_04023288; -extern UNK_TYPE D_04023348; +extern Gfx D_04023348[]; +extern Gfx D_04023428[]; extern UNK_TYPE D_04025850; extern UNK_TYPE D_04025DD0; extern UNK_TYPE D_040281DC; diff --git a/include/z64.h b/include/z64.h index d6f097cfb..5cd4ad79f 100644 --- a/include/z64.h +++ b/include/z64.h @@ -1517,6 +1517,21 @@ typedef struct { /* 0x00 */ u16 state; } GameOverContext; // size = 0x02 +typedef struct { + /* 0x00 */ u8 unk_0; + /* 0x02 */ s16 unk_2; + /* 0x04 */ Vec3f unk_4; + /* 0x10 */ Vec3f unk_10; + /* 0x1C */ Vec3f unk_1C; + /* 0x28 */ char unk28[4]; + /* 0x2C */ s16 unk_2C; + /* 0x2E */ char unk2E[2]; + /* 0x30 */ s16 unk_30; + /* 0x32 */ char unk32[2]; + /* 0x34 */ f32 unk_34; + /* 0x38 */ char unk38[0x10]; +} Boss07Effect; + struct GlobalContext { /* 0x00000 */ GameState state; /* 0x000A4 */ s16 sceneNum; @@ -1581,7 +1596,7 @@ struct GlobalContext { /* 0x18864 */ Path* setupPathList; /* 0x18868 */ void* unk_18868; /* 0x1886C */ AnimatedMaterial* sceneMaterialAnims; - /* 0x18870 */ void* specialEffects; + /* 0x18870 */ Boss07Effect* specialEffects; /* 0x18874 */ u8 skyboxId; /* 0x18875 */ s8 sceneLoadFlag; // "fade_direction" /* 0x18876 */ s16 unk_18876; 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 6c549b217..b8e8988be 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -1,13 +1,103 @@ #include "z_boss_07.h" +#include "overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h" #define FLAGS 0x00000035 #define THIS ((Boss07*)thisx) +// #define FACING_ANGLE(actor1, actor2) BINANG_SUB(BINANG_ROT180((actor1)->shape.rot.y), (actor2)->shape.rot.y) +#define FACING_ANGLE(actor1, actor2) ((s16)((actor1)->shape.rot.y - (actor2)->shape.rot.y + 0x8000)) + void Boss07_Init(Actor* thisx, GlobalContext* globalCtx); void Boss07_Destroy(Actor* thisx, GlobalContext* globalCtx); -void Boss07_Update(Actor* thisx, GlobalContext* globalCtx); -void Boss07_Draw(Actor* thisx, GlobalContext* globalCtx); + +void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Effects_Update(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Remains_Update(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Top_Update(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Afterimage_Update(Actor* thisx, GlobalContext* globalCtx); + +void Boss07_Wrath_Draw(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Effects_Draw(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Remains_Draw(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Top_Draw(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Projectile_Draw(Actor* thisx, GlobalContext* globalCtx); +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_809F4BB0(s32 arg0, ColliderJntSph* arg1, Vec3f* arg2); +s32 func_809FF678(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx); +void func_809FF6B0(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3s *rot, Actor *thisx); +void func_809FF810(GlobalContext *globalCtx, s32 limbIndex, Actor *thisx); +void func_80A07740(GlobalContext* globalCtx); +void func_809FBF94(Boss07* this, GlobalContext* globalCtx); +void func_80A03238(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, Vec3f* arg4, Vec3f* arg5, + Vec3f* arg6, f32 arg7, u8 arg8, f32 arg9); +void func_80A036C4(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, f32 arg4, f32 arg5); +void func_80A03868(Boss07* this, GlobalContext* globalCtx); +void func_80A03F18(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor); +void func_809FAA44(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, Vec3f* arg4, Vec3f* arg5, f32 arg6, + f32 arg7, f32 arg8, f32 arg9, Vec3s* argA, s32 argB, f32 argC, s32 argD); +void func_809FB114(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, f32 arg4, s32 arg5); +s32 func_809FB504(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor); +void func_809FB55C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor); +void func_809FB728(GlobalContext* globalCtx, s32 limbIndex, Actor* actor); +void func_809FB7D4(Boss07* this, GlobalContext* globalCtx); +void func_809FBB9C(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2); +void func_809FC8B0(u8 *arg0, Boss07* this, GlobalContext* globalCtx); +void func_809FC960(u8 *arg0, Boss07* this, GlobalContext* globalCtx); +void func_809FC4C0(Boss07 * this, u8 *arg1, f32 arg2); +void func_809F7688(Boss07* this, GlobalContext* globalCtx); +void func_809F783C(Boss07* this, GlobalContext* globalCtx); +void func_809FFE64(Boss07* this, GlobalContext* globalCtx); +void func_80A006F4(Boss07* this, GlobalContext* globalCtx); +void func_80A025AC(Boss07* this, GlobalContext* globalCtx); +void func_809FEE70(Boss07* this, GlobalContext* globalCtx); +void func_809F51E8(Boss07* this, GlobalContext* globalCtx, u8 arg2); +void func_809F52CC(Boss07* this, GlobalContext* globalCtx); +void func_809F5494(Boss07* this, GlobalContext* globalCtx); +void func_809F64F4(Boss07* this, GlobalContext* globalCtx); +void func_809F7AB4(Boss07* this, GlobalContext* globalCtx); +void func_809F99C4(Boss07* this, GlobalContext* globalCtx); + +void func_809F4D10(Vec3f* arg0, f32 arg1); +void func_809F4FAC(GlobalContext* globalCtx); +void func_809F4AE8(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4); +void func_80A02B30(Boss07* this, GlobalContext* globalCtx); +void func_809F536C(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2); +void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx); +void func_809F4FF8(GlobalContext* globalCtx, Vec3f* arg1, u8 arg2); +s32 func_809F4C40(Boss07* this, GlobalContext* globalCtx); +void func_809F4CBC(Boss07* this, f32 arg1); +void func_809F4D54(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3); +void func_809FCBC8(Boss07* this); +void func_80A07638(GlobalContext* globalCtx); +void func_809F9CEC(Boss07* this, GlobalContext* globalCtx); +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_809F9280(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3); + +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_80A00484(Boss07* this, GlobalContext* globalCtx, u8 arg2, Actor* arg3); +void func_80A0021C(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_809FFA04(Boss07* this, GlobalContext* globalCtx); +void func_80A016E4(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); @@ -24,10 +114,12 @@ 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 func_809F93DC(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); @@ -235,8 +327,8 @@ const ActorInit Boss_07_InitVars = { sizeof(Boss07), (ActorFunc)Boss07_Init, (ActorFunc)Boss07_Destroy, - (ActorFunc)Boss07_Update, - (ActorFunc)Boss07_Draw, + (ActorFunc)Boss07_Wrath_Update, + (ActorFunc)Boss07_Wrath_Draw, }; // static ColliderJntSphElementInit sJntSphElementsInit[11] = { @@ -405,6 +497,8 @@ static ColliderCylinderInit D_80A07ED0 = { #endif +extern s16 D_80A07968[4][3]; +extern s16 D_80A07950[4][3]; extern DamageTable D_80A07980; extern DamageTable D_80A079A0; extern DamageTable D_80A079C0; @@ -422,88 +516,556 @@ extern ColliderJntSphInit D_80A07E68; extern ColliderCylinderInit D_80A07E78; extern ColliderCylinderInit D_80A07EA4; extern ColliderCylinderInit D_80A07ED0; +extern Color_RGBA8 D_80A07EFC; +extern Color_RGBA8 D_80A07F00; +extern Color_RGBA8 D_80A07F04; +extern Color_RGBA8 D_80A07F08; +extern Vec3f D_80A07F0C[4]; +extern Vec3s D_80A07F3C[4]; +extern s16 D_80A07F54[4]; +extern EffTireMarkInit D_80A07F5C; +extern EffTireMarkInit D_80A07F64; +extern Vec3f D_80A07F6C[5]; +extern Vec3f D_80A07FA8; +extern Vec3f D_80A07FB4; +extern Vec3f D_80A07FC0; +extern Color_RGBA8 D_80A07FCC; +extern Color_RGBA8 D_80A07FD0; +extern Vec3f D_80A07FD4; +extern Vec3f D_80A07FE0; +extern s8 D_80A07FEC[32]; +extern Vec3f D_80A0800C[11]; +extern s8 D_80A08090[32]; +extern Vec3f D_80A080B0; +extern s32 D_80A080BC[6]; +extern s32 D_80A080D4[7]; +extern s32 D_80A080F0[8]; +extern s32 D_80A08110[12]; +extern s32 D_80A08140[15]; +extern u8 D_80A0817C[15]; +extern AnimationHeader* D_80A0818C[3]; +extern u8 D_80A08198[8]; +extern u8 D_80A081A0[8]; +extern s8 D_80A081A8[32]; +extern s8 D_80A081C8[32]; +extern Vec3f D_80A081E8[11]; +extern s8 D_80A0826C[32]; +extern Vec3s D_80A0828C[4]; +extern Vec3s D_80A082A4[4]; +extern Vec3f D_80A082BC; +extern Vec3f D_80A082C8; +extern Vec3f D_80A082D4; +extern void* D_80A082E0[2]; + +extern Vec3f D_80A084D8; + +extern Vec3f D_80A09A40; +extern u8 D_80A09A4C; +extern s32 D_80A09A50; +extern Boss07* D_80A09A54; +extern Boss07* D_80A09A58; +extern Boss07* D_80A09A5C; +extern Boss07* D_80A09A60[4]; +extern u8 D_80A09A70; +extern u8 D_80A09A71; +extern Boss07Effect D_80A09A78[50]; +extern s32 D_80A0A888; +extern s32 D_80A0A88C; +extern s32 D_80A0A890; extern UNK_TYPE D_06000194; extern UNK_TYPE D_06000428; -extern UNK_TYPE D_06000D0C; +extern AnimationHeader D_06000D0C; extern UNK_TYPE D_06002C40; -extern UNK_TYPE D_06002D84; +extern AnimationHeader D_06002D84; extern UNK_TYPE D_06003854; extern UNK_TYPE D_06003A64; -extern UNK_TYPE D_06009C7C; +extern FlexSkeletonHeader D_060099A0; +extern AnimationHeader D_06009C7C; extern UNK_TYPE D_06009EA8; extern UNK_TYPE D_0600A194; -extern UNK_TYPE D_0600A400; -extern UNK_TYPE D_0600AE40; -extern UNK_TYPE D_0600AFB0; +extern AnimationHeader D_0600A400; +extern AnimationHeader D_0600A6AC; +extern AnimationHeader D_0600AE40; +extern Gfx D_0600AFB0[]; extern UNK_TYPE D_0600B020; extern UNK_TYPE D_0600C7D8; -extern UNK_TYPE D_0600CEE8; -extern UNK_TYPE D_060149A0; -extern UNK_TYPE D_06019E48; -extern UNK_TYPE D_0601DEB4; -extern UNK_TYPE D_06022BB4; -extern UNK_TYPE D_06023DAC; +extern Gfx D_0600CEE8[]; +extern Gfx D_060149A0[]; +extern Gfx D_06016090[]; +extern Gfx D_06017DE0[]; +extern Gfx D_06019328[]; +extern SkeletonHeader D_06019C58; +extern AnimationHeader D_06019E48; +extern AnimationHeader D_0601DEB4; +extern AnimationHeader D_06022BB4; +extern AnimationHeader D_06023DAC; extern UNK_TYPE D_06025018; extern UNK_TYPE D_06025878; extern UNK_TYPE D_060269EC; extern UNK_TYPE D_06026EA0; extern UNK_TYPE D_06027270; extern UNK_TYPE D_0602EEC8; -extern UNK_TYPE D_0602EF68; +extern Gfx D_0602EF68[]; +extern Gfx D_0602EF88[]; extern UNK_TYPE D_0602EFE8; -extern UNK_TYPE D_0602F640; -extern UNK_TYPE D_0602F840; +extern Gfx D_0602F640[]; +extern UNK_TYPE D_0602F840; // title card +extern u16 D_0603DD30[]; +extern u16 D_0603ED30[]; +extern u16 D_0603F130[]; +extern u16 D_06040130[]; +extern u16 D_06040B30[]; +extern u16 D_06041B30[]; +extern u16 D_06042330[]; +extern u16 D_06043330[]; +extern FlexSkeletonHeader D_060335F0; extern UNK_TYPE D_06033F80; -extern UNK_TYPE D_0603B330; -extern UNK_TYPE D_0603CBD0; +extern AnimationHeader D_0603B330; +extern AnimationHeader D_0603CBD0; extern UNK_TYPE D_0603D7F0; extern UNK_TYPE D_0603DD1C; -extern UNK_TYPE D_06040930; +extern u16 D_06040930[]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F4980.s") +void func_809F4980(Actor* arg0) { + Audio_PlayActorSound2(arg0, NA_SE_EN_FOLLOWERS_DAMAGE); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F49A0.s") +void func_809F49A0(s32 seedInit0, s32 seedInit1, s32 seedInit2) { + D_80A0A888 = seedInit0; + D_80A0A88C = seedInit1; + D_80A0A890 = seedInit2; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F49C0.s") +f32 func_809F49C0(void) { + // Wichmann-Hill algorithm + f32 randFloat; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F4AE8.s") + D_80A0A888 = (D_80A0A888 * 171) % 30269; + D_80A0A88C = (D_80A0A88C * 172) % 30307; + D_80A0A890 = (D_80A0A890 * 170) % 30323; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F4BB0.s") + randFloat = (D_80A0A888 / 30269.0f) + (D_80A0A88C / 30307.0f) + (D_80A0A890 / 30323.0f); + while (randFloat >= 1.0f) { + randFloat -= 1.0f; + } + return fabsf(randFloat); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F4C40.s") +void func_809F4AE8(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4) { + s32 i; + Boss07Effect* effect = (Boss07Effect*)globalCtx->specialEffects; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F4CBC.s") + for (i = 0; i < 50; i++, effect++) { + if (effect->unk_0 == 0) { + effect->unk_0 = 1; + effect->unk_4 = *arg1; + effect->unk_10 = *arg2; + effect->unk_1C = *arg3; + effect->unk_34 = arg4 / 1000.0f; + effect->unk_30 = 0; + effect->unk_2C = 0; + effect->unk_2 = Rand_ZeroFloat(1000.0f); + break; + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F4D10.s") +void func_809F4BB0(s32 arg0, ColliderJntSph *arg1, Vec3f *arg2) { + arg1->elements[arg0].dim.worldSphere.center.x = arg2->x; + arg1->elements[arg0].dim.worldSphere.center.y = arg2->y; + arg1->elements[arg0].dim.worldSphere.center.z = arg2->z; + arg1->elements[arg0].dim.worldSphere.radius = arg1->elements[arg0].dim.modelSphere.radius * arg1->elements[arg0].dim.scale; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F4D54.s") +s32 func_809F4C40(Boss07* this, GlobalContext* globalCtx) { + Player* player = PLAYER; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F4FAC.s") + if ((ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x3000) && + (ABS_ALT((s16)(this->actor.yawTowardsPlayer - (s16)(player->actor.shape.rot.y + 0x8000))) < 0x3000)) { + return 1; + } + return 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F4FF8.s") +void func_809F4CBC(Boss07* this, f32 arg1) { + Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, arg1); + if (this->actor.bgCheckFlags & 0x18) { + this->actor.speedXZ = 0.0f; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F51E8.s") +void func_809F4D10(Vec3f* arg0, f32 arg1) { + SysMatrix_InsertYRotation_f(Rand_ZeroFloat(2 * M_PI), 0); + SysMatrix_GetStateTranslationAndScaledZ(arg1, arg0); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F52CC.s") +void func_809F4D54(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { + u8 phi_s1; + Vec3f spB0; + Vec3f spA4; + Vec3f sp98; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F536C.s") + if (!(this->unk_14C & arg2) && ((arg2 == 0) || (this->actor.speedXZ > 1.0f))) { + for (phi_s1 = 0; phi_s1 < 2; phi_s1++) { + spA4.x = randPlusMinusPoint5Scaled(5.0f); + spA4.y = Rand_ZeroFloat(2.0f) + 1.0f; + spA4.z = randPlusMinusPoint5Scaled(5.0f); + sp98.x = sp98.z = 0.0f; + sp98.y = -0.1f; + spB0.y = Rand_ZeroFloat(10.0f) + 3.0f; + if (arg3) { + spB0.x = randPlusMinusPoint5Scaled(150.0f) + this->actor.focus.pos.x; + spB0.z = randPlusMinusPoint5Scaled(150.0f) + this->actor.focus.pos.z; + } else { + spB0.z = this->unk_1788[phi_s1].z + randPlusMinusPoint5Scaled(20.0f); + spB0.x = this->unk_1788[phi_s1].x + randPlusMinusPoint5Scaled(20.0f); + } + func_800B0EB0(globalCtx, &spB0, &spA4, &sp98, &D_80A07EFC, &D_80A07F00, Rand_ZeroFloat(150.0f) + 350.0f, 10, + Rand_ZeroFloat(5.0f) + 14.0f); + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F5494.s") +void func_809F4FAC(GlobalContext* globalCtx) { + Player* player = PLAYER; + if (SQXZ(player->actor.world.pos) < SQ(80.0f)) { + player->actor.world.pos.z = 90.0f; + } +} + +void func_809F4FF8(GlobalContext* globalCtx, Vec3f* arg1, u8 arg2) { + u8 i; + Vec3f spB0; + Vec3f spA4; + Vec3f sp98; + + for (i = 0; i < arg2; i++) { + spA4.x = randPlusMinusPoint5Scaled(3.0f); + spA4.y = Rand_ZeroFloat(2.0f) + 1.0f; + spA4.z = randPlusMinusPoint5Scaled(3.0f); + sp98.x = sp98.z = 0.0f; + sp98.y = -0.1f; + spB0.x = randPlusMinusPoint5Scaled(30.0f) + arg1->x; + spB0.y = randPlusMinusPoint5Scaled(30.0f) + (arg1->y + 15.0f); + spB0.z = randPlusMinusPoint5Scaled(30.0f) + arg1->z; + func_800B0EB0(globalCtx, &spB0, &spA4, &sp98, &D_80A07F04, &D_80A07F08, Rand_ZeroFloat(50.0f) + 100.0f, 10, + Rand_ZeroFloat(5.0f) + 14.0f); + } +} + +void func_809F51E8(Boss07* this, GlobalContext* globalCtx, u8 arg2) { + Player* player = PLAYER; + + if ((this->unk_15C == 0) && (((this->actionFunc != func_809F7968) && (this->actionFunc != func_809F76D0) && + (this->actionFunc != func_809F77A8)) || + (arg2 != 0))) { + if (Rand_ZeroOne() < 0.5f) { + func_809F783C(this, globalCtx); + } else { + func_809F7688(this, globalCtx); + } + this->unk_158 = 10; + this->unk_F7E = 0; + if (&this->actor == player->actor.parent) { + player->unk_AE8 = 101; + player->actor.parent = NULL; + player->unk_394 = 0; + } + } +} + +void func_809F52CC(Boss07* this, GlobalContext* globalCtx) { + Actor* phi_v0 = globalCtx->actorCtx.actorList[ACTORCAT_EXPLOSIVES].first; + + while (phi_v0 != NULL) { + f32 dx = phi_v0->world.pos.x - this->actor.world.pos.x; + f32 dy = phi_v0->world.pos.y - this->actor.world.pos.y; + f32 dz = phi_v0->world.pos.z - this->actor.world.pos.z; + + if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 200.0f) { + func_809F51E8(this, globalCtx, 0); + return; + } + phi_v0 = phi_v0->next; + } +} + +void func_809F536C(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2) { + s32 i; + f32 push; + f32 dx; + f32 dy; + f32 dz; + Vec3f sp50; + + sp50.x = 0.0f; + + for (i = 0; i < D_80A09A50; i++, arg1++, arg2++) { + dx = arg1->x - arg0->x; + dy = arg1->y - arg0->y; + dz = arg1->z - arg0->z; + + if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 300.0f) { + + push = 300.0f - sqrtf(SQ(dx) + SQ(dy) + SQ(dz)); + push = CLAMP_MAX(push, 200.0f); + + sp50.y = push; + sp50.z = push; + SysMatrix_InsertYRotation_f(Math_Acot2F(dz, dx), 0); + SysMatrix_MultiplyVector3fByState(&sp50, arg2); + } + } +} + +void func_809F5494(Boss07* this, GlobalContext* globalCtx) { + Actor* phi_s0 = globalCtx->actorCtx.actorList[3].first; + + while (phi_s0 != NULL) { + if (phi_s0->params == 1) { + func_809F536C(&phi_s0->world.pos, this->unk_7AC, this->unk_C5C); + func_809F536C(&phi_s0->world.pos, this->unk_FB8, this->unk_1468); + } + phi_s0 = phi_s0->next; + } +} + +#ifdef NON_MATCHING +void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + s32 i; + + if (this->actor.params == 150) { + this->actor.update = Boss07_Effects_Update; + this->actor.draw = Boss07_Effects_Draw; + this->actor.flags &= ~1; + D_80A09A58 = this; + D_80A09A70 = 0; + globalCtx->envCtx.unk_C3 = 0; + globalCtx->envCtx.unk_E0 = 2; + } else { + if (this->actor.params == 0) { + Boss07Effect* effect; + + this->actor.params = 10; + 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, 150); + globalCtx->specialEffects = D_80A09A78; + for (effect = D_80A09A78; effect < &D_80A09A78[50]; effect++) { + effect->unk_0 = 0; + } + for (i = 0; i < 4; i++) { + D_80A09A60[i] = NULL; + } + } + this->actor.targetMode = 5; + this->actor.colChkInfo.mass = MASS_HEAVY; + this->actor.gravity = -2.5f; + if (this->actor.params >= 200) { + this->actor.update = Boss07_Remains_Update; + this->actor.draw = Boss07_Remains_Draw; + D_80A09A60[(u32)this->actor.params - 200] = this; + if (gSaveContext.eventInf[6] & 2) { + Actor_SetScale(&this->actor, 0.03f); + this->actor.world.pos.x = D_80A07F3C[this->actor.params - 200].x; + this->actor.world.pos.y = 370.0f; + this->actor.world.pos.z = D_80A07F3C[this->actor.params - 200].z; + this->actor.shape.rot.y = D_80A07F3C[this->actor.params - 200].y; + func_80A04DE0(this, globalCtx); + } else { + func_80A04878(this, globalCtx); + } + this->actor.flags &= ~1; + this->actor.colChkInfo.damageTable = &D_80A079E0; + } else if (this->actor.params == 180) { + this->actor.update = Boss07_Top_Update; + this->actor.draw = Boss07_Top_Draw; + + func_80A05AF8(this, globalCtx); + this->actor.colChkInfo.damageTable = &D_80A07A00; + ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, KREG(55) + 9.0f); + this->actor.shape.shadowAlpha = 180; + Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &D_80A07ED0); + Effect_Add(globalCtx, &this->effectIndex, 4, 0, 0, &D_80A07F5C); + this->actor.flags &= ~1; + } else if ((this->actor.params == 100) || (this->actor.params == 101)) { + this->actor.update = Boss07_Projectile_Update; + this->actor.draw = Boss07_Projectile_Draw; + this->actor.flags &= ~1; + Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &D_80A07E78); + func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); + this->unk_181C = Rand_ZeroFloat(3.99f); + } else if ((this->actor.params == 10) || (this->actor.params == 11)) { + this->actor.colChkInfo.damageTable = &D_80A07980; + ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 15.0f); + SkelAnime_Init(globalCtx, &this->skelAnime1, &D_06019C58, &D_06019E48, this->jointTable1, this->morphTable1, + 19); + if (this->actor.params == 10) { + this->actor.update = Boss07_Mask_Update; + this->actor.draw = Boss07_Mask_Draw; + Effect_Add(globalCtx, &this->effectIndex, 4, 0, 0, &D_80A07F64); + D_80A09A5C = this; + if (gSaveContext.eventInf[6] & 2) { + this->actor.world.pos.x = 0.0f; + this->actor.world.pos.y = sREG(17) + 277.0f; + this->actor.world.pos.z = -922.5f; + func_809FFA04(this, globalCtx); + this->unk_164.x = 0.0f; + this->unk_164.y = 200.0f; + this->unk_164.z = 0.0f; + this->unk_170 = 0.0f; + this->timers[0] = 50; + this->timers[2] = 200; + this->unk_1888 = 50; + this->actor.flags |= 1; + D_80A09A71 = 20; + } else { + func_80A016E4(this, globalCtx); + } + Collider_InitAndSetQuad(globalCtx, &this->quad1, &this->actor, &D_80A07C3C); + Collider_InitAndSetQuad(globalCtx, &this->quad2, &this->actor, &D_80A07C8C); + this->actor.colChkInfo.health = 14; + for (i = 0; i < 4; i++) { + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BOSS_07, 0.0f, 0.0f, 0.0f, 0, 0, 0, + D_80A07F54[i]); + } + } + } else if ((this->actor.params == 20) || (this->actor.params == 21)) { + Actor_SetScale(&this->actor, 0.015000001f); + SkelAnime_InitSV(globalCtx, &this->skelAnime1, &D_060099A0, &D_0600A6AC, this->jointTable1, + this->morphTable1, 25); + if (this->actor.params == 21) { + this->timers[0] = this->actor.world.rot.z; + this->actor.world.rot.z = 0; + this->actor.update = Boss07_Afterimage_Update; + this->actor.draw = Boss07_Afterimage_Draw; + this->actor.flags &= ~1; + } else { + this->actor.colChkInfo.damageTable = &D_80A079A0; + this->actor.colChkInfo.health = 30; + this->actor.update = Boss07_Incarnation_Update; + this->actor.draw = Boss07_Incarnation_Draw; + Collider_InitAndSetJntSph(globalCtx, &this->sph1, &this->actor, &D_80A07E68, this->sphElems1); + ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 80.0f); + this->unk_ABD2 = this->actor.shape.rot.z; + if (this->unk_ABD2 != 0) { + func_809FCC70(this, globalCtx); + } else { + func_809FD5F8(this, globalCtx); + this->unk_14A = 1; + this->unk_17B8[1] = 1.0f; + this->unk_17B8[2] = 1.0f; + this->unk_17B8[3] = 1.0f; + this->unk_17B8[0] = 1.0f; + globalCtx->envCtx.unk_DC = 0.0f; + } + this->unk_17E0 = 1.0f; + this->unk_17E4 = 1.0f; + this->unk_17F0 = 1.0f; + this->unk_17F4 = 1.0f; + } + } else { + D_80A09A54 = this; + this->actor.colChkInfo.health = 40; + this->actor.colChkInfo.damageTable = &D_80A079C0; + Actor_SetScale(&this->actor, 0.01f); + this->unk_ABD2 = this->actor.shape.rot.z; + if (this->unk_ABD2 != 0) { + func_809F5E14(this, globalCtx); + } else { + func_809F7400(this, globalCtx, 50); + this->unk_77C = 1.0f; + func_801A89A8(0x8069); + } + SkelAnime_InitSV(globalCtx, &this->skelAnime1, &D_060335F0, &D_0603CBD0, this->jointTable1, + this->morphTable1, 28); + Collider_InitAndSetJntSph(globalCtx, &this->sph1, &this->actor, &D_80A07BCC, this->sphElems1); + Collider_InitAndSetJntSph(globalCtx, &this->sph2, &this->actor, &D_80A07C2C, this->sphElems2); + Collider_InitAndSetCylinder(globalCtx, &this->cyl1, &this->actor, &D_80A07BDC); + this->unk_17E0 = 1.0f; + this->unk_794 = 0.7f; + this->unk_FA0 = 0.7f; + this->unk_798 = 2.0f; + this->unk_FA4 = 2.0f; + this->unk_79C = 0.0f; + this->unk_FA8 = 0.0f; + this->unk_790 = -15.0f; + this->unk_F9C = -15.0f; + + D_80A09A50 = 44; + } + } +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Init.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Destroy.s") +void Boss07_Destroy(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F5E14.s") + switch (this->actor.params) { + case 30: + Collider_DestroyQuad(globalCtx, &this->quad1); + Collider_DestroyQuad(globalCtx, &this->quad2); + case 180: + Effect_Destroy(globalCtx, this->effectIndex); + break; + } +} + +void func_809F5E14(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_809F5E88; + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_06023DAC, 0.0f); + this->actor.flags &= ~1; + this->unk_17D8 = 0x7F00; + this->unk_15C = 20; + this->unk_17E8 = 5120.0f; +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F5E88.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F64F4.s") +void func_809F64F4(Boss07* this, GlobalContext* globalCtx) { + s32 i; + + func_801A89A8(0x100100FF); + func_809F4FAC(globalCtx); + this->actionFunc = func_809F65F4; + this->unk_794 = 0.7f; + this->unk_FA0 = 0.7f; + this->unk_798 = 2.0f; + this->unk_FA4 = 2.0f; + this->unk_79C = 0.0f; + this->unk_FA8 = 0.0f; + this->unk_790 = -15.0f; + this->unk_F9C = -15.0f; + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06022BB4, 0.0f); + this->actor.flags &= ~1; + this->unk_ABD0 = 0; + this->unk_ABC8 = 0; + if (D_80A09A60[0] != NULL) { + for (i = 0; i < 4; i++) { + D_80A09A60[i]->unk_14E = 2; + } + } + this->unk_15C = 1000; +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F65F4.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F7400.s") +void func_809F7400(Boss07* this, GlobalContext* globalCtx, s16 arg2) { + this->actionFunc = func_809F748C; + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_0603CBD0, -10.0f); + if (arg2 != 0) { + this->timers[0] = arg2; + } else { + this->timers[0] = Rand_ZeroFloat(30.0f); + } + this->actor.flags |= 1; +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F748C.s") @@ -539,7 +1101,15 @@ extern UNK_TYPE D_06040930; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F8D04.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F8DEC.s") +void func_809F8DEC(Boss07* this, GlobalContext* globalCtx) { + if (this->actionFunc != func_809F91D4) { + this->actionFunc = func_809F91D4; + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603B330, -10.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_0603B330); + } + this->unk_158 = 10; + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE_OLD); +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F8E68.s") @@ -547,19 +1117,353 @@ extern UNK_TYPE D_06040930; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F91D4.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F9280.s") +void func_809F9280(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { + if ((s8)this->actor.colChkInfo.health >= 0) { + this->actor.colChkInfo.health -= arg2; + } + if ((s8)this->actor.colChkInfo.health <= 0) { + if (gGameInfo->data[1267] != 0) { + func_8019F1C0(&D_80A09A40, NA_SE_EN_LAST3_VOICE_DEAD_OLD); + } else { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_DEAD_OLD); + } + this->unk_148 = 1; + Enemy_StartFinishingBlow(globalCtx, &this->actor); + } else { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE2_OLD); + if (this->actionFunc != func_809F93DC) { + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0601DEB4, -10.0f); + this->actionFunc = func_809F93DC; + this->unk_1D4 = SkelAnime_GetFrameCount(&D_0601DEB4); + this->unk_ABCC = 0; + } else if (arg3 == 14) { + if (this->skelAnime1.animCurrentFrame <= (this->unk_1D4 - 5.0f)) { + this->unk_158 = 30; + } else { + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0601DEB4, -5.0f); + } + } + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F93DC.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F94AC.s") +void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx) { + s32 i; + s32 sp98 = -1; + Player* player = PLAYER; + f32 dx; + f32 dy; + f32 dz; + Vec3f sp7C; + + if ((arg1 >= 50.0f) && (this->unk_15A == 0)) { + Actor* phi_s1 = globalCtx->actorCtx.actorList[6].first; + + while (phi_s1 != NULL) { + if (phi_s1->id == ACTOR_OBJ_TSUBO) { + for (i = 10; i < D_80A09A50; i += 3) { + dx = phi_s1->world.pos.x - arg0[i].x; + dy = phi_s1->world.pos.y + 10.0f - arg0[i].y; + dz = phi_s1->world.pos.z - arg0[i].z; + + if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < (gGameInfo->data[1286] + 60.0f)) { + ((ObjTsubo*)phi_s1)->unk19B = 1; + func_809F4FF8(globalCtx, &phi_s1->world.pos, 10); + } + } + } + phi_s1 = phi_s1->next; + } + } + if ((arg1 >= 50.0f) && (this->unk_15A == 0) && (!(player->stateFlags3 & 0x100) || (this->unk_14E == 4))) { + if ((func_800B64FC(globalCtx, 1000.0f, &this->actor.world.pos, &sp98) >= 0.0f) && (sp98 != 1)) { + sp98 = -1; + } + for (i = 10; i < D_80A09A50; i += 3) { + dx = player->actor.world.pos.x - arg0[i].x; + dy = player->actor.world.pos.y + 30.0f - arg0[i].y; + dz = player->actor.world.pos.z - arg0[i].z; + + dy *= 1.75f; + + if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 140.0f) { + if ((this->actionFunc == func_809F86B8) && (sp98 != 1) && !(player->stateFlags3 & 0x1000) && + (520.0f <= this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer <= 900.0f)) { + if (globalCtx->grabPlayer(globalCtx, player)) { + f32 dx1; + f32 dy1; + f32 dz1; + f32 dxz1; + + player->actor.parent = &this->actor; + func_801A5CFC(0x6805, &player->actor.projectedPos, 4, &D_801DB4B0, &D_801DB4B0, &D_801DB4B8); + this->unk_F7C = 0; + this->unk_F7E = ((this->actor.xzDistToPlayer - 300.0f) / 22.0f) + 10.0f; + dx1 = player->actor.world.pos.x - this->unk_7A0.x; + dy1 = player->actor.world.pos.y - this->unk_7A0.y + 50.0f; + dz1 = player->actor.world.pos.z - this->unk_7A0.z; + 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->unk_79C = 0.0f; + play_sound(NA_SE_EN_LAST3_GET_LINK_OLD); + } + } else if ((player->stateFlags1 & 0x400000) && func_809F4C40(this, globalCtx)) { + player->unk_B80 = 10.0f; + player->unk_B84 = this->actor.yawTowardsPlayer; + play_sound(NA_SE_IT_SHIELD_BOUND); + this->unk_15A = 4; + } else { + func_800B8D50(globalCtx, NULL, 5.0f, this->actor.shape.rot.y, 0.0f, 8); + this->unk_15A = 20; + } + sp7C = player->actor.world.pos; + + sp7C.x += randPlusMinusPoint5Scaled(30.0f); + sp7C.y += randPlusMinusPoint5Scaled(30.0f) + 20.0f; + sp7C.z += randPlusMinusPoint5Scaled(30.0f); + EffectSsHitMark_SpawnFixedScale(globalCtx, 0, &sp7C); + func_809F4FF8(globalCtx, &player->actor.world.pos, 7); + return; + } + } + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F99C4.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F9CEC.s") +void func_809F9CEC(Boss07* this, GlobalContext* globalCtx) { + Vec3f sp8C; + Vec3f sp80; + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F9E94.s") + Audio_PlaySoundAtPosition(globalCtx, this->unk_334, 0x1E, NA_SE_EV_ICE_BROKEN); + for (i = 0; i < 30; i++) { + sp80.x = randPlusMinusPoint5Scaled(7.0f); + sp80.z = randPlusMinusPoint5Scaled(7.0f); + sp80.y = Rand_ZeroFloat(6.0f) + 4.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Update.s") + sp8C.x = this->unk_334[i / 2].x + sp80.x; + sp8C.y = this->unk_334[i / 2].y + sp80.y; + sp8C.z = this->unk_334[i / 2].z + sp80.z; + EffectSsEnIce_Spawn(globalCtx, &sp8C, Rand_ZeroFloat(1.0f) + 1.5f, &sp80, &D_80A07FD4, &D_80A07FCC, &D_80A07FD0, + 30); + } +} + +void func_809F9E94(Boss07* this, GlobalContext* globalCtx) { + DECR(this->unk_1806); + + switch (this->unk_1805) { + case 0: + this->unk_1804 = 0; + this->unk_1806 = 0; + this->unk_1800 = 0.0f; + break; + case 1: + this->unk_1804 = 0; + this->unk_1806 = 40; + this->unk_1800 = 1.0f; + this->unk_17F8 = 0.0f; + this->unk_1805++; + func_800BCB70(&this->actor, 0x4000, 120, 0, 60); + case 2: + if (this->unk_1806 == 0) { + Math_ApproachZeroF(&this->unk_1800, 1.0f, 0.02f); + if (this->unk_1800 == 0.0f) { + this->unk_1805 = 0; + } + } else { + Math_ApproachF(&this->unk_17F8, 1.0f, 0.1f, 0.5f); + } + break; + case 10: + this->unk_1804 = 11; + this->unk_1806 = 40; + this->unk_1800 = 1.0f; + this->unk_17FC = 1.0f; + this->unk_17F8 = 0.0f; + this->unk_1805++; + case 11: + if (this->unk_1806 == 0) { + func_809F9CEC(this, globalCtx); + this->unk_1805 = 0; + } else { + if (this->unk_1806 == 50) { + this->unk_1804 = 10; + } + Math_ApproachF(&this->unk_17F8, 1.0f, 1.0f, 0.08f); + Math_ApproachF(&this->unk_17FC, 1.0f, 0.05f, 0.05f); + } + break; + case 20: + this->unk_1804 = 20; + this->unk_1806 = 40; + this->unk_17F8 = 1.0f; + goto test_label; + case 30: + this->unk_1804 = 21; + this->unk_1806 = 40; + this->unk_17F8 = 3.0f; + test_label: + this->unk_1800 = 1.0f; + this->unk_1805 = 21; + case 21: + if (this->unk_1806 == 0) { + Math_ApproachZeroF(&this->unk_17F8, 1.0f, 0.03f); + if (this->unk_17F8 == 0.0f) { + this->unk_1805 = 0; + this->unk_1800 = 0.0f; + } + } else { + Math_ApproachF(&this->unk_17F8, 1.5f, 0.5f, 0.5f); + } + break; + case 40: + this->unk_1804 = 30; + this->unk_1806 = 50; + this->unk_1800 = 1.0f; + this->unk_17F8 = (gGameInfo->data[1266] * 0.1f) + 1.0f; + this->unk_1805++; + case 41: + if (this->unk_1806 == 0) { + Math_ApproachZeroF(&this->unk_17F8, 1.0f, 0.05f); + if (this->unk_17F8 == 0.0f) { + this->unk_1805 = 0; + this->unk_1800 = 0.0f; + } + } + break; + } +} + +void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + s32 i; + Player* sp78 = PLAYER; + + globalCtx->envCtx.unk_C1 = 2; + 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; + Math_Vec3f_Copy(&D_80A09A40, &this->actor.projectedPos); + if (gGameInfo->data[1311] == 0) { + this->unk_174 = 0; + this->unk_14C += 1; + Actor_SetScale(&this->actor, 0.015f); + Math_ApproachZeroF(&this->unk_184, 1.0f, 0.02f); + Math_ApproachZeroF(&this->unk_188, 1.0f, 0.02f); + for (i = 0; i < 3; i++) { + DECR(this->timers[i]); + } + DECR(this->unk_15A); + DECR(this->unk_158); + DECR(this->unk_15C); + DECR(this->unk_15E); + DECR(this->unk_156); + + Math_ApproachZeroF(&this->unk_32C, 1.0f, 0.2f); + Math_ApproachZeroF(&this->unk_330, 1.0f, 0.04f); + this->actionFunc(this, globalCtx); + Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + 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)) { + play_sound(NA_SE_EN_LAST3_ROD_FLOOR_OLD); + } + } + } else { + D_80A09A50 = 45; + } + func_809F94AC(this->unk_7AC, this->unk_79C, this, globalCtx); + func_809F94AC(this->unk_FB8, this->unk_FA8, this, globalCtx); + if (this->unk_158 != 0) { + for (i = 0; i < 11; i++) { + this->sph1.elements[i].info.bumperFlags &= ~2; + } + } + func_809F99C4(this, globalCtx); + if (this->unk_15C != 0) { + this->unk_778 = 0; + } + 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)) { + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->sph2.base); + } else { + if ((this->unk_174 != 0) && func_809F4C40(this, globalCtx)) { + if ((sp78->unk_D57 == 4) && (sp78->itemActionParam != 0xC)) { + if ((this->actor.xzDistToPlayer >= 400.0f) && (Rand_ZeroOne() < 0.5f)) { + func_809F7AB4(this, globalCtx); + } else { + func_809F51E8(this, globalCtx, 0); + } + } + if ((sp78->unk_ADC != 0) && (this->actor.xzDistToPlayer <= 150.0f)) { + func_809F51E8(this, globalCtx, 0); + } + } + if ((this->actionFunc != func_809F91D4) && (this->actionFunc != func_809F93DC)) { + if ((sp78->stateFlags3 & 0x00001000) && !(sp78->stateFlags3 & 0x00080000) && + (this->actor.xzDistToPlayer <= 250.0f)) { + func_809F51E8(this, globalCtx, 0); + } + } + } + if (this->unk_174 != 0) { + func_809F52CC(this, globalCtx); + } + func_809F5494(this, globalCtx); + if ((gGameInfo->data[1336] != 0) || (this->unk_148 != 0)) { + gGameInfo->data[1336] = 0; + this->unk_148 = 0; + func_809F64F4(this, globalCtx); + } + if (this->unk_1D8 != 0) { + u16* sp74 = SEGMENTED_TO_VIRTUAL(D_06040930); + u16* sp70 = SEGMENTED_TO_VIRTUAL(D_0603ED30); + u16* sp6C = SEGMENTED_TO_VIRTUAL(D_06040130); + u16* sp68 = SEGMENTED_TO_VIRTUAL(D_06041B30); + u16* sp64 = SEGMENTED_TO_VIRTUAL(D_0603F130); + u16* sp60 = SEGMENTED_TO_VIRTUAL(D_06042330); + u16* sp5C = SEGMENTED_TO_VIRTUAL(D_06040B30); + u16* sp58 = SEGMENTED_TO_VIRTUAL(D_06043330); + u16* sp54 = SEGMENTED_TO_VIRTUAL(D_0603DD30); + + for (i = 0; i < this->unk_1D8; i++) { + s32 sp50; + s32 sp4C; + s32 sp48; + s32 sp44; + + sp44 = Rand_ZeroFloat(255.99f); + sp4C = Rand_ZeroFloat(511.99f); + sp48 = Rand_ZeroFloat(1023.99f); + sp50 = Rand_ZeroFloat(2047.99f); + + sp74[sp44] = sp70[sp4C] = sp6C[sp48] = sp68[sp48] = sp64[sp50] = sp60[sp50] = sp5C[sp50] = sp58[sp50] = + sp54[sp50] = 0; + } + } + func_809F9E94(this, globalCtx); + if ((this->unk_156 == 1) || (this->unk_156 == 4)) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_WALK2_OLD); + } + if (sp78->actor.world.pos.y > 100.0f) { + if (sp78->actor.world.pos.z < gGameInfo->data[1330] + -850.0f) { + sp78->actor.world.pos.z = gGameInfo->data[1330] + -850.0f; + } + } + if (sp78->actor.world.pos.y < -300.0f) { + sp78->actor.world.pos.x = sp78->actor.world.pos.y = sp78->actor.world.pos.z = 0.0f; + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FAA44.s") @@ -575,35 +1479,205 @@ extern UNK_TYPE D_06040930; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FBB9C.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FBF94.s") +#ifdef NON_MATCHING +void func_809FBF94(Boss07 *this, GlobalContext *globalCtx) { + s32 pad; + s32 pad2; + f32 sp54; + f32 sp50; + Player *sp4C = PLAYER; + // GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Draw.s") + OPEN_DISPS(globalCtx->state.gfxCtx); + if (this->unk_AB44 > 0.0f) { + func_8012C2DC(globalCtx->state.gfxCtx); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)(gGameInfo->data[1588] + 255)); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 0); + gSPDisplayList(POLY_XLU_DISP++, D_04023348); + + if (sp4C->transformation == 1) { + sp54 = -10.0f; + sp50 = -20.0f; + } else { + sp54 = sp50 = 0.0f; + } + if (sp4C->transformation == 0) { + sp54 -= 43.0f; + } + + SysMatrix_InsertTranslation(sp4C->actor.world.pos.x, sp4C->actor.world.pos.y + func_800B6FC8(sp4C) - 20.0f + sp54 + gGameInfo->data[1596], sp4C->actor.world.pos.z + gGameInfo->data[1597] - 15.0f + sp50, 0); + SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); + + Matrix_Scale(this->unk_AB44, this->unk_AB44, this->unk_AB44, 1); + SysMatrix_InsertZRotation_s(globalCtx->gameplayFrames * 0x40, 1); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + gSPDisplayList(POLY_XLU_DISP++, D_04023428); + } + CLOSE_DISPS(gfxCtx); +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FBF94.s") +#endif + +void Boss07_Wrath_Draw(Actor *thisx, GlobalContext *globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + u8 *sp54 = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(u8[0x40][0x40])); + + OPEN_DISPS(globalCtx->state.gfxCtx); + Vec3f sp58; + + func_8012C28C(globalCtx->state.gfxCtx); + func_8012C2DC(globalCtx->state.gfxCtx); + if ((this->unk_15E % 2) != 0) { + POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); + } + SysMatrix_InsertYRotation_f(this->unk_184, 1); + SysMatrix_RotateStateAroundXAxis(this->unk_188); + func_801343C0(globalCtx, this->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, (s32) this->skelAnime1.dListCount, func_809FB504, func_809FB55C, func_809FB728, &this->actor); + POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); + + if (((gGameInfo->data[1311] == 0) || (gGameInfo->data[1311] == 2)) && (this->unk_149 != 0)) { + func_809FAA44(this, globalCtx, &this->unk_7A0, this->unk_7AC, this->unk_A04, this->unk_C5C, this->unk_790, this->unk_794, this->unk_798, this->unk_79C, &this->unk_788, this->unk_F7E, this->unk_77C, 0); + func_809FAA44(this, globalCtx, &this->unk_FAC, this->unk_FB8, this->unk_1210, this->unk_1468, this->unk_F9C, this->unk_FA0, this->unk_FA4, this->unk_FA8, &this->unk_F94, 0, this->unk_77C, 1); + } + func_809FB114(this, globalCtx, this->unk_7AC, this->unk_A04, this->unk_77C, 0); + func_809FB114(this, globalCtx, this->unk_FB8, this->unk_1210, this->unk_77C, 1); + if (this->unk_AB48 == 0) { + func_809FC8B0(sp54, this, globalCtx); + func_809FC960(sp54, this, globalCtx); + } + func_809FB7D4(this, globalCtx); + sp58.x = this->unk_334[2].x; + sp58.y = this->unk_334[2].y - 30.0f + 50.0f; + sp58.z = this->unk_334[2].z; + func_809FBB9C(this, globalCtx, &sp58); + func_800BE680(globalCtx, &this->actor, this->unk_334, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, this->unk_1804); + this->unk_149 = 0; + CLOSE_DISPS(globalCtx->state.gfxCtx); +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FC4C0.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FC8B0.s") +void func_809FC8B0(u8 *arg0, Boss07 *this, GlobalContext *globalCtx) { + s32 i; + s32* temp = (s32*) arg0; + for(i = 0; i < 0x400; i++, temp++) { + *temp = 0; + } + SysMatrix_SetStateXRotation(1.0f); + for(i = 0; i < 6; i++) { + func_809FC4C0(this, arg0, i / 5.0f); + } +} + +#ifdef NON_MATCHING +void func_809FC960(u8 *arg0, Boss07 *thisx, GlobalContext *globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + GraphicsContext* pad3 = globalCtx->state.gfxCtx; + + OPEN_DISPS(pad3); + f32 phi_f0; + + func_8012C28C(globalCtx->state.gfxCtx); + phi_f0 = (400.0f - this->actor.world.pos.y) * 0.0025f; + phi_f0 = CLAMP_MIN(phi_f0, 0.0f); + 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); + SysMatrix_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); + gSPDisplayList(POLY_OPA_DISP++, D_0602EF68); + gDPLoadTextureBlock(POLY_OPA_DISP++, arg0, 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); + gSPDisplayList(POLY_OPA_DISP++, D_0602EF88); + CLOSE_DISPS(pad3); +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FC960.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FCBC8.s") +void func_809FCBC8(Boss07* this) { + s32 phi_v0 = (Rand_ZeroOne() < 0.5f) ? 0x4000 : -0x4000; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FCC70.s") + Matrix_RotateY(this->actor.yawTowardsPlayer + phi_v0, MTXMODE_NEW); + SysMatrix_GetStateTranslationAndScaledZ(200.0f, &this->unk_164); + this->timers[1] = 30; + this->unk_164.x += this->actor.world.pos.x; + this->unk_164.z += this->actor.world.pos.z; + this->unk_170 = 20000.0f; +} + +void func_809FCC70(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_809FCCCC; + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_06002D84, 0.0f); + this->actor.flags &= ~1; + this->unk_17D8 = 0x6E00; +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FCCCC.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FD5F8.s") +void func_809FD5F8(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_809FD710; + this->unk_14E = Rand_ZeroFloat(2.999f); + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, D_80A0818C[this->unk_14E], -10.0f); + this->actor.flags |= 1; + this->timers[0] = Rand_ZeroFloat(50.0f) + 50.0f; +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FD710.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FD818.s") +void func_809FD818(Boss07* this, GlobalContext* globalCtx, s16 arg2) { + if (this->actionFunc != func_809FD89C) { + this->actionFunc = func_809FD89C; + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06009C7C, -10.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_06009C7C); + } + this->unk_158 = 10; + this->timers[0] = arg2; + this->timers[1] = 12; +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FD89C.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FD984.s") +void func_809FD984(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { + if (this->actionFunc != func_809FDAB0) { + this->actionFunc = func_809FDAB0; + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06000D0C, -2.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_06000D0C); + } else if (arg3 == 14) { + if (this->skelAnime1.animCurrentFrame <= (this->unk_1D4 - 5.0f)) { + this->unk_158 = 30; + this->unk_15C = 30; + } else { + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, (AnimationHeader*)&D_06000D0C, -2.0f); + } + } + + if (this->actor.colChkInfo.health != 0) { + 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_15C = 100; + this->unk_158 = 100; + Enemy_StartFinishingBlow(globalCtx, &this->actor); + return; + } + } + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_DAMAGE2_OLD); +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FDAB0.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FDB2C.s") +void func_809FDB2C(Boss07* this, GlobalContext* globalCtx) { + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_0600A400, -2.0f); + this->actionFunc = func_809FDBA0; + this->timers[0] = Rand_ZeroFloat(100.0f) + 150.0f; + func_809FCBC8(this); +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FDBA0.s") @@ -623,49 +1697,757 @@ extern UNK_TYPE D_06040930; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FE524.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FE6B0.s") +void func_809FE6B0(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_809FE734; + func_809F4FAC(globalCtx); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06000D0C, -2.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_06000D0C); + this->unk_ABD0 = 0; + this->unk_ABC8 = 0; + this->actor.flags &= ~1; + this->unk_15C = 20; +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FE734.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FEE70.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FF0E4.s") +void Boss07_Afterimage_Update(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FF12C.s") + if (DECR(this->timers[0]) == 0) { + Actor_MarkForDeath(&this->actor); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FF5CC.s") +#ifdef NON_MATCHING +void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + s32 i; + s32 pad; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FF678.s") + this->actor.hintId = 51; + this->unk_14C++; + Math_Vec3f_Copy(&D_80A09A40, &this->actor.projectedPos); + if (this->unk_14A == 1) { + 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; + this->unk_14B++; + if (this->unk_14B >= 8) { + this->unk_14B = 0; + } + } + globalCtx->envCtx.unk_C2 = D_80A08198[this->unk_14B]; + globalCtx->envCtx.unk_C1 = D_80A081A0[this->unk_14B]; + } + Math_ApproachF(&globalCtx->envCtx.unk_DC, 0.0f, 1.0f, 0.03f); + if (gGameInfo->data[1311] == 0) { + this->unk_174 = 0; + this->actor.shape.shadowAlpha = 130; + for (i = 0; i < 3; i++) { + DECR(this->timers[i]); + } + DECR(this->unk_15C); + DECR(this->unk_15E); + DECR(this->unk_158); + DECR(this->unk_18D6); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FF6B0.s") + Math_ApproachZeroF(&this->unk_330, 1.0f, 0.04f); + 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) || (gGameInfo->data[1336] != 0)) { + gGameInfo->data[1336] = 0; + this->unk_148 = 0; + func_801A89A8(0x100100FF); + func_809FE6B0(this, globalCtx); + } + } + if (this->unk_158 != 0) { + for (i = 0; i < 11; i++) { + this->sph1.elements[i].info.bumperFlags &= ~2; + } + } + func_809FEE70(this, globalCtx); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->sph1.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->sph1.base); + if (this->actionFunc != func_809FE524) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 1, 0x1000); + } + if ((this->unk_18D6 != 0) && !(this->unk_14C & 1)) { + Boss07* temp_v0_12 = (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 (temp_v0_12 != NULL) { + for (i = 0; i < 25; i++) { + temp_v0_12->skelAnime1.limbDrawTbl[i] = this->skelAnime1.limbDrawTbl[i]; + } + } + } + func_809F9E94(this, globalCtx); +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Incarnation_Update.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FF810.s") +void Boss07_Afterimage_Draw(Actor *thisx, GlobalContext *globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + Boss07 *sp34 = (Boss07*) this->actor.parent; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FF900.s") + OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); + POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 0, 0, 100, 155, 900, 1099); + SkelAnime_DrawSV(globalCtx, sp34->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, sp34->skelAnime1.dListCount, NULL, NULL, &this->actor); + POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); + CLOSE_DISPS(globalCtx->state.gfxCtx); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FFA04.s") +s32 func_809FF678(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { + Boss07* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FFA80.s") + if (limbIndex == 24) { + rot->y += this->unk_17D8; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FFE64.s") +void func_809FF6B0(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3s *rot, Actor *thisx) { + Boss07* this = THIS; + Vec3f sp28; + s8 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FFEAC.s") + if (limbIndex == 0x18) { + SysMatrix_GetStateTranslation(&this->actor.focus.pos); + } + i = D_80A0826C[limbIndex]; + if (i >= 0) { + SysMatrix_GetStateTranslation(&this->unk_334[i]); + } + i = D_80A081A8[limbIndex]; + if (i >= 0) { + if (this->unk_158 != 0) { + SysMatrix_GetStateTranslationAndScaledZ(100000.0f, &sp28); + } else { + SysMatrix_MultiplyVector3fByState(&D_80A081E8[i], &sp28); + } + func_809F4BB0(i, &this->sph1, &sp28); + } + if (limbIndex == 8) { + SysMatrix_GetStateTranslation(&this->unk_1788[0]); + } + if (limbIndex == 0x17) { + SysMatrix_GetStateTranslation(&this->unk_1788[1]); + } + if (limbIndex == 0xD) { + SysMatrix_GetStateTranslation(&this->unk_17AC); + } + if (limbIndex == 0x12) { + SysMatrix_GetStateTranslation(&this->unk_17A0); + } + i = D_80A081C8[limbIndex]; + if (i >= 0) { + f32 temp_f12 = this->unk_17B8[i]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A0021C.s") + Matrix_Scale(temp_f12, temp_f12, temp_f12, 1); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A00274.s") +void func_809FF810(GlobalContext *globalCtx, s32 limbIndex, Actor *thisx) { + Boss07* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A00484.s") + if (limbIndex == 3) { + Matrix_Scale(this->unk_17F4, this->unk_17F0, 1.0f, 1); + } + 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 == 5) || (limbIndex == 7) || (limbIndex == 8) || (limbIndex == 0x14) || (limbIndex == 0x16) || (limbIndex == 0x17)) { + Matrix_Scale(1.0f, this->unk_17E4, this->unk_17E4, 1); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A00554.s") +void Boss07_Incarnation_Draw(Actor *thisx, GlobalContext *globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A006D0.s") + OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); + func_8012C2DC(globalCtx->state.gfxCtx); + if ((this->unk_15E % 2) != 0) { + POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); + } + func_801343C0(globalCtx, this->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, this->skelAnime1.dListCount, func_809FF678, func_809FF6B0, func_809FF810, &this->actor); + POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); + func_800BE680(globalCtx, &this->actor, this->unk_334, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, this->unk_1804); + CLOSE_DISPS(globalCtx->state.gfxCtx); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A006F4.s") +void func_809FFA04(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_809FFA80; + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_06019E48, -20.0f); + this->timers[2] = Rand_ZeroFloat(150.0f) + 60.0f; + this->unk_1870 = 1.0f; +} +void func_809FFA80(Boss07* this, GlobalContext* globalCtx) { + s16 sp36; + s16 sp34; + f32 sp30; + f32 sp2C; + f32 sp28; + s32 pad; + Player* player = PLAYER; + + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + Audio_PlayActorSound2(&this->actor, 0x31E4); + if (this->timers[0] == 0) { + if (this->timers[2] == 0) { + if (((s8)this->actor.colChkInfo.health < 9) && (player->transformation != 0) && (Rand_ZeroOne() < 0.75f)) { + func_80A006F4(this, globalCtx); + } else { + func_809FFE64(this, globalCtx); + } + } else if (Rand_ZeroOne() < 0.15f) { + this->unk_18C = 2.0f; + this->timers[0] = Rand_ZeroFloat(50.0f) + 30.0f; + } else { + func_809F4D10(&this->unk_164, 500.0f); + this->unk_164.y = Rand_ZeroFloat(350.0f) + 100.0f; + this->timers[0] = Rand_ZeroFloat(50.0f) + 20.0f; + this->unk_170 = 0.0f; + this->unk_18C = Rand_ZeroFloat(12.0f) + 3.0f; + } + } + sp30 = this->unk_164.x - this->actor.world.pos.x; + sp2C = this->unk_164.y - this->actor.world.pos.y; + 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); + 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); + Math_ApproachF(&this->actor.speedXZ, this->unk_18C, 1.0f, 1.0f); + if (this->timers[1] != 0) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x3000); + } else if (this->unk_18C < 7.0f) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x2000); + } else { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 5, 0x2000); + } + if ((player->unk_D57 == 4) && (Rand_ZeroOne() < 0.8f)) { + this->timers[1] = 20; + } + 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) || (gGameInfo->data[1336] != 0)) { + gGameInfo->data[1336] = 0; + this->unk_148 = 0; + func_801A89A8(0x100100FF); + func_80A025AC(this, globalCtx); + } +} + +void func_809FFE64(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_809FFEAC; + this->unk_14E = 0; + this->unk_ABD0 = 0; + this->timers[0] = 30; + this->unk_18D4 = 0; + Audio_PlayActorSound2(&this->actor, 0x39D4); +} + +void func_809FFEAC(Boss07* this, GlobalContext* globalCtx) { + s16 sp36; + s16 sp34; + f32 sp30; + f32 sp2C; + f32 sp28; + f32 sp24; + Player* sp20 = PLAYER; + + this->actor.shape.rot.z -= this->unk_18D4; + switch (this->unk_14E) { + case 0: + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); + func_809F4CBC(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->actor.world.rot.x = 0; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + this->timers[0] = 100; + this->timers[1] = 20; + this->unk_170 = 0.0f; + } + break; + case 1: + Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 0xA, 0x400); + Math_ApproachS(&this->unk_18D4, 0x2000, 1, 0x200); + if (this->timers[1] != 0) { + this->unk_164.x = sp20->actor.world.pos.x; + this->unk_164.y = sp20->actor.world.pos.y + 10.0f; + this->unk_164.z = sp20->actor.world.pos.z; + } else { + Audio_PlayActorSound2(&this->actor, 0x31E6); + } + sp30 = this->unk_164.x - this->actor.world.pos.x; + sp2C = this->unk_164.y - this->actor.world.pos.y; + sp28 = this->unk_164.z - this->actor.world.pos.z; + sp34 = Math_Atan2S(sp30, sp28); + sp24 = sqrtf(SQ(sp30) + SQ(sp28)); + sp36 = Math_Atan2S(sp2C, sp24); + Math_ApproachS(&this->actor.world.rot.y, sp34, 0xA, this->unk_170); + Math_ApproachS(&this->actor.world.rot.x, sp36, 0xA, this->unk_170); + Math_ApproachF(&this->unk_170, 3000.0f, 1.0f, 100.0f); + Math_ApproachF(&this->actor.speedXZ, 20.0f, 1.0f, 2.0f); + if (((this->unk_ABD0 == 0) && (sp24 < 100.0f)) || (this->timers[0] == 0)) { + if (Rand_ZeroOne() < 0.25f) { + this->unk_14E = 2; + this->timers[0] = 30; + } else { + func_809F4D10(&this->unk_164, 500.0f); + this->unk_164.y = Rand_ZeroFloat(100.0f) + 100.0f; + if (Rand_ZeroOne() < 0.3f) { + this->timers[1] = 20; + Audio_PlayActorSound2(&this->actor, 0x39E5); + this->unk_ABD0 = 1; + } else { + this->timers[1] = 0; + this->unk_ABD0 = 0; + } + this->timers[0] = 50; + this->unk_170 = 0.0f; + } + } + break; + case 2: + Math_ApproachS(&this->unk_18D4, 0, 1, 0x100); + Math_ApproachS(&this->actor.world.rot.x, 0x2000, 0xA, 0x7D0); + func_809F4CBC(this, 0.5f); + if (this->timers[0] == 0) { + func_809FFA04(this, globalCtx); + } + } +} + +void func_80A0021C(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_80A00274; + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_0600AE40, -10.0f); + this->timers[0] = 100; + this->unk_170 = 0.0f; +} + +void func_80A00274(Boss07* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + func_8019F1C0(&D_80A09A40, 0x301B); + func_809F4CBC(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); + if (this->actor.world.pos.y > 51.0f) { + Audio_PlayActorSound2(&this->actor, 0x31D7); + } + 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->unk_170, 15.0f, 1.0f, 1.0f); + + if ((this->timers[0] > 30) || ((this->timers[0] & 2) != 0)) { + this->unk_1884 = 1; + } + if (this->timers[0] == 0) { + func_809FFA04(this, globalCtx); + this->timers[2] = 100; + } +} + +void func_80A00484(Boss07* this, GlobalContext* globalCtx, u8 arg2, Actor* arg3) { + Player* player = PLAYER; + + this->actionFunc = func_80A00554; + this->timers[0] = 40; + if (arg2) { + this->actor.speedXZ = 30.0f; + this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; + this->unk_18D4 = 0x1500; + } else { + if (player->stateFlags3 & 0x200) { + this->actor.speedXZ = 20.0f; + this->actor.velocity.y = 20.0f; + } else { + this->actor.speedXZ = 13.0f; + this->actor.velocity.y = 10.0f; + if (arg3 != NULL) { + this->actor.world.rot.y = arg3->world.rot.y; + } + } + this->unk_18D4 = 0x1000; + } + this->actor.colChkInfo.health -= arg2; + if ((s8)this->actor.colChkInfo.health <= 0) { + this->timers[0] = 30; + } + this->timers[1] = 30; +} + +void func_80A00554(Boss07* this, GlobalContext* globalCtx) { + this->unk_15C = 20; + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + if (this->actor.bgCheckFlags & 1) { + func_809F4CBC(this, 1.0f); + Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 1, 0x1000); + Math_ApproachS(&this->unk_18D4, 0, 1, 0x100); + } else { + this->actor.shape.rot.x += 0x2000; + } + this->actor.shape.rot.z += this->unk_18D4; + if ((this->timers[0] > 30) || ((this->timers[0] & 2) != 0)) { + this->unk_1884 = 1; + } + if ((this->timers[0] == 15) && ((s8)this->actor.colChkInfo.health < 10)) { + this->unk_774 = 1; + } + if (this->timers[0] == 0) { + func_809FFA04(this, globalCtx); + if ((s8)this->actor.colChkInfo.health <= 0) { + this->unk_148 = 1; + Enemy_StartFinishingBlow(globalCtx, &this->actor); + func_801A72CC(&this->actor.projectedPos); + Audio_PlayActorSound2(&this->actor, 0x3A02); + } else { + this->unk_164.x = this->actor.world.pos.x; + this->unk_164.y = 200.0f; + this->unk_164.z = this->actor.world.pos.z; + this->actor.world.rot.x = 0x3000; + this->timers[0] = 50; + this->timers[2] = 100; + this->unk_18C = 6.0f; + this->unk_170 = 0.0f; + } + } +} + +void func_80A006D0(Boss07* this) { + this->unk_188C = 0.0f; + this->unk_1890 = 0.0f; + this->unk_1894 = 0.0f; + this->unk_1898 = 0.0f; + this->unk_18C0 = 0.0f; +} + +void func_80A006F4(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_80A00720; + this->unk_14E = 0; + this->timers[0] = 30; + this->unk_170 = 0.0f; +} + +#ifdef NON_MATCHING +void func_80A00720(Boss07* this, GlobalContext* globalCtx) { + f32 temp_f20; + f32 temp_f22; + f32 temp_f12; + f32 sp180; + f32 phi_f24; + s16 phi_s0; + s16 sp178; + Vec3f sp16C; + Vec3f sp160; + Player* player = PLAYER; + CollisionPoly* sp158; + Vec3f sp14C; + u8 sp14B = 0; + u32 sp144; + + this->unk_15C = 20; + func_809F4CBC(this, 0.5f); + 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; + } else { + phi_f24 = (player->transformation == 4) ? 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); + temp_f20 = player->actor.world.pos.x - this->actor.world.pos.x; + temp_f12 = player->actor.world.pos.y - this->actor.world.pos.y + phi_f24; + temp_f22 = player->actor.world.pos.z - this->actor.world.pos.z; + Math_ApproachS(&this->actor.shape.rot.x, -Math_Atan2S(temp_f12, sqrtf(SQ(temp_f20) + SQ(temp_f22))), phi_s0, + this->unk_170); + Math_ApproachF(&this->unk_170, 4000.0f, 1.0f, 200.0f); + this->unk_1874 = 1; + switch (this->unk_14E) { + case 0: + if (this->timers[0] == 25) { + func_8019F1C0(&D_80A09A40, 0x39D2); + } + if (this->timers[0] == 0) { + this->unk_14E = 1; + this->timers[0] = 6; + this->unk_1898 = 1.0f; + } + break; + case 1: + Math_ApproachF(&this->unk_188C, 1.0f, 1.0f, 0.2f); + if (this->timers[0] == 0) { + this->unk_14E = 2; + this->timers[0] = 8; + } + break; + case 2: + play_sound(0x31D3); + Math_ApproachF(&this->unk_1890, 1.0f, 0.2f, 0.2f); + if (this->timers[0] == 0) { + this->unk_14E = 3; + this->timers[0] = 100; + } + break; + case 3: + case 4: + play_sound(0x31D3); + case 5: + Math_ApproachF(&this->unk_1890, 1.0f, 0.2f, 0.2f); + temp_f20 = player->actor.world.pos.x - this->unk_189C.x; + temp_f12 = player->actor.world.pos.y - this->unk_189C.y + 20.0f; + temp_f22 = player->actor.world.pos.z - this->unk_189C.z; + sp180 = sqrtf(SQ(temp_f20) + SQ(temp_f12) + SQ(temp_f22)); + Math_ApproachF(&this->unk_1894, sp180 * 0.2f, 1.0f, 7.0f); + + if (func_800C55C4(&globalCtx->colCtx, &this->unk_189C, &this->unk_18A8, &sp14C, &sp158, 1, 1, 1, 1, + &sp144) && + (this->unk_14E != 5)) { + Vec3f sp138; + Vec3f sp12C; + Vec3f sp120; + + sp138.x = randPlusMinusPoint5Scaled(20.0f) + sp14C.x; + sp138.y = randPlusMinusPoint5Scaled(20.0f) + sp14C.y; + sp138.z = randPlusMinusPoint5Scaled(20.0f) + sp14C.z; + sp12C.x = 0.0f; + sp12C.y = 6.0f; + sp12C.z = 0.0f; + sp120.x = sp12C.x * -0.05f; + sp120.y = sp12C.y * -0.05f; + sp120.z = sp12C.z * -0.05f; + func_809F4AE8(globalCtx, &sp138, &sp12C, &sp120, Rand_ZeroFloat(10.0f) + 25.0f); + sp14B = true; + } + 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; + SysMatrix_InsertXRotation_s(-this->actor.shape.rot.x, 0); + Matrix_RotateY(-this->actor.shape.rot.y, 1); + SysMatrix_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) && + (FACING_ANGLE(&player->actor, &this->actor) > -0x2000)) { + Vec3s sp118; + + this->unk_1894 = sp180 * 0.05f; + Math_ApproachF(&this->unk_18C0, sp180 * 0.2f, 1.0f, 7.0f); + func_8018219C(&player->shieldMf, &sp118, 0); + sp118.y += 0x8000; + sp118.x = -sp118.x; + if (this->unk_14E == 3) { + this->unk_14E = 4; + this->unk_18C4 = sp118.x; + this->unk_18C6 = sp118.y; + } else { + player->unk_B84 = this->actor.yawTowardsPlayer; + player->unk_B80 = this->unk_1898 * 0.5f; + D_80A09A58->unk_1808 = 1; + D_80A09A58->unk_180C = this->unk_1898 * 30.0f; + D_80A09A58->unk_1810 = this->unk_18A8; + Math_ApproachS(&this->unk_18C4, sp118.x, 2, 0x2000); + Math_ApproachS(&this->unk_18C6, sp118.y, 2, 0x2000); + sp16C.x = this->actor.world.pos.x - this->unk_18A8.x; + 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)); + SysMatrix_InsertXRotation_s(-this->unk_18C4, 0); + Matrix_RotateY(-this->unk_18C6, 1); + SysMatrix_StatePush(); + SysMatrix_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)) { + s32 phi_s0_2; + Vec3f sp108; + Vec3f spFC; + Vec3f spF0; + + this->unk_18D8 += 2; + this->unk_18C0 = sp180 * 0.062f; + if (this->unk_18D8 < 10) { + sp108.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(40.0f); + sp108.y = this->actor.world.pos.y + randPlusMinusPoint5Scaled(40.0f); + sp108.z = this->actor.world.pos.z + randPlusMinusPoint5Scaled(40.0f); + spFC.x = 0.0f; + spFC.y = 6.0f; + spFC.z = 0.0f; + spF0.x = spFC.x * -0.05f; + spF0.y = spFC.y * -0.05f; + spF0.z = spFC.z * -0.05f; + func_809F4AE8(globalCtx, &sp108, &spFC, &spF0, Rand_ZeroFloat(10.0f) + 25.0f); + this->unk_15E |= 0xA; + } else { + this->unk_15C = 50; + this->unk_15E = 15; + func_801A72CC(&this->actor.projectedPos); + Audio_PlayActorSound2(&this->actor, 0x39D6); + func_80A00484(this, globalCtx, 2, NULL); + func_80A006D0(this); + for (phi_s0_2 = 0; phi_s0_2 < 20; phi_s0_2++) { + sp108.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(50.0f); + sp108.y = this->actor.world.pos.y + randPlusMinusPoint5Scaled(50.0f); + sp108.z = this->actor.world.pos.z + randPlusMinusPoint5Scaled(50.0f); + spFC.x = randPlusMinusPoint5Scaled(20.0f); + spFC.y = randPlusMinusPoint5Scaled(20.0f); + spFC.z = randPlusMinusPoint5Scaled(20.0f); + spF0.x = spFC.x * -0.05f; + spF0.y = spFC.y * -0.05f; + spF0.z = spFC.z * -0.05f; + func_809F4AE8(globalCtx, &sp108, &spFC, &spF0, Rand_ZeroFloat(10.0f) + 25.0f); + } + if ((s8)this->actor.colChkInfo.health <= 0) { + this->unk_18D6 = 200; + } else { + this->unk_18D6 = 60; + } + } + } + SysMatrix_StatePop(); + for (sp178 = 0; sp178 < 4; sp178++) { + if (D_80A09A60[sp178]->unk_14E < 2) { + sp16C.x = D_80A09A60[sp178]->actor.world.pos.x - this->unk_18A8.x; + sp16C.y = D_80A09A60[sp178]->actor.world.pos.y - this->unk_18A8.y; + sp16C.z = D_80A09A60[sp178]->actor.world.pos.z - this->unk_18A8.z; + sp180 = sqrtf(SQXYZ(sp16C)); + SysMatrix_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)) { + s32 pad; + Vec3f spE0; + Vec3f spD4; + Vec3f spC8; + + this->unk_18D8 += 2; + this->unk_18C0 = sp180 * 0.062f; + if (this->unk_18D8 < 5) { + spE0.x = + D_80A09A60[sp178]->actor.world.pos.x + randPlusMinusPoint5Scaled(40.0f); + spE0.y = + D_80A09A60[sp178]->actor.world.pos.y + randPlusMinusPoint5Scaled(40.0f); + spE0.z = + D_80A09A60[sp178]->actor.world.pos.z + randPlusMinusPoint5Scaled(40.0f); + spD4.x = 0.0f; + spD4.y = 6.0f; + spD4.z = 0.0f; + spC8.x = spD4.x * -0.05f; + spC8.y = spD4.y * -0.05f; + spC8.z = spD4.z * -0.05f; + + func_809F4AE8(globalCtx, &spE0, &spD4, &spC8, Rand_ZeroFloat(10.0f) + 25.0f); + D_80A09A60[sp178]->unk_15E |= 0xA; + } else { + D_80A09A60[sp178]->unk_14E = 2; + D_80A09A60[sp178]->unk_18D6 = 60; + Audio_PlayActorSound2(&this->actor, 0x3A0D); + for (pad = 0; pad < 20; pad++) { + spE0.x = + D_80A09A60[sp178]->actor.world.pos.x + randPlusMinusPoint5Scaled(50.0f); + spE0.y = + D_80A09A60[sp178]->actor.world.pos.y + randPlusMinusPoint5Scaled(50.0f); + spE0.z = + D_80A09A60[sp178]->actor.world.pos.z + randPlusMinusPoint5Scaled(50.0f); + spD4.x = randPlusMinusPoint5Scaled(20.0f); + spD4.y = randPlusMinusPoint5Scaled(20.0f); + spD4.z = randPlusMinusPoint5Scaled(20.0f); + spC8.x = spD4.x * -0.05f; + spC8.y = spD4.y * -0.05f; + spC8.z = spD4.z * -0.05f; + func_809F4AE8(globalCtx, &spE0, &spD4, &spC8, + Rand_ZeroFloat(10.0f) + 25.0f); + } + } + } + } + } + if (func_800C55C4(&globalCtx->colCtx, &this->unk_18A8, &this->unk_18B4, &sp14C, &sp158, 1, 1, 1, + 1, &sp144) && + (this->unk_14E != 5)) { + Vec3f spBC; + Vec3f spB0; + Vec3f spA4; + + sp14B = true; + spBC.x = randPlusMinusPoint5Scaled(20.0f) + sp14C.x; + spBC.y = randPlusMinusPoint5Scaled(20.0f) + sp14C.y; + spBC.z = randPlusMinusPoint5Scaled(20.0f) + sp14C.z; + spB0.x = 0.0f; + spB0.y = 6.0f; + spB0.z = 0.0f; + spA4.x = spB0.x * -0.05f; + spA4.y = spB0.y * -0.05f; + spA4.z = spB0.z * -0.05f; + + func_809F4AE8(globalCtx, &spBC, &spB0, &spA4, Rand_ZeroFloat(10.0f) + 25.0f); + } + } + } else if (!player->isBurning && (this->unk_14E != 5)) { + s32 pad2; + + func_800B8D50(globalCtx, &this->actor, 5.0f, this->actor.shape.rot.y, 0.0f, 0x10); + for (pad2 = 0; pad2 < 18; pad2++) { + player->flameTimers[pad2] = Rand_S16Offset(0, 200); + } + player->isBurning = true; + func_800B8E58(&player->actor, player->ageProperties->unk_92 + 0x681E); + } + } + if (sp14B) { + if (sp14C.y == 0.0f) { + temp_f20 = this->unk_18E0.x - sp14C.x; + temp_f22 = this->unk_18E0.z - sp14C.z; + func_800AE930(&globalCtx->colCtx, Effect_GetParams(this->effectIndex), &sp14C, 15.0f, + Math_Atan2S(temp_f20, temp_f22), sp158, sp144); + this->unk_18EC = 1; + } + this->unk_18E0 = sp14C; + } + if (this->unk_14E != 5) { + if (this->timers[0] == 0) { + this->unk_14E = 5; + this->timers[0] = 20; + } + } else { + Math_ApproachZeroF(&this->unk_1898, 1.0f, 0.05f); + if (this->timers[0] == 0) { + func_809FFA04(this, globalCtx); + this->timers[2] = 100; + func_80A006D0(this); + } + } + break; + } +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A00720.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A016E4.s") +void func_80A016E4(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_80A01750; + this->actor.world.pos.x = 0.0f; + this->actor.world.pos.y = 300.0f; + this->actor.world.pos.z = -922.5f; + this->unk_160 = KREG(75) + 150; + func_8016566C(this->unk_160); +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A01750.s") @@ -673,9 +2455,174 @@ extern UNK_TYPE D_06040930; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A0264C.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A02B30.s") +void func_80A02B30(Boss07* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + ColliderInfo* hitbox; + u8 sp27; + Actor* hit; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A02C54.s") + if (this->unk_15C == 0) { + if (this->quad1.base.acFlags & 2) { + this->quad1.base.acFlags &= ~2; + this->unk_186C = 7; + } + if (this->quad2.base.acFlags & 2) { + this->quad2.base.acFlags &= ~2; + this->unk_186C = 15; + if ((this->actionFunc == func_80A00274) || (player->stateFlags3 & 0x200)) { + hit = this->quad2.base.ac; + hitbox = this->quad2.info.acHitInfo; + sp27 = (hitbox->toucher.dmgFlags & 0xF7CFFFFF) ? this->actor.colChkInfo.damage : 0; + this->unk_15C = 50; + this->unk_15E = 15; + func_801A72CC(&this->actor.projectedPos); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_DAMAGE2_OLD); + func_80A00484(this, globalCtx, sp27, hit); + } else { + this->unk_15C = 15; + func_801A72CC(&this->actor.projectedPos); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_DAMAGE1_OLD); + func_80A0021C(this, globalCtx); + } + } + } +} + +void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + s32 i; + Player* spA8 = PLAYER; + Vec3f sp9C; + Vec3f sp90; + Vec3f sp84; + Vec3f sp78; + Vec3f sp6C; + f32 sp68; + + this->actor.hintId = 50; + if (D_80A09A71 != 0) { + D_80A09A71--; + if (D_80A09A71 == 0) { + func_801A89A8(0x806B); + } + } + Math_Vec3f_Copy(&D_80A09A40, &this->actor.projectedPos); + if ((D_80A09A58 == NULL) || (D_80A09A58->unk_ABD2 == 0)) { + this->unk_149 = 1; + 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; + if (gGameInfo->data[1311] == 0) { + this->unk_174 = 0; + this->unk_1884 = 0; + this->unk_1874 = 0; + Actor_SetScale(&this->actor, 0.1f); + this->actor.focus.pos = this->actor.world.pos; + for (i = 0; i < 3; i++) { + DECR(this->timers[i]); + } + DECR(this->unk_186C); + DECR(this->unk_15C); + DECR(this->unk_15E); + DECR(this->unk_18D6); + DECR(this->unk_18D8); + + this->unk_18EC = 0; + this->actionFunc(this, globalCtx); + if ((this->unk_18EC == 0) && (this->unk_18ED != 0)) { + func_800AEF44(Effect_GetParams(this->effectIndex)); + } + this->unk_18ED = this->unk_18EC; + if (this->actionFunc != func_80A01750) { + if (this->actionFunc != func_80A00554) { + Actor_SetVelocityXYRotation(&this->actor); + Actor_ApplyMovement(&this->actor); + } else { + if (this->actor.bgCheckFlags & 1) { + this->actor.velocity.y = 0.0f; + } + Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + } + if (this->unk_1888 == 0) { + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 60.0f, 100.0f, 5); + } else { + this->unk_1888--; + } + } + } else { + this->actor.colChkInfo.health = 0; + } + func_80A02B30(this, globalCtx); + SysMatrix_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); + SysMatrix_InsertXRotation_s(this->actor.shape.rot.x, MTXMODE_APPLY); + SysMatrix_InsertZRotation_s(this->actor.shape.rot.z, MTXMODE_APPLY); + sp6C.x = -55.0f; + sp6C.y = 55.0f; + sp6C.z = 10.0f; + SysMatrix_MultiplyVector3fByState(&sp6C, &sp9C); + sp6C.x = -55.0f; + sp6C.y = -55.0f; + SysMatrix_MultiplyVector3fByState(&sp6C, &sp90); + sp6C.x = 55.0f; + sp6C.y = 55.0f; + SysMatrix_MultiplyVector3fByState(&sp6C, &sp84); + sp6C.x = 55.0f; + sp6C.y = -55.0f; + SysMatrix_MultiplyVector3fByState(&sp6C, &sp78); + Collider_SetQuadVertices(&this->quad1, &sp9C, &sp90, &sp84, &sp78); + + sp68 = (spA8->stateFlags3 & 0x200) ? 70.0f : 40.0f; + sp6C.x = -sp68; + sp6C.y = sp68; + sp6C.z = -10.0f; + SysMatrix_MultiplyVector3fByState(&sp6C, &sp9C); + sp6C.x = -sp68; + sp6C.y = -sp68; + SysMatrix_MultiplyVector3fByState(&sp6C, &sp90); + sp6C.x = sp68; + sp6C.y = sp68; + SysMatrix_MultiplyVector3fByState(&sp6C, &sp84); + sp6C.x = sp68; + sp6C.y = -sp68; + SysMatrix_MultiplyVector3fByState(&sp6C, &sp78); + Collider_SetQuadVertices(&this->quad2, &sp9C, &sp90, &sp84, &sp78); + + if (spA8->stateFlags3 & 0x200) { + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->quad2.base); + } else { + if ((this->actionFunc != func_80A00274) && (this->actionFunc != func_80A00554)) { + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->quad1.base); + } + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->quad2.base); + if (this->actionFunc == func_809FFEAC) { + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->quad1.base); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->quad2.base); + } + } + if (this->unk_18D6 != 0) { + Vec3f sp5C; + Vec3f sp50; + Vec3f sp44; + f32 sp40 = (this->actionFunc == func_80A0264C) ? 130.0f : 80.0f; + + sp5C.x = randPlusMinusPoint5Scaled(sp40) + this->actor.world.pos.x; + sp5C.y = randPlusMinusPoint5Scaled(sp40) + this->actor.world.pos.y; + sp5C.z = randPlusMinusPoint5Scaled(sp40) + this->actor.world.pos.z; + sp50.x = 0.0f; + sp50.y = 5.0f; + sp50.z = 0.0f; + sp44.x = sp50.x * -0.05f; + sp44.y = sp50.y * -0.05f; + sp44.z = sp50.z * -0.05f; + func_809F4AE8(globalCtx, &sp5C, &sp50, &sp44, Rand_ZeroFloat(10.0f) + 25.0f); + func_8019F1C0(&D_80A09A40, NA_SE_EV_BURN_OUT - SFX_FLAG); + } + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A03238.s") @@ -685,19 +2632,162 @@ extern UNK_TYPE D_06040930; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A03F18.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A03F5C.s") +#ifdef NON_MATCHING +void Boss07_Mask_Draw(Actor *thisx, GlobalContext *globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + s32 i; + s32 phi_s6; + f32 temp_f20; + f32 temp_f22; + f32 phi_f24; + f32 pad2; + Vec3f spA8; + Vec3f sp9C; + Vec3f sp90; + + OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); + 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; + SysMatrix_InsertYRotation_f(Math_SinS(this->unk_186C * 0x4500) * temp_f20, 1); + SysMatrix_RotateStateAroundXAxis(temp_f22); + if ((this->unk_15E % 2) != 0) { + POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); + } + gSPSegment(POLY_OPA_DISP++, 8, Lib_SegmentedToVirtual(D_80A082E0[this->unk_1884])); + SkelAnime_Draw(globalCtx, this->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, NULL, func_80A03F18, &this->actor); + POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); + gSPDisplayList(POLY_OPA_DISP++, D_0600AFB0); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A0434C.s") + phi_s6 = ((this->actionFunc == func_809FFA80) && (ABS_ALT((s16)(this->actor.world.rot.y - this->actor.shape.rot.y)) > 0x4000)) ? 1 : 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A045A8.s") + Matrix_RotateY(this->actor.shape.rot.y, 0); + SysMatrix_InsertXRotation_s(this->actor.shape.rot.x, 1); + SysMatrix_InsertZRotation_s(this->actor.shape.rot.z, 1); + SysMatrix_GetStateTranslationAndScaledZ(-3.0f, &sp90); + spA8.x = 0.0f; + spA8.y = 20.0f; + spA8.z = -2.0f; + phi_f24 = 0.0f; + for(i = 0; i < 25; i++) { + SysMatrix_StatePush(); + SysMatrix_StatePush(); + SysMatrix_InsertZRotation_f(phi_f24, 1); + SysMatrix_MultiplyVector3fByState(&spA8, &sp9C); + this->unk_19F0[i].unk_0.x = this->unk_1878.x + sp9C.x; + this->unk_19F0[i].unk_0.y = this->unk_1878.y + sp9C.y; + this->unk_19F0[i].unk_0.z = this->unk_1878.z + sp9C.z; + + pad2 = (1 - (i * 0.008f)) * this->unk_1870; + SysMatrix_StatePop(); + if (this->unk_149 != 0) { + func_80A03238(this, globalCtx, &this->unk_19F0[i].unk_0, this->unk_19F0[i].unk_C, this->unk_19F0[i].unk_84, this->unk_19F0[i].unk_FC, &sp90, pad2, phi_s6, phi_f24); + } + func_80A036C4(this, globalCtx, this->unk_19F0[i].unk_C, this->unk_19F0[i].unk_84, pad2, i * 0.9f); + phi_f24 += 0.5f; + spA8.y += 1.0f; + + SysMatrix_StatePop(); + } + func_80A03868(this, globalCtx); + this->unk_149 = 0; + CLOSE_DISPS(globalCtx->state.gfxCtx); +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Mask_Draw.s") +#endif + +#ifdef NON_MATCHING +void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx2) { + s32 i; + f32 sp58; + f32 sp54; + f32 sp50; + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + Player* player = PLAYER; + + this->unk_14C++; + if (this->actor.params == 100) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_BEAM - SFX_FLAG); + } + if (gGameInfo->data[1311] == 0) { + Actor_SetScale(&this->actor, 3.5f); + if (this->unk_14E == 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; + + this->actor.world.rot.y = Math_Atan2S(sp58, sp50); + this->actor.world.rot.x = Math_Atan2S(sp54, sqrtf(SQ(sp58) + SQ(sp50))); + this->unk_14E = 1; + this->actor.speedXZ = 30.0f; + func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); + if (this->actor.params == 101) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_FIRE_OLD); + } + } + for (i = 0; i < 3; i++) { + DECR(this->timers[i]); + } + Actor_SetVelocityXYRotation(&this->actor); + Actor_ApplyMovement(&this->actor); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 31.0f, 100.0f, 7); + this->actor.shape.rot.z += 0x1200; + if ((this->actor.bgCheckFlags & 0x19) || (this->cyl2.base.atFlags & 2) || (this->cyl2.base.atFlags & 2) || + (D_80A09A70 != 0)) { + Actor_MarkForDeath(&this->actor); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, this->unk_181C, + CLEAR_TAG_SMALL_LIGHT_RAYS); + } + Collider_UpdateCylinder(&this->actor, &this->cyl2); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); + } +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Projectile_Update.s") +#endif + +void Boss07_Projectile_Draw(Actor *thisx, GlobalContext *globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + + OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C2DC(globalCtx->state.gfxCtx); + gDPPipeSync(POLY_XLU_DISP++); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, D_80A07968[this->unk_181C][0], D_80A07968[this->unk_181C][1], D_80A07968[this->unk_181C][2], 255); + gDPSetEnvColor(POLY_XLU_DISP++, D_80A07950[this->unk_181C][0], D_80A07950[this->unk_181C][1], D_80A07950[this->unk_181C][2], 128); + SysMatrix_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); + SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); + SysMatrix_InsertZRotation_s(this->actor.shape.rot.z, 1); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + gSPDisplayList(POLY_XLU_DISP++, D_04023348); + gSPDisplayList(POLY_XLU_DISP++, D_04023428); + CLOSE_DISPS(globalCtx->state.gfxCtx); +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A04768.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A04878.s") +void func_80A04878(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_80A04890; +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A04890.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A04DE0.s") +void func_80A04DE0(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_80A04E5C; + this->actor.gravity = -0.75f; + ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 40.0f); + Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &D_80A07EA4); + this->actor.colChkInfo.health = 5; + this->unk_14E = 0; +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A04E5C.s") @@ -705,11 +2795,88 @@ extern UNK_TYPE D_06040930; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A05608.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A05694.s") +void Boss07_Remains_Update(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A057A0.s") + this->unk_14C++; + 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--; + } + this->actionFunc(this, globalCtx); + this->actor.focus.pos = this->actor.world.pos; + this->actor.world.pos.x += this->unk_18CC; + this->actor.world.pos.z += this->unk_18D0; + Math_ApproachZeroF(&this->unk_18CC, 1.0f, 1.0f); + Math_ApproachZeroF(&this->unk_18D0, 1.0f, 1.0f); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A05AF8.s") +void Boss07_Remains_Draw(Actor *thisx, GlobalContext *globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + f32 sp64; + f32 sp60; + s32 pad; + + OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); + if ((this->unk_15E % 2) != 0) { + POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); + } + sp64 = this->unk_15C * (M_PI / 4.0f) * 0.06666667f; + sp60 = Math_SinS(this->unk_15C * 0x3500) * sp64 * 0.5f; + SysMatrix_InsertYRotation_f(Math_SinS(this->unk_15C * 0x4500) * sp64, 1); + SysMatrix_RotateStateAroundXAxis(sp60); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + switch(this->actor.params) { + case 200: + gSPDisplayList(POLY_OPA_DISP++, D_060149A0); + break; + case 201: + gSPDisplayList(POLY_OPA_DISP++, D_06016090); + break; + case 202: + gSPDisplayList(POLY_OPA_DISP++, D_06017DE0); + break; + case 203: + gSPDisplayList(POLY_OPA_DISP++, D_06019328); + break; + } + POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); + if (this->actionFunc == func_80A04890) { + gDPPipeSync(POLY_XLU_DISP++); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 200, 200); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 100, 128); + + SysMatrix_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); + SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); + SysMatrix_InsertZRotation_s(this->unk_18C8, 1); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + 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; + this->actor.gravity = 0.0f; + this->unk_17C = (sREG(42) * 0.01f) + 0.9f; + this->timers[0] = 200; +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A05B50.s") @@ -717,18 +2884,376 @@ extern UNK_TYPE D_06040930; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A05DDC.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A06500.s") +void func_80A06500(Boss07* this, GlobalContext* globalCtx) { + s32 i; + Boss07* phi_a2; + f32 dx; + f32 dy; + f32 dz; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A06990.s") + if (this->unk_158 == 0) { + phi_a2 = (Boss07*)globalCtx->actorCtx.actorList[ACTORCAT_BOSS].first; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A06C64.s") + while (phi_a2 != NULL) { + if ((this != phi_a2) && (phi_a2->actor.params == 180) && (phi_a2->unk_158 == 0)) { + dx = phi_a2->actor.world.pos.x - this->actor.world.pos.x; + dy = phi_a2->actor.world.pos.y - this->actor.world.pos.y; + dz = phi_a2->actor.world.pos.z - this->actor.world.pos.z; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A06E24.s") + if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < (gGameInfo->data[1564] + 50.0f)) { + phi_a2->unk_158 = this->unk_158 = 10; + this->actor.world.rot.y = Math_Atan2S(dx, dz); + phi_a2->actor.world.rot.y = this->actor.world.rot.y + 0x7FFF; + if (this->timers[0] > 0) { + this->actor.speedXZ = -10.0f; + } else { + this->actor.speedXZ = -5.0f; + this->unk_17C = (gGameInfo->data[1625] * 0.01f) + 0.2f; + this->unk_180 = 0x800; + } + if (phi_a2->timers[0] > 0) { + phi_a2->actor.speedXZ = -10.0f; + } else { + phi_a2->actor.speedXZ = -5.0f; + phi_a2->unk_17C = (gGameInfo->data[1625] * 0.01f) + 0.2f; + phi_a2->unk_180 = 0x800; + } + CollisionCheck_SpawnShieldParticles(globalCtx, &this->actor.focus.pos); + CollisionCheck_SpawnShieldParticles(globalCtx, &phi_a2->actor.focus.pos); + if (this->timers[0] > 80) { + this->actor.shape.rot.z = randPlusMinusPoint5Scaled((gGameInfo->data[1565] + 20) * 256.0f); + for (i = 0; i < 5; i++) { + DECR(this->timers[0]); + DECR(this->timers[1]); + } + } + if (phi_a2->timers[0] > 80) { + phi_a2->actor.shape.rot.z = randPlusMinusPoint5Scaled((gGameInfo->data[1565] + 20) * 256.0f); + for (i = 0; i < 5; i++) { + DECR(phi_a2->timers[0]); + DECR(phi_a2->timers[1]); + } + } + Audio_PlayActorSound2(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW); + return; + } + } + phi_a2 = (Boss07*)phi_a2->actor.next; + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A06F48.s") +void func_80A06990(Boss07* this, GlobalContext* globalCtx) { + s32 sp3C; + s32 sp38 = 0; + Player* player = PLAYER; + s32 pad[3]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A07604.s") + if (this->cyl2.base.acFlags & 2) { + this->cyl2.base.acFlags &= ~2; + if (this->unk_15C == 0) { + this->unk_15C = 5; + if ((this->actor.colChkInfo.damageEffect == 13) || (this->actor.colChkInfo.damageEffect == 10)) { + if (this->actor.colChkInfo.damageEffect == 13) { + player->unk_B84 = this->actor.yawTowardsPlayer; + player->unk_B80 = 20.0f; + } + if (this->timers[0] > 40) { + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + if (player->transformation == 0) { + this->actor.speedXZ = -30.0f; + this->actor.velocity.y = 10.0f; + if ((s16)(gGameInfo->data[1583] + 100) < this->timers[0]) { + this->timers[0] = gGameInfo->data[1583] + 100; + this->timers[1] = gGameInfo->data[1613] + 170; + } + } else if (this->actor.colChkInfo.damageEffect == 10) { + this->actor.speedXZ = -15.0f; + } else { + this->actor.speedXZ = -7.0f; + } + } + } else if (this->actor.colChkInfo.damageEffect == 12) { + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + this->actor.speedXZ = 2.0f * -player->actor.speedXZ; + sp38 = 1; + } else if (this->actor.colChkInfo.damageEffect == 11) { + this->actor.world.rot.y = Math_Atan2S(this->cyl2.base.ac->world.pos.x - this->actor.world.pos.x, + this->cyl2.base.ac->world.pos.z - this->actor.world.pos.z); + this->actor.speedXZ = -20.0f; + this->actor.velocity.y = gGameInfo->data[1591] + 15.0f; + sp38 = 1; + } + } + } + if (this->actor.bgCheckFlags & 1) { + if ((func_800B64FC(globalCtx, 5.0f, &this->actor.world.pos, &sp3C) >= 0.0f) && (sp3C == 0)) { + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + this->actor.velocity.y = gGameInfo->data[1591] + 25.0f; + sp38 = 1; + } + } + if (sp38 && (this->timers[0] > 90)) { + this->actor.shape.rot.z = randPlusMinusPoint5Scaled((gGameInfo->data[1565] + 30) * 256.0f); + this->timers[0] = Rand_ZeroFloat(10.0f) + 70.0f; + this->timers[1] = this->timers[0] + 70; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A07638.s") +void Boss07_Top_Update(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A07740.s") + this->unk_14C++; + DECR(this->timers[0]); + DECR(this->timers[1]); + DECR(this->unk_15E); + DECR(this->unk_15C); + DECR(this->unk_158); + 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); + 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); + this->unk_178 -= this->unk_17C; + if (this->unk_178 < -2.0f * M_PI) { + this->unk_178 += 2.0f * M_PI; + } + if (D_80A09A54->actionFunc == func_809F65F4) { + Actor_MarkForDeath(&this->actor); + } + Math_ApproachF(&this->actor.scale.x, (sREG(77) * 0.001f) + 0.06f, 1.0f, 0.012f); + Actor_SetScale(&this->actor, this->actor.scale.x); +} + +void Boss07_Top_Draw(Actor *thisx, GlobalContext *globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + + OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); + if ((this->unk_15E % 2) != 0) { + POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 780, 1099); + } + SysMatrix_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); + SysMatrix_InsertZRotation_s(this->actor.shape.rot.z, 1); + SysMatrix_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); + gSPDisplayList(POLY_OPA_DISP++, D_0602F640); + POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +#ifdef NON_MATCHING +void Boss07_Effects_Update(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + + func_80A07638(globalCtx); + + if (D_80A09A4C != 0) { + D_80A09A4C--; + play_sound(NA_SE_EN_LAST2_HEARTBEAT_OLD - SFX_FLAG); + } + if (this->unk_1808 != 0) { + D_801F4E32 = 1; + D_801F4E38 = this->unk_1810; + D_801F4E44 = this->unk_180C; + D_801F4E48 = 10.0f; + D_801F4E4C = 0; + this->unk_1808 = 0; + } else { + D_801F4E32 = 0; + } + this->unk_ABC8++; + switch (this->unk_ABD0) { + case 0: + if ((D_80A09A5C != NULL) && (D_80A09A5C->unk_774 != 0)) { + this->unk_ABD0 = 1; + this->unk_ABC8 = 0; + } + break; + case 1: + if (ActorCutscene_GetCurrentIndex() == -1) { + func_800EA0D4(globalCtx, &globalCtx->csCtx); + func_800B7298(globalCtx, &this->actor, 7); + this->unk_ABD2 = func_801694DC(globalCtx); + func_80169590(globalCtx, 0, 1); + func_80169590(globalCtx, this->unk_ABD2, 7); + this->unk_ABC8 = 0; + this->unk_ABD0 = 2; + func_8016566C(150); + this->unk_ABD4.x = D_80A09A60[0]->actor.world.pos.x * 0.7f; + this->unk_ABD4.y = D_80A09A60[0]->actor.world.pos.y * 0.7f; + this->unk_ABD4.z = D_80A09A60[0]->actor.world.pos.z * 0.7f; + } else { + break; + } + case 2: + if (this->unk_ABC8 == 20) { + D_80A09A60[0]->unk_14E = 20; + } + this->unk_ABE0.x = D_80A09A60[0]->actor.world.pos.x; + this->unk_ABE0.y = D_80A09A60[0]->actor.world.pos.y; + this->unk_ABE0.z = D_80A09A60[0]->actor.world.pos.z; + if (this->unk_ABC8 == 40) { + this->unk_ABD0 = 3; + this->unk_ABC8 = 0; + this->unk_ABD4.x = D_80A09A60[1]->actor.world.pos.x * 0.7f; + this->unk_ABD4.y = D_80A09A60[1]->actor.world.pos.y * 0.7f; + this->unk_ABD4.z = D_80A09A60[1]->actor.world.pos.z * 0.7f; + } else { + break; + } + case 3: + if (this->unk_ABC8 == 20) { + D_80A09A60[1]->unk_14E = 20; + } + this->unk_ABE0.x = D_80A09A60[1]->actor.world.pos.x; + this->unk_ABE0.y = D_80A09A60[1]->actor.world.pos.y; + this->unk_ABE0.z = D_80A09A60[1]->actor.world.pos.z; + if (this->unk_ABC8 == 40) { + this->unk_ABD0 = 4; + this->unk_ABC8 = 0; + this->unk_ABD4.x = D_80A09A60[2]->actor.world.pos.x * 0.7f; + this->unk_ABD4.y = D_80A09A60[2]->actor.world.pos.y * 0.7f; + this->unk_ABD4.z = D_80A09A60[2]->actor.world.pos.z * 0.7f; + } else { + break; + } + case 4: + if (this->unk_ABC8 == 20) { + D_80A09A60[2]->unk_14E = 20; + } + this->unk_ABE0.x = D_80A09A60[2]->actor.world.pos.x; + this->unk_ABE0.y = D_80A09A60[2]->actor.world.pos.y; + this->unk_ABE0.z = D_80A09A60[2]->actor.world.pos.z; + if (this->unk_ABC8 == 40) { + this->unk_ABD0 = 5; + this->unk_ABC8 = 0; + this->unk_ABD4.x = D_80A09A60[3]->actor.world.pos.x * 0.7f; + this->unk_ABD4.y = D_80A09A60[3]->actor.world.pos.y * 0.7f; + this->unk_ABD4.z = D_80A09A60[3]->actor.world.pos.z * 0.7f; + } else { + break; + } + case 5: + if (this->unk_ABC8 == 20) { + D_80A09A60[3]->unk_14E = 20; + } + this->unk_ABE0.x = D_80A09A60[3]->actor.world.pos.x; + this->unk_ABE0.y = D_80A09A60[3]->actor.world.pos.y; + this->unk_ABE0.z = D_80A09A60[3]->actor.world.pos.z; + if (this->unk_ABC8 == 40) { + Camera* temp_v0_3 = Play_GetCamera(globalCtx, 0); + s32 i; + + this->unk_ABD0 = 6; + this->unk_ABC8 = 0; + temp_v0_3->eye = this->unk_ABD4; + temp_v0_3->eyeNext = this->unk_ABD4; + temp_v0_3->at = this->unk_ABE0; + func_80169AFC(globalCtx, this->unk_ABD2, 0); + this->unk_ABD2 = 0; + func_800EA0EC(globalCtx, &globalCtx->csCtx); + func_800B7298(globalCtx, &this->actor, 6); + func_80165690(); + for (i = 0; i < 4; i++) { + func_800BC154(globalCtx, &globalCtx->actorCtx, &D_80A09A60[i]->actor, 5); + } + } + break; + case 6: + break; + } + if (this->unk_ABD2 != 0) { + if (this->unk_ABC8 < 20) { + s32 j; + + for (j = 0; j < 4; j++) { + if ((this->unk_ABC8 & 1) != 0) { + D_80A09A60[j]->actor.world.pos.x += 2.0f; + D_80A09A60[j]->actor.world.pos.z += 2.0f; + } else { + D_80A09A60[j]->actor.world.pos.x -= 2.0f; + D_80A09A60[j]->actor.world.pos.z -= 2.0f; + } + } + } + ShrinkWindow_SetLetterboxTarget(27); + Play_CameraSetAtEye(globalCtx, this->unk_ABD2, &this->unk_ABE0, &this->unk_ABD4); + } +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Effects_Update.s") +#endif + +void Boss07_Effects_Draw(Actor *thisx, GlobalContext *globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss07* this = THIS; + + func_80A07740(globalCtx); + func_809FBF94(this, globalCtx); +} + +void func_80A07638(GlobalContext* globalCtx) { + Boss07Effect* effect = (Boss07Effect*)globalCtx->specialEffects; + s32 i; + + for (i = 0; i < 50; i++, effect++) { + if (effect->unk_0 != 0) { + effect->unk_2++; + + effect->unk_4.x += effect->unk_10.x; + effect->unk_4.y += effect->unk_10.y; + effect->unk_4.z += effect->unk_10.z; + + effect->unk_10.x += effect->unk_1C.x; + effect->unk_10.y += effect->unk_1C.y; + effect->unk_10.z += effect->unk_1C.z; + if (effect->unk_0 == 1) { + if (effect->unk_30 != 0) { + effect->unk_2C -= (i & 7) + 13; + if (effect->unk_2C <= 0) { + effect->unk_2C = 0; + effect->unk_0 = 0; + } + } else { + effect->unk_2C += 300; + if (effect->unk_2C >= 255) { + effect->unk_2C = 255; + effect->unk_30++; + } + } + } + } + } +} + +void func_80A07740(GlobalContext *globalCtx) { + Boss07Effect *effect = (Boss07Effect*) globalCtx->specialEffects; + GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; + s32 i; + + OPEN_DISPS(gfxCtx); + func_8012C2DC(globalCtx->state.gfxCtx); + for(i = 0; i < 50; i++, effect++) { + if (effect->unk_0 > 0) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, effect->unk_2C); + 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->unk_2) & 0x7F, (15 * -effect->unk_2) & 0xFF, 0x20, 0x40, 1, 0, 0, 0x20, 0x20)); + SysMatrix_InsertTranslation(effect->unk_4.x, effect->unk_4.y, effect->unk_4.z, 0); + SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); + Matrix_Scale(effect->unk_34, effect->unk_34, 1.0f, 1); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); + gSPDisplayList(POLY_XLU_DISP++, D_0600CEE8); + } + } + CLOSE_DISPS(gfxCtx); +} 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 21e30eb92..6172a8b0f 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -7,10 +7,165 @@ struct Boss07; typedef void (*Boss07ActionFunc)(struct Boss07*, GlobalContext*); +typedef struct { + Vec3f unk_0; + Vec3f unk_C[10]; + Vec3f unk_84[10]; + Vec3f unk_FC[10]; +} Boss07Tentacle; // size = 0x174 + +typedef struct { + Vec3s unk_0; + f32 unk_8; + f32 unk_C; + f32 unk_10; + f32 unk_14; + Vec3f unk_18; + Vec3f unk_24[50]; + Vec3f unk_27C[50]; + Vec3f unk_4D4[50]; + char unk_72C[0xC8]; +} Boss07Whip; // size = 0x7F4 + typedef struct Boss07 { /* 0x0000 */ Actor actor; /* 0x0144 */ Boss07ActionFunc actionFunc; - /* 0x0148 */ char unk_144[0xAAD8]; + /* 0x0148 */ u8 unk_148; + /* 0x0149 */ u8 unk_149; + /* 0x014A */ u8 unk_14A; + /* 0x014B */ u8 unk_14B; + /* 0x014C */ s16 unk_14C; + /* 0x014E */ u8 unk_14E; + /* 0x014F */ u8 unk_14F; + /* 0x0150 */ s16 timers[3]; + /* 0x0156 */ s16 unk_156; + /* 0x0158 */ s16 unk_158; + /* 0x015A */ s16 unk_15A; + /* 0x015C */ s16 unk_15C; + /* 0x015E */ s16 unk_15E; + /* 0x0160 */ s16 unk_160; + /* 0x0162 */ s16 unk_162; + /* 0x0164 */ Vec3f unk_164; + /* 0x0170 */ f32 unk_170; + /* 0x0174 */ u8 unk_174; + /* 0x0178 */ f32 unk_178; + /* 0x017C */ f32 unk_17C; + /* 0x0180 */ s16 unk_180; + /* 0x0184 */ f32 unk_184; + /* 0x0188 */ f32 unk_188; + /* 0x018C */ f32 unk_18C; + /* 0x0190 */ SkelAnime skelAnime1; + /* 0x01D4 */ f32 unk_1D4; + /* 0x01D8 */ s32 unk_1D8; + /* 0x01DC */ Vec3s jointTable1[28]; + /* 0x0284 */ Vec3s morphTable1[28]; + /* 0x032C */ f32 unk_32C; + /* 0x0330 */ f32 unk_330; + /* 0x0334 */ Vec3f unk_334[15]; + /* 0x03E8 */ ColliderJntSph sph1; + /* 0x0408 */ ColliderJntSphElement sphElems1[11]; + /* 0x06C8 */ ColliderJntSph sph2; + /* 0x06E8 */ ColliderJntSphElement sphElems2[1]; + /* 0x0728 */ ColliderCylinder cyl1; + /* 0x0774 */ u8 unk_774; + /* 0x0778 */ s32 unk_778; + /* 0x077C */ f32 unk_77C; + /* 0x0780 */ char unk_780[4]; + /* 0x0784 */ s32 unk_784; + /* 0x0788 */ Vec3s unk_788; + /* 0x0790 */ f32 unk_790; + /* 0x0794 */ f32 unk_794; + /* 0x0798 */ f32 unk_798; + /* 0x079C */ f32 unk_79C; + /* 0x07A0 */ Vec3f unk_7A0; + /* 0x07A0 */ Vec3f unk_7AC[50]; + /* 0x0A04 */ Vec3f unk_A04[50]; + /* 0x0C5C */ Vec3f unk_C5C[50]; + /* 0x0EB4 */ char unkEB4[0xC8]; + /* 0x0F7C */ s16 unk_F7C; + /* 0x0F7E */ s16 unk_F7E; + /* 0x0F80 */ Vec3f unk_F80; + /* 0x0F8C */ f32 unk_F8C; + /* 0x0F90 */ f32 unk_F90; + /* 0x0F94 */ Vec3s unk_F94; + /* 0x0F9C */ f32 unk_F9C; + /* 0x0FA0 */ f32 unk_FA0; + /* 0x0FA4 */ f32 unk_FA4; + /* 0x0FA8 */ f32 unk_FA8; + /* 0x0FAC */ Vec3f unk_FAC; + /* 0x0FB8 */ Vec3f unk_FB8[50]; + /* 0x1210 */ Vec3f unk_1210[50]; + /* 0x1468 */ Vec3f unk_1468[50]; + /* 0x16C0 */ char unk16C0[0xC8]; + /* 0x1788 */ Vec3f unk_1788[2]; + /* 0x17A0 */ Vec3f unk_17A0; + /* 0x17AC */ Vec3f unk_17AC; + /* 0x17B8 */ f32 unk_17B8[4]; + /* 0x17C8 */ char unk17C8[0x10]; + /* 0x17D8 */ s16 unk_17D8; + /* 0x17DA */ s16 unk_17DA; + /* 0x17DA */ char unk17DC[4]; + /* 0x17E0 */ f32 unk_17E0; + /* 0x17E4 */ f32 unk_17E4; + /* 0x17E8 */ f32 unk_17E8; + /* 0x17E8 */ f32 unk_17EC; + /* 0x17F0 */ f32 unk_17F0; + /* 0x17F4 */ f32 unk_17F4; + /* 0x17F8 */ f32 unk_17F8; + /* 0x17FC */ f32 unk_17FC; + /* 0x1800 */ f32 unk_1800; + /* 0x1804 */ u8 unk_1804; + /* 0x1805 */ u8 unk_1805; + /* 0x1806 */ s16 unk_1806; + /* 0x1808 */ u8 unk_1808; + /* 0x180c */ f32 unk_180C; + /* 0x1810 */ Vec3f unk_1810; + /* 0x181C */ s16 unk_181C; + /* 0x1820 */ ColliderCylinder cyl2; + /* 0x186C */ s16 unk_186C; + /* 0x1870 */ f32 unk_1870; + /* 0x1874 */ u8 unk_1874; + /* 0x1878 */ Vec3f unk_1878; + /* 0x1884 */ s32 unk_1884; + /* 0x1888 */ u8 unk_1888; + /* 0x188C */ f32 unk_188C; + /* 0x1890 */ f32 unk_1890; + /* 0x1894 */ f32 unk_1894; + /* 0x1898 */ f32 unk_1898; + /* 0x189C */ Vec3f unk_189C; + /* 0x18A8 */ Vec3f unk_18A8; + /* 0x18B4 */ Vec3f unk_18B4; + /* 0x18C0 */ f32 unk_18C0; + /* 0x18C4 */ s16 unk_18C4; + /* 0x18C6 */ s16 unk_18C6; + /* 0x18C8 */ s16 unk_18C8; + /* 0x18CC */ f32 unk_18CC; + /* 0x18D0 */ f32 unk_18D0; + /* 0x18D4 */ s16 unk_18D4; + /* 0x18D6 */ s16 unk_18D6; + /* 0x18D8 */ s16 unk_18D8; + /* 0x18DC */ s32 effectIndex; + /* 0x18E0 */ Vec3f unk_18E0; + /* 0x18EC */ u8 unk_18EC; + /* 0x18ED */ u8 unk_18ED; + /* 0x18F0 */ ColliderQuad quad1; + /* 0x1970 */ ColliderQuad quad2; + /* 0x19F0 */ Boss07Tentacle unk_19F0[25]; + /* 0x3E44 */ char unk3E44[0x6D00]; + /* 0xAB44 */ f32 unk_AB44; + /* 0xAB48 */ u8 unk_AB48; + /* 0xAB48 */ char unkAB49[0x7F]; + /* 0xABC8 */ u32 unk_ABC8; + /* 0xABCC */ s32 unk_ABCC; + /* 0xABD0 */ s16 unk_ABD0; + /* 0xABD2 */ s16 unk_ABD2; + /* 0xABD4 */ Vec3f unk_ABD4; + /* 0xABE0 */ Vec3f unk_ABE0; + /* 0xABEC */ Vec3f unk_ABEC; + /* 0xABF8 */ Vec3f unk_ABF8; + /* 0xAC04 */ char unkAC04[8]; + /* 0xAC0C */ f32 unk_AC0C; + /* 0xAC10 */ char unkAC10[0x10]; } Boss07; // size = 0xAC20 extern const ActorInit Boss_07_InitVars; diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h index 31b7df583..9b3b98271 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h @@ -10,7 +10,8 @@ typedef void (*ObjTsuboActionFunc)(struct ObjTsubo*, GlobalContext*); typedef struct ObjTsubo { /* 0x0000 */ Actor actor; /* 0x0144 */ ObjTsuboActionFunc actionFunc; - /* 0x0148 */ char unk_144[0x54]; + /* 0x0148 */ char unk_144[0x53]; + /* 0x019B */ u8 unk19B; } ObjTsubo; // size = 0x19C extern const ActorInit Obj_Tsubo_InitVars; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index eba62a5cd..ea20876a3 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -9488,7 +9488,7 @@ 0x809F99C4:("func_809F99C4",), 0x809F9CEC:("func_809F9CEC",), 0x809F9E94:("func_809F9E94",), - 0x809FA1B4:("Boss07_Update",), + 0x809FA1B4:("Boss07_Wrath_Update",), 0x809FAA44:("func_809FAA44",), 0x809FB114:("func_809FB114",), 0x809FB504:("func_809FB504",), @@ -9497,7 +9497,7 @@ 0x809FB7D4:("func_809FB7D4",), 0x809FBB9C:("func_809FBB9C",), 0x809FBF94:("func_809FBF94",), - 0x809FC1C8:("Boss07_Draw",), + 0x809FC1C8:("Boss07_Wrath_Draw",), 0x809FC4C0:("func_809FC4C0",), 0x809FC8B0:("func_809FC8B0",), 0x809FC960:("func_809FC960",), @@ -9523,13 +9523,13 @@ 0x809FE6B0:("func_809FE6B0",), 0x809FE734:("func_809FE734",), 0x809FEE70:("func_809FEE70",), - 0x809FF0E4:("func_809FF0E4",), - 0x809FF12C:("func_809FF12C",), - 0x809FF5CC:("func_809FF5CC",), + 0x809FF0E4:("Boss07_Afterimage_Update",), + 0x809FF12C:("Boss07_Incarnation_Update",), + 0x809FF5CC:("Boss07_Afterimage_Draw",), 0x809FF678:("func_809FF678",), 0x809FF6B0:("func_809FF6B0",), 0x809FF810:("func_809FF810",), - 0x809FF900:("func_809FF900",), + 0x809FF900:("Boss07_Incarnation_Draw",), 0x809FFA04:("func_809FFA04",), 0x809FFA80:("func_809FFA80",), 0x809FFE64:("func_809FFE64",), @@ -9546,14 +9546,14 @@ 0x80A025AC:("func_80A025AC",), 0x80A0264C:("func_80A0264C",), 0x80A02B30:("func_80A02B30",), - 0x80A02C54:("func_80A02C54",), + 0x80A02C54:("Boss07_Mask_Update",), 0x80A03238:("func_80A03238",), 0x80A036C4:("func_80A036C4",), 0x80A03868:("func_80A03868",), 0x80A03F18:("func_80A03F18",), - 0x80A03F5C:("func_80A03F5C",), - 0x80A0434C:("func_80A0434C",), - 0x80A045A8:("func_80A045A8",), + 0x80A03F5C:("Boss07_Mask_Draw",), + 0x80A0434C:("Boss07_Projectile_Update",), + 0x80A045A8:("Boss07_Projectile_Draw",), 0x80A04768:("func_80A04768",), 0x80A04878:("func_80A04878",), 0x80A04890:("func_80A04890",), @@ -9561,18 +9561,18 @@ 0x80A04E5C:("func_80A04E5C",), 0x80A055E0:("func_80A055E0",), 0x80A05608:("func_80A05608",), - 0x80A05694:("func_80A05694",), - 0x80A057A0:("func_80A057A0",), + 0x80A05694:("Boss07_Remains_Update",), + 0x80A057A0:("Boss07_Remains_Draw",), 0x80A05AF8:("func_80A05AF8",), 0x80A05B50:("func_80A05B50",), 0x80A05C88:("func_80A05C88",), 0x80A05DDC:("func_80A05DDC",), 0x80A06500:("func_80A06500",), 0x80A06990:("func_80A06990",), - 0x80A06C64:("func_80A06C64",), - 0x80A06E24:("func_80A06E24",), - 0x80A06F48:("func_80A06F48",), - 0x80A07604:("func_80A07604",), + 0x80A06C64:("Boss07_Top_Update",), + 0x80A06E24:("Boss07_Top_Draw",), + 0x80A06F48:("Boss07_Effects_Update",), + 0x80A07604:("Boss07_Effects_Draw",), 0x80A07638:("func_80A07638",), 0x80A07740:("func_80A07740",), 0x80A0A8A0:("BgDyYoseizo_Init",), From 87da5d2b36b019fd4dd37c4f3e307704e09f9833 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Wed, 29 Sep 2021 10:26:28 -0500 Subject: [PATCH 02/28] more functions --- include/functions.h | 6 +- include/variables.h | 2 +- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 851 ++++++++++++++++++-- src/overlays/actors/ovl_Boss_07/z_boss_07.h | 12 +- 4 files changed, 774 insertions(+), 97 deletions(-) diff --git a/include/functions.h b/include/functions.h index 5a2960506..e82550b41 100644 --- a/include/functions.h +++ b/include/functions.h @@ -3864,8 +3864,8 @@ void func_8019FAD8(Vec3f* param_1, u16 param_2, f32 param_3); // void func_8019FCB8(void); // void func_8019FD90(void); void func_8019FDC8(UNK_PTR arg0, u16 sfxId, UNK_TYPE arg2); -// void func_8019FE1C(void); -// void func_8019FE74(void); +void func_8019FE1C(Vec3f* arg0, u16 sfxId, f32 arg2); +void func_8019FE74(f32* arg0, f32 arg1, UNK_TYPE arg2); // void func_8019FEDC(void); // void func_8019FF38(void); // void func_8019FF9C(void); @@ -3959,7 +3959,7 @@ void Audio_PreNMI(void); // void func_801A44D4(void); s32 func_801A46F8(void); // void func_801A4748(void); -// void func_801A479C(void); +void func_801A479C(Vec3f* arg0, u16 sfxId, UNK_TYPE arg2); // void func_801A47DC(void); // void func_801A48E0(void); // void func_801A4A28(void); diff --git a/include/variables.h b/include/variables.h index 2ea7fb68d..0783d8dc6 100644 --- a/include/variables.h +++ b/include/variables.h @@ -1743,7 +1743,7 @@ extern UNK_PTR D_801D618C; // extern UNK_TYPE1 D_801D6648; // extern UNK_TYPE1 D_801D664C; // extern UNK_TYPE1 D_801D6650; -// extern UNK_TYPE4 D_801D6654; +extern f32 D_801D6654; // extern UNK_TYPE1 D_801D6658; // extern UNK_TYPE1 D_801D665C; // extern UNK_TYPE1 D_801D6660; 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 b8e8988be..97e15ad8e 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -30,9 +30,9 @@ void Boss07_Incarnation_Draw(Actor* thisx, GlobalContext* globalCtx); void Boss07_Afterimage_Draw(Actor* thisx, GlobalContext* globalCtx); void func_809F4BB0(s32 arg0, ColliderJntSph* arg1, Vec3f* arg2); -s32 func_809FF678(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx); -void func_809FF6B0(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3s *rot, Actor *thisx); -void func_809FF810(GlobalContext *globalCtx, s32 limbIndex, Actor *thisx); +s32 func_809FF678(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); +void func_809FF6B0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); +void func_809FF810(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx); void func_80A07740(GlobalContext* globalCtx); void func_809FBF94(Boss07* this, GlobalContext* globalCtx); void func_80A03238(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, Vec3f* arg4, Vec3f* arg5, @@ -48,9 +48,9 @@ void func_809FB55C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* void func_809FB728(GlobalContext* globalCtx, s32 limbIndex, Actor* actor); void func_809FB7D4(Boss07* this, GlobalContext* globalCtx); void func_809FBB9C(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2); -void func_809FC8B0(u8 *arg0, Boss07* this, GlobalContext* globalCtx); -void func_809FC960(u8 *arg0, Boss07* this, GlobalContext* globalCtx); -void func_809FC4C0(Boss07 * this, u8 *arg1, f32 arg2); +void func_809FC8B0(u8* arg0, Boss07* this, GlobalContext* globalCtx); +void func_809FC960(u8* arg0, Boss07* this, GlobalContext* globalCtx); +void func_809FC4C0(Boss07* this, u8* arg1, f32 arg2); void func_809F7688(Boss07* this, GlobalContext* globalCtx); void func_809F783C(Boss07* this, GlobalContext* globalCtx); void func_809FFE64(Boss07* this, GlobalContext* globalCtx); @@ -64,6 +64,9 @@ void func_809F64F4(Boss07* this, GlobalContext* globalCtx); void func_809F7AB4(Boss07* this, GlobalContext* globalCtx); void func_809F99C4(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 func_809F4FAC(GlobalContext* globalCtx); void func_809F4AE8(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4); @@ -525,7 +528,7 @@ extern Vec3s D_80A07F3C[4]; extern s16 D_80A07F54[4]; extern EffTireMarkInit D_80A07F5C; extern EffTireMarkInit D_80A07F64; -extern Vec3f D_80A07F6C[5]; +extern f32 D_80A07F6C[][3]; extern Vec3f D_80A07FA8; extern Vec3f D_80A07FB4; extern Vec3f D_80A07FC0; @@ -601,7 +604,8 @@ extern AnimationHeader D_0601DEB4; extern AnimationHeader D_06022BB4; extern AnimationHeader D_06023DAC; extern UNK_TYPE D_06025018; -extern UNK_TYPE D_06025878; +extern AnimationHeader D_06025878; +extern AnimationHeader D_06026204; extern UNK_TYPE D_060269EC; extern UNK_TYPE D_06026EA0; extern UNK_TYPE D_06027270; @@ -611,21 +615,30 @@ extern Gfx D_0602EF88[]; extern UNK_TYPE D_0602EFE8; extern Gfx D_0602F640[]; extern UNK_TYPE D_0602F840; // title card +extern UNK_TYPE D_06032040; // title card +extern FlexSkeletonHeader D_060335F0; +extern AnimationHeader D_06033F80; +extern AnimationHeader D_06034E64; +extern AnimationHeader D_060358C4; +extern AnimationHeader D_06036A7C; +extern AnimationHeader D_06037ADC; +extern AnimationHeader D_0603918C; +extern AnimationHeader D_0603B330; +extern AnimationHeader D_0603C4E0; +extern AnimationHeader D_0603CBD0; +extern AnimationHeader D_0603D224; +extern AnimationHeader D_0603D7F0; +extern AnimationHeader D_0603DD1C; extern u16 D_0603DD30[]; extern u16 D_0603ED30[]; extern u16 D_0603F130[]; extern u16 D_06040130[]; +extern u16 D_06040930[]; extern u16 D_06040B30[]; extern u16 D_06041B30[]; extern u16 D_06042330[]; extern u16 D_06043330[]; -extern FlexSkeletonHeader D_060335F0; -extern UNK_TYPE D_06033F80; -extern AnimationHeader D_0603B330; -extern AnimationHeader D_0603CBD0; -extern UNK_TYPE D_0603D7F0; -extern UNK_TYPE D_0603DD1C; -extern u16 D_06040930[]; + void func_809F4980(Actor* arg0) { Audio_PlayActorSound2(arg0, NA_SE_EN_FOLLOWERS_DAMAGE); @@ -671,11 +684,12 @@ void func_809F4AE8(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* ar } } -void func_809F4BB0(s32 arg0, ColliderJntSph *arg1, Vec3f *arg2) { +void func_809F4BB0(s32 arg0, ColliderJntSph* arg1, Vec3f* arg2) { arg1->elements[arg0].dim.worldSphere.center.x = arg2->x; arg1->elements[arg0].dim.worldSphere.center.y = arg2->y; arg1->elements[arg0].dim.worldSphere.center.z = arg2->z; - arg1->elements[arg0].dim.worldSphere.radius = arg1->elements[arg0].dim.modelSphere.radius * arg1->elements[arg0].dim.scale; + arg1->elements[arg0].dim.worldSphere.radius = + arg1->elements[arg0].dim.modelSphere.radius * arg1->elements[arg0].dim.scale; } s32 func_809F4C40(Boss07* this, GlobalContext* globalCtx) { @@ -1026,7 +1040,118 @@ void func_809F5E14(Boss07* this, GlobalContext* globalCtx) { this->unk_17E8 = 5120.0f; } +#ifdef NON_MATCHING +void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { + this->unk_15C = 20; + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + this->unk_ABC8++; + SysMatrix_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); + switch (this->unk_ABD0) { + case 0: + this->unk_ABC8 = 0; + this->unk_ABD0 = 1; + this->unk_ABF8.z = 0.f; + this->unk_ABEC.x = 0.0; + this->unk_ABEC.y = gGameInfo->data[1265] + 100.0f - 30.0f + 80.0f; + this->unk_ABEC.z = gGameInfo->data[1266] + 270.0f - 150.0f + 30.0f - 50.0f; + this->unk_ABF8.x = 0.0f; + this->unk_ABF8.y = 180.0f; + case 1: + if (this->unk_ABC8 < 40) { + D_80A09A4C = 3; + } + if (this->unk_ABC8 > 20) { + if (this->unk_ABC8 == 21) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_GROW_HEAD_OLD); + } + Math_ApproachS(&this->unk_17D8, 0, 5, 0x1000); + this->unk_17DA = Math_SinS(this->unk_ABC8 * 0x1000) * this->unk_17E8; + this->unk_17DC = Math_SinS(this->unk_ABC8 * 0xB00) * this->unk_17E8 * 0.5f; + if (this->unk_ABC8 > 40) { + Math_ApproachZeroF(&this->unk_17E8, 1.0f, 200.0f); + } + } + if (this->unk_ABC8 >= 0x3D) { + Player* player = PLAYER; + s32 phi_v1 = 0; + + if (player->transformation == 1) { + phi_v1 = 1; + } else if (player->transformation == 0) { + phi_v1 = 2; + } else if (player->transformation == 2) { + phi_v1 = 3; + } else if (player->transformation == 3) { + phi_v1 = 4; + } + + Math_ApproachF(&this->unk_ABEC.y, D_80A07F6C[phi_v1][0], 0.075f, this->unk_AC0C * 7.0f); + Math_ApproachF(&this->unk_ABEC.z, D_80A07F6C[phi_v1][1], 0.075f, this->unk_AC0C * 17.0f); + Math_ApproachF(&this->unk_ABF8.y, D_80A07F6C[phi_v1][2], 0.075f, this->unk_AC0C * 7.0f); + Math_ApproachF(&this->unk_AC0C, 1.0f, 1.0f, 0.01f); + if (this->unk_ABC8 == 70) { + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06025018, -15.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_06025018); + func_8019FE1C(&this->actor.projectedPos, NA_SE_EV_ICE_PILLAR_RISING, 1.0f); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_SHOUT); + } + if (this->unk_ABC8 >= 110) { + Math_ApproachF(&this->unk_77C, 1.0f, 1.0f, 0.05f); + this->unk_794 = 0.79999995f; + this->unk_FA0 = 0.79999995f; + this->unk_798 = 1.0f; + this->unk_FA4 = 1.0f; + } + if (this->unk_ABC8 == 127) { + this->unk_77C = 1.0f; + } + if (this->unk_ABC8 == 120) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_HOP2_OLD); + func_8019F1C0(&D_80A09A40, NA_SE_EN_LAST3_VOICE_KICK_OLD); + func_8019FE74(&D_801D6654, 0.0f, 0x3C); + } + if (this->unk_ABC8 == 112) { + func_801A89A8(0x8069); + } + if (this->unk_ABC8 == 137) { + Actor_TitleCardCreate(globalCtx, &globalCtx->actorCtx.titleCtxt, + Lib_SegmentedToVirtual(&D_06032040), 0xA0, 0xB4, 0x80, 0x28); + } + if (func_801378B8(&this->skelAnime1, this->unk_1D4)) { + s32 i; + Camera* sp48 = Play_GetCamera(globalCtx, 0); + + this->unk_ABD0 = 0; + func_809F7400(this, globalCtx, 50); + sp48->eye = this->unk_ABD4; + sp48->eyeNext = this->unk_ABD4; + sp48->at = this->unk_ABE0; + func_80169AFC(globalCtx, this->unk_ABD2, 0); + this->unk_ABD2 = 0; + func_800EA0EC(globalCtx, &globalCtx->csCtx); + func_800B7298(globalCtx, &this->actor, 6); + this->actor.flags |= 1; + func_80165690(); + if (D_80A09A60[0] != NULL) { + for (i = 0; i < 4; i++) { + func_800BC154(globalCtx, &globalCtx->actorCtx, &D_80A09A60[i]->actor, 9); + } + } + } + } + break; + } + SysMatrix_MultiplyVector3fByState(&this->unk_ABEC, &this->unk_ABD4); + SysMatrix_MultiplyVector3fByState(&this->unk_ABF8, &this->unk_ABE0); + if (this->unk_ABD2 != 0) { + ShrinkWindow_SetLetterboxTarget(0x1B); + Play_CameraSetAtEye(globalCtx, this->unk_ABD2, &this->unk_ABE0, &this->unk_ABD4); + } +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F5E88.s") +#endif void func_809F64F4(Boss07* this, GlobalContext* globalCtx) { s32 i; @@ -1054,7 +1179,234 @@ void func_809F64F4(Boss07* this, GlobalContext* globalCtx) { this->unk_15C = 1000; } +#ifdef NON_MATCHING +void func_809F65F4(Boss07 *this, GlobalContext *globalCtx) { + s32 i; + s32 spC0 = 0; + Vec3f spB4; + Vec3f spA8 = D_80A07FA8; + f32 spA4; + f32 spA0; + Camera* temp_s0; + spA4 = 0.0f; + spA0 = 0.1f; + + temp_s0 = Play_GetCamera(globalCtx, 0); + this->unk_15C = 1000; + func_809F4CBC(this, 1.0f); + switch(this->unk_ABD0) { + case 0: + if (ActorCutscene_GetCurrentIndex() == -1) { + func_800EA0D4(globalCtx, &globalCtx->csCtx); + func_800B7298(globalCtx, &this->actor, 1); + this->unk_ABD2 = func_801694DC(globalCtx); + func_80169590(globalCtx, 0, 1); + func_80169590(globalCtx, this->unk_ABD2, 7); + Audio_PlayActorSound2(&this->actor, 0x39B8); + } + case 1: + this->unk_ABC8 = 0; + this->unk_ABD0 = 2; + this->unk_ABD4.x = temp_s0->eye.x; + this->unk_ABD4.y = temp_s0->eye.y; + this->unk_ABD4.z = temp_s0->eye.z; + this->unk_ABE0.x = temp_s0->at.x; + this->unk_ABE0.y = temp_s0->at.y; + this->unk_ABE0.z = temp_s0->at.z; + this->unk_AC04 = this->actor.shape.rot.y * M_PI / 0x8000; + this->unk_AC08 = this->unk_AC0C = D_80A09A58->unk_180C = 0.0f; + func_809F49A0(1, 0x71AC, 0x263A); + for(i = 0; i < 30; i++) { + this->unk_AB50[i] = func_809F49C0() - 1.0f; + } + func_8016566C(150); + case 2: + if (this->unk_ABC8 == 20) { + func_8019F1C0(&D_80A09A40, 0x39E3); + } + if (this->unk_ABC8 == 40) { + func_8019F1C0(&D_80A09A40, 0x39E3); + } + if (this->unk_ABC8 == 60) { + func_8019F1C0(&D_80A09A40, 0x39E3); + } + if (this->unk_ABC8 == 0x50) { + func_8019F1C0(&D_80A09A40, 0x39E3); + } + spB4.x = 0.0f; + spB4.y = -90.0f; + spB4.z = 350.0f; + this->unk_ABF8.x = this->actor.focus.pos.x; + this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f; + this->unk_ABF8.z = this->actor.focus.pos.z; + + if ((this->unk_ABC8 >= 50) && (this->unk_ABC8 < 80)) { + if (this->unk_ABC8 == 50) { + func_8019F1C0(&D_80A09A40, 0x39AF); + } + spB4.x = 30.0f; + spB4.z = 120.0f; + this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f + 30.0f; + spA4 = 200.0f; + spA0 = 1.0f; + } else if ((this->unk_ABC8 >= 80) && (this->unk_ABC8 < 110)) { + if (this->unk_ABC8 == 80) { + this->skelAnime1.animCurrentFrame -= 30.0f; + func_8019F1C0(&D_80A09A40, 0x39B4); + } + spB4.x = -10.0f; + spB4.z = 150.0f; + this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f - 60.0f; + spA4 = 200.0f; + spA0 = 1.0f; + } else if ((this->unk_ABC8 >= 110) && (this->unk_ABC8 < 140)) { + if (this->unk_ABC8 == 110) { + func_8019F1C0(&D_80A09A40, 0x39B5); + } + spB4.x = -70.0f; + spB4.z = 110.0f; + this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f + 30.0f; + spA4 = 200.0f; + spA0 = 1.0f; + } + if (this->unk_ABC8 >= (gGameInfo->data[1551] + 140)) { + this->unk_ABD0 = 4; + this->unk_AC14 = gGameInfo->data[1552] + 270.0f + 50.0f; + func_8019F1C0(&D_80A09A40, 0x39BF); + } else { + break; + } + case 4: + if ((this->unk_ABC8 >= (gGameInfo->data[1626] + 260)) && (this->unk_ABC8 < (gGameInfo->data[1627] + 370))) { + spC0 = gGameInfo->data[1262] + 1; + this->unk_AC04 = this->actor.shape.rot.y * M_PI / 0x8000; + spB4.x = 0.0f; + spB4.y = this->unk_AC14 + -190.0f; + spB4.z = gGameInfo->data[1553] + 390.0f - 380.0f; + + this->unk_ABF8.x = this->actor.focus.pos.x; + this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f - 60.0f + 130.0f + gGameInfo->data[1554]; + this->unk_ABF8.z = this->actor.focus.pos.z; + + spA0 = 1.0f; + + Math_ApproachF(&this->unk_AC14, gGameInfo->data[1555] + 240.0f, 0.05f, 1.0f + (gGameInfo->data[1556] * 0.1f)); + spA4 = 2000.0f; + this->unk_1D8 = gGameInfo->data[1329] + 10; + this->unk_AB48 = 1; + func_8019F1C0(&D_80A09A40, 0x205B); + } else { + spB4.x = 0.0f; + spB4.y = -190.0f; + spB4.z = 390.0f; + this->unk_ABF8.x = this->actor.focus.pos.x; + this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f - 60.0f; + this->unk_ABF8.z = this->actor.focus.pos.z; + this->unk_1D8 = 0; + if (this->unk_ABC8 > 330) { + spA4 = 2000.0f; + spA0 = 1.0f; + } + Math_ApproachZeroF(&this->actor.world.pos.x, 0.1f, this->unk_AC0C); + Math_ApproachZeroF(&this->actor.world.pos.z, 0.1f, this->unk_AC0C); + Math_ApproachF(&this->unk_AC0C, 5.0f, 1.0f, 0.1f); + } + if (this->unk_ABC8 >= 260) { + f32 sp98; + f32 sp94; + s16 temp_a0; + + if (this->unk_ABC8 == 260) { + func_801A479C(&D_80A09A40, 0x39B6, 0x3C); + } + globalCtx->envCtx.unk_E5 = 1; + globalCtx->envCtx.unk_E6[0] = globalCtx->envCtx.unk_E6[1] = globalCtx->envCtx.unk_E6[2] = 0xFF; + if (this->unk_ABC8 < 350) { + sp98 = 0.5f; + sp94 = 0.02f; + globalCtx->envCtx.unk_E6[3] = 0; + } else { + sp98 = 5.0f; + sp94 = 0.1f; + temp_a0 = (this->unk_ABC8 * 2) - 700; + temp_a0 = CLAMP_MAX(temp_a0, 250); + globalCtx->envCtx.unk_E6[3] = temp_a0; + if (this->unk_ABC8 == 400) { + func_8019FE74(&D_801D6654, 0.0f, 90); + } + if (this->unk_ABC8 == (gGameInfo->data[1342] + 440)) { + globalCtx->nextEntranceIndex = 0x5400; + gSaveContext.nextCutsceneIndex = 0xFFF7; + globalCtx->sceneLoadFlag = 0x14; + } + } + if (this->unk_ABC8 > 300) { + D_80A09A58->unk_1808 = 1; + Math_ApproachF(&D_80A09A58->unk_180C, 30.0f, 0.1f, 1.5f); + D_80A09A58->unk_1810 = this->unk_334[2]; + Math_ApproachF(&this->unk_AB4C, 1.0f, 0.1f, 0.05f); + for(i = 0; i < 30; i++) { + Math_ApproachF(&this->unk_AB50[i], sp98, 1.0f, sp94); + } + Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.1f); + } + } + this->unk_AC04 += this->unk_AC08; + this->unk_AC08 += 0.0004f; + if (this->unk_AC08 > 0.02f) { + this->unk_AC08 = 0.02f; + } + if (this->unk_ABC8 >= (gGameInfo->data[1629] + 180)) { + Vec3f sp84 = D_80A07FB4; + Vec3f sp78 = D_80A07FC0; + Vec3f sp6C; + f32 sp68; + + play_sound(0x2159); + sp68 = (spC0 == 0) ? 2.0f : (gGameInfo->data[1301] * 0.01f) + 0.2f; + spA8.x = Math_SinS(this->unk_ABC8 * 0x7000) * sp68; + spA8.y = Math_SinS(this->unk_ABC8 * 0x5000) * sp68 * 2.5f; + spA8.z = Math_CosS(this->unk_ABC8 * 0x8000) * sp68; + for(i = 0; i < 2; i++) { + sp6C.x = randPlusMinusPoint5Scaled(500.0f) + this->actor.world.pos.x; + sp6C.y = Rand_ZeroFloat(50.0f) + this->actor.world.pos.y + 200.0f; + sp6C.z = randPlusMinusPoint5Scaled(500.0f) + this->actor.world.pos.z; + EffectSsHahen_Spawn(globalCtx, &sp6C, &sp84, &sp78, 0, Rand_ZeroFloat(5.0f) + 20.0f, -1, 0xA, NULL); + } + } + if (this->unk_ABC8 >= (gGameInfo->data[1630] + 290)) { + this->unk_1D8 = gGameInfo->data[1334] + 25; + Math_ApproachZeroF(&this->unk_77C, 1.0f, 0.015f); + } + break; + } + SysMatrix_InsertYRotation_f(this->unk_AC04, 0); + SysMatrix_MultiplyVector3fByState(&spB4, &this->unk_ABEC); + this->unk_ABEC.x += this->actor.focus.pos.x; + this->unk_ABEC.y += this->actor.focus.pos.y; + this->unk_ABEC.z += this->actor.focus.pos.z; + + Math_ApproachF(&this->unk_ABD4.x, this->unk_ABEC.x, spA0, 40.0f + spA4); + Math_ApproachF(&this->unk_ABD4.y, this->unk_ABEC.y, spA0, 40.0f + spA4); + Math_ApproachF(&this->unk_ABD4.z, this->unk_ABEC.z, spA0, 40.0f + spA4); + + Math_ApproachF(&this->unk_ABE0.x, this->unk_ABF8.x, spA0, 70.0f + spA4); + Math_ApproachF(&this->unk_ABE0.y, this->unk_ABF8.y, spA0, 70.0f + spA4); + Math_ApproachF(&this->unk_ABE0.z, this->unk_ABF8.z, spA0, 70.0f + spA4); + if (this->unk_ABD2 != 0) { + Vec3f sp5C; + + sp5C.x = this->unk_ABE0.x + spA8.x; + sp5C.y = this->unk_ABE0.y + spA8.y; + sp5C.z = this->unk_ABE0.z + spA8.z; + Play_CameraSetAtEye(globalCtx, this->unk_ABD2, &sp5C, &this->unk_ABD4); + } + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + this->unk_ABC8++; +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F65F4.s") +#endif void func_809F7400(Boss07* this, GlobalContext* globalCtx, s16 arg2) { this->actionFunc = func_809F748C; @@ -1067,23 +1419,250 @@ void func_809F7400(Boss07* this, GlobalContext* globalCtx, s16 arg2) { this->actor.flags |= 1; } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F748C.s") +void func_809F748C(Boss07 *this, GlobalContext *globalCtx) { + Player *player = PLAYER; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F7688.s") + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + func_809F4CBC(this, 2.0f); + this->unk_794 = 0.7f; + this->unk_FA0 = 0.7f; + this->unk_790 = -15.0f; + this->unk_F9C = -15.0f; + this->unk_798 = 2.0f; + this->unk_FA4 = 2.0f; + this->unk_79C = 0.0f; + this->unk_FA8 = 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); + } else if (this->timers[0] == 0) { + if (gGameInfo->data[1326] == 1) { + func_809F8E68(this, globalCtx); + } else if ((s8) this->actor.colChkInfo.health >= 28) { + func_809F7D2C(this, globalCtx); + } else if (((s8) this->actor.colChkInfo.health <= 12) && (Rand_ZeroOne() < 0.65f)) { + func_809F8E68(this, globalCtx); + } else if (Rand_ZeroOne() < 0.3f) { + func_809F8658(this, globalCtx); + } else { + func_809F7D2C(this, globalCtx); + } + } + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); + this->unk_174 = 1; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F76D0.s") +void func_809F7688(Boss07 *this, GlobalContext *globalCtx) { + this->actionFunc = func_809F76D0; + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06025878, -5.0f); + this->unk_14C = 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F77A8.s") +void func_809F76D0(Boss07 *this, GlobalContext *globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + this->unk_794 = 0.7f; + this->unk_FA0 = 0.7f; + this->unk_798 = 2.0f; + this->unk_FA4 = 2.0f; + this->unk_790 = -15.0f; + this->unk_F9C = -15.0f; + this->unk_79C = 0.0f; + this->unk_FA8 = 0.0f; + if (this->unk_14C == 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->actor.speedXZ = 20.0f; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F783C.s") +void func_809F77A8(Boss07 *this, GlobalContext *globalCtx) { + Audio_PlayActorSound2(&this->actor, 0x3014); + if (this->unk_14C == 13) { + func_8019F1C0(&D_80A09A40, 0x3A57); + } + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + if (this->actor.bgCheckFlags & 1) { + func_809F7400(this, globalCtx, 1); + this->unk_156 = 5; + } + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x4000); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F7968.s") +void func_809F783C(Boss07 *this, GlobalContext *globalCtx) { + f32 dx; + f32 dz; + s16 temp; + Vec3f sp30; + s32 pad; + -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F7AB4.s") + this->actionFunc = func_809F7968; + this->actor.velocity.y = 25.0f; + dx = 0.0f - this->actor.world.pos.x; + dz = 0.0f - this->actor.world.pos.z; + // temp2 = ; + temp = this->actor.yawTowardsPlayer - (s16)(Math_Acot2F(dz,dx) * (M_PI / 0x8000)); + if (temp < 0) { + dx = 200.0f; + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603D224, -5.0f); + } else { + dx = -200.0f; + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603D7F0, -5.0f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F7BC4.s") + } + Matrix_RotateY(this->actor.yawTowardsPlayer, 0); + SysMatrix_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) * (M_PI / 0x8000); + this->unk_14C = 0; + this->actor.speedXZ = 17.0f; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F7D2C.s") +void func_809F7968(Boss07 *this, GlobalContext *globalCtx) { + Audio_PlayActorSound2(&this->actor, 0x3014); + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + this->unk_794 = 0.7f; + this->unk_FA0 = 0.7f; + this->unk_798 = 2.0f; + this->unk_FA4 = 2.0f; + this->unk_790 = -15.0f; + this->unk_F9C = -15.0f; + this->unk_79C = 0.0f; + this->unk_FA8 = 0.0f; + if ((this->unk_14C == 10) && (Rand_ZeroOne() < 0.5f)) { + func_8019F1C0(&D_80A09A40, 0x3A57); + } + if ((this->actor.velocity.y < 0.0f) && (this->actor.bgCheckFlags & 1)) { + if (Rand_ZeroOne() < 0.3f) { + func_809F51E8(this, globalCtx, 1); + } else { + func_809F7400(this, globalCtx, 1); + this->actor.speedXZ = 5.0f; + } + this->unk_156 = 5; + } + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x4000); +} + +void func_809F7AB4(Boss07 *this, GlobalContext *globalCtx) { + f32 phi_f12; + f32 phi_f14; + s32 pad; + s16 sp22; + + this->actionFunc = func_809F7BC4; + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &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) * (M_PI / 0x8000)); + Matrix_RotateY(this->actor.shape.rot.y, 0); + if (sp22 < 0) { + this->skelAnime1.animPlaybackSpeed = 1.0f; + phi_f14 = 300.0f; + } else { + this->skelAnime1.animPlaybackSpeed = -1.0f; + phi_f14 = -300.0f; + } + SysMatrix_GetStateTranslationAndScaledX(phi_f14, &this->unk_164); + this->unk_164.x += this->actor.world.pos.x; + this->unk_164.z += this->actor.world.pos.z; + this->timers[1] = 21; + this->unk_158 = 10; + this->unk_170 = 0.0f; + this->unk_ABCC = 0; +} + +void func_809F7BC4(Boss07 *this, GlobalContext *globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + if (this->unk_14C == 20) { + Audio_PlayActorSound2(this, 0x3A53); + } + this->unk_ABCC++; + if ((this->unk_ABCC % 16) == 0) { + func_8019F1C0(&D_80A09A40, 0x39E3); + } + this->unk_794 = 0.7f; + this->unk_FA0 = 0.7f; + this->unk_798 = 2.0f; + this->unk_FA4 = 2.0f; + this->unk_790 = -15.0f; + this->unk_F9C = -15.0f; + this->unk_79C = 0.0f; + this->unk_FA8 = 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); + } else { + func_809F7400(this, globalCtx, 1); + } + } +} + +void func_809F7D2C(Boss07 *this, GlobalContext *globalCtx) { + Player* player = PLAYER; + + this->actionFunc = func_809F805C; + this->timers[1] = 0; + if (player->stateFlags3 & 0x100) { + this->unk_14E = 4; + } else if (this->actor.xzDistToPlayer <= 300.0f) { + if(this->actor.xzDistToPlayer <= 200.0f) { + this->unk_14E = 7; + } else { + this->unk_14E = 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; + } + } + switch (this->unk_14E) { + case 0: + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06033F80, -5.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_06033F80); + break; + case 1: + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06034E64, -5.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_06034E64); + break; + case 2: + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_060358C4, -5.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_060358C4); + break; + case 3: + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06036A7C, -5.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_06036A7C); + break; + case 4: + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603C4E0, -5.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_0603C4E0); + func_809F4D10(&this->unk_164, 650.0f); + this->unk_170 = 0.0f; + break; + case 5: + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06037ADC, -5.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_06037ADC); + break; + case 6: + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603918C, -5.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_0603918C); + break; + case 7: + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06026204, -5.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_06026204); + break; + } + this->unk_14C = 0; +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F805C.s") @@ -1197,7 +1776,8 @@ void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx f32 dxz1; player->actor.parent = &this->actor; - func_801A5CFC(0x6805, &player->actor.projectedPos, 4, &D_801DB4B0, &D_801DB4B0, &D_801DB4B8); + func_801A5CFC(NA_SE_VO_LI_DAMAGE_S, &player->actor.projectedPos, 4, &D_801DB4B0, &D_801DB4B0, + &D_801DB4B8); this->unk_F7C = 0; this->unk_F7E = ((this->actor.xzDistToPlayer - 300.0f) / 22.0f) + 10.0f; dx1 = player->actor.world.pos.x - this->unk_7A0.x; @@ -1480,12 +2060,12 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FBB9C.s") #ifdef NON_MATCHING -void func_809FBF94(Boss07 *this, GlobalContext *globalCtx) { +void func_809FBF94(Boss07* this, GlobalContext* globalCtx) { s32 pad; s32 pad2; f32 sp54; f32 sp50; - Player *sp4C = PLAYER; + Player* sp4C = PLAYER; // GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -1505,7 +2085,10 @@ void func_809FBF94(Boss07 *this, GlobalContext *globalCtx) { sp54 -= 43.0f; } - SysMatrix_InsertTranslation(sp4C->actor.world.pos.x, sp4C->actor.world.pos.y + func_800B6FC8(sp4C) - 20.0f + sp54 + gGameInfo->data[1596], sp4C->actor.world.pos.z + gGameInfo->data[1597] - 15.0f + sp50, 0); + SysMatrix_InsertTranslation(sp4C->actor.world.pos.x, + sp4C->actor.world.pos.y + func_800B6FC8(sp4C) - 20.0f + sp54 + + gGameInfo->data[1596], + sp4C->actor.world.pos.z + gGameInfo->data[1597] - 15.0f + sp50, 0); SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); Matrix_Scale(this->unk_AB44, this->unk_AB44, this->unk_AB44, 1); @@ -1519,10 +2102,10 @@ void func_809FBF94(Boss07 *this, GlobalContext *globalCtx) { #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FBF94.s") #endif -void Boss07_Wrath_Draw(Actor *thisx, GlobalContext *globalCtx2) { +void Boss07_Wrath_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; - u8 *sp54 = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(u8[0x40][0x40])); + u8* sp54 = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(u8[0x40][0x40])); OPEN_DISPS(globalCtx->state.gfxCtx); Vec3f sp58; @@ -1534,12 +2117,15 @@ void Boss07_Wrath_Draw(Actor *thisx, GlobalContext *globalCtx2) { } SysMatrix_InsertYRotation_f(this->unk_184, 1); SysMatrix_RotateStateAroundXAxis(this->unk_188); - func_801343C0(globalCtx, this->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, (s32) this->skelAnime1.dListCount, func_809FB504, func_809FB55C, func_809FB728, &this->actor); + func_801343C0(globalCtx, this->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, (s32)this->skelAnime1.dListCount, + func_809FB504, func_809FB55C, func_809FB728, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); if (((gGameInfo->data[1311] == 0) || (gGameInfo->data[1311] == 2)) && (this->unk_149 != 0)) { - func_809FAA44(this, globalCtx, &this->unk_7A0, this->unk_7AC, this->unk_A04, this->unk_C5C, this->unk_790, this->unk_794, this->unk_798, this->unk_79C, &this->unk_788, this->unk_F7E, this->unk_77C, 0); - func_809FAA44(this, globalCtx, &this->unk_FAC, this->unk_FB8, this->unk_1210, this->unk_1468, this->unk_F9C, this->unk_FA0, this->unk_FA4, this->unk_FA8, &this->unk_F94, 0, this->unk_77C, 1); + func_809FAA44(this, globalCtx, &this->unk_7A0, this->unk_7AC, this->unk_A04, this->unk_C5C, this->unk_790, + this->unk_794, this->unk_798, this->unk_79C, &this->unk_788, this->unk_F7E, this->unk_77C, 0); + func_809FAA44(this, globalCtx, &this->unk_FAC, this->unk_FB8, this->unk_1210, this->unk_1468, this->unk_F9C, + this->unk_FA0, this->unk_FA4, this->unk_FA8, &this->unk_F94, 0, this->unk_77C, 1); } func_809FB114(this, globalCtx, this->unk_7AC, this->unk_A04, this->unk_77C, 0); func_809FB114(this, globalCtx, this->unk_FB8, this->unk_1210, this->unk_77C, 1); @@ -1552,32 +2138,104 @@ void Boss07_Wrath_Draw(Actor *thisx, GlobalContext *globalCtx2) { sp58.y = this->unk_334[2].y - 30.0f + 50.0f; sp58.z = this->unk_334[2].z; func_809FBB9C(this, globalCtx, &sp58); - func_800BE680(globalCtx, &this->actor, this->unk_334, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, this->unk_1804); + func_800BE680(globalCtx, &this->actor, this->unk_334, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, + this->unk_1804); this->unk_149 = 0; CLOSE_DISPS(globalCtx->state.gfxCtx); } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FC4C0.s") - -void func_809FC8B0(u8 *arg0, Boss07 *this, GlobalContext *globalCtx) { +void func_809FC4C0(Boss07* this, u8* shadowTexture, f32 arg2) { + s32 temp_t0; + s32 temp_t1; + s32 temp_v0; + s32 phi_a0; + s32 phi_a3; + s32 j = 0; s32 i; - s32* temp = (s32*) arg0; + Vec3f lerp; + Vec3f sp74; + Vec3f sp68; - for(i = 0; i < 0x400; i++, temp++) { + for (i = 0; i < 15; i++) { + if ((arg2 == 0.0f) || ((j = D_80A08140[i]) >= 0)) { + if (arg2 > 0.0f) { + VEC3F_LERPIMPDST(&lerp, &this->unk_334[i], &this->unk_334[j], arg2); + + sp74.x = lerp.x - this->actor.world.pos.x; + sp74.y = lerp.y - this->actor.world.pos.y + 76.0f + 30.0f + 30.0f + 100.0f; + sp74.z = lerp.z - this->actor.world.pos.z; + } else { + sp74.x = this->unk_334[i].x - this->actor.world.pos.x; + sp74.y = this->unk_334[i].y - this->actor.world.pos.y + 76.0f + 30.0f + 30.0f + 100.0f; + sp74.z = this->unk_334[i].z - this->actor.world.pos.z; + } + SysMatrix_MultiplyVector3fByState(&sp74, &sp68); + + sp68.x *= 0.2f; + sp68.y *= 0.2f; + temp_t0 = (u16)(s32)(sp68.x + 32.0f); + temp_t1 = (u16)((s32)sp68.y << 6); + + if (D_80A0817C[i] == 2) { + for (j = 0, phi_a3 = -0x180; j < 12; j++, phi_a3 += 0x40) { + for (phi_a0 = -D_80A08110[j]; phi_a0 < D_80A08110[j]; phi_a0++) { + temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; + if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { + shadowTexture[temp_v0] = 255; + } + } + } + } else if (D_80A0817C[i] == 1) { + for (j = 0, phi_a3 = -0x100; j < 8; j++, phi_a3 += 0x40) { + for (phi_a0 = -D_80A080F0[j]; phi_a0 < D_80A080F0[j]; phi_a0++) { + temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; + if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { + shadowTexture[temp_v0] = 255; + } + } + } + } else if (D_80A0817C[i] == 0) { + for (j = 0, phi_a3 = -0xC0; j < 7; j++, phi_a3 += 0x40) { + for (phi_a0 = -D_80A080D4[j]; phi_a0 < D_80A080D4[j] - 1; phi_a0++) { + temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; + if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { + shadowTexture[temp_v0] = 255; + } + } + } + } else { + for (j = 0, phi_a3 = -0x80; j < 6; j++, phi_a3 += 0x40) { + for (phi_a0 = -D_80A080BC[j]; phi_a0 < D_80A080BC[j] - 1; phi_a0++) { + temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; + if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { + shadowTexture[temp_v0] = 255; + } + } + } + } + } + } +} + +void func_809FC8B0(u8* arg0, Boss07* this, GlobalContext* globalCtx) { + s32 i; + s32* temp = (s32*)arg0; + + for (i = 0; i < 0x400; i++, temp++) { *temp = 0; } SysMatrix_SetStateXRotation(1.0f); - for(i = 0; i < 6; i++) { + for (i = 0; i < 6; i++) { func_809FC4C0(this, arg0, i / 5.0f); } } #ifdef NON_MATCHING -void func_809FC960(u8 *arg0, Boss07 *thisx, GlobalContext *globalCtx2) { +void func_809FC960(u8* arg0, Boss07* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; GraphicsContext* pad3 = globalCtx->state.gfxCtx; - + OPEN_DISPS(pad3); f32 phi_f0; @@ -1591,7 +2249,8 @@ void func_809FC960(u8 *arg0, Boss07 *thisx, GlobalContext *globalCtx2) { Matrix_Scale(1.75f, 1.0f, 1.75f, 1); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); gSPDisplayList(POLY_OPA_DISP++, D_0602EF68); - gDPLoadTextureBlock(POLY_OPA_DISP++, arg0, 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); + gDPLoadTextureBlock(POLY_OPA_DISP++, arg0, 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); gSPDisplayList(POLY_OPA_DISP++, D_0602EF88); CLOSE_DISPS(pad3); } @@ -1793,20 +2452,21 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Incarnation_Update.s") #endif -void Boss07_Afterimage_Draw(Actor *thisx, GlobalContext *globalCtx2) { +void Boss07_Afterimage_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; - Boss07 *sp34 = (Boss07*) this->actor.parent; + Boss07* sp34 = (Boss07*)this->actor.parent; OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 0, 0, 100, 155, 900, 1099); - SkelAnime_DrawSV(globalCtx, sp34->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, sp34->skelAnime1.dListCount, NULL, NULL, &this->actor); + SkelAnime_DrawSV(globalCtx, sp34->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, sp34->skelAnime1.dListCount, + NULL, NULL, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx); } -s32 func_809FF678(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { +s32 func_809FF678(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { Boss07* this = THIS; if (limbIndex == 24) { @@ -1815,7 +2475,7 @@ s32 func_809FF678(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3f *p return false; } -void func_809FF6B0(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3s *rot, Actor *thisx) { +void func_809FF6B0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { Boss07* this = THIS; Vec3f sp28; s8 i; @@ -1856,21 +2516,23 @@ void func_809FF6B0(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3s * } } -void func_809FF810(GlobalContext *globalCtx, s32 limbIndex, Actor *thisx) { +void func_809FF810(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { Boss07* this = THIS; if (limbIndex == 3) { Matrix_Scale(this->unk_17F4, this->unk_17F0, 1.0f, 1); } - if ((limbIndex == 0xA) || (limbIndex == 0xC) || (limbIndex == 0xD) || (limbIndex == 0xF) || (limbIndex == 0x11) || (limbIndex == 0x12)) { + 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 == 5) || (limbIndex == 7) || (limbIndex == 8) || (limbIndex == 0x14) || (limbIndex == 0x16) || (limbIndex == 0x17)) { + if ((limbIndex == 5) || (limbIndex == 7) || (limbIndex == 8) || (limbIndex == 0x14) || (limbIndex == 0x16) || + (limbIndex == 0x17)) { Matrix_Scale(1.0f, this->unk_17E4, this->unk_17E4, 1); } } -void Boss07_Incarnation_Draw(Actor *thisx, GlobalContext *globalCtx2) { +void Boss07_Incarnation_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; @@ -1880,9 +2542,11 @@ void Boss07_Incarnation_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); } - func_801343C0(globalCtx, this->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, this->skelAnime1.dListCount, func_809FF678, func_809FF6B0, func_809FF810, &this->actor); + func_801343C0(globalCtx, this->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, this->skelAnime1.dListCount, + func_809FF678, func_809FF6B0, func_809FF810, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); - func_800BE680(globalCtx, &this->actor, this->unk_334, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, this->unk_1804); + func_800BE680(globalCtx, &this->actor, this->unk_334, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, + this->unk_1804); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -1903,7 +2567,7 @@ void func_809FFA80(Boss07* this, GlobalContext* globalCtx) { Player* player = PLAYER; SkelAnime_FrameUpdateMatrix(&this->skelAnime1); - Audio_PlayActorSound2(&this->actor, 0x31E4); + 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)) { @@ -1958,7 +2622,7 @@ void func_809FFE64(Boss07* this, GlobalContext* globalCtx) { this->unk_ABD0 = 0; this->timers[0] = 30; this->unk_18D4 = 0; - Audio_PlayActorSound2(&this->actor, 0x39D4); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_ATTACK_OLD); } void func_809FFEAC(Boss07* this, GlobalContext* globalCtx) { @@ -1994,7 +2658,7 @@ void func_809FFEAC(Boss07* this, GlobalContext* globalCtx) { this->unk_164.y = sp20->actor.world.pos.y + 10.0f; this->unk_164.z = sp20->actor.world.pos.z; } else { - Audio_PlayActorSound2(&this->actor, 0x31E6); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_ROLLING_OLD - SFX_FLAG); } sp30 = this->unk_164.x - this->actor.world.pos.x; sp2C = this->unk_164.y - this->actor.world.pos.y; @@ -2015,7 +2679,7 @@ void func_809FFEAC(Boss07* this, GlobalContext* globalCtx) { this->unk_164.y = Rand_ZeroFloat(100.0f) + 100.0f; if (Rand_ZeroOne() < 0.3f) { this->timers[1] = 20; - Audio_PlayActorSound2(&this->actor, 0x39E5); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_ATTACK_2ND_OLD); this->unk_ABD0 = 1; } else { this->timers[1] = 0; @@ -2045,12 +2709,12 @@ void func_80A0021C(Boss07* this, GlobalContext* globalCtx) { void func_80A00274(Boss07* this, GlobalContext* globalCtx) { SkelAnime_FrameUpdateMatrix(&this->skelAnime1); - func_8019F1C0(&D_80A09A40, 0x301B); + func_8019F1C0(&D_80A09A40, NA_SE_EN_COMMON_WEAKENED - SFX_FLAG); func_809F4CBC(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); if (this->actor.world.pos.y > 51.0f) { - Audio_PlayActorSound2(&this->actor, 0x31D7); + 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->unk_170, 15.0f, 1.0f, 1.0f); @@ -2116,7 +2780,7 @@ void func_80A00554(Boss07* this, GlobalContext* globalCtx) { this->unk_148 = 1; Enemy_StartFinishingBlow(globalCtx, &this->actor); func_801A72CC(&this->actor.projectedPos); - Audio_PlayActorSound2(&this->actor, 0x3A02); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_DEAD_OLD); } else { this->unk_164.x = this->actor.world.pos.x; this->unk_164.y = 200.0f; @@ -2183,7 +2847,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { switch (this->unk_14E) { case 0: if (this->timers[0] == 25) { - func_8019F1C0(&D_80A09A40, 0x39D2); + func_8019F1C0(&D_80A09A40, NA_SE_EN_LAST1_BLOW_OLD); } if (this->timers[0] == 0) { this->unk_14E = 1; @@ -2199,7 +2863,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { } break; case 2: - play_sound(0x31D3); + 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; @@ -2208,7 +2872,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { break; case 3: case 4: - play_sound(0x31D3); + play_sound(NA_SE_EN_LAST1_BEAM_OLD - SFX_FLAG); case 5: Math_ApproachF(&this->unk_1890, 1.0f, 0.2f, 0.2f); temp_f20 = player->actor.world.pos.x - this->unk_189C.x; @@ -2299,7 +2963,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { this->unk_15C = 50; this->unk_15E = 15; func_801A72CC(&this->actor.projectedPos); - Audio_PlayActorSound2(&this->actor, 0x39D6); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_DAMAGE2_OLD); func_80A00484(this, globalCtx, 2, NULL); func_80A006D0(this); for (phi_s0_2 = 0; phi_s0_2 < 20; phi_s0_2++) { @@ -2357,7 +3021,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { } else { D_80A09A60[sp178]->unk_14E = 2; D_80A09A60[sp178]->unk_18D6 = 60; - Audio_PlayActorSound2(&this->actor, 0x3A0D); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_DEAD); for (pad = 0; pad < 20; pad++) { spE0.x = D_80A09A60[sp178]->actor.world.pos.x + randPlusMinusPoint5Scaled(50.0f); @@ -2407,7 +3071,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { player->flameTimers[pad2] = Rand_S16Offset(0, 200); } player->isBurning = true; - func_800B8E58(&player->actor, player->ageProperties->unk_92 + 0x681E); + func_800B8E58(&player->actor, player->ageProperties->unk_92 + NA_SE_VO_LI_DEMO_DAMAGE); } } if (sp14B) { @@ -2633,7 +3297,7 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A03F18.s") #ifdef NON_MATCHING -void Boss07_Mask_Draw(Actor *thisx, GlobalContext *globalCtx2) { +void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; s32 i; @@ -2645,7 +3309,7 @@ void Boss07_Mask_Draw(Actor *thisx, GlobalContext *globalCtx2) { Vec3f spA8; Vec3f sp9C; Vec3f sp90; - + OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); func_8012C2DC(globalCtx->state.gfxCtx); @@ -2657,12 +3321,16 @@ void Boss07_Mask_Draw(Actor *thisx, GlobalContext *globalCtx2) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); } gSPSegment(POLY_OPA_DISP++, 8, Lib_SegmentedToVirtual(D_80A082E0[this->unk_1884])); - SkelAnime_Draw(globalCtx, this->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, NULL, func_80A03F18, &this->actor); + SkelAnime_Draw(globalCtx, this->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, NULL, func_80A03F18, + &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); gSPDisplayList(POLY_OPA_DISP++, D_0600AFB0); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); - phi_s6 = ((this->actionFunc == func_809FFA80) && (ABS_ALT((s16)(this->actor.world.rot.y - this->actor.shape.rot.y)) > 0x4000)) ? 1 : 0; + phi_s6 = ((this->actionFunc == func_809FFA80) && + (ABS_ALT((s16)(this->actor.world.rot.y - this->actor.shape.rot.y)) > 0x4000)) + ? 1 + : 0; Matrix_RotateY(this->actor.shape.rot.y, 0); SysMatrix_InsertXRotation_s(this->actor.shape.rot.x, 1); @@ -2672,7 +3340,7 @@ void Boss07_Mask_Draw(Actor *thisx, GlobalContext *globalCtx2) { spA8.y = 20.0f; spA8.z = -2.0f; phi_f24 = 0.0f; - for(i = 0; i < 25; i++) { + for (i = 0; i < 25; i++) { SysMatrix_StatePush(); SysMatrix_StatePush(); SysMatrix_InsertZRotation_f(phi_f24, 1); @@ -2680,16 +3348,17 @@ void Boss07_Mask_Draw(Actor *thisx, GlobalContext *globalCtx2) { this->unk_19F0[i].unk_0.x = this->unk_1878.x + sp9C.x; this->unk_19F0[i].unk_0.y = this->unk_1878.y + sp9C.y; this->unk_19F0[i].unk_0.z = this->unk_1878.z + sp9C.z; - + pad2 = (1 - (i * 0.008f)) * this->unk_1870; SysMatrix_StatePop(); if (this->unk_149 != 0) { - func_80A03238(this, globalCtx, &this->unk_19F0[i].unk_0, this->unk_19F0[i].unk_C, this->unk_19F0[i].unk_84, this->unk_19F0[i].unk_FC, &sp90, pad2, phi_s6, phi_f24); + func_80A03238(this, globalCtx, &this->unk_19F0[i].unk_0, this->unk_19F0[i].unk_C, this->unk_19F0[i].unk_84, + this->unk_19F0[i].unk_FC, &sp90, pad2, phi_s6, phi_f24); } func_80A036C4(this, globalCtx, this->unk_19F0[i].unk_C, this->unk_19F0[i].unk_84, pad2, i * 0.9f); phi_f24 += 0.5f; spA8.y += 1.0f; - + SysMatrix_StatePop(); } func_80A03868(this, globalCtx); @@ -2753,15 +3422,17 @@ void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx2) { #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Projectile_Update.s") #endif -void Boss07_Projectile_Draw(Actor *thisx, GlobalContext *globalCtx2) { +void Boss07_Projectile_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C2DC(globalCtx->state.gfxCtx); gDPPipeSync(POLY_XLU_DISP++); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, D_80A07968[this->unk_181C][0], D_80A07968[this->unk_181C][1], D_80A07968[this->unk_181C][2], 255); - gDPSetEnvColor(POLY_XLU_DISP++, D_80A07950[this->unk_181C][0], D_80A07950[this->unk_181C][1], D_80A07950[this->unk_181C][2], 128); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, D_80A07968[this->unk_181C][0], D_80A07968[this->unk_181C][1], + D_80A07968[this->unk_181C][2], 255); + gDPSetEnvColor(POLY_XLU_DISP++, D_80A07950[this->unk_181C][0], D_80A07950[this->unk_181C][1], + D_80A07950[this->unk_181C][2], 128); SysMatrix_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); SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); @@ -2823,7 +3494,7 @@ void Boss07_Remains_Update(Actor* thisx, GlobalContext* globalCtx2) { Math_ApproachZeroF(&this->unk_18D0, 1.0f, 1.0f); } -void Boss07_Remains_Draw(Actor *thisx, GlobalContext *globalCtx2) { +void Boss07_Remains_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; f32 sp64; @@ -2840,7 +3511,7 @@ void Boss07_Remains_Draw(Actor *thisx, GlobalContext *globalCtx2) { SysMatrix_InsertYRotation_f(Math_SinS(this->unk_15C * 0x4500) * sp64, 1); SysMatrix_RotateStateAroundXAxis(sp60); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); - switch(this->actor.params) { + switch (this->actor.params) { case 200: gSPDisplayList(POLY_OPA_DISP++, D_060149A0); break; @@ -3029,7 +3700,7 @@ void Boss07_Top_Update(Actor* thisx, GlobalContext* globalCtx2) { Actor_SetScale(&this->actor, this->actor.scale.x); } -void Boss07_Top_Draw(Actor *thisx, GlobalContext *globalCtx2) { +void Boss07_Top_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; @@ -3055,7 +3726,7 @@ void Boss07_Effects_Update(Actor* thisx, GlobalContext* globalCtx2) { Boss07* this = THIS; func_80A07638(globalCtx); - + if (D_80A09A4C != 0) { D_80A09A4C--; play_sound(NA_SE_EN_LAST2_HEARTBEAT_OLD - SFX_FLAG); @@ -3193,7 +3864,7 @@ void Boss07_Effects_Update(Actor* thisx, GlobalContext* globalCtx2) { #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Effects_Update.s") #endif -void Boss07_Effects_Draw(Actor *thisx, GlobalContext *globalCtx2) { +void Boss07_Effects_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; @@ -3235,19 +3906,21 @@ void func_80A07638(GlobalContext* globalCtx) { } } -void func_80A07740(GlobalContext *globalCtx) { - Boss07Effect *effect = (Boss07Effect*) globalCtx->specialEffects; +void func_80A07740(GlobalContext* globalCtx) { + Boss07Effect* effect = (Boss07Effect*)globalCtx->specialEffects; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; s32 i; OPEN_DISPS(gfxCtx); func_8012C2DC(globalCtx->state.gfxCtx); - for(i = 0; i < 50; i++, effect++) { + for (i = 0; i < 50; i++, effect++) { if (effect->unk_0 > 0) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, effect->unk_2C); 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->unk_2) & 0x7F, (15 * -effect->unk_2) & 0xFF, 0x20, 0x40, 1, 0, 0, 0x20, 0x20)); + gSPSegment(POLY_XLU_DISP++, 8, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (3 * effect->unk_2) & 0x7F, + (15 * -effect->unk_2) & 0xFF, 0x20, 0x40, 1, 0, 0, 0x20, 0x20)); SysMatrix_InsertTranslation(effect->unk_4.x, effect->unk_4.y, effect->unk_4.z, 0); SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); Matrix_Scale(effect->unk_34, effect->unk_34, 1.0f, 1); 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 6172a8b0f..37fa4bf1b 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -104,7 +104,7 @@ typedef struct Boss07 { /* 0x17C8 */ char unk17C8[0x10]; /* 0x17D8 */ s16 unk_17D8; /* 0x17DA */ s16 unk_17DA; - /* 0x17DA */ char unk17DC[4]; + /* 0x17DA */ s16 unk_17DC; /* 0x17E0 */ f32 unk_17E0; /* 0x17E4 */ f32 unk_17E4; /* 0x17E8 */ f32 unk_17E8; @@ -154,7 +154,8 @@ typedef struct Boss07 { /* 0x3E44 */ char unk3E44[0x6D00]; /* 0xAB44 */ f32 unk_AB44; /* 0xAB48 */ u8 unk_AB48; - /* 0xAB48 */ char unkAB49[0x7F]; + /* 0xAB4C */ f32 unk_AB4C; + /* 0xAB50 */ f32 unk_AB50[30]; /* 0xABC8 */ u32 unk_ABC8; /* 0xABCC */ s32 unk_ABCC; /* 0xABD0 */ s16 unk_ABD0; @@ -163,9 +164,12 @@ typedef struct Boss07 { /* 0xABE0 */ Vec3f unk_ABE0; /* 0xABEC */ Vec3f unk_ABEC; /* 0xABF8 */ Vec3f unk_ABF8; - /* 0xAC04 */ char unkAC04[8]; + /* 0xAC04 */ f32 unk_AC04; + /* 0xAC08 */ f32 unk_AC08; /* 0xAC0C */ f32 unk_AC0C; - /* 0xAC10 */ char unkAC10[0x10]; + /* 0xAC10 */ char unkAC10[4]; + /* 0xAC14 */ f32 unk_AC14; + /* 0xAC18 */ char unkAC18[8]; } Boss07; // size = 0xAC20 extern const ActorInit Boss_07_InitVars; From 745583303bee681be7d383af145082d532d8595e Mon Sep 17 00:00:00 2001 From: petrie911 Date: Wed, 29 Sep 2021 12:13:07 -0500 Subject: [PATCH 03/28] merge, I hope --- src/boot_O2/gfxprint.c | 2 +- src/boot_O2/printutils.c | 2 +- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 66 +++++++++---------- .../ovl_En_Ending_Hero6/z_en_ending_hero6.c | 2 +- 4 files changed, 35 insertions(+), 37 deletions(-) diff --git a/src/boot_O2/gfxprint.c b/src/boot_O2/gfxprint.c index f671c6f5c..f65d88200 100644 --- a/src/boot_O2/gfxprint.c +++ b/src/boot_O2/gfxprint.c @@ -180,6 +180,6 @@ void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) { va_start(args, fmt); GfxPrint_VPrintf(this, fmt, args); - + va_end(args); } diff --git a/src/boot_O2/printutils.c b/src/boot_O2/printutils.c index 4f04fca14..ca62b91b7 100644 --- a/src/boot_O2/printutils.c +++ b/src/boot_O2/printutils.c @@ -9,6 +9,6 @@ void PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...) { va_start(args, fmt); PrintUtils_VPrintf(pfn, fmt, args); - + va_end(args); } 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 97e15ad8e..0d9403e26 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -639,7 +639,6 @@ extern u16 D_06041B30[]; extern u16 D_06042330[]; extern u16 D_06043330[]; - void func_809F4980(Actor* arg0) { Audio_PlayActorSound2(arg0, NA_SE_EN_FOLLOWERS_DAMAGE); } @@ -992,7 +991,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { } else { func_809F7400(this, globalCtx, 50); this->unk_77C = 1.0f; - func_801A89A8(0x8069); + Audio_QueueSeqCmd(0x8069); } SkelAnime_InitSV(globalCtx, &this->skelAnime1, &D_060335F0, &D_0603CBD0, this->jointTable1, this->morphTable1, 28); @@ -1112,7 +1111,7 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { func_8019FE74(&D_801D6654, 0.0f, 0x3C); } if (this->unk_ABC8 == 112) { - func_801A89A8(0x8069); + Audio_QueueSeqCmd(0x8069); } if (this->unk_ABC8 == 137) { Actor_TitleCardCreate(globalCtx, &globalCtx->actorCtx.titleCtxt, @@ -1156,7 +1155,7 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { void func_809F64F4(Boss07* this, GlobalContext* globalCtx) { s32 i; - func_801A89A8(0x100100FF); + Audio_QueueSeqCmd(0x100100FF); func_809F4FAC(globalCtx); this->actionFunc = func_809F65F4; this->unk_794 = 0.7f; @@ -1180,7 +1179,7 @@ void func_809F64F4(Boss07* this, GlobalContext* globalCtx) { } #ifdef NON_MATCHING -void func_809F65F4(Boss07 *this, GlobalContext *globalCtx) { +void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { s32 i; s32 spC0 = 0; Vec3f spB4; @@ -1190,11 +1189,11 @@ void func_809F65F4(Boss07 *this, GlobalContext *globalCtx) { Camera* temp_s0; spA4 = 0.0f; spA0 = 0.1f; - + temp_s0 = Play_GetCamera(globalCtx, 0); this->unk_15C = 1000; func_809F4CBC(this, 1.0f); - switch(this->unk_ABD0) { + switch (this->unk_ABD0) { case 0: if (ActorCutscene_GetCurrentIndex() == -1) { func_800EA0D4(globalCtx, &globalCtx->csCtx); @@ -1216,7 +1215,7 @@ void func_809F65F4(Boss07 *this, GlobalContext *globalCtx) { this->unk_AC04 = this->actor.shape.rot.y * M_PI / 0x8000; this->unk_AC08 = this->unk_AC0C = D_80A09A58->unk_180C = 0.0f; func_809F49A0(1, 0x71AC, 0x263A); - for(i = 0; i < 30; i++) { + for (i = 0; i < 30; i++) { this->unk_AB50[i] = func_809F49C0() - 1.0f; } func_8016566C(150); @@ -1283,14 +1282,15 @@ void func_809F65F4(Boss07 *this, GlobalContext *globalCtx) { spB4.x = 0.0f; spB4.y = this->unk_AC14 + -190.0f; spB4.z = gGameInfo->data[1553] + 390.0f - 380.0f; - + this->unk_ABF8.x = this->actor.focus.pos.x; this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f - 60.0f + 130.0f + gGameInfo->data[1554]; this->unk_ABF8.z = this->actor.focus.pos.z; - + spA0 = 1.0f; - Math_ApproachF(&this->unk_AC14, gGameInfo->data[1555] + 240.0f, 0.05f, 1.0f + (gGameInfo->data[1556] * 0.1f)); + Math_ApproachF(&this->unk_AC14, gGameInfo->data[1555] + 240.0f, 0.05f, + 1.0f + (gGameInfo->data[1556] * 0.1f)); spA4 = 2000.0f; this->unk_1D8 = gGameInfo->data[1329] + 10; this->unk_AB48 = 1; @@ -1345,7 +1345,7 @@ void func_809F65F4(Boss07 *this, GlobalContext *globalCtx) { Math_ApproachF(&D_80A09A58->unk_180C, 30.0f, 0.1f, 1.5f); D_80A09A58->unk_1810 = this->unk_334[2]; Math_ApproachF(&this->unk_AB4C, 1.0f, 0.1f, 0.05f); - for(i = 0; i < 30; i++) { + for (i = 0; i < 30; i++) { Math_ApproachF(&this->unk_AB50[i], sp98, 1.0f, sp94); } Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.1f); @@ -1367,7 +1367,7 @@ void func_809F65F4(Boss07 *this, GlobalContext *globalCtx) { spA8.x = Math_SinS(this->unk_ABC8 * 0x7000) * sp68; spA8.y = Math_SinS(this->unk_ABC8 * 0x5000) * sp68 * 2.5f; spA8.z = Math_CosS(this->unk_ABC8 * 0x8000) * sp68; - for(i = 0; i < 2; i++) { + for (i = 0; i < 2; i++) { sp6C.x = randPlusMinusPoint5Scaled(500.0f) + this->actor.world.pos.x; sp6C.y = Rand_ZeroFloat(50.0f) + this->actor.world.pos.y + 200.0f; sp6C.z = randPlusMinusPoint5Scaled(500.0f) + this->actor.world.pos.z; @@ -1419,8 +1419,8 @@ void func_809F7400(Boss07* this, GlobalContext* globalCtx, s16 arg2) { this->actor.flags |= 1; } -void func_809F748C(Boss07 *this, GlobalContext *globalCtx) { - Player *player = PLAYER; +void func_809F748C(Boss07* this, GlobalContext* globalCtx) { + Player* player = PLAYER; SkelAnime_FrameUpdateMatrix(&this->skelAnime1); func_809F4CBC(this, 2.0f); @@ -1440,9 +1440,9 @@ void func_809F748C(Boss07 *this, GlobalContext *globalCtx) { } else if (this->timers[0] == 0) { if (gGameInfo->data[1326] == 1) { func_809F8E68(this, globalCtx); - } else if ((s8) this->actor.colChkInfo.health >= 28) { + } else if ((s8)this->actor.colChkInfo.health >= 28) { func_809F7D2C(this, globalCtx); - } else if (((s8) this->actor.colChkInfo.health <= 12) && (Rand_ZeroOne() < 0.65f)) { + } else if (((s8)this->actor.colChkInfo.health <= 12) && (Rand_ZeroOne() < 0.65f)) { func_809F8E68(this, globalCtx); } else if (Rand_ZeroOne() < 0.3f) { func_809F8658(this, globalCtx); @@ -1454,13 +1454,13 @@ void func_809F748C(Boss07 *this, GlobalContext *globalCtx) { this->unk_174 = 1; } -void func_809F7688(Boss07 *this, GlobalContext *globalCtx) { +void func_809F7688(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_809F76D0; SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06025878, -5.0f); this->unk_14C = 0; } -void func_809F76D0(Boss07 *this, GlobalContext *globalCtx) { +void func_809F76D0(Boss07* this, GlobalContext* globalCtx) { SkelAnime_FrameUpdateMatrix(&this->skelAnime1); this->unk_794 = 0.7f; this->unk_FA0 = 0.7f; @@ -1478,7 +1478,7 @@ void func_809F76D0(Boss07 *this, GlobalContext *globalCtx) { } } -void func_809F77A8(Boss07 *this, GlobalContext *globalCtx) { +void func_809F77A8(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, 0x3014); if (this->unk_14C == 13) { func_8019F1C0(&D_80A09A40, 0x3A57); @@ -1491,38 +1491,36 @@ void func_809F77A8(Boss07 *this, GlobalContext *globalCtx) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x4000); } -void func_809F783C(Boss07 *this, GlobalContext *globalCtx) { +void func_809F783C(Boss07* this, GlobalContext* globalCtx) { f32 dx; f32 dz; s16 temp; Vec3f sp30; s32 pad; - this->actionFunc = func_809F7968; this->actor.velocity.y = 25.0f; dx = 0.0f - this->actor.world.pos.x; dz = 0.0f - this->actor.world.pos.z; // temp2 = ; - temp = this->actor.yawTowardsPlayer - (s16)(Math_Acot2F(dz,dx) * (M_PI / 0x8000)); + temp = this->actor.yawTowardsPlayer - (s16)(Math_Acot2F(dz, dx) * (0x8000 / M_PI)); if (temp < 0) { dx = 200.0f; SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603D224, -5.0f); } else { dx = -200.0f; SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603D7F0, -5.0f); - } Matrix_RotateY(this->actor.yawTowardsPlayer, 0); SysMatrix_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) * (M_PI / 0x8000); + this->actor.world.rot.y = Math_Acot2F(dz, dx) * (0x8000 / M_PI); this->unk_14C = 0; this->actor.speedXZ = 17.0f; } -void func_809F7968(Boss07 *this, GlobalContext *globalCtx) { +void func_809F7968(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, 0x3014); SkelAnime_FrameUpdateMatrix(&this->skelAnime1); this->unk_794 = 0.7f; @@ -1548,7 +1546,7 @@ 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 func_809F7AB4(Boss07* this, GlobalContext* globalCtx) { f32 phi_f12; f32 phi_f14; s32 pad; @@ -1558,7 +1556,7 @@ void func_809F7AB4(Boss07 *this, GlobalContext *globalCtx) { SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &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) * (M_PI / 0x8000)); + sp22 = this->actor.yawTowardsPlayer - (s16)(Math_Acot2F(phi_f12, phi_f14) * (0x8000 / M_PI)); Matrix_RotateY(this->actor.shape.rot.y, 0); if (sp22 < 0) { this->skelAnime1.animPlaybackSpeed = 1.0f; @@ -1576,7 +1574,7 @@ void func_809F7AB4(Boss07 *this, GlobalContext *globalCtx) { this->unk_ABCC = 0; } -void func_809F7BC4(Boss07 *this, GlobalContext *globalCtx) { +void func_809F7BC4(Boss07* this, GlobalContext* globalCtx) { SkelAnime_FrameUpdateMatrix(&this->skelAnime1); if (this->unk_14C == 20) { Audio_PlayActorSound2(this, 0x3A53); @@ -1606,7 +1604,7 @@ void func_809F7BC4(Boss07 *this, GlobalContext *globalCtx) { } } -void func_809F7D2C(Boss07 *this, GlobalContext *globalCtx) { +void func_809F7D2C(Boss07* this, GlobalContext* globalCtx) { Player* player = PLAYER; this->actionFunc = func_809F805C; @@ -1614,7 +1612,7 @@ void func_809F7D2C(Boss07 *this, GlobalContext *globalCtx) { if (player->stateFlags3 & 0x100) { this->unk_14E = 4; } else if (this->actor.xzDistToPlayer <= 300.0f) { - if(this->actor.xzDistToPlayer <= 200.0f) { + if (this->actor.xzDistToPlayer <= 200.0f) { this->unk_14E = 7; } else { this->unk_14E = 4; @@ -2421,7 +2419,7 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { if ((this->unk_148 != 0) || (gGameInfo->data[1336] != 0)) { gGameInfo->data[1336] = 0; this->unk_148 = 0; - func_801A89A8(0x100100FF); + Audio_QueueSeqCmd(0x100100FF); func_809FE6B0(this, globalCtx); } } @@ -2611,7 +2609,7 @@ void func_809FFA80(Boss07* this, GlobalContext* globalCtx) { if ((this->unk_148 != 0) || (gGameInfo->data[1336] != 0)) { gGameInfo->data[1336] = 0; this->unk_148 = 0; - func_801A89A8(0x100100FF); + Audio_QueueSeqCmd(0x100100FF); func_80A025AC(this, globalCtx); } } @@ -3168,7 +3166,7 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { if (D_80A09A71 != 0) { D_80A09A71--; if (D_80A09A71 == 0) { - func_801A89A8(0x806B); + Audio_QueueSeqCmd(0x806B); } } Math_Vec3f_Copy(&D_80A09A40, &this->actor.projectedPos); diff --git a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c index cfd596646..334856872 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c +++ b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c @@ -183,7 +183,7 @@ void EnEndingHero6_Draw(Actor* thisx, GlobalContext* globalCtx) { } SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, - this->skelAnime.dListCount, NULL, EnEndingHero6_PostLimbDraw, &this->actor); + this->skelAnime.dListCount, NULL, EnEndingHero6_PostLimbDraw, &this->actor); } CLOSE_DISPS(globalCtx->state.gfxCtx); From 19177cb8c9aaddecb739a7c843719d96f027979e Mon Sep 17 00:00:00 2001 From: petrie911 Date: Wed, 29 Sep 2021 21:12:21 -0500 Subject: [PATCH 04/28] wrath done-ish --- include/variables.h | 1 + src/overlays/actors/ovl_Boss_07/z_boss_07.c | 817 +++++++++++++++++++- src/overlays/actors/ovl_Boss_07/z_boss_07.h | 4 +- 3 files changed, 795 insertions(+), 27 deletions(-) diff --git a/include/variables.h b/include/variables.h index aa6957033..3043c18c1 100644 --- a/include/variables.h +++ b/include/variables.h @@ -3979,6 +3979,7 @@ extern UNK_TYPE D_04023130; extern Gfx D_04023210[]; extern UNK_TYPE D_04023288; extern Gfx D_04023348[]; +extern Gfx D_040233B8[]; extern Gfx D_04023428[]; extern UNK_TYPE D_04025850; extern UNK_TYPE D_04025DD0; 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 0d9403e26..56854c066 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -39,13 +39,13 @@ void func_80A03238(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* a Vec3f* arg6, f32 arg7, u8 arg8, f32 arg9); void func_80A036C4(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, f32 arg4, f32 arg5); void func_80A03868(Boss07* this, GlobalContext* globalCtx); -void func_80A03F18(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor); +void func_80A03F18(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Boss07* this); void func_809FAA44(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, Vec3f* arg4, Vec3f* arg5, f32 arg6, - f32 arg7, f32 arg8, f32 arg9, Vec3s* argA, s32 argB, f32 argC, s32 argD); + f32 arg7, f32 arg8, f32 arg9, Vec3s* argA, s16 argB, f32 argC, s32 argD); void func_809FB114(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, f32 arg4, s32 arg5); -s32 func_809FB504(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor); -void func_809FB55C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor); -void func_809FB728(GlobalContext* globalCtx, s32 limbIndex, Actor* actor); +s32 func_809FB504(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); +void func_809FB55C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); +void func_809FB728(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx); void func_809FB7D4(Boss07* this, GlobalContext* globalCtx); void func_809FBB9C(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2); void func_809FC8B0(u8* arg0, Boss07* this, GlobalContext* globalCtx); @@ -64,6 +64,7 @@ void func_809F64F4(Boss07* this, GlobalContext* globalCtx); void func_809F7AB4(Boss07* this, GlobalContext* globalCtx); void func_809F99C4(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); @@ -502,6 +503,7 @@ static ColliderCylinderInit D_80A07ED0 = { extern s16 D_80A07968[4][3]; extern s16 D_80A07950[4][3]; +extern s16 D_80A07952[3]; extern DamageTable D_80A07980; extern DamageTable D_80A079A0; extern DamageTable D_80A079C0; @@ -560,7 +562,7 @@ extern Vec3f D_80A082C8; extern Vec3f D_80A082D4; extern void* D_80A082E0[2]; -extern Vec3f D_80A084D8; +// extern Vec3f D_80A084D8; extern Vec3f D_80A09A40; extern u8 D_80A09A4C; @@ -606,13 +608,15 @@ extern AnimationHeader D_06023DAC; extern UNK_TYPE D_06025018; extern AnimationHeader D_06025878; extern AnimationHeader D_06026204; -extern UNK_TYPE D_060269EC; -extern UNK_TYPE D_06026EA0; +extern AnimationHeader D_060269EC; +extern AnimationHeader D_06026EA0; extern UNK_TYPE D_06027270; -extern UNK_TYPE D_0602EEC8; +extern Gfx D_0602EE50[]; +extern Gfx D_0602EEC8[]; +extern Gfx D_0602EEF8[]; extern Gfx D_0602EF68[]; extern Gfx D_0602EF88[]; -extern UNK_TYPE D_0602EFE8; +extern Gfx D_0602EFE8[]; extern Gfx D_0602F640[]; extern UNK_TYPE D_0602F840; // title card extern UNK_TYPE D_06032040; // title card @@ -1662,21 +1666,321 @@ void func_809F7D2C(Boss07* this, GlobalContext* globalCtx) { this->unk_14C = 0; } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F805C.s") +void func_809F805C(Boss07* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + func_809F4CBC(this, 2.0f); + this->unk_794 = 0.79999995f; + this->unk_FA0 = 0.79999995f; + this->unk_790 = -5.0f; + this->unk_F9C = -5.0f; + this->unk_79C = 0.0f; + this->unk_FA8 = 0.0f; + this->unk_798 = 1.0f; + this->unk_FA4 = 1.0f; + if (this->unk_14C >= 0x15) { + this->unk_174 = 1; + } + switch (this->unk_14E) { + case 0: + if (this->unk_14C == (s16)(gGameInfo->data[1340] + 1)) { + func_8019F1C0(&D_80A09A40, 0x3A55); + } + if ((this->unk_14C >= 0xF) && (this->unk_14C < 0x12)) { + this->unk_79C = 500.0f; + } + if (this->unk_14C == 9) { + this->unk_14F = 0xB; + } + if (this->unk_14C == 1) { + Audio_PlayActorSound2(this, 0x39CD); + } + if (this->unk_14C == 0xA) { + Audio_PlayActorSound2(this, 0x39CA); + } + break; + case 1: + if (this->unk_14C == (s16)(gGameInfo->data[1339] + 3)) { + func_8019F1C0(&D_80A09A40, 0x3A56); + } + if ((this->unk_14C >= 8) && (this->unk_14C < 0x38)) { + this->unk_79C = 300.0f; + this->unk_FA8 = 300.0f; + if ((((this->unk_14C + 2) & 3) == 0) && (Rand_ZeroOne() < 0.5f)) { + play_sound(0x39CB); + } + if ((this->unk_14C & 3) == 0) { + Audio_PlayActorSound2(this, 0x39CA); + } + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); + } + break; + case 2: + if (this->unk_14C == (s16)(gGameInfo->data[1332] + 5)) { + func_8019F1C0(&D_80A09A40, 0x3A55); + } + if ((this->unk_14C >= 0x20) && (this->unk_14C < 0x27)) { + this->unk_79C = 300.0f; + this->unk_FA8 = 300.0f; + } + if (this->unk_14C == 0x1C) { + this->unk_14F = 0xB; + } + if (this->unk_14C == 0xA) { + Audio_PlayActorSound2(this, 0x39CD); + } + if (this->unk_14C == 0x20) { + Audio_PlayActorSound2(this, 0x39CA); + } + break; + case 3: + if (this->unk_14C == (s16)(gGameInfo->data[1332] + 5)) { + func_8019F1C0(&D_80A09A40, 0x3A55); + } + if ((this->unk_14C >= 0x1F) && (this->unk_14C < 0x24)) { + this->unk_79C = 1200.0f; + } + if (this->unk_14C == 0x17) { + this->unk_14F = 0xB; + } + 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) { + Audio_PlayActorSound2(this, 0x39CD); + } + if (this->unk_14C == 0x1E) { + Audio_PlayActorSound2(this, 0x39CA); + } + break; + case 4: + if ((this->unk_14C >= 0x11) && (this->unk_14C < 0x29)) { + this->unk_79C = 200.0f; + this->unk_FA8 = 200.0f; + if ((this->unk_14C % 8) == 0) { + func_8019F1C0(&D_80A09A40, 0x3A54); + } + Audio_PlayActorSound2(this, 0x31CC); + Math_ApproachF(&this->actor.world, this->unk_164.x, 0.1f, this->unk_170); + 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; + } + break; + case 7: + this->unk_174 = 0; + if (this->unk_14C == 3) { + Audio_PlayActorSound2(this, 0x3A53); + } + break; + case 5: + this->unk_FA0 = 0.7f; + this->unk_794 = 0.7f; + this->unk_790 = -15.0f; + this->unk_F9C = -15.0f; + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); + this->unk_174 = 1; + break; + case 6: + if (this->unk_14C == (s16)(gGameInfo->data[1333] + 5)) { + func_8019F1C0(&D_80A09A40, 0x3A55); + } + if ((this->unk_14C >= 0xE) && (this->unk_14C < 0x13)) { + this->unk_79C = 150.0f; + } + if ((this->unk_14C >= 0x17) && (this->unk_14C < 0x1D)) { + this->unk_FA8 = 200.0f; + } + if ((this->unk_14C >= 0x2B) && (this->unk_14C < 0x31)) { + this->unk_79C = 200.0f; + } + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); + if (this->unk_14C == 0x14) { + Audio_PlayActorSound2(this, 0x39CD); + func_8019F1C0(&D_80A09A40, 0x3A55); + } + if (this->unk_14C == 5) { + Audio_PlayActorSound2(this, 0x39CE); + } + if (this->unk_14C == 0x29) { + Audio_PlayActorSound2(this, 0x39CA); + func_8019F1C0(&D_80A09A40, 0x3A55); + } + break; + } + if (func_801378B8(&this->skelAnime1, this->unk_1D4) || (this->timers[1] == 1)) { + func_809F7400(this, globalCtx, 0); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F8658.s") +void func_809F8658(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_809F86B8; + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06026EA0, -5.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_06026EA0); + this->unk_14C = 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F86B8.s") +void func_809F86B8(Boss07* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer - 0x800, 3, 0x2000); + func_809F4CBC(this, 2.0f); + this->unk_794 = 0.79999995f; + this->unk_FA0 = 0.79999995f; + this->unk_798 = 1.0f; + this->unk_FA4 = 1.0f; + this->unk_790 = -5.0f; + this->unk_79C = 0.0f; + this->unk_FA8 = 0.0f; + this->unk_F9C = -15.0f; + if ((this->unk_14C >= 0xE) && (this->unk_14C < 0x13)) { + this->unk_79C = 500.0f; + } + if (this->unk_14C >= 0x12) { + func_809F7400(this, globalCtx, Rand_ZeroFloat(20.0f) + 20.0f); + play_sound(0x39ED); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F87C8.s") +void func_809F87C8(Boss07* this, GlobalContext* globalCtx) { + s32 sp2C; + Player* player = PLAYER; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F8908.s") + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + func_809F4CBC(this, 2.0f); + player->actor.world.pos = this->unk_F80; + this->actor.flags &= ~1; + this->unk_15A = 20; + this->unk_F7C += 1; + if (this->unk_14C > (s16)(0x2E - this->unk_F7E)) { + func_8019F1C0(&D_80A09A40, 0x3A56); + play_sound(0x39F1); + this->actionFunc = func_809F8908; + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06027270, -5.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_06027270); + this->unk_14C = 0; + } + if ((func_800B64FC(globalCtx, 1000.0f, &this->actor.world, &sp2C) >= 0.0f) && (sp2C == 1)) { + func_809F8AB0(this, globalCtx); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F8AB0.s") +void func_809F8908(Boss07* this, GlobalContext* globalCtx) { + Player* sp3C = PLAYER; + f32 phi_f0; + f32 phi_f2; + s32 sp30; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F8B1C.s") + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + this->unk_15A = 20; + if (this->unk_14C == 6) { + this->unk_F7E = 0; + if (&this->actor == sp3C->actor.parent) { + sp3C->unk_AE8 = 101; + sp3C->actor.parent = NULL; + sp3C->unk_394 = 0; + if (sp3C->transformation == 3) { + phi_f0 = 23.0f; + phi_f2 = 20.0f; + } else if (sp3C->transformation == 1) { + phi_f0 = 15.0f; + phi_f2 = 10.0f; + } else if (sp3C->transformation == 0) { + phi_f0 = 10.0f; + phi_f2 = 3.0f; + } else { + phi_f0 = 20.0f; + phi_f2 = 15.0f; + } + func_800B8D50(globalCtx, NULL, phi_f0, this->actor.yawTowardsPlayer + 0x9000, phi_f2, 0x10); + } + } + if (this->unk_14C < 7) { + sp3C->actor.world.pos = this->unk_F80; + if ((func_800B64FC(globalCtx, 1000.0f, &this->actor.world, &sp30) >= 0.0f) && (sp30 == 1)) { + func_809F8AB0(this, globalCtx); + } + } + if (func_801378B8(&this->skelAnime1, this->unk_1D4) != 0) { + func_809F7400(this, globalCtx, 0); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F8D04.s") +void func_809F8AB0(Boss07* this, GlobalContext* globalCtx) { + s32 temp_v0; + s32 temp_v1; + + this->actionFunc = func_809F8B1C; + + temp_v0 = this->unk_F7E + 10; + this->unk_780 = this->unk_784 = temp_v0; + + temp_v1 = D_80A09A50 - 1; + if (temp_v1 < temp_v0) { + this->unk_780 = this->unk_784 = temp_v1; + } + this->unk_14C = 0; + play_sound(0x28E1); +} + +void func_809F8B1C(Boss07* this, GlobalContext* globalCtx) { + s32 i; + Player* player = PLAYER; + + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + func_809F4CBC(this, 2.0f); + player->actor.world.pos = this->unk_F80; + this->actor.flags &= ~1; + this->unk_15A = 20; + if (this->unk_14C <= (s16)(46 - this->unk_F7E)) { + this->unk_F7C++; + } + for (i = 0; i < 4; i++) { + if (this->unk_784 != 0) { + this->unk_784--; + } + } + if (this->unk_784 == 0) { + Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.3f); + Math_ApproachF(&this->unk_32C, 5.0f, 0.5f, 3.0f); + play_sound(0x309A); + } else { + this->unk_32C = 0.01f; + } + if (this->unk_32C > 4.0f) { + this->actionFunc = func_809F8D04; + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603B330, -10.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_0603B330); + this->unk_F7E = 0; + if (&this->actor == player->actor.parent) { + player->unk_AE8 = 101; + player->actor.parent = NULL; + player->unk_394 = 0; + } + 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; + } +} + +void func_809F8D04(Boss07* this, GlobalContext* globalCtx) { + s32 i; + + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + this->unk_15A = 20; + for (i = 0; i < 2; i++) { + if (this->unk_780 != 0) { + this->unk_780--; + } + } + if (this->unk_14C < 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(0x309A); + Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.3f); + } + if (func_801378B8(&this->skelAnime1, this->unk_1D4)) { + func_809F51E8(this, globalCtx, 1); + } +} void func_809F8DEC(Boss07* this, GlobalContext* globalCtx) { if (this->actionFunc != func_809F91D4) { @@ -1688,11 +1992,81 @@ void func_809F8DEC(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE_OLD); } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F8E68.s") +void func_809F8E68(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_809F8EC8; + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_060269EC, -5.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_060269EC); + this->unk_14C = 0; +} +#ifdef NON_MATCHING +void func_809F8EC8(Boss07* this, GlobalContext* globalCtx) { + this->unk_15A = 20; + if (this->unk_14C < (s16)(gGameInfo->data[1288] + 14)) { + this->unk_778 += 6; + if (this->unk_778 > 44) { + this->unk_778 = 44; + } + } + if (this->unk_14C == 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, 180); + } + if (this->unk_14C == 10) { + Audio_PlayActorSound2(this, 0x39CA); + } + if (this->unk_14C == (s16)(gGameInfo->data[1288] + 18)) { + Audio_PlayActorSound2(this, 0x3A54); + } + if ((this->unk_14C < (s16)(gGameInfo->data[1288] + 14)) || ((s16)(gGameInfo->data[1289] + 17) < this->unk_14C)) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + } + if ((this->unk_14C >= (s16)(gGameInfo->data[1288] + 14)) && + ((this->unk_14C <= (s16)(gGameInfo->data[1289] + 17)) || + ((s16)(gGameInfo->data[1290] + 21) <= this->unk_14C))) { + this->unk_778 -= gGameInfo->data[1287] + 5; + if (this->unk_778 < 0) { + this->unk_778 = 0; + } + } + Math_ApproachS(&this->actor.shape.rot.y, gGameInfo->data[1256] * 0x100 + this->actor.yawTowardsPlayer + 0xF00, 3, + 0x2000); + func_809F4CBC(this, 2.0f); + this->unk_794 = 0.79999995f; + this->unk_FA0 = 0.79999995f; + this->unk_798 = 1.0f; + this->unk_FA4 = 1.0f; + this->unk_790 = -5.0f; + this->unk_79C = 0.0f; + this->unk_FA8 = 0.0f; + this->unk_F9C = -15.0f; + if (((s16)(gGameInfo->data[1291] + 12) <= this->unk_14C) && (this->unk_14C <= (s16)(gGameInfo->data[1292] + 17))) { + this->unk_79C = gGameInfo->data[1254] + 500.0f; + } + if (this->unk_14C >= (s16)(gGameInfo->data[1293] + 36)) { + func_809F7400(this, globalCtx, Rand_ZeroFloat(20.0f) + 20.0f); + } +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F8EC8.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F91D4.s") +void func_809F91D4(Boss07* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + func_8019F1C0(&D_80A09A40, 0x301B); + func_809F4CBC(this, 2.0f); + this->unk_794 = 0.7f; + this->unk_FA0 = 0.7f; + this->unk_790 = -15.0f; + this->unk_F9C = -15.0f; + this->unk_798 = 2.0f; + this->unk_FA4 = 2.0f; + this->unk_79C = 0.0f; + this->unk_FA8 = 0.0f; + if (func_801378B8(&this->skelAnime1, this->unk_1D4)) { + func_809F51E8(this, globalCtx, 1); + } +} void func_809F9280(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { if ((s8)this->actor.colChkInfo.health >= 0) { @@ -1723,7 +2097,25 @@ void func_809F9280(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { } } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F93DC.s") +void func_809F93DC(Boss07* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + this->unk_ABCC++; + if ((this->unk_ABCC % 16) == 0) { + Audio_PlayActorSound2(&this->actor, 0x39E3); + } + func_809F4CBC(this, 2.0f); + this->unk_794 = 0.7f; + this->unk_FA0 = 0.7f; + this->unk_790 = -15.0f; + this->unk_F9C = -15.0f; + this->unk_798 = 2.0f; + this->unk_FA4 = 2.0f; + this->unk_79C = 0.0f; + this->unk_FA8 = 0.0f; + if (func_801378B8(&this->skelAnime1, this->unk_1D4)) { + func_809F51E8(this, globalCtx, 1); + } +} void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx) { s32 i; @@ -1811,7 +2203,77 @@ void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx } } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F99C4.s") +void func_809F99C4(Boss07* this, GlobalContext* globalCtx) { + s32 i; + s32 j; + u8 pad; + Player* player = PLAYER; + + if (this->unk_15C == 0) { + if (this->sph2.elements[0].info.toucherFlags & 2) { + this->sph2.elements[0].info.toucherFlags &= ~2; + player->unk_B84 = this->actor.yawTowardsPlayer; + player->unk_B80 = 20.0f; + func_809F4FF8(globalCtx, &player->actor.world, 12); + play_sound(0x1829); + } + for (i = 0; i < 11; i++) { + if (this->sph1.elements[i].info.bumperFlags & 2) { + for (j = 0; j < 11; j++) { + this->sph1.elements[j].info.bumperFlags &= ~2; + } + if (this->unk_1804 == 10) { + this->unk_1806 = 0; + } + switch (this->actor.colChkInfo.damageEffect) { + case 3: + this->unk_1805 = 10; + break; + case 2: + this->unk_1805 = 1; + break; + case 4: + this->unk_1805 = 20; + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, + this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 0, 4); + break; + case 10: + this->unk_1805 = 40; + Audio_PlayActorSound2(&this->actor, 0x389E); + break; + case 9: + this->unk_1805 = 30; + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, + 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 == func_809F93DC)) { + 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); + this->unk_15C = 6; + } else { + this->unk_15E = 15; + this->unk_15C = (this->actor.colChkInfo.damageEffect == 0xC) ? 15 : 5; + func_809F9280(this, globalCtx, pad, this->actor.colChkInfo.damageEffect); + } + } else { + this->unk_15C = 15; + func_809F8DEC(this, globalCtx); + this->unk_F7E = 0; + if (&this->actor == player->actor.parent) { + player->unk_AE8 = 101; + player->actor.parent = NULL; + player->unk_394 = 0; + } + } + break; + } + } + } +} void func_809F9CEC(Boss07* this, GlobalContext* globalCtx) { Vec3f sp8C; @@ -2043,19 +2505,324 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { } } +#ifdef NON_MATCHING +void func_809FAA44(Boss07 *this, GlobalContext *globalCtx, Vec3f *arg2, Vec3f *arg3, Vec3f *arg4, Vec3f *arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9, Vec3s *argA, s16 argB, f32 argC, s32 argD) { + s32 i; + s32 phi_s6; + f32 temp_f20; + f32 temp_f24; + f32 temp_f26; + f32 temp_f22; + f32 phi_f0; + Vec3f* temp; + s32 pad; + Vec3f spB8 = D_80A07FE0; + Vec3f spAC; + Vec3f spA0; + Vec3f sp94; + Vec3f sp88; + Vec3f sp7C; + + spB8.z = 22.0f * argC; + temp = arg5; + for(i = 0; i < (s16)D_80A09A50; i++, temp++) { + if(i == 0) { + arg3[0] = *arg2; + } else { + Math_ApproachF(&temp->x, 0.0f, 1.0f, arg8); + Math_ApproachF(&temp->y, 0.0f, 1.0f, arg8); + Math_ApproachF(&temp->z, 0.0f, 1.0f, arg8); + } + } + spAC.z = 20.0f; + Matrix_RotateY(argA->y, 0); + SysMatrix_InsertXRotation_s(argA->x, 1); + SysMatrix_InsertZRotation_s(argA->z, 1); + Matrix_RotateY(0x4000, 1); + SysMatrix_GetStateTranslationAndScaledZ(spAC.z, &sp94); + if (argB != 0) { + spAC.z = 200.0f; + SysMatrix_InsertYRotation_f(this->unk_F8C, 0); + SysMatrix_RotateStateAroundXAxis(this->unk_F90); + } else { + spAC.z = arg9; + } + SysMatrix_GetStateTranslationAndScaledZ(spAC.z, &sp7C); + + for(i = 1, phi_s6 = 0; i < (s16)D_80A09A50; i++) { + if(i < 6) { + sp88.x = (6 - i) * sp94.x * 0.2f; + sp88.y = (6 - i) * sp94.y * 0.2f; + sp88.z = (6 - i) * sp94.z * 0.2f; + } else if (argB != 0) { + if(argB <= i && i < (s16)(argB + this->unk_F7C)) { + sp88.y = 0.0f; + sp88.x = __sinf(this->actor.yawTowardsPlayer * M_PI / 0x8000 + (phi_s6 * 1.4f)) * 100.0f; + sp88.z = __cosf(this->actor.yawTowardsPlayer * M_PI / 0x8000 + (phi_s6 * 1.4f)) * 100.0f; + sp7C = D_801D15B0; + phi_s6++; + } + } else { + sp88 = D_801D15B0; + } + temp_f24 = (arg3 + i)->x + (arg5 + i)->x - (arg3 + i - 1)->x + sp88.x + sp7C.x; + phi_f0 = (arg3 + i)->y + (arg5 + i)->y + arg6 + sp88.y + sp7C.y; + phi_f0 = CLAMP_MIN(phi_f0, 2.0f); + temp_f26 = phi_f0 - (arg3 + i - 1)->y; + temp_f20 = (arg3 + i)->z + (arg5 + i)->z - (arg3 + i - 1)->z + sp88.z + sp7C.z; + temp_f22 = Math_Acot2F(temp_f20, temp_f24); + temp_f20 = -Math_Acot2F(sqrtf(SQ(temp_f24) + SQ(temp_f20)), temp_f26); + (arg4 + i - 1)->y = temp_f22; + (arg4 + i - 1)->x = temp_f20; + SysMatrix_InsertYRotation_f(temp_f22, 0); + SysMatrix_RotateStateAroundXAxis(temp_f20); + SysMatrix_GetStateTranslationAndScaledZ(spB8.z, &spA0); + temp_f24 = (arg3 + i)->x; + temp_f26 = (arg3 + i)->y; + temp_f20 = (arg3 + i)->z; + (arg3 + i)->x = (arg3 + i - 1)->x + spA0.x; + (arg3 + i)->y = (arg3 + i - 1)->y + spA0.y; + (arg3 + i)->z = (arg3 + i - 1)->z + spA0.y; + if((i != 0) && (i == argB)) { + spAC.x = 15.0f; + spAC.y = -30.0f; + spAC.z = -12.0f; + SysMatrix_MultiplyVector3fByState(&spAC, &spA0); + this->unk_F80.x = (arg3 + i)->x + spA0.x; + this->unk_F80.y = (arg3 + i)->y + spA0.y; + this->unk_F80.z = (arg3 + i)->z + spA0.z; + } else if ((argD == 0) && (this->actionFunc == func_809F8EC8)) { + if (i == gGameInfo->data[1338] + D_80A09A50 - this->unk_778 + 1) { + spAC.x = gGameInfo->data[1308]; + spAC.y = gGameInfo->data[1309]; + spAC.z = gGameInfo->data[1310]; + SysMatrix_MultiplyVector3fByState(&spAC, &spA0); + this->unk_F80.x = (arg3 + i)->x + spA0.x; + this->unk_F80.y = (arg3 + i)->y + spA0.y; + this->unk_F80.z = (arg3 + i)->z + spA0.z; + } + } + (arg5 + i)->x = ((arg3 + i)->x - temp_f24) * arg7; + (arg5 + i)->y = ((arg3 + i)->y - temp_f26) * arg7; + (arg5 + i)->z = ((arg3 + i)->z - temp_f20) * arg7; + if((arg5 + i)->x > 200.0f) { + (arg5 + i)->x = 200.0f; + } + if((arg5 + i)->x < -200.0f) { + (arg5 + i)->x = -200.0f; + } + if((arg5 + i)->y > 200.0f) { + (arg5 + i)->y = 200.0f; + } + if((arg5 + i)->y < -200.0f) { + (arg5 + i)->y = -200.0f; + } + if((arg5 + i)->z > 200.0f) { + (arg5 + i)->z = 200.0f; + } + if((arg5 + i)->z < -200.0f) { + (arg5 + i)->z = -200.0f; + } + } +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FAA44.s") +#endif +#ifdef NON_MATCHING +void func_809FB114(Boss07 *this, GlobalContext *globalCtx, Vec3f *arg2, Vec3f *arg3, f32 arg4, s32 arg5) { + s32 phi_s6; + s32 phi_s1; + f32 phi_f12; + f32 one = 1.0f; + f32 two = 2.0f; + + OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); + gSPDisplayList(POLY_OPA_DISP++, D_0602EEC8); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, gGameInfo->data[1584] + 45, 35, 75, 255); + phi_s6 = (arg5 == 0) ? this->unk_778 : 0; + for(phi_s1 = 0; phi_s1 <= (D_80A09A50 - phi_s6) - 1; phi_s1++) { + SysMatrix_InsertTranslation(arg2[phi_s1].x, 0.0f, arg2[phi_s1].z, 0); + Matrix_Scale(1.0f, 0.0f, 1.0f, 1); + SysMatrix_InsertYRotation_f(arg3[phi_s1].y, 1); + SysMatrix_RotateStateAroundXAxis(arg3[phi_s1].x); + phi_f12 = (phi_s1 > 24) ? 0.025f : ((24 - phi_s1) * one * 0.001f) + 0.025f; + Matrix_Scale(phi_f12, phi_f12, ((two * arg4) + 0.5f) * 0.01f, 1); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + gSPDisplayList(POLY_OPA_DISP++, D_0602EEF8); + } + gSPDisplayList(POLY_OPA_DISP++, D_0602EE50); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); + for(phi_s1 = 0; phi_s1 < (D_80A09A50 - phi_s6) - 1; phi_s1++) { + SysMatrix_InsertTranslation(arg2[phi_s1].x, arg2[phi_s1].y, arg2[phi_s1].z, 0); + SysMatrix_InsertYRotation_f(arg3[phi_s1].y, 1); + SysMatrix_RotateStateAroundXAxis(arg3[phi_s1].x); + phi_f12 = (phi_s1 > 24) ? 0.025f : ((24 - phi_s1) * one * 0.001f) + 0.025f; + Matrix_Scale(phi_f12, phi_f12, ((two * arg4) + 0.5f) * 0.01f, 1); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + gSPDisplayList(POLY_OPA_DISP++, D_0602EEF8); + } + CLOSE_DISPS(globalCtx->state.gfxCtx); +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FB114.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FB504.s") +s32 func_809FB504(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { + Boss07* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FB55C.s") + if (limbIndex == 26) { + rot->x += this->unk_17DA; + rot->y += this->unk_17D8; + rot->z += this->unk_17DC; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FB728.s") +void func_809FB55C(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3s *rot, Actor *thisx) { + Boss07* this = THIS; + s8 sp6B; + Vec3f sp5C; + MtxF sp1C; + sp6B = D_80A08090[limbIndex]; + if (sp6B >= 0) { + SysMatrix_GetStateTranslation(&this->unk_334[sp6B]); + } + sp6B = D_80A07FEC[limbIndex]; + if (sp6B >= 0) { + if (this->unk_158 != 0) { + SysMatrix_GetStateTranslationAndScaledZ(100000.0f, &sp5C); + } else { + SysMatrix_MultiplyVector3fByState(&D_80A0800C[sp6B], &sp5C); + } + func_809F4BB0(sp6B, &this->sph1, &sp5C); + } + if (limbIndex == 26) { + SysMatrix_GetStateTranslation(&this->actor.focus.pos); + } + if (limbIndex == 19) { + SysMatrix_MultiplyVector3fByState(&D_80A080B0, &this->unk_7A0); + } + if (limbIndex == 17) { + SysMatrix_CopyCurrentState(&sp1C); + func_8018219C(&sp1C, &this->unk_788, 0); + } + if (limbIndex == 24) { + SysMatrix_MultiplyVector3fByState(&D_80A080B0, &this->unk_FAC); + } + if (limbIndex == 22) { + SysMatrix_CopyCurrentState(&sp1C); + func_8018219C(&sp1C, &this->unk_F94, 0); + } + if (limbIndex == 12) { + SysMatrix_GetStateTranslation(&sp5C); + func_809F4BB0(0, &this->sph2, &sp5C); + } +} + +void func_809FB728(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); + } +} + +#ifdef NON_MATCHING +void func_809FB7D4(Boss07 *this, GlobalContext *globalCtx) { + s32 i; + GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; + + OPEN_DISPS(gfxCtx); + if ((this->unk_32C > 0.0f) || (this->unk_330 > 0.0f)) { + func_8012C2DC(globalCtx->state.gfxCtx); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 0); + + if (this->unk_32C > 0.0f) { + gSPDisplayList(POLY_XLU_DISP++, D_04023348); + for(i = 0; i < 15; i++) { + SysMatrix_InsertTranslation(this->unk_334[i].x, this->unk_334[i].y, this->unk_334[i].z, 0); + SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); + Matrix_Scale(this->unk_32C, this->unk_32C, this->unk_32C, 1); + SysMatrix_InsertZRotation_f(Rand_ZeroFloat(2.0f * M_PI), 1); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); + gSPDisplayList(POLY_XLU_DISP++, D_04023428); + } + for(i = this->unk_780; i >= this->unk_784; i--) { + SysMatrix_InsertTranslation(this->unk_7AC[i].x, this->unk_7AC[i].y, this->unk_7AC[i].z, 0); + SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); + Matrix_Scale(1.5f, 1.5f, 1.5f, 1); + SysMatrix_InsertZRotation_f(Rand_ZeroFloat(2.0f * M_PI), 1); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); + gSPDisplayList(POLY_XLU_DISP++, D_04023428); + } + } + if (this->unk_330 > 0.0f) { + gSPDisplayList(POLY_XLU_DISP++, D_040233B8); + for(i = 0; i < 30; i++) { + SysMatrix_InsertTranslation(this->unk_334[i / 2].x + randPlusMinusPoint5Scaled(30.0f), this->unk_334[i / 2].y + randPlusMinusPoint5Scaled(30.0f), this->unk_334[i / 2].z + randPlusMinusPoint5Scaled(30.0f), 0); + Matrix_Scale(this->unk_330, this->unk_330, this->unk_330, 1); + SysMatrix_RotateStateAroundXAxis(Rand_ZeroFloat(2.0f * M_PI)); + SysMatrix_InsertZRotation_f(Rand_ZeroFloat(2.0f * M_PI), 1); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); + gSPDisplayList(POLY_XLU_DISP++, D_04023428); + } + } + } + CLOSE_DISPS(gfxCtx); +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FB7D4.s") +#endif +#ifdef NON_MATCHING +void func_809FBB9C(Boss07 *this, GlobalContext *globalCtx, Vec3f *arg2) { + s32 i; + f32 temp_f12_2; + f32 temp_f20; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + + if (this->unk_AB4C > 0.0f) { + func_809F49A0(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 < 30; i++) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, D_80A07950[0][0], D_80A07950[0][1], D_80A07950[0][2], 40); + temp_f20 = (func_809F49C0() * 40.0f) - 30.0f; + SysMatrix_InsertTranslation(this->unk_334[2].x, this->unk_334[2].y - 30.0f + 50.0f + temp_f20 + 25.0f, this->unk_334[2].z, 0); + SysMatrix_InsertTranslation(arg2->x, arg2->y + temp_f20, arg2->z, 0); + SysMatrix_InsertYRotation_f(func_809F49C0() * M_PI * 2.0f, 1); + SysMatrix_RotateStateAroundXAxis(-0.024999999f * temp_f20); + SysMatrix_InsertZRotation_f(func_809F49C0() * 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(globalCtx->state.gfxCtx), 2); + gSPDisplayList(POLY_XLU_DISP++, D_0602EFE8); + } + } + func_8012C2DC(globalCtx->state.gfxCtx); + gSPDisplayList(POLY_XLU_DISP++, D_04023348); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, gGameInfo->data[1554] + 220, gGameInfo->data[1552] + 170); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, gGameInfo->data[1558] + 100, 128); + + SysMatrix_InsertTranslation(this->unk_334[2].x, this->unk_334[2].y, this->unk_334[2].z, 0); + SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); + SysMatrix_InsertZRotation_s(globalCtx->gameplayFrames * 0x80, 1); + temp_f12_2 = (gGameInfo->data[1553] + 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); + gSPDisplayList(POLY_XLU_DISP++, D_04023428); + } + CLOSE_DISPS(globalCtx->state.gfxCtx); +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FBB9C.s") +#endif #ifdef NON_MATCHING void func_809FBF94(Boss07* this, GlobalContext* globalCtx) { 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 37fa4bf1b..dddafe1d1 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -24,7 +24,7 @@ typedef struct { Vec3f unk_24[50]; Vec3f unk_27C[50]; Vec3f unk_4D4[50]; - char unk_72C[0xC8]; + f32 unk_72C[50]; } Boss07Whip; // size = 0x7F4 typedef struct Boss07 { @@ -70,7 +70,7 @@ typedef struct Boss07 { /* 0x0774 */ u8 unk_774; /* 0x0778 */ s32 unk_778; /* 0x077C */ f32 unk_77C; - /* 0x0780 */ char unk_780[4]; + /* 0x0780 */ s32 unk_780; /* 0x0784 */ s32 unk_784; /* 0x0788 */ Vec3s unk_788; /* 0x0790 */ f32 unk_790; From 080366a84bbc270e2c6d588297474119389d47d3 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Tue, 5 Oct 2021 00:40:57 -0500 Subject: [PATCH 05/28] 5 nonmatchings --- include/functions.h | 4 +- include/z64.h | 17 +- spec | 2 - src/boot_O2_g3/idle.c | 1 + src/overlays/actors/ovl_Boss_07/z_boss_07.c | 4018 +++++++++++++------ src/overlays/actors/ovl_Boss_07/z_boss_07.h | 88 +- tools/disasm/variables.txt | 77 +- undefined_syms.txt | 3 + 8 files changed, 2955 insertions(+), 1255 deletions(-) diff --git a/include/functions.h b/include/functions.h index 31d685c8b..f6dd9476b 100644 --- a/include/functions.h +++ b/include/functions.h @@ -653,7 +653,7 @@ void EffectSsSibuki_SpawnBurst(GlobalContext* globalCtx, Vec3f* pos); void EffectSsHitMark_SpawnFixedScale(GlobalContext* globalCtx, s32 type, Vec3f* pos); // void EffectSsHitMark_SpawnCustomScale(void); // void EffectSsFhgFlash_SpawnShock(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, Vec3f* pzParm3, UNK_TYPE2 uParm4, UNK_TYPE1 param_5); -// void EffectSsKFire_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, UNK_TYPE2 param_5, UNK_TYPE1 param_6); +void EffectSsKFire_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scaleMax, u8 type); void EffectSsSolderSrchBall_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, s16* linkDetected, s16 drawFlag); void EffectSsKakera_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* arg3, s16 gravity, s16 arg5, @@ -3858,7 +3858,7 @@ void func_8019F540(u8 arg0); void func_8019F88C(Vec3f* arg0, u16 sfxId, UNK_TYPE arg2); // void func_8019F900(void); // void func_8019FA18(void); -void func_8019FAD8(Vec3f* param_1, u16 param_2, f32 param_3); +void func_8019FAD8(Vec3f* param_1, u16 sfxId, f32 param_3); // void func_8019FB0C(void); // void func_8019FC20(void); // void func_8019FCB8(void); diff --git a/include/z64.h b/include/z64.h index e762f892b..a13ffedb6 100644 --- a/include/z64.h +++ b/include/z64.h @@ -1518,21 +1518,6 @@ typedef struct { /* 0x00 */ u16 state; } GameOverContext; // size = 0x02 -typedef struct { - /* 0x00 */ u8 unk_0; - /* 0x02 */ s16 unk_2; - /* 0x04 */ Vec3f unk_4; - /* 0x10 */ Vec3f unk_10; - /* 0x1C */ Vec3f unk_1C; - /* 0x28 */ char unk28[4]; - /* 0x2C */ s16 unk_2C; - /* 0x2E */ char unk2E[2]; - /* 0x30 */ s16 unk_30; - /* 0x32 */ char unk32[2]; - /* 0x34 */ f32 unk_34; - /* 0x38 */ char unk38[0x10]; -} Boss07Effect; - struct GlobalContext { /* 0x00000 */ GameState state; /* 0x000A4 */ s16 sceneNum; @@ -1597,7 +1582,7 @@ struct GlobalContext { /* 0x18864 */ Path* setupPathList; /* 0x18868 */ void* unk_18868; /* 0x1886C */ AnimatedMaterial* sceneMaterialAnims; - /* 0x18870 */ Boss07Effect* specialEffects; + /* 0x18870 */ void* specialEffects; /* 0x18874 */ u8 skyboxId; /* 0x18875 */ s8 sceneLoadFlag; // "fade_direction" /* 0x18876 */ s16 unk_18876; diff --git a/spec b/spec index 0faeb1229..fd6d04663 100644 --- a/spec +++ b/spec @@ -2604,8 +2604,6 @@ beginseg name "ovl_Boss_07" compress include "build/src/overlays/actors/ovl_Boss_07/z_boss_07.o" - include "build/data/ovl_Boss_07/ovl_Boss_07.data.o" - include "build/data/ovl_Boss_07/ovl_Boss_07.bss.o" include "build/data/ovl_Boss_07/ovl_Boss_07.reloc.o" endseg diff --git a/src/boot_O2_g3/idle.c b/src/boot_O2_g3/idle.c index 4be8a1094..bb39f53da 100644 --- a/src/boot_O2_g3/idle.c +++ b/src/boot_O2_g3/idle.c @@ -1,4 +1,5 @@ #include "global.h" +#include "prevent_bss_reordering.h" u8 D_80096B20 = 1; vu8 gViConfigUseDefault = 1; 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 56854c066..057e3ece5 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -1,13 +1,28 @@ #include "z_boss_07.h" #include "overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h" +#include "overlays/actors/ovl_En_Bom/z_en_bom.h" #define FLAGS 0x00000035 #define THIS ((Boss07*)thisx) -// #define FACING_ANGLE(actor1, actor2) BINANG_SUB(BINANG_ROT180((actor1)->shape.rot.y), (actor2)->shape.rot.y) #define FACING_ANGLE(actor1, actor2) ((s16)((actor1)->shape.rot.y - (actor2)->shape.rot.y + 0x8000)) +typedef struct { + /* 0x00 */ u8 unk_0; + /* 0x02 */ s16 unk_2; + /* 0x04 */ Vec3f unk_4; + /* 0x10 */ Vec3f unk_10; + /* 0x1C */ Vec3f unk_1C; + /* 0x28 */ char unk28[4]; + /* 0x2C */ s16 unk_2C; + /* 0x2E */ char unk2E[2]; + /* 0x30 */ s16 unk_30; + /* 0x32 */ char unk32[2]; + /* 0x34 */ f32 unk_34; + /* 0x38 */ char unk38[0x10]; +} Boss07Effect; + void Boss07_Init(Actor* thisx, GlobalContext* globalCtx); void Boss07_Destroy(Actor* thisx, GlobalContext* globalCtx); @@ -29,20 +44,27 @@ 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 func_809F4BB0(s32 arg0, ColliderJntSph* arg1, Vec3f* arg2); s32 func_809FF678(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); void func_809FF6B0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); void func_809FF810(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx); void func_80A07740(GlobalContext* globalCtx); void func_809FBF94(Boss07* this, GlobalContext* globalCtx); -void func_80A03238(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, Vec3f* arg4, Vec3f* arg5, +void func_80A03238(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, Vec3f* arg6, f32 arg7, u8 arg8, f32 arg9); -void func_80A036C4(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, f32 arg4, f32 arg5); +void func_80A036C4(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* rot, f32 arg4, f32 arg5); void func_80A03868(Boss07* this, GlobalContext* globalCtx); -void func_80A03F18(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Boss07* this); -void func_809FAA44(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, Vec3f* arg4, Vec3f* arg5, f32 arg6, - f32 arg7, f32 arg8, f32 arg9, Vec3s* argA, s16 argB, f32 argC, s32 argD); -void func_809FB114(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, f32 arg4, s32 arg5); +void func_80A03F18(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); +void Boss07_Wrath_UpdateWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, f32 arg6, + f32 arg7, f32 arg8, f32 arg9, Vec3s* argA, s16 argB, f32 scale, s32 whipHand); +void Boss07_Wrath_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* rot, f32 arg4, s32 whipHand); s32 func_809FB504(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); void func_809FB55C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); void func_809FB728(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx); @@ -142,9 +164,94 @@ void func_80A05608(Boss07* this, GlobalContext* globalCtx); void func_80A05B50(Boss07* this, GlobalContext* globalCtx); void func_80A05DDC(Boss07* this, GlobalContext* globalCtx); -#if 0 -// static DamageTable sDamageTable = { -static DamageTable D_80A07980 = { +// object addresses +extern AnimationHeader D_06000194; +extern AnimationHeader D_06000428; +extern AnimationHeader D_06000D0C; +extern AnimationHeader D_06002C40; +extern AnimationHeader D_06002D84; +extern AnimationHeader D_060031E4; +extern AnimationHeader D_06003854; +extern AnimationHeader D_06003A64; +extern FlexSkeletonHeader D_060099A0; +extern AnimationHeader D_06009C7C; +extern AnimationHeader D_06009EA8; +extern AnimationHeader D_0600A194; +extern AnimationHeader D_0600A400; +extern AnimationHeader D_0600A6AC; +extern AnimationHeader D_0600AB04; +extern AnimationHeader D_0600AD84; +extern AnimationHeader D_0600AE40; +extern Gfx D_0600AFB0[]; +extern Gfx D_0600B020[]; +extern Gfx D_0600C7D8[]; +extern Gfx D_0600CEE8[]; +extern Gfx D_060149A0[]; +extern Gfx D_06016090[]; +extern Gfx D_06017DE0[]; +extern Gfx D_06019328[]; +extern SkeletonHeader D_06019C58; +extern AnimationHeader D_06019E48; +extern AnimationHeader D_0601DEB4; +extern AnimationHeader D_06022BB4; +extern AnimationHeader D_06023DAC; +extern AnimationHeader D_06025018; +extern AnimationHeader D_06025878; +extern AnimationHeader D_06026204; +extern AnimationHeader D_060269EC; +extern AnimationHeader D_06026EA0; +extern AnimationHeader D_06027270; +extern Gfx D_0602EE50[]; +extern Gfx D_0602EEC8[]; +extern Gfx D_0602EEF8[]; +extern Gfx D_0602EF68[]; +extern Gfx D_0602EF88[]; +extern Gfx D_0602EFE8[]; +extern Gfx D_0602F640[]; +extern UNK_TYPE D_0602F840; // title card +extern UNK_TYPE D_06030C40; // title card +extern UNK_TYPE D_06032040; // title card +extern FlexSkeletonHeader D_060335F0; +extern AnimationHeader D_06033F80; +extern AnimationHeader D_06034E64; +extern AnimationHeader D_060358C4; +extern AnimationHeader D_06036A7C; +extern AnimationHeader D_06037ADC; +extern AnimationHeader D_0603918C; +extern AnimationHeader D_0603B330; +extern AnimationHeader D_0603C4E0; +extern AnimationHeader D_0603CBD0; +extern AnimationHeader D_0603D224; +extern AnimationHeader D_0603D7F0; +extern AnimationHeader D_0603DD1C; +extern UNK_TYPE D_0603DD30[]; +extern UNK_TYPE D_0603ED30[]; +extern UNK_TYPE D_0603F130[]; +extern UNK_TYPE D_06040130[]; +extern UNK_TYPE D_06040930[]; +extern UNK_TYPE D_06040B30[]; +extern UNK_TYPE D_06041B30[]; +extern UNK_TYPE D_06042330[]; +extern UNK_TYPE D_06043330[]; +extern UNK_TYPE D_06045B30[]; + +static s16 D_80A07950[4][3] = { + { 255, 255, 100 }, + { 255, 100, 100 }, + { 100, 255, 100 }, + { 100, 100, 255 }, +}; + +static s16 D_80A07968[4][3] = { + { 255, 255, 255 }, + { 255, 255, 255 }, + { 255, 255, 255 }, + { 255, 255, 255 }, +}; + +#if 1 // use to collapse collision data + +static DamageTable sMaskDmgTable = { /* Deku Nut */ DMG_ENTRY(0, 0x0), /* Deku Stick */ DMG_ENTRY(1, 0xF), /* Horse trample */ DMG_ENTRY(0, 0x0), @@ -179,8 +286,7 @@ static DamageTable D_80A07980 = { /* Powder Keg */ DMG_ENTRY(2, 0xF), }; -// static DamageTable sDamageTable = { -static DamageTable D_80A079A0 = { +static DamageTable sIncarnationDmgTable = { /* Deku Nut */ DMG_ENTRY(0, 0x0), /* Deku Stick */ DMG_ENTRY(1, 0xF), /* Horse trample */ DMG_ENTRY(0, 0x0), @@ -215,8 +321,7 @@ static DamageTable D_80A079A0 = { /* Powder Keg */ DMG_ENTRY(4, 0xC), }; -// static DamageTable sDamageTable = { -static DamageTable D_80A079C0 = { +static DamageTable sWrathDmgTable = { /* Deku Nut */ DMG_ENTRY(0, 0x0), /* Deku Stick */ DMG_ENTRY(1, 0xE), /* Horse trample */ DMG_ENTRY(0, 0x0), @@ -251,8 +356,7 @@ static DamageTable D_80A079C0 = { /* Powder Keg */ DMG_ENTRY(2, 0xC), }; -// static DamageTable sDamageTable = { -static DamageTable D_80A079E0 = { +static DamageTable sRemainsDmgTable = { /* Deku Nut */ DMG_ENTRY(0, 0x0), /* Deku Stick */ DMG_ENTRY(1, 0xF), /* Horse trample */ DMG_ENTRY(0, 0x0), @@ -287,8 +391,7 @@ static DamageTable D_80A079E0 = { /* Powder Keg */ DMG_ENTRY(2, 0xE), }; -// static DamageTable sDamageTable = { -static DamageTable D_80A07A00 = { +static DamageTable sTopDmgTable = { /* Deku Nut */ DMG_ENTRY(0, 0x0), /* Deku Stick */ DMG_ENTRY(1, 0xD), /* Horse trample */ DMG_ENTRY(1, 0xE), @@ -335,333 +438,461 @@ const ActorInit Boss_07_InitVars = { (ActorFunc)Boss07_Wrath_Draw, }; -// static ColliderJntSphElementInit sJntSphElementsInit[11] = { static ColliderJntSphElementInit D_80A07A40[11] = { { - { ELEMTYPE_UNK3, { 0xF7CFFFFF, 0x00, 0x10 }, { 0xF7CEFFFE, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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 sJntSphInit = { -static ColliderJntSphInit D_80A07BCC = { - { COLTYPE_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, OC2_TYPE_1, COLSHAPE_JNTSPH, }, - 11, D_80A07A40, // sJntSphElementsInit, +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, + D_80A07A40, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80A07BDC = { - { 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, }, +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 sJntSphElementsInit[1] = { static ColliderJntSphElementInit D_80A07C08[1] = { { - { ELEMTYPE_UNK3, { 0xF7CFFFFF, 0x04, 0x10 }, { 0xF7CEFFFE, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_HARD, BUMP_ON, OCELEM_ON, }, + { + 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 sJntSphInit = { -static ColliderJntSphInit D_80A07C2C = { - { COLTYPE_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, OC2_TYPE_1, COLSHAPE_JNTSPH, }, - 1, D_80A07C08, // sJntSphElementsInit, +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, + D_80A07C08, }; -// static ColliderQuadInit sQuadInit = { -static ColliderQuadInit D_80A07C3C = { - { 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, }, +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 sQuadInit = { -static ColliderQuadInit D_80A07C8C = { - { 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, }, +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 sJntSphElementsInit[11] = { static ColliderJntSphElementInit D_80A07CDC[11] = { { - { ELEMTYPE_UNK3, { 0xF7CFFFFF, 0x00, 0x10 }, { 0xF7CEFFFE, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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, }, + { + 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 sJntSphInit = { -static ColliderJntSphInit D_80A07E68 = { - { COLTYPE_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, OC2_TYPE_1, COLSHAPE_JNTSPH, }, - 11, D_80A07CDC, // sJntSphElementsInit, +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, + D_80A07CDC, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80A07E78 = { - { 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, }, +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 sCylinderInit = { -static ColliderCylinderInit D_80A07EA4 = { - { 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, }, +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 sCylinderInit = { -static ColliderCylinderInit D_80A07ED0 = { - { 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, }, +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 -extern s16 D_80A07968[4][3]; -extern s16 D_80A07950[4][3]; -extern s16 D_80A07952[3]; -extern DamageTable D_80A07980; -extern DamageTable D_80A079A0; -extern DamageTable D_80A079C0; -extern DamageTable D_80A079E0; -extern DamageTable D_80A07A00; -extern ColliderJntSphElementInit D_80A07A40[11]; -extern ColliderJntSphInit D_80A07BCC; -extern ColliderCylinderInit D_80A07BDC; -extern ColliderJntSphElementInit D_80A07C08[1]; -extern ColliderJntSphInit D_80A07C2C; -extern ColliderQuadInit D_80A07C3C; -extern ColliderQuadInit D_80A07C8C; -extern ColliderJntSphElementInit D_80A07CDC[11]; -extern ColliderJntSphInit D_80A07E68; -extern ColliderCylinderInit D_80A07E78; -extern ColliderCylinderInit D_80A07EA4; -extern ColliderCylinderInit D_80A07ED0; -extern Color_RGBA8 D_80A07EFC; -extern Color_RGBA8 D_80A07F00; -extern Color_RGBA8 D_80A07F04; -extern Color_RGBA8 D_80A07F08; -extern Vec3f D_80A07F0C[4]; -extern Vec3s D_80A07F3C[4]; -extern s16 D_80A07F54[4]; -extern EffTireMarkInit D_80A07F5C; -extern EffTireMarkInit D_80A07F64; -extern f32 D_80A07F6C[][3]; -extern Vec3f D_80A07FA8; -extern Vec3f D_80A07FB4; -extern Vec3f D_80A07FC0; -extern Color_RGBA8 D_80A07FCC; -extern Color_RGBA8 D_80A07FD0; -extern Vec3f D_80A07FD4; -extern Vec3f D_80A07FE0; -extern s8 D_80A07FEC[32]; -extern Vec3f D_80A0800C[11]; -extern s8 D_80A08090[32]; -extern Vec3f D_80A080B0; -extern s32 D_80A080BC[6]; -extern s32 D_80A080D4[7]; -extern s32 D_80A080F0[8]; -extern s32 D_80A08110[12]; -extern s32 D_80A08140[15]; -extern u8 D_80A0817C[15]; -extern AnimationHeader* D_80A0818C[3]; -extern u8 D_80A08198[8]; -extern u8 D_80A081A0[8]; -extern s8 D_80A081A8[32]; -extern s8 D_80A081C8[32]; -extern Vec3f D_80A081E8[11]; -extern s8 D_80A0826C[32]; -extern Vec3s D_80A0828C[4]; -extern Vec3s D_80A082A4[4]; -extern Vec3f D_80A082BC; -extern Vec3f D_80A082C8; -extern Vec3f D_80A082D4; -extern void* D_80A082E0[2]; - -// extern Vec3f D_80A084D8; - -extern Vec3f D_80A09A40; -extern u8 D_80A09A4C; -extern s32 D_80A09A50; -extern Boss07* D_80A09A54; -extern Boss07* D_80A09A58; -extern Boss07* D_80A09A5C; -extern Boss07* D_80A09A60[4]; -extern u8 D_80A09A70; -extern u8 D_80A09A71; -extern Boss07Effect D_80A09A78[50]; -extern s32 D_80A0A888; -extern s32 D_80A0A88C; -extern s32 D_80A0A890; - -extern UNK_TYPE D_06000194; -extern UNK_TYPE D_06000428; -extern AnimationHeader D_06000D0C; -extern UNK_TYPE D_06002C40; -extern AnimationHeader D_06002D84; -extern UNK_TYPE D_06003854; -extern UNK_TYPE D_06003A64; -extern FlexSkeletonHeader D_060099A0; -extern AnimationHeader D_06009C7C; -extern UNK_TYPE D_06009EA8; -extern UNK_TYPE D_0600A194; -extern AnimationHeader D_0600A400; -extern AnimationHeader D_0600A6AC; -extern AnimationHeader D_0600AE40; -extern Gfx D_0600AFB0[]; -extern UNK_TYPE D_0600B020; -extern UNK_TYPE D_0600C7D8; -extern Gfx D_0600CEE8[]; -extern Gfx D_060149A0[]; -extern Gfx D_06016090[]; -extern Gfx D_06017DE0[]; -extern Gfx D_06019328[]; -extern SkeletonHeader D_06019C58; -extern AnimationHeader D_06019E48; -extern AnimationHeader D_0601DEB4; -extern AnimationHeader D_06022BB4; -extern AnimationHeader D_06023DAC; -extern UNK_TYPE D_06025018; -extern AnimationHeader D_06025878; -extern AnimationHeader D_06026204; -extern AnimationHeader D_060269EC; -extern AnimationHeader D_06026EA0; -extern UNK_TYPE D_06027270; -extern Gfx D_0602EE50[]; -extern Gfx D_0602EEC8[]; -extern Gfx D_0602EEF8[]; -extern Gfx D_0602EF68[]; -extern Gfx D_0602EF88[]; -extern Gfx D_0602EFE8[]; -extern Gfx D_0602F640[]; -extern UNK_TYPE D_0602F840; // title card -extern UNK_TYPE D_06032040; // title card -extern FlexSkeletonHeader D_060335F0; -extern AnimationHeader D_06033F80; -extern AnimationHeader D_06034E64; -extern AnimationHeader D_060358C4; -extern AnimationHeader D_06036A7C; -extern AnimationHeader D_06037ADC; -extern AnimationHeader D_0603918C; -extern AnimationHeader D_0603B330; -extern AnimationHeader D_0603C4E0; -extern AnimationHeader D_0603CBD0; -extern AnimationHeader D_0603D224; -extern AnimationHeader D_0603D7F0; -extern AnimationHeader D_0603DD1C; -extern u16 D_0603DD30[]; -extern u16 D_0603ED30[]; -extern u16 D_0603F130[]; -extern u16 D_06040130[]; -extern u16 D_06040930[]; -extern u16 D_06040B30[]; -extern u16 D_06041B30[]; -extern u16 D_06042330[]; -extern u16 D_06043330[]; +static Vec3f sSfxPoint; +static u8 sHeartbeatTimer; +static s32 sWhipSegCount; +static Boss07* sMajorasWrath; +static Boss07* sMajoraStatic; +static Boss07* sMajorasMask; +static Boss07* sBossRemains[4]; +static u8 D_80A09A70; +static u8 sMusicStartTimer; +static Boss07Effect sEffects[50]; +static s32 sSeed0; +static s32 sSeed1; +static s32 sSeed2; void func_809F4980(Actor* arg0) { Audio_PlayActorSound2(arg0, NA_SE_EN_FOLLOWERS_DAMAGE); } void func_809F49A0(s32 seedInit0, s32 seedInit1, s32 seedInit2) { - D_80A0A888 = seedInit0; - D_80A0A88C = seedInit1; - D_80A0A890 = seedInit2; + sSeed0 = seedInit0; + sSeed1 = seedInit1; + sSeed2 = seedInit2; } f32 func_809F49C0(void) { // Wichmann-Hill algorithm f32 randFloat; - D_80A0A888 = (D_80A0A888 * 171) % 30269; - D_80A0A88C = (D_80A0A88C * 172) % 30307; - D_80A0A890 = (D_80A0A890 * 170) % 30323; + sSeed0 = (sSeed0 * 171) % 30269; + sSeed1 = (sSeed1 * 172) % 30307; + sSeed2 = (sSeed2 * 170) % 30323; - randFloat = (D_80A0A888 / 30269.0f) + (D_80A0A88C / 30307.0f) + (D_80A0A890 / 30323.0f); + randFloat = (sSeed0 / 30269.0f) + (sSeed1 / 30307.0f) + (sSeed2 / 30323.0f); while (randFloat >= 1.0f) { randFloat -= 1.0f; } @@ -718,6 +949,8 @@ void func_809F4D10(Vec3f* arg0, f32 arg1) { } void func_809F4D54(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { + static Color_RGBA8 sDarkOrange1 = { 60, 50, 20, 255 }; + static Color_RGBA8 sDarkRed1 = { 40, 30, 30, 255 }; u8 phi_s1; Vec3f spB0; Vec3f spA4; @@ -738,7 +971,7 @@ void func_809F4D54(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { spB0.z = this->unk_1788[phi_s1].z + randPlusMinusPoint5Scaled(20.0f); spB0.x = this->unk_1788[phi_s1].x + randPlusMinusPoint5Scaled(20.0f); } - func_800B0EB0(globalCtx, &spB0, &spA4, &sp98, &D_80A07EFC, &D_80A07F00, Rand_ZeroFloat(150.0f) + 350.0f, 10, + func_800B0EB0(globalCtx, &spB0, &spA4, &sp98, &sDarkOrange1, &sDarkRed1, Rand_ZeroFloat(150.0f) + 350.0f, 10, Rand_ZeroFloat(5.0f) + 14.0f); } } @@ -753,6 +986,8 @@ void func_809F4FAC(GlobalContext* globalCtx) { } void func_809F4FF8(GlobalContext* globalCtx, Vec3f* arg1, u8 arg2) { + static Color_RGBA8 sDarkOrange2 = { 60, 50, 20, 255 }; + static Color_RGBA8 sDarkRed2 = { 40, 30, 30, 255 }; u8 i; Vec3f spB0; Vec3f spA4; @@ -767,7 +1002,7 @@ void func_809F4FF8(GlobalContext* globalCtx, Vec3f* arg1, u8 arg2) { spB0.x = randPlusMinusPoint5Scaled(30.0f) + arg1->x; spB0.y = randPlusMinusPoint5Scaled(30.0f) + (arg1->y + 15.0f); spB0.z = randPlusMinusPoint5Scaled(30.0f) + arg1->z; - func_800B0EB0(globalCtx, &spB0, &spA4, &sp98, &D_80A07F04, &D_80A07F08, Rand_ZeroFloat(50.0f) + 100.0f, 10, + func_800B0EB0(globalCtx, &spB0, &spA4, &sp98, &sDarkOrange2, &sDarkRed2, Rand_ZeroFloat(50.0f) + 100.0f, 10, Rand_ZeroFloat(5.0f) + 14.0f); } } @@ -794,18 +1029,18 @@ void func_809F51E8(Boss07* this, GlobalContext* globalCtx, u8 arg2) { } void func_809F52CC(Boss07* this, GlobalContext* globalCtx) { - Actor* phi_v0 = globalCtx->actorCtx.actorList[ACTORCAT_EXPLOSIVES].first; + Actor* explosive = globalCtx->actorCtx.actorList[ACTORCAT_EXPLOSIVES].first; - while (phi_v0 != NULL) { - f32 dx = phi_v0->world.pos.x - this->actor.world.pos.x; - f32 dy = phi_v0->world.pos.y - this->actor.world.pos.y; - f32 dz = phi_v0->world.pos.z - this->actor.world.pos.z; + while (explosive != NULL) { + f32 dx = explosive->world.pos.x - this->actor.world.pos.x; + f32 dy = explosive->world.pos.y - this->actor.world.pos.y; + 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, 0); return; } - phi_v0 = phi_v0->next; + explosive = explosive->next; } } @@ -819,7 +1054,7 @@ void func_809F536C(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2) { sp50.x = 0.0f; - for (i = 0; i < D_80A09A50; i++, arg1++, arg2++) { + for (i = 0; i < sWhipSegCount; i++, arg1++, arg2++) { dx = arg1->x - arg0->x; dy = arg1->y - arg0->y; dz = arg1->z - arg0->z; @@ -838,19 +1073,37 @@ void func_809F536C(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2) { } void func_809F5494(Boss07* this, GlobalContext* globalCtx) { - Actor* phi_s0 = globalCtx->actorCtx.actorList[3].first; + Actor* explosive = globalCtx->actorCtx.actorList[ACTORCAT_EXPLOSIVES].first; - while (phi_s0 != NULL) { - if (phi_s0->params == 1) { - func_809F536C(&phi_s0->world.pos, this->unk_7AC, this->unk_C5C); - func_809F536C(&phi_s0->world.pos, this->unk_FB8, this->unk_1468); + while (explosive != NULL) { + if (explosive->params == 1) { + func_809F536C(&explosive->world.pos, this->rightWhip.pos, this->rightWhip.pull); + func_809F536C(&explosive->world.pos, this->leftWhip.pos, this->leftWhip.pull); } - phi_s0 = phi_s0->next; + explosive = explosive->next; } } +static Vec3f sRemainsStart[4] = { + { 70.0f, 70.0f, -70.0f }, + { 24.0f, 88.0f, -70.0f }, + { -24.0f, 88.0f, -70.0f }, + { -70.0f, 70.0f, -70.0f }, +}; + +static Vec3s sRemainsEnd[4] = { + { 712, 0xD500, -416 }, + { -712, 0x2B00, -420 }, + { 702, 0xAB00, 415 }, + { -712, 0x5500, 416 }, +}; // y value here is y rotation, not position + #ifdef NON_MATCHING +// reordering when loading Boss07_Projectile_Update void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { + static s16 sRemainsParams[4] = { 200, 201, 202, 203 }; + static EffTireMarkInit sTopTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; + static EffTireMarkInit sMaskTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; s32 i; @@ -859,72 +1112,76 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.update = Boss07_Effects_Update; this->actor.draw = Boss07_Effects_Draw; this->actor.flags &= ~1; - D_80A09A58 = this; + sMajoraStatic = this; D_80A09A70 = 0; globalCtx->envCtx.unk_C3 = 0; globalCtx->envCtx.unk_E0 = 2; } else { if (this->actor.params == 0) { - Boss07Effect* effect; - this->actor.params = 10; 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, 150); - globalCtx->specialEffects = D_80A09A78; - for (effect = D_80A09A78; effect < &D_80A09A78[50]; effect++) { - effect->unk_0 = 0; + globalCtx->specialEffects = (void*)sEffects; + + for (i = 0; i < 50; i++) { + sEffects[i].unk_0 = 0; } for (i = 0; i < 4; i++) { - D_80A09A60[i] = NULL; + sBossRemains[i] = NULL; } } + this->actor.targetMode = 5; this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.gravity = -2.5f; + if(1) {} if (this->actor.params >= 200) { this->actor.update = Boss07_Remains_Update; this->actor.draw = Boss07_Remains_Draw; - D_80A09A60[(u32)this->actor.params - 200] = this; + if(1) {} + sBossRemains[this->actor.params - 200] = this; if (gSaveContext.eventInf[6] & 2) { Actor_SetScale(&this->actor, 0.03f); - this->actor.world.pos.x = D_80A07F3C[this->actor.params - 200].x; + this->actor.world.pos.x = sRemainsEnd[this->actor.params - 200].x; this->actor.world.pos.y = 370.0f; - this->actor.world.pos.z = D_80A07F3C[this->actor.params - 200].z; - this->actor.shape.rot.y = D_80A07F3C[this->actor.params - 200].y; + this->actor.world.pos.z = sRemainsEnd[this->actor.params - 200].z; + this->actor.shape.rot.y = sRemainsEnd[this->actor.params - 200].y; func_80A04DE0(this, globalCtx); } else { func_80A04878(this, globalCtx); } this->actor.flags &= ~1; - this->actor.colChkInfo.damageTable = &D_80A079E0; + this->actor.colChkInfo.damageTable = &sRemainsDmgTable; } else if (this->actor.params == 180) { this->actor.update = Boss07_Top_Update; this->actor.draw = Boss07_Top_Draw; func_80A05AF8(this, globalCtx); - this->actor.colChkInfo.damageTable = &D_80A07A00; + this->actor.colChkInfo.damageTable = &sTopDmgTable; ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, KREG(55) + 9.0f); this->actor.shape.shadowAlpha = 180; - Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &D_80A07ED0); - Effect_Add(globalCtx, &this->effectIndex, 4, 0, 0, &D_80A07F5C); + Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &sTopCylInit); + Effect_Add(globalCtx, &this->effectIndex, 4, 0, 0, &sTopTireMarkInit); this->actor.flags &= ~1; - } else if ((this->actor.params == 100) || (this->actor.params == 101)) { + } else if ((this->actor.params == 100) || ((this->actor.params & 0xFFFFFFFF) == 101)) { + this->actor.update = Boss07_Projectile_Update; this->actor.draw = Boss07_Projectile_Draw; + this->actor.flags &= ~1; - Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &D_80A07E78); + Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &sShotCylInit); func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); this->unk_181C = Rand_ZeroFloat(3.99f); } else if ((this->actor.params == 10) || (this->actor.params == 11)) { - this->actor.colChkInfo.damageTable = &D_80A07980; + this->actor.colChkInfo.damageTable = &sMaskDmgTable; ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 15.0f); - SkelAnime_Init(globalCtx, &this->skelAnime1, &D_06019C58, &D_06019E48, this->jointTable1, this->morphTable1, + SkelAnime_Init(globalCtx, &this->skelAnime, &D_06019C58, &D_06019E48, this->jointTable1, this->morphTable1, 19); if (this->actor.params == 10) { this->actor.update = Boss07_Mask_Update; this->actor.draw = Boss07_Mask_Draw; - Effect_Add(globalCtx, &this->effectIndex, 4, 0, 0, &D_80A07F64); - D_80A09A5C = this; + Effect_Add(globalCtx, &this->effectIndex, 4, 0, 0, &sMaskTireMarkInit); + sMajorasMask = this; if (gSaveContext.eventInf[6] & 2) { this->actor.world.pos.x = 0.0f; this->actor.world.pos.y = sREG(17) + 277.0f; @@ -938,21 +1195,21 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->timers[2] = 200; this->unk_1888 = 50; this->actor.flags |= 1; - D_80A09A71 = 20; + sMusicStartTimer = 20; } else { func_80A016E4(this, globalCtx); } - Collider_InitAndSetQuad(globalCtx, &this->quad1, &this->actor, &D_80A07C3C); - Collider_InitAndSetQuad(globalCtx, &this->quad2, &this->actor, &D_80A07C8C); + Collider_InitAndSetQuad(globalCtx, &this->quad1, &this->actor, &sMaskQuadInit1); + Collider_InitAndSetQuad(globalCtx, &this->quad2, &this->actor, &sMaskQuadInit2); this->actor.colChkInfo.health = 14; for (i = 0; i < 4; i++) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BOSS_07, 0.0f, 0.0f, 0.0f, 0, 0, 0, - D_80A07F54[i]); + sRemainsParams[i]); } } } else if ((this->actor.params == 20) || (this->actor.params == 21)) { Actor_SetScale(&this->actor, 0.015000001f); - SkelAnime_InitSV(globalCtx, &this->skelAnime1, &D_060099A0, &D_0600A6AC, this->jointTable1, + SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060099A0, &D_0600A6AC, this->jointTable1, this->morphTable1, 25); if (this->actor.params == 21) { this->timers[0] = this->actor.world.rot.z; @@ -961,14 +1218,14 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.draw = Boss07_Afterimage_Draw; this->actor.flags &= ~1; } else { - this->actor.colChkInfo.damageTable = &D_80A079A0; + this->actor.colChkInfo.damageTable = &sIncarnationDmgTable; this->actor.colChkInfo.health = 30; this->actor.update = Boss07_Incarnation_Update; this->actor.draw = Boss07_Incarnation_Draw; - Collider_InitAndSetJntSph(globalCtx, &this->sph1, &this->actor, &D_80A07E68, this->sphElems1); + Collider_InitAndSetJntSph(globalCtx, &this->sph1, &this->actor, &sIncarnationJntSphInit1, this->sphElems1); ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 80.0f); - this->unk_ABD2 = this->actor.shape.rot.z; - if (this->unk_ABD2 != 0) { + this->csCamIndex = this->actor.shape.rot.z; + if (this->csCamIndex != 0) { func_809FCC70(this, globalCtx); } else { func_809FD5F8(this, globalCtx); @@ -985,38 +1242,39 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->unk_17F4 = 1.0f; } } else { - D_80A09A54 = this; + sMajorasWrath = this; this->actor.colChkInfo.health = 40; - this->actor.colChkInfo.damageTable = &D_80A079C0; + this->actor.colChkInfo.damageTable = &sWrathDmgTable; Actor_SetScale(&this->actor, 0.01f); - this->unk_ABD2 = this->actor.shape.rot.z; - if (this->unk_ABD2 != 0) { + this->csCamIndex = this->actor.shape.rot.z; + if (this->csCamIndex != 0) { func_809F5E14(this, globalCtx); } else { func_809F7400(this, globalCtx, 50); - this->unk_77C = 1.0f; + this->whipScale = 1.0; Audio_QueueSeqCmd(0x8069); } - SkelAnime_InitSV(globalCtx, &this->skelAnime1, &D_060335F0, &D_0603CBD0, this->jointTable1, + SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060335F0, &D_0603CBD0, this->jointTable1, this->morphTable1, 28); - Collider_InitAndSetJntSph(globalCtx, &this->sph1, &this->actor, &D_80A07BCC, this->sphElems1); - Collider_InitAndSetJntSph(globalCtx, &this->sph2, &this->actor, &D_80A07C2C, this->sphElems2); - Collider_InitAndSetCylinder(globalCtx, &this->cyl1, &this->actor, &D_80A07BDC); - this->unk_17E0 = 1.0f; - this->unk_794 = 0.7f; - this->unk_FA0 = 0.7f; - this->unk_798 = 2.0f; - this->unk_FA4 = 2.0f; - this->unk_79C = 0.0f; - this->unk_FA8 = 0.0f; - this->unk_790 = -15.0f; - this->unk_F9C = -15.0f; + 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); + + 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; - D_80A09A50 = 44; + sWhipSegCount = 44; + this->unk_17E0 = 1.0f; + } } } #else +static s16 sRemainsParams[4] = { 200, 201, 202, 203 }; +static EffTireMarkInit sTopTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; +static EffTireMarkInit sMaskTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Init.s") #endif @@ -1036,33 +1294,36 @@ void Boss07_Destroy(Actor* thisx, GlobalContext* globalCtx2) { void func_809F5E14(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_809F5E88; - SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_06023DAC, 0.0f); + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06023DAC, 0.0f); this->actor.flags &= ~1; this->unk_17D8 = 0x7F00; this->unk_15C = 20; this->unk_17E8 = 5120.0f; } -#ifdef NON_MATCHING void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { + static f32 D_80A07F6C[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 }, + }; this->unk_15C = 20; - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); this->unk_ABC8++; SysMatrix_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); - switch (this->unk_ABD0) { + switch (this->csState) { case 0: this->unk_ABC8 = 0; - this->unk_ABD0 = 1; - this->unk_ABF8.z = 0.f; - this->unk_ABEC.x = 0.0; - this->unk_ABEC.y = gGameInfo->data[1265] + 100.0f - 30.0f + 80.0f; - this->unk_ABEC.z = gGameInfo->data[1266] + 270.0f - 150.0f + 30.0f - 50.0f; - this->unk_ABF8.x = 0.0f; - this->unk_ABF8.y = 180.0f; + this->csState = 1; + this->csCamNextAt.z = 0.f; + this->csCamNextEye.x = 0.0; + this->csCamNextEye.y = KREG(17) + 100.0f - 30.0f + 80.0f; + this->csCamNextEye.z = KREG(18) + 270.0f - 150.0f + 30.0f - 50.0f; + this->csCamNextAt.x = 0.0f; + this->csCamNextAt.y = 180.0f; case 1: if (this->unk_ABC8 < 40) { - D_80A09A4C = 3; + sHeartbeatTimer = 3; } if (this->unk_ABC8 > 20) { if (this->unk_ABC8 == 21) { @@ -1075,9 +1336,10 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { Math_ApproachZeroF(&this->unk_17E8, 1.0f, 200.0f); } } - if (this->unk_ABC8 >= 0x3D) { + if (this->unk_ABC8 > 60) { Player* player = PLAYER; s32 phi_v1 = 0; + if (0) {} if (player->transformation == 1) { phi_v1 = 1; @@ -1089,29 +1351,29 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { phi_v1 = 4; } - Math_ApproachF(&this->unk_ABEC.y, D_80A07F6C[phi_v1][0], 0.075f, this->unk_AC0C * 7.0f); - Math_ApproachF(&this->unk_ABEC.z, D_80A07F6C[phi_v1][1], 0.075f, this->unk_AC0C * 17.0f); - Math_ApproachF(&this->unk_ABF8.y, D_80A07F6C[phi_v1][2], 0.075f, this->unk_AC0C * 7.0f); - Math_ApproachF(&this->unk_AC0C, 1.0f, 1.0f, 0.01f); + Math_ApproachF(&this->csCamNextEye.y, D_80A07F6C[phi_v1][0], 0.075f, this->csCamSpeedMod * 7.0f); + Math_ApproachF(&this->csCamNextEye.z, D_80A07F6C[phi_v1][1], 0.075f, this->csCamSpeedMod * 17.0f); + Math_ApproachF(&this->csCamNextAt.y, D_80A07F6C[phi_v1][2], 0.075f, this->csCamSpeedMod * 7.0f); + Math_ApproachF(&this->csCamSpeedMod, 1.0f, 1.0f, 0.01f); if (this->unk_ABC8 == 70) { - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06025018, -15.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06025018, -15.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_06025018); func_8019FE1C(&this->actor.projectedPos, NA_SE_EV_ICE_PILLAR_RISING, 1.0f); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_SHOUT); } if (this->unk_ABC8 >= 110) { - Math_ApproachF(&this->unk_77C, 1.0f, 1.0f, 0.05f); - this->unk_794 = 0.79999995f; - this->unk_FA0 = 0.79999995f; - this->unk_798 = 1.0f; - this->unk_FA4 = 1.0f; + 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; } if (this->unk_ABC8 == 127) { - this->unk_77C = 1.0f; + this->whipScale = 1.0f; } if (this->unk_ABC8 == 120) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_HOP2_OLD); - func_8019F1C0(&D_80A09A40, NA_SE_EN_LAST3_VOICE_KICK_OLD); + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_KICK_OLD); func_8019FE74(&D_801D6654, 0.0f, 0x3C); } if (this->unk_ABC8 == 112) { @@ -1121,40 +1383,37 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { Actor_TitleCardCreate(globalCtx, &globalCtx->actorCtx.titleCtxt, Lib_SegmentedToVirtual(&D_06032040), 0xA0, 0xB4, 0x80, 0x28); } - if (func_801378B8(&this->skelAnime1, this->unk_1D4)) { + if (func_801378B8(&this->skelAnime, this->unk_1D4)) { s32 i; Camera* sp48 = Play_GetCamera(globalCtx, 0); - this->unk_ABD0 = 0; + this->csState = 0; func_809F7400(this, globalCtx, 50); - sp48->eye = this->unk_ABD4; - sp48->eyeNext = this->unk_ABD4; - sp48->at = this->unk_ABE0; - func_80169AFC(globalCtx, this->unk_ABD2, 0); - this->unk_ABD2 = 0; + sp48->eye = this->csCamEye; + sp48->eyeNext = this->csCamEye; + sp48->at = this->csCamAt; + func_80169AFC(globalCtx, this->csCamIndex, 0); + this->csCamIndex = 0; func_800EA0EC(globalCtx, &globalCtx->csCtx); func_800B7298(globalCtx, &this->actor, 6); this->actor.flags |= 1; func_80165690(); - if (D_80A09A60[0] != NULL) { + if (sBossRemains[0] != NULL) { for (i = 0; i < 4; i++) { - func_800BC154(globalCtx, &globalCtx->actorCtx, &D_80A09A60[i]->actor, 9); + func_800BC154(globalCtx, &globalCtx->actorCtx, &sBossRemains[i]->actor, 9); } } } } break; } - SysMatrix_MultiplyVector3fByState(&this->unk_ABEC, &this->unk_ABD4); - SysMatrix_MultiplyVector3fByState(&this->unk_ABF8, &this->unk_ABE0); - if (this->unk_ABD2 != 0) { + SysMatrix_MultiplyVector3fByState(&this->csCamNextEye, &this->csCamEye); + SysMatrix_MultiplyVector3fByState(&this->csCamNextAt, &this->csCamAt); + if (this->csCamIndex != 0) { ShrinkWindow_SetLetterboxTarget(0x1B); - Play_CameraSetAtEye(globalCtx, this->unk_ABD2, &this->unk_ABE0, &this->unk_ABD4); + Play_CameraSetAtEye(globalCtx, this->csCamIndex, &this->csCamAt, &this->csCamEye); } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F5E88.s") -#endif void func_809F64F4(Boss07* this, GlobalContext* globalCtx) { s32 i; @@ -1162,32 +1421,33 @@ void func_809F64F4(Boss07* this, GlobalContext* globalCtx) { Audio_QueueSeqCmd(0x100100FF); func_809F4FAC(globalCtx); this->actionFunc = func_809F65F4; - this->unk_794 = 0.7f; - this->unk_FA0 = 0.7f; - this->unk_798 = 2.0f; - this->unk_FA4 = 2.0f; - this->unk_79C = 0.0f; - this->unk_FA8 = 0.0f; - this->unk_790 = -15.0f; - this->unk_F9C = -15.0f; - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06022BB4, 0.0f); + 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; + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06022BB4, 0.0f); this->actor.flags &= ~1; - this->unk_ABD0 = 0; + this->csState = 0; this->unk_ABC8 = 0; - if (D_80A09A60[0] != NULL) { + if (sBossRemains[0] != NULL) { for (i = 0; i < 4; i++) { - D_80A09A60[i]->unk_14E = 2; + sBossRemains[i]->unk_14E = 2; } } this->unk_15C = 1000; } #ifdef NON_MATCHING +// spA4 and spA0 loaded in wrong order void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { s32 i; s32 spC0 = 0; Vec3f spB4; - Vec3f spA8 = D_80A07FA8; + Vec3f spA8 = {0.0f, 0.0f, 0.0f}; f32 spA4; f32 spA0; Camera* temp_s0; @@ -1197,27 +1457,28 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { temp_s0 = Play_GetCamera(globalCtx, 0); this->unk_15C = 1000; func_809F4CBC(this, 1.0f); - switch (this->unk_ABD0) { + switch (this->csState) { case 0: - if (ActorCutscene_GetCurrentIndex() == -1) { - func_800EA0D4(globalCtx, &globalCtx->csCtx); - func_800B7298(globalCtx, &this->actor, 1); - this->unk_ABD2 = func_801694DC(globalCtx); - func_80169590(globalCtx, 0, 1); - func_80169590(globalCtx, this->unk_ABD2, 7); - Audio_PlayActorSound2(&this->actor, 0x39B8); + if (ActorCutscene_GetCurrentIndex() != -1) { + break; } + func_800EA0D4(globalCtx, &globalCtx->csCtx); + func_800B7298(globalCtx, &this->actor, 1); + this->csCamIndex = func_801694DC(globalCtx); + func_80169590(globalCtx, 0, 1); + func_80169590(globalCtx, this->csCamIndex, 7); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_DEAD_ROD); case 1: this->unk_ABC8 = 0; - this->unk_ABD0 = 2; - this->unk_ABD4.x = temp_s0->eye.x; - this->unk_ABD4.y = temp_s0->eye.y; - this->unk_ABD4.z = temp_s0->eye.z; - this->unk_ABE0.x = temp_s0->at.x; - this->unk_ABE0.y = temp_s0->at.y; - this->unk_ABE0.z = temp_s0->at.z; - this->unk_AC04 = this->actor.shape.rot.y * M_PI / 0x8000; - this->unk_AC08 = this->unk_AC0C = D_80A09A58->unk_180C = 0.0f; + this->csState = 2; + this->csCamEye.x = temp_s0->eye.x; + this->csCamEye.y = temp_s0->eye.y; + this->csCamEye.z = temp_s0->eye.z; + this->csCamAt.x = temp_s0->at.x; + this->csCamAt.y = temp_s0->at.y; + this->csCamAt.z = temp_s0->at.z; + this->csCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; + this->csCamRotVel = this->csCamSpeedMod = sMajoraStatic->unk_180C = 0.0f; func_809F49A0(1, 0x71AC, 0x263A); for (i = 0; i < 30; i++) { this->unk_AB50[i] = func_809F49C0() - 1.0f; @@ -1225,95 +1486,94 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { func_8016566C(150); case 2: if (this->unk_ABC8 == 20) { - func_8019F1C0(&D_80A09A40, 0x39E3); + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST2_WALK2_OLD); } if (this->unk_ABC8 == 40) { - func_8019F1C0(&D_80A09A40, 0x39E3); + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST2_WALK2_OLD); } if (this->unk_ABC8 == 60) { - func_8019F1C0(&D_80A09A40, 0x39E3); + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST2_WALK2_OLD); } - if (this->unk_ABC8 == 0x50) { - func_8019F1C0(&D_80A09A40, 0x39E3); + if (this->unk_ABC8 == 80) { + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST2_WALK2_OLD); } spB4.x = 0.0f; spB4.y = -90.0f; spB4.z = 350.0f; - this->unk_ABF8.x = this->actor.focus.pos.x; - this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f; - this->unk_ABF8.z = this->actor.focus.pos.z; + this->csCamNextAt.x = this->actor.focus.pos.x; + this->csCamNextAt.y = this->actor.focus.pos.y - 40.0f; + this->csCamNextAt.z = this->actor.focus.pos.z; if ((this->unk_ABC8 >= 50) && (this->unk_ABC8 < 80)) { if (this->unk_ABC8 == 50) { - func_8019F1C0(&D_80A09A40, 0x39AF); + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_DEAD_WIND1_OLD); } spB4.x = 30.0f; spB4.z = 120.0f; - this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f + 30.0f; + this->csCamNextAt.y = this->actor.focus.pos.y - 40.0f + 30.0f; spA4 = 200.0f; spA0 = 1.0f; } else if ((this->unk_ABC8 >= 80) && (this->unk_ABC8 < 110)) { if (this->unk_ABC8 == 80) { - this->skelAnime1.animCurrentFrame -= 30.0f; - func_8019F1C0(&D_80A09A40, 0x39B4); + this->skelAnime.animCurrentFrame -= 30.0f; + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_DEAD_WIND2_OLD); } spB4.x = -10.0f; spB4.z = 150.0f; - this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f - 60.0f; + this->csCamNextAt.y = this->actor.focus.pos.y - 40.0f - 60.0f; spA4 = 200.0f; spA0 = 1.0f; } else if ((this->unk_ABC8 >= 110) && (this->unk_ABC8 < 140)) { if (this->unk_ABC8 == 110) { - func_8019F1C0(&D_80A09A40, 0x39B5); + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_DEAD_WIND3_OLD); } spB4.x = -70.0f; spB4.z = 110.0f; - this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f + 30.0f; + this->csCamNextAt.y = this->actor.focus.pos.y - 40.0f + 30.0f; spA4 = 200.0f; spA0 = 1.0f; } - if (this->unk_ABC8 >= (gGameInfo->data[1551] + 140)) { - this->unk_ABD0 = 4; - this->unk_AC14 = gGameInfo->data[1552] + 270.0f + 50.0f; - func_8019F1C0(&D_80A09A40, 0x39BF); + if (this->unk_ABC8 >= (sREG(15) + 140)) { + this->csState = 4; + this->csCamEyeMod.y = sREG(16) + 270.0f + 50.0f; + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_DEAD_FLOAT); } else { break; } case 4: - if ((this->unk_ABC8 >= (gGameInfo->data[1626] + 260)) && (this->unk_ABC8 < (gGameInfo->data[1627] + 370))) { - spC0 = gGameInfo->data[1262] + 1; - this->unk_AC04 = this->actor.shape.rot.y * M_PI / 0x8000; + if ((this->unk_ABC8 >= (sREG(90) + 260)) && (this->unk_ABC8 < (sREG(91) + 370))) { + spC0 = KREG(14) + 1; + this->csCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; spB4.x = 0.0f; - spB4.y = this->unk_AC14 + -190.0f; - spB4.z = gGameInfo->data[1553] + 390.0f - 380.0f; + spB4.y = this->csCamEyeMod.y + -190.0f; + spB4.z = sREG(17) + 390.0f - 380.0f; - this->unk_ABF8.x = this->actor.focus.pos.x; - this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f - 60.0f + 130.0f + gGameInfo->data[1554]; - this->unk_ABF8.z = this->actor.focus.pos.z; + this->csCamNextAt.x = this->actor.focus.pos.x; + this->csCamNextAt.y = this->actor.focus.pos.y - 40.0f - 60.0f + sREG(18) + 130.0f; + this->csCamNextAt.z = this->actor.focus.pos.z; + Math_ApproachF(&this->csCamEyeMod.y, sREG(19) + 240.0f, 0.05f, 1.0f + (sREG(20) * 0.1f)); + spA4 = 2000.0f; spA0 = 1.0f; - Math_ApproachF(&this->unk_AC14, gGameInfo->data[1555] + 240.0f, 0.05f, - 1.0f + (gGameInfo->data[1556] * 0.1f)); - spA4 = 2000.0f; - this->unk_1D8 = gGameInfo->data[1329] + 10; + this->unk_1D8 = KREG(81) + 10; this->unk_AB48 = 1; - func_8019F1C0(&D_80A09A40, 0x205B); + func_8019F1C0(&sSfxPoint, NA_SE_EV_BURN_OUT - SFX_FLAG); } else { spB4.x = 0.0f; spB4.y = -190.0f; spB4.z = 390.0f; - this->unk_ABF8.x = this->actor.focus.pos.x; - this->unk_ABF8.y = this->actor.focus.pos.y - 40.0f - 60.0f; - this->unk_ABF8.z = this->actor.focus.pos.z; + this->csCamNextAt.x = this->actor.focus.pos.x; + this->csCamNextAt.y = this->actor.focus.pos.y - 40.0f - 60.0f; + this->csCamNextAt.z = this->actor.focus.pos.z; this->unk_1D8 = 0; if (this->unk_ABC8 > 330) { spA4 = 2000.0f; spA0 = 1.0f; } - Math_ApproachZeroF(&this->actor.world.pos.x, 0.1f, this->unk_AC0C); - Math_ApproachZeroF(&this->actor.world.pos.z, 0.1f, this->unk_AC0C); - Math_ApproachF(&this->unk_AC0C, 5.0f, 1.0f, 0.1f); + Math_ApproachZeroF(&this->actor.world.pos.x, 0.1f, this->csCamSpeedMod); + Math_ApproachZeroF(&this->actor.world.pos.z, 0.1f, this->csCamSpeedMod); + Math_ApproachF(&this->csCamSpeedMod, 5.0f, 1.0f, 0.1f); } if (this->unk_ABC8 >= 260) { f32 sp98; @@ -1321,10 +1581,11 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { s16 temp_a0; if (this->unk_ABC8 == 260) { - func_801A479C(&D_80A09A40, 0x39B6, 0x3C); + func_801A479C(&sSfxPoint, NA_SE_EN_LAST3_DEAD_LIGHTS_OLD, 0x3C); } + globalCtx->envCtx.unk_E5 = 1; - globalCtx->envCtx.unk_E6[0] = globalCtx->envCtx.unk_E6[1] = globalCtx->envCtx.unk_E6[2] = 0xFF; + globalCtx->envCtx.unk_E6[0] = globalCtx->envCtx.unk_E6[1] = globalCtx->envCtx.unk_E6[2] = 255; if (this->unk_ABC8 < 350) { sp98 = 0.5f; sp94 = 0.02f; @@ -1333,21 +1594,23 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { sp98 = 5.0f; sp94 = 0.1f; temp_a0 = (this->unk_ABC8 * 2) - 700; - temp_a0 = CLAMP_MAX(temp_a0, 250); + if (temp_a0 > 250) { + temp_a0 = 250; + } globalCtx->envCtx.unk_E6[3] = temp_a0; if (this->unk_ABC8 == 400) { func_8019FE74(&D_801D6654, 0.0f, 90); } - if (this->unk_ABC8 == (gGameInfo->data[1342] + 440)) { + if (this->unk_ABC8 == (KREG(94) + 440)) { globalCtx->nextEntranceIndex = 0x5400; gSaveContext.nextCutsceneIndex = 0xFFF7; globalCtx->sceneLoadFlag = 0x14; } } if (this->unk_ABC8 > 300) { - D_80A09A58->unk_1808 = 1; - Math_ApproachF(&D_80A09A58->unk_180C, 30.0f, 0.1f, 1.5f); - D_80A09A58->unk_1810 = this->unk_334[2]; + sMajoraStatic->unk_1808 = 1; + 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 < 30; i++) { Math_ApproachF(&this->unk_AB50[i], sp98, 1.0f, sp94); @@ -1355,19 +1618,23 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.1f); } } - this->unk_AC04 += this->unk_AC08; - this->unk_AC08 += 0.0004f; - if (this->unk_AC08 > 0.02f) { - this->unk_AC08 = 0.02f; + this->csCamRotY += this->csCamRotVel; + this->csCamRotVel += 0.0004f; + if (this->csCamRotVel > 0.02f) { + this->csCamRotVel = 0.02f; } - if (this->unk_ABC8 >= (gGameInfo->data[1629] + 180)) { - Vec3f sp84 = D_80A07FB4; - Vec3f sp78 = D_80A07FC0; + if (this->unk_ABC8 >= (sREG(93) + 180)) { + Vec3f sp84 = {0.0f, 10.0f, 0.0f}; + Vec3f sp78 = {0.0f, -0.5f, 0.0f}; Vec3f sp6C; f32 sp68; - play_sound(0x2159); - sp68 = (spC0 == 0) ? 2.0f : (gGameInfo->data[1301] * 0.01f) + 0.2f; + play_sound(NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG); + if (spC0 == 0) { + sp68 = 2.0f; + } else { + sp68 = (KREG(53) * 0.01f) + 0.2f; + } spA8.x = Math_SinS(this->unk_ABC8 * 0x7000) * sp68; spA8.y = Math_SinS(this->unk_ABC8 * 0x5000) * sp68 * 2.5f; spA8.z = Math_CosS(this->unk_ABC8 * 0x8000) * sp68; @@ -1378,43 +1645,46 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { EffectSsHahen_Spawn(globalCtx, &sp6C, &sp84, &sp78, 0, Rand_ZeroFloat(5.0f) + 20.0f, -1, 0xA, NULL); } } - if (this->unk_ABC8 >= (gGameInfo->data[1630] + 290)) { - this->unk_1D8 = gGameInfo->data[1334] + 25; - Math_ApproachZeroF(&this->unk_77C, 1.0f, 0.015f); + if (this->unk_ABC8 >= (sREG(94) + 290)) { + this->unk_1D8 = KREG(86) + 25; + Math_ApproachZeroF(&this->whipScale, 1.0f, 0.015f); } break; } - SysMatrix_InsertYRotation_f(this->unk_AC04, 0); - SysMatrix_MultiplyVector3fByState(&spB4, &this->unk_ABEC); - this->unk_ABEC.x += this->actor.focus.pos.x; - this->unk_ABEC.y += this->actor.focus.pos.y; - this->unk_ABEC.z += this->actor.focus.pos.z; + SysMatrix_InsertYRotation_f(this->csCamRotY, 0); + SysMatrix_MultiplyVector3fByState(&spB4, &this->csCamNextEye); + this->csCamNextEye.x += this->actor.focus.pos.x; + this->csCamNextEye.y += this->actor.focus.pos.y; + this->csCamNextEye.z += this->actor.focus.pos.z; - Math_ApproachF(&this->unk_ABD4.x, this->unk_ABEC.x, spA0, 40.0f + spA4); - Math_ApproachF(&this->unk_ABD4.y, this->unk_ABEC.y, spA0, 40.0f + spA4); - Math_ApproachF(&this->unk_ABD4.z, this->unk_ABEC.z, spA0, 40.0f + spA4); + Math_ApproachF(&this->csCamEye.x, this->csCamNextEye.x, spA0, 40.0f + spA4); + Math_ApproachF(&this->csCamEye.y, this->csCamNextEye.y, spA0, 40.0f + spA4); + Math_ApproachF(&this->csCamEye.z, this->csCamNextEye.z, spA0, 40.0f + spA4); - Math_ApproachF(&this->unk_ABE0.x, this->unk_ABF8.x, spA0, 70.0f + spA4); - Math_ApproachF(&this->unk_ABE0.y, this->unk_ABF8.y, spA0, 70.0f + spA4); - Math_ApproachF(&this->unk_ABE0.z, this->unk_ABF8.z, spA0, 70.0f + spA4); - if (this->unk_ABD2 != 0) { + Math_ApproachF(&this->csCamAt.x, this->csCamNextAt.x, spA0, 70.0f + spA4); + Math_ApproachF(&this->csCamAt.y, this->csCamNextAt.y, spA0, 70.0f + spA4); + Math_ApproachF(&this->csCamAt.z, this->csCamNextAt.z, spA0, 70.0f + spA4); + if (this->csCamIndex != 0) { Vec3f sp5C; - sp5C.x = this->unk_ABE0.x + spA8.x; - sp5C.y = this->unk_ABE0.y + spA8.y; - sp5C.z = this->unk_ABE0.z + spA8.z; - Play_CameraSetAtEye(globalCtx, this->unk_ABD2, &sp5C, &this->unk_ABD4); + sp5C.x = this->csCamAt.x + spA8.x; + sp5C.y = this->csCamAt.y + spA8.y; + sp5C.z = this->csCamAt.z + spA8.z; + Play_CameraSetAtEye(globalCtx, this->csCamIndex, &sp5C, &this->csCamEye); } - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); this->unk_ABC8++; } #else +static Vec3f D_80A07FA8 = { 0.0f, 0.0f, 0.0f }; +static Vec3f D_80A07FB4 = { 0.0f, 10.0f, 0.0f }; +static Vec3f D_80A07FC0 = { 0.0f, -0.5f, 0.0f }; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F65F4.s") #endif void func_809F7400(Boss07* this, GlobalContext* globalCtx, s16 arg2) { this->actionFunc = func_809F748C; - SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_0603CBD0, -10.0f); + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_0603CBD0, -10.0f); if (arg2 != 0) { this->timers[0] = arg2; } else { @@ -1426,23 +1696,23 @@ void func_809F7400(Boss07* this, GlobalContext* globalCtx, s16 arg2) { void func_809F748C(Boss07* this, GlobalContext* globalCtx) { Player* player = PLAYER; - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); func_809F4CBC(this, 2.0f); - this->unk_794 = 0.7f; - this->unk_FA0 = 0.7f; - this->unk_790 = -15.0f; - this->unk_F9C = -15.0f; - this->unk_798 = 2.0f; - this->unk_FA4 = 2.0f; - this->unk_79C = 0.0f; - this->unk_FA8 = 0.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; 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); } else if (this->timers[0] == 0) { - if (gGameInfo->data[1326] == 1) { + if (KREG(78) == 1) { func_809F8E68(this, globalCtx); } else if ((s8)this->actor.colChkInfo.health >= 28) { func_809F7D2C(this, globalCtx); @@ -1460,20 +1730,20 @@ void func_809F748C(Boss07* this, GlobalContext* globalCtx) { void func_809F7688(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_809F76D0; - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06025878, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06025878, -5.0f); this->unk_14C = 0; } void func_809F76D0(Boss07* this, GlobalContext* globalCtx) { - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); - this->unk_794 = 0.7f; - this->unk_FA0 = 0.7f; - this->unk_798 = 2.0f; - this->unk_FA4 = 2.0f; - this->unk_790 = -15.0f; - this->unk_F9C = -15.0f; - this->unk_79C = 0.0f; - this->unk_FA8 = 0.0f; + SkelAnime_FrameUpdateMatrix(&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->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); @@ -1483,11 +1753,11 @@ void func_809F76D0(Boss07* this, GlobalContext* globalCtx) { } void func_809F77A8(Boss07* this, GlobalContext* globalCtx) { - Audio_PlayActorSound2(&this->actor, 0x3014); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_MIBOSS_JUMP2 - SFX_FLAG); if (this->unk_14C == 13) { - func_8019F1C0(&D_80A09A40, 0x3A57); + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_LAUGH_OLD); } - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); if (this->actor.bgCheckFlags & 1) { func_809F7400(this, globalCtx, 1); this->unk_156 = 5; @@ -1510,10 +1780,10 @@ void func_809F783C(Boss07* this, GlobalContext* globalCtx) { temp = this->actor.yawTowardsPlayer - (s16)(Math_Acot2F(dz, dx) * (0x8000 / M_PI)); if (temp < 0) { dx = 200.0f; - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603D224, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_0603D224, -5.0f); } else { dx = -200.0f; - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603D7F0, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_0603D7F0, -5.0f); } Matrix_RotateY(this->actor.yawTowardsPlayer, 0); SysMatrix_GetStateTranslationAndScaledX(dx, &sp30); @@ -1525,18 +1795,18 @@ void func_809F783C(Boss07* this, GlobalContext* globalCtx) { } void func_809F7968(Boss07* this, GlobalContext* globalCtx) { - Audio_PlayActorSound2(&this->actor, 0x3014); - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); - this->unk_794 = 0.7f; - this->unk_FA0 = 0.7f; - this->unk_798 = 2.0f; - this->unk_FA4 = 2.0f; - this->unk_790 = -15.0f; - this->unk_F9C = -15.0f; - this->unk_79C = 0.0f; - this->unk_FA8 = 0.0f; + Audio_PlayActorSound2(&this->actor, NA_SE_EN_MIBOSS_JUMP2 - SFX_FLAG); + SkelAnime_FrameUpdateMatrix(&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)) { - func_8019F1C0(&D_80A09A40, 0x3A57); + 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) { @@ -1557,16 +1827,16 @@ void func_809F7AB4(Boss07* this, GlobalContext* globalCtx) { s16 sp22; this->actionFunc = func_809F7BC4; - SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_0603DD1C, -5.0f); + SkelAnime_ChangeAnimTransitionRepeat(&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); if (sp22 < 0) { - this->skelAnime1.animPlaybackSpeed = 1.0f; + this->skelAnime.animPlaybackSpeed = 1.0f; phi_f14 = 300.0f; } else { - this->skelAnime1.animPlaybackSpeed = -1.0f; + this->skelAnime.animPlaybackSpeed = -1.0f; phi_f14 = -300.0f; } SysMatrix_GetStateTranslationAndScaledX(phi_f14, &this->unk_164); @@ -1579,22 +1849,22 @@ void func_809F7AB4(Boss07* this, GlobalContext* globalCtx) { } void func_809F7BC4(Boss07* this, GlobalContext* globalCtx) { - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); if (this->unk_14C == 20) { - Audio_PlayActorSound2(this, 0x3A53); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_KICK_OLD); } this->unk_ABCC++; if ((this->unk_ABCC % 16) == 0) { - func_8019F1C0(&D_80A09A40, 0x39E3); + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST2_WALK2_OLD); } - this->unk_794 = 0.7f; - this->unk_FA0 = 0.7f; - this->unk_798 = 2.0f; - this->unk_FA4 = 2.0f; - this->unk_790 = -15.0f; - this->unk_F9C = -15.0f; - this->unk_79C = 0.0f; - this->unk_FA8 = 0.0f; + 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; 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); @@ -1629,37 +1899,37 @@ void func_809F7D2C(Boss07* this, GlobalContext* globalCtx) { } switch (this->unk_14E) { case 0: - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06033F80, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06033F80, -5.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_06033F80); break; case 1: - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06034E64, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06034E64, -5.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_06034E64); break; case 2: - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_060358C4, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_060358C4, -5.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_060358C4); break; case 3: - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06036A7C, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06036A7C, -5.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_06036A7C); break; case 4: - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603C4E0, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_0603C4E0, -5.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_0603C4E0); func_809F4D10(&this->unk_164, 650.0f); this->unk_170 = 0.0f; break; case 5: - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06037ADC, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06037ADC, -5.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_06037ADC); break; case 6: - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603918C, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_0603918C, -5.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_0603918C); break; case 7: - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06026204, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06026204, -5.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_06026204); break; } @@ -1667,99 +1937,99 @@ void func_809F7D2C(Boss07* this, GlobalContext* globalCtx) { } void func_809F805C(Boss07* this, GlobalContext* globalCtx) { - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); func_809F4CBC(this, 2.0f); - this->unk_794 = 0.79999995f; - this->unk_FA0 = 0.79999995f; - this->unk_790 = -5.0f; - this->unk_F9C = -5.0f; - this->unk_79C = 0.0f; - this->unk_FA8 = 0.0f; - this->unk_798 = 1.0f; - this->unk_FA4 = 1.0f; - if (this->unk_14C >= 0x15) { + 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; } switch (this->unk_14E) { case 0: - if (this->unk_14C == (s16)(gGameInfo->data[1340] + 1)) { - func_8019F1C0(&D_80A09A40, 0x3A55); + if (this->unk_14C == (s16)(KREG(92) + 1)) { + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } - if ((this->unk_14C >= 0xF) && (this->unk_14C < 0x12)) { - this->unk_79C = 500.0f; + if ((this->unk_14C >= 15) && (this->unk_14C < 18)) { + this->rightWhip.tension = 500.0f; } if (this->unk_14C == 9) { - this->unk_14F = 0xB; + this->unk_14F = 11; } if (this->unk_14C == 1) { - Audio_PlayActorSound2(this, 0x39CD); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_HOP_OLD); } - if (this->unk_14C == 0xA) { - Audio_PlayActorSound2(this, 0x39CA); + if (this->unk_14C == 10) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } break; case 1: - if (this->unk_14C == (s16)(gGameInfo->data[1339] + 3)) { - func_8019F1C0(&D_80A09A40, 0x3A56); + if (this->unk_14C == (s16)(KREG(91) + 3)) { + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_THROW_OLD); } - if ((this->unk_14C >= 8) && (this->unk_14C < 0x38)) { - this->unk_79C = 300.0f; - this->unk_FA8 = 300.0f; + 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)) { - play_sound(0x39CB); + play_sound(NA_SE_EN_LAST3_ROD_FLOOR_OLD); } - if ((this->unk_14C & 3) == 0) { - Audio_PlayActorSound2(this, 0x39CA); + if ((this->unk_14C % 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)(gGameInfo->data[1332] + 5)) { - func_8019F1C0(&D_80A09A40, 0x3A55); + if (this->unk_14C == (s16)(KREG(84) + 5)) { + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } - if ((this->unk_14C >= 0x20) && (this->unk_14C < 0x27)) { - this->unk_79C = 300.0f; - this->unk_FA8 = 300.0f; + if ((this->unk_14C >= 32) && (this->unk_14C < 39)) { + this->rightWhip.tension = 300.0f; + this->leftWhip.tension = 300.0f; } - if (this->unk_14C == 0x1C) { - this->unk_14F = 0xB; + if (this->unk_14C == 28) { + this->unk_14F = 11; } - if (this->unk_14C == 0xA) { - Audio_PlayActorSound2(this, 0x39CD); + if (this->unk_14C == 10) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_HOP_OLD); } - if (this->unk_14C == 0x20) { - Audio_PlayActorSound2(this, 0x39CA); + if (this->unk_14C == 32) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } break; case 3: - if (this->unk_14C == (s16)(gGameInfo->data[1332] + 5)) { - func_8019F1C0(&D_80A09A40, 0x3A55); + if (this->unk_14C == (s16)(KREG(84) + 5)) { + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } - if ((this->unk_14C >= 0x1F) && (this->unk_14C < 0x24)) { - this->unk_79C = 1200.0f; + if ((this->unk_14C > 30) && (this->unk_14C <= 35)) { + this->rightWhip.tension = 1200.0f; } - if (this->unk_14C == 0x17) { - this->unk_14F = 0xB; + if (this->unk_14C == 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) { - Audio_PlayActorSound2(this, 0x39CD); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_HOP_OLD); } - if (this->unk_14C == 0x1E) { - Audio_PlayActorSound2(this, 0x39CA); + if (this->unk_14C == 30) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } break; case 4: - if ((this->unk_14C >= 0x11) && (this->unk_14C < 0x29)) { - this->unk_79C = 200.0f; - this->unk_FA8 = 200.0f; + 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) { - func_8019F1C0(&D_80A09A40, 0x3A54); + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_KOMA_OLD); } - Audio_PlayActorSound2(this, 0x31CC); - Math_ApproachF(&this->actor.world, this->unk_164.x, 0.1f, this->unk_170); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_DANCE_OLD - SFX_FLAG); + Math_ApproachF(&this->actor.world.pos.x, this->unk_164.x, 0.1f, this->unk_170); 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); @@ -1769,74 +2039,74 @@ void func_809F805C(Boss07* this, GlobalContext* globalCtx) { case 7: this->unk_174 = 0; if (this->unk_14C == 3) { - Audio_PlayActorSound2(this, 0x3A53); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_KICK_OLD); } break; case 5: - this->unk_FA0 = 0.7f; - this->unk_794 = 0.7f; - this->unk_790 = -15.0f; - this->unk_F9C = -15.0f; + this->leftWhip.stiffness = 0.7f; + this->rightWhip.stiffness = 0.7f; + this->rightWhip.gravity = -15.0f; + this->leftWhip.gravity = -15.0f; Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); this->unk_174 = 1; break; case 6: - if (this->unk_14C == (s16)(gGameInfo->data[1333] + 5)) { - func_8019F1C0(&D_80A09A40, 0x3A55); + if (this->unk_14C == (s16)(KREG(85) + 5)) { + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } - if ((this->unk_14C >= 0xE) && (this->unk_14C < 0x13)) { - this->unk_79C = 150.0f; + if ((this->unk_14C >= 14) && (this->unk_14C < 19)) { + this->rightWhip.tension = 150.0f; } - if ((this->unk_14C >= 0x17) && (this->unk_14C < 0x1D)) { - this->unk_FA8 = 200.0f; + if ((this->unk_14C >= 23) && (this->unk_14C < 29)) { + this->leftWhip.tension = 200.0f; } - if ((this->unk_14C >= 0x2B) && (this->unk_14C < 0x31)) { - this->unk_79C = 200.0f; + if ((this->unk_14C >= 43) && (this->unk_14C < 49)) { + this->rightWhip.tension = 200.0f; } Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); - if (this->unk_14C == 0x14) { - Audio_PlayActorSound2(this, 0x39CD); - func_8019F1C0(&D_80A09A40, 0x3A55); + if (this->unk_14C == 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) { - Audio_PlayActorSound2(this, 0x39CE); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_HOP2_OLD); } - if (this->unk_14C == 0x29) { - Audio_PlayActorSound2(this, 0x39CA); - func_8019F1C0(&D_80A09A40, 0x3A55); + if (this->unk_14C == 41) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } break; } - if (func_801378B8(&this->skelAnime1, this->unk_1D4) || (this->timers[1] == 1)) { + if (func_801378B8(&this->skelAnime, this->unk_1D4) || (this->timers[1] == 1)) { func_809F7400(this, globalCtx, 0); } } void func_809F8658(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_809F86B8; - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06026EA0, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06026EA0, -5.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_06026EA0); this->unk_14C = 0; } void func_809F86B8(Boss07* this, GlobalContext* globalCtx) { - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer - 0x800, 3, 0x2000); func_809F4CBC(this, 2.0f); - this->unk_794 = 0.79999995f; - this->unk_FA0 = 0.79999995f; - this->unk_798 = 1.0f; - this->unk_FA4 = 1.0f; - this->unk_790 = -5.0f; - this->unk_79C = 0.0f; - this->unk_FA8 = 0.0f; - this->unk_F9C = -15.0f; + this->rightWhip.stiffness = 0.79999995f; + this->leftWhip.stiffness = 0.79999995f; + this->rightWhip.drag = 1.0f; + this->leftWhip.drag = 1.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)) { - this->unk_79C = 500.0f; + this->rightWhip.tension = 500.0f; } if (this->unk_14C >= 0x12) { func_809F7400(this, globalCtx, Rand_ZeroFloat(20.0f) + 20.0f); - play_sound(0x39ED); + play_sound(NA_SE_EN_LAST3_ROD_MID_OLD); } } @@ -1844,46 +2114,46 @@ void func_809F87C8(Boss07* this, GlobalContext* globalCtx) { s32 sp2C; Player* player = PLAYER; - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); func_809F4CBC(this, 2.0f); player->actor.world.pos = this->unk_F80; this->actor.flags &= ~1; this->unk_15A = 20; - this->unk_F7C += 1; - if (this->unk_14C > (s16)(0x2E - this->unk_F7E)) { - func_8019F1C0(&D_80A09A40, 0x3A56); - play_sound(0x39F1); + this->unk_F7C++; + if (this->unk_14C > (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; - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06027270, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06027270, -5.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_06027270); this->unk_14C = 0; } - if ((func_800B64FC(globalCtx, 1000.0f, &this->actor.world, &sp2C) >= 0.0f) && (sp2C == 1)) { + if ((func_800B64FC(globalCtx, 1000.0f, &this->actor.world.pos, &sp2C) >= 0.0f) && (sp2C == 1)) { func_809F8AB0(this, globalCtx); } } void func_809F8908(Boss07* this, GlobalContext* globalCtx) { - Player* sp3C = PLAYER; + Player* player = PLAYER; f32 phi_f0; f32 phi_f2; s32 sp30; - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); this->unk_15A = 20; if (this->unk_14C == 6) { this->unk_F7E = 0; - if (&this->actor == sp3C->actor.parent) { - sp3C->unk_AE8 = 101; - sp3C->actor.parent = NULL; - sp3C->unk_394 = 0; - if (sp3C->transformation == 3) { + if (&this->actor == player->actor.parent) { + player->unk_AE8 = 101; + player->actor.parent = NULL; + player->unk_394 = 0; + if (player->transformation == 3) { phi_f0 = 23.0f; phi_f2 = 20.0f; - } else if (sp3C->transformation == 1) { + } else if (player->transformation == 1) { phi_f0 = 15.0f; phi_f2 = 10.0f; - } else if (sp3C->transformation == 0) { + } else if (player->transformation == 0) { phi_f0 = 10.0f; phi_f2 = 3.0f; } else { @@ -1894,12 +2164,12 @@ void func_809F8908(Boss07* this, GlobalContext* globalCtx) { } } if (this->unk_14C < 7) { - sp3C->actor.world.pos = this->unk_F80; - if ((func_800B64FC(globalCtx, 1000.0f, &this->actor.world, &sp30) >= 0.0f) && (sp30 == 1)) { + 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); } } - if (func_801378B8(&this->skelAnime1, this->unk_1D4) != 0) { + if (func_801378B8(&this->skelAnime, this->unk_1D4) != 0) { func_809F7400(this, globalCtx, 0); } } @@ -1913,19 +2183,19 @@ void func_809F8AB0(Boss07* this, GlobalContext* globalCtx) { temp_v0 = this->unk_F7E + 10; this->unk_780 = this->unk_784 = temp_v0; - temp_v1 = D_80A09A50 - 1; + temp_v1 = sWhipSegCount - 1; if (temp_v1 < temp_v0) { this->unk_780 = this->unk_784 = temp_v1; } this->unk_14C = 0; - play_sound(0x28E1); + play_sound(NA_SE_EV_ELECTRIC_EXPLOSION); } void func_809F8B1C(Boss07* this, GlobalContext* globalCtx) { s32 i; Player* player = PLAYER; - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); func_809F4CBC(this, 2.0f); player->actor.world.pos = this->unk_F80; this->actor.flags &= ~1; @@ -1941,13 +2211,13 @@ void func_809F8B1C(Boss07* this, GlobalContext* globalCtx) { if (this->unk_784 == 0) { Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.3f); Math_ApproachF(&this->unk_32C, 5.0f, 0.5f, 3.0f); - play_sound(0x309A); + play_sound(NA_SE_EN_BIRI_SPARK - SFX_FLAG); } else { this->unk_32C = 0.01f; } if (this->unk_32C > 4.0f) { this->actionFunc = func_809F8D04; - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603B330, -10.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_0603B330, -10.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_0603B330); this->unk_F7E = 0; if (&this->actor == player->actor.parent) { @@ -1964,7 +2234,7 @@ void func_809F8B1C(Boss07* this, GlobalContext* globalCtx) { void func_809F8D04(Boss07* this, GlobalContext* globalCtx) { s32 i; - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); this->unk_15A = 20; for (i = 0; i < 2; i++) { if (this->unk_780 != 0) { @@ -1974,10 +2244,10 @@ void func_809F8D04(Boss07* this, GlobalContext* globalCtx) { if (this->unk_14C < 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(0x309A); + play_sound(NA_SE_EN_BIRI_SPARK - SFX_FLAG); Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.3f); } - if (func_801378B8(&this->skelAnime1, this->unk_1D4)) { + if (func_801378B8(&this->skelAnime, this->unk_1D4)) { func_809F51E8(this, globalCtx, 1); } } @@ -1985,7 +2255,7 @@ void func_809F8D04(Boss07* this, GlobalContext* globalCtx) { void func_809F8DEC(Boss07* this, GlobalContext* globalCtx) { if (this->actionFunc != func_809F91D4) { this->actionFunc = func_809F91D4; - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0603B330, -10.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_0603B330, -10.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_0603B330); } this->unk_158 = 10; @@ -1994,15 +2264,14 @@ void func_809F8DEC(Boss07* this, GlobalContext* globalCtx) { void func_809F8E68(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_809F8EC8; - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_060269EC, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_060269EC, -5.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_060269EC); this->unk_14C = 0; } -#ifdef NON_MATCHING void func_809F8EC8(Boss07* this, GlobalContext* globalCtx) { this->unk_15A = 20; - if (this->unk_14C < (s16)(gGameInfo->data[1288] + 14)) { + if (this->unk_14C < (s16)(KREG(40) + 14)) { this->unk_778 += 6; if (this->unk_778 > 44) { this->unk_778 = 44; @@ -2012,58 +2281,48 @@ void func_809F8EC8(Boss07* this, GlobalContext* globalCtx) { 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, 180); } + if (1) {} if (this->unk_14C == 10) { - Audio_PlayActorSound2(this, 0x39CA); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } - if (this->unk_14C == (s16)(gGameInfo->data[1288] + 18)) { - Audio_PlayActorSound2(this, 0x3A54); + if (this->unk_14C == (s16)(KREG(40) + 18)) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_KOMA_OLD); } - if ((this->unk_14C < (s16)(gGameInfo->data[1288] + 14)) || ((s16)(gGameInfo->data[1289] + 17) < this->unk_14C)) { - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + if ((this->unk_14C < (s16)(KREG(40) + 14)) || ((s16)(KREG(41) + 17) < this->unk_14C)) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime); } - if ((this->unk_14C >= (s16)(gGameInfo->data[1288] + 14)) && - ((this->unk_14C <= (s16)(gGameInfo->data[1289] + 17)) || - ((s16)(gGameInfo->data[1290] + 21) <= this->unk_14C))) { - this->unk_778 -= gGameInfo->data[1287] + 5; + if ((this->unk_14C >= (s16)(KREG(40) + 14)) && + ((this->unk_14C <= (s16)(KREG(41) + 17)) || ((s16)(KREG(42) + 21) <= this->unk_14C))) { + this->unk_778 -= KREG(39) + 5; if (this->unk_778 < 0) { this->unk_778 = 0; } } - Math_ApproachS(&this->actor.shape.rot.y, gGameInfo->data[1256] * 0x100 + this->actor.yawTowardsPlayer + 0xF00, 3, - 0x2000); + Math_ApproachS(&this->actor.shape.rot.y, KREG(8) * 0x100 + this->actor.yawTowardsPlayer + 0xF00, 3, 0x2000); func_809F4CBC(this, 2.0f); - this->unk_794 = 0.79999995f; - this->unk_FA0 = 0.79999995f; - this->unk_798 = 1.0f; - this->unk_FA4 = 1.0f; - this->unk_790 = -5.0f; - this->unk_79C = 0.0f; - this->unk_FA8 = 0.0f; - this->unk_F9C = -15.0f; - if (((s16)(gGameInfo->data[1291] + 12) <= this->unk_14C) && (this->unk_14C <= (s16)(gGameInfo->data[1292] + 17))) { - this->unk_79C = gGameInfo->data[1254] + 500.0f; + this->leftWhip.stiffness = this->rightWhip.stiffness = 0.79999995f; + 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))) { + this->rightWhip.tension = KREG(6) + 500.0f; } - if (this->unk_14C >= (s16)(gGameInfo->data[1293] + 36)) { + if (this->unk_14C >= (s16)(KREG(45) + 36)) { func_809F7400(this, globalCtx, Rand_ZeroFloat(20.0f) + 20.0f); } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F8EC8.s") -#endif void func_809F91D4(Boss07* this, GlobalContext* globalCtx) { - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); - func_8019F1C0(&D_80A09A40, 0x301B); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + func_8019F1C0(&sSfxPoint, NA_SE_EN_COMMON_WEAKENED - SFX_FLAG); func_809F4CBC(this, 2.0f); - this->unk_794 = 0.7f; - this->unk_FA0 = 0.7f; - this->unk_790 = -15.0f; - this->unk_F9C = -15.0f; - this->unk_798 = 2.0f; - this->unk_FA4 = 2.0f; - this->unk_79C = 0.0f; - this->unk_FA8 = 0.0f; - if (func_801378B8(&this->skelAnime1, this->unk_1D4)) { + this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.gravity = this->rightWhip.gravity = -15.0f; + this->leftWhip.tension = this->rightWhip.tension = 0.0f; + this->leftWhip.drag = this->rightWhip.drag = 2.0f; + if (func_801378B8(&this->skelAnime, this->unk_1D4)) { func_809F51E8(this, globalCtx, 1); } } @@ -2073,8 +2332,8 @@ void func_809F9280(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { this->actor.colChkInfo.health -= arg2; } if ((s8)this->actor.colChkInfo.health <= 0) { - if (gGameInfo->data[1267] != 0) { - func_8019F1C0(&D_80A09A40, NA_SE_EN_LAST3_VOICE_DEAD_OLD); + if (KREG(19) != 0) { + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_DEAD_OLD); } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_DEAD_OLD); } @@ -2083,36 +2342,36 @@ void func_809F9280(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE2_OLD); if (this->actionFunc != func_809F93DC) { - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0601DEB4, -10.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_0601DEB4, -10.0f); this->actionFunc = func_809F93DC; this->unk_1D4 = SkelAnime_GetFrameCount(&D_0601DEB4); this->unk_ABCC = 0; } else if (arg3 == 14) { - if (this->skelAnime1.animCurrentFrame <= (this->unk_1D4 - 5.0f)) { + if (this->skelAnime.animCurrentFrame <= (this->unk_1D4 - 5.0f)) { this->unk_158 = 30; } else { - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_0601DEB4, -5.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_0601DEB4, -5.0f); } } } } void func_809F93DC(Boss07* this, GlobalContext* globalCtx) { - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); this->unk_ABCC++; if ((this->unk_ABCC % 16) == 0) { - Audio_PlayActorSound2(&this->actor, 0x39E3); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_WALK2_OLD); } func_809F4CBC(this, 2.0f); - this->unk_794 = 0.7f; - this->unk_FA0 = 0.7f; - this->unk_790 = -15.0f; - this->unk_F9C = -15.0f; - this->unk_798 = 2.0f; - this->unk_FA4 = 2.0f; - this->unk_79C = 0.0f; - this->unk_FA8 = 0.0f; - if (func_801378B8(&this->skelAnime1, this->unk_1D4)) { + 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; + if (func_801378B8(&this->skelAnime, this->unk_1D4)) { func_809F51E8(this, globalCtx, 1); } } @@ -2127,29 +2386,29 @@ void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx Vec3f sp7C; if ((arg1 >= 50.0f) && (this->unk_15A == 0)) { - Actor* phi_s1 = globalCtx->actorCtx.actorList[6].first; + Actor* prop = globalCtx->actorCtx.actorList[ACTORCAT_PROP].first; - while (phi_s1 != NULL) { - if (phi_s1->id == ACTOR_OBJ_TSUBO) { - for (i = 10; i < D_80A09A50; i += 3) { - dx = phi_s1->world.pos.x - arg0[i].x; - dy = phi_s1->world.pos.y + 10.0f - arg0[i].y; - dz = phi_s1->world.pos.z - arg0[i].z; + while (prop != NULL) { + if (prop->id == ACTOR_OBJ_TSUBO) { + for (i = 10; i < sWhipSegCount; i += 3) { + dx = prop->world.pos.x - arg0[i].x; + dy = prop->world.pos.y + 10.0f - arg0[i].y; + dz = prop->world.pos.z - arg0[i].z; - if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < (gGameInfo->data[1286] + 60.0f)) { - ((ObjTsubo*)phi_s1)->unk19B = 1; - func_809F4FF8(globalCtx, &phi_s1->world.pos, 10); + if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < (KREG(38) + 60.0f)) { + ((ObjTsubo*)prop)->unk19B = 1; + func_809F4FF8(globalCtx, &prop->world.pos, 10); } } } - phi_s1 = phi_s1->next; + prop = prop->next; } } if ((arg1 >= 50.0f) && (this->unk_15A == 0) && (!(player->stateFlags3 & 0x100) || (this->unk_14E == 4))) { if ((func_800B64FC(globalCtx, 1000.0f, &this->actor.world.pos, &sp98) >= 0.0f) && (sp98 != 1)) { sp98 = -1; } - for (i = 10; i < D_80A09A50; i += 3) { + for (i = 10; i < sWhipSegCount; i += 3) { dx = player->actor.world.pos.x - arg0[i].x; dy = player->actor.world.pos.y + 30.0f - arg0[i].y; dz = player->actor.world.pos.z - arg0[i].z; @@ -2170,15 +2429,15 @@ void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx &D_801DB4B8); this->unk_F7C = 0; this->unk_F7E = ((this->actor.xzDistToPlayer - 300.0f) / 22.0f) + 10.0f; - dx1 = player->actor.world.pos.x - this->unk_7A0.x; - dy1 = player->actor.world.pos.y - this->unk_7A0.y + 50.0f; - dz1 = player->actor.world.pos.z - this->unk_7A0.z; + dx1 = player->actor.world.pos.x - this->rightWhip.basePos.x; + dy1 = player->actor.world.pos.y - this->rightWhip.basePos.y + 50.0f; + dz1 = player->actor.world.pos.z - this->rightWhip.basePos.z; 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->unk_79C = 0.0f; + this->rightWhip.tension = 0.0f; play_sound(NA_SE_EN_LAST3_GET_LINK_OLD); } } else if ((player->stateFlags1 & 0x400000) && func_809F4C40(this, globalCtx)) { @@ -2214,8 +2473,8 @@ void func_809F99C4(Boss07* this, GlobalContext* globalCtx) { this->sph2.elements[0].info.toucherFlags &= ~2; player->unk_B84 = this->actor.yawTowardsPlayer; player->unk_B80 = 20.0f; - func_809F4FF8(globalCtx, &player->actor.world, 12); - play_sound(0x1829); + func_809F4FF8(globalCtx, &player->actor.world.pos, 12); + play_sound(NA_SE_IT_HOOKSHOT_STICK_OBJ); } for (i = 0; i < 11; i++) { if (this->sph1.elements[i].info.bumperFlags & 2) { @@ -2239,7 +2498,7 @@ void func_809F99C4(Boss07* this, GlobalContext* globalCtx) { break; case 10: this->unk_1805 = 40; - Audio_PlayActorSound2(&this->actor, 0x389E); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); break; case 9: this->unk_1805 = 30; @@ -2276,20 +2535,23 @@ void func_809F99C4(Boss07* this, GlobalContext* globalCtx) { } void func_809F9CEC(Boss07* this, GlobalContext* globalCtx) { + static Color_RGBA8 sLightCyan = { 170, 255, 255, 255 }; + static Color_RGBA8 sLightBlue = { 200, 200, 255, 255 }; + static Vec3f sIceVel = { 0.0f, -1.0f, 0.0f }; Vec3f sp8C; Vec3f sp80; s32 i; - Audio_PlaySoundAtPosition(globalCtx, this->unk_334, 0x1E, NA_SE_EV_ICE_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, this->bodyPartsPos, 0x1E, NA_SE_EV_ICE_BROKEN); for (i = 0; i < 30; i++) { sp80.x = randPlusMinusPoint5Scaled(7.0f); sp80.z = randPlusMinusPoint5Scaled(7.0f); sp80.y = Rand_ZeroFloat(6.0f) + 4.0f; - sp8C.x = this->unk_334[i / 2].x + sp80.x; - sp8C.y = this->unk_334[i / 2].y + sp80.y; - sp8C.z = this->unk_334[i / 2].z + sp80.z; - EffectSsEnIce_Spawn(globalCtx, &sp8C, Rand_ZeroFloat(1.0f) + 1.5f, &sp80, &D_80A07FD4, &D_80A07FCC, &D_80A07FD0, + sp8C.x = this->bodyPartsPos[i / 2].x + sp80.x; + sp8C.y = this->bodyPartsPos[i / 2].y + sp80.y; + sp8C.z = this->bodyPartsPos[i / 2].z + sp80.z; + EffectSsEnIce_Spawn(globalCtx, &sp8C, Rand_ZeroFloat(1.0f) + 1.5f, &sp80, &sIceVel, &sLightCyan, &sLightBlue, 30); } } @@ -2366,7 +2628,7 @@ void func_809F9E94(Boss07* this, GlobalContext* globalCtx) { this->unk_1804 = 30; this->unk_1806 = 50; this->unk_1800 = 1.0f; - this->unk_17F8 = (gGameInfo->data[1266] * 0.1f) + 1.0f; + this->unk_17F8 = (KREG(18) * 0.1f) + 1.0f; this->unk_1805++; case 41: if (this->unk_1806 == 0) { @@ -2384,15 +2646,15 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; s32 i; - Player* sp78 = PLAYER; + Player* player = PLAYER; globalCtx->envCtx.unk_C1 = 2; 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; - Math_Vec3f_Copy(&D_80A09A40, &this->actor.projectedPos); - if (gGameInfo->data[1311] == 0) { + Math_Vec3f_Copy(&sSfxPoint, &this->actor.projectedPos); + if (KREG(63) == 0) { this->unk_174 = 0; this->unk_14C += 1; Actor_SetScale(&this->actor, 0.015f); @@ -2419,10 +2681,10 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { } } } else { - D_80A09A50 = 45; + sWhipSegCount = 45; } - func_809F94AC(this->unk_7AC, this->unk_79C, this, globalCtx); - func_809F94AC(this->unk_FB8, this->unk_FA8, this, globalCtx); + func_809F94AC(this->rightWhip.pos, this->rightWhip.tension, this, globalCtx); + func_809F94AC(this->leftWhip.pos, this->leftWhip.tension, this, globalCtx); if (this->unk_158 != 0) { for (i = 0; i < 11; i++) { this->sph1.elements[i].info.bumperFlags &= ~2; @@ -2438,19 +2700,19 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->sph2.base); } else { if ((this->unk_174 != 0) && func_809F4C40(this, globalCtx)) { - if ((sp78->unk_D57 == 4) && (sp78->itemActionParam != 0xC)) { + if ((player->unk_D57 == 4) && (player->itemActionParam != 0xC)) { if ((this->actor.xzDistToPlayer >= 400.0f) && (Rand_ZeroOne() < 0.5f)) { func_809F7AB4(this, globalCtx); } else { func_809F51E8(this, globalCtx, 0); } } - if ((sp78->unk_ADC != 0) && (this->actor.xzDistToPlayer <= 150.0f)) { + if ((player->unk_ADC != 0) && (this->actor.xzDistToPlayer <= 150.0f)) { func_809F51E8(this, globalCtx, 0); } } if ((this->actionFunc != func_809F91D4) && (this->actionFunc != func_809F93DC)) { - if ((sp78->stateFlags3 & 0x00001000) && !(sp78->stateFlags3 & 0x00080000) && + if ((player->stateFlags3 & 0x00001000) && !(player->stateFlags3 & 0x00080000) && (this->actor.xzDistToPlayer <= 250.0f)) { func_809F51E8(this, globalCtx, 0); } @@ -2460,8 +2722,8 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { func_809F52CC(this, globalCtx); } func_809F5494(this, globalCtx); - if ((gGameInfo->data[1336] != 0) || (this->unk_148 != 0)) { - gGameInfo->data[1336] = 0; + if ((KREG(88) != 0) || (this->unk_148 != 0)) { + KREG(88) = 0; this->unk_148 = 0; func_809F64F4(this, globalCtx); } @@ -2495,18 +2757,18 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { if ((this->unk_156 == 1) || (this->unk_156 == 4)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_WALK2_OLD); } - if (sp78->actor.world.pos.y > 100.0f) { - if (sp78->actor.world.pos.z < gGameInfo->data[1330] + -850.0f) { - sp78->actor.world.pos.z = gGameInfo->data[1330] + -850.0f; + 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 (sp78->actor.world.pos.y < -300.0f) { - sp78->actor.world.pos.x = sp78->actor.world.pos.y = sp78->actor.world.pos.z = 0.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; } } -#ifdef NON_MATCHING -void func_809FAA44(Boss07 *this, GlobalContext *globalCtx, Vec3f *arg2, Vec3f *arg3, Vec3f *arg4, Vec3f *arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9, Vec3s *argA, s16 argB, f32 argC, s32 argD) { +void Boss07_Wrath_UpdateWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, f32 gravity, + f32 stiffness, f32 drag, f32 tension, Vec3s* baseRot, s16 argB, f32 scale, s32 whipHand) { s32 i; s32 phi_s6; f32 temp_f20; @@ -2514,30 +2776,30 @@ void func_809FAA44(Boss07 *this, GlobalContext *globalCtx, Vec3f *arg2, Vec3f *a f32 temp_f26; f32 temp_f22; f32 phi_f0; - Vec3f* temp; - s32 pad; - Vec3f spB8 = D_80A07FE0; + Vec3f* temp = pull; + f32 temp1; + Vec3f spB8 = {0.0f, 0.0f, 0.0f}; Vec3f spAC; Vec3f spA0; Vec3f sp94; Vec3f sp88; Vec3f sp7C; - spB8.z = 22.0f * argC; - temp = arg5; - for(i = 0; i < (s16)D_80A09A50; i++, temp++) { - if(i == 0) { - arg3[0] = *arg2; + spB8.z = 22.0f * scale; + + for (i = 0; i < (s16)sWhipSegCount; i++, pull++) { + if (i == 0) { + pos[0] = *base; } else { - Math_ApproachF(&temp->x, 0.0f, 1.0f, arg8); - Math_ApproachF(&temp->y, 0.0f, 1.0f, arg8); - Math_ApproachF(&temp->z, 0.0f, 1.0f, arg8); + Math_ApproachF(&pull->x, 0.0f, 1.0f, drag); + Math_ApproachF(&pull->y, 0.0f, 1.0f, drag); + Math_ApproachF(&pull->z, 0.0f, 1.0f, drag); } } spAC.z = 20.0f; - Matrix_RotateY(argA->y, 0); - SysMatrix_InsertXRotation_s(argA->x, 1); - SysMatrix_InsertZRotation_s(argA->z, 1); + Matrix_RotateY(baseRot->y, 0); + SysMatrix_InsertXRotation_s(baseRot->x, 1); + SysMatrix_InsertZRotation_s(baseRot->z, 1); Matrix_RotateY(0x4000, 1); SysMatrix_GetStateTranslationAndScaledZ(spAC.z, &sp94); if (argB != 0) { @@ -2545,17 +2807,22 @@ void func_809FAA44(Boss07 *this, GlobalContext *globalCtx, Vec3f *arg2, Vec3f *a SysMatrix_InsertYRotation_f(this->unk_F8C, 0); SysMatrix_RotateStateAroundXAxis(this->unk_F90); } else { - spAC.z = arg9; + spAC.z = tension; } SysMatrix_GetStateTranslationAndScaledZ(spAC.z, &sp7C); - for(i = 1, phi_s6 = 0; i < (s16)D_80A09A50; i++) { - if(i < 6) { + pos++; + rot++; + pull = temp + 1; + phi_s6 = 0; + + for (i = 1; i < (s16)sWhipSegCount; i++, pull++, pos++, rot++) { + if (i < 6) { sp88.x = (6 - i) * sp94.x * 0.2f; sp88.y = (6 - i) * sp94.y * 0.2f; - sp88.z = (6 - i) * sp94.z * 0.2f; + sp88.z = (6 - i) * sp94.z * 0.2f; } else if (argB != 0) { - if(argB <= i && i < (s16)(argB + this->unk_F7C)) { + if (argB <= i && i < (s16)(argB + this->unk_F7C)) { sp88.y = 0.0f; sp88.x = __sinf(this->actor.yawTowardsPlayer * M_PI / 0x8000 + (phi_s6 * 1.4f)) * 100.0f; sp88.z = __cosf(this->actor.yawTowardsPlayer * M_PI / 0x8000 + (phi_s6 * 1.4f)) * 100.0f; @@ -2565,111 +2832,110 @@ void func_809FAA44(Boss07 *this, GlobalContext *globalCtx, Vec3f *arg2, Vec3f *a } else { sp88 = D_801D15B0; } - temp_f24 = (arg3 + i)->x + (arg5 + i)->x - (arg3 + i - 1)->x + sp88.x + sp7C.x; - phi_f0 = (arg3 + i)->y + (arg5 + i)->y + arg6 + sp88.y + sp7C.y; + temp_f24 = pos->x + pull->x - (pos - 1)->x + sp88.x + sp7C.x; + phi_f0 = pos->y + pull->y + gravity + sp88.y + sp7C.y; phi_f0 = CLAMP_MIN(phi_f0, 2.0f); - temp_f26 = phi_f0 - (arg3 + i - 1)->y; - temp_f20 = (arg3 + i)->z + (arg5 + i)->z - (arg3 + i - 1)->z + sp88.z + sp7C.z; + temp_f26 = phi_f0 - (pos - 1)->y; + temp_f20 = pos->z + pull->z - (pos - 1)->z + sp88.z + sp7C.z; temp_f22 = Math_Acot2F(temp_f20, temp_f24); - temp_f20 = -Math_Acot2F(sqrtf(SQ(temp_f24) + SQ(temp_f20)), temp_f26); - (arg4 + i - 1)->y = temp_f22; - (arg4 + i - 1)->x = temp_f20; + temp1 = -Math_Acot2F(sqrtf(SQ(temp_f24) + SQ(temp_f20)), temp_f26); + (rot - 1)->y = temp_f22; + (rot - 1)->x = temp1; SysMatrix_InsertYRotation_f(temp_f22, 0); - SysMatrix_RotateStateAroundXAxis(temp_f20); + SysMatrix_RotateStateAroundXAxis(temp1); SysMatrix_GetStateTranslationAndScaledZ(spB8.z, &spA0); - temp_f24 = (arg3 + i)->x; - temp_f26 = (arg3 + i)->y; - temp_f20 = (arg3 + i)->z; - (arg3 + i)->x = (arg3 + i - 1)->x + spA0.x; - (arg3 + i)->y = (arg3 + i - 1)->y + spA0.y; - (arg3 + i)->z = (arg3 + i - 1)->z + spA0.y; - if((i != 0) && (i == argB)) { + if (1) {} + temp_f24 = pos->x; + temp_f26 = pos->y; + temp_f20 = pos->z; + + pos->x = (pos - 1)->x + spA0.x; + pos->y = (pos - 1)->y + spA0.y; + pos->z = (pos - 1)->z + spA0.z; + + if ((i != 0) && (i == argB)) { spAC.x = 15.0f; spAC.y = -30.0f; spAC.z = -12.0f; SysMatrix_MultiplyVector3fByState(&spAC, &spA0); - this->unk_F80.x = (arg3 + i)->x + spA0.x; - this->unk_F80.y = (arg3 + i)->y + spA0.y; - this->unk_F80.z = (arg3 + i)->z + spA0.z; - } else if ((argD == 0) && (this->actionFunc == func_809F8EC8)) { - if (i == gGameInfo->data[1338] + D_80A09A50 - this->unk_778 + 1) { - spAC.x = gGameInfo->data[1308]; - spAC.y = gGameInfo->data[1309]; - spAC.z = gGameInfo->data[1310]; + 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)) { + if (i == KREG(90) + sWhipSegCount - this->unk_778 + 1) { + spAC.x = KREG(60); + spAC.y = KREG(61); + spAC.z = KREG(62); SysMatrix_MultiplyVector3fByState(&spAC, &spA0); - this->unk_F80.x = (arg3 + i)->x + spA0.x; - this->unk_F80.y = (arg3 + i)->y + spA0.y; - this->unk_F80.z = (arg3 + i)->z + spA0.z; + this->unk_F80.x = pos->x + spA0.x; + this->unk_F80.y = pos->y + spA0.y; + this->unk_F80.z = pos->z + spA0.z; } } - (arg5 + i)->x = ((arg3 + i)->x - temp_f24) * arg7; - (arg5 + i)->y = ((arg3 + i)->y - temp_f26) * arg7; - (arg5 + i)->z = ((arg3 + i)->z - temp_f20) * arg7; - if((arg5 + i)->x > 200.0f) { - (arg5 + i)->x = 200.0f; + pull->x = (pos->x - temp_f24) * stiffness; + pull->y = (pos->y - temp_f26) * stiffness; + pull->z = (pos->z - temp_f20) * stiffness; + if (pull->x > 200.0f) { + pull->x = 200.0f; } - if((arg5 + i)->x < -200.0f) { - (arg5 + i)->x = -200.0f; + if (pull->x < -200.0f) { + pull->x = -200.0f; } - if((arg5 + i)->y > 200.0f) { - (arg5 + i)->y = 200.0f; + if (pull->y > 200.0f) { + pull->y = 200.0f; } - if((arg5 + i)->y < -200.0f) { - (arg5 + i)->y = -200.0f; + if (pull->y < -200.0f) { + pull->y = -200.0f; } - if((arg5 + i)->z > 200.0f) { - (arg5 + i)->z = 200.0f; + if (pull->z > 200.0f) { + pull->z = 200.0f; } - if((arg5 + i)->z < -200.0f) { - (arg5 + i)->z = -200.0f; + if (pull->z < -200.0f) { + pull->z = -200.0f; } } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FAA44.s") -#endif -#ifdef NON_MATCHING -void func_809FB114(Boss07 *this, GlobalContext *globalCtx, Vec3f *arg2, Vec3f *arg3, f32 arg4, s32 arg5) { +void Boss07_Wrath_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* pos, Vec3f* rot, f32 arg4, s32 hand) { s32 phi_s6; - s32 phi_s1; + s32 i; f32 phi_f12; - f32 one = 1.0f; - f32 two = 2.0f; + s32 pad[2]; + Vec3f* vec2 = pos; + Vec3f* vec3 = rot; OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, D_0602EEC8); - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, gGameInfo->data[1584] + 45, 35, 75, 255); - phi_s6 = (arg5 == 0) ? this->unk_778 : 0; - for(phi_s1 = 0; phi_s1 <= (D_80A09A50 - phi_s6) - 1; phi_s1++) { - SysMatrix_InsertTranslation(arg2[phi_s1].x, 0.0f, arg2[phi_s1].z, 0); + 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++) { + SysMatrix_InsertTranslation(pos->x, 0.0f, pos->z, 0); Matrix_Scale(1.0f, 0.0f, 1.0f, 1); - SysMatrix_InsertYRotation_f(arg3[phi_s1].y, 1); - SysMatrix_RotateStateAroundXAxis(arg3[phi_s1].x); - phi_f12 = (phi_s1 > 24) ? 0.025f : ((24 - phi_s1) * one * 0.001f) + 0.025f; - Matrix_Scale(phi_f12, phi_f12, ((two * arg4) + 0.5f) * 0.01f, 1); + SysMatrix_InsertYRotation_f(rot->y, 1); + SysMatrix_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); gSPDisplayList(POLY_OPA_DISP++, D_0602EEF8); } + pos = vec2; + rot = vec3; gSPDisplayList(POLY_OPA_DISP++, D_0602EE50); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); - for(phi_s1 = 0; phi_s1 < (D_80A09A50 - phi_s6) - 1; phi_s1++) { - SysMatrix_InsertTranslation(arg2[phi_s1].x, arg2[phi_s1].y, arg2[phi_s1].z, 0); - SysMatrix_InsertYRotation_f(arg3[phi_s1].y, 1); - SysMatrix_RotateStateAroundXAxis(arg3[phi_s1].x); - phi_f12 = (phi_s1 > 24) ? 0.025f : ((24 - phi_s1) * one * 0.001f) + 0.025f; - Matrix_Scale(phi_f12, phi_f12, ((two * arg4) + 0.5f) * 0.01f, 1); + for (i = 0; i < (sWhipSegCount - phi_s6) - 1; i++, pos++, rot++) { + SysMatrix_InsertTranslation(pos->x, pos->y, pos->z, 0); + SysMatrix_InsertYRotation_f(rot->y, 1); + SysMatrix_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); gSPDisplayList(POLY_OPA_DISP++, D_0602EEF8); } CLOSE_DISPS(globalCtx->state.gfxCtx); } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FB114.s") -#endif -s32 func_809FB504(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { +s32 func_809FB504(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { Boss07* this = THIS; if (limbIndex == 26) { @@ -2680,22 +2946,36 @@ s32 func_809FB504(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3f *p return false; } -void func_809FB55C(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3s *rot, Actor *thisx) { +static s8 sWrathColliders[32] = { + -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, 0, 0, +}; +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 }, + { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, + { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, +}; + +static s8 sWrathBodyParts[32] = { + -1, -1, 2, -1, 12, -1, 13, 14, -1, 9, -1, 10, 11, -1, 1, -1, 6, 7, 8, -1, -1, 3, 4, 5, -1, -1, 0, -1, -1, -1, 0, 0, +}; +static Vec3f sWhipOffset = { 1000.0f, 100.0f, 0.0f }; + +void func_809FB55C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { Boss07* this = THIS; s8 sp6B; Vec3f sp5C; MtxF sp1C; - sp6B = D_80A08090[limbIndex]; + sp6B = sWrathBodyParts[limbIndex]; if (sp6B >= 0) { - SysMatrix_GetStateTranslation(&this->unk_334[sp6B]); + SysMatrix_GetStateTranslation(&this->bodyPartsPos[sp6B]); } - sp6B = D_80A07FEC[limbIndex]; + sp6B = sWrathColliders[limbIndex]; if (sp6B >= 0) { if (this->unk_158 != 0) { SysMatrix_GetStateTranslationAndScaledZ(100000.0f, &sp5C); } else { - SysMatrix_MultiplyVector3fByState(&D_80A0800C[sp6B], &sp5C); + SysMatrix_MultiplyVector3fByState(&sWrathColliderOffsets[sp6B], &sp5C); } func_809F4BB0(sp6B, &this->sph1, &sp5C); } @@ -2703,18 +2983,18 @@ void func_809FB55C(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3s * SysMatrix_GetStateTranslation(&this->actor.focus.pos); } if (limbIndex == 19) { - SysMatrix_MultiplyVector3fByState(&D_80A080B0, &this->unk_7A0); + SysMatrix_MultiplyVector3fByState(&sWhipOffset, &this->rightWhip.basePos); } if (limbIndex == 17) { SysMatrix_CopyCurrentState(&sp1C); - func_8018219C(&sp1C, &this->unk_788, 0); + func_8018219C(&sp1C, &this->rightWhip.baseRot, 0); } if (limbIndex == 24) { - SysMatrix_MultiplyVector3fByState(&D_80A080B0, &this->unk_FAC); + SysMatrix_MultiplyVector3fByState(&sWhipOffset, &this->leftWhip.basePos); } if (limbIndex == 22) { SysMatrix_CopyCurrentState(&sp1C); - func_8018219C(&sp1C, &this->unk_F94, 0); + func_8018219C(&sp1C, &this->leftWhip.baseRot, 0); } if (limbIndex == 12) { SysMatrix_GetStateTranslation(&sp5C); @@ -2722,20 +3002,21 @@ void func_809FB55C(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3s * } } -void func_809FB728(GlobalContext *globalCtx, s32 limbIndex, Actor *thisx) { +void func_809FB728(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)) { + 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); } } -#ifdef NON_MATCHING -void func_809FB7D4(Boss07 *this, GlobalContext *globalCtx) { +void func_809FB7D4(Boss07* this, GlobalContext* globalCtx) { s32 i; - GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; + GraphicsContext* gfxCtx; - OPEN_DISPS(gfxCtx); + OPEN_DISPS(gfxCtx = globalCtx->state.gfxCtx); if ((this->unk_32C > 0.0f) || (this->unk_330 > 0.0f)) { func_8012C2DC(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255); @@ -2743,16 +3024,17 @@ void func_809FB7D4(Boss07 *this, GlobalContext *globalCtx) { if (this->unk_32C > 0.0f) { gSPDisplayList(POLY_XLU_DISP++, D_04023348); - for(i = 0; i < 15; i++) { - SysMatrix_InsertTranslation(this->unk_334[i].x, this->unk_334[i].y, this->unk_334[i].z, 0); + for (i = 0; i < 15; i++) { + SysMatrix_InsertTranslation(this->bodyPartsPos[i].x, this->bodyPartsPos[i].y, this->bodyPartsPos[i].z, 0); SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); Matrix_Scale(this->unk_32C, this->unk_32C, this->unk_32C, 1); SysMatrix_InsertZRotation_f(Rand_ZeroFloat(2.0f * M_PI), 1); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); gSPDisplayList(POLY_XLU_DISP++, D_04023428); } - for(i = this->unk_780; i >= this->unk_784; i--) { - SysMatrix_InsertTranslation(this->unk_7AC[i].x, this->unk_7AC[i].y, this->unk_7AC[i].z, 0); + for (i = this->unk_780; i >= this->unk_784; i--) { + SysMatrix_InsertTranslation(this->rightWhip.pos[i].x, this->rightWhip.pos[i].y, + this->rightWhip.pos[i].z, 0); SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); Matrix_Scale(1.5f, 1.5f, 1.5f, 1); SysMatrix_InsertZRotation_f(Rand_ZeroFloat(2.0f * M_PI), 1); @@ -2762,8 +3044,10 @@ void func_809FB7D4(Boss07 *this, GlobalContext *globalCtx) { } if (this->unk_330 > 0.0f) { gSPDisplayList(POLY_XLU_DISP++, D_040233B8); - for(i = 0; i < 30; i++) { - SysMatrix_InsertTranslation(this->unk_334[i / 2].x + randPlusMinusPoint5Scaled(30.0f), this->unk_334[i / 2].y + randPlusMinusPoint5Scaled(30.0f), this->unk_334[i / 2].z + randPlusMinusPoint5Scaled(30.0f), 0); + for (i = 0; i < 30; i++) { + SysMatrix_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); SysMatrix_RotateStateAroundXAxis(Rand_ZeroFloat(2.0f * M_PI)); SysMatrix_InsertZRotation_f(Rand_ZeroFloat(2.0f * M_PI), 1); @@ -2774,98 +3058,91 @@ void func_809FB7D4(Boss07 *this, GlobalContext *globalCtx) { } CLOSE_DISPS(gfxCtx); } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FB7D4.s") -#endif -#ifdef NON_MATCHING -void func_809FBB9C(Boss07 *this, GlobalContext *globalCtx, Vec3f *arg2) { +void func_809FBB9C(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2) { s32 i; f32 temp_f12_2; f32 temp_f20; + GraphicsContext* gfxCtx; + s16* temp; + + OPEN_DISPS(gfxCtx = globalCtx->state.gfxCtx); - OPEN_DISPS(globalCtx->state.gfxCtx); - - if (this->unk_AB4C > 0.0f) { func_809F49A0(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 < 30; i++) { - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, D_80A07950[0][0], D_80A07950[0][1], D_80A07950[0][2], 40); + for (i = 0; i < 30; i++) { + temp = D_80A07950[0]; + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, temp[0], temp[1], temp[2], 40); temp_f20 = (func_809F49C0() * 40.0f) - 30.0f; - SysMatrix_InsertTranslation(this->unk_334[2].x, this->unk_334[2].y - 30.0f + 50.0f + temp_f20 + 25.0f, this->unk_334[2].z, 0); + SysMatrix_InsertTranslation(this->bodyPartsPos[2].x, this->bodyPartsPos[2].y - 30.0f + 50.0f + temp_f20 + 25.0f, + this->bodyPartsPos[2].z, 0); SysMatrix_InsertTranslation(arg2->x, arg2->y + temp_f20, arg2->z, 0); SysMatrix_InsertYRotation_f(func_809F49C0() * M_PI * 2.0f, 1); SysMatrix_RotateStateAroundXAxis(-0.024999999f * temp_f20); SysMatrix_InsertZRotation_f(func_809F49C0() * 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(globalCtx->state.gfxCtx), 2); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); gSPDisplayList(POLY_XLU_DISP++, D_0602EFE8); } } func_8012C2DC(globalCtx->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, D_04023348); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, gGameInfo->data[1554] + 220, gGameInfo->data[1552] + 170); - gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, gGameInfo->data[1558] + 100, 128); + 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); - SysMatrix_InsertTranslation(this->unk_334[2].x, this->unk_334[2].y, this->unk_334[2].z, 0); + SysMatrix_InsertTranslation(this->bodyPartsPos[2].x, this->bodyPartsPos[2].y, this->bodyPartsPos[2].z, 0); SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); SysMatrix_InsertZRotation_s(globalCtx->gameplayFrames * 0x80, 1); - temp_f12_2 = (gGameInfo->data[1553] + 800) * 0.01f * this->unk_AB4C; + 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); gSPDisplayList(POLY_XLU_DISP++, D_04023428); } - CLOSE_DISPS(globalCtx->state.gfxCtx); -} -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FBB9C.s") -#endif - -#ifdef NON_MATCHING -void func_809FBF94(Boss07* this, GlobalContext* globalCtx) { - s32 pad; - s32 pad2; - f32 sp54; - f32 sp50; - Player* sp4C = PLAYER; - // GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; - - OPEN_DISPS(globalCtx->state.gfxCtx); - if (this->unk_AB44 > 0.0f) { - func_8012C2DC(globalCtx->state.gfxCtx); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)(gGameInfo->data[1588] + 255)); - gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 0); - gSPDisplayList(POLY_XLU_DISP++, D_04023348); - - if (sp4C->transformation == 1) { - sp54 = -10.0f; - sp50 = -20.0f; - } else { - sp54 = sp50 = 0.0f; - } - if (sp4C->transformation == 0) { - sp54 -= 43.0f; - } - - SysMatrix_InsertTranslation(sp4C->actor.world.pos.x, - sp4C->actor.world.pos.y + func_800B6FC8(sp4C) - 20.0f + sp54 + - gGameInfo->data[1596], - sp4C->actor.world.pos.z + gGameInfo->data[1597] - 15.0f + sp50, 0); - SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); - - Matrix_Scale(this->unk_AB44, this->unk_AB44, this->unk_AB44, 1); - SysMatrix_InsertZRotation_s(globalCtx->gameplayFrames * 0x40, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); - gSPDisplayList(POLY_XLU_DISP++, D_04023428); - } CLOSE_DISPS(gfxCtx); } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FBF94.s") -#endif + +void func_809FBF94(Boss07* this, GlobalContext* globalCtx) { + s32 pad; + GraphicsContext* gfxCtx; + f32 sp54; + f32 sp50; + Player* player; + + + OPEN_DISPS(gfxCtx = globalCtx->state.gfxCtx); + player = PLAYER; + + if (this->unk_AB44 > 0.0f) { + func_8012C2DC(globalCtx->state.gfxCtx); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)(sREG(52) + 255)); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 0); + gSPDisplayList(POLY_XLU_DISP++, D_04023348); + + if (player->transformation == 1) { + sp54 = -10.0f; + sp50 = -20.0f; + } else { + sp54 = sp50 = 0.0f; + } + if (player->transformation == 0) { + sp54 -= 43.0f; + } + + SysMatrix_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); + SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); + + Matrix_Scale(this->unk_AB44, this->unk_AB44, this->unk_AB44, 1); + SysMatrix_InsertZRotation_s(globalCtx->gameplayFrames * 0x40, 1); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); + gSPDisplayList(POLY_XLU_DISP++, D_04023428); + } + CLOSE_DISPS(gfxCtx); +} void Boss07_Wrath_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; @@ -2882,34 +3159,42 @@ void Boss07_Wrath_Draw(Actor* thisx, GlobalContext* globalCtx2) { } SysMatrix_InsertYRotation_f(this->unk_184, 1); SysMatrix_RotateStateAroundXAxis(this->unk_188); - func_801343C0(globalCtx, this->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, (s32)this->skelAnime1.dListCount, + func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, (s32)this->skelAnime.dListCount, func_809FB504, func_809FB55C, func_809FB728, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); - if (((gGameInfo->data[1311] == 0) || (gGameInfo->data[1311] == 2)) && (this->unk_149 != 0)) { - func_809FAA44(this, globalCtx, &this->unk_7A0, this->unk_7AC, this->unk_A04, this->unk_C5C, this->unk_790, - this->unk_794, this->unk_798, this->unk_79C, &this->unk_788, this->unk_F7E, this->unk_77C, 0); - func_809FAA44(this, globalCtx, &this->unk_FAC, this->unk_FB8, this->unk_1210, this->unk_1468, this->unk_F9C, - this->unk_FA0, this->unk_FA4, this->unk_FA8, &this->unk_F94, 0, this->unk_77C, 1); + if (((KREG(63) == 0) || (KREG(63) == 2)) && (this->unk_149 != 0)) { + 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, this->whipScale, 0); + Boss07_Wrath_UpdateWhips(this, globalCtx, &this->leftWhip.basePos, this->leftWhip.pos, this->leftWhip.rot, + this->leftWhip.pull, this->leftWhip.gravity, this->leftWhip.stiffness, this->leftWhip.drag, + this->leftWhip.tension, &this->leftWhip.baseRot, 0, this->whipScale, 1); } - func_809FB114(this, globalCtx, this->unk_7AC, this->unk_A04, this->unk_77C, 0); - func_809FB114(this, globalCtx, this->unk_FB8, this->unk_1210, this->unk_77C, 1); + Boss07_Wrath_DrawWhips(this, globalCtx, this->rightWhip.pos, this->rightWhip.rot, this->whipScale, 0); + Boss07_Wrath_DrawWhips(this, globalCtx, this->leftWhip.pos, this->leftWhip.rot, this->whipScale, 1); if (this->unk_AB48 == 0) { func_809FC8B0(sp54, this, globalCtx); func_809FC960(sp54, this, globalCtx); } func_809FB7D4(this, globalCtx); - sp58.x = this->unk_334[2].x; - sp58.y = this->unk_334[2].y - 30.0f + 50.0f; - sp58.z = this->unk_334[2].z; + sp58.x = this->bodyPartsPos[2].x; + sp58.y = this->bodyPartsPos[2].y - 30.0f + 50.0f; + sp58.z = this->bodyPartsPos[2].z; func_809FBB9C(this, globalCtx, &sp58); - func_800BE680(globalCtx, &this->actor, this->unk_334, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, + func_800BE680(globalCtx, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, this->unk_1804); this->unk_149 = 0; CLOSE_DISPS(globalCtx->state.gfxCtx); } void func_809FC4C0(Boss07* this, u8* shadowTexture, f32 arg2) { + static s32 sShadowWidths6[6] = { 1, 2, 3, 3, 2, 1 }; + 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 u8 sShadowSize[15] = { 3, 2, 2, 1, 3, 3, 1, 3, 3, 1, 0, 3, 1, 0, 3 }; s32 temp_t0; s32 temp_t1; s32 temp_v0; @@ -2922,17 +3207,17 @@ void func_809FC4C0(Boss07* this, u8* shadowTexture, f32 arg2) { Vec3f sp68; for (i = 0; i < 15; i++) { - if ((arg2 == 0.0f) || ((j = D_80A08140[i]) >= 0)) { + if ((arg2 == 0.0f) || ((j = sBodyPartsIndex2[i]) >= 0)) { if (arg2 > 0.0f) { - VEC3F_LERPIMPDST(&lerp, &this->unk_334[i], &this->unk_334[j], arg2); + VEC3F_LERPIMPDST(&lerp, &this->bodyPartsPos[i], &this->bodyPartsPos[j], arg2); sp74.x = lerp.x - this->actor.world.pos.x; sp74.y = lerp.y - this->actor.world.pos.y + 76.0f + 30.0f + 30.0f + 100.0f; sp74.z = lerp.z - this->actor.world.pos.z; } else { - sp74.x = this->unk_334[i].x - this->actor.world.pos.x; - sp74.y = this->unk_334[i].y - this->actor.world.pos.y + 76.0f + 30.0f + 30.0f + 100.0f; - sp74.z = this->unk_334[i].z - this->actor.world.pos.z; + sp74.x = this->bodyPartsPos[i].x - this->actor.world.pos.x; + sp74.y = this->bodyPartsPos[i].y - this->actor.world.pos.y + 76.0f + 30.0f + 30.0f + 100.0f; + sp74.z = this->bodyPartsPos[i].z - this->actor.world.pos.z; } SysMatrix_MultiplyVector3fByState(&sp74, &sp68); @@ -2941,27 +3226,27 @@ void func_809FC4C0(Boss07* this, u8* shadowTexture, f32 arg2) { temp_t0 = (u16)(s32)(sp68.x + 32.0f); temp_t1 = (u16)((s32)sp68.y << 6); - if (D_80A0817C[i] == 2) { + if (sShadowSize[i] == 2) { for (j = 0, phi_a3 = -0x180; j < 12; j++, phi_a3 += 0x40) { - for (phi_a0 = -D_80A08110[j]; phi_a0 < D_80A08110[j]; phi_a0++) { + for (phi_a0 = -sShadowWidths12[j]; phi_a0 < sShadowWidths12[j]; phi_a0++) { temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { shadowTexture[temp_v0] = 255; } } } - } else if (D_80A0817C[i] == 1) { + } else if (sShadowSize[i] == 1) { for (j = 0, phi_a3 = -0x100; j < 8; j++, phi_a3 += 0x40) { - for (phi_a0 = -D_80A080F0[j]; phi_a0 < D_80A080F0[j]; phi_a0++) { + for (phi_a0 = -sShadowWidths8[j]; phi_a0 < sShadowWidths8[j]; phi_a0++) { temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { shadowTexture[temp_v0] = 255; } } } - } else if (D_80A0817C[i] == 0) { + } else if (sShadowSize[i] == 0) { for (j = 0, phi_a3 = -0xC0; j < 7; j++, phi_a3 += 0x40) { - for (phi_a0 = -D_80A080D4[j]; phi_a0 < D_80A080D4[j] - 1; phi_a0++) { + for (phi_a0 = -sShadowWidths7[j]; phi_a0 < sShadowWidths7[j] - 1; phi_a0++) { temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { shadowTexture[temp_v0] = 255; @@ -2970,7 +3255,7 @@ void func_809FC4C0(Boss07* this, u8* shadowTexture, f32 arg2) { } } else { for (j = 0, phi_a3 = -0x80; j < 6; j++, phi_a3 += 0x40) { - for (phi_a0 = -D_80A080BC[j]; phi_a0 < D_80A080BC[j] - 1; phi_a0++) { + for (phi_a0 = -sShadowWidths6[j]; phi_a0 < sShadowWidths6[j] - 1; phi_a0++) { temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { shadowTexture[temp_v0] = 255; @@ -2995,14 +3280,12 @@ void func_809FC8B0(u8* arg0, Boss07* this, GlobalContext* globalCtx) { } } -#ifdef NON_MATCHING -void func_809FC960(u8* arg0, Boss07* thisx, GlobalContext* globalCtx2) { - GlobalContext* globalCtx = globalCtx2; - Boss07* this = THIS; +void func_809FC960(u8* arg0, Boss07* this, GlobalContext* globalCtx) { + s32 pad[2]; + f32 phi_f0; GraphicsContext* pad3 = globalCtx->state.gfxCtx; OPEN_DISPS(pad3); - f32 phi_f0; func_8012C28C(globalCtx->state.gfxCtx); phi_f0 = (400.0f - this->actor.world.pos.y) * 0.0025f; @@ -3019,9 +3302,6 @@ void func_809FC960(u8* arg0, Boss07* thisx, GlobalContext* globalCtx2) { gSPDisplayList(POLY_OPA_DISP++, D_0602EF88); CLOSE_DISPS(pad3); } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FC960.s") -#endif void func_809FCBC8(Boss07* this) { s32 phi_v0 = (Rand_ZeroOne() < 0.5f) ? 0x4000 : -0x4000; @@ -3036,27 +3316,201 @@ void func_809FCBC8(Boss07* this) { void func_809FCC70(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_809FCCCC; - SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_06002D84, 0.0f); + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06002D84, 0.0f); this->actor.flags &= ~1; this->unk_17D8 = 0x6E00; } +#ifdef NON_MATCHING +// float literals for 1.0f +void func_809FCCCC(Boss07* this, GlobalContext* globalCtx) { + s32 i; + f32 sp58; + Camera* sp54; + + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + this->unk_ABC8++; + SysMatrix_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; + switch (this->csState) { + case 0: + this->unk_ABC8 = 0; + this->csState = 1; + this->csCamNextAt.z = 0.0f; + case 1: + this->csState = 2; + this->unk_ABC8 = 0; + this->csCamNextEye.x = 70.0f; + this->csCamNextEye.y = 70.0f; + this->csCamNextEye.z = 150.0f; + this->csCamNextAt.x = 20.0f; + this->csCamNextAt.y = 80.0f; + break; + case 2: + 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); + } + Math_ApproachF(&this->unk_17B8[3], (this->unk_17C8[3] * sp58) + 1.0f, 1.0f, 0.5f); + } + if (this->unk_ABC8 > 40) { + this->csState = 3; + this->unk_ABC8 = 0; + } + break; + case 3: + Math_ApproachF(&this->csCamNextEye.x, 0.0f, 0.05f, this->csCamSpeedMod * 40.0f); + Math_ApproachF(&this->csCamNextEye.y, 100.0f, 0.05f, this->csCamSpeedMod * 30.0f); + Math_ApproachF(&this->csCamNextEye.z, 270.0f, 0.05f, this->csCamSpeedMod * 150.0f); + Math_ApproachF(&this->csCamNextAt.x, 0.0f, 0.05f, this->csCamSpeedMod * 20.0f); + Math_ApproachF(&this->csCamNextAt.y, 100.0f, 0.05f, this->csCamSpeedMod * 20.0f); + Math_ApproachF(&this->csCamSpeedMod, 0.05f, 1.0f, 0.002f); + if (this->unk_ABC8 >= 20) { + if (this->unk_ABC8 == 20) { + this->unk_17C8[2] = 1.0f; + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_TRANSFORM); + } + Math_ApproachF(&this->unk_17B8[2], (this->unk_17C8[2] * sp58) + 1.0f, 1.0f, 0.5f); + } + if (this->unk_ABC8 >= 50) { + if (this->unk_ABC8 == 50) { + this->unk_17C8[1] = 1.0f; + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_TRANSFORM); + } + Math_ApproachF(&this->unk_17B8[1], (this->unk_17C8[1] * sp58) + 1.0f, 1.0f, 0.5f); + } + if (this->unk_ABC8 >= 60) { + if (this->unk_ABC8 == 60) { + this->unk_17C8[0] = 1.0f; + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_TRANSFORM); + } + Math_ApproachF(this->unk_17B8, (this->unk_17C8[0] * sp58) + 1.0f, 1.0f, 0.5f); + } + if (this->unk_ABC8 == 80) { + this->csState = 4; + this->unk_ABC8 = 0; + this->unk_17B8[0] = 1.0f; + this->unk_17B8[1] = 1.0f; + this->unk_17B8[2] = 1.0f; + this->unk_17B8[3] = 1.0f; + } + break; + case 4: + this->csCamNextEye.x = 0.0f; + this->csCamNextEye.y = 120.0f; + this->csCamNextEye.z = 140.0f; + this->csCamNextAt.y = 170.0f; + if (this->unk_ABC8 >= 10) { + if (this->unk_ABC8 == 10) { + this->unk_17C8[3] = 1.0f; + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); + } + Math_ApproachS(&this->unk_17D8, this->unk_17C8[3] * sp58 * 0x6000, 1, 0x4000); + } + if (this->unk_ABC8 == 30) { + this->csState = 5; + this->unk_ABC8 = 0; + this->csCamSpeedMod = 0.0f; + this->unk_1D4 = 1000.0f; + func_80165690(); + } + break; + case 5: + if (this->unk_ABC8 == 20) { + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06002C40, 0.0f); + this->unk_1D4 = SkelAnime_GetFrameCount(&D_06002C40); + } + if (this->unk_ABC8 >= 20) { + sREG(28) = this->unk_ABC8; + if ((this->unk_ABC8 == (KREG(16) + 28)) || (this->unk_ABC8 == (KREG(17) + 60))) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_UAUOO2_OLD); + } + if ((this->unk_ABC8 == (KREG(18) + 38)) || (this->unk_ABC8 == (KREG(19) + 48)) || + (this->unk_ABC8 == (KREG(20) + 68)) || (this->unk_ABC8 == (KREG(21) + 78))) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_GYM_B_OLD); + } + if (this->unk_ABC8 == (KREG(38) + 93)) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_UAUOO_OLD); + } + } + if (this->unk_ABC8 == 45) { + Actor_TitleCardCreate(globalCtx, &globalCtx->actorCtx.titleCtxt, Lib_SegmentedToVirtual(&D_06030C40), + 0xA0, 0xB4, 0x80, 0x28); + } + if (this->unk_ABC8 == 20) { + Audio_QueueSeqCmd(0x806A); + this->unk_14A = 1; + globalCtx->envCtx.unk_DC = 0.0f; + } + Math_ApproachF(&this->csCamNextEye.x, -80.0f, 0.05f, this->csCamSpeedMod * 80.0f); + Math_ApproachF(&this->csCamNextEye.y, 20.0f, 0.05f, this->csCamSpeedMod * 60.0f); + Math_ApproachF(&this->csCamNextEye.z, 220.0f, 0.05f, this->csCamSpeedMod * 180.0f); + Math_ApproachF(&this->csCamNextAt.y, 110.0f, 0.05f, this->csCamSpeedMod * 80.0f); + Math_ApproachF(&this->csCamSpeedMod, 0.1f, 1.0f, 0.005f); + if (func_801378B8(&this->skelAnime, this->unk_1D4)) { + sp54 = Play_GetCamera(globalCtx, 0); + + this->csState = 0; + func_809FD5F8(this, globalCtx); + sp54->eye = this->csCamEye; + sp54->eyeNext = this->csCamEye; + sp54->at = this->csCamAt; + func_80169AFC(globalCtx, this->csCamIndex, 0); + this->csCamIndex = 0; + func_800EA0EC(globalCtx, &globalCtx->csCtx); + func_800B7298(globalCtx, &this->actor, 6); + this->actor.flags |= 1; + } + break; + } + for (i = 0; i < 4; i++) { + Math_ApproachZeroF(&this->unk_17C8[i], 0.5f, 0.1f); + } + SysMatrix_MultiplyVector3fByState(&this->csCamNextEye, &this->csCamEye); + SysMatrix_MultiplyVector3fByState(&this->csCamNextAt, &this->csCamAt); + if (this->csCamIndex != 0) { + ShrinkWindow_SetLetterboxTarget(0x1B); + Play_CameraSetAtEye(globalCtx, this->csCamIndex, &this->csCamAt, &this->csCamEye); + } +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FCCCC.s") +#endif void func_809FD5F8(Boss07* this, GlobalContext* globalCtx) { + static AnimationHeader* sDanceAnims[3] = { &D_0600A6AC, &D_0600AB04, &D_0600AD84}; + this->actionFunc = func_809FD710; this->unk_14E = Rand_ZeroFloat(2.999f); - SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, D_80A0818C[this->unk_14E], -10.0f); + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, sDanceAnims[this->unk_14E], -10.0f); this->actor.flags |= 1; this->timers[0] = Rand_ZeroFloat(50.0f) + 50.0f; } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FD710.s") +void func_809FD710(Boss07* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + + if (this->unk_14E < 2) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_WAIT_OLD - SFX_FLAG); + } else if ((this->unk_14E == 2) && func_801378B8(&this->skelAnime, 5.0f)) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_JUMP_OLD); + } + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + func_809F4CBC(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); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_SURPRISED_OLD); + } + func_809F4D54(this, globalCtx, 1, 0); +} void func_809FD818(Boss07* this, GlobalContext* globalCtx, s16 arg2) { if (this->actionFunc != func_809FD89C) { this->actionFunc = func_809FD89C; - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06009C7C, -10.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06009C7C, -10.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_06009C7C); } this->unk_158 = 10; @@ -3064,19 +3518,37 @@ void func_809FD818(Boss07* this, GlobalContext* globalCtx, s16 arg2) { this->timers[1] = 12; } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FD89C.s") +void func_809FD89C(Boss07* this, GlobalContext* globalCtx) { + this->actor.shape.shadowAlpha = 0; + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + func_809F4CBC(this, 1.0f); + if (this->timers[1] == 1) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_HIPLOOP_LAND); + } + if (func_801378B8(&this->skelAnime, this->unk_1D4)) { + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06009EA8, -5.0f); + this->unk_1D4 = 1000.0f; + } + if (this->unk_1D4 == 1000.0f) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_BIRD_OLD - SFX_FLAG); + } + if (this->timers[0] == 0) { + func_809FD5F8(this, globalCtx); + } + func_809F4D54(this, globalCtx, 1, 1); +} void func_809FD984(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { if (this->actionFunc != func_809FDAB0) { this->actionFunc = func_809FDAB0; - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06000D0C, -2.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06000D0C, -2.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_06000D0C); } else if (arg3 == 14) { - if (this->skelAnime1.animCurrentFrame <= (this->unk_1D4 - 5.0f)) { + if (this->skelAnime.animCurrentFrame <= (this->unk_1D4 - 5.0f)) { this->unk_158 = 30; this->unk_15C = 30; } else { - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, (AnimationHeader*)&D_06000D0C, -2.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, (AnimationHeader*)&D_06000D0C, -2.0f); } } @@ -3094,47 +3566,404 @@ void func_809FD984(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_DAMAGE2_OLD); } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FDAB0.s") +void func_809FDAB0(Boss07* this, GlobalContext* globalCtx) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_BIRD2_OLD - SFX_FLAG); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + func_809F4CBC(this, 2.0f); + if (func_801378B8(&this->skelAnime, this->unk_1D4)) { + func_809FDB2C(this, globalCtx); + } + func_809F4D54(this, globalCtx, 1, 0); +} void func_809FDB2C(Boss07* this, GlobalContext* globalCtx) { - SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_0600A400, -2.0f); + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_0600A400, -2.0f); this->actionFunc = func_809FDBA0; this->timers[0] = Rand_ZeroFloat(100.0f) + 150.0f; func_809FCBC8(this); } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FDBA0.s") +void func_809FDBA0(Boss07* this, GlobalContext* globalCtx) { + f32 sp34; + f32 sp30; + s32 sp2C; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FDEDC.s") + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_WALK_OLD - SFX_FLAG); + this->unk_AB40++; + if (this->unk_AB40 >= 2) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_WALK2_OLD); + this->unk_AB40 = 0; + } + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + if ((func_800B64FC(globalCtx, 5.0f, &this->actor.world.pos, &sp2C) >= 0.0f) && (sp2C == 0)) { + func_809FD818(this, globalCtx, 50); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_DAMAGE_OLD); + } else { + sp34 = this->unk_164.x - this->actor.world.pos.x; + sp30 = this->unk_164.z - this->actor.world.pos.z; + if ((this->timers[1] == 0) || (SQ(sp34) + SQ(sp30) < 30000.0f)) { + if (Rand_ZeroOne() < 0.3f) { + f32 temp_f0 = Rand_ZeroOne(); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FDF54.s") + if (temp_f0 < 0.25f) { + func_809FDEDC(this, globalCtx); + } else if (temp_f0 < 0.5f) { + func_809FE068(this, globalCtx); + } else if (temp_f0 < 0.75f) { + func_809FE2D4(this, globalCtx); + } else if (temp_f0 < 1.0f) { + func_809FE4B0(this, globalCtx); + } + } else if (Rand_ZeroOne() < 0.01f) { + func_809FD818(this, globalCtx, 50); + } else { + func_809F4D10(&this->unk_164, 500.0f); + this->timers[1] = Rand_ZeroFloat(50.0f) + 20.0f; + this->unk_170 = 0.0f; + } + } + Math_ApproachS(&this->actor.world.rot.y, Math_Atan2S(sp34, sp30), 5, this->unk_170); + 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); + } + if ((this->actor.xzDistToPlayer < 200.0f) && (this->timers[2] == 0)) { + func_809FCBC8(this); + this->timers[0] = 50; + this->timers[2] = 50; + } + func_809F4D54(this, globalCtx, 3, 0); + this->unk_18D6 = 5; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FE068.s") +void func_809FDEDC(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_809FDF54; + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06000428, -5.0f); + this->timers[0] = Rand_ZeroFloat(50.0f) + 30.0f; + this->unk_188C = 0.0f; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FE0E4.s") +void func_809FDF54(Boss07* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + func_809F4CBC(this, 3.0f); + Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 0x3000); + if (func_801378B8(&this->skelAnime, 4.0f)) { + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BOSS_07, this->unk_17A0.x, this->unk_17A0.y, + this->unk_17A0.z, 0, 0, 0, 101); + } + if (func_801378B8(&this->skelAnime, 9.0f)) { + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BOSS_07, this->unk_17AC.x, this->unk_17AC.y, + this->unk_17AC.z, 0, 0, 0, 101); + } + if (this->timers[0] == 0) { + func_809FDB2C(this, globalCtx); + } + func_809F4D54(this, globalCtx, 1, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FE2D4.s") +void func_809FE068(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_809FE0E4; + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06003A64, -5.0f); + this->timers[0] = Rand_ZeroFloat(100.0f) + 100.0f; + this->timers[1] = 0; + this->unk_ABC8 = 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FE348.s") +void func_809FE0E4(Boss07* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + if (func_801378B8(&this->skelAnime, 5.0f)) { + if ((this->unk_ABC8 % 2) == 0) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_UAUOO1_OLD); + } else { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_UAUOO2_OLD); + } + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST2_JUMP_OLD); + this->unk_ABC8++; + } + 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 (Rand_ZeroOne() < 0.75f) { + this->unk_180 = randPlusMinusPoint5Scaled(0x10000); + } else { + this->unk_180 = this->actor.yawTowardsPlayer; + } + } + if (this->actor.bgCheckFlags & 8) { + this->timers[1] = 20; + this->unk_180 = this->actor.yawTowardsPlayer; + } + } + 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); + if (this->timers[0] != 0) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_SURPRISED_OLD); + } + } + func_809F4D54(this, globalCtx, 7, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FE4B0.s") +void func_809FE2D4(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_809FE348; + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_0600A194, -10.0f); + this->timers[0] = Rand_ZeroFloat(50.0f) + 70.0f; + this->timers[1] = 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FE524.s") +void func_809FE348(Boss07* this, GlobalContext* globalCtx) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_MOONWALK_OLD - SFX_FLAG); + SkelAnime_FrameUpdateMatrix(&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 (Rand_ZeroOne() < 0.75f) { + this->unk_180 = randPlusMinusPoint5Scaled(65536.0f); + } else { + this->unk_180 = this->actor.yawTowardsPlayer + 0x8000; + } + } + if ((this->actor.bgCheckFlags & 8) != 0) { + this->timers[1] = 20; + this->unk_180 = this->actor.yawTowardsPlayer + 0x8000; + } + } + Math_ApproachS(&this->actor.world.rot.y, this->unk_180, 0xA, 0x1000); + if (this->timers[0] == 0) { + func_809FDB2C(this, globalCtx); + } + func_809F4D54(this, globalCtx, 7, 0); +} + +void func_809FE4B0(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_809FE524; + SkelAnime_ChangeAnimTransitionStop(&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) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_BALLET_OLD - SFX_FLAG); + SkelAnime_FrameUpdateMatrix(&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 (Rand_ZeroOne() < 0.75f) { + this->unk_180 = randPlusMinusPoint5Scaled(65536.0f); + } else { + this->unk_180 = this->actor.yawTowardsPlayer; + } + } + if (this->actor.bgCheckFlags & 8) { + this->timers[1] = 20; + this->unk_180 = this->actor.yawTowardsPlayer; + } + } + 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); + if (this->timers[0] != 0) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_SURPRISED_OLD); + } + } + this->actor.shape.rot.y += 0x2000; +} void func_809FE6B0(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_809FE734; func_809F4FAC(globalCtx); - SkelAnime_ChangeAnimTransitionStop(&this->skelAnime1, &D_06000D0C, -2.0f); + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06000D0C, -2.0f); this->unk_1D4 = SkelAnime_GetFrameCount(&D_06000D0C); - this->unk_ABD0 = 0; + this->csState = 0; this->unk_ABC8 = 0; this->actor.flags &= ~1; this->unk_15C = 20; } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FE734.s") +void func_809FE734(Boss07* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + u8 sp4B = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FEE70.s") + this->unk_15C = 20; + this->unk_ABC8++; + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + func_809F4CBC(this, 3.0f); + switch (this->csState) { + case 0: + if (ActorCutscene_GetCurrentIndex() != -1) { + break; + } + func_800EA0D4(globalCtx, &globalCtx->csCtx); + func_800B7298(globalCtx, &this->actor, 7); + this->csCamIndex = func_801694DC(globalCtx); + func_80169590(globalCtx, 0, 1); + func_80169590(globalCtx, this->csCamIndex, 7); + this->unk_ABC8 = 0; + this->csState = 10; + func_8016566C(150); + case 10: + sHeartbeatTimer = 5; + this->csCamNextEye.x = 0.0f; + this->csCamNextEye.y = 30.0f; + this->csCamNextEye.z = 210.0f; + this->csCamNextAt.x = 0.0f; + this->csCamNextAt.y = 150.0f; + this->csCamNextAt.z = 0.0f; + Math_ApproachF(&this->actor.world.pos.x, 0.0f, 0.1f, 5.0f); + Math_ApproachF(&this->actor.world.pos.z, 0.0f, 0.1f, 5.0f); + if (func_801378B8(&this->skelAnime, this->unk_1D4)) { + this->unk_ABC8 = 0; + this->csState = 1; + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06003854, -5.0f); + } + break; + case 1: + sHeartbeatTimer = 5; + this->csCamNextAt.y = (Math_SinS(this->unk_ABC8 * 0x700) * 15.0f) + 150.0f; + if (this->unk_ABC8 == 40) { + this->unk_ABC8 = 0; + this->csState = 2; + this->csCamNextEye.x = -30.0f; + this->csCamNextEye.y = 120.0f; + this->csCamNextEye.z = 110.0f; + this->csCamNextAt.x = -70.0f; + this->csCamNextAt.y = 150.0f; + this->csCamNextAt.z = -20.0f; + this->unk_17E8 = 1.0f; + this->unk_17EC = 0.4f; + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_060031E4, -5.0f); + this->actor.shape.rot.y = 0; + this->actor.world.rot.y = this->actor.shape.rot.y; + Math_ApproachF(&this->actor.world.pos.x, 0.0f, 1.0f, 200.0f); + Math_ApproachF(&this->actor.world.pos.z, 0.0f, 1.0f, 200.0f); + player->actor.world.pos.x = this->actor.world.pos.x; + player->actor.world.pos.z = this->actor.world.pos.z + 300.0f; + player->actor.world.rot.y = player->actor.shape.rot.y = -0x8000; + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_PUMP_UP_OLD); + } + break; + case 2: + sHeartbeatTimer = 5; + sp4B = 1; + if (this->unk_ABC8 == 40) { + this->unk_ABC8 = 0; + this->csState = 3; + this->csCamNextEye.x = 30.0f; + this->csCamNextEye.y = 120.0f; + this->csCamNextEye.z = 110.0f; + this->csCamNextAt.x = 50.0f; + this->csCamNextAt.y = 150.0f; + this->csCamNextAt.z = -20.0f; + this->unk_17E8 = 1.0f; + this->unk_17EC = 0.4f; + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_PUMP_UP_OLD); + } + break; + case 3: + sHeartbeatTimer = 5; + sp4B = 1; + if (this->unk_ABC8 == 40) { + this->unk_ABC8 = 0; + this->csState = 4; + this->csCamNextEye.x = 0.0f; + this->csCamNextEye.y = 90.0f; + this->csCamNextEye.z = 110.0f; + this->csCamNextAt.x = 0.0f; + this->csCamNextAt.y = 90.0f; + this->csCamNextAt.z = 0.0f; + this->unk_17E8 = 1.0f; + this->unk_17EC = 0.4f; + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_PUMP_UP_OLD); + } + break; + case 4: + sHeartbeatTimer = 5; + sp4B = 2; + if (this->unk_ABC8 == 10) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_PUMP_UP_OLD); + } + if (this->unk_ABC8 == 40) { + 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, this->csCamIndex, 30); + Actor_MarkForDeath(&this->actor); + } + break; + } + SysMatrix_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); + SysMatrix_MultiplyVector3fByState(&this->csCamNextEye, &this->csCamEye); + SysMatrix_MultiplyVector3fByState(&this->csCamNextAt, &this->csCamAt); + if (sp4B == 1) { + this->unk_17E0 = (Math_SinS(this->unk_ABC8 * 0x3000) * this->unk_17EC) + this->unk_17E8; + Math_ApproachF(&this->unk_17E8, 2.0f, 1.0f, 0.05f); + Math_ApproachZeroF(&this->unk_17EC, 1.0f, 0.01f); + } else if (sp4B == 2) { + this->unk_17E4 = (Math_SinS(this->unk_ABC8 * 0x3000) * this->unk_17EC) + this->unk_17E8; + Math_ApproachF(&this->unk_17E8, 2.0f, 1.0f, 0.05f); + Math_ApproachZeroF(&this->unk_17EC, 1.0f, 0.01f); + } + this->unk_17F0 = (Math_SinS(this->unk_ABC8 * 0x2000) * 0.1f) + 1.0f; + this->unk_17F4 = (Math_CosS(this->unk_ABC8 * 0x2000) * 0.1f) + 1.0f; + if (this->csCamIndex != 0) { + ShrinkWindow_SetLetterboxTarget(0x1B); + Play_CameraSetAtEye(globalCtx, this->csCamIndex, &this->csCamAt, &this->csCamEye); + } +} + +void func_809FEE70(Boss07* this, GlobalContext* globalCtx) { + s32 i; + s32 j; + u8 damage; + + if (this->unk_15C == 0) { + for (i = 0; i < 11; i++) { + if (this->sph1.elements[i].info.bumperFlags & 2) { + for (j = 0; j < 11; j++) { + this->sph1.elements[j].info.bumperFlags &= ~2; + } + if (this->unk_1804 == 10) { + this->unk_1806 = 0; + } + switch (this->actor.colChkInfo.damageEffect) { + case 3: + this->unk_1805 = 10; + break; + case 2: + this->unk_1805 = 1; + break; + case 4: + this->unk_1805 = 20; + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, + this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 0, 4); + break; + case 10: + this->unk_1805 = 40; + Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + break; + case 9: + this->unk_1805 = 30; + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, + this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 3, 4); + break; + } + + if ((this->actionFunc == func_809FD89C) || (this->actionFunc == func_809FDAB0)) { + this->unk_15C = (this->actor.colChkInfo.damageEffect == 12) ? 15 : 5; + damage = this->actor.colChkInfo.damage; + func_809FD984(this, globalCtx, damage, this->actor.colChkInfo.damageEffect); + this->unk_15E = 15; + } else { + this->unk_15C = 15; + func_809FD818(this, globalCtx, 150); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_DAMAGE_OLD); + } + break; + } + } + } +} void Boss07_Afterimage_Update(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; @@ -3146,7 +3975,10 @@ void Boss07_Afterimage_Update(Actor* thisx, GlobalContext* globalCtx2) { } #ifdef NON_MATCHING +// Incorrect load of 0.1f in the first Math_ApproachF void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { + static u8 D_80A08198[8] = { 1, 0, 3, 0, 4, 0, 5, 0 }; + static u8 D_80A081A0[8] = { 0, 3, 0, 4, 0, 5, 0, 1 }; GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; s32 i; @@ -3154,7 +3986,7 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actor.hintId = 51; this->unk_14C++; - Math_Vec3f_Copy(&D_80A09A40, &this->actor.projectedPos); + Math_Vec3f_Copy(&sSfxPoint, &this->actor.projectedPos); if (this->unk_14A == 1) { Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.1f); if (globalCtx->envCtx.unk_DC == 1.0f) { @@ -3168,7 +4000,7 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { globalCtx->envCtx.unk_C1 = D_80A081A0[this->unk_14B]; } Math_ApproachF(&globalCtx->envCtx.unk_DC, 0.0f, 1.0f, 0.03f); - if (gGameInfo->data[1311] == 0) { + if (KREG(63) == 0) { this->unk_174 = 0; this->actor.shape.shadowAlpha = 130; for (i = 0; i < 3; i++) { @@ -3183,8 +4015,8 @@ 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) || (gGameInfo->data[1336] != 0)) { - gGameInfo->data[1336] = 0; + if ((this->unk_148 != 0) || (KREG(88) != 0)) { + KREG(88) = 0; this->unk_148 = 0; Audio_QueueSeqCmd(0x100100FF); func_809FE6B0(this, globalCtx); @@ -3202,18 +4034,21 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 1, 0x1000); } if ((this->unk_18D6 != 0) && !(this->unk_14C & 1)) { - Boss07* temp_v0_12 = (Boss07*)Actor_SpawnAsChild( + 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 (temp_v0_12 != NULL) { + + if (afterimage != NULL) { for (i = 0; i < 25; i++) { - temp_v0_12->skelAnime1.limbDrawTbl[i] = this->skelAnime1.limbDrawTbl[i]; + afterimage->skelAnime.limbDrawTbl[i] = this->skelAnime.limbDrawTbl[i]; } } } func_809F9E94(this, globalCtx); } #else +static u8 D_80A08198[8] = { 1, 0, 3, 0, 4, 0, 5, 0 }; +static u8 D_80A081A0[8] = { 0, 3, 0, 4, 0, 5, 0, 1 }; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Incarnation_Update.s") #endif @@ -3225,7 +4060,7 @@ void Boss07_Afterimage_Draw(Actor* thisx, GlobalContext* globalCtx2) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 0, 0, 100, 155, 900, 1099); - SkelAnime_DrawSV(globalCtx, sp34->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, sp34->skelAnime1.dListCount, + SkelAnime_DrawSV(globalCtx, sp34->skelAnime.skeleton, this->skelAnime.limbDrawTbl, sp34->skelAnime.dListCount, NULL, NULL, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx); @@ -3240,6 +4075,23 @@ s32 func_809FF678(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p return false; } +static s8 sIncarnationColliders[32] = { + -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, 0, 0, +}; +static s8 D_80A081C8[32] = { + -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, 0, 0, +}; +static Vec3f sIncarnationColliderOffsets[11] = { + { 2000.0f, 0.0f, 0.0f }, { 3500.0f, -1000.0f, 0.0f }, { 100000.0f, 100000.0f, 100000.0f }, + { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, + { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, + { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, +}; +static s8 sIncarnationBodyParts[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, +}; + void func_809FF6B0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { Boss07* this = THIS; Vec3f sp28; @@ -3248,16 +4100,16 @@ void func_809FF6B0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* if (limbIndex == 0x18) { SysMatrix_GetStateTranslation(&this->actor.focus.pos); } - i = D_80A0826C[limbIndex]; + i = sIncarnationBodyParts[limbIndex]; if (i >= 0) { - SysMatrix_GetStateTranslation(&this->unk_334[i]); + SysMatrix_GetStateTranslation(&this->bodyPartsPos[i]); } - i = D_80A081A8[limbIndex]; + i = sIncarnationColliders[limbIndex]; if (i >= 0) { if (this->unk_158 != 0) { SysMatrix_GetStateTranslationAndScaledZ(100000.0f, &sp28); } else { - SysMatrix_MultiplyVector3fByState(&D_80A081E8[i], &sp28); + SysMatrix_MultiplyVector3fByState(&sIncarnationColliderOffsets[i], &sp28); } func_809F4BB0(i, &this->sph1, &sp28); } @@ -3307,17 +4159,17 @@ void Boss07_Incarnation_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); } - func_801343C0(globalCtx, this->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, this->skelAnime1.dListCount, + func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, func_809FF678, func_809FF6B0, func_809FF810, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); - func_800BE680(globalCtx, &this->actor, this->unk_334, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, + func_800BE680(globalCtx, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, this->unk_1804); CLOSE_DISPS(globalCtx->state.gfxCtx); } void func_809FFA04(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_809FFA80; - SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_06019E48, -20.0f); + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06019E48, -20.0f); this->timers[2] = Rand_ZeroFloat(150.0f) + 60.0f; this->unk_1870 = 1.0f; } @@ -3331,7 +4183,7 @@ void func_809FFA80(Boss07* this, GlobalContext* globalCtx) { s32 pad; Player* player = PLAYER; - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_FLOAT_OLD - SFX_FLAG); if (this->timers[0] == 0) { if (this->timers[2] == 0) { @@ -3373,8 +4225,8 @@ void func_809FFA80(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) || (gGameInfo->data[1336] != 0)) { - gGameInfo->data[1336] = 0; + if ((this->unk_148 != 0) || (KREG(88) != 0)) { + KREG(88) = 0; this->unk_148 = 0; Audio_QueueSeqCmd(0x100100FF); func_80A025AC(this, globalCtx); @@ -3384,7 +4236,7 @@ void func_809FFA80(Boss07* this, GlobalContext* globalCtx) { void func_809FFE64(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_809FFEAC; this->unk_14E = 0; - this->unk_ABD0 = 0; + this->csState = 0; this->timers[0] = 30; this->unk_18D4 = 0; Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_ATTACK_OLD); @@ -3397,7 +4249,7 @@ void func_809FFEAC(Boss07* this, GlobalContext* globalCtx) { f32 sp2C; f32 sp28; f32 sp24; - Player* sp20 = PLAYER; + Player* player = PLAYER; this->actor.shape.rot.z -= this->unk_18D4; switch (this->unk_14E) { @@ -3419,9 +4271,9 @@ void func_809FFEAC(Boss07* this, GlobalContext* globalCtx) { Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 0xA, 0x400); Math_ApproachS(&this->unk_18D4, 0x2000, 1, 0x200); if (this->timers[1] != 0) { - this->unk_164.x = sp20->actor.world.pos.x; - this->unk_164.y = sp20->actor.world.pos.y + 10.0f; - this->unk_164.z = sp20->actor.world.pos.z; + this->unk_164.x = player->actor.world.pos.x; + this->unk_164.y = player->actor.world.pos.y + 10.0f; + this->unk_164.z = player->actor.world.pos.z; } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_ROLLING_OLD - SFX_FLAG); } @@ -3435,7 +4287,7 @@ void func_809FFEAC(Boss07* this, GlobalContext* globalCtx) { Math_ApproachS(&this->actor.world.rot.x, sp36, 0xA, this->unk_170); Math_ApproachF(&this->unk_170, 3000.0f, 1.0f, 100.0f); Math_ApproachF(&this->actor.speedXZ, 20.0f, 1.0f, 2.0f); - if (((this->unk_ABD0 == 0) && (sp24 < 100.0f)) || (this->timers[0] == 0)) { + if (((this->csState == 0) && (sp24 < 100.0f)) || (this->timers[0] == 0)) { if (Rand_ZeroOne() < 0.25f) { this->unk_14E = 2; this->timers[0] = 30; @@ -3445,10 +4297,10 @@ void func_809FFEAC(Boss07* this, GlobalContext* globalCtx) { if (Rand_ZeroOne() < 0.3f) { this->timers[1] = 20; Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_ATTACK_2ND_OLD); - this->unk_ABD0 = 1; + this->csState = 1; } else { this->timers[1] = 0; - this->unk_ABD0 = 0; + this->csState = 0; } this->timers[0] = 50; this->unk_170 = 0.0f; @@ -3467,14 +4319,14 @@ void func_809FFEAC(Boss07* this, GlobalContext* globalCtx) { void func_80A0021C(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_80A00274; - SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime1, &D_0600AE40, -10.0f); + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_0600AE40, -10.0f); this->timers[0] = 100; this->unk_170 = 0.0f; } void func_80A00274(Boss07* this, GlobalContext* globalCtx) { - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); - func_8019F1C0(&D_80A09A40, NA_SE_EN_COMMON_WEAKENED - SFX_FLAG); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + func_8019F1C0(&sSfxPoint, NA_SE_EN_COMMON_WEAKENED - SFX_FLAG); func_809F4CBC(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); @@ -3524,7 +4376,7 @@ void func_80A00484(Boss07* this, GlobalContext* globalCtx, u8 arg2, Actor* arg3) void func_80A00554(Boss07* this, GlobalContext* globalCtx) { this->unk_15C = 20; - SkelAnime_FrameUpdateMatrix(&this->skelAnime1); + SkelAnime_FrameUpdateMatrix(&this->skelAnime); if (this->actor.bgCheckFlags & 1) { func_809F4CBC(this, 1.0f); Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 1, 0x1000); @@ -3574,7 +4426,6 @@ void func_80A006F4(Boss07* this, GlobalContext* globalCtx) { this->unk_170 = 0.0f; } -#ifdef NON_MATCHING void func_80A00720(Boss07* this, GlobalContext* globalCtx) { f32 temp_f20; f32 temp_f22; @@ -3612,7 +4463,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { switch (this->unk_14E) { case 0: if (this->timers[0] == 25) { - func_8019F1C0(&D_80A09A40, NA_SE_EN_LAST1_BLOW_OLD); + func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST1_BLOW_OLD); } if (this->timers[0] == 0) { this->unk_14E = 1; @@ -3690,9 +4541,9 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { } else { player->unk_B84 = this->actor.yawTowardsPlayer; player->unk_B80 = this->unk_1898 * 0.5f; - D_80A09A58->unk_1808 = 1; - D_80A09A58->unk_180C = this->unk_1898 * 30.0f; - D_80A09A58->unk_1810 = this->unk_18A8; + sMajoraStatic->unk_1808 = 1; + sMajoraStatic->unk_180C = this->unk_1898 * 30.0f; + sMajoraStatic->unk_1810 = this->unk_18A8; Math_ApproachS(&this->unk_18C4, sp118.x, 2, 0x2000); Math_ApproachS(&this->unk_18C6, sp118.y, 2, 0x2000); sp16C.x = this->actor.world.pos.x - this->unk_18A8.x; @@ -3752,60 +4603,62 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { } SysMatrix_StatePop(); for (sp178 = 0; sp178 < 4; sp178++) { - if (D_80A09A60[sp178]->unk_14E < 2) { - sp16C.x = D_80A09A60[sp178]->actor.world.pos.x - this->unk_18A8.x; - sp16C.y = D_80A09A60[sp178]->actor.world.pos.y - this->unk_18A8.y; - sp16C.z = D_80A09A60[sp178]->actor.world.pos.z - this->unk_18A8.z; - sp180 = sqrtf(SQXYZ(sp16C)); - SysMatrix_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)) { - s32 pad; - Vec3f spE0; - Vec3f spD4; - Vec3f spC8; + if (sBossRemains[sp178]->unk_14E >= 2) { + continue; + } + sp16C.x = sBossRemains[sp178]->actor.world.pos.x - this->unk_18A8.x; + sp16C.y = sBossRemains[sp178]->actor.world.pos.y - this->unk_18A8.y; + sp16C.z = sBossRemains[sp178]->actor.world.pos.z - this->unk_18A8.z; + sp180 = sqrtf(SQXYZ(sp16C)); + SysMatrix_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)) { + s32 pad; + Vec3f spE0; + Vec3f spD4; + Vec3f spC8; - this->unk_18D8 += 2; - this->unk_18C0 = sp180 * 0.062f; - if (this->unk_18D8 < 5) { + this->unk_18D8 += 2; + this->unk_18C0 = sp180 * 0.062f; + if (this->unk_18D8 < 5) { + spE0.x = + sBossRemains[sp178]->actor.world.pos.x + randPlusMinusPoint5Scaled(40.0f); + spE0.y = + sBossRemains[sp178]->actor.world.pos.y + randPlusMinusPoint5Scaled(40.0f); + spE0.z = + sBossRemains[sp178]->actor.world.pos.z + randPlusMinusPoint5Scaled(40.0f); + spD4.x = 0.0f; + spD4.y = 6.0f; + spD4.z = 0.0f; + spC8.x = spD4.x * -0.05f; + spC8.y = spD4.y * -0.05f; + spC8.z = spD4.z * -0.05f; + + func_809F4AE8(globalCtx, &spE0, &spD4, &spC8, Rand_ZeroFloat(10.0f) + 25.0f); + sBossRemains[sp178]->unk_15E |= 0xA; + } else { + sBossRemains[sp178]->unk_14E = 2; + sBossRemains[sp178]->unk_18D6 = 60; + Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_DEAD); + for (pad = 0; pad < 20; pad++) { spE0.x = - D_80A09A60[sp178]->actor.world.pos.x + randPlusMinusPoint5Scaled(40.0f); + sBossRemains[sp178]->actor.world.pos.x + randPlusMinusPoint5Scaled(50.0f); spE0.y = - D_80A09A60[sp178]->actor.world.pos.y + randPlusMinusPoint5Scaled(40.0f); + sBossRemains[sp178]->actor.world.pos.y + randPlusMinusPoint5Scaled(50.0f); spE0.z = - D_80A09A60[sp178]->actor.world.pos.z + randPlusMinusPoint5Scaled(40.0f); - spD4.x = 0.0f; - spD4.y = 6.0f; - spD4.z = 0.0f; + sBossRemains[sp178]->actor.world.pos.z + randPlusMinusPoint5Scaled(50.0f); + spD4.x = randPlusMinusPoint5Scaled(20.0f); + spD4.y = randPlusMinusPoint5Scaled(20.0f); + spD4.z = randPlusMinusPoint5Scaled(20.0f); spC8.x = spD4.x * -0.05f; spC8.y = spD4.y * -0.05f; spC8.z = spD4.z * -0.05f; - - func_809F4AE8(globalCtx, &spE0, &spD4, &spC8, Rand_ZeroFloat(10.0f) + 25.0f); - D_80A09A60[sp178]->unk_15E |= 0xA; - } else { - D_80A09A60[sp178]->unk_14E = 2; - D_80A09A60[sp178]->unk_18D6 = 60; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_DEAD); - for (pad = 0; pad < 20; pad++) { - spE0.x = - D_80A09A60[sp178]->actor.world.pos.x + randPlusMinusPoint5Scaled(50.0f); - spE0.y = - D_80A09A60[sp178]->actor.world.pos.y + randPlusMinusPoint5Scaled(50.0f); - spE0.z = - D_80A09A60[sp178]->actor.world.pos.z + randPlusMinusPoint5Scaled(50.0f); - spD4.x = randPlusMinusPoint5Scaled(20.0f); - spD4.y = randPlusMinusPoint5Scaled(20.0f); - spD4.z = randPlusMinusPoint5Scaled(20.0f); - spC8.x = spD4.x * -0.05f; - spC8.y = spD4.y * -0.05f; - spC8.z = spD4.z * -0.05f; - func_809F4AE8(globalCtx, &spE0, &spD4, &spC8, - Rand_ZeroFloat(10.0f) + 25.0f); - } + func_809F4AE8(globalCtx, &spE0, &spD4, &spC8, + Rand_ZeroFloat(10.0f) + 25.0f); } } } + } if (func_800C55C4(&globalCtx->colCtx, &this->unk_18A8, &this->unk_18B4, &sp14C, &sp158, 1, 1, 1, 1, &sp144) && @@ -3865,9 +4718,6 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { break; } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A00720.s") -#endif void func_80A016E4(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_80A01750; @@ -3878,11 +4728,338 @@ void func_80A016E4(Boss07* this, GlobalContext* globalCtx) { func_8016566C(this->unk_160); } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A01750.s") +static Vec3s sCameraEyes[4] = { + { 616, 402, -46 }, + { -622, 380, -86 }, + { 400, 300, 463 }, + { -400, 470, 496 }, +}; +static Vec3s sCameraAts[4] = { + { 646, 394, -150 }, + { -648, 380, -190 }, + { 502, 321, 438 }, + { -500, 445, 468 }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A025AC.s") +void func_80A01750(Boss07* this, GlobalContext* globalCtx) { -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A0264C.s") + f32 sp8C = 0.0f; + Player* player = PLAYER; + + this->unk_ABC8++; + SREG(90) = this->unk_160; + this->unk_1884 = 1; + switch (this->csState) { + case 0: + this->actor.world.pos.x = 0.0f; + this->actor.world.pos.y = 277.0f; + this->actor.world.pos.z = -922.5f; + if ((player->actor.world.pos.z < 700.0f) && (ActorCutscene_GetCurrentIndex() == -1)) { + func_800EA0D4(globalCtx, &globalCtx->csCtx); + func_800B7298(globalCtx, &this->actor, 7); + this->csCamIndex = func_801694DC(globalCtx); + func_80169590(globalCtx, 0, 1); + func_80169590(globalCtx, this->csCamIndex, 7); + this->unk_ABC8 = 0; + this->csState = 1; + this->unk_160 = KREG(76) + 150; + case 1: + if (this->unk_ABC8 >= 20) { + func_8019F128(NA_SE_EV_LIGHT_GATHER - SFX_FLAG); + Math_ApproachF(&sMajoraStatic->unk_AB44, sREG(50) + 1.0f, 0.05f, sREG(51) + 0.05f); + } + if (this->unk_ABC8 == 35) { + func_800B7298(globalCtx, &this->actor, 0xF); + } + player->actor.world.pos.x = 0.0f; + player->actor.world.pos.z = 700.0f; + player->actor.shape.rot.y = -0x8000; + player->actor.world.rot.y = player->actor.shape.rot.y; + this->csCamEye.x = 0.0f; + this->csCamEye.y = func_800B6FC8(player) + player->actor.world.pos.y - 24.0f; + this->csCamEye.z = player->actor.world.pos.z - 60.0f; + 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) { + this->csCamAt.y -= 30.0f; + } + if (this->unk_ABC8 == 75) { + this->unk_ABC8 = 0; + this->csState = 2; + this->csCamEye.x = player->actor.world.pos.x; + this->csCamEye.y = player->actor.world.pos.y + 20.0f; + this->csCamEye.z = player->actor.world.pos.z - 60.0f + 120.0f; + this->csCamAt.x = player->actor.world.pos.x; + this->csCamAt.y = player->actor.world.pos.y + 24.0f + 5.0f; + this->csCamAt.z = player->actor.world.pos.z; + } + } + break; + case 2: + this->unk_160 = KREG(77) + 150; + if (this->unk_ABC8 >= 20) { + Math_ApproachZeroF(&sMajoraStatic->unk_AB44, 1.0f, 0.05f); + } + if (this->unk_ABC8 == 20) { + sBossRemains[0]->unk_14E = 1; + sBossRemains[1]->unk_14E = 1; + sBossRemains[2]->unk_14E = 1; + sBossRemains[3]->unk_14E = 1; + } + if (this->unk_ABC8 == 0) { + func_800B7298(globalCtx, &this->actor, 7); + } + if (this->unk_ABC8 == 120) { + func_800B7298(globalCtx, &this->actor, 0x15); + } + if (this->unk_ABC8 >= 0x1FU) { + Math_ApproachF(&this->csCamAt.y, player->actor.world.pos.y + 24.0f + 20.0f, 0.05f, this->csCamSpeedMod); + Math_ApproachF(&this->csCamSpeedMod, 1.0f, 1.0f, 0.01f); + } + if (this->unk_ABC8 >= 160) { + if (this->unk_ABC8 == 160) { + sBossRemains[0]->unk_14E = 2; + sBossRemains[1]->unk_14E = 2; + sBossRemains[2]->unk_14E = 2; + sBossRemains[3]->unk_14E = 2; + } + if (this->unk_ABC8 == 161) { + sBossRemains[0]->unk_14E = 3; + } + if ((this->unk_ABC8 == 180) || (this->unk_ABC8 == 200) || (this->unk_ABC8 == 220)) { + this->unk_ABCC++; + sBossRemains[this->unk_ABCC]->unk_14E = 3; + } + this->csCamEye.x = sCameraEyes[this->unk_ABCC].x; + this->csCamEye.y = sCameraEyes[this->unk_ABCC].y; + this->csCamEye.z = sCameraEyes[this->unk_ABCC].z; + this->csCamAt.x = sCameraAts[this->unk_ABCC].x; + this->csCamAt.y = sCameraAts[this->unk_ABCC].y; + this->csCamAt.z = sCameraAts[this->unk_ABCC].z; + if (this->unk_ABC8 == 250) { + this->csState = 3; + this->unk_ABC8 = 0; + this->csCamEye.x = this->actor.world.pos.x; + this->csCamEye.y = this->actor.world.pos.y; + this->csCamEye.z = 300.0f; + 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[0], globalCtx); + func_80A04DE0(sBossRemains[1], globalCtx); + func_80A04DE0(sBossRemains[2], globalCtx); + func_80A04DE0(sBossRemains[3], globalCtx); + this->csCamSpeedMod = 0.0f; + sMajoraStatic->unk_AB44 = 0.0f; + Audio_QueueSeqCmd(0x100A00FF); + } + } + break; + case 3: + this->unk_160 = KREG(78) + 150; + if (this->unk_ABC8 >= 15) { + Math_ApproachF(&this->csCamEye.z, -700.0f, 0.4f, 100.0f); + } + if (this->unk_ABC8 >= 55) { + if (this->unk_ABC8 == 55) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_B_PAMET_BREAK); + } + this->unk_1884 = 0; + } + if (this->unk_ABC8 >= 75) { + s32 i; + Vec3f sp78 = { 0.0f, 0.0f, 0.0f }; + Vec3f sp6C = { 0.0f, -0.5f, 0.0f }; + Vec3f sp60; + + if (this->unk_ABC8 == 75) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_DEMO_WALL); + } + sp8C = 2.0f * (this->unk_ABC8 % 2); + if ((this->unk_ABC8 % 2) != 0) { + this->actor.world.pos.x += 2.0f; + } else { + this->actor.world.pos.x -= 2.0f; + } + for (i = 0; i < 3; i++) { + sp60.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(110.0f); + sp60.y = this->actor.world.pos.y + randPlusMinusPoint5Scaled(110.0f); + sp60.z = this->actor.world.pos.z + 10.0f; + EffectSsHahen_Spawn(globalCtx, &sp60, &sp78, &sp6C, 0, (Rand_ZeroOne() * 5.0f) + 10.0f, -1, 10, + NULL); + } + } + if (this->unk_ABC8 == 110) { + this->csState = 4; + this->unk_ABC8 = 0; + this->csCamEye.x = this->actor.world.pos.x + 200.0f; + this->csCamEye.y = this->actor.world.pos.y; + this->csCamEye.z = this->actor.world.pos.z + 400.0f; + player->actor.world.pos.z = 0.0f; + func_800B7298(globalCtx, &this->actor, 1); + this->unk_160 = KREG(74) + 200; + } + break; + case 4: + this->unk_1884 = 0; + if (this->unk_ABC8 >= 10) { + Math_ApproachS(&this->unk_160, KREG(72), 1, KREG(73) + 2); + if (this->unk_ABC8 == 10) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_DEMO_BREAK); + } + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_FLOAT_OLD - SFX_FLAG); + Math_ApproachF(&this->unk_1870, 1.0f, 1.0f, 0.02f); + Math_ApproachF(&this->actor.world.pos.z, -642.5f, 0.05f, 30.0f); + Math_ApproachF(&this->actor.world.pos.y, 350.0f, 0.03f, 2.0f); + if (this->unk_ABC8 == 55) { + Actor_TitleCardCreate(globalCtx, &globalCtx->actorCtx.titleCtxt, + Lib_SegmentedToVirtual(&D_0602F840), 0xA0, 0xB4, 0x80, 0x28); + } + if (this->unk_ABC8 == 30) { + Audio_QueueSeqCmd(0x806B); + } + if (this->unk_ABC8 > 100) { + Math_ApproachF(&this->csCamEye.x, player->actor.world.pos.x + 40.0f, 0.1f, this->csCamSpeedMod * 20.0f); + Math_ApproachF(&this->csCamEye.y, player->actor.world.pos.y + 10.0f, 0.1f, this->csCamSpeedMod * 20.0f); + Math_ApproachF(&this->csCamEye.z, player->actor.world.pos.z + 90.0f, 0.1f, this->csCamSpeedMod * 60.0f); + Math_ApproachF(&this->csCamSpeedMod, 1.0f, 1.0f, 0.03f); + } + if (this->unk_ABC8 == 175) { + Camera* sp5C = Play_GetCamera(globalCtx, 0); + + this->csState = 0; + func_809FFA04(this, globalCtx); + this->timers[0] = 50; + this->timers[2] = 200; + this->unk_1888 = 50; + this->unk_164.x = 0.0f; + this->unk_164.y = 200.0f; + this->unk_164.z = 0.0f; + this->unk_170 = 0.0f; + sp5C->eye = this->csCamEye; + sp5C->eyeNext = this->csCamEye; + sp5C->at = this->csCamAt; + func_80169AFC(globalCtx, this->csCamIndex, 0); + this->csCamIndex = 0; + func_800EA0EC(globalCtx, &globalCtx->csCtx); + func_800B7298(globalCtx, &this->actor, 6); + this->actor.flags |= 1; + gSaveContext.eventInf[6] |= 2; + func_80165690(); + } + } else if ((this->unk_ABC8 % 2) != 0) { + this->actor.world.pos.x += 2.0f; + } else { + this->actor.world.pos.x -= 2.0f; + } + Math_ApproachF(&this->csCamAt.x, this->actor.world.pos.x, 0.05f, 10.0f); + Math_ApproachF(&this->csCamAt.y, this->actor.world.pos.y, 0.05f, 10.0f); + Math_ApproachF(&this->csCamAt.z, this->actor.world.pos.z, 0.05f, 10.0f); + break; + } + if (this->csCamIndex != 0) { + Vec3f sp50; + + ShrinkWindow_SetLetterboxTarget(0x1B); + sp50.x = this->csCamAt.x; + sp50.y = this->csCamAt.y + sp8C; + sp50.z = this->csCamAt.z; + Play_CameraSetAtEye(globalCtx, this->csCamIndex, &sp50, &this->csCamEye); + } +} + +void func_80A025AC(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_80A0264C; + SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_0600AE40, -10.0f); + this->actor.world.rot.y = this->actor.shape.rot.y = + Math_Acot2F(-this->actor.world.pos.z, -this->actor.world.pos.x) * (0x8000 / M_PI); + this->csState = 0; + this->unk_ABC8 = 0; + this->actor.flags &= ~1; + this->unk_15C = 20; +} + +void func_80A0264C(Boss07* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + Vec3f sp60; + Vec3f sp54; + + this->unk_ABC8++; + this->unk_15C = 20; + this->unk_1884 = 1; + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + func_809F4CBC(this, 0.5f); + 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); + SysMatrix_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); + switch (this->csState) { + case 0: + if (ActorCutscene_GetCurrentIndex() == -1) { + func_800EA0D4(globalCtx, &globalCtx->csCtx); + func_800B7298(globalCtx, &this->actor, 1U); + this->csCamIndex = func_801694DC(globalCtx); + func_80169590(globalCtx, 0, 1); + func_80169590(globalCtx, this->csCamIndex, 7); + this->unk_ABC8 = 0; + this->csState = 1; + this->csCamNextAt.z = 0.0f; + this->unk_18D6 = 120; + func_8016566C(150); + this->csCamNextEye.x = 0.0f; + this->csCamNextEye.y = -30.0f; + this->csCamNextEye.z = 270.0f; + this->csCamNextAt.x = 0.0f; + this->csCamNextAt.y = -30.0f; + SysMatrix_MultiplyVector3fByState(&this->csCamNextEye, &this->csCamEye); + SysMatrix_MultiplyVector3fByState(&this->csCamNextAt, &this->csCamAt); + } else { + break; + } + case 1: + player->actor.world.pos.x = 0.0f; + player->actor.world.pos.z = BREG(87) + 250.0f; + player->actor.world.rot.y = player->actor.shape.rot.y = -0x8000; + + this->unk_1874 = 2; + if (this->unk_ABC8 > 60) { + Math_ApproachS(&this->actor.shape.rot.x, 0, 0xA, 0x200); + Math_ApproachS(&this->actor.shape.rot.z, 0, 0xA, 0x200); + Math_ApproachZeroF(&this->unk_1870, 1.0f, 0.01f); + } else { + this->actor.shape.rot.x += 0x1000; + this->actor.shape.rot.z += 0x1200; + Math_ApproachZeroF(&this->unk_1870, 1.0f, 0.005f); + } + if (this->unk_ABC8 > 130) { + this->csState = 2; + } else { + break; + } + case 2: + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BOSS_07, 0.0f, 0.0f, 0.0f, 0, this->actor.shape.rot.y, + this->csCamIndex, 20); + Actor_MarkForDeath(&this->actor); + break; + } + + SysMatrix_MultiplyVector3fByState(&this->csCamNextEye, &this->csCamEye); + SysMatrix_MultiplyVector3fByState(&this->csCamNextAt, &sp60); + Math_ApproachF(&this->csCamAt.x, sp60.x, 0.1f, 10.0f); + Math_ApproachF(&this->csCamAt.y, sp60.y, 0.1f, 10.0f); + Math_ApproachF(&this->csCamAt.z, sp60.z, 0.1f, 10.0f); + if (this->csCamIndex != 0) { + ShrinkWindow_SetLetterboxTarget(0x1B); + sp54 = this->csCamEye; + if (sp54.y < 30.0f) { + sp54.y = 30.0f; + } + Play_CameraSetAtEye(globalCtx, this->csCamIndex, &this->csCamAt, &sp54); + } +} void func_80A02B30(Boss07* this, GlobalContext* globalCtx) { Player* player = PLAYER; @@ -3921,7 +5098,7 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; s32 i; - Player* spA8 = PLAYER; + Player* player = PLAYER; Vec3f sp9C; Vec3f sp90; Vec3f sp84; @@ -3930,20 +5107,20 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { f32 sp68; this->actor.hintId = 50; - if (D_80A09A71 != 0) { - D_80A09A71--; - if (D_80A09A71 == 0) { + if (sMusicStartTimer != 0) { + sMusicStartTimer--; + if (sMusicStartTimer == 0) { Audio_QueueSeqCmd(0x806B); } } - Math_Vec3f_Copy(&D_80A09A40, &this->actor.projectedPos); - if ((D_80A09A58 == NULL) || (D_80A09A58->unk_ABD2 == 0)) { + Math_Vec3f_Copy(&sSfxPoint, &this->actor.projectedPos); + if ((sMajoraStatic == NULL) || (sMajoraStatic->csCamIndex == 0)) { this->unk_149 = 1; 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; - if (gGameInfo->data[1311] == 0) { + if (KREG(63) == 0) { this->unk_174 = 0; this->unk_1884 = 0; this->unk_1874 = 0; @@ -4004,7 +5181,7 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { SysMatrix_MultiplyVector3fByState(&sp6C, &sp78); Collider_SetQuadVertices(&this->quad1, &sp9C, &sp90, &sp84, &sp78); - sp68 = (spA8->stateFlags3 & 0x200) ? 70.0f : 40.0f; + sp68 = (player->stateFlags3 & 0x200) ? 70.0f : 40.0f; sp6C.x = -sp68; sp6C.y = sp68; sp6C.z = -10.0f; @@ -4020,7 +5197,7 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { SysMatrix_MultiplyVector3fByState(&sp6C, &sp78); Collider_SetQuadVertices(&this->quad2, &sp9C, &sp90, &sp84, &sp78); - if (spA8->stateFlags3 & 0x200) { + if (player->stateFlags3 & 0x200) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->quad2.base); } else { if ((this->actionFunc != func_80A00274) && (this->actionFunc != func_80A00554)) { @@ -4048,21 +5225,208 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { sp44.y = sp50.y * -0.05f; sp44.z = sp50.z * -0.05f; func_809F4AE8(globalCtx, &sp5C, &sp50, &sp44, Rand_ZeroFloat(10.0f) + 25.0f); - func_8019F1C0(&D_80A09A40, NA_SE_EV_BURN_OUT - SFX_FLAG); + func_8019F1C0(&sSfxPoint, NA_SE_EV_BURN_OUT - SFX_FLAG); } } } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A03238.s") +void func_80A03238(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, + Vec3f* arg6, f32 arg7, u8 arg8, f32 arg9) { + f32 temp_f20; + f32 temp_f22; + f32 temp_f24; + f32 phi_f0; + f32 phi_f2; + f32 temp_f26; + s32 i; + f32 temp1; + f32 temp2; + Vec3f sp98 = { 0.0f, 0.0f, 0.0f }; + Vec3f sp8C; + Vec3f sp80; + Vec3f* sp7C = pull; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A036C4.s") + if (this->unk_1874 != 0) { + for (i = 0; i < 10; i++) { + SysMatrix_StatePush(); + SysMatrix_InsertZRotation_f(arg9, 1); + sp98.x = Math_SinS((2 * i + this->unk_14C) * 0x1600) * 10; + sp98.y = 10.0f; + sp98.z = 0.0f; + SysMatrix_MultiplyVector3fByState(&sp98, &sp8C); + pos[i].x += sp8C.x; + pos[i].y += sp8C.y; + pos[i].z += sp8C.z; + SysMatrix_StatePop(); + } + } + for (i = 0; i < 10; i++, pull++) { + if (i == 0) { + pos[0] = *base; + } else { + Math_ApproachF(&pull->x, 0.0f, 1.0f, 1.0f); + Math_ApproachF(&pull->y, 0.0f, 1.0f, 1.0f); + Math_ApproachF(&pull->z, 0.0f, 1.0f, 1.0f); + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A03868.s") + pos++; + rot++; + pull = sp7C + 1; + sp98.x = sp98.y = 0.0f; + sp98.z = arg7 * 23.0f; + for (i = 1; i < 10; i++, pull++, pos++, rot++) { + if (i < 5) { + sp80.x = arg6->x * (5 - i) * 0.2f; + sp80.y = arg6->y * (5 - i) * 0.2f; + sp80.z = arg6->z * (5 - i) * 0.2f; + } else { + sp80 = D_801D15B0; + } + temp_f24 = pos->x + pull->x - (pos - 1)->x + sp80.x; + if (this->unk_1874 != 0) { + phi_f0 = 0.0f; + } 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_f2 = pos->y + pull->y + phi_f0 + sp80.y; + if (phi_f2 < 2.0f) { + phi_f2 = 2.0f; + } + temp_f22 = phi_f2 - (pos - 1)->y; + temp_f20 = pos->z + pull->z - (pos - 1)->z + sp80.x; + temp_f26 = Math_Acot2F(temp_f20, temp_f24); + temp2 = sqrtf(SQ(temp_f24) + SQ(temp_f20)); + temp1 = -Math_Acot2F(temp2, temp_f22); + (rot - 1)->y = temp_f26; + (rot - 1)->x = temp1; + SysMatrix_InsertYRotation_f(temp_f26, 0); + SysMatrix_RotateStateAroundXAxis(temp1); + SysMatrix_GetStateTranslationAndScaledZ(sp98.z, &sp8C); + temp_f24 = pos->x; + temp_f22 = pos->y; + temp_f20 = pos->z; + pos->x = (pos - 1)->x + sp8C.x; + pos->y = (pos - 1)->y + sp8C.y; + pos->z = (pos - 1)->z + sp8C.z; + pull->x = (pos->x - temp_f24) * 0.85f; + pull->y = (pos->y - temp_f22) * 0.85f; + pull->z = (pos->z - temp_f20) * 0.85f; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A03F18.s") +void func_80A036C4(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, f32 arg4, f32 arg5) { + s32 i; + f32 phi_f12; + + OPEN_DISPS(globalCtx->state.gfxCtx); + for (i = 0; i < 9; i++, arg2++, arg3++) { + SysMatrix_InsertTranslation(arg2->x, arg2->y, arg2->z, 0); + SysMatrix_InsertYRotation_f(arg3->y, 1); + SysMatrix_RotateStateAroundXAxis(arg3->x); + SysMatrix_InsertZRotation_f(arg5, 1); + if (i <= 4) { + phi_f12 = 0.035f; + } else { + phi_f12 = 0.035f - (i - 4) * 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); + gSPDisplayList(POLY_OPA_DISP++, D_0600B020); + } + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +void func_80A03868(Boss07* this, GlobalContext* globalCtx) { + s32 pad[4]; + + OPEN_DISPS(globalCtx->state.gfxCtx); + if (this->actionFunc == func_80A00720) { + gSPSegment(POLY_XLU_DISP++, 12, + Gfx_TexScroll(globalCtx->state.gfxCtx, 0, ((s32)this->unk_14C * -0xF) & 0xFF, 0x20, 0x40)); + gDPPipeSync(POLY_XLU_DISP++); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 60, 200); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128); + SysMatrix_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); + SysMatrix_InsertXRotation_s(this->actor.shape.rot.x, 1); + Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, 1); + SysMatrix_StatePush(); + SysMatrix_StatePush(); + SysMatrix_StatePush(); + + SysMatrix_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); + gSPDisplayList(POLY_XLU_DISP++, D_0600C7D8); + SysMatrix_StatePop(); + + SysMatrix_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); + gSPDisplayList(POLY_XLU_DISP++, D_0600C7D8); + gSPDisplayList(POLY_XLU_DISP++, D_04023348); + SysMatrix_StatePop(); + + SysMatrix_InsertTranslation(0.0f, 0.0f, 1200.0f, 1); + SysMatrix_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); + SysMatrix_InsertZRotation_s(this->unk_14C * 0x100, 1); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + 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); + SysMatrix_InsertZRotation_s(0x4000, 1); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + gSPDisplayList(POLY_XLU_DISP++, D_04023428); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 60, 200); + SysMatrix_StatePop(); + + SysMatrix_InsertTranslation(0.0f, 0.0f, 1150.0f, 1); + SysMatrix_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); + gSPDisplayList(POLY_XLU_DISP++, D_0600C7D8); + SysMatrix_GetStateTranslationAndScaledZ(20100.0f, &this->unk_18A8); + if (this->unk_18C0 > 0.0f) { + Vec3f sp50; + + SysMatrix_GetStateTranslationAndScaledZ(20000.0f, &sp50); + SysMatrix_InsertTranslation(this->unk_18A8.x, this->unk_18A8.y, this->unk_18A8.z, 0); + Matrix_RotateY(this->unk_18C6, 1); + SysMatrix_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); + gSPDisplayList(POLY_XLU_DISP++, D_0600C7D8); + + SysMatrix_GetStateTranslationAndScaledZ(20100.0f, &this->unk_18B4); + SysMatrix_InsertTranslation(sp50.x, sp50.y, sp50.z, 0); + SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); + Matrix_Scale(this->unk_1898 * 5.0f, this->unk_1898 * 5.0f, 0.0f, 1); + SysMatrix_InsertZRotation_s(this->unk_14C * 0x100, 1); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + gSPDisplayList(POLY_XLU_DISP++, D_04023348); + gSPDisplayList(POLY_XLU_DISP++, D_04023428); + } + } + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +void func_80A03F18(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + Boss07* this = THIS; + + if (limbIndex == 2) { + SysMatrix_GetStateTranslationAndScaledX(500.0f, &this->unk_1878); + } +} -#ifdef NON_MATCHING void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { + static void* D_80A082E0[2] = { D_06042330, D_06045B30 }; GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; s32 i; @@ -4070,12 +5434,13 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { f32 temp_f20; f32 temp_f22; f32 phi_f24; - f32 pad2; + + OPEN_DISPS(globalCtx->state.gfxCtx); Vec3f spA8; Vec3f sp9C; Vec3f sp90; + f32 pad2; - OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); func_8012C2DC(globalCtx->state.gfxCtx); temp_f20 = this->unk_186C * (M_PI / 4.0f) * 0.06666667f; @@ -4086,7 +5451,7 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); } gSPSegment(POLY_OPA_DISP++, 8, Lib_SegmentedToVirtual(D_80A082E0[this->unk_1884])); - SkelAnime_Draw(globalCtx, this->skelAnime1.skeleton, this->skelAnime1.limbDrawTbl, NULL, func_80A03F18, + SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, NULL, func_80A03F18, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); gSPDisplayList(POLY_OPA_DISP++, D_0600AFB0); @@ -4110,17 +5475,17 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { SysMatrix_StatePush(); SysMatrix_InsertZRotation_f(phi_f24, 1); SysMatrix_MultiplyVector3fByState(&spA8, &sp9C); - this->unk_19F0[i].unk_0.x = this->unk_1878.x + sp9C.x; - this->unk_19F0[i].unk_0.y = this->unk_1878.y + sp9C.y; - this->unk_19F0[i].unk_0.z = this->unk_1878.z + sp9C.z; + this->tentacles[i].base.x = this->unk_1878.x + sp9C.x; + this->tentacles[i].base.y = this->unk_1878.y + sp9C.y; + this->tentacles[i].base.z = this->unk_1878.z + sp9C.z; pad2 = (1 - (i * 0.008f)) * this->unk_1870; SysMatrix_StatePop(); if (this->unk_149 != 0) { - func_80A03238(this, globalCtx, &this->unk_19F0[i].unk_0, this->unk_19F0[i].unk_C, this->unk_19F0[i].unk_84, - this->unk_19F0[i].unk_FC, &sp90, pad2, phi_s6, phi_f24); + func_80A03238(this, globalCtx, &this->tentacles[i].base, this->tentacles[i].pos, this->tentacles[i].rot, + this->tentacles[i].pull, &sp90, pad2, phi_s6, phi_f24); } - func_80A036C4(this, globalCtx, this->unk_19F0[i].unk_C, this->unk_19F0[i].unk_84, pad2, i * 0.9f); + func_80A036C4(this, globalCtx, this->tentacles[i].pos, this->tentacles[i].rot, pad2, i * 0.9f); phi_f24 += 0.5f; spA8.y += 1.0f; @@ -4130,11 +5495,7 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { this->unk_149 = 0; CLOSE_DISPS(globalCtx->state.gfxCtx); } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Mask_Draw.s") -#endif -#ifdef NON_MATCHING void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx2) { s32 i; f32 sp58; @@ -4142,13 +5503,14 @@ void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx2) { f32 sp50; GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; + f32 pad; Player* player = PLAYER; this->unk_14C++; if (this->actor.params == 100) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_BEAM - SFX_FLAG); } - if (gGameInfo->data[1311] == 0) { + if (KREG(63) == 0) { Actor_SetScale(&this->actor, 3.5f); if (this->unk_14E == 0) { sp58 = player->actor.world.pos.x - this->actor.world.pos.x; @@ -4156,7 +5518,8 @@ void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx2) { sp50 = player->actor.world.pos.z - this->actor.world.pos.z; this->actor.world.rot.y = Math_Atan2S(sp58, sp50); - this->actor.world.rot.x = Math_Atan2S(sp54, sqrtf(SQ(sp58) + SQ(sp50))); + pad = sqrtf(SQ(sp58) + SQ(sp50)); + this->actor.world.rot.x = Math_Atan2S(sp54, pad); this->unk_14E = 1; this->actor.speedXZ = 30.0f; func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); @@ -4183,9 +5546,6 @@ void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx2) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Projectile_Update.s") -#endif void Boss07_Projectile_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; @@ -4208,28 +5568,296 @@ void Boss07_Projectile_Draw(Actor* thisx, GlobalContext* globalCtx2) { CLOSE_DISPS(globalCtx->state.gfxCtx); } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A04768.s") +void func_80A04768(Boss07* this, GlobalContext* globalCtx) { + Vec3f sp2C; + ColliderInfo* hitbox; + + if ((this->unk_15C == 0) && (this->cyl2.base.acFlags & 2)) { + this->cyl2.base.acFlags &= ~2; + this->unk_15C = 15; + hitbox = this->cyl2.info.acHitInfo; + if (hitbox->toucher.dmgFlags & 0x80) { + func_80A055E0(this, globalCtx); + } else { + u8 damage = this->actor.colChkInfo.damage; + + this->actor.colChkInfo.health -= damage; + this->unk_15E = 15; + this->actionFunc = func_80A04E5C; + if ((s8)this->actor.colChkInfo.health <= 0) { + this->unk_14E = 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->timers[0] = 0xF; + func_809F4980(&this->actor); + } + Matrix_RotateY(this->actor.yawTowardsPlayer, 0); + SysMatrix_GetStateTranslationAndScaledZ(-20.0f, &sp2C); + this->unk_18CC = sp2C.x; + this->unk_18D0 = sp2C.z; + } + } +} void func_80A04878(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_80A04890; } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A04890.s") +void func_80A04890(Boss07* this, GlobalContext* globalCtx) { + f32 sp54; + f32 sp50; + f32 sp4C; + f32 phi_f2; + s32 pad; + f32 sp40; + f32 sp3C; + f32 sp38; + f32 sp34; + s16 sp32; + s16 sp30; + Player* player = PLAYER; + + switch (this->unk_14E) { + 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) { + this->actor.world.pos.y += 30.0f + KREG(48); + } + this->unk_164.x = sRemainsStart[this->actor.params - 200].x + player->actor.world.pos.x; + this->unk_164.y = sRemainsStart[this->actor.params - 200].y + player->actor.world.pos.y; + this->unk_164.z = sRemainsStart[this->actor.params - 200].z + player->actor.world.pos.z; + sp54 = this->unk_164.x - this->actor.world.pos.x; + sp50 = this->unk_164.y - this->actor.world.pos.y; + sp4C = this->unk_164.z - this->actor.world.pos.z; + this->actor.world.rot.y = Math_Atan2S(sp54, sp4C); + this->actor.world.rot.x = Math_Atan2S(sp50, sqrtf(SQ(sp54) + SQ(sp4C))); + this->unk_AB40 = Rand_ZeroFloat(100.0f); + break; + case 1: + this->unk_ABC8++; + this->unk_AB40++; + this->unk_18C8 += 0x200; + Math_ApproachF(&this->unk_188C, 1.2f, 1.0f, 0.1f); + Math_ApproachF(&this->actor.scale.x, 0.004f, 0.5f, 0.0002f); + this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; + if (this->unk_ABC8 > 90) { + this->unk_164.x = sRemainsEnd[this->actor.params - 200].x; + this->unk_164.y = 370.0f; + this->unk_164.z = sRemainsEnd[this->actor.params - 200].z; + sp38 = 20.0f; + sp34 = 0.5f; + sp40 = 4096.0f; + sp3C = 400.0f; + phi_f2 = 0.0f; + } else { + phi_f2 = Math_SinS(this->unk_AB40 * 0x300) * 20.0f; + sp38 = 1.0f; + sp34 = 0.1f; + sp40 = 1500.0f; + sp3C = 100.0f; + } + sp54 = this->unk_164.x - this->actor.world.pos.x; + sp50 = this->unk_164.y - this->actor.world.pos.y + phi_f2; + sp4C = this->unk_164.z - this->actor.world.pos.z; + sp30 = Math_Atan2S(sp54, sp4C); + sp32 = Math_Atan2S(sp50, sqrtf(SQ(sp54) + SQ(sp4C))); + Math_ApproachS(&this->actor.world.rot.y, sp30, 5, this->unk_170); + Math_ApproachS(&this->actor.world.rot.x, sp32, 5, this->unk_170); + Math_ApproachF(&this->unk_170, sp40, 1.0f, sp3C); + Math_ApproachF(&this->actor.speedXZ, sp38, 1.0f, sp34); + Actor_SetVelocityXYRotation(&this->actor); + Actor_ApplyMovement(&this->actor); + this->actor.shape.rot = this->actor.world.rot; + break; + case 2: + Actor_SetScale(&this->actor, 0.0f); + this->unk_188C = 0.0f; + this->actor.speedXZ = 0.0f; + this->actor.world.pos.x = sRemainsEnd[this->actor.params - 200].x * 0.6f; + this->actor.world.pos.y = 370.0f; + this->actor.world.pos.z = sRemainsEnd[this->actor.params - 200].z * 0.6f; + this->actor.shape.rot.y = sRemainsEnd[this->actor.params - 200].y; + this->unk_ABCC = 0; + break; + case 3: + this->unk_ABCC++; + if (this->unk_ABCC == 10) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_STAY); + } + Actor_SetScale(&this->actor, 0.03f); + Math_ApproachF(&this->actor.world.pos.x, sRemainsEnd[this->actor.params - 200].x, 0.5f, 40.0f); + Math_ApproachF(&this->actor.world.pos.z, sRemainsEnd[this->actor.params - 200].z, 0.5f, 22.0f); + break; + } +} void func_80A04DE0(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_80A04E5C; this->actor.gravity = -0.75f; ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 40.0f); - Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &D_80A07EA4); + Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &sRemainsCylInit); this->actor.colChkInfo.health = 5; this->unk_14E = 0; } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A04E5C.s") +void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { + s16 sp7E; + s16 sp7C; + f32 sp78; + f32 sp74; + f32 sp70; + s32 pad; + Vec3f sp60; + Vec3f sp54; + Vec3f sp48; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A055E0.s") + switch (this->unk_14E) { + case 20: + Audio_PlayActorSound2(&this->actor, NA_SE_EV_MUJURA_FOLLOWERS_FLY - SFX_FLAG); + this->timers[0] = 80; + this->timers[2] = 100.0f + Rand_ZeroFloat(100.0f); + this->unk_18C = 5.0f; + 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->unk_1888 = 100; + this->cyl2.base.colType = 3; + this->actor.flags |= 0x201; + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_DEMO_BREAK); + break; + case 1: + Audio_PlayActorSound2(&this->actor, NA_SE_EV_MUJURA_FOLLOWERS_FLY - SFX_FLAG); + if (this->timers[2] == 0) { + this->unk_18DB = 1; + this->timers[2] = Rand_ZeroFloat(200.0f) + 100.0f; + } + if (this->timers[0] == 0) { + if (Rand_ZeroOne() < 0.35f) { + this->unk_18C = 1.0f; + this->timers[0] = Rand_ZeroFloat(50.0f) + 30.0f; + } else { + func_809F4D10(&this->unk_164, 500.0f); + this->unk_164.y = Rand_ZeroFloat(350.0f) + 100.0f; + this->timers[0] = Rand_ZeroFloat(50.0f) + 20.0f; + this->unk_170 = 0.0f; + this->unk_18C = Rand_ZeroFloat(5.0f) + 5.0f; + } + } + sp78 = this->unk_164.x - this->actor.world.pos.x; + sp74 = this->unk_164.y - this->actor.world.pos.y; + sp70 = this->unk_164.z - this->actor.world.pos.z; + sp7C = Math_Atan2S(sp78, sp70); + sp7E = Math_Atan2S(sp74, sqrtf((sp78 * sp78) + (sp70 * sp70))); + sp7E += (s16)(Math_SinS(this->unk_14C * 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); + Math_ApproachF(&this->actor.speedXZ, this->unk_18C, 1.0f, 1.0f); + if ((this->unk_18C < 8.0f) && (func_801690CC(globalCtx) == 0)) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); + } else { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0xA, 0x1000); + } + Actor_SetVelocityXYRotation(&this->actor); + Actor_ApplyMovement(&this->actor); + if (this->unk_1888 == 0) { + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 100.0f, 100.0f, 5); + } else { + this->unk_1888--; + } + func_80A04768(this, globalCtx); + break; + case 2: + Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 1, 0x500); + Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 100.0f, 100.0f, 5); + if (this->actor.bgCheckFlags & 1) { + if (this->unk_18DA != 0) { + this->unk_18D6 |= 4; + } + Math_ApproachF(&this->actor.scale.z, 0.0f, 1.0f, 0.001f); + if (this->actor.scale.z == 0.0f) { + this->unk_14E = 3; + this->actor.draw = NULL; + this->actor.flags &= ~1; + } + func_809F4CBC(this, 2.0f); + } else { + this->actor.shape.rot.z += 0x200; + } + break; + case 10: + Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + this->actor.world.pos.y -= 50.0f; + this->actor.prevPos.y -= 50.0f; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 5); + this->actor.world.pos.y += 50.0f; + this->actor.prevPos.y += 50.0f; + if (this->timers[0] == 0) { + this->unk_14E = 1; + } + break; + case 0: + break; + } + if (this->unk_14E < 2) { + Collider_UpdateCylinder(&this->actor, &this->cyl2); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); + } + if (this->unk_18DB != 0) { + this->unk_18DB = 0; + if ((func_809F4C40(this, globalCtx) != 0) && (sMajorasMask->actionFunc != func_80A00720)) { + 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, 100); + } + } + if (this->unk_18D6 != 0) { + sp60.x = randPlusMinusPoint5Scaled(80.0f) + this->actor.world.pos.x; + sp60.z = randPlusMinusPoint5Scaled(80.0f) + this->actor.world.pos.z; + if (this->unk_18DA != 0) { + sp48.x = sp48.z = 0.0f; + sp48.y = 0.03f; + sp60.y = Rand_ZeroFloat(10.0f) + this->actor.world.pos.y; + EffectSsKFire_Spawn(globalCtx, &sp60, &D_801D15B0, &sp48, Rand_ZeroFloat(30.0f) + 30.0f, 0); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); + } else { + sp60.y = (Rand_ZeroFloat(30.0f) + this->actor.world.pos.y) - 15.0f; + sp54.x = 0.0f; + sp54.y = 5.0f; + sp54.z = 0.0f; + sp48.x = sp54.x * -0.05f; + sp48.y = sp54.y * -0.05f; + sp48.z = sp54.z * -0.05f; + func_809F4AE8(globalCtx, &sp60, &sp54, &sp48, Rand_ZeroFloat(10.0f) + 25.0f); + Audio_PlayActorSound2(&this->actor, NA_SE_EV_BURN_OUT - SFX_FLAG); + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A05608.s") +void func_80A055E0(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_80A05608; + this->timers[0] = 50; + this->actor.speedXZ = 0.0f; +} + +void func_80A05608(Boss07* this, GlobalContext* globalCtx) { + func_80A04768(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; + } +} void Boss07_Remains_Update(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; @@ -4314,67 +5942,172 @@ void func_80A05AF8(Boss07* this, GlobalContext* globalCtx) { this->timers[0] = 200; } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A05B50.s") +void func_80A05B50(Boss07* this, GlobalContext* globalCtx) { + if (sMajorasWrath->actionFunc == func_809F8EC8) { + 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); + } else if (this->actor.bgCheckFlags & 8) { + func_80A05C88(this, globalCtx); + this->actor.speedXZ = -15.0f; + CollisionCheck_SpawnShieldParticles(globalCtx, &this->actor.focus.pos); + Audio_PlayActorSound2(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A05C88.s") +void func_80A05C88(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = func_80A05DDC; + this->actor.gravity = -2.0f; + if (sMajorasWrath->unk_15C != 0) { + this->timers[0] = sREG(47) + 80; + this->timers[1] = sREG(77) + 150; + } else { + this->timers[0] = sREG(47) + 300; + this->timers[1] = sREG(77) + 370; + this->actor.velocity.y = (sREG(43) * 0.1f) + 15.0f; + this->actor.speedXZ = (sREG(44) * 0.1f) + -3.0f; + } + this->actor.world.rot.y = (sREG(45) * 0x1000) + sMajorasWrath->actor.shape.rot.y; + this->actor.shape.rot.z = Rand_ZeroFloat((sREG(29) + 10) * 256.0f); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_80A05DDC.s") +void func_80A05DDC(Boss07* this, GlobalContext* globalCtx) { + f32 sp4C; + f32 sp48; + + func_8019FAD8(&this->actor.projectedPos, NA_SE_EN_LAST3_KOMA_OLD - SFX_FLAG, this->unk_17C * 1.1111112f); + Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + this->actor.world.pos.x += this->unk_18CC; + this->actor.world.pos.z += this->unk_18D0; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 40.0f, 40.0f, 80.0f, 5); + if ((this->unk_158 == 0) && (this->actor.bgCheckFlags & 8)) { + this->unk_158 = 10; + if (this->unk_17C > 0.01f) { + if (this->unk_17C < 0.45f) { + this->actor.speedXZ *= -1.0f; + } else { + this->actor.speedXZ = -10.0f; + } + CollisionCheck_SpawnShieldParticles(globalCtx, &this->actor.focus.pos); + Audio_PlayActorSound2(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW); + } + } + if (this->actor.bgCheckFlags & 1) { + if (this->timers[0] < (s16)(sREG(24) + 70)) { + if (this->timers[0] >= (s16)(sREG(25) + 35)) { + Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, (sREG(17) * 0.01f) + 0.1f); + Math_ApproachS(&this->actor.shape.rot.z, (sREG(19) * 0x800) + 0x2000, 1, sREG(18) + 416); + Math_ApproachZeroF(&this->unk_17C, 1.0f, (sREG(16) * 0.0001f) + 0.005f); + Math_ApproachS(&this->unk_180, (sREG(20) * 0x800) + 0x2000, 1, (sREG(21) * 16) + 192); + } else if (this->timers[0] == 0) { + Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, (sREG(26) * 0.01f) + 0.5f); + Math_ApproachS(&this->actor.shape.rot.z, (sREG(19) * 0x800) + 0x2000, 1, 0x800); + Math_ApproachZeroF(&this->unk_17C, 1.0f, (sREG(27) * 0.001f) + 0.024f); + Math_ApproachS(&this->unk_180, 0, 2, sREG(28) + 106); + } else { + Math_ApproachF(&this->actor.speedXZ, sREG(22) + 10.0f, 1.0f, (sREG(23) * 0.01f) + 0.6f); + Math_ApproachS(&this->actor.shape.rot.z, (sREG(19) * 0x800) + 0x2000, 1, sREG(18) + 1040); + Math_ApproachZeroF(&this->unk_17C, 1.0f, (sREG(16) * 0.0001f) + 0.005f); + Math_ApproachS(&this->unk_180, (sREG(29) * 0x800) - 0x800, 1, (sREG(30) * 16) + 832); + } + this->actor.world.rot.y += this->unk_180; + } else { + Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x300); + Math_ApproachF(&this->actor.speedXZ, (sREG(48) * 0.1f) + 2.0f + 8.0f, 1.0f, + (sREG(46) * 0.01f) + 0.100000024f + 0.2f); + } + Math_ApproachZeroF(&this->unk_18CC, 1.0f, 1.0f); + Math_ApproachZeroF(&this->unk_18D0, 1.0f, 1.0f); + if (this->actor.velocity.y < (sREG(40) + -2.0f)) { + this->actor.velocity.y *= -(0.5f + (sREG(41) * 0.01f)); + Audio_PlayActorSound2(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW); + CollisionCheck_SpawnShieldParticles(globalCtx, &this->actor.world.pos); + this->actor.speedXZ *= 0.5f + (sREG(57) * 0.01f); + } else { + this->actor.velocity.y = -0.5f; + } + sp4C = this->actor.prevPos.x - this->actor.world.pos.x; + 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; + func_800AEF44(Effect_GetParams(this->effectIndex)); + } + this->actor.shape.rot.y = this->actor.world.rot.y; + if (this->timers[1] == 0) { + EnBom* bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.world.pos.x, + this->actor.world.pos.y + 25.0f, this->actor.world.pos.z, 0, 0, 0, 0); + + if (bomb != NULL) { + bomb->timer = 0; + } + Actor_MarkForDeath(&this->actor); + } else if (this->timers[1] == 25) { + this->unk_15E = 25; + func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, 3); + } +} void func_80A06500(Boss07* this, GlobalContext* globalCtx) { s32 i; - Boss07* phi_a2; + Boss07* top; f32 dx; f32 dy; f32 dz; if (this->unk_158 == 0) { - phi_a2 = (Boss07*)globalCtx->actorCtx.actorList[ACTORCAT_BOSS].first; + top = (Boss07*)globalCtx->actorCtx.actorList[ACTORCAT_BOSS].first; - while (phi_a2 != NULL) { - if ((this != phi_a2) && (phi_a2->actor.params == 180) && (phi_a2->unk_158 == 0)) { - dx = phi_a2->actor.world.pos.x - this->actor.world.pos.x; - dy = phi_a2->actor.world.pos.y - this->actor.world.pos.y; - dz = phi_a2->actor.world.pos.z - this->actor.world.pos.z; + while (top != NULL) { + if ((this != top) && (top->actor.params == 180) && (top->unk_158 == 0)) { + dx = top->actor.world.pos.x - this->actor.world.pos.x; + dy = top->actor.world.pos.y - this->actor.world.pos.y; + dz = top->actor.world.pos.z - this->actor.world.pos.z; - if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < (gGameInfo->data[1564] + 50.0f)) { - phi_a2->unk_158 = this->unk_158 = 10; + if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < (sREG(28) + 50.0f)) { + top->unk_158 = this->unk_158 = 10; this->actor.world.rot.y = Math_Atan2S(dx, dz); - phi_a2->actor.world.rot.y = this->actor.world.rot.y + 0x7FFF; + top->actor.world.rot.y = this->actor.world.rot.y + 0x7FFF; if (this->timers[0] > 0) { this->actor.speedXZ = -10.0f; } else { this->actor.speedXZ = -5.0f; - this->unk_17C = (gGameInfo->data[1625] * 0.01f) + 0.2f; + this->unk_17C = (sREG(89) * 0.01f) + 0.2f; this->unk_180 = 0x800; } - if (phi_a2->timers[0] > 0) { - phi_a2->actor.speedXZ = -10.0f; + if (top->timers[0] > 0) { + top->actor.speedXZ = -10.0f; } else { - phi_a2->actor.speedXZ = -5.0f; - phi_a2->unk_17C = (gGameInfo->data[1625] * 0.01f) + 0.2f; - phi_a2->unk_180 = 0x800; + top->actor.speedXZ = -5.0f; + top->unk_17C = (sREG(89) * 0.01f) + 0.2f; + top->unk_180 = 0x800; } CollisionCheck_SpawnShieldParticles(globalCtx, &this->actor.focus.pos); - CollisionCheck_SpawnShieldParticles(globalCtx, &phi_a2->actor.focus.pos); + CollisionCheck_SpawnShieldParticles(globalCtx, &top->actor.focus.pos); if (this->timers[0] > 80) { - this->actor.shape.rot.z = randPlusMinusPoint5Scaled((gGameInfo->data[1565] + 20) * 256.0f); + this->actor.shape.rot.z = randPlusMinusPoint5Scaled((sREG(29) + 20) * 256.0f); for (i = 0; i < 5; i++) { DECR(this->timers[0]); DECR(this->timers[1]); } } - if (phi_a2->timers[0] > 80) { - phi_a2->actor.shape.rot.z = randPlusMinusPoint5Scaled((gGameInfo->data[1565] + 20) * 256.0f); + if (top->timers[0] > 80) { + top->actor.shape.rot.z = randPlusMinusPoint5Scaled((sREG(29) + 20) * 256.0f); for (i = 0; i < 5; i++) { - DECR(phi_a2->timers[0]); - DECR(phi_a2->timers[1]); + DECR(top->timers[0]); + DECR(top->timers[1]); } } Audio_PlayActorSound2(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW); return; } } - phi_a2 = (Boss07*)phi_a2->actor.next; + top = (Boss07*)top->actor.next; } } } @@ -4399,9 +6132,9 @@ void func_80A06990(Boss07* this, GlobalContext* globalCtx) { if (player->transformation == 0) { this->actor.speedXZ = -30.0f; this->actor.velocity.y = 10.0f; - if ((s16)(gGameInfo->data[1583] + 100) < this->timers[0]) { - this->timers[0] = gGameInfo->data[1583] + 100; - this->timers[1] = gGameInfo->data[1613] + 170; + if ((s16)(sREG(47) + 100) < this->timers[0]) { + this->timers[0] = sREG(47) + 100; + this->timers[1] = sREG(77) + 170; } } else if (this->actor.colChkInfo.damageEffect == 10) { this->actor.speedXZ = -15.0f; @@ -4417,7 +6150,7 @@ void func_80A06990(Boss07* this, GlobalContext* globalCtx) { this->actor.world.rot.y = Math_Atan2S(this->cyl2.base.ac->world.pos.x - this->actor.world.pos.x, this->cyl2.base.ac->world.pos.z - this->actor.world.pos.z); this->actor.speedXZ = -20.0f; - this->actor.velocity.y = gGameInfo->data[1591] + 15.0f; + this->actor.velocity.y = sREG(55) + 15.0f; sp38 = 1; } } @@ -4425,12 +6158,12 @@ void func_80A06990(Boss07* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 1) { if ((func_800B64FC(globalCtx, 5.0f, &this->actor.world.pos, &sp3C) >= 0.0f) && (sp3C == 0)) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - this->actor.velocity.y = gGameInfo->data[1591] + 25.0f; + this->actor.velocity.y = sREG(55) + 25.0f; sp38 = 1; } } if (sp38 && (this->timers[0] > 90)) { - this->actor.shape.rot.z = randPlusMinusPoint5Scaled((gGameInfo->data[1565] + 30) * 256.0f); + this->actor.shape.rot.z = randPlusMinusPoint5Scaled((sREG(29) + 30) * 256.0f); this->timers[0] = Rand_ZeroFloat(10.0f) + 70.0f; this->timers[1] = this->timers[0] + 70; } @@ -4458,7 +6191,7 @@ void Boss07_Top_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->unk_178 < -2.0f * M_PI) { this->unk_178 += 2.0f * M_PI; } - if (D_80A09A54->actionFunc == func_809F65F4) { + if (sMajorasWrath->actionFunc == func_809F65F4) { Actor_MarkForDeath(&this->actor); } Math_ApproachF(&this->actor.scale.x, (sREG(77) * 0.001f) + 0.06f, 1.0f, 0.012f); @@ -4486,14 +6219,15 @@ void Boss07_Top_Draw(Actor* thisx, GlobalContext* globalCtx2) { } #ifdef NON_MATCHING +// reordering in sHeartbeatTimer-- void Boss07_Effects_Update(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; func_80A07638(globalCtx); - if (D_80A09A4C != 0) { - D_80A09A4C--; + if (sHeartbeatTimer != 0) { + sHeartbeatTimer--; play_sound(NA_SE_EN_LAST2_HEARTBEAT_OLD - SFX_FLAG); } if (this->unk_1808 != 0) { @@ -4507,10 +6241,10 @@ void Boss07_Effects_Update(Actor* thisx, GlobalContext* globalCtx2) { D_801F4E32 = 0; } this->unk_ABC8++; - switch (this->unk_ABD0) { + switch (this->csState) { case 0: - if ((D_80A09A5C != NULL) && (D_80A09A5C->unk_774 != 0)) { - this->unk_ABD0 = 1; + if ((sMajorasMask != NULL) && (sMajorasMask->unk_774 != 0)) { + this->csState = 1; this->unk_ABC8 = 0; } break; @@ -4518,111 +6252,111 @@ void Boss07_Effects_Update(Actor* thisx, GlobalContext* globalCtx2) { if (ActorCutscene_GetCurrentIndex() == -1) { func_800EA0D4(globalCtx, &globalCtx->csCtx); func_800B7298(globalCtx, &this->actor, 7); - this->unk_ABD2 = func_801694DC(globalCtx); + this->csCamIndex = func_801694DC(globalCtx); func_80169590(globalCtx, 0, 1); - func_80169590(globalCtx, this->unk_ABD2, 7); + func_80169590(globalCtx, this->csCamIndex, 7); this->unk_ABC8 = 0; - this->unk_ABD0 = 2; + this->csState = 2; func_8016566C(150); - this->unk_ABD4.x = D_80A09A60[0]->actor.world.pos.x * 0.7f; - this->unk_ABD4.y = D_80A09A60[0]->actor.world.pos.y * 0.7f; - this->unk_ABD4.z = D_80A09A60[0]->actor.world.pos.z * 0.7f; + this->csCamEye.x = sBossRemains[0]->actor.world.pos.x * 0.7f; + this->csCamEye.y = sBossRemains[0]->actor.world.pos.y * 0.7f; + this->csCamEye.z = sBossRemains[0]->actor.world.pos.z * 0.7f; } else { break; } case 2: if (this->unk_ABC8 == 20) { - D_80A09A60[0]->unk_14E = 20; + sBossRemains[0]->unk_14E = 20; } - this->unk_ABE0.x = D_80A09A60[0]->actor.world.pos.x; - this->unk_ABE0.y = D_80A09A60[0]->actor.world.pos.y; - this->unk_ABE0.z = D_80A09A60[0]->actor.world.pos.z; + this->csCamAt.x = sBossRemains[0]->actor.world.pos.x; + this->csCamAt.y = sBossRemains[0]->actor.world.pos.y; + this->csCamAt.z = sBossRemains[0]->actor.world.pos.z; if (this->unk_ABC8 == 40) { - this->unk_ABD0 = 3; + this->csState = 3; this->unk_ABC8 = 0; - this->unk_ABD4.x = D_80A09A60[1]->actor.world.pos.x * 0.7f; - this->unk_ABD4.y = D_80A09A60[1]->actor.world.pos.y * 0.7f; - this->unk_ABD4.z = D_80A09A60[1]->actor.world.pos.z * 0.7f; + this->csCamEye.x = sBossRemains[1]->actor.world.pos.x * 0.7f; + this->csCamEye.y = sBossRemains[1]->actor.world.pos.y * 0.7f; + this->csCamEye.z = sBossRemains[1]->actor.world.pos.z * 0.7f; } else { break; } case 3: if (this->unk_ABC8 == 20) { - D_80A09A60[1]->unk_14E = 20; + sBossRemains[1]->unk_14E = 20; } - this->unk_ABE0.x = D_80A09A60[1]->actor.world.pos.x; - this->unk_ABE0.y = D_80A09A60[1]->actor.world.pos.y; - this->unk_ABE0.z = D_80A09A60[1]->actor.world.pos.z; + this->csCamAt.x = sBossRemains[1]->actor.world.pos.x; + this->csCamAt.y = sBossRemains[1]->actor.world.pos.y; + this->csCamAt.z = sBossRemains[1]->actor.world.pos.z; if (this->unk_ABC8 == 40) { - this->unk_ABD0 = 4; + this->csState = 4; this->unk_ABC8 = 0; - this->unk_ABD4.x = D_80A09A60[2]->actor.world.pos.x * 0.7f; - this->unk_ABD4.y = D_80A09A60[2]->actor.world.pos.y * 0.7f; - this->unk_ABD4.z = D_80A09A60[2]->actor.world.pos.z * 0.7f; + this->csCamEye.x = sBossRemains[2]->actor.world.pos.x * 0.7f; + this->csCamEye.y = sBossRemains[2]->actor.world.pos.y * 0.7f; + this->csCamEye.z = sBossRemains[2]->actor.world.pos.z * 0.7f; } else { break; } case 4: if (this->unk_ABC8 == 20) { - D_80A09A60[2]->unk_14E = 20; + sBossRemains[2]->unk_14E = 20; } - this->unk_ABE0.x = D_80A09A60[2]->actor.world.pos.x; - this->unk_ABE0.y = D_80A09A60[2]->actor.world.pos.y; - this->unk_ABE0.z = D_80A09A60[2]->actor.world.pos.z; + this->csCamAt.x = sBossRemains[2]->actor.world.pos.x; + this->csCamAt.y = sBossRemains[2]->actor.world.pos.y; + this->csCamAt.z = sBossRemains[2]->actor.world.pos.z; if (this->unk_ABC8 == 40) { - this->unk_ABD0 = 5; + this->csState = 5; this->unk_ABC8 = 0; - this->unk_ABD4.x = D_80A09A60[3]->actor.world.pos.x * 0.7f; - this->unk_ABD4.y = D_80A09A60[3]->actor.world.pos.y * 0.7f; - this->unk_ABD4.z = D_80A09A60[3]->actor.world.pos.z * 0.7f; + this->csCamEye.x = sBossRemains[3]->actor.world.pos.x * 0.7f; + this->csCamEye.y = sBossRemains[3]->actor.world.pos.y * 0.7f; + this->csCamEye.z = sBossRemains[3]->actor.world.pos.z * 0.7f; } else { break; } case 5: if (this->unk_ABC8 == 20) { - D_80A09A60[3]->unk_14E = 20; + sBossRemains[3]->unk_14E = 20; } - this->unk_ABE0.x = D_80A09A60[3]->actor.world.pos.x; - this->unk_ABE0.y = D_80A09A60[3]->actor.world.pos.y; - this->unk_ABE0.z = D_80A09A60[3]->actor.world.pos.z; + this->csCamAt.x = sBossRemains[3]->actor.world.pos.x; + this->csCamAt.y = sBossRemains[3]->actor.world.pos.y; + this->csCamAt.z = sBossRemains[3]->actor.world.pos.z; if (this->unk_ABC8 == 40) { Camera* temp_v0_3 = Play_GetCamera(globalCtx, 0); s32 i; - this->unk_ABD0 = 6; + this->csState = 6; this->unk_ABC8 = 0; - temp_v0_3->eye = this->unk_ABD4; - temp_v0_3->eyeNext = this->unk_ABD4; - temp_v0_3->at = this->unk_ABE0; - func_80169AFC(globalCtx, this->unk_ABD2, 0); - this->unk_ABD2 = 0; + temp_v0_3->eye = this->csCamEye; + temp_v0_3->eyeNext = this->csCamEye; + temp_v0_3->at = this->csCamAt; + func_80169AFC(globalCtx, this->csCamIndex, 0); + this->csCamIndex = 0; func_800EA0EC(globalCtx, &globalCtx->csCtx); func_800B7298(globalCtx, &this->actor, 6); func_80165690(); for (i = 0; i < 4; i++) { - func_800BC154(globalCtx, &globalCtx->actorCtx, &D_80A09A60[i]->actor, 5); + func_800BC154(globalCtx, &globalCtx->actorCtx, &sBossRemains[i]->actor, 5); } } break; case 6: break; } - if (this->unk_ABD2 != 0) { + if (this->csCamIndex != 0) { if (this->unk_ABC8 < 20) { s32 j; for (j = 0; j < 4; j++) { - if ((this->unk_ABC8 & 1) != 0) { - D_80A09A60[j]->actor.world.pos.x += 2.0f; - D_80A09A60[j]->actor.world.pos.z += 2.0f; + if ((this->unk_ABC8 % 2) != 0) { + sBossRemains[j]->actor.world.pos.x += 2.0f; + sBossRemains[j]->actor.world.pos.z += 2.0f; } else { - D_80A09A60[j]->actor.world.pos.x -= 2.0f; - D_80A09A60[j]->actor.world.pos.z -= 2.0f; + sBossRemains[j]->actor.world.pos.x -= 2.0f; + sBossRemains[j]->actor.world.pos.z -= 2.0f; } } } ShrinkWindow_SetLetterboxTarget(27); - Play_CameraSetAtEye(globalCtx, this->unk_ABD2, &this->unk_ABE0, &this->unk_ABD4); + Play_CameraSetAtEye(globalCtx, this->csCamIndex, &this->csCamAt, &this->csCamEye); } } #else 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 dddafe1d1..46b9d5ab2 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -8,23 +8,23 @@ struct Boss07; typedef void (*Boss07ActionFunc)(struct Boss07*, GlobalContext*); typedef struct { - Vec3f unk_0; - Vec3f unk_C[10]; - Vec3f unk_84[10]; - Vec3f unk_FC[10]; + Vec3f base; + Vec3f pos[10]; + Vec3f rot[10]; + Vec3f pull[10]; } Boss07Tentacle; // size = 0x174 typedef struct { - Vec3s unk_0; - f32 unk_8; - f32 unk_C; - f32 unk_10; - f32 unk_14; - Vec3f unk_18; - Vec3f unk_24[50]; - Vec3f unk_27C[50]; - Vec3f unk_4D4[50]; - f32 unk_72C[50]; + Vec3s baseRot; + f32 gravity; + f32 stiffness; + f32 drag; + f32 tension; + Vec3f basePos; + Vec3f pos[50]; + Vec3f rot[50]; + Vec3f pull[50]; + f32 unk_72C[50]; // unused, probably a stretch factor } Boss07Whip; // size = 0x7F4 typedef struct Boss07 { @@ -54,14 +54,14 @@ typedef struct Boss07 { /* 0x0184 */ f32 unk_184; /* 0x0188 */ f32 unk_188; /* 0x018C */ f32 unk_18C; - /* 0x0190 */ SkelAnime skelAnime1; + /* 0x0190 */ SkelAnime skelAnime; /* 0x01D4 */ f32 unk_1D4; /* 0x01D8 */ s32 unk_1D8; /* 0x01DC */ Vec3s jointTable1[28]; /* 0x0284 */ Vec3s morphTable1[28]; /* 0x032C */ f32 unk_32C; /* 0x0330 */ f32 unk_330; - /* 0x0334 */ Vec3f unk_334[15]; + /* 0x0334 */ Vec3f bodyPartsPos[15]; /* 0x03E8 */ ColliderJntSph sph1; /* 0x0408 */ ColliderJntSphElement sphElems1[11]; /* 0x06C8 */ ColliderJntSph sph2; @@ -69,39 +69,21 @@ typedef struct Boss07 { /* 0x0728 */ ColliderCylinder cyl1; /* 0x0774 */ u8 unk_774; /* 0x0778 */ s32 unk_778; - /* 0x077C */ f32 unk_77C; + /* 0x077C */ f32 whipScale; /* 0x0780 */ s32 unk_780; /* 0x0784 */ s32 unk_784; - /* 0x0788 */ Vec3s unk_788; - /* 0x0790 */ f32 unk_790; - /* 0x0794 */ f32 unk_794; - /* 0x0798 */ f32 unk_798; - /* 0x079C */ f32 unk_79C; - /* 0x07A0 */ Vec3f unk_7A0; - /* 0x07A0 */ Vec3f unk_7AC[50]; - /* 0x0A04 */ Vec3f unk_A04[50]; - /* 0x0C5C */ Vec3f unk_C5C[50]; - /* 0x0EB4 */ char unkEB4[0xC8]; + /* 0x0788 */ Boss07Whip rightWhip; /* 0x0F7C */ s16 unk_F7C; /* 0x0F7E */ s16 unk_F7E; /* 0x0F80 */ Vec3f unk_F80; /* 0x0F8C */ f32 unk_F8C; /* 0x0F90 */ f32 unk_F90; - /* 0x0F94 */ Vec3s unk_F94; - /* 0x0F9C */ f32 unk_F9C; - /* 0x0FA0 */ f32 unk_FA0; - /* 0x0FA4 */ f32 unk_FA4; - /* 0x0FA8 */ f32 unk_FA8; - /* 0x0FAC */ Vec3f unk_FAC; - /* 0x0FB8 */ Vec3f unk_FB8[50]; - /* 0x1210 */ Vec3f unk_1210[50]; - /* 0x1468 */ Vec3f unk_1468[50]; - /* 0x16C0 */ char unk16C0[0xC8]; + /* 0x0F94 */ Boss07Whip leftWhip; /* 0x1788 */ Vec3f unk_1788[2]; /* 0x17A0 */ Vec3f unk_17A0; /* 0x17AC */ Vec3f unk_17AC; /* 0x17B8 */ f32 unk_17B8[4]; - /* 0x17C8 */ char unk17C8[0x10]; + /* 0x17C8 */ f32 unk_17C8[4]; /* 0x17D8 */ s16 unk_17D8; /* 0x17DA */ s16 unk_17DA; /* 0x17DA */ s16 unk_17DC; @@ -144,32 +126,34 @@ typedef struct Boss07 { /* 0x18D4 */ s16 unk_18D4; /* 0x18D6 */ s16 unk_18D6; /* 0x18D8 */ s16 unk_18D8; + /* 0x18DA */ u8 unk_18DA; + /* 0x18DB */ u8 unk_18DB; /* 0x18DC */ s32 effectIndex; /* 0x18E0 */ Vec3f unk_18E0; /* 0x18EC */ u8 unk_18EC; /* 0x18ED */ u8 unk_18ED; /* 0x18F0 */ ColliderQuad quad1; /* 0x1970 */ ColliderQuad quad2; - /* 0x19F0 */ Boss07Tentacle unk_19F0[25]; - /* 0x3E44 */ char unk3E44[0x6D00]; + /* 0x19F0 */ Boss07Tentacle tentacles[25]; + /* 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]; /* 0xABC8 */ u32 unk_ABC8; /* 0xABCC */ s32 unk_ABCC; - /* 0xABD0 */ s16 unk_ABD0; - /* 0xABD2 */ s16 unk_ABD2; - /* 0xABD4 */ Vec3f unk_ABD4; - /* 0xABE0 */ Vec3f unk_ABE0; - /* 0xABEC */ Vec3f unk_ABEC; - /* 0xABF8 */ Vec3f unk_ABF8; - /* 0xAC04 */ f32 unk_AC04; - /* 0xAC08 */ f32 unk_AC08; - /* 0xAC0C */ f32 unk_AC0C; - /* 0xAC10 */ char unkAC10[4]; - /* 0xAC14 */ f32 unk_AC14; - /* 0xAC18 */ char unkAC18[8]; + /* 0xABD0 */ s16 csState; + /* 0xABD2 */ s16 csCamIndex; + /* 0xABD4 */ Vec3f csCamEye; + /* 0xABE0 */ Vec3f csCamAt; + /* 0xABEC */ Vec3f csCamNextEye; + /* 0xABF8 */ Vec3f csCamNextAt; + /* 0xAC04 */ f32 csCamRotY; + /* 0xAC08 */ f32 csCamRotVel; + /* 0xAC0C */ f32 csCamSpeedMod; + /* 0xAC10 */ Vec3f csCamEyeMod; + /* 0xAC1C */ char unkAC1C[4]; } Boss07; // size = 0xAC20 extern const ActorInit Boss_07_InitVars; diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index a7bc54164..3e56d99b2 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -10714,39 +10714,37 @@ 0x809F4974:("D_809F4974","UNK_TYPE4","",0x4), 0x809F4978:("D_809F4978","UNK_TYPE4","",0x4), 0x809F497C:("D_809F497C","UNK_TYPE4","",0x4), - 0x80A07950:("D_80A07950","UNK_TYPE2","",0x2), - 0x80A07952:("D_80A07952","UNK_TYPE2","",0x2), - 0x80A07954:("D_80A07954","UNK_TYPE2","",0x2), + 0x80A07950:("D_80A07950","UNK_TYPE2","[12]",0x2), 0x80A07968:("D_80A07968","UNK_TYPE1","",0x1), - 0x80A07980:("D_80A07980","UNK_TYPE1","",0x1), - 0x80A079A0:("D_80A079A0","UNK_TYPE1","",0x1), - 0x80A079C0:("D_80A079C0","UNK_TYPE1","",0x1), - 0x80A079E0:("D_80A079E0","UNK_TYPE1","",0x1), - 0x80A07A00:("D_80A07A00","UNK_TYPE1","",0x1), + 0x80A07980:("sMaskDmgTable","UNK_TYPE1","",0x1), + 0x80A079A0:("sIncarnationDmgTable","UNK_TYPE1","",0x1), + 0x80A079C0:("sWrathDmgTable","UNK_TYPE1","",0x1), + 0x80A079E0:("sRemainsDmgTable","UNK_TYPE1","",0x1), + 0x80A07A00:("sTopDmgTable","UNK_TYPE1","",0x1), 0x80A07A20:("Boss_07_InitVars","UNK_TYPE1","",0x1), 0x80A07A40:("D_80A07A40","UNK_TYPE1","",0x1), 0x80A07A8C:("D_80A07A8C","UNK_TYPE2","",0x2), 0x80A07A90:("D_80A07A90","UNK_TYPE2","",0x2), - 0x80A07BCC:("D_80A07BCC","UNK_TYPE1","",0x1), - 0x80A07BDC:("D_80A07BDC","UNK_TYPE1","",0x1), + 0x80A07BCC:("sWrathJntSphInit1","UNK_TYPE1","",0x1), + 0x80A07BDC:("sWrathCylInit","UNK_TYPE1","",0x1), 0x80A07C08:("D_80A07C08","UNK_TYPE1","",0x1), - 0x80A07C2C:("D_80A07C2C","UNK_TYPE1","",0x1), - 0x80A07C3C:("D_80A07C3C","UNK_TYPE1","",0x1), - 0x80A07C8C:("D_80A07C8C","UNK_TYPE1","",0x1), + 0x80A07C2C:("sWrathJntSphInit2","UNK_TYPE1","",0x1), + 0x80A07C3C:("sMaskQuadInit1","UNK_TYPE1","",0x1), + 0x80A07C8C:("sMaskQuadInit2","UNK_TYPE1","",0x1), 0x80A07CDC:("D_80A07CDC","UNK_TYPE1","",0x1), - 0x80A07E68:("D_80A07E68","UNK_TYPE1","",0x1), - 0x80A07E78:("D_80A07E78","UNK_TYPE1","",0x1), - 0x80A07EA4:("D_80A07EA4","UNK_TYPE1","",0x1), - 0x80A07ED0:("D_80A07ED0","UNK_TYPE1","",0x1), - 0x80A07EFC:("D_80A07EFC","UNK_TYPE1","",0x1), - 0x80A07F00:("D_80A07F00","UNK_TYPE1","",0x1), - 0x80A07F04:("D_80A07F04","UNK_TYPE1","",0x1), - 0x80A07F08:("D_80A07F08","UNK_TYPE1","",0x1), - 0x80A07F0C:("D_80A07F0C","UNK_TYPE1","",0x1), - 0x80A07F3C:("D_80A07F3C","UNK_TYPE1","",0x1), - 0x80A07F54:("D_80A07F54","UNK_TYPE2","",0x2), - 0x80A07F5C:("D_80A07F5C","EffTireMarkInit","",0x8), - 0x80A07F64:("D_80A07F64","EffTireMarkInit","",0x8), + 0x80A07E68:("sIncarnationJntSphInit1","UNK_TYPE1","",0x1), + 0x80A07E78:("sShotCylInit","UNK_TYPE1","",0x1), + 0x80A07EA4:("sRemainsCylInit","UNK_TYPE1","",0x1), + 0x80A07ED0:("sTopCylInit","UNK_TYPE1","",0x1), + 0x80A07EFC:("sDarkOrange1","UNK_TYPE1","",0x1), + 0x80A07F00:("sDarkRed1","UNK_TYPE1","",0x1), + 0x80A07F04:("sDarkOrange2","UNK_TYPE1","",0x1), + 0x80A07F08:("sDarkRed2","UNK_TYPE1","",0x1), + 0x80A07F0C:("sRemainsStart","UNK_TYPE1","",0x1), + 0x80A07F3C:("sRemainsEnd","UNK_TYPE1","",0x1), + 0x80A07F54:("sRemainsParams","UNK_TYPE2","",0x2), + 0x80A07F5C:("sTopTireMarkInit","EffTireMarkInit","",0x8), + 0x80A07F64:("sMaskTireMarkInit","EffTireMarkInit","",0x8), 0x80A07F6C:("D_80A07F6C","UNK_TYPE4","",0x4), 0x80A07FA8:("D_80A07FA8","UNK_TYPE4","",0x4), 0x80A07FB4:("D_80A07FB4","UNK_TYPE4","",0x4), @@ -10962,22 +10960,19 @@ 0x80A08794:("D_80A08794","f32","",0x4), 0x80A08798:("D_80A08798","f32","",0x4), 0x80A09740:("D_80A09740","UNK_TYPE1","",0x1), - 0x80A09A40:("D_80A09A40","UNK_TYPE1","",0x1), - 0x80A09A4C:("D_80A09A4C","UNK_TYPE1","",0x1), - 0x80A09A50:("D_80A09A50","UNK_TYPE4","",0x4), - 0x80A09A54:("D_80A09A54","UNK_TYPE4","",0x4), - 0x80A09A58:("D_80A09A58","UNK_TYPE4","",0x4), - 0x80A09A5C:("D_80A09A5C","UNK_TYPE4","",0x4), - 0x80A09A60:("D_80A09A60","UNK_TYPE4","",0x4), - 0x80A09A64:("D_80A09A64","UNK_TYPE4","",0x4), - 0x80A09A68:("D_80A09A68","UNK_TYPE4","",0x4), - 0x80A09A6C:("D_80A09A6C","UNK_TYPE4","",0x4), + 0x80A09A40:("sSfxPoint","UNK_TYPE1","",0x1), + 0x80A09A4C:("sHeartbeatTimer","UNK_TYPE1","",0x1), + 0x80A09A50:("sWhipSegCount","UNK_TYPE4","",0x4), + 0x80A09A54:("sMajorasWrath","UNK_TYPE4","",0x4), + 0x80A09A58:("sMajoraStatic","UNK_TYPE4","",0x4), + 0x80A09A5C:("sMajorasMask","UNK_TYPE4","",0x4), + 0x80A09A60:("sBossRemains","UNK_TYPE4","[4]",0x4), 0x80A09A70:("D_80A09A70","UNK_TYPE1","",0x1), - 0x80A09A71:("D_80A09A71","UNK_TYPE1","",0x1), - 0x80A09A78:("D_80A09A78","UNK_TYPE1","",0x1), - 0x80A0A888:("D_80A0A888","UNK_TYPE4","",0x4), - 0x80A0A88C:("D_80A0A88C","UNK_TYPE4","",0x4), - 0x80A0A890:("D_80A0A890","UNK_TYPE4","",0x4), + 0x80A09A71:("sMusicStartTimer","UNK_TYPE1","",0x1), + 0x80A09A78:("sEffects","UNK_TYPE1","",0x1), + 0x80A0A888:("sSeed0","UNK_TYPE4","",0x4), + 0x80A0A88C:("sSeed1","UNK_TYPE4","",0x4), + 0x80A0A890:("sSeed2","UNK_TYPE4","",0x4), 0x80A0C4A0:("Bg_Dy_Yoseizo_InitVars","UNK_TYPE1","",0x1), 0x80A0C4C0:("D_80A0C4C0","UNK_TYPE4","",0x4), 0x80A0C4C4:("D_80A0C4C4","UNK_TYPE4","",0x4), diff --git a/undefined_syms.txt b/undefined_syms.txt index 57eb32e56..59ad645f4 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -1080,6 +1080,8 @@ D_06009EA8 = 0x06009EA8; D_0600A194 = 0x0600A194; D_0600A400 = 0x0600A400; D_0600A6AC = 0x0600A6AC; +D_0600AB04 = 0x0600AB04; +D_0600AD84 = 0x0600AD84; D_0600AE40 = 0x0600AE40; D_0600AFB0 = 0x0600AFB0; D_0600B020 = 0x0600B020; @@ -1132,6 +1134,7 @@ D_06040B30 = 0x06040B30; D_06041B30 = 0x06041B30; D_06042330 = 0x06042330; D_06043330 = 0x06043330; +D_06045B30 = 0x06045B30; // ovl_Boss_Hakugin From eed734521eec03a063d9858eafa33dc4827e1dfc Mon Sep 17 00:00:00 2001 From: petrie911 Date: Wed, 6 Oct 2021 11:56:18 -0500 Subject: [PATCH 06/28] more matchings --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 433 ++++++++++---------- 1 file changed, 217 insertions(+), 216 deletions(-) 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 057e3ece5..d0356e8ce 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -27,7 +27,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx); void Boss07_Destroy(Actor* thisx, GlobalContext* globalCtx); void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx); -void Boss07_Effects_Update(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx); void Boss07_Remains_Update(Actor* thisx, GlobalContext* globalCtx); void Boss07_Top_Update(Actor* thisx, GlobalContext* globalCtx); void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx); @@ -36,7 +36,7 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx); void Boss07_Afterimage_Update(Actor* thisx, GlobalContext* globalCtx); void Boss07_Wrath_Draw(Actor* thisx, GlobalContext* globalCtx); -void Boss07_Effects_Draw(Actor* thisx, GlobalContext* globalCtx); +void Boss07_Static_Draw(Actor* thisx, GlobalContext* globalCtx); void Boss07_Remains_Draw(Actor* thisx, GlobalContext* globalCtx); void Boss07_Top_Draw(Actor* thisx, GlobalContext* globalCtx); void Boss07_Projectile_Draw(Actor* thisx, GlobalContext* globalCtx); @@ -51,37 +51,37 @@ 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 func_809F4BB0(s32 arg0, ColliderJntSph* arg1, Vec3f* arg2); +void Boss07_UpdateSpheres(s32 arg0, ColliderJntSph* arg1, Vec3f* arg2); s32 func_809FF678(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); void func_809FF6B0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); void func_809FF810(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx); -void func_80A07740(GlobalContext* globalCtx); -void func_809FBF94(Boss07* this, GlobalContext* globalCtx); -void func_80A03238(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, +void Boss07_Static_DrawEffects(GlobalContext* globalCtx); +void Boss07_Static_DrawLight(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_UpdateTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, Vec3f* arg6, f32 arg7, u8 arg8, f32 arg9); -void func_80A036C4(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* rot, f32 arg4, f32 arg5); -void func_80A03868(Boss07* this, GlobalContext* globalCtx); -void func_80A03F18(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); +void Boss07_Mask_DrawTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* rot, f32 arg4, f32 arg5); +void Boss07_Mask_DrawBeam(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); void Boss07_Wrath_UpdateWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, f32 arg6, f32 arg7, f32 arg8, f32 arg9, Vec3s* argA, s16 argB, f32 scale, s32 whipHand); void Boss07_Wrath_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* rot, f32 arg4, s32 whipHand); -s32 func_809FB504(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); -void func_809FB55C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); -void func_809FB728(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx); -void func_809FB7D4(Boss07* this, GlobalContext* globalCtx); -void func_809FBB9C(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2); -void func_809FC8B0(u8* arg0, Boss07* this, GlobalContext* globalCtx); -void func_809FC960(u8* arg0, Boss07* this, GlobalContext* globalCtx); -void func_809FC4C0(Boss07* this, u8* arg1, f32 arg2); +s32 Boss07_Wrath_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); +void Boss07_Wrath_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); +void Boss07_Wrath_UnkLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx); +void Boss07_Wrath_DrawShocks(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_DrawDeathLights(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2); +void Boss07_Wrath_MakeShadowTex(u8* arg0, Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_DrawShadowTex(u8* arg0, Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_MakeShadowCircles(Boss07* this, u8* arg1, f32 arg2); void func_809F7688(Boss07* this, GlobalContext* globalCtx); void func_809F783C(Boss07* this, GlobalContext* globalCtx); -void func_809FFE64(Boss07* this, GlobalContext* globalCtx); -void func_80A006F4(Boss07* this, GlobalContext* globalCtx); -void func_80A025AC(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_SetupSpin(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_SetupBeam(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_SetupDeath(Boss07* this, GlobalContext* globalCtx); void func_809FEE70(Boss07* this, GlobalContext* globalCtx); void func_809F51E8(Boss07* this, GlobalContext* globalCtx, u8 arg2); void func_809F52CC(Boss07* this, GlobalContext* globalCtx); -void func_809F5494(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_BombWhips(Boss07* this, GlobalContext* globalCtx); void func_809F64F4(Boss07* this, GlobalContext* globalCtx); void func_809F7AB4(Boss07* this, GlobalContext* globalCtx); void func_809F99C4(Boss07* this, GlobalContext* globalCtx); @@ -92,16 +92,16 @@ void func_809F8658(Boss07* this, GlobalContext* globalCtx); void func_809F7D2C(Boss07* this, GlobalContext* globalCtx); void func_809F4D10(Vec3f* arg0, f32 arg1); void func_809F4FAC(GlobalContext* globalCtx); -void func_809F4AE8(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4); -void func_80A02B30(Boss07* this, GlobalContext* globalCtx); -void func_809F536C(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2); +void Boss07_SpawnEffect(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4); +void Boss07_Mask_CollisionCheck(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_BlastWhip(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2); void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx); void func_809F4FF8(GlobalContext* globalCtx, Vec3f* arg1, u8 arg2); -s32 func_809F4C40(Boss07* this, GlobalContext* globalCtx); +s32 Boss07_IsFacingPlayer(Boss07* this, GlobalContext* globalCtx); void func_809F4CBC(Boss07* this, f32 arg1); void func_809F4D54(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3); void func_809FCBC8(Boss07* this); -void func_80A07638(GlobalContext* globalCtx); +void Boss07_Static_UpdateEffects(GlobalContext* globalCtx); void func_809F9CEC(Boss07* this, GlobalContext* globalCtx); void func_80A06500(Boss07* this, GlobalContext* globalCtx); void func_80A06990(Boss07* this, GlobalContext* globalCtx); @@ -112,15 +112,15 @@ void func_809F9280(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3); 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_80A00484(Boss07* this, GlobalContext* globalCtx, u8 arg2, Actor* arg3); -void func_80A0021C(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 arg2, Actor* arg3); +void Boss07_Mask_SetupStunned(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_809FFA04(Boss07* this, GlobalContext* globalCtx); -void func_80A016E4(Boss07* this, GlobalContext* globalCtx); +void Boss07_SetupIdle(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_SetupIntro(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); @@ -151,13 +151,13 @@ 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_809FFA80(Boss07* this, GlobalContext* globalCtx); -void func_809FFEAC(Boss07* this, GlobalContext* globalCtx); -void func_80A00274(Boss07* this, GlobalContext* globalCtx); -void func_80A00554(Boss07* this, GlobalContext* globalCtx); -void func_80A00720(Boss07* this, GlobalContext* globalCtx); -void func_80A01750(Boss07* this, GlobalContext* globalCtx); -void func_80A0264C(Boss07* this, GlobalContext* globalCtx); +void Boss07_Idle(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_Spin(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_Stunned(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_Damaged(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_Death(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); @@ -874,17 +874,19 @@ static s32 sSeed0; static s32 sSeed1; static s32 sSeed2; -void func_809F4980(Actor* arg0) { - Audio_PlayActorSound2(arg0, NA_SE_EN_FOLLOWERS_DAMAGE); +#define NON_MATCHING + +void Boss07_Remains_DamageSfx(Boss07* this) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_DAMAGE); } -void func_809F49A0(s32 seedInit0, s32 seedInit1, s32 seedInit2) { +void Boss07_Wrath_InitRand(s32 seedInit0, s32 seedInit1, s32 seedInit2) { sSeed0 = seedInit0; sSeed1 = seedInit1; sSeed2 = seedInit2; } -f32 func_809F49C0(void) { +f32 Boss07_Wrath_RandZeroOne(void) { // Wichmann-Hill algorithm f32 randFloat; @@ -899,7 +901,7 @@ f32 func_809F49C0(void) { return fabsf(randFloat); } -void func_809F4AE8(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4) { +void Boss07_SpawnEffect(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4) { s32 i; Boss07Effect* effect = (Boss07Effect*)globalCtx->specialEffects; @@ -918,22 +920,22 @@ void func_809F4AE8(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* ar } } -void func_809F4BB0(s32 arg0, ColliderJntSph* arg1, Vec3f* arg2) { - arg1->elements[arg0].dim.worldSphere.center.x = arg2->x; - arg1->elements[arg0].dim.worldSphere.center.y = arg2->y; - arg1->elements[arg0].dim.worldSphere.center.z = arg2->z; - arg1->elements[arg0].dim.worldSphere.radius = - arg1->elements[arg0].dim.modelSphere.radius * arg1->elements[arg0].dim.scale; +void Boss07_UpdateSpheres(s32 index, ColliderJntSph* collider, Vec3f* pos) { + collider->elements[index].dim.worldSphere.center.x = pos->x; + collider->elements[index].dim.worldSphere.center.y = pos->y; + collider->elements[index].dim.worldSphere.center.z = pos->z; + collider->elements[index].dim.worldSphere.radius = + collider->elements[index].dim.modelSphere.radius * collider->elements[index].dim.scale; } -s32 func_809F4C40(Boss07* this, GlobalContext* globalCtx) { +s32 Boss07_IsFacingPlayer(Boss07* this, GlobalContext* globalCtx) { Player* player = PLAYER; if ((ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x3000) && (ABS_ALT((s16)(this->actor.yawTowardsPlayer - (s16)(player->actor.shape.rot.y + 0x8000))) < 0x3000)) { - return 1; + return true; } - return 0; + return false; } void func_809F4CBC(Boss07* this, f32 arg1) { @@ -1012,7 +1014,7 @@ void func_809F51E8(Boss07* this, GlobalContext* globalCtx, u8 arg2) { if ((this->unk_15C == 0) && (((this->actionFunc != func_809F7968) && (this->actionFunc != func_809F76D0) && (this->actionFunc != func_809F77A8)) || - (arg2 != 0))) { + arg2)) { if (Rand_ZeroOne() < 0.5f) { func_809F783C(this, globalCtx); } else { @@ -1037,14 +1039,14 @@ void func_809F52CC(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, 0); - return; + func_809F51E8(this, globalCtx, false); + break; } explosive = explosive->next; } } -void func_809F536C(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2) { +void Boss07_Wrath_BlastWhip(Vec3f* bombPos, Vec3f* pos, Vec3f* pull) { s32 i; f32 push; f32 dx; @@ -1054,10 +1056,10 @@ void func_809F536C(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2) { sp50.x = 0.0f; - for (i = 0; i < sWhipSegCount; i++, arg1++, arg2++) { - dx = arg1->x - arg0->x; - dy = arg1->y - arg0->y; - dz = arg1->z - arg0->z; + for (i = 0; i < sWhipSegCount; i++, pos++, pull++) { + dx = pos->x - bombPos->x; + dy = pos->y - bombPos->y; + dz = pos->z - bombPos->z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 300.0f) { @@ -1067,18 +1069,18 @@ void func_809F536C(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2) { sp50.y = push; sp50.z = push; SysMatrix_InsertYRotation_f(Math_Acot2F(dz, dx), 0); - SysMatrix_MultiplyVector3fByState(&sp50, arg2); + SysMatrix_MultiplyVector3fByState(&sp50, pull); } } } -void func_809F5494(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_BombWhips(Boss07* this, GlobalContext* globalCtx) { Actor* explosive = globalCtx->actorCtx.actorList[ACTORCAT_EXPLOSIVES].first; while (explosive != NULL) { if (explosive->params == 1) { - func_809F536C(&explosive->world.pos, this->rightWhip.pos, this->rightWhip.pull); - func_809F536C(&explosive->world.pos, this->leftWhip.pos, this->leftWhip.pull); + Boss07_Wrath_BlastWhip(&explosive->world.pos, this->rightWhip.pos, this->rightWhip.pull); + Boss07_Wrath_BlastWhip(&explosive->world.pos, this->leftWhip.pos, this->leftWhip.pull); } explosive = explosive->next; } @@ -1109,8 +1111,8 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { s32 i; if (this->actor.params == 150) { - this->actor.update = Boss07_Effects_Update; - this->actor.draw = Boss07_Effects_Draw; + this->actor.update = Boss07_Static_Update; + this->actor.draw = Boss07_Static_Draw; this->actor.flags &= ~1; sMajoraStatic = this; D_80A09A70 = 0; @@ -1186,7 +1188,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.world.pos.x = 0.0f; this->actor.world.pos.y = sREG(17) + 277.0f; this->actor.world.pos.z = -922.5f; - func_809FFA04(this, globalCtx); + Boss07_SetupIdle(this, globalCtx); this->unk_164.x = 0.0f; this->unk_164.y = 200.0f; this->unk_164.z = 0.0f; @@ -1197,7 +1199,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.flags |= 1; sMusicStartTimer = 20; } else { - func_80A016E4(this, globalCtx); + Boss07_Mask_SetupIntro(this, globalCtx); } Collider_InitAndSetQuad(globalCtx, &this->quad1, &this->actor, &sMaskQuadInit1); Collider_InitAndSetQuad(globalCtx, &this->quad2, &this->actor, &sMaskQuadInit2); @@ -1338,22 +1340,22 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_ABC8 > 60) { Player* player = PLAYER; - s32 phi_v1 = 0; + s32 dataIndex = 0; if (0) {} if (player->transformation == 1) { - phi_v1 = 1; + dataIndex = 1; } else if (player->transformation == 0) { - phi_v1 = 2; + dataIndex = 2; } else if (player->transformation == 2) { - phi_v1 = 3; + dataIndex = 3; } else if (player->transformation == 3) { - phi_v1 = 4; + dataIndex = 4; } - Math_ApproachF(&this->csCamNextEye.y, D_80A07F6C[phi_v1][0], 0.075f, this->csCamSpeedMod * 7.0f); - Math_ApproachF(&this->csCamNextEye.z, D_80A07F6C[phi_v1][1], 0.075f, this->csCamSpeedMod * 17.0f); - Math_ApproachF(&this->csCamNextAt.y, D_80A07F6C[phi_v1][2], 0.075f, this->csCamSpeedMod * 7.0f); + Math_ApproachF(&this->csCamNextEye.y, D_80A07F6C[dataIndex][0], 0.075f, this->csCamSpeedMod * 7.0f); + Math_ApproachF(&this->csCamNextEye.z, D_80A07F6C[dataIndex][1], 0.075f, this->csCamSpeedMod * 17.0f); + Math_ApproachF(&this->csCamNextAt.y, D_80A07F6C[dataIndex][2], 0.075f, this->csCamSpeedMod * 7.0f); Math_ApproachF(&this->csCamSpeedMod, 1.0f, 1.0f, 0.01f); if (this->unk_ABC8 == 70) { SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06025018, -15.0f); @@ -1400,7 +1402,7 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { func_80165690(); if (sBossRemains[0] != NULL) { for (i = 0; i < 4; i++) { - func_800BC154(globalCtx, &globalCtx->actorCtx, &sBossRemains[i]->actor, 9); + func_800BC154(globalCtx, &globalCtx->actorCtx, &sBossRemains[i]->actor, ACTORCAT_BOSS); } } } @@ -1450,11 +1452,11 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { Vec3f spA8 = {0.0f, 0.0f, 0.0f}; f32 spA4; f32 spA0; - Camera* temp_s0; + Camera* camera; spA4 = 0.0f; spA0 = 0.1f; - temp_s0 = Play_GetCamera(globalCtx, 0); + camera = Play_GetCamera(globalCtx, 0); this->unk_15C = 1000; func_809F4CBC(this, 1.0f); switch (this->csState) { @@ -1471,17 +1473,17 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { case 1: this->unk_ABC8 = 0; this->csState = 2; - this->csCamEye.x = temp_s0->eye.x; - this->csCamEye.y = temp_s0->eye.y; - this->csCamEye.z = temp_s0->eye.z; - this->csCamAt.x = temp_s0->at.x; - this->csCamAt.y = temp_s0->at.y; - this->csCamAt.z = temp_s0->at.z; + this->csCamEye.x = camera->eye.x; + this->csCamEye.y = camera->eye.y; + this->csCamEye.z = camera->eye.z; + this->csCamAt.x = camera->at.x; + this->csCamAt.y = camera->at.y; + this->csCamAt.z = camera->at.z; this->csCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; this->csCamRotVel = this->csCamSpeedMod = sMajoraStatic->unk_180C = 0.0f; - func_809F49A0(1, 0x71AC, 0x263A); + Boss07_Wrath_InitRand(1, 0x71AC, 0x263A); for (i = 0; i < 30; i++) { - this->unk_AB50[i] = func_809F49C0() - 1.0f; + this->unk_AB50[i] = Boss07_Wrath_RandZeroOne() - 1.0f; } func_8016566C(150); case 2: @@ -1810,7 +1812,7 @@ void func_809F7968(Boss07* this, GlobalContext* globalCtx) { } if ((this->actor.velocity.y < 0.0f) && (this->actor.bgCheckFlags & 1)) { if (Rand_ZeroOne() < 0.3f) { - func_809F51E8(this, globalCtx, 1); + func_809F51E8(this, globalCtx, true); } else { func_809F7400(this, globalCtx, 1); this->actor.speedXZ = 5.0f; @@ -2248,7 +2250,7 @@ void func_809F8D04(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.3f); } if (func_801378B8(&this->skelAnime, this->unk_1D4)) { - func_809F51E8(this, globalCtx, 1); + func_809F51E8(this, globalCtx, true); } } @@ -2323,7 +2325,7 @@ void func_809F91D4(Boss07* this, GlobalContext* globalCtx) { this->leftWhip.tension = this->rightWhip.tension = 0.0f; this->leftWhip.drag = this->rightWhip.drag = 2.0f; if (func_801378B8(&this->skelAnime, this->unk_1D4)) { - func_809F51E8(this, globalCtx, 1); + func_809F51E8(this, globalCtx, true); } } @@ -2372,7 +2374,7 @@ void func_809F93DC(Boss07* this, GlobalContext* globalCtx) { this->rightWhip.tension = 0.0f; this->leftWhip.tension = 0.0f; if (func_801378B8(&this->skelAnime, this->unk_1D4)) { - func_809F51E8(this, globalCtx, 1); + func_809F51E8(this, globalCtx, true); } } @@ -2440,7 +2442,7 @@ void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx this->rightWhip.tension = 0.0f; play_sound(NA_SE_EN_LAST3_GET_LINK_OLD); } - } else if ((player->stateFlags1 & 0x400000) && func_809F4C40(this, globalCtx)) { + } else if ((player->stateFlags1 & 0x400000) && Boss07_IsFacingPlayer(this, globalCtx)) { player->unk_B80 = 10.0f; player->unk_B84 = this->actor.yawTowardsPlayer; play_sound(NA_SE_IT_SHIELD_BOUND); @@ -2456,7 +2458,7 @@ void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx sp7C.z += randPlusMinusPoint5Scaled(30.0f); EffectSsHitMark_SpawnFixedScale(globalCtx, 0, &sp7C); func_809F4FF8(globalCtx, &player->actor.world.pos, 7); - return; + break; } } } @@ -2699,29 +2701,29 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { if ((this->actionFunc == func_809F805C) && (this->unk_14E == 7) && (this->unk_14C >= 6)) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->sph2.base); } else { - if ((this->unk_174 != 0) && func_809F4C40(this, globalCtx)) { + if ((this->unk_174 != 0) && 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); } else { - func_809F51E8(this, globalCtx, 0); + func_809F51E8(this, globalCtx, false); } } if ((player->unk_ADC != 0) && (this->actor.xzDistToPlayer <= 150.0f)) { - func_809F51E8(this, globalCtx, 0); + func_809F51E8(this, globalCtx, false); } } if ((this->actionFunc != func_809F91D4) && (this->actionFunc != func_809F93DC)) { if ((player->stateFlags3 & 0x00001000) && !(player->stateFlags3 & 0x00080000) && (this->actor.xzDistToPlayer <= 250.0f)) { - func_809F51E8(this, globalCtx, 0); + func_809F51E8(this, globalCtx, false); } } } if (this->unk_174 != 0) { func_809F52CC(this, globalCtx); } - func_809F5494(this, globalCtx); + Boss07_Wrath_BombWhips(this, globalCtx); if ((KREG(88) != 0) || (this->unk_148 != 0)) { KREG(88) = 0; this->unk_148 = 0; @@ -2935,7 +2937,7 @@ void Boss07_Wrath_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* pos, CLOSE_DISPS(globalCtx->state.gfxCtx); } -s32 func_809FB504(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { +s32 Boss07_Wrath_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { Boss07* this = THIS; if (limbIndex == 26) { @@ -2960,7 +2962,7 @@ static s8 sWrathBodyParts[32] = { }; static Vec3f sWhipOffset = { 1000.0f, 100.0f, 0.0f }; -void func_809FB55C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { +void Boss07_Wrath_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { Boss07* this = THIS; s8 sp6B; Vec3f sp5C; @@ -2977,7 +2979,7 @@ void func_809FB55C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* } else { SysMatrix_MultiplyVector3fByState(&sWrathColliderOffsets[sp6B], &sp5C); } - func_809F4BB0(sp6B, &this->sph1, &sp5C); + Boss07_UpdateSpheres(sp6B, &this->sph1, &sp5C); } if (limbIndex == 26) { SysMatrix_GetStateTranslation(&this->actor.focus.pos); @@ -2998,11 +3000,11 @@ void func_809FB55C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* } if (limbIndex == 12) { SysMatrix_GetStateTranslation(&sp5C); - func_809F4BB0(0, &this->sph2, &sp5C); + Boss07_UpdateSpheres(0, &this->sph2, &sp5C); } } -void func_809FB728(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { +void Boss07_Wrath_UnkLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { Boss07* this = THIS; if ((limbIndex == 2) || (limbIndex == 4) || (limbIndex == 6) || (limbIndex == 7) || (limbIndex == 9) || @@ -3012,7 +3014,7 @@ void func_809FB728(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { } } -void func_809FB7D4(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_DrawShocks(Boss07* this, GlobalContext* globalCtx) { s32 i; GraphicsContext* gfxCtx; @@ -3059,7 +3061,7 @@ void func_809FB7D4(Boss07* this, GlobalContext* globalCtx) { CLOSE_DISPS(gfxCtx); } -void func_809FBB9C(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2) { +void Boss07_Wrath_DrawDeathLights(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2) { s32 i; f32 temp_f12_2; f32 temp_f20; @@ -3069,19 +3071,19 @@ void func_809FBB9C(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2) { OPEN_DISPS(gfxCtx = globalCtx->state.gfxCtx); if (this->unk_AB4C > 0.0f) { - func_809F49A0(1, 0x71B8, 0x263A); + Boss07_Wrath_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 < 30; i++) { temp = D_80A07950[0]; gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, temp[0], temp[1], temp[2], 40); - temp_f20 = (func_809F49C0() * 40.0f) - 30.0f; + temp_f20 = (Boss07_Wrath_RandZeroOne() * 40.0f) - 30.0f; SysMatrix_InsertTranslation(this->bodyPartsPos[2].x, this->bodyPartsPos[2].y - 30.0f + 50.0f + temp_f20 + 25.0f, this->bodyPartsPos[2].z, 0); SysMatrix_InsertTranslation(arg2->x, arg2->y + temp_f20, arg2->z, 0); - SysMatrix_InsertYRotation_f(func_809F49C0() * M_PI * 2.0f, 1); + SysMatrix_InsertYRotation_f(Boss07_Wrath_RandZeroOne() * M_PI * 2.0f, 1); SysMatrix_RotateStateAroundXAxis(-0.024999999f * temp_f20); - SysMatrix_InsertZRotation_f(func_809F49C0() * M_PI * 2.0f, 1); + SysMatrix_InsertZRotation_f(Boss07_Wrath_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); @@ -3104,7 +3106,7 @@ void func_809FBB9C(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2) { CLOSE_DISPS(gfxCtx); } -void func_809FBF94(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Static_DrawLight(Boss07* this, GlobalContext* globalCtx) { s32 pad; GraphicsContext* gfxCtx; f32 sp54; @@ -3147,7 +3149,7 @@ void func_809FBF94(Boss07* this, GlobalContext* globalCtx) { void Boss07_Wrath_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; - u8* sp54 = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(u8[0x40][0x40])); + u8* shadowTex = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(u8[0x40][0x40])); OPEN_DISPS(globalCtx->state.gfxCtx); Vec3f sp58; @@ -3160,7 +3162,7 @@ void Boss07_Wrath_Draw(Actor* thisx, GlobalContext* globalCtx2) { SysMatrix_InsertYRotation_f(this->unk_184, 1); SysMatrix_RotateStateAroundXAxis(this->unk_188); func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, (s32)this->skelAnime.dListCount, - func_809FB504, func_809FB55C, func_809FB728, &this->actor); + Boss07_Wrath_OverrideLimbDraw, Boss07_Wrath_PostLimbDraw, Boss07_Wrath_UnkLimbDraw, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); if (((KREG(63) == 0) || (KREG(63) == 2)) && (this->unk_149 != 0)) { @@ -3174,21 +3176,21 @@ void Boss07_Wrath_Draw(Actor* thisx, GlobalContext* globalCtx2) { Boss07_Wrath_DrawWhips(this, globalCtx, this->rightWhip.pos, this->rightWhip.rot, this->whipScale, 0); Boss07_Wrath_DrawWhips(this, globalCtx, this->leftWhip.pos, this->leftWhip.rot, this->whipScale, 1); if (this->unk_AB48 == 0) { - func_809FC8B0(sp54, this, globalCtx); - func_809FC960(sp54, this, globalCtx); + Boss07_Wrath_MakeShadowTex(shadowTex, this, globalCtx); + Boss07_Wrath_DrawShadowTex(shadowTex, this, globalCtx); } - func_809FB7D4(this, globalCtx); + Boss07_Wrath_DrawShocks(this, globalCtx); sp58.x = this->bodyPartsPos[2].x; sp58.y = this->bodyPartsPos[2].y - 30.0f + 50.0f; sp58.z = this->bodyPartsPos[2].z; - func_809FBB9C(this, globalCtx, &sp58); + 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; CLOSE_DISPS(globalCtx->state.gfxCtx); } -void func_809FC4C0(Boss07* this, u8* shadowTexture, f32 arg2) { +void Boss07_Wrath_MakeShadowCircles(Boss07* this, u8* shadowTex, f32 weight) { static s32 sShadowWidths6[6] = { 1, 2, 3, 3, 2, 1 }; static s32 sShadowWidths7[7] = { 2, 3, 4, 4, 4, 3, 2 }; static s32 sShadowWidths8[8] = { 2, 3, 4, 4, 4, 4, 3, 2 }; @@ -3207,9 +3209,9 @@ void func_809FC4C0(Boss07* this, u8* shadowTexture, f32 arg2) { Vec3f sp68; for (i = 0; i < 15; i++) { - if ((arg2 == 0.0f) || ((j = sBodyPartsIndex2[i]) >= 0)) { - if (arg2 > 0.0f) { - VEC3F_LERPIMPDST(&lerp, &this->bodyPartsPos[i], &this->bodyPartsPos[j], arg2); + if ((weight == 0.0f) || ((j = sBodyPartsIndex2[i]) >= 0)) { + if (weight > 0.0f) { + VEC3F_LERPIMPDST(&lerp, &this->bodyPartsPos[i], &this->bodyPartsPos[j], weight); sp74.x = lerp.x - this->actor.world.pos.x; sp74.y = lerp.y - this->actor.world.pos.y + 76.0f + 30.0f + 30.0f + 100.0f; @@ -3231,7 +3233,7 @@ void func_809FC4C0(Boss07* this, u8* shadowTexture, f32 arg2) { for (phi_a0 = -sShadowWidths12[j]; phi_a0 < sShadowWidths12[j]; phi_a0++) { temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { - shadowTexture[temp_v0] = 255; + shadowTex[temp_v0] = 255; } } } @@ -3240,7 +3242,7 @@ void func_809FC4C0(Boss07* this, u8* shadowTexture, f32 arg2) { for (phi_a0 = -sShadowWidths8[j]; phi_a0 < sShadowWidths8[j]; phi_a0++) { temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { - shadowTexture[temp_v0] = 255; + shadowTex[temp_v0] = 255; } } } @@ -3249,7 +3251,7 @@ void func_809FC4C0(Boss07* this, u8* shadowTexture, f32 arg2) { for (phi_a0 = -sShadowWidths7[j]; phi_a0 < sShadowWidths7[j] - 1; phi_a0++) { temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { - shadowTexture[temp_v0] = 255; + shadowTex[temp_v0] = 255; } } } @@ -3258,7 +3260,7 @@ void func_809FC4C0(Boss07* this, u8* shadowTexture, f32 arg2) { for (phi_a0 = -sShadowWidths6[j]; phi_a0 < sShadowWidths6[j] - 1; phi_a0++) { temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { - shadowTexture[temp_v0] = 255; + shadowTex[temp_v0] = 255; } } } @@ -3267,20 +3269,20 @@ void func_809FC4C0(Boss07* this, u8* shadowTexture, f32 arg2) { } } -void func_809FC8B0(u8* arg0, Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_MakeShadowTex(u8* shadowTex, Boss07* this, GlobalContext* globalCtx) { s32 i; - s32* temp = (s32*)arg0; + s32* shadowTex32 = (s32*)shadowTex; - for (i = 0; i < 0x400; i++, temp++) { - *temp = 0; + for (i = 0; i < 0x400; i++, shadowTex32++) { + *shadowTex32 = 0; } SysMatrix_SetStateXRotation(1.0f); for (i = 0; i < 6; i++) { - func_809FC4C0(this, arg0, i / 5.0f); + Boss07_Wrath_MakeShadowCircles(this, shadowTex, i / 5.0f); } } -void func_809FC960(u8* arg0, Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_DrawShadowTex(u8* arg0, Boss07* this, GlobalContext* globalCtx) { s32 pad[2]; f32 phi_f0; GraphicsContext* pad3 = globalCtx->state.gfxCtx; @@ -3504,7 +3506,7 @@ void func_809FD710(Boss07* this, GlobalContext* globalCtx) { func_809FDB2C(this, globalCtx); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_SURPRISED_OLD); } - func_809F4D54(this, globalCtx, 1, 0); + func_809F4D54(this, globalCtx, 1, false); } void func_809FD818(Boss07* this, GlobalContext* globalCtx, s16 arg2) { @@ -3535,7 +3537,7 @@ void func_809FD89C(Boss07* this, GlobalContext* globalCtx) { if (this->timers[0] == 0) { func_809FD5F8(this, globalCtx); } - func_809F4D54(this, globalCtx, 1, 1); + func_809F4D54(this, globalCtx, 1, true); } void func_809FD984(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { @@ -3573,7 +3575,7 @@ void func_809FDAB0(Boss07* this, GlobalContext* globalCtx) { if (func_801378B8(&this->skelAnime, this->unk_1D4)) { func_809FDB2C(this, globalCtx); } - func_809F4D54(this, globalCtx, 1, 0); + func_809F4D54(this, globalCtx, 1, false); } void func_809FDB2C(Boss07* this, GlobalContext* globalCtx) { @@ -3633,7 +3635,7 @@ void func_809FDBA0(Boss07* this, GlobalContext* globalCtx) { this->timers[0] = 50; this->timers[2] = 50; } - func_809F4D54(this, globalCtx, 3, 0); + func_809F4D54(this, globalCtx, 3, false); this->unk_18D6 = 5; } } @@ -3660,7 +3662,7 @@ void func_809FDF54(Boss07* this, GlobalContext* globalCtx) { if (this->timers[0] == 0) { func_809FDB2C(this, globalCtx); } - func_809F4D54(this, globalCtx, 1, 0); + func_809F4D54(this, globalCtx, 1, false); } void func_809FE068(Boss07* this, GlobalContext* globalCtx) { @@ -3703,7 +3705,7 @@ void func_809FE0E4(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_SURPRISED_OLD); } } - func_809F4D54(this, globalCtx, 7, 0); + func_809F4D54(this, globalCtx, 7, false); } void func_809FE2D4(Boss07* this, GlobalContext* globalCtx) { @@ -3734,7 +3736,7 @@ void func_809FE348(Boss07* this, GlobalContext* globalCtx) { if (this->timers[0] == 0) { func_809FDB2C(this, globalCtx); } - func_809F4D54(this, globalCtx, 7, 0); + func_809F4D54(this, globalCtx, 7, false); } void func_809FE4B0(Boss07* this, GlobalContext* globalCtx) { @@ -4111,7 +4113,7 @@ void func_809FF6B0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* } else { SysMatrix_MultiplyVector3fByState(&sIncarnationColliderOffsets[i], &sp28); } - func_809F4BB0(i, &this->sph1, &sp28); + Boss07_UpdateSpheres(i, &this->sph1, &sp28); } if (limbIndex == 8) { SysMatrix_GetStateTranslation(&this->unk_1788[0]); @@ -4167,14 +4169,14 @@ void Boss07_Incarnation_Draw(Actor* thisx, GlobalContext* globalCtx2) { CLOSE_DISPS(globalCtx->state.gfxCtx); } -void func_809FFA04(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_809FFA80; +void Boss07_SetupIdle(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Idle; SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06019E48, -20.0f); this->timers[2] = Rand_ZeroFloat(150.0f) + 60.0f; this->unk_1870 = 1.0f; } -void func_809FFA80(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Idle(Boss07* this, GlobalContext* globalCtx) { s16 sp36; s16 sp34; f32 sp30; @@ -4188,9 +4190,9 @@ void func_809FFA80(Boss07* this, GlobalContext* globalCtx) { if (this->timers[0] == 0) { if (this->timers[2] == 0) { if (((s8)this->actor.colChkInfo.health < 9) && (player->transformation != 0) && (Rand_ZeroOne() < 0.75f)) { - func_80A006F4(this, globalCtx); + Boss07_Mask_SetupBeam(this, globalCtx); } else { - func_809FFE64(this, globalCtx); + Boss07_Mask_SetupSpin(this, globalCtx); } } else if (Rand_ZeroOne() < 0.15f) { this->unk_18C = 2.0f; @@ -4229,12 +4231,12 @@ void func_809FFA80(Boss07* this, GlobalContext* globalCtx) { KREG(88) = 0; this->unk_148 = 0; Audio_QueueSeqCmd(0x100100FF); - func_80A025AC(this, globalCtx); + Boss07_Mask_SetupDeath(this, globalCtx); } } -void func_809FFE64(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_809FFEAC; +void Boss07_Mask_SetupSpin(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Mask_Spin; this->unk_14E = 0; this->csState = 0; this->timers[0] = 30; @@ -4242,7 +4244,7 @@ void func_809FFE64(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_ATTACK_OLD); } -void func_809FFEAC(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Mask_Spin(Boss07* this, GlobalContext* globalCtx) { s16 sp36; s16 sp34; f32 sp30; @@ -4312,19 +4314,19 @@ void func_809FFEAC(Boss07* this, GlobalContext* globalCtx) { Math_ApproachS(&this->actor.world.rot.x, 0x2000, 0xA, 0x7D0); func_809F4CBC(this, 0.5f); if (this->timers[0] == 0) { - func_809FFA04(this, globalCtx); + Boss07_SetupIdle(this, globalCtx); } } } -void func_80A0021C(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_80A00274; +void Boss07_Mask_SetupStunned(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Mask_Stunned; SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_0600AE40, -10.0f); this->timers[0] = 100; this->unk_170 = 0.0f; } -void func_80A00274(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Mask_Stunned(Boss07* this, GlobalContext* globalCtx) { SkelAnime_FrameUpdateMatrix(&this->skelAnime); func_8019F1C0(&sSfxPoint, NA_SE_EN_COMMON_WEAKENED - SFX_FLAG); func_809F4CBC(this, 0.5f); @@ -4340,15 +4342,15 @@ void func_80A00274(Boss07* this, GlobalContext* globalCtx) { this->unk_1884 = 1; } if (this->timers[0] == 0) { - func_809FFA04(this, globalCtx); + Boss07_SetupIdle(this, globalCtx); this->timers[2] = 100; } } -void func_80A00484(Boss07* this, GlobalContext* globalCtx, u8 arg2, Actor* arg3) { +void Boss07_Mask_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 arg2, Actor* arg3) { Player* player = PLAYER; - this->actionFunc = func_80A00554; + this->actionFunc = Boss07_Mask_Damaged; this->timers[0] = 40; if (arg2) { this->actor.speedXZ = 30.0f; @@ -4374,7 +4376,7 @@ void func_80A00484(Boss07* this, GlobalContext* globalCtx, u8 arg2, Actor* arg3) this->timers[1] = 30; } -void func_80A00554(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Mask_Damaged(Boss07* this, GlobalContext* globalCtx) { this->unk_15C = 20; SkelAnime_FrameUpdateMatrix(&this->skelAnime); if (this->actor.bgCheckFlags & 1) { @@ -4392,7 +4394,7 @@ void func_80A00554(Boss07* this, GlobalContext* globalCtx) { this->unk_774 = 1; } if (this->timers[0] == 0) { - func_809FFA04(this, globalCtx); + Boss07_SetupIdle(this, globalCtx); if ((s8)this->actor.colChkInfo.health <= 0) { this->unk_148 = 1; Enemy_StartFinishingBlow(globalCtx, &this->actor); @@ -4419,14 +4421,14 @@ void func_80A006D0(Boss07* this) { this->unk_18C0 = 0.0f; } -void func_80A006F4(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_80A00720; +void Boss07_Mask_SetupBeam(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Mask_Beam; this->unk_14E = 0; this->timers[0] = 30; this->unk_170 = 0.0f; } -void func_80A00720(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { f32 temp_f20; f32 temp_f22; f32 temp_f12; @@ -4513,7 +4515,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { sp120.x = sp12C.x * -0.05f; sp120.y = sp12C.y * -0.05f; sp120.z = sp12C.z * -0.05f; - func_809F4AE8(globalCtx, &sp138, &sp12C, &sp120, Rand_ZeroFloat(10.0f) + 25.0f); + Boss07_SpawnEffect(globalCtx, &sp138, &sp12C, &sp120, Rand_ZeroFloat(10.0f) + 25.0f); sp14B = true; } sp16C.x = player->actor.world.pos.x - this->unk_189C.x; @@ -4573,14 +4575,14 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { spF0.x = spFC.x * -0.05f; spF0.y = spFC.y * -0.05f; spF0.z = spFC.z * -0.05f; - func_809F4AE8(globalCtx, &sp108, &spFC, &spF0, Rand_ZeroFloat(10.0f) + 25.0f); + Boss07_SpawnEffect(globalCtx, &sp108, &spFC, &spF0, Rand_ZeroFloat(10.0f) + 25.0f); this->unk_15E |= 0xA; } else { this->unk_15C = 50; this->unk_15E = 15; func_801A72CC(&this->actor.projectedPos); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_DAMAGE2_OLD); - func_80A00484(this, globalCtx, 2, NULL); + Boss07_Mask_SetupDamaged(this, globalCtx, 2, NULL); func_80A006D0(this); for (phi_s0_2 = 0; phi_s0_2 < 20; phi_s0_2++) { sp108.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(50.0f); @@ -4592,7 +4594,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { spF0.x = spFC.x * -0.05f; spF0.y = spFC.y * -0.05f; spF0.z = spFC.z * -0.05f; - func_809F4AE8(globalCtx, &sp108, &spFC, &spF0, Rand_ZeroFloat(10.0f) + 25.0f); + Boss07_SpawnEffect(globalCtx, &sp108, &spFC, &spF0, Rand_ZeroFloat(10.0f) + 25.0f); } if ((s8)this->actor.colChkInfo.health <= 0) { this->unk_18D6 = 200; @@ -4634,7 +4636,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { spC8.y = spD4.y * -0.05f; spC8.z = spD4.z * -0.05f; - func_809F4AE8(globalCtx, &spE0, &spD4, &spC8, Rand_ZeroFloat(10.0f) + 25.0f); + Boss07_SpawnEffect(globalCtx, &spE0, &spD4, &spC8, Rand_ZeroFloat(10.0f) + 25.0f); sBossRemains[sp178]->unk_15E |= 0xA; } else { sBossRemains[sp178]->unk_14E = 2; @@ -4653,7 +4655,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { spC8.x = spD4.x * -0.05f; spC8.y = spD4.y * -0.05f; spC8.z = spD4.z * -0.05f; - func_809F4AE8(globalCtx, &spE0, &spD4, &spC8, + Boss07_SpawnEffect(globalCtx, &spE0, &spD4, &spC8, Rand_ZeroFloat(10.0f) + 25.0f); } } @@ -4678,7 +4680,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { spA4.y = spB0.y * -0.05f; spA4.z = spB0.z * -0.05f; - func_809F4AE8(globalCtx, &spBC, &spB0, &spA4, Rand_ZeroFloat(10.0f) + 25.0f); + Boss07_SpawnEffect(globalCtx, &spBC, &spB0, &spA4, Rand_ZeroFloat(10.0f) + 25.0f); } } } else if (!player->isBurning && (this->unk_14E != 5)) { @@ -4710,7 +4712,7 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { } else { Math_ApproachZeroF(&this->unk_1898, 1.0f, 0.05f); if (this->timers[0] == 0) { - func_809FFA04(this, globalCtx); + Boss07_SetupIdle(this, globalCtx); this->timers[2] = 100; func_80A006D0(this); } @@ -4719,8 +4721,8 @@ void func_80A00720(Boss07* this, GlobalContext* globalCtx) { } } -void func_80A016E4(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_80A01750; +void Boss07_Mask_SetupIntro(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Mask_Intro; this->actor.world.pos.x = 0.0f; this->actor.world.pos.y = 300.0f; this->actor.world.pos.z = -922.5f; @@ -4741,8 +4743,7 @@ static Vec3s sCameraAts[4] = { { -500, 445, 468 }, }; -void func_80A01750(Boss07* this, GlobalContext* globalCtx) { - +void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { f32 sp8C = 0.0f; Player* player = PLAYER; @@ -4930,7 +4931,7 @@ void func_80A01750(Boss07* this, GlobalContext* globalCtx) { Camera* sp5C = Play_GetCamera(globalCtx, 0); this->csState = 0; - func_809FFA04(this, globalCtx); + Boss07_SetupIdle(this, globalCtx); this->timers[0] = 50; this->timers[2] = 200; this->unk_1888 = 50; @@ -4970,8 +4971,8 @@ void func_80A01750(Boss07* this, GlobalContext* globalCtx) { } } -void func_80A025AC(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_80A0264C; +void Boss07_Mask_SetupDeath(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Mask_Death; SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_0600AE40, -10.0f); this->actor.world.rot.y = this->actor.shape.rot.y = Math_Acot2F(-this->actor.world.pos.z, -this->actor.world.pos.x) * (0x8000 / M_PI); @@ -4981,7 +4982,7 @@ void func_80A025AC(Boss07* this, GlobalContext* globalCtx) { this->unk_15C = 20; } -void func_80A0264C(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Mask_Death(Boss07* this, GlobalContext* globalCtx) { Player* player = PLAYER; Vec3f sp60; Vec3f sp54; @@ -5061,21 +5062,21 @@ void func_80A0264C(Boss07* this, GlobalContext* globalCtx) { } } -void func_80A02B30(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Mask_CollisionCheck(Boss07* this, GlobalContext* globalCtx) { Player* player = PLAYER; ColliderInfo* hitbox; u8 sp27; Actor* hit; if (this->unk_15C == 0) { - if (this->quad1.base.acFlags & 2) { - this->quad1.base.acFlags &= ~2; + if (this->quad1.base.acFlags & AC_HIT) { + this->quad1.base.acFlags &= ~AC_HIT; this->unk_186C = 7; } - if (this->quad2.base.acFlags & 2) { - this->quad2.base.acFlags &= ~2; + if (this->quad2.base.acFlags & AC_HIT) { + this->quad2.base.acFlags &= ~AC_HIT; this->unk_186C = 15; - if ((this->actionFunc == func_80A00274) || (player->stateFlags3 & 0x200)) { + if ((this->actionFunc == Boss07_Mask_Stunned) || (player->stateFlags3 & 0x200)) { hit = this->quad2.base.ac; hitbox = this->quad2.info.acHitInfo; sp27 = (hitbox->toucher.dmgFlags & 0xF7CFFFFF) ? this->actor.colChkInfo.damage : 0; @@ -5083,12 +5084,12 @@ void func_80A02B30(Boss07* this, GlobalContext* globalCtx) { this->unk_15E = 15; func_801A72CC(&this->actor.projectedPos); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_DAMAGE2_OLD); - func_80A00484(this, globalCtx, sp27, hit); + Boss07_Mask_SetupDamaged(this, globalCtx, sp27, hit); } else { this->unk_15C = 15; func_801A72CC(&this->actor.projectedPos); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_DAMAGE1_OLD); - func_80A0021C(this, globalCtx); + Boss07_Mask_SetupStunned(this, globalCtx); } } } @@ -5141,8 +5142,8 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { func_800AEF44(Effect_GetParams(this->effectIndex)); } this->unk_18ED = this->unk_18EC; - if (this->actionFunc != func_80A01750) { - if (this->actionFunc != func_80A00554) { + if (this->actionFunc != Boss07_Mask_Intro) { + if (this->actionFunc != Boss07_Mask_Damaged) { Actor_SetVelocityXYRotation(&this->actor); Actor_ApplyMovement(&this->actor); } else { @@ -5160,7 +5161,7 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { } else { this->actor.colChkInfo.health = 0; } - func_80A02B30(this, globalCtx); + Boss07_Mask_CollisionCheck(this, globalCtx); SysMatrix_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); @@ -5200,11 +5201,11 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { if (player->stateFlags3 & 0x200) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->quad2.base); } else { - if ((this->actionFunc != func_80A00274) && (this->actionFunc != func_80A00554)) { + if ((this->actionFunc != Boss07_Mask_Stunned) && (this->actionFunc != Boss07_Mask_Damaged)) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->quad1.base); } CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->quad2.base); - if (this->actionFunc == func_809FFEAC) { + if (this->actionFunc == Boss07_Mask_Spin) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->quad1.base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->quad2.base); } @@ -5213,7 +5214,7 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { Vec3f sp5C; Vec3f sp50; Vec3f sp44; - f32 sp40 = (this->actionFunc == func_80A0264C) ? 130.0f : 80.0f; + f32 sp40 = (this->actionFunc == Boss07_Mask_Death) ? 130.0f : 80.0f; sp5C.x = randPlusMinusPoint5Scaled(sp40) + this->actor.world.pos.x; sp5C.y = randPlusMinusPoint5Scaled(sp40) + this->actor.world.pos.y; @@ -5224,13 +5225,13 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { sp44.x = sp50.x * -0.05f; sp44.y = sp50.y * -0.05f; sp44.z = sp50.z * -0.05f; - func_809F4AE8(globalCtx, &sp5C, &sp50, &sp44, Rand_ZeroFloat(10.0f) + 25.0f); + Boss07_SpawnEffect(globalCtx, &sp5C, &sp50, &sp44, Rand_ZeroFloat(10.0f) + 25.0f); func_8019F1C0(&sSfxPoint, NA_SE_EV_BURN_OUT - SFX_FLAG); } } } -void func_80A03238(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, +void Boss07_Mask_UpdateTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, Vec3f* arg6, f32 arg7, u8 arg8, f32 arg9) { f32 temp_f20; f32 temp_f22; @@ -5317,7 +5318,7 @@ void func_80A03238(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* p } } -void func_80A036C4(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, f32 arg4, f32 arg5) { +void Boss07_Mask_DrawTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3, f32 arg4, f32 arg5) { s32 i; f32 phi_f12; @@ -5339,11 +5340,11 @@ void func_80A036C4(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* a CLOSE_DISPS(globalCtx->state.gfxCtx); } -void func_80A03868(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Mask_DrawBeam(Boss07* this, GlobalContext* globalCtx) { s32 pad[4]; OPEN_DISPS(globalCtx->state.gfxCtx); - if (this->actionFunc == func_80A00720) { + 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)); gDPPipeSync(POLY_XLU_DISP++); @@ -5417,7 +5418,7 @@ void func_80A03868(Boss07* this, GlobalContext* globalCtx) { CLOSE_DISPS(globalCtx->state.gfxCtx); } -void func_80A03F18(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { +void Boss07_Mask_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { Boss07* this = THIS; if (limbIndex == 2) { @@ -5451,13 +5452,13 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); } gSPSegment(POLY_OPA_DISP++, 8, Lib_SegmentedToVirtual(D_80A082E0[this->unk_1884])); - SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, NULL, func_80A03F18, + SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, NULL, Boss07_Mask_PostLimbDraw, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); gSPDisplayList(POLY_OPA_DISP++, D_0600AFB0); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); - phi_s6 = ((this->actionFunc == func_809FFA80) && + phi_s6 = ((this->actionFunc == Boss07_Idle) && (ABS_ALT((s16)(this->actor.world.rot.y - this->actor.shape.rot.y)) > 0x4000)) ? 1 : 0; @@ -5482,16 +5483,16 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { pad2 = (1 - (i * 0.008f)) * this->unk_1870; SysMatrix_StatePop(); if (this->unk_149 != 0) { - func_80A03238(this, globalCtx, &this->tentacles[i].base, this->tentacles[i].pos, this->tentacles[i].rot, + 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); } - func_80A036C4(this, globalCtx, this->tentacles[i].pos, this->tentacles[i].rot, pad2, i * 0.9f); + Boss07_Mask_DrawTentacles(this, globalCtx, this->tentacles[i].pos, this->tentacles[i].rot, pad2, i * 0.9f); phi_f24 += 0.5f; spA8.y += 1.0f; SysMatrix_StatePop(); } - func_80A03868(this, globalCtx); + Boss07_Mask_DrawBeam(this, globalCtx); this->unk_149 = 0; CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -5592,7 +5593,7 @@ void func_80A04768(Boss07* this, GlobalContext* globalCtx) { } else { this->unk_14E = 0xA; this->timers[0] = 0xF; - func_809F4980(&this->actor); + Boss07_Remains_DamageSfx(this); } Matrix_RotateY(this->actor.yawTowardsPlayer, 0); SysMatrix_GetStateTranslationAndScaledZ(-20.0f, &sp2C); @@ -5814,7 +5815,7 @@ void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_18DB != 0) { this->unk_18DB = 0; - if ((func_809F4C40(this, globalCtx) != 0) && (sMajorasMask->actionFunc != func_80A00720)) { + if ((Boss07_IsFacingPlayer(this, globalCtx) != 0) && (sMajorasMask->actionFunc != Boss07_Mask_Beam)) { 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, 100); } @@ -5836,7 +5837,7 @@ void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { sp48.x = sp54.x * -0.05f; sp48.y = sp54.y * -0.05f; sp48.z = sp54.z * -0.05f; - func_809F4AE8(globalCtx, &sp60, &sp54, &sp48, Rand_ZeroFloat(10.0f) + 25.0f); + Boss07_SpawnEffect(globalCtx, &sp60, &sp54, &sp48, Rand_ZeroFloat(10.0f) + 25.0f); Audio_PlayActorSound2(&this->actor, NA_SE_EV_BURN_OUT - SFX_FLAG); } } @@ -6104,7 +6105,7 @@ void func_80A06500(Boss07* this, GlobalContext* globalCtx) { } } Audio_PlayActorSound2(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW); - return; + break; } } top = (Boss07*)top->actor.next; @@ -6220,11 +6221,11 @@ void Boss07_Top_Draw(Actor* thisx, GlobalContext* globalCtx2) { #ifdef NON_MATCHING // reordering in sHeartbeatTimer-- -void Boss07_Effects_Update(Actor* thisx, GlobalContext* globalCtx2) { +void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; - func_80A07638(globalCtx); + Boss07_Static_UpdateEffects(globalCtx); if (sHeartbeatTimer != 0) { sHeartbeatTimer--; @@ -6320,21 +6321,21 @@ void Boss07_Effects_Update(Actor* thisx, GlobalContext* globalCtx2) { this->csCamAt.y = sBossRemains[3]->actor.world.pos.y; this->csCamAt.z = sBossRemains[3]->actor.world.pos.z; if (this->unk_ABC8 == 40) { - Camera* temp_v0_3 = Play_GetCamera(globalCtx, 0); + Camera* camera = Play_GetCamera(globalCtx, MAIN_CAM); s32 i; this->csState = 6; this->unk_ABC8 = 0; - temp_v0_3->eye = this->csCamEye; - temp_v0_3->eyeNext = this->csCamEye; - temp_v0_3->at = this->csCamAt; + camera->eye = this->csCamEye; + camera->eyeNext = this->csCamEye; + camera->at = this->csCamAt; func_80169AFC(globalCtx, this->csCamIndex, 0); this->csCamIndex = 0; func_800EA0EC(globalCtx, &globalCtx->csCtx); func_800B7298(globalCtx, &this->actor, 6); func_80165690(); for (i = 0; i < 4; i++) { - func_800BC154(globalCtx, &globalCtx->actorCtx, &sBossRemains[i]->actor, 5); + func_800BC154(globalCtx, &globalCtx->actorCtx, &sBossRemains[i]->actor, ACTORCAT_ENEMY); } } break; @@ -6360,18 +6361,18 @@ void Boss07_Effects_Update(Actor* thisx, GlobalContext* globalCtx2) { } } #else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Effects_Update.s") +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Static_Update.s") #endif -void Boss07_Effects_Draw(Actor* thisx, GlobalContext* globalCtx2) { +void Boss07_Static_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; - func_80A07740(globalCtx); - func_809FBF94(this, globalCtx); + Boss07_Static_DrawEffects(globalCtx); + Boss07_Static_DrawLight(this, globalCtx); } -void func_80A07638(GlobalContext* globalCtx) { +void Boss07_Static_UpdateEffects(GlobalContext* globalCtx) { Boss07Effect* effect = (Boss07Effect*)globalCtx->specialEffects; s32 i; @@ -6405,7 +6406,7 @@ void func_80A07638(GlobalContext* globalCtx) { } } -void func_80A07740(GlobalContext* globalCtx) { +void Boss07_Static_DrawEffects(GlobalContext* globalCtx) { Boss07Effect* effect = (Boss07Effect*)globalCtx->specialEffects; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; s32 i; From 123249cfe63569e57a8675518556a529cecb4e15 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Thu, 7 Oct 2021 09:40:36 -0500 Subject: [PATCH 07/28] more improvements --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 35 +++++++++------------ tools/disasm/functions.txt | 14 ++++----- 2 files changed, 21 insertions(+), 28 deletions(-) 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 d0356e8ce..668b80991 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -874,8 +874,6 @@ static s32 sSeed0; static s32 sSeed1; static s32 sSeed2; -#define NON_MATCHING - void Boss07_Remains_DamageSfx(Boss07* this) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_DAMAGE); } @@ -1092,7 +1090,6 @@ static Vec3f sRemainsStart[4] = { { -24.0f, 88.0f, -70.0f }, { -70.0f, 70.0f, -70.0f }, }; - static Vec3s sRemainsEnd[4] = { { 712, 0xD500, -416 }, { -712, 0x2B00, -420 }, @@ -2956,7 +2953,6 @@ static Vec3f sWrathColliderOffsets[11] = { { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, }; - static s8 sWrathBodyParts[32] = { -1, -1, 2, -1, 12, -1, 13, 14, -1, 9, -1, 10, 11, -1, 1, -1, 6, 7, 8, -1, -1, 3, 4, 5, -1, -1, 0, -1, -1, -1, 0, 0, }; @@ -4129,9 +4125,7 @@ void func_809FF6B0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* } i = D_80A081C8[limbIndex]; if (i >= 0) { - f32 temp_f12 = this->unk_17B8[i]; - - Matrix_Scale(temp_f12, temp_f12, temp_f12, 1); + Matrix_Scale(this->unk_17B8[i], this->unk_17B8[i], this->unk_17B8[i], 1); } } @@ -4730,20 +4724,19 @@ void Boss07_Mask_SetupIntro(Boss07* this, GlobalContext* globalCtx) { func_8016566C(this->unk_160); } -static Vec3s sCameraEyes[4] = { - { 616, 402, -46 }, - { -622, 380, -86 }, - { 400, 300, 463 }, - { -400, 470, 496 }, -}; -static Vec3s sCameraAts[4] = { - { 646, 394, -150 }, - { -648, 380, -190 }, - { 502, 321, 438 }, - { -500, 445, 468 }, -}; - void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { + static Vec3s sCameraEyes[4] = { + { 616, 402, -46 }, + { -622, 380, -86 }, + { 400, 300, 463 }, + { -400, 470, 496 }, + }; + static Vec3s sCameraAts[4] = { + { 646, 394, -150 }, + { -648, 380, -190 }, + { 502, 321, 438 }, + { -500, 445, 468 }, + }; f32 sp8C = 0.0f; Player* player = PLAYER; @@ -6224,7 +6217,7 @@ void Boss07_Top_Draw(Actor* thisx, GlobalContext* globalCtx2) { void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; - + Boss07_Static_UpdateEffects(globalCtx); if (sHeartbeatTimer != 0) { diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index a222825ec..086fded3a 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -9440,8 +9440,8 @@ 0x809F2F0C:("Boss06_Update",), 0x809F334C:("Boss06_Draw",), 0x809F4980:("func_809F4980",), - 0x809F49A0:("func_809F49A0",), - 0x809F49C0:("func_809F49C0",), + 0x809F49A0:("Boss07_Wrath_InitRand",), + 0x809F49C0:("Boss07_Wrath_RandZeroOne",), 0x809F4AE8:("func_809F4AE8",), 0x809F4BB0:("func_809F4BB0",), 0x809F4C40:("func_809F4C40",), @@ -9530,7 +9530,7 @@ 0x809FF6B0:("func_809FF6B0",), 0x809FF810:("func_809FF810",), 0x809FF900:("Boss07_Incarnation_Draw",), - 0x809FFA04:("func_809FFA04",), + 0x809FFA04:("Boss07_SetupIdle",), 0x809FFA80:("func_809FFA80",), 0x809FFE64:("func_809FFE64",), 0x809FFEAC:("func_809FFEAC",), @@ -9541,7 +9541,7 @@ 0x80A006D0:("func_80A006D0",), 0x80A006F4:("func_80A006F4",), 0x80A00720:("func_80A00720",), - 0x80A016E4:("func_80A016E4",), + 0x80A016E4:("Boss07_Mask_SetupIntro",), 0x80A01750:("func_80A01750",), 0x80A025AC:("func_80A025AC",), 0x80A0264C:("func_80A0264C",), @@ -9571,9 +9571,9 @@ 0x80A06990:("func_80A06990",), 0x80A06C64:("Boss07_Top_Update",), 0x80A06E24:("Boss07_Top_Draw",), - 0x80A06F48:("Boss07_Effects_Update",), - 0x80A07604:("Boss07_Effects_Draw",), - 0x80A07638:("func_80A07638",), + 0x80A06F48:("Boss07_Static_Update",), + 0x80A07604:("Boss07_Static_Draw",), + 0x80A07638:("Boss07_Static_UpdateEffects",), 0x80A07740:("func_80A07740",), 0x80A0A8A0:("BgDyYoseizo_Init",), 0x80A0A95C:("BgDyYoseizo_Destroy",), From 82ba0b0f8b3452c57c5faea1d21dab8f1af6bab7 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Sat, 16 Oct 2021 07:43:19 -0500 Subject: [PATCH 08/28] more stuff --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 301 ++++++++++---------- src/overlays/actors/ovl_Boss_07/z_boss_07.h | 50 +++- 2 files changed, 187 insertions(+), 164 deletions(-) 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 668b80991..bcdef5ee1 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -8,6 +8,16 @@ #define FACING_ANGLE(actor1, actor2) ((s16)((actor1)->shape.rot.y - (actor2)->shape.rot.y + 0x8000)) +#define EFFECT_COUNT 50 + +typedef enum { + /* 0 */ REMAINS_ODOLWA, + /* 1 */ REMAINS_GOHT, + /* 2 */ REMAINS_GYORG, + /* 3 */ REMAINS_TWINMOLD, + /* 4 */ REMAINS_COUNT +} RemainsIndex; + typedef struct { /* 0x00 */ u8 unk_0; /* 0x02 */ s16 unk_2; @@ -23,6 +33,7 @@ typedef struct { /* 0x38 */ char unk38[0x10]; } Boss07Effect; +#if 1 // function prototypes void Boss07_Init(Actor* thisx, GlobalContext* globalCtx); void Boss07_Destroy(Actor* thisx, GlobalContext* globalCtx); @@ -163,8 +174,9 @@ 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); +#endif -// object addresses +#if 1 // object addresses extern AnimationHeader D_06000194; extern AnimationHeader D_06000428; extern AnimationHeader D_06000D0C; @@ -234,6 +246,7 @@ extern UNK_TYPE D_06041B30[]; extern UNK_TYPE D_06042330[]; extern UNK_TYPE D_06043330[]; extern UNK_TYPE D_06045B30[]; +#endif static s16 D_80A07950[4][3] = { { 255, 255, 100 }, @@ -249,7 +262,7 @@ static s16 D_80A07968[4][3] = { { 255, 255, 255 }, }; -#if 1 // use to collapse collision data +#if 1 // collision data static DamageTable sMaskDmgTable = { /* Deku Nut */ DMG_ENTRY(0, 0x0), @@ -866,10 +879,10 @@ static s32 sWhipSegCount; static Boss07* sMajorasWrath; static Boss07* sMajoraStatic; static Boss07* sMajorasMask; -static Boss07* sBossRemains[4]; +static Boss07* sBossRemains[REMAINS_COUNT]; static u8 D_80A09A70; static u8 sMusicStartTimer; -static Boss07Effect sEffects[50]; +static Boss07Effect sEffects[EFFECT_COUNT]; static s32 sSeed0; static s32 sSeed1; static s32 sSeed2; @@ -903,7 +916,7 @@ void Boss07_SpawnEffect(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3 s32 i; Boss07Effect* effect = (Boss07Effect*)globalCtx->specialEffects; - for (i = 0; i < 50; i++, effect++) { + for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { if (effect->unk_0 == 0) { effect->unk_0 = 1; effect->unk_4 = *arg1; @@ -1084,13 +1097,13 @@ void Boss07_Wrath_BombWhips(Boss07* this, GlobalContext* globalCtx) { } } -static Vec3f sRemainsStart[4] = { +static Vec3f sRemainsStart[REMAINS_COUNT] = { { 70.0f, 70.0f, -70.0f }, { 24.0f, 88.0f, -70.0f }, { -24.0f, 88.0f, -70.0f }, { -70.0f, 70.0f, -70.0f }, }; -static Vec3s sRemainsEnd[4] = { +static Vec3s sRemainsEnd[REMAINS_COUNT] = { { 712, 0xD500, -416 }, { -712, 0x2B00, -420 }, { 702, 0xAB00, 415 }, @@ -1100,14 +1113,15 @@ static Vec3s sRemainsEnd[4] = { #ifdef NON_MATCHING // reordering when loading Boss07_Projectile_Update void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { - static s16 sRemainsParams[4] = { 200, 201, 202, 203 }; + static s16 sRemainsParams[REMAINS_COUNT] = { MAJORA_REMAINS + REMAINS_ODOLWA, MAJORA_REMAINS + REMAINS_GOHT, MAJORA_REMAINS + REMAINS_GYORG, MAJORA_REMAINS + REMAINS_TWINMOLD, }; static EffTireMarkInit sTopTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; static EffTireMarkInit sMaskTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; s32 i; + f32 whipScale = 1.0; - if (this->actor.params == 150) { + if (this->actor.params == MAJORA_STATIC) { this->actor.update = Boss07_Static_Update; this->actor.draw = Boss07_Static_Draw; this->actor.flags &= ~1; @@ -1116,16 +1130,16 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { globalCtx->envCtx.unk_C3 = 0; globalCtx->envCtx.unk_E0 = 2; } else { - if (this->actor.params == 0) { - this->actor.params = 10; + if (this->actor.params == MAJORA_BOSS) { + this->actor.params = MAJORA_MASK; 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, 150); + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, MAJORA_STATIC); globalCtx->specialEffects = (void*)sEffects; - for (i = 0; i < 50; i++) { + for (i = 0; i < ARRAY_COUNT(sEffects); i++) { sEffects[i].unk_0 = 0; } - for (i = 0; i < 4; i++) { + for (i = 0; i < ARRAY_COUNT(sBossRemains); i++) { sBossRemains[i] = NULL; } } @@ -1134,24 +1148,24 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.gravity = -2.5f; if(1) {} - if (this->actor.params >= 200) { + if (this->actor.params >= MAJORA_REMAINS) { this->actor.update = Boss07_Remains_Update; this->actor.draw = Boss07_Remains_Draw; if(1) {} - sBossRemains[this->actor.params - 200] = this; + sBossRemains[this->actor.params - MAJORA_REMAINS] = this; if (gSaveContext.eventInf[6] & 2) { Actor_SetScale(&this->actor, 0.03f); - this->actor.world.pos.x = sRemainsEnd[this->actor.params - 200].x; + this->actor.world.pos.x = sRemainsEnd[this->actor.params - MAJORA_REMAINS].x; this->actor.world.pos.y = 370.0f; - this->actor.world.pos.z = sRemainsEnd[this->actor.params - 200].z; - this->actor.shape.rot.y = sRemainsEnd[this->actor.params - 200].y; + 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); } else { func_80A04878(this, globalCtx); } this->actor.flags &= ~1; this->actor.colChkInfo.damageTable = &sRemainsDmgTable; - } else if (this->actor.params == 180) { + } else if (this->actor.params == MAJORA_TOP) { this->actor.update = Boss07_Top_Update; this->actor.draw = Boss07_Top_Draw; @@ -1162,21 +1176,19 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &sTopCylInit); Effect_Add(globalCtx, &this->effectIndex, 4, 0, 0, &sTopTireMarkInit); this->actor.flags &= ~1; - } else if ((this->actor.params == 100) || ((this->actor.params & 0xFFFFFFFF) == 101)) { - + } else if ((this->actor.params == MAJORA_REMAINS_SHOT) || (this->actor.params == MAJORA_INCARNATION_SHOT)) { this->actor.update = Boss07_Projectile_Update; this->actor.draw = Boss07_Projectile_Draw; - this->actor.flags &= ~1; Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &sShotCylInit); func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); this->unk_181C = Rand_ZeroFloat(3.99f); - } else if ((this->actor.params == 10) || (this->actor.params == 11)) { + } 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, - 19); - if (this->actor.params == 10) { + MAJORA_MASK_LIMB_COUNT); + if (this->actor.params == MAJORA_MASK) { this->actor.update = Boss07_Mask_Update; this->actor.draw = Boss07_Mask_Draw; Effect_Add(globalCtx, &this->effectIndex, 4, 0, 0, &sMaskTireMarkInit); @@ -1201,16 +1213,16 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { Collider_InitAndSetQuad(globalCtx, &this->quad1, &this->actor, &sMaskQuadInit1); Collider_InitAndSetQuad(globalCtx, &this->quad2, &this->actor, &sMaskQuadInit2); this->actor.colChkInfo.health = 14; - for (i = 0; i < 4; i++) { + for (i = 0; i < ARRAY_COUNT(sBossRemains); i++) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BOSS_07, 0.0f, 0.0f, 0.0f, 0, 0, 0, sRemainsParams[i]); } } - } else if ((this->actor.params == 20) || (this->actor.params == 21)) { + } else if ((this->actor.params == MAJORA_INCARNATION) || (this->actor.params == MAJORA_AFTERIMAGE)) { Actor_SetScale(&this->actor, 0.015000001f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060099A0, &D_0600A6AC, this->jointTable1, - this->morphTable1, 25); - if (this->actor.params == 21) { + this->morphTable1, MAJORA_INCARNATION_LIMB_COUNT); + if (this->actor.params == MAJORA_AFTERIMAGE) { this->timers[0] = this->actor.world.rot.z; this->actor.world.rot.z = 0; this->actor.update = Boss07_Afterimage_Update; @@ -1250,11 +1262,11 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { func_809F5E14(this, globalCtx); } else { func_809F7400(this, globalCtx, 50); - this->whipScale = 1.0; + this->whipScale = whipScale; Audio_QueueSeqCmd(0x8069); } SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060335F0, &D_0603CBD0, this->jointTable1, - this->morphTable1, 28); + this->morphTable1, 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); @@ -1282,10 +1294,10 @@ void Boss07_Destroy(Actor* thisx, GlobalContext* globalCtx2) { Boss07* this = THIS; switch (this->actor.params) { - case 30: + case MAJORA_WRATH: Collider_DestroyQuad(globalCtx, &this->quad1); Collider_DestroyQuad(globalCtx, &this->quad2); - case 180: + case MAJORA_TOP: Effect_Destroy(globalCtx, this->effectIndex); break; } @@ -1397,8 +1409,8 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { func_800B7298(globalCtx, &this->actor, 6); this->actor.flags |= 1; func_80165690(); - if (sBossRemains[0] != NULL) { - for (i = 0; i < 4; i++) { + if (sBossRemains[REMAINS_ODOLWA] != NULL) { + for (i = 0; i < ARRAY_COUNT(sBossRemains); i++) { func_800BC154(globalCtx, &globalCtx->actorCtx, &sBossRemains[i]->actor, ACTORCAT_BOSS); } } @@ -1432,7 +1444,7 @@ void func_809F64F4(Boss07* this, GlobalContext* globalCtx) { this->actor.flags &= ~1; this->csState = 0; this->unk_ABC8 = 0; - if (sBossRemains[0] != NULL) { + if (sBossRemains[REMAINS_ODOLWA] != NULL) { for (i = 0; i < 4; i++) { sBossRemains[i]->unk_14E = 2; } @@ -1479,7 +1491,7 @@ 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_Wrath_InitRand(1, 0x71AC, 0x263A); - for (i = 0; i < 30; i++) { + for (i = 0; i < ARRAY_COUNT(this->unk_AB50); i++) { this->unk_AB50[i] = Boss07_Wrath_RandZeroOne() - 1.0f; } func_8016566C(150); @@ -1611,7 +1623,7 @@ 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 < 30; i++) { + for (i = 0; i < ARRAY_COUNT(this->unk_AB50); i++) { Math_ApproachF(&this->unk_AB50[i], sp98, 1.0f, sp94); } Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.1f); @@ -1775,7 +1787,7 @@ void func_809F783C(Boss07* this, GlobalContext* globalCtx) { this->actor.velocity.y = 25.0f; dx = 0.0f - this->actor.world.pos.x; dz = 0.0f - this->actor.world.pos.z; - // temp2 = ; + temp = this->actor.yawTowardsPlayer - (s16)(Math_Acot2F(dz, dx) * (0x8000 / M_PI)); if (temp < 0) { dx = 200.0f; @@ -2278,7 +2290,7 @@ void func_809F8EC8(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_14C == 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, 180); + this->actor.world.pos.z, 0, 0, 0, MAJORA_TOP); } if (1) {} if (this->unk_14C == 10) { @@ -2475,9 +2487,9 @@ void func_809F99C4(Boss07* this, GlobalContext* globalCtx) { func_809F4FF8(globalCtx, &player->actor.world.pos, 12); play_sound(NA_SE_IT_HOOKSHOT_STICK_OBJ); } - for (i = 0; i < 11; i++) { + for (i = 0; i < ARRAY_COUNT(this->sphElems1); i++) { if (this->sph1.elements[i].info.bumperFlags & 2) { - for (j = 0; j < 11; j++) { + for (j = 0; j < ARRAY_COUNT(this->sphElems1); j++) { this->sph1.elements[j].info.bumperFlags &= ~2; } if (this->unk_1804 == 10) { @@ -2541,7 +2553,7 @@ void func_809F9CEC(Boss07* this, GlobalContext* globalCtx) { Vec3f sp80; s32 i; - Audio_PlaySoundAtPosition(globalCtx, this->bodyPartsPos, 0x1E, NA_SE_EV_ICE_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, this->bodyPartsPos, 30, NA_SE_EV_ICE_BROKEN); for (i = 0; i < 30; i++) { sp80.x = randPlusMinusPoint5Scaled(7.0f); sp80.z = randPlusMinusPoint5Scaled(7.0f); @@ -2685,7 +2697,7 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { func_809F94AC(this->rightWhip.pos, this->rightWhip.tension, this, globalCtx); func_809F94AC(this->leftWhip.pos, this->leftWhip.tension, this, globalCtx); if (this->unk_158 != 0) { - for (i = 0; i < 11; i++) { + for (i = 0; i < ARRAY_COUNT(this->sphElems1); i++) { this->sph1.elements[i].info.bumperFlags &= ~2; } } @@ -3022,7 +3034,7 @@ void Boss07_Wrath_DrawShocks(Boss07* this, GlobalContext* globalCtx) { if (this->unk_32C > 0.0f) { gSPDisplayList(POLY_XLU_DISP++, D_04023348); - for (i = 0; i < 15; i++) { + for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) { SysMatrix_InsertTranslation(this->bodyPartsPos[i].x, this->bodyPartsPos[i].y, this->bodyPartsPos[i].z, 0); SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC); Matrix_Scale(this->unk_32C, this->unk_32C, this->unk_32C, 1); @@ -3042,7 +3054,7 @@ void Boss07_Wrath_DrawShocks(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_330 > 0.0f) { gSPDisplayList(POLY_XLU_DISP++, D_040233B8); - for (i = 0; i < 30; i++) { + for (i = 0; i < 2 * ARRAY_COUNT(this->bodyPartsPos); i++) { SysMatrix_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); @@ -3070,7 +3082,7 @@ void Boss07_Wrath_DrawDeathLights(Boss07* this, GlobalContext* globalCtx, Vec3f* Boss07_Wrath_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 < 30; i++) { + for (i = 0; i < ARRAY_COUNT(this->unk_AB50); i++) { temp = D_80A07950[0]; gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, temp[0], temp[1], temp[2], 40); temp_f20 = (Boss07_Wrath_RandZeroOne() * 40.0f) - 30.0f; @@ -3204,7 +3216,7 @@ void Boss07_Wrath_MakeShadowCircles(Boss07* this, u8* shadowTex, f32 weight) { Vec3f sp74; Vec3f sp68; - for (i = 0; i < 15; i++) { + for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) { if ((weight == 0.0f) || ((j = sBodyPartsIndex2[i]) >= 0)) { if (weight > 0.0f) { VEC3F_LERPIMPDST(&lerp, &this->bodyPartsPos[i], &this->bodyPartsPos[j], weight); @@ -3319,7 +3331,7 @@ void func_809FCC70(Boss07* this, GlobalContext* globalCtx) { this->unk_17D8 = 0x6E00; } -#ifdef NON_MATCHING +#ifndef NON_MATCHING // float literals for 1.0f void func_809FCCCC(Boss07* this, GlobalContext* globalCtx) { s32 i; @@ -3389,10 +3401,7 @@ void func_809FCCCC(Boss07* this, GlobalContext* globalCtx) { if (this->unk_ABC8 == 80) { this->csState = 4; this->unk_ABC8 = 0; - this->unk_17B8[0] = 1.0f; - this->unk_17B8[1] = 1.0f; - this->unk_17B8[2] = 1.0f; - this->unk_17B8[3] = 1.0f; + this->unk_17B8[0] = this->unk_17B8[1] = this->unk_17B8[2] = this->unk_17B8[3] = 1.0f; } break; case 4: @@ -3463,7 +3472,7 @@ void func_809FCCCC(Boss07* this, GlobalContext* globalCtx) { } break; } - for (i = 0; i < 4; i++) { + for (i = 0; i < ArRAY_COUNT(this->unk_17C8); i++) { Math_ApproachZeroF(&this->unk_17C8[i], 0.5f, 0.1f); } SysMatrix_MultiplyVector3fByState(&this->csCamNextEye, &this->csCamEye); @@ -3649,11 +3658,11 @@ void func_809FDF54(Boss07* this, GlobalContext* globalCtx) { Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 0x3000); if (func_801378B8(&this->skelAnime, 4.0f)) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BOSS_07, this->unk_17A0.x, this->unk_17A0.y, - this->unk_17A0.z, 0, 0, 0, 101); + this->unk_17A0.z, 0, 0, 0, MAJORA_INCARNATION_SHOT); } if (func_801378B8(&this->skelAnime, 9.0f)) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BOSS_07, this->unk_17AC.x, this->unk_17AC.y, - this->unk_17AC.z, 0, 0, 0, 101); + this->unk_17AC.z, 0, 0, 0, MAJORA_INCARNATION_SHOT); } if (this->timers[0] == 0) { func_809FDB2C(this, globalCtx); @@ -3884,7 +3893,7 @@ void func_809FE734(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_ABC8 == 40) { 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, this->csCamIndex, 30); + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, this->csCamIndex, MAJORA_WRATH); Actor_MarkForDeath(&this->actor); } break; @@ -3916,9 +3925,9 @@ void func_809FEE70(Boss07* this, GlobalContext* globalCtx) { u8 damage; if (this->unk_15C == 0) { - for (i = 0; i < 11; i++) { + for (i = 0; i < ARRAY_COUNT(this->sphElems1); i++) { if (this->sph1.elements[i].info.bumperFlags & 2) { - for (j = 0; j < 11; j++) { + for (j = 0; j < ARRAY_COUNT(this->sphElems1); j++) { this->sph1.elements[j].info.bumperFlags &= ~2; } if (this->unk_1804 == 10) { @@ -3972,20 +3981,19 @@ void Boss07_Afterimage_Update(Actor* thisx, GlobalContext* globalCtx2) { } } -#ifdef NON_MATCHING -// Incorrect load of 0.1f in the first Math_ApproachF void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { static u8 D_80A08198[8] = { 1, 0, 3, 0, 4, 0, 5, 0 }; static u8 D_80A081A0[8] = { 0, 3, 0, 4, 0, 5, 0, 1 }; GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; s32 i; - s32 pad; + this->actor.hintId = 51; this->unk_14C++; 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; @@ -4021,7 +4029,7 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { } } if (this->unk_158 != 0) { - for (i = 0; i < 11; i++) { + for (i = 0; i < ARRAY_COUNT(this->sphElems1); i++) { this->sph1.elements[i].info.bumperFlags &= ~2; } } @@ -4037,18 +4045,13 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, 7, 21); if (afterimage != NULL) { - for (i = 0; i < 25; i++) { + for (i = 0; i < MAJORA_INCARNATION_LIMB_COUNT; i++) { afterimage->skelAnime.limbDrawTbl[i] = this->skelAnime.limbDrawTbl[i]; } } } func_809F9E94(this, globalCtx); } -#else -static u8 D_80A08198[8] = { 1, 0, 3, 0, 4, 0, 5, 0 }; -static u8 D_80A081A0[8] = { 0, 3, 0, 4, 0, 5, 0, 1 }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Incarnation_Update.s") -#endif void Boss07_Afterimage_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; @@ -4598,7 +4601,7 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { } } SysMatrix_StatePop(); - for (sp178 = 0; sp178 < 4; sp178++) { + for (sp178 = 0; sp178 < ARRAY_COUNT(sBossRemains); sp178++) { if (sBossRemains[sp178]->unk_14E >= 2) { continue; } @@ -4796,10 +4799,10 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { Math_ApproachZeroF(&sMajoraStatic->unk_AB44, 1.0f, 0.05f); } if (this->unk_ABC8 == 20) { - sBossRemains[0]->unk_14E = 1; - sBossRemains[1]->unk_14E = 1; - sBossRemains[2]->unk_14E = 1; - sBossRemains[3]->unk_14E = 1; + sBossRemains[REMAINS_ODOLWA]->unk_14E = 1; + sBossRemains[REMAINS_GOHT]->unk_14E = 1; + sBossRemains[REMAINS_GYORG]->unk_14E = 1; + sBossRemains[REMAINS_TWINMOLD]->unk_14E = 1; } if (this->unk_ABC8 == 0) { func_800B7298(globalCtx, &this->actor, 7); @@ -4813,13 +4816,13 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_ABC8 >= 160) { if (this->unk_ABC8 == 160) { - sBossRemains[0]->unk_14E = 2; - sBossRemains[1]->unk_14E = 2; - sBossRemains[2]->unk_14E = 2; - sBossRemains[3]->unk_14E = 2; + sBossRemains[REMAINS_ODOLWA]->unk_14E = 2; + sBossRemains[REMAINS_GOHT]->unk_14E = 2; + sBossRemains[REMAINS_GYORG]->unk_14E = 2; + sBossRemains[REMAINS_TWINMOLD]->unk_14E = 2; } if (this->unk_ABC8 == 161) { - sBossRemains[0]->unk_14E = 3; + sBossRemains[REMAINS_ODOLWA]->unk_14E = 3; } if ((this->unk_ABC8 == 180) || (this->unk_ABC8 == 200) || (this->unk_ABC8 == 220)) { this->unk_ABCC++; @@ -4840,10 +4843,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[0], globalCtx); - func_80A04DE0(sBossRemains[1], globalCtx); - func_80A04DE0(sBossRemains[2], globalCtx); - func_80A04DE0(sBossRemains[3], globalCtx); + func_80A04DE0(sBossRemains[REMAINS_ODOLWA], globalCtx); + func_80A04DE0(sBossRemains[REMAINS_GOHT], globalCtx); + func_80A04DE0(sBossRemains[REMAINS_GYORG], globalCtx); + func_80A04DE0(sBossRemains[REMAINS_TWINMOLD], globalCtx); this->csCamSpeedMod = 0.0f; sMajoraStatic->unk_AB44 = 0.0f; Audio_QueueSeqCmd(0x100A00FF); @@ -5035,7 +5038,7 @@ void Boss07_Mask_Death(Boss07* this, GlobalContext* globalCtx) { } case 2: Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BOSS_07, 0.0f, 0.0f, 0.0f, 0, this->actor.shape.rot.y, - this->csCamIndex, 20); + this->csCamIndex, MAJORA_INCARNATION); Actor_MarkForDeath(&this->actor); break; } @@ -5241,7 +5244,7 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* Vec3f* sp7C = pull; if (this->unk_1874 != 0) { - for (i = 0; i < 10; i++) { + for (i = 0; i < MAJORA_TENT_LENGTH; i++) { SysMatrix_StatePush(); SysMatrix_InsertZRotation_f(arg9, 1); sp98.x = Math_SinS((2 * i + this->unk_14C) * 0x1600) * 10; @@ -5254,7 +5257,7 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* SysMatrix_StatePop(); } } - for (i = 0; i < 10; i++, pull++) { + for (i = 0; i < MAJORA_TENT_LENGTH; i++, pull++) { if (i == 0) { pos[0] = *base; } else { @@ -5269,11 +5272,11 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* pull = sp7C + 1; sp98.x = sp98.y = 0.0f; sp98.z = arg7 * 23.0f; - for (i = 1; i < 10; i++, pull++, pos++, rot++) { - if (i < 5) { - sp80.x = arg6->x * (5 - i) * 0.2f; - sp80.y = arg6->y * (5 - i) * 0.2f; - sp80.z = arg6->z * (5 - i) * 0.2f; + for (i = 1; i < MAJORA_TENT_LENGTH; i++, pull++, pos++, rot++) { + if (i < MAJORA_TENT_LENGTH / 2) { + sp80.x = arg6->x * (MAJORA_TENT_LENGTH / 2 - i) * 0.2f; + sp80.y = arg6->y * (MAJORA_TENT_LENGTH / 2 - i) * 0.2f; + sp80.z = arg6->z * (MAJORA_TENT_LENGTH / 2 - i) * 0.2f; } else { sp80 = D_801D15B0; } @@ -5316,15 +5319,15 @@ void Boss07_Mask_DrawTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* ar f32 phi_f12; OPEN_DISPS(globalCtx->state.gfxCtx); - for (i = 0; i < 9; i++, arg2++, arg3++) { + for (i = 0; i < MAJORA_TENT_LENGTH - 1; i++, arg2++, arg3++) { SysMatrix_InsertTranslation(arg2->x, arg2->y, arg2->z, 0); SysMatrix_InsertYRotation_f(arg3->y, 1); SysMatrix_RotateStateAroundXAxis(arg3->x); SysMatrix_InsertZRotation_f(arg5, 1); - if (i <= 4) { + if (i <= (MAJORA_TENT_LENGTH - 1) / 2) { phi_f12 = 0.035f; } else { - phi_f12 = 0.035f - (i - 4) * 60.0f * 0.0001f; + 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); @@ -5464,7 +5467,7 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { spA8.y = 20.0f; spA8.z = -2.0f; phi_f24 = 0.0f; - for (i = 0; i < 25; i++) { + for (i = 0; i < MAJORA_TENT_COUNT; i++) { SysMatrix_StatePush(); SysMatrix_StatePush(); SysMatrix_InsertZRotation_f(phi_f24, 1); @@ -5501,7 +5504,7 @@ void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx2) { Player* player = PLAYER; this->unk_14C++; - if (this->actor.params == 100) { + if (this->actor.params == MAJORA_REMAINS_SHOT) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_BEAM - SFX_FLAG); } if (KREG(63) == 0) { @@ -5517,7 +5520,7 @@ void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_14E = 1; this->actor.speedXZ = 30.0f; func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); - if (this->actor.params == 101) { + if (this->actor.params == MAJORA_INCARNATION_SHOT) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_FIRE_OLD); } } @@ -5623,9 +5626,9 @@ void func_80A04890(Boss07* this, GlobalContext* globalCtx) { if (player->transformation == 0) { this->actor.world.pos.y += 30.0f + KREG(48); } - this->unk_164.x = sRemainsStart[this->actor.params - 200].x + player->actor.world.pos.x; - this->unk_164.y = sRemainsStart[this->actor.params - 200].y + player->actor.world.pos.y; - this->unk_164.z = sRemainsStart[this->actor.params - 200].z + player->actor.world.pos.z; + this->unk_164.x = sRemainsStart[this->actor.params - MAJORA_REMAINS].x + player->actor.world.pos.x; + this->unk_164.y = sRemainsStart[this->actor.params - MAJORA_REMAINS].y + player->actor.world.pos.y; + this->unk_164.z = sRemainsStart[this->actor.params - MAJORA_REMAINS].z + player->actor.world.pos.z; sp54 = this->unk_164.x - this->actor.world.pos.x; sp50 = this->unk_164.y - this->actor.world.pos.y; sp4C = this->unk_164.z - this->actor.world.pos.z; @@ -5641,9 +5644,9 @@ void func_80A04890(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.scale.x, 0.004f, 0.5f, 0.0002f); this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; if (this->unk_ABC8 > 90) { - this->unk_164.x = sRemainsEnd[this->actor.params - 200].x; + this->unk_164.x = sRemainsEnd[this->actor.params - MAJORA_REMAINS].x; this->unk_164.y = 370.0f; - this->unk_164.z = sRemainsEnd[this->actor.params - 200].z; + this->unk_164.z = sRemainsEnd[this->actor.params - MAJORA_REMAINS].z; sp38 = 20.0f; sp34 = 0.5f; sp40 = 4096.0f; @@ -5673,10 +5676,10 @@ void func_80A04890(Boss07* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.0f); this->unk_188C = 0.0f; this->actor.speedXZ = 0.0f; - this->actor.world.pos.x = sRemainsEnd[this->actor.params - 200].x * 0.6f; + this->actor.world.pos.x = sRemainsEnd[this->actor.params - MAJORA_REMAINS].x * 0.6f; this->actor.world.pos.y = 370.0f; - this->actor.world.pos.z = sRemainsEnd[this->actor.params - 200].z * 0.6f; - this->actor.shape.rot.y = sRemainsEnd[this->actor.params - 200].y; + this->actor.world.pos.z = sRemainsEnd[this->actor.params - MAJORA_REMAINS].z * 0.6f; + this->actor.shape.rot.y = sRemainsEnd[this->actor.params - MAJORA_REMAINS].y; this->unk_ABCC = 0; break; case 3: @@ -5685,8 +5688,8 @@ void func_80A04890(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_STAY); } Actor_SetScale(&this->actor, 0.03f); - Math_ApproachF(&this->actor.world.pos.x, sRemainsEnd[this->actor.params - 200].x, 0.5f, 40.0f); - Math_ApproachF(&this->actor.world.pos.z, sRemainsEnd[this->actor.params - 200].z, 0.5f, 22.0f); + Math_ApproachF(&this->actor.world.pos.x, sRemainsEnd[this->actor.params - MAJORA_REMAINS].x, 0.5f, 40.0f); + Math_ApproachF(&this->actor.world.pos.z, sRemainsEnd[this->actor.params - MAJORA_REMAINS].z, 0.5f, 22.0f); break; } } @@ -5810,7 +5813,7 @@ void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { this->unk_18DB = 0; if ((Boss07_IsFacingPlayer(this, globalCtx) != 0) && (sMajorasMask->actionFunc != Boss07_Mask_Beam)) { 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, 100); + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, MAJORA_REMAINS_SHOT); } } if (this->unk_18D6 != 0) { @@ -5899,16 +5902,16 @@ void Boss07_Remains_Draw(Actor* thisx, GlobalContext* globalCtx2) { SysMatrix_RotateStateAroundXAxis(sp60); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); switch (this->actor.params) { - case 200: + case MAJORA_REMAINS + REMAINS_ODOLWA: gSPDisplayList(POLY_OPA_DISP++, D_060149A0); break; - case 201: + case MAJORA_REMAINS + REMAINS_GOHT: gSPDisplayList(POLY_OPA_DISP++, D_06016090); break; - case 202: + case MAJORA_REMAINS + REMAINS_GYORG: gSPDisplayList(POLY_OPA_DISP++, D_06017DE0); break; - case 203: + case MAJORA_REMAINS + REMAINS_TWINMOLD: gSPDisplayList(POLY_OPA_DISP++, D_06019328); break; } @@ -6058,7 +6061,7 @@ void func_80A06500(Boss07* this, GlobalContext* globalCtx) { top = (Boss07*)globalCtx->actorCtx.actorList[ACTORCAT_BOSS].first; while (top != NULL) { - if ((this != top) && (top->actor.params == 180) && (top->unk_158 == 0)) { + if ((this != top) && (top->actor.params == MAJORA_TOP) && (top->unk_158 == 0)) { dx = top->actor.world.pos.x - this->actor.world.pos.x; dy = top->actor.world.pos.y - this->actor.world.pos.y; dz = top->actor.world.pos.z - this->actor.world.pos.z; @@ -6212,8 +6215,6 @@ void Boss07_Top_Draw(Actor* thisx, GlobalContext* globalCtx2) { CLOSE_DISPS(globalCtx->state.gfxCtx); } -#ifdef NON_MATCHING -// reordering in sHeartbeatTimer-- void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; @@ -6222,6 +6223,7 @@ void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { if (sHeartbeatTimer != 0) { sHeartbeatTimer--; + dummy_label:; play_sound(NA_SE_EN_LAST2_HEARTBEAT_OLD - SFX_FLAG); } if (this->unk_1808 != 0) { @@ -6252,67 +6254,67 @@ void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_ABC8 = 0; this->csState = 2; func_8016566C(150); - this->csCamEye.x = sBossRemains[0]->actor.world.pos.x * 0.7f; - this->csCamEye.y = sBossRemains[0]->actor.world.pos.y * 0.7f; - this->csCamEye.z = sBossRemains[0]->actor.world.pos.z * 0.7f; + this->csCamEye.x = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.x * 0.7f; + this->csCamEye.y = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.y * 0.7f; + this->csCamEye.z = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.z * 0.7f; } else { break; } case 2: if (this->unk_ABC8 == 20) { - sBossRemains[0]->unk_14E = 20; + sBossRemains[REMAINS_ODOLWA]->unk_14E = 20; } - this->csCamAt.x = sBossRemains[0]->actor.world.pos.x; - this->csCamAt.y = sBossRemains[0]->actor.world.pos.y; - this->csCamAt.z = sBossRemains[0]->actor.world.pos.z; + this->csCamAt.x = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.x; + this->csCamAt.y = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.y; + this->csCamAt.z = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.z; if (this->unk_ABC8 == 40) { this->csState = 3; this->unk_ABC8 = 0; - this->csCamEye.x = sBossRemains[1]->actor.world.pos.x * 0.7f; - this->csCamEye.y = sBossRemains[1]->actor.world.pos.y * 0.7f; - this->csCamEye.z = sBossRemains[1]->actor.world.pos.z * 0.7f; + this->csCamEye.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x * 0.7f; + this->csCamEye.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y * 0.7f; + this->csCamEye.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z * 0.7f; } else { break; } case 3: if (this->unk_ABC8 == 20) { - sBossRemains[1]->unk_14E = 20; + sBossRemains[REMAINS_GOHT]->unk_14E = 20; } - this->csCamAt.x = sBossRemains[1]->actor.world.pos.x; - this->csCamAt.y = sBossRemains[1]->actor.world.pos.y; - this->csCamAt.z = sBossRemains[1]->actor.world.pos.z; + this->csCamAt.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x; + this->csCamAt.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y; + this->csCamAt.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z; if (this->unk_ABC8 == 40) { this->csState = 4; this->unk_ABC8 = 0; - this->csCamEye.x = sBossRemains[2]->actor.world.pos.x * 0.7f; - this->csCamEye.y = sBossRemains[2]->actor.world.pos.y * 0.7f; - this->csCamEye.z = sBossRemains[2]->actor.world.pos.z * 0.7f; + this->csCamEye.x = sBossRemains[REMAINS_GYORG]->actor.world.pos.x * 0.7f; + this->csCamEye.y = sBossRemains[REMAINS_GYORG]->actor.world.pos.y * 0.7f; + this->csCamEye.z = sBossRemains[REMAINS_GYORG]->actor.world.pos.z * 0.7f; } else { break; } case 4: if (this->unk_ABC8 == 20) { - sBossRemains[2]->unk_14E = 20; + sBossRemains[REMAINS_GYORG]->unk_14E = 20; } - this->csCamAt.x = sBossRemains[2]->actor.world.pos.x; - this->csCamAt.y = sBossRemains[2]->actor.world.pos.y; - this->csCamAt.z = sBossRemains[2]->actor.world.pos.z; + this->csCamAt.x = sBossRemains[REMAINS_GYORG]->actor.world.pos.x; + this->csCamAt.y = sBossRemains[REMAINS_GYORG]->actor.world.pos.y; + this->csCamAt.z = sBossRemains[REMAINS_GYORG]->actor.world.pos.z; if (this->unk_ABC8 == 40) { this->csState = 5; this->unk_ABC8 = 0; - this->csCamEye.x = sBossRemains[3]->actor.world.pos.x * 0.7f; - this->csCamEye.y = sBossRemains[3]->actor.world.pos.y * 0.7f; - this->csCamEye.z = sBossRemains[3]->actor.world.pos.z * 0.7f; + this->csCamEye.x = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.x * 0.7f; + this->csCamEye.y = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.y * 0.7f; + this->csCamEye.z = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.z * 0.7f; } else { break; } case 5: if (this->unk_ABC8 == 20) { - sBossRemains[3]->unk_14E = 20; + sBossRemains[REMAINS_TWINMOLD]->unk_14E = 20; } - this->csCamAt.x = sBossRemains[3]->actor.world.pos.x; - this->csCamAt.y = sBossRemains[3]->actor.world.pos.y; - this->csCamAt.z = sBossRemains[3]->actor.world.pos.z; + this->csCamAt.x = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.x; + this->csCamAt.y = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.y; + this->csCamAt.z = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.z; if (this->unk_ABC8 == 40) { Camera* camera = Play_GetCamera(globalCtx, MAIN_CAM); s32 i; @@ -6327,7 +6329,7 @@ void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { func_800EA0EC(globalCtx, &globalCtx->csCtx); func_800B7298(globalCtx, &this->actor, 6); func_80165690(); - for (i = 0; i < 4; i++) { + for (i = 0; i < ARRAY_COUNT(sBossRemains); i++) { func_800BC154(globalCtx, &globalCtx->actorCtx, &sBossRemains[i]->actor, ACTORCAT_ENEMY); } } @@ -6339,7 +6341,7 @@ void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->unk_ABC8 < 20) { s32 j; - for (j = 0; j < 4; j++) { + for (j = 0; j < ARRAY_COUNT(sBossRemains); j++) { if ((this->unk_ABC8 % 2) != 0) { sBossRemains[j]->actor.world.pos.x += 2.0f; sBossRemains[j]->actor.world.pos.z += 2.0f; @@ -6353,9 +6355,6 @@ void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { Play_CameraSetAtEye(globalCtx, this->csCamIndex, &this->csCamAt, &this->csCamEye); } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Static_Update.s") -#endif void Boss07_Static_Draw(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; @@ -6369,7 +6368,7 @@ void Boss07_Static_UpdateEffects(GlobalContext* globalCtx) { Boss07Effect* effect = (Boss07Effect*)globalCtx->specialEffects; s32 i; - for (i = 0; i < 50; i++, effect++) { + for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { if (effect->unk_0 != 0) { effect->unk_2++; @@ -6406,7 +6405,7 @@ void Boss07_Static_DrawEffects(GlobalContext* globalCtx) { OPEN_DISPS(gfxCtx); func_8012C2DC(globalCtx->state.gfxCtx); - for (i = 0; i < 50; i++, effect++) { + for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { if (effect->unk_0 > 0) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, effect->unk_2C); gDPPipeSync(POLY_XLU_DISP++); 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 46b9d5ab2..a59860592 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -5,14 +5,24 @@ struct Boss07; +#define MAJORA_TENT_LENGTH 10 +#define MAJORA_TENT_COUNT 25 +#define MAJORA_TENT_MAX 100 +#define MAJORA_WHIP_MAX 50 + +#define MAJORA_MASK_LIMB_COUNT 19 +#define MAJORA_INCARNATION_LIMB_COUNT 25 +#define MAJORA_WRATH_LIMB_COUNT 28 +#define MAJORA_LIMB_COUNT MAX(MAJORA_MASK_LIMB_COUNT, MAX(MAJORA_INCARNATION_LIMB_COUNT, MAJORA_WRATH_LIMB_COUNT)) + typedef void (*Boss07ActionFunc)(struct Boss07*, GlobalContext*); typedef struct { Vec3f base; - Vec3f pos[10]; - Vec3f rot[10]; - Vec3f pull[10]; -} Boss07Tentacle; // size = 0x174 + Vec3f pos[MAJORA_TENT_LENGTH]; + Vec3f rot[MAJORA_TENT_LENGTH]; + Vec3f pull[MAJORA_TENT_LENGTH]; +} Boss07Tentacle; // size = 0x174 (0xC + 0x24 * length) typedef struct { Vec3s baseRot; @@ -21,11 +31,11 @@ typedef struct { f32 drag; f32 tension; Vec3f basePos; - Vec3f pos[50]; - Vec3f rot[50]; - Vec3f pull[50]; - f32 unk_72C[50]; // unused, probably a stretch factor -} Boss07Whip; // size = 0x7F4 + 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 +} Boss07Whip; // size = 0x7F4 (0x24 + 0x28 * max) typedef struct Boss07 { /* 0x0000 */ Actor actor; @@ -57,8 +67,8 @@ typedef struct Boss07 { /* 0x0190 */ SkelAnime skelAnime; /* 0x01D4 */ f32 unk_1D4; /* 0x01D8 */ s32 unk_1D8; - /* 0x01DC */ Vec3s jointTable1[28]; - /* 0x0284 */ Vec3s morphTable1[28]; + /* 0x01DC */ Vec3s jointTable1[MAJORA_LIMB_COUNT]; + /* 0x0284 */ Vec3s morphTable1[MAJORA_LIMB_COUNT]; /* 0x032C */ f32 unk_32C; /* 0x0330 */ f32 unk_330; /* 0x0334 */ Vec3f bodyPartsPos[15]; @@ -134,8 +144,8 @@ typedef struct Boss07 { /* 0x18ED */ u8 unk_18ED; /* 0x18F0 */ ColliderQuad quad1; /* 0x1970 */ ColliderQuad quad2; - /* 0x19F0 */ Boss07Tentacle tentacles[25]; - /* 0x3E44 */ char unk3E44[0x6CFC]; // size suggests 100 element tentacle array + /* 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; @@ -158,4 +168,18 @@ typedef struct Boss07 { extern const ActorInit Boss_07_InitVars; +typedef enum { + /* 0 */ MAJORA_BOSS, + /* 10 */ MAJORA_MASK = 10, + /* 11 */ MAJORA_MASK_CS, + /* 20 */ MAJORA_INCARNATION = 20, + /* 21 */ MAJORA_AFTERIMAGE, + /* 30 */ MAJORA_WRATH = 30, + /* 100 */ MAJORA_REMAINS_SHOT = 100, + /* 101 */ MAJORA_INCARNATION_SHOT, + /* 150 */ MAJORA_STATIC = 150, + /* 180 */ MAJORA_TOP = 180, + /* 200 */ MAJORA_REMAINS = 200, +} MajoraParams; + #endif // Z_BOSS_07_H From bc37eaf3416123e9b6e4cba4d5c15570b55700d3 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Tue, 26 Oct 2021 12:32:02 -0500 Subject: [PATCH 09/28] stuff --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) 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 480945074..874e36896 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -1153,7 +1153,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.targetMode = 5; this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.gravity = -2.5f; - if (1) {} + if (this->actor.params >= MAJORA_REMAINS) { this->actor.update = Boss07_Remains_Update; this->actor.draw = Boss07_Remains_Draw; @@ -1185,6 +1185,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { } else if ((this->actor.params == MAJORA_REMAINS_SHOT) || (this->actor.params == MAJORA_INCARNATION_SHOT)) { this->actor.update = Boss07_Projectile_Update; this->actor.draw = Boss07_Projectile_Draw; + this->actor.flags &= ~1; Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &sShotCylInit); func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); @@ -1468,9 +1469,9 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { f32 spA4; f32 spA0; Camera* camera; - spA4 = 0.0f; spA0 = 0.1f; - + spA4 = 0.0f; + camera = Play_GetCamera(globalCtx, 0); this->unk_15C = 1000; func_809F4CBC(this, 1.0f); @@ -3346,7 +3347,6 @@ void func_809FCC70(Boss07* this, GlobalContext* globalCtx) { void func_809FCCCC(Boss07* this, GlobalContext* globalCtx) { s32 i; f32 sp58; - Camera* sp54; SkelAnime_Update(&this->skelAnime); this->unk_ABC8++; @@ -3371,9 +3371,9 @@ 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], (this->unk_17C8[3] * sp58) + 1.0f, 1.0f, 0.5f); + Math_ApproachF(&this->unk_17B8[3], 1.0f + (this->unk_17C8[3] * sp58), 1.0f, 0.5f); } if (this->unk_ABC8 > 40) { this->csState = 3; @@ -3392,7 +3392,7 @@ void func_809FCCCC(Boss07* this, GlobalContext* globalCtx) { this->unk_17C8[2] = 1.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_TRANSFORM); } - Math_ApproachF(&this->unk_17B8[2], (this->unk_17C8[2] * sp58) + 1.0f, 1.0f, 0.5f); + Math_ApproachF(&this->unk_17B8[2], 1.0f + (this->unk_17C8[2] * sp58), 1.0f, 0.5f); } if (this->unk_ABC8 >= 50) { if (this->unk_ABC8 == 50) { @@ -3411,7 +3411,10 @@ void func_809FCCCC(Boss07* this, GlobalContext* globalCtx) { if (this->unk_ABC8 == 80) { this->csState = 4; this->unk_ABC8 = 0; - this->unk_17B8[0] = this->unk_17B8[1] = this->unk_17B8[2] = this->unk_17B8[3] = 1.0f; + this->unk_17B8[3] = 1.0f; + this->unk_17B8[2] = 1.0f; + this->unk_17B8[1] = 1.0f; + this->unk_17B8[0] = 1.0f; } break; case 4: @@ -3467,7 +3470,7 @@ void func_809FCCCC(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->csCamNextAt.y, 110.0f, 0.05f, this->csCamSpeedMod * 80.0f); Math_ApproachF(&this->csCamSpeedMod, 0.1f, 1.0f, 0.005f); if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { - sp54 = Play_GetCamera(globalCtx, 0); + Camera* sp54 = Play_GetCamera(globalCtx, 0); this->csState = 0; func_809FD5F8(this, globalCtx); From 3effc11fbe26f17ab5e04e8220cfc00bbd9dfc40 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Wed, 27 Oct 2021 09:45:33 -0500 Subject: [PATCH 10/28] docs part 1 / infinity --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 594 ++++++++++---------- tools/disasm/variables.txt | 4 +- 2 files changed, 287 insertions(+), 311 deletions(-) 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 874e36896..9a3253b86 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -19,15 +19,15 @@ typedef enum { } RemainsIndex; typedef struct { - /* 0x00 */ u8 unk_0; - /* 0x02 */ s16 unk_2; - /* 0x04 */ Vec3f unk_4; - /* 0x10 */ Vec3f unk_10; - /* 0x1C */ Vec3f unk_1C; + /* 0x00 */ u8 type; + /* 0x02 */ s16 scroll; + /* 0x04 */ Vec3f pos; + /* 0x10 */ Vec3f vel; + /* 0x1C */ Vec3f accel; /* 0x28 */ char unk28[4]; - /* 0x2C */ s16 unk_2C; + /* 0x2C */ s16 alpha; /* 0x2E */ char unk2E[2]; - /* 0x30 */ s16 unk_30; + /* 0x30 */ s16 isFading; /* 0x32 */ char unk32[2]; /* 0x34 */ f32 unk_34; /* 0x38 */ char unk38[0x10]; @@ -62,77 +62,70 @@ 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_UpdateSpheres(s32 arg0, ColliderJntSph* arg1, Vec3f* arg2); -s32 func_809FF678(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); -void func_809FF6B0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); -void func_809FF810(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx); + +void Boss07_Static_UpdateEffects(GlobalContext* globalCtx); void Boss07_Static_DrawEffects(GlobalContext* globalCtx); -void Boss07_Static_DrawLight(Boss07* this, GlobalContext* globalCtx); -void Boss07_Mask_UpdateTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* pos, Vec3f* rot, - Vec3f* pull, Vec3f* arg6, f32 arg7, u8 arg8, f32 arg9); -void Boss07_Mask_DrawTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* rot, f32 arg4, f32 arg5); -void Boss07_Mask_DrawBeam(Boss07* this, GlobalContext* globalCtx); -void Boss07_Mask_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); -void Boss07_Wrath_UpdateWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, - f32 arg6, f32 arg7, f32 arg8, f32 arg9, Vec3s* argA, s16 argB, f32 scale, s32 whipHand); -void Boss07_Wrath_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* rot, f32 arg4, s32 whipHand); -s32 Boss07_Wrath_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, - Actor* thisx); -void Boss07_Wrath_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); -void Boss07_Wrath_UnkLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx); -void Boss07_Wrath_DrawShocks(Boss07* this, GlobalContext* globalCtx); -void Boss07_Wrath_DrawDeathLights(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2); -void Boss07_Wrath_MakeShadowTex(u8* arg0, Boss07* this, GlobalContext* globalCtx); -void Boss07_Wrath_DrawShadowTex(u8* arg0, Boss07* this, GlobalContext* globalCtx); -void Boss07_Wrath_MakeShadowCircles(Boss07* this, u8* arg1, f32 arg2); + +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); +void Boss07_Mask_Spin(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_SetupBeam(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_SetupStunned(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_Stunned(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 arg2, Actor* hitActor); +void Boss07_Mask_Damaged(Boss07* this, GlobalContext* globalCtx); +void Boss07_Mask_SetupIntro(Boss07* this, GlobalContext* globalCtx); +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 func_809F7688(Boss07* this, GlobalContext* globalCtx); void func_809F783C(Boss07* this, GlobalContext* globalCtx); -void Boss07_Mask_SetupSpin(Boss07* this, GlobalContext* globalCtx); -void Boss07_Mask_SetupBeam(Boss07* this, GlobalContext* globalCtx); -void Boss07_Mask_SetupDeath(Boss07* this, GlobalContext* globalCtx); + void func_809FEE70(Boss07* this, GlobalContext* globalCtx); void func_809F51E8(Boss07* this, GlobalContext* globalCtx, u8 arg2); -void func_809F52CC(Boss07* this, GlobalContext* globalCtx); -void Boss07_Wrath_BombWhips(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_CheckExplosives(Boss07* this, GlobalContext* globalCtx); + void func_809F64F4(Boss07* this, GlobalContext* globalCtx); void func_809F7AB4(Boss07* this, GlobalContext* globalCtx); -void func_809F99C4(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 func_809F4FAC(GlobalContext* globalCtx); -void Boss07_SpawnEffect(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4); -void Boss07_Mask_CollisionCheck(Boss07* this, GlobalContext* globalCtx); -void Boss07_Wrath_BlastWhip(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2); -void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx); -void func_809F4FF8(GlobalContext* globalCtx, Vec3f* arg1, u8 arg2); -s32 Boss07_IsFacingPlayer(Boss07* this, GlobalContext* globalCtx); -void func_809F4CBC(Boss07* this, f32 arg1); -void func_809F4D54(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3); +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 Boss07_Static_UpdateEffects(GlobalContext* globalCtx); -void func_809F9CEC(Boss07* this, GlobalContext* globalCtx); + 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_809F9280(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3); 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 Boss07_Mask_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 arg2, Actor* arg3); -void Boss07_Mask_SetupStunned(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 Boss07_SetupIdle(Boss07* this, GlobalContext* globalCtx); -void Boss07_Mask_SetupIntro(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); @@ -152,7 +145,7 @@ 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 func_809F93DC(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); @@ -163,13 +156,7 @@ 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 Boss07_Idle(Boss07* this, GlobalContext* globalCtx); -void Boss07_Mask_Spin(Boss07* this, GlobalContext* globalCtx); -void Boss07_Mask_Stunned(Boss07* this, GlobalContext* globalCtx); -void Boss07_Mask_Damaged(Boss07* this, GlobalContext* globalCtx); -void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx); -void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx); -void Boss07_Mask_Death(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); @@ -249,18 +236,18 @@ extern UNK_TYPE D_06043330[]; extern UNK_TYPE D_06045B30[]; #endif -static s16 D_80A07950[4][3] = { - { 255, 255, 100 }, - { 255, 100, 100 }, - { 100, 255, 100 }, - { 100, 100, 255 }, +static s16 sColorsYRGB[4][3] = { + { 255, 255, 100 }, // light yellow + { 255, 100, 100 }, // light red + { 100, 255, 100 }, // light green + { 100, 100, 255 }, // light blue }; -static s16 D_80A07968[4][3] = { - { 255, 255, 255 }, - { 255, 255, 255 }, - { 255, 255, 255 }, - { 255, 255, 255 }, +static s16 sColorsWhite[4][3] = { + { 255, 255, 255 }, // white + { 255, 255, 255 }, // white + { 255, 255, 255 }, // white + { 255, 255, 255 }, // white }; #if 1 // collision data @@ -881,7 +868,7 @@ static Boss07* sMajorasWrath; static Boss07* sMajoraStatic; static Boss07* sMajorasMask; static Boss07* sBossRemains[REMAINS_COUNT]; -static u8 D_80A09A70; +static u8 sKillProjectiles; static u8 sMusicStartTimer; static Boss07Effect sEffects[EFFECT_COUNT]; static s32 sSeed0; @@ -892,13 +879,13 @@ void Boss07_Remains_DamageSfx(Boss07* this) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_DAMAGE); } -void Boss07_Wrath_InitRand(s32 seedInit0, s32 seedInit1, s32 seedInit2) { +void Boss07_InitRand(s32 seedInit0, s32 seedInit1, s32 seedInit2) { sSeed0 = seedInit0; sSeed1 = seedInit1; sSeed2 = seedInit2; } -f32 Boss07_Wrath_RandZeroOne(void) { +f32 Boss07_RandZeroOne(void) { // Wichmann-Hill algorithm f32 randFloat; @@ -918,15 +905,15 @@ void Boss07_SpawnEffect(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3 Boss07Effect* effect = (Boss07Effect*)globalCtx->specialEffects; for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { - if (effect->unk_0 == 0) { - effect->unk_0 = 1; - effect->unk_4 = *arg1; - effect->unk_10 = *arg2; - effect->unk_1C = *arg3; + if (effect->type == 0) { + effect->type = 1; + effect->pos = *arg1; + effect->vel = *arg2; + effect->accel = *arg3; effect->unk_34 = arg4 / 1000.0f; - effect->unk_30 = 0; - effect->unk_2C = 0; - effect->unk_2 = Rand_ZeroFloat(1000.0f); + effect->isFading = 0; + effect->alpha = 0; + effect->scroll = Rand_ZeroFloat(1000.0f); break; } } @@ -950,48 +937,49 @@ s32 Boss07_IsFacingPlayer(Boss07* this, GlobalContext* globalCtx) { return false; } -void func_809F4CBC(Boss07* this, f32 arg1) { - Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, arg1); +void Boss07_SmoothStop(Boss07* this, f32 maxStep) { + Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, maxStep); if (this->actor.bgCheckFlags & 0x18) { this->actor.speedXZ = 0.0f; } } -void func_809F4D10(Vec3f* arg0, f32 arg1) { +void func_809F4D10(Vec3f* dst, f32 scale) { Matrix_InsertYRotation_f(Rand_ZeroFloat(2 * M_PI), 0); - Matrix_GetStateTranslationAndScaledZ(arg1, arg0); + Matrix_GetStateTranslationAndScaledZ(scale, dst); } -void func_809F4D54(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { - static Color_RGBA8 sDarkOrange1 = { 60, 50, 20, 255 }; - static Color_RGBA8 sDarkRed1 = { 40, 30, 30, 255 }; - u8 phi_s1; - Vec3f spB0; - Vec3f spA4; - Vec3f sp98; +void Boss07_SpawnDust(Boss07* this, GlobalContext* globalCtx, u8 spawnInterval, u8 mode) { + static Color_RGBA8 sDarkOrange = { 60, 50, 20, 255 }; + static Color_RGBA8 sDarkRed = { 40, 30, 30, 255 }; + u8 i; - if (!(this->unk_14C & arg2) && ((arg2 == 0) || (this->actor.speedXZ > 1.0f))) { - for (phi_s1 = 0; phi_s1 < 2; phi_s1++) { - spA4.x = randPlusMinusPoint5Scaled(5.0f); - spA4.y = Rand_ZeroFloat(2.0f) + 1.0f; - spA4.z = randPlusMinusPoint5Scaled(5.0f); - sp98.x = sp98.z = 0.0f; - sp98.y = -0.1f; - spB0.y = Rand_ZeroFloat(10.0f) + 3.0f; - if (arg3) { - spB0.x = randPlusMinusPoint5Scaled(150.0f) + this->actor.focus.pos.x; - spB0.z = randPlusMinusPoint5Scaled(150.0f) + this->actor.focus.pos.z; + if (!(this->unk_14C & spawnInterval) && ((spawnInterval == 0) || (this->actor.speedXZ > 1.0f))) { + for (i = 0; i < 2; i++) { + Vec3f pos; + Vec3f vel; + Vec3f accel; + + vel.x = randPlusMinusPoint5Scaled(5.0f); + vel.y = Rand_ZeroFloat(2.0f) + 1.0f; + vel.z = randPlusMinusPoint5Scaled(5.0f); + accel.x = accel.z = 0.0f; + accel.y = -0.1f; + pos.y = Rand_ZeroFloat(10.0f) + 3.0f; + if (mode) { + pos.x = this->actor.focus.pos.x + randPlusMinusPoint5Scaled(150.0f); + pos.z = this->actor.focus.pos.z + randPlusMinusPoint5Scaled(150.0f); } else { - spB0.z = this->unk_1788[phi_s1].z + randPlusMinusPoint5Scaled(20.0f); - spB0.x = this->unk_1788[phi_s1].x + randPlusMinusPoint5Scaled(20.0f); + pos.z = this->unk_1788[i].z + randPlusMinusPoint5Scaled(20.0f); + pos.x = this->unk_1788[i].x + randPlusMinusPoint5Scaled(20.0f); } - func_800B0EB0(globalCtx, &spB0, &spA4, &sp98, &sDarkOrange1, &sDarkRed1, Rand_ZeroFloat(150.0f) + 350.0f, + func_800B0EB0(globalCtx, &pos, &vel, &accel, &sDarkOrange, &sDarkRed, Rand_ZeroFloat(150.0f) + 350.0f, 10, Rand_ZeroFloat(5.0f) + 14.0f); } } } -void func_809F4FAC(GlobalContext* globalCtx) { +void Boss07_MovePlayer(GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (SQXZ(player->actor.world.pos) < SQ(80.0f)) { @@ -999,24 +987,25 @@ void func_809F4FAC(GlobalContext* globalCtx) { } } -void func_809F4FF8(GlobalContext* globalCtx, Vec3f* arg1, u8 arg2) { - static Color_RGBA8 sDarkOrange2 = { 60, 50, 20, 255 }; - static Color_RGBA8 sDarkRed2 = { 40, 30, 30, 255 }; +void Boss07_SpawnDustAtPos(GlobalContext* globalCtx, Vec3f* spawnPos, u8 count) { + static Color_RGBA8 sDarkOrange = { 60, 50, 20, 255 }; + static Color_RGBA8 sDarkRed = { 40, 30, 30, 255 }; u8 i; - Vec3f spB0; - Vec3f spA4; - Vec3f sp98; - for (i = 0; i < arg2; i++) { - spA4.x = randPlusMinusPoint5Scaled(3.0f); - spA4.y = Rand_ZeroFloat(2.0f) + 1.0f; - spA4.z = randPlusMinusPoint5Scaled(3.0f); - sp98.x = sp98.z = 0.0f; - sp98.y = -0.1f; - spB0.x = randPlusMinusPoint5Scaled(30.0f) + arg1->x; - spB0.y = randPlusMinusPoint5Scaled(30.0f) + (arg1->y + 15.0f); - spB0.z = randPlusMinusPoint5Scaled(30.0f) + arg1->z; - func_800B0EB0(globalCtx, &spB0, &spA4, &sp98, &sDarkOrange2, &sDarkRed2, Rand_ZeroFloat(50.0f) + 100.0f, 10, + for (i = 0; i < count; i++) { + Vec3f pos; + Vec3f vel; + Vec3f accel; + + vel.x = randPlusMinusPoint5Scaled(3.0f); + vel.y = Rand_ZeroFloat(2.0f) + 1.0f; + vel.z = randPlusMinusPoint5Scaled(3.0f); + accel.x = accel.z = 0.0f; + accel.y = -0.1f; + pos.x = spawnPos->x + randPlusMinusPoint5Scaled(30.0f); + pos.y = spawnPos->y + 15.0f + randPlusMinusPoint5Scaled(30.0f); + pos.z = spawnPos->z + randPlusMinusPoint5Scaled(30.0f); + func_800B0EB0(globalCtx, &pos, &vel, &accel, &sDarkOrange, &sDarkRed, Rand_ZeroFloat(50.0f) + 100.0f, 10, Rand_ZeroFloat(5.0f) + 14.0f); } } @@ -1042,7 +1031,7 @@ void func_809F51E8(Boss07* this, GlobalContext* globalCtx, u8 arg2) { } } -void func_809F52CC(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_CheckExplosives(Boss07* this, GlobalContext* globalCtx) { Actor* explosive = globalCtx->actorCtx.actorList[ACTORCAT_EXPLOSIVES].first; while (explosive != NULL) { @@ -1132,7 +1121,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.draw = Boss07_Static_Draw; this->actor.flags &= ~1; sMajoraStatic = this; - D_80A09A70 = 0; + sKillProjectiles = false; globalCtx->envCtx.unk_C3 = 0; globalCtx->envCtx.unk_E0 = 2; } else { @@ -1143,7 +1132,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { globalCtx->specialEffects = (void*)sEffects; for (i = 0; i < ARRAY_COUNT(sEffects); i++) { - sEffects[i].unk_0 = 0; + sEffects[i].type = 0; } for (i = 0; i < ARRAY_COUNT(sBossRemains); i++) { sBossRemains[i] = NULL; @@ -1185,7 +1174,6 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { } else if ((this->actor.params == MAJORA_REMAINS_SHOT) || (this->actor.params == MAJORA_INCARNATION_SHOT)) { this->actor.update = Boss07_Projectile_Update; this->actor.draw = Boss07_Projectile_Draw; - this->actor.flags &= ~1; Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &sShotCylInit); func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); @@ -1204,7 +1192,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.world.pos.x = 0.0f; this->actor.world.pos.y = sREG(17) + 277.0f; this->actor.world.pos.z = -922.5f; - Boss07_SetupIdle(this, globalCtx); + Boss07_Mask_SetupIdle(this, globalCtx); this->unk_164.x = 0.0f; this->unk_164.y = 200.0f; this->unk_164.z = 0.0f; @@ -1320,7 +1308,7 @@ void func_809F5E14(Boss07* this, GlobalContext* globalCtx) { } void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { - static f32 D_80A07F6C[5][3] = { + 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 }, }; @@ -1369,9 +1357,9 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { dataIndex = 4; } - Math_ApproachF(&this->csCamNextEye.y, D_80A07F6C[dataIndex][0], 0.075f, this->csCamSpeedMod * 7.0f); - Math_ApproachF(&this->csCamNextEye.z, D_80A07F6C[dataIndex][1], 0.075f, this->csCamSpeedMod * 17.0f); - Math_ApproachF(&this->csCamNextAt.y, D_80A07F6C[dataIndex][2], 0.075f, this->csCamSpeedMod * 7.0f); + Math_ApproachF(&this->csCamNextEye.y, sCamPoints[dataIndex][0], 0.075f, this->csCamSpeedMod * 7.0f); + Math_ApproachF(&this->csCamNextEye.z, sCamPoints[dataIndex][1], 0.075f, this->csCamSpeedMod * 17.0f); + Math_ApproachF(&this->csCamNextAt.y, sCamPoints[dataIndex][2], 0.075f, this->csCamSpeedMod * 7.0f); Math_ApproachF(&this->csCamSpeedMod, 1.0f, 1.0f, 0.01f); if (this->unk_ABC8 == 70) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06025018, -15.0f); @@ -1437,7 +1425,7 @@ void func_809F64F4(Boss07* this, GlobalContext* globalCtx) { s32 i; Audio_QueueSeqCmd(0x100100FF); - func_809F4FAC(globalCtx); + Boss07_MovePlayer(globalCtx); this->actionFunc = func_809F65F4; this->rightWhip.stiffness = 0.7f; this->leftWhip.stiffness = 0.7f; @@ -1459,22 +1447,16 @@ void func_809F64F4(Boss07* this, GlobalContext* globalCtx) { this->unk_15C = 1000; } -#ifdef NON_MATCHING -// spA4 and spA0 loaded in wrong order void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { s32 i; s32 spC0 = 0; Vec3f spB4; Vec3f spA8 = { 0.0f, 0.0f, 0.0f }; - f32 spA4; - f32 spA0; - Camera* camera; - spA0 = 0.1f; - spA4 = 0.0f; - - camera = Play_GetCamera(globalCtx, 0); + f32 spA4 = 0.0f, spA0 = 0.1f; + Camera* camera = Play_GetCamera(globalCtx, 0); + this->unk_15C = 1000; - func_809F4CBC(this, 1.0f); + Boss07_SmoothStop(this, 1.0f); switch (this->csState) { case 0: if (ActorCutscene_GetCurrentIndex() != -1) { @@ -1497,9 +1479,9 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { this->csCamAt.z = camera->at.z; this->csCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; this->csCamRotVel = this->csCamSpeedMod = sMajoraStatic->unk_180C = 0.0f; - Boss07_Wrath_InitRand(1, 0x71AC, 0x263A); + Boss07_InitRand(1, 0x71AC, 0x263A); for (i = 0; i < ARRAY_COUNT(this->unk_AB50); i++) { - this->unk_AB50[i] = Boss07_Wrath_RandZeroOne() - 1.0f; + this->unk_AB50[i] = Boss07_RandZeroOne() - 1.0f; } func_8016566C(150); case 2: @@ -1693,12 +1675,6 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->unk_ABC8++; } -#else -static Vec3f D_80A07FA8 = { 0.0f, 0.0f, 0.0f }; -static Vec3f D_80A07FB4 = { 0.0f, 10.0f, 0.0f }; -static Vec3f D_80A07FC0 = { 0.0f, -0.5f, 0.0f }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809F65F4.s") -#endif void func_809F7400(Boss07* this, GlobalContext* globalCtx, s16 arg2) { this->actionFunc = func_809F748C; @@ -1715,7 +1691,7 @@ void func_809F748C(Boss07* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); SkelAnime_Update(&this->skelAnime); - func_809F4CBC(this, 2.0f); + Boss07_SmoothStop(this, 2.0f); this->rightWhip.stiffness = 0.7f; this->leftWhip.stiffness = 0.7f; this->rightWhip.gravity = -15.0f; @@ -1956,7 +1932,7 @@ void func_809F7D2C(Boss07* this, GlobalContext* globalCtx) { void func_809F805C(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - func_809F4CBC(this, 2.0f); + Boss07_SmoothStop(this, 2.0f); this->rightWhip.stiffness = 0.79999995f; this->leftWhip.stiffness = 0.79999995f; this->rightWhip.gravity = -5.0f; @@ -2110,7 +2086,7 @@ void func_809F8658(Boss07* this, GlobalContext* globalCtx) { void func_809F86B8(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer - 0x800, 3, 0x2000); - func_809F4CBC(this, 2.0f); + Boss07_SmoothStop(this, 2.0f); this->rightWhip.stiffness = 0.79999995f; this->leftWhip.stiffness = 0.79999995f; this->rightWhip.drag = 1.0f; @@ -2133,7 +2109,7 @@ void func_809F87C8(Boss07* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); SkelAnime_Update(&this->skelAnime); - func_809F4CBC(this, 2.0f); + Boss07_SmoothStop(this, 2.0f); player->actor.world.pos = this->unk_F80; this->actor.flags &= ~1; this->unk_15A = 20; @@ -2214,7 +2190,7 @@ void func_809F8B1C(Boss07* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); SkelAnime_Update(&this->skelAnime); - func_809F4CBC(this, 2.0f); + Boss07_SmoothStop(this, 2.0f); player->actor.world.pos = this->unk_F80; this->actor.flags &= ~1; this->unk_15A = 20; @@ -2317,7 +2293,7 @@ void func_809F8EC8(Boss07* this, GlobalContext* globalCtx) { } } Math_ApproachS(&this->actor.shape.rot.y, KREG(8) * 0x100 + this->actor.yawTowardsPlayer + 0xF00, 3, 0x2000); - func_809F4CBC(this, 2.0f); + Boss07_SmoothStop(this, 2.0f); this->leftWhip.stiffness = this->rightWhip.stiffness = 0.79999995f; this->leftWhip.drag = this->rightWhip.drag = 1.0f; this->leftWhip.tension = this->rightWhip.tension = 0.0f; @@ -2335,7 +2311,7 @@ void func_809F8EC8(Boss07* this, GlobalContext* globalCtx) { void func_809F91D4(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); func_8019F1C0(&sSfxPoint, NA_SE_EN_COMMON_WEAKENED - SFX_FLAG); - func_809F4CBC(this, 2.0f); + Boss07_SmoothStop(this, 2.0f); this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; this->leftWhip.gravity = this->rightWhip.gravity = -15.0f; this->leftWhip.tension = this->rightWhip.tension = 0.0f; @@ -2345,7 +2321,7 @@ void func_809F91D4(Boss07* this, GlobalContext* globalCtx) { } } -void func_809F9280(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { +void Boss07_Wrath_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { if ((s8)this->actor.colChkInfo.health >= 0) { this->actor.colChkInfo.health -= arg2; } @@ -2359,9 +2335,9 @@ void func_809F9280(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { Enemy_StartFinishingBlow(globalCtx, &this->actor); } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE2_OLD); - if (this->actionFunc != func_809F93DC) { + if (this->actionFunc != Boss07_Wrath_Damaged) { Animation_MorphToPlayOnce(&this->skelAnime, &D_0601DEB4, -10.0f); - this->actionFunc = func_809F93DC; + this->actionFunc = Boss07_Wrath_Damaged; this->unk_1D4 = Animation_GetLastFrame(&D_0601DEB4); this->unk_ABCC = 0; } else if (arg3 == 14) { @@ -2374,13 +2350,13 @@ void func_809F9280(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { } } -void func_809F93DC(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_Damaged(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->unk_ABCC++; if ((this->unk_ABCC % 16) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_WALK2_OLD); } - func_809F4CBC(this, 2.0f); + Boss07_SmoothStop(this, 2.0f); this->rightWhip.stiffness = 0.7f; this->leftWhip.stiffness = 0.7f; this->rightWhip.gravity = -15.0f; @@ -2394,7 +2370,7 @@ void func_809F93DC(Boss07* this, GlobalContext* globalCtx) { } } -void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_WhipCollisionCheck(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx) { s32 i; s32 sp98 = -1; Player* player = GET_PLAYER(globalCtx); @@ -2415,7 +2391,7 @@ void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < (KREG(38) + 60.0f)) { ((ObjTsubo*)prop)->unk19B = 1; - func_809F4FF8(globalCtx, &prop->world.pos, 10); + Boss07_SpawnDustAtPos(globalCtx, &prop->world.pos, 10); } } } @@ -2473,14 +2449,14 @@ void func_809F94AC(Vec3f* arg0, f32 arg1, Boss07* this, GlobalContext* globalCtx sp7C.y += randPlusMinusPoint5Scaled(30.0f) + 20.0f; sp7C.z += randPlusMinusPoint5Scaled(30.0f); EffectSsHitMark_SpawnFixedScale(globalCtx, 0, &sp7C); - func_809F4FF8(globalCtx, &player->actor.world.pos, 7); + Boss07_SpawnDustAtPos(globalCtx, &player->actor.world.pos, 7); break; } } } } -void func_809F99C4(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_CollisionCheck(Boss07* this, GlobalContext* globalCtx) { s32 i; s32 j; u8 pad; @@ -2491,7 +2467,7 @@ void func_809F99C4(Boss07* this, GlobalContext* globalCtx) { this->sph2.elements[0].info.toucherFlags &= ~2; player->unk_B84 = this->actor.yawTowardsPlayer; player->unk_B80 = 20.0f; - func_809F4FF8(globalCtx, &player->actor.world.pos, 12); + Boss07_SpawnDustAtPos(globalCtx, &player->actor.world.pos, 12); play_sound(NA_SE_IT_HOOKSHOT_STICK_OBJ); } for (i = 0; i < ARRAY_COUNT(this->sphElems1); i++) { @@ -2525,7 +2501,7 @@ void func_809F99C4(Boss07* this, GlobalContext* globalCtx) { break; } pad = this->actor.colChkInfo.damage; - if ((this->actionFunc == func_809F91D4) || (this->actionFunc == func_809F93DC)) { + 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)) { @@ -2534,7 +2510,7 @@ void func_809F99C4(Boss07* this, GlobalContext* globalCtx) { } else { this->unk_15E = 15; this->unk_15C = (this->actor.colChkInfo.damageEffect == 0xC) ? 15 : 5; - func_809F9280(this, globalCtx, pad, this->actor.colChkInfo.damageEffect); + Boss07_Wrath_SetupDamaged(this, globalCtx, pad, this->actor.colChkInfo.damageEffect); } } else { this->unk_15C = 15; @@ -2552,24 +2528,24 @@ void func_809F99C4(Boss07* this, GlobalContext* globalCtx) { } } -void func_809F9CEC(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_BreakIce(Boss07* this, GlobalContext* globalCtx) { static Color_RGBA8 sLightCyan = { 170, 255, 255, 255 }; static Color_RGBA8 sLightBlue = { 200, 200, 255, 255 }; - static Vec3f sIceVel = { 0.0f, -1.0f, 0.0f }; - Vec3f sp8C; - Vec3f sp80; + static Vec3f sIceAccel = { 0.0f, -1.0f, 0.0f }; + Vec3f pos; + Vec3f vel; s32 i; Audio_PlaySoundAtPosition(globalCtx, this->bodyPartsPos, 30, NA_SE_EV_ICE_BROKEN); for (i = 0; i < 30; i++) { - sp80.x = randPlusMinusPoint5Scaled(7.0f); - sp80.z = randPlusMinusPoint5Scaled(7.0f); - sp80.y = Rand_ZeroFloat(6.0f) + 4.0f; + vel.x = randPlusMinusPoint5Scaled(7.0f); + vel.z = randPlusMinusPoint5Scaled(7.0f); + vel.y = Rand_ZeroFloat(6.0f) + 4.0f; - sp8C.x = this->bodyPartsPos[i / 2].x + sp80.x; - sp8C.y = this->bodyPartsPos[i / 2].y + sp80.y; - sp8C.z = this->bodyPartsPos[i / 2].z + sp80.z; - EffectSsEnIce_Spawn(globalCtx, &sp8C, Rand_ZeroFloat(1.0f) + 1.5f, &sp80, &sIceVel, &sLightCyan, &sLightBlue, + pos.x = this->bodyPartsPos[i / 2].x + vel.x; + pos.y = this->bodyPartsPos[i / 2].y + vel.y; + pos.z = this->bodyPartsPos[i / 2].z + vel.z; + EffectSsEnIce_Spawn(globalCtx, &pos, Rand_ZeroFloat(1.0f) + 1.5f, &vel, &sIceAccel, &sLightCyan, &sLightBlue, 30); } } @@ -2609,7 +2585,7 @@ void func_809F9E94(Boss07* this, GlobalContext* globalCtx) { this->unk_1805++; case 11: if (this->unk_1806 == 0) { - func_809F9CEC(this, globalCtx); + Boss07_Wrath_BreakIce(this, globalCtx); this->unk_1805 = 0; } else { if (this->unk_1806 == 50) { @@ -2674,7 +2650,7 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { Math_Vec3f_Copy(&sSfxPoint, &this->actor.projectedPos); if (KREG(63) == 0) { this->unk_174 = 0; - this->unk_14C += 1; + this->unk_14C++; Actor_SetScale(&this->actor, 0.015f); Math_ApproachZeroF(&this->unk_184, 1.0f, 0.02f); Math_ApproachZeroF(&this->unk_188, 1.0f, 0.02f); @@ -2701,14 +2677,14 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { } else { sWhipSegCount = 45; } - func_809F94AC(this->rightWhip.pos, this->rightWhip.tension, this, globalCtx); - func_809F94AC(this->leftWhip.pos, this->leftWhip.tension, this, globalCtx); + Boss07_Wrath_WhipCollisionCheck(this->rightWhip.pos, this->rightWhip.tension, this, globalCtx); + Boss07_Wrath_WhipCollisionCheck(this->leftWhip.pos, this->leftWhip.tension, this, globalCtx); if (this->unk_158 != 0) { for (i = 0; i < ARRAY_COUNT(this->sphElems1); i++) { this->sph1.elements[i].info.bumperFlags &= ~2; } } - func_809F99C4(this, globalCtx); + Boss07_Wrath_CollisionCheck(this, globalCtx); if (this->unk_15C != 0) { this->unk_778 = 0; } @@ -2729,7 +2705,7 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { func_809F51E8(this, globalCtx, false); } } - if ((this->actionFunc != func_809F91D4) && (this->actionFunc != func_809F93DC)) { + if ((this->actionFunc != func_809F91D4) && (this->actionFunc != Boss07_Wrath_Damaged)) { if ((player->stateFlags3 & 0x00001000) && !(player->stateFlags3 & 0x00080000) && (this->actor.xzDistToPlayer <= 250.0f)) { func_809F51E8(this, globalCtx, false); @@ -2737,7 +2713,7 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { } } if (this->unk_174 != 0) { - func_809F52CC(this, globalCtx); + Boss07_Wrath_CheckExplosives(this, globalCtx); } Boss07_Wrath_BombWhips(this, globalCtx); if ((KREG(88) != 0) || (this->unk_148 != 0)) { @@ -2966,20 +2942,20 @@ s32 Boss07_Wrath_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** return false; } -static s8 sWrathColliders[32] = { - -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, 0, 0, -}; -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 }, - { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, - { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, -}; -static s8 sWrathBodyParts[32] = { - -1, -1, 2, -1, 12, -1, 13, 14, -1, 9, -1, 10, 11, -1, 1, -1, 6, 7, 8, -1, -1, 3, 4, 5, -1, -1, 0, -1, -1, -1, 0, 0, -}; -static Vec3f sWhipOffset = { 1000.0f, 100.0f, 0.0f }; 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, + }; + 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 }, + { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, + { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, { 2000.0f, 0.0f, 0.0f }, + }; + static s8 sWrathBodyParts[30] = { + -1, -1, 2, -1, 12, -1, 13, 14, -1, 9, -1, 10, 11, -1, 1, -1, 6, 7, 8, -1, -1, 3, 4, 5, -1, -1, 0, -1, -1, -1, + }; + static Vec3f sWhipOffset = { 1000.0f, 100.0f, 0.0f }; Boss07* this = THIS; s8 sp6B; Vec3f sp5C; @@ -2989,7 +2965,7 @@ void Boss07_Wrath_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL if (sp6B >= 0) { Matrix_GetStateTranslation(&this->bodyPartsPos[sp6B]); } - sp6B = sWrathColliders[limbIndex]; + sp6B = sLimbColliderIndex[limbIndex]; if (sp6B >= 0) { if (this->unk_158 != 0) { Matrix_GetStateTranslationAndScaledZ(100000.0f, &sp5C); @@ -3088,20 +3064,20 @@ void Boss07_Wrath_DrawDeathLights(Boss07* this, GlobalContext* globalCtx, Vec3f* OPEN_DISPS(gfxCtx = globalCtx->state.gfxCtx); if (this->unk_AB4C > 0.0f) { - Boss07_Wrath_InitRand(1, 0x71B8, 0x263A); + 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++) { - temp = D_80A07950[0]; + temp = sColorsYRGB[0]; gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, temp[0], temp[1], temp[2], 40); - temp_f20 = (Boss07_Wrath_RandZeroOne() * 40.0f) - 30.0f; + 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_Wrath_RandZeroOne() * M_PI * 2.0f, 1); + Matrix_InsertYRotation_f(Boss07_RandZeroOne() * M_PI * 2.0f, 1); Matrix_RotateStateAroundXAxis(-0.024999999f * temp_f20); - Matrix_InsertZRotation_f(Boss07_Wrath_RandZeroOne() * M_PI * 2.0f, 1); + 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); @@ -3301,7 +3277,7 @@ void Boss07_Wrath_MakeShadowTex(u8* shadowTex, Boss07* this, GlobalContext* glob } } -void Boss07_Wrath_DrawShadowTex(u8* arg0, Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_DrawShadowTex(u8* shadowTex, Boss07* this, GlobalContext* globalCtx) { s32 pad[2]; f32 phi_f0; GraphicsContext* pad3 = globalCtx->state.gfxCtx; @@ -3318,7 +3294,7 @@ void Boss07_Wrath_DrawShadowTex(u8* arg0, Boss07* this, GlobalContext* globalCtx Matrix_Scale(1.75f, 1.0f, 1.75f, 1); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); gSPDisplayList(POLY_OPA_DISP++, D_0602EF68); - gDPLoadTextureBlock(POLY_OPA_DISP++, arg0, G_IM_FMT_I, G_IM_SIZ_8b, 0x40, 0x40, 0, G_TX_NOMIRROR | G_TX_CLAMP, + 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); gSPDisplayList(POLY_OPA_DISP++, D_0602EF88); CLOSE_DISPS(pad3); @@ -3518,13 +3494,13 @@ void func_809FD710(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_JUMP_OLD); } SkelAnime_Update(&this->skelAnime); - func_809F4CBC(this, 2.0f); + 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); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_SURPRISED_OLD); } - func_809F4D54(this, globalCtx, 1, false); + Boss07_SpawnDust(this, globalCtx, 1, false); } void func_809FD818(Boss07* this, GlobalContext* globalCtx, s16 arg2) { @@ -3541,7 +3517,7 @@ void func_809FD818(Boss07* this, GlobalContext* globalCtx, s16 arg2) { void func_809FD89C(Boss07* this, GlobalContext* globalCtx) { this->actor.shape.shadowAlpha = 0; SkelAnime_Update(&this->skelAnime); - func_809F4CBC(this, 1.0f); + Boss07_SmoothStop(this, 1.0f); if (this->timers[1] == 1) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_HIPLOOP_LAND); } @@ -3555,7 +3531,7 @@ void func_809FD89C(Boss07* this, GlobalContext* globalCtx) { if (this->timers[0] == 0) { func_809FD5F8(this, globalCtx); } - func_809F4D54(this, globalCtx, 1, true); + Boss07_SpawnDust(this, globalCtx, 1, true); } void func_809FD984(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { @@ -3589,11 +3565,11 @@ void func_809FD984(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { void func_809FDAB0(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_BIRD2_OLD - SFX_FLAG); SkelAnime_Update(&this->skelAnime); - func_809F4CBC(this, 2.0f); + Boss07_SmoothStop(this, 2.0f); if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { func_809FDB2C(this, globalCtx); } - func_809F4D54(this, globalCtx, 1, false); + Boss07_SpawnDust(this, globalCtx, 1, false); } void func_809FDB2C(Boss07* this, GlobalContext* globalCtx) { @@ -3621,7 +3597,7 @@ void func_809FDBA0(Boss07* this, GlobalContext* globalCtx) { } else { sp34 = this->unk_164.x - this->actor.world.pos.x; sp30 = this->unk_164.z - this->actor.world.pos.z; - if ((this->timers[1] == 0) || (SQ(sp34) + SQ(sp30) < 30000.0f)) { + if ((this->timers[1] == 0) || (SQ(sp34) + SQ(sp30) < SQ(173.20508f))) { // 100 * sqrt(3) if (Rand_ZeroOne() < 0.3f) { f32 temp_f0 = Rand_ZeroOne(); @@ -3653,7 +3629,7 @@ void func_809FDBA0(Boss07* this, GlobalContext* globalCtx) { this->timers[0] = 50; this->timers[2] = 50; } - func_809F4D54(this, globalCtx, 3, false); + Boss07_SpawnDust(this, globalCtx, 3, false); this->unk_18D6 = 5; } } @@ -3667,7 +3643,7 @@ void func_809FDEDC(Boss07* this, GlobalContext* globalCtx) { void func_809FDF54(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - func_809F4CBC(this, 3.0f); + Boss07_SmoothStop(this, 3.0f); Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 0x3000); if (Animation_OnFrame(&this->skelAnime, 4.0f)) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BOSS_07, this->unk_17A0.x, this->unk_17A0.y, @@ -3680,7 +3656,7 @@ void func_809FDF54(Boss07* this, GlobalContext* globalCtx) { if (this->timers[0] == 0) { func_809FDB2C(this, globalCtx); } - func_809F4D54(this, globalCtx, 1, false); + Boss07_SpawnDust(this, globalCtx, 1, false); } void func_809FE068(Boss07* this, GlobalContext* globalCtx) { @@ -3723,7 +3699,7 @@ void func_809FE0E4(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_SURPRISED_OLD); } } - func_809F4D54(this, globalCtx, 7, false); + Boss07_SpawnDust(this, globalCtx, 7, false); } void func_809FE2D4(Boss07* this, GlobalContext* globalCtx) { @@ -3754,7 +3730,7 @@ void func_809FE348(Boss07* this, GlobalContext* globalCtx) { if (this->timers[0] == 0) { func_809FDB2C(this, globalCtx); } - func_809F4D54(this, globalCtx, 7, false); + Boss07_SpawnDust(this, globalCtx, 7, false); } void func_809FE4B0(Boss07* this, GlobalContext* globalCtx) { @@ -3793,7 +3769,7 @@ void func_809FE524(Boss07* this, GlobalContext* globalCtx) { void func_809FE6B0(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = func_809FE734; - func_809F4FAC(globalCtx); + Boss07_MovePlayer(globalCtx); Animation_MorphToPlayOnce(&this->skelAnime, &D_06000D0C, -2.0f); this->unk_1D4 = Animation_GetLastFrame(&D_06000D0C); this->csState = 0; @@ -3809,7 +3785,7 @@ void func_809FE734(Boss07* this, GlobalContext* globalCtx) { this->unk_15C = 20; this->unk_ABC8++; SkelAnime_Update(&this->skelAnime); - func_809F4CBC(this, 3.0f); + Boss07_SmoothStop(this, 3.0f); switch (this->csState) { case 0: if (ActorCutscene_GetCurrentIndex() != -1) { @@ -4079,7 +4055,7 @@ void Boss07_Afterimage_Draw(Actor* thisx, GlobalContext* globalCtx2) { CLOSE_DISPS(globalCtx->state.gfxCtx); } -s32 func_809FF678(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) { @@ -4088,36 +4064,36 @@ s32 func_809FF678(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p return false; } -static s8 sIncarnationColliders[32] = { - -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, 0, 0, -}; -static s8 D_80A081C8[32] = { - -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, 0, 0, -}; -static Vec3f sIncarnationColliderOffsets[11] = { - { 2000.0f, 0.0f, 0.0f }, { 3500.0f, -1000.0f, 0.0f }, { 100000.0f, 100000.0f, 100000.0f }, - { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, - { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, - { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, -}; -static s8 sIncarnationBodyParts[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, -}; +void Boss07_Incarnation_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + static s8 sLimbColliderIndex[30] = { + -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, + }; + static Vec3f sIncarnationColliderOffsets[11] = { + { 2000.0f, 0.0f, 0.0f }, { 3500.0f, -1000.0f, 0.0f }, { 100000.0f, 100000.0f, 100000.0f }, + { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, + { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, + { 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, + }; -void func_809FF6B0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { Boss07* this = THIS; Vec3f sp28; s8 i; - if (limbIndex == 0x18) { + if (limbIndex == 24) { Matrix_GetStateTranslation(&this->actor.focus.pos); } - i = sIncarnationBodyParts[limbIndex]; + i = sLimbBodyPartIndex[limbIndex]; if (i >= 0) { Matrix_GetStateTranslation(&this->bodyPartsPos[i]); } - i = sIncarnationColliders[limbIndex]; + i = sLimbColliderIndex[limbIndex]; if (i >= 0) { if (this->unk_158 != 0) { Matrix_GetStateTranslationAndScaledZ(100000.0f, &sp28); @@ -4129,22 +4105,22 @@ void func_809FF6B0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* if (limbIndex == 8) { Matrix_GetStateTranslation(&this->unk_1788[0]); } - if (limbIndex == 0x17) { + if (limbIndex == 23) { Matrix_GetStateTranslation(&this->unk_1788[1]); } - if (limbIndex == 0xD) { + if (limbIndex == 13) { Matrix_GetStateTranslation(&this->unk_17AC); } - if (limbIndex == 0x12) { + if (limbIndex == 18) { Matrix_GetStateTranslation(&this->unk_17A0); } - i = D_80A081C8[limbIndex]; + i = sLimbPumpIndex[limbIndex]; if (i >= 0) { Matrix_Scale(this->unk_17B8[i], this->unk_17B8[i], this->unk_17B8[i], 1); } } -void func_809FF810(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { +void Boss07_Incarnation_UnkActorDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { Boss07* this = THIS; if (limbIndex == 3) { @@ -4171,21 +4147,21 @@ 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, - func_809FF678, func_809FF6B0, func_809FF810, &this->actor); + Boss07_Incarnation_OverrideLimbDraw, Boss07_Incarnation_PostLimbDraw, Boss07_Incarnation_UnkActorDraw, &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); CLOSE_DISPS(globalCtx->state.gfxCtx); } -void Boss07_SetupIdle(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = Boss07_Idle; +void Boss07_Mask_SetupIdle(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Mask_Idle; Animation_MorphToLoop(&this->skelAnime, &D_06019E48, -20.0f); this->timers[2] = Rand_ZeroFloat(150.0f) + 60.0f; this->unk_1870 = 1.0f; } -void Boss07_Idle(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Mask_Idle(Boss07* this, GlobalContext* globalCtx) { s16 sp36; s16 sp34; f32 sp30; @@ -4266,7 +4242,7 @@ void Boss07_Mask_Spin(Boss07* this, GlobalContext* globalCtx) { switch (this->unk_14E) { case 0: Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); - func_809F4CBC(this, 1.0f); + 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) { @@ -4321,9 +4297,9 @@ void Boss07_Mask_Spin(Boss07* this, GlobalContext* globalCtx) { case 2: Math_ApproachS(&this->unk_18D4, 0, 1, 0x100); Math_ApproachS(&this->actor.world.rot.x, 0x2000, 0xA, 0x7D0); - func_809F4CBC(this, 0.5f); + Boss07_SmoothStop(this, 0.5f); if (this->timers[0] == 0) { - Boss07_SetupIdle(this, globalCtx); + Boss07_Mask_SetupIdle(this, globalCtx); } } } @@ -4338,7 +4314,7 @@ void Boss07_Mask_SetupStunned(Boss07* this, GlobalContext* globalCtx) { void Boss07_Mask_Stunned(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); func_8019F1C0(&sSfxPoint, NA_SE_EN_COMMON_WEAKENED - SFX_FLAG); - func_809F4CBC(this, 0.5f); + 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); if (this->actor.world.pos.y > 51.0f) { @@ -4351,17 +4327,17 @@ void Boss07_Mask_Stunned(Boss07* this, GlobalContext* globalCtx) { this->unk_1884 = 1; } if (this->timers[0] == 0) { - Boss07_SetupIdle(this, globalCtx); + Boss07_Mask_SetupIdle(this, globalCtx); this->timers[2] = 100; } } -void Boss07_Mask_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 arg2, Actor* arg3) { +void Boss07_Mask_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 damage, Actor* arg3) { Player* player = GET_PLAYER(globalCtx); this->actionFunc = Boss07_Mask_Damaged; this->timers[0] = 40; - if (arg2) { + if (damage) { this->actor.speedXZ = 30.0f; this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; this->unk_18D4 = 0x1500; @@ -4378,7 +4354,7 @@ void Boss07_Mask_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 arg2, A } this->unk_18D4 = 0x1000; } - this->actor.colChkInfo.health -= arg2; + this->actor.colChkInfo.health -= damage; if ((s8)this->actor.colChkInfo.health <= 0) { this->timers[0] = 30; } @@ -4389,7 +4365,7 @@ void Boss07_Mask_Damaged(Boss07* this, GlobalContext* globalCtx) { this->unk_15C = 20; SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 1) { - func_809F4CBC(this, 1.0f); + Boss07_SmoothStop(this, 1.0f); Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 1, 0x1000); Math_ApproachS(&this->unk_18D4, 0, 1, 0x100); } else { @@ -4403,7 +4379,7 @@ void Boss07_Mask_Damaged(Boss07* this, GlobalContext* globalCtx) { this->unk_774 = 1; } if (this->timers[0] == 0) { - Boss07_SetupIdle(this, globalCtx); + Boss07_Mask_SetupIdle(this, globalCtx); if ((s8)this->actor.colChkInfo.health <= 0) { this->unk_148 = 1; Enemy_StartFinishingBlow(globalCtx, &this->actor); @@ -4454,7 +4430,7 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { u32 sp144; this->unk_15C = 20; - func_809F4CBC(this, 0.5f); + Boss07_SmoothStop(this, 0.5f); 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)) { @@ -4717,7 +4693,7 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { } else { Math_ApproachZeroF(&this->unk_1898, 1.0f, 0.05f); if (this->timers[0] == 0) { - Boss07_SetupIdle(this, globalCtx); + Boss07_Mask_SetupIdle(this, globalCtx); this->timers[2] = 100; func_80A006D0(this); } @@ -4735,13 +4711,13 @@ void Boss07_Mask_SetupIntro(Boss07* this, GlobalContext* globalCtx) { func_8016566C(this->unk_160); } -static Vec3s sCameraEyes[4] = { +static Vec3s sIntroCamEyes[4] = { { 616, 402, -46 }, { -622, 380, -86 }, { 400, 300, 463 }, { -400, 470, 496 }, }; -static Vec3s sCameraAts[4] = { +static Vec3s sIntroCamAts[4] = { { 646, 394, -150 }, { -648, 380, -190 }, { 502, 321, 438 }, @@ -4837,12 +4813,12 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { this->unk_ABCC++; sBossRemains[this->unk_ABCC]->unk_14E = 3; } - this->csCamEye.x = sCameraEyes[this->unk_ABCC].x; - this->csCamEye.y = sCameraEyes[this->unk_ABCC].y; - this->csCamEye.z = sCameraEyes[this->unk_ABCC].z; - this->csCamAt.x = sCameraAts[this->unk_ABCC].x; - this->csCamAt.y = sCameraAts[this->unk_ABCC].y; - this->csCamAt.z = sCameraAts[this->unk_ABCC].z; + this->csCamEye.x = sIntroCamEyes[this->unk_ABCC].x; + this->csCamEye.y = sIntroCamEyes[this->unk_ABCC].y; + this->csCamEye.z = sIntroCamEyes[this->unk_ABCC].z; + this->csCamAt.x = sIntroCamAts[this->unk_ABCC].x; + this->csCamAt.y = sIntroCamAts[this->unk_ABCC].y; + this->csCamAt.z = sIntroCamAts[this->unk_ABCC].z; if (this->unk_ABC8 == 250) { this->csState = 3; this->unk_ABC8 = 0; @@ -4939,7 +4915,7 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { Camera* sp5C = Play_GetCamera(globalCtx, 0); this->csState = 0; - Boss07_SetupIdle(this, globalCtx); + Boss07_Mask_SetupIdle(this, globalCtx); this->timers[0] = 50; this->timers[2] = 200; this->unk_1888 = 50; @@ -4999,7 +4975,7 @@ void Boss07_Mask_Death(Boss07* this, GlobalContext* globalCtx) { this->unk_15C = 20; this->unk_1884 = 1; SkelAnime_Update(&this->skelAnime); - func_809F4CBC(this, 0.5f); + Boss07_SmoothStop(this, 0.5f); 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); @@ -5073,8 +5049,8 @@ void Boss07_Mask_Death(Boss07* this, GlobalContext* globalCtx) { void Boss07_Mask_CollisionCheck(Boss07* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); ColliderInfo* hitbox; - u8 sp27; - Actor* hit; + u8 damage; + Actor* hitActor; if (this->unk_15C == 0) { if (this->quad1.base.acFlags & AC_HIT) { @@ -5085,14 +5061,14 @@ void Boss07_Mask_CollisionCheck(Boss07* this, GlobalContext* globalCtx) { this->quad2.base.acFlags &= ~AC_HIT; this->unk_186C = 15; if ((this->actionFunc == Boss07_Mask_Stunned) || (player->stateFlags3 & 0x200)) { - hit = this->quad2.base.ac; + hitActor = this->quad2.base.ac; hitbox = this->quad2.info.acHitInfo; - sp27 = (hitbox->toucher.dmgFlags & 0xF7CFFFFF) ? this->actor.colChkInfo.damage : 0; + damage = (hitbox->toucher.dmgFlags & 0xF7CFFFFF) ? this->actor.colChkInfo.damage : 0; this->unk_15C = 50; this->unk_15E = 15; func_801A72CC(&this->actor.projectedPos); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_DAMAGE2_OLD); - Boss07_Mask_SetupDamaged(this, globalCtx, sp27, hit); + Boss07_Mask_SetupDamaged(this, globalCtx, damage, hitActor); } else { this->unk_15C = 15; func_801A72CC(&this->actor.projectedPos); @@ -5466,7 +5442,7 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { gSPDisplayList(POLY_OPA_DISP++, D_0600AFB0); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); - phi_s6 = ((this->actionFunc == Boss07_Idle) && + phi_s6 = ((this->actionFunc == Boss07_Mask_Idle) && (ABS_ALT((s16)(this->actor.world.rot.y - this->actor.shape.rot.y)) > 0x4000)) ? 1 : 0; @@ -5544,7 +5520,7 @@ void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx2) { Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 31.0f, 100.0f, 7); this->actor.shape.rot.z += 0x1200; if ((this->actor.bgCheckFlags & 0x19) || (this->cyl2.base.atFlags & 2) || (this->cyl2.base.atFlags & 2) || - (D_80A09A70 != 0)) { + sKillProjectiles) { Actor_MarkForDeath(&this->actor); Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, this->unk_181C, @@ -5563,10 +5539,10 @@ void Boss07_Projectile_Draw(Actor* thisx, GlobalContext* globalCtx2) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C2DC(globalCtx->state.gfxCtx); gDPPipeSync(POLY_XLU_DISP++); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, D_80A07968[this->unk_181C][0], D_80A07968[this->unk_181C][1], - D_80A07968[this->unk_181C][2], 255); - gDPSetEnvColor(POLY_XLU_DISP++, D_80A07950[this->unk_181C][0], D_80A07950[this->unk_181C][1], - D_80A07950[this->unk_181C][2], 128); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, sColorsWhite[this->unk_181C][0], sColorsWhite[this->unk_181C][1], + 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_NormalizeXYZ(&globalCtx->mf_187FC); @@ -5763,7 +5739,7 @@ void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { sp74 = this->unk_164.y - this->actor.world.pos.y; sp70 = this->unk_164.z - this->actor.world.pos.z; sp7C = Math_Atan2S(sp78, sp70); - sp7E = Math_Atan2S(sp74, sqrtf((sp78 * sp78) + (sp70 * sp70))); + sp7E = Math_Atan2S(sp74, sqrtf(SQ(sp78) + SQ(sp70))); sp7E += (s16)(Math_SinS(this->unk_14C * 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); @@ -5797,7 +5773,7 @@ void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { this->actor.draw = NULL; this->actor.flags &= ~1; } - func_809F4CBC(this, 2.0f); + Boss07_SmoothStop(this, 2.0f); } else { this->actor.shape.rot.z += 0x200; } @@ -6381,28 +6357,28 @@ void Boss07_Static_UpdateEffects(GlobalContext* globalCtx) { s32 i; for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { - if (effect->unk_0 != 0) { - effect->unk_2++; + if (effect->type != 0) { + effect->scroll++; - effect->unk_4.x += effect->unk_10.x; - effect->unk_4.y += effect->unk_10.y; - effect->unk_4.z += effect->unk_10.z; + effect->pos.x += effect->vel.x; + effect->pos.y += effect->vel.y; + effect->pos.z += effect->vel.z; - effect->unk_10.x += effect->unk_1C.x; - effect->unk_10.y += effect->unk_1C.y; - effect->unk_10.z += effect->unk_1C.z; - if (effect->unk_0 == 1) { - if (effect->unk_30 != 0) { - effect->unk_2C -= (i & 7) + 13; - if (effect->unk_2C <= 0) { - effect->unk_2C = 0; - effect->unk_0 = 0; + effect->vel.x += effect->accel.x; + effect->vel.y += effect->accel.y; + effect->vel.z += effect->accel.z; + if (effect->type == 1) { + if (effect->isFading) { + effect->alpha -= (i & 7) + 13; + if (effect->alpha <= 0) { + effect->alpha = 0; + effect->type = 0; } } else { - effect->unk_2C += 300; - if (effect->unk_2C >= 255) { - effect->unk_2C = 255; - effect->unk_30++; + effect->alpha += 300; + if (effect->alpha >= 255) { + effect->alpha = 255; + effect->isFading++; } } } @@ -6418,14 +6394,14 @@ void Boss07_Static_DrawEffects(GlobalContext* globalCtx) { OPEN_DISPS(gfxCtx); func_8012C2DC(globalCtx->state.gfxCtx); for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { - if (effect->unk_0 > 0) { - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, effect->unk_2C); + if (effect->type > 0) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, effect->alpha); 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->unk_2) & 0x7F, - (15 * -effect->unk_2) & 0xFF, 0x20, 0x40, 1, 0, 0, 0x20, 0x20)); - Matrix_InsertTranslation(effect->unk_4.x, effect->unk_4.y, effect->unk_4.z, 0); + 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); Matrix_NormalizeXYZ(&globalCtx->mf_187FC); Matrix_Scale(effect->unk_34, effect->unk_34, 1.0f, 1); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index d030902e0..c30c80ce6 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -10965,8 +10965,8 @@ 0x80A09A54:("sMajorasWrath","UNK_TYPE4","",0x4), 0x80A09A58:("sMajoraStatic","UNK_TYPE4","",0x4), 0x80A09A5C:("sMajorasMask","UNK_TYPE4","",0x4), - 0x80A09A60:("sBossRemains","UNK_TYPE4","[4]",0x4), - 0x80A09A70:("D_80A09A70","UNK_TYPE1","",0x1), + 0x80A09A60:("sBossRemains","Boss07*","[4]",0x10), + 0x80A09A70:("sKillProjectiles","UNK_TYPE1","",0x1), 0x80A09A71:("sMusicStartTimer","UNK_TYPE1","",0x1), 0x80A09A78:("sEffects","UNK_TYPE1","",0x1), 0x80A0A888:("sSeed0","UNK_TYPE4","",0x4), From 494332fd7d77ffbeb826885e3777073d90d86773 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Fri, 29 Oct 2021 08:28:37 -0500 Subject: [PATCH 11/28] more docs --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 2025 ++++++----------- src/overlays/actors/ovl_Boss_07/z_boss_07.h | 21 +- .../actors/ovl_Boss_07/z_boss_07_colchk.c | 422 ++++ .../actors/ovl_Boss_07/z_boss_07_dmgtbl.c | 176 ++ tools/disasm/functions.txt | 14 +- 5 files changed, 1304 insertions(+), 1354 deletions(-) create mode 100644 src/overlays/actors/ovl_Boss_07/z_boss_07_colchk.c create mode 100644 src/overlays/actors/ovl_Boss_07/z_boss_07_dmgtbl.c 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",), From f3e8b7d3cf97636ed0cd75fb5db7fbb845b587b9 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Fri, 4 Mar 2022 07:38:01 -0600 Subject: [PATCH 12/28] . --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 5f88c869a..4dbde29c7 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -502,7 +502,6 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; s32 i; - f32 whipScale = 1.0; if (this->actor.params == MAJORA_STATIC) { this->actor.update = Boss07_Static_Update; @@ -531,7 +530,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.gravity = -2.5f; - if (this->actor.params >= MAJORA_REMAINS) { + if (thisx->params >= MAJORA_REMAINS) { this->actor.update = Boss07_Remains_Update; this->actor.draw = Boss07_Remains_Draw; if (1) {} @@ -646,7 +645,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { Boss07_Wrath_SetupIntro(this, globalCtx); } else { Boss07_Wrath_SetupIdle(this, globalCtx, 50); - this->whipScale = whipScale; + this->whipScale = 1.0; Audio_QueueSeqCmd(0x8069); } SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060335F0, &D_0603CBD0, this->jointTable, From 16488d8419c376ccf46721d00149994af93c2ddc Mon Sep 17 00:00:00 2001 From: petrie911 Date: Thu, 16 Jun 2022 06:03:21 -0500 Subject: [PATCH 13/28] more adjustments --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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 3eaf66d90..6ce34dbb3 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -537,7 +537,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.gravity = -2.5f; - if (thisx->params >= MAJORA_REMAINS) { + if (this->actor.params >= MAJORA_REMAINS) { this->actor.update = Boss07_Remains_Update; this->actor.draw = Boss07_Remains_Draw; if (1) {} @@ -1950,16 +1950,17 @@ void Boss07_Wrath_DamageEffects(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->unk_17FC, 1.0f, 0.05f, 0.05f); } break; + if(1) { case 20: this->unk_1804 = 20; this->unk_1806 = 40; this->unk_17F8 = 1.0f; - goto test_label; + } else { case 30: this->unk_1804 = 21; this->unk_1806 = 40; this->unk_17F8 = 3.0f; - test_label: + } this->unk_1800 = 1.0f; this->unk_1805 = 21; case 21: @@ -2702,7 +2703,7 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { case 2: if (this->unk_ABC8 >= 20) { if (this->unk_ABC8 == 20) { - this->unk_17C8[3] = 1.0f; + this->unk_17C8[3] = 1.0; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_TRANSFORM); } Math_ApproachF(&this->unk_17B8[3], 1.0f + (this->unk_17C8[3] * sp58), 1.0f, 0.5f); @@ -2731,14 +2732,14 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { this->unk_17C8[1] = 1.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_TRANSFORM); } - Math_ApproachF(&this->unk_17B8[1], (this->unk_17C8[1] * sp58) + 1.0f, 1.0f, 0.5f); + Math_ApproachF(&this->unk_17B8[1], 1.0f + (this->unk_17C8[1] * sp58), 1.0f, 0.5f); } if (this->unk_ABC8 >= 60) { if (this->unk_ABC8 == 60) { this->unk_17C8[0] = 1.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_TRANSFORM); } - Math_ApproachF(this->unk_17B8, (this->unk_17C8[0] * sp58) + 1.0f, 1.0f, 0.5f); + Math_ApproachF(this->unk_17B8, 1.0f + (this->unk_17C8[0] * sp58), 1.0f, 0.5f); } if (this->unk_ABC8 == 80) { this->csState = 4; @@ -2800,7 +2801,7 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->csCamNextEye.y, 20.0f, 0.05f, this->csCamSpeedMod * 60.0f); Math_ApproachF(&this->csCamNextEye.z, 220.0f, 0.05f, this->csCamSpeedMod * 180.0f); Math_ApproachF(&this->csCamNextAt.y, 110.0f, 0.05f, this->csCamSpeedMod * 80.0f); - Math_ApproachF(&this->csCamSpeedMod, 0.1f, 1.0f, 0.005f); + Math_ApproachF(&this->csCamSpeedMod, 0.1f, 1.f, 0.005f); if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { Camera* sp54 = Play_GetCamera(globalCtx, 0); From b55c107d727b321ae8e19a1fcf8d90fe69871fd4 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Thu, 16 Jun 2022 09:32:57 -0500 Subject: [PATCH 14/28] linked assets --- assets/xml/objects/object_boss07.xml | 6 +- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 263 +++++++------------- 2 files changed, 100 insertions(+), 169 deletions(-) diff --git a/assets/xml/objects/object_boss07.xml b/assets/xml/objects/object_boss07.xml index 15a2e162d..777580b03 100644 --- a/assets/xml/objects/object_boss07.xml +++ b/assets/xml/objects/object_boss07.xml @@ -156,7 +156,9 @@ - + + + @@ -211,6 +213,6 @@ - + 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 6ce34dbb3..644ed1035 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_boss07/object_boss07.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -153,78 +154,6 @@ void Boss07_Static_UpdateEffects(GlobalContext* globalCtx); void Boss07_Static_DrawEffects(GlobalContext* globalCtx); #endif -#if 1 // object addresses -extern AnimationHeader D_06000194; -extern AnimationHeader D_06000428; -extern AnimationHeader D_06000D0C; -extern AnimationHeader D_06002C40; -extern AnimationHeader D_06002D84; -extern AnimationHeader D_060031E4; -extern AnimationHeader D_06003854; -extern AnimationHeader D_06003A64; -extern FlexSkeletonHeader D_060099A0; -extern AnimationHeader D_06009C7C; -extern AnimationHeader D_06009EA8; -extern AnimationHeader D_0600A194; -extern AnimationHeader D_0600A400; -extern AnimationHeader D_0600A6AC; -extern AnimationHeader D_0600AB04; -extern AnimationHeader D_0600AD84; -extern AnimationHeader D_0600AE40; -extern Gfx D_0600AFB0[]; -extern Gfx D_0600B020[]; -extern Gfx D_0600C7D8[]; -extern Gfx D_0600CEE8[]; -extern Gfx D_060149A0[]; -extern Gfx D_06016090[]; -extern Gfx D_06017DE0[]; -extern Gfx D_06019328[]; -extern SkeletonHeader D_06019C58; -extern AnimationHeader D_06019E48; -extern AnimationHeader D_0601DEB4; -extern AnimationHeader D_06022BB4; -extern AnimationHeader D_06023DAC; -extern AnimationHeader D_06025018; -extern AnimationHeader D_06025878; -extern AnimationHeader D_06026204; -extern AnimationHeader D_060269EC; -extern AnimationHeader D_06026EA0; -extern AnimationHeader D_06027270; -extern Gfx D_0602EE50[]; -extern Gfx D_0602EEC8[]; -extern Gfx D_0602EEF8[]; -extern Gfx D_0602EF68[]; -extern Gfx D_0602EF88[]; -extern Gfx D_0602EFE8[]; -extern Gfx D_0602F640[]; -extern UNK_TYPE D_0602F840; // title card -extern UNK_TYPE D_06030C40; // title card -extern UNK_TYPE D_06032040; // title card -extern FlexSkeletonHeader D_060335F0; -extern AnimationHeader D_06033F80; -extern AnimationHeader D_06034E64; -extern AnimationHeader D_060358C4; -extern AnimationHeader D_06036A7C; -extern AnimationHeader D_06037ADC; -extern AnimationHeader D_0603918C; -extern AnimationHeader D_0603B330; -extern AnimationHeader D_0603C4E0; -extern AnimationHeader D_0603CBD0; -extern AnimationHeader D_0603D224; -extern AnimationHeader D_0603D7F0; -extern AnimationHeader D_0603DD1C; -extern UNK_TYPE D_0603DD30[]; -extern UNK_TYPE D_0603ED30[]; -extern UNK_TYPE D_0603F130[]; -extern UNK_TYPE D_06040130[]; -extern UNK_TYPE D_06040930[]; -extern UNK_TYPE D_06040B30[]; -extern UNK_TYPE D_06041B30[]; -extern UNK_TYPE D_06042330[]; -extern UNK_TYPE D_06043330[]; -extern UNK_TYPE D_06045B30[]; -#endif - static s16 sColorsYRGB[4][3] = { { 255, 255, 100 }, // light yellow { 255, 100, 100 }, // light red @@ -575,7 +504,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, ActorShadow_DrawCircle, 15.0f); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06019C58, &D_06019E48, this->jointTable, this->morphTable, + SkelAnime_Init(globalCtx, &this->skelAnime, &object_boss07_Skel_019C58, &object_boss07_Anim_019E48, this->jointTable, this->morphTable, MAJORA_MASK_LIMB_COUNT); if (this->actor.params == MAJORA_MASK) { this->actor.update = Boss07_Mask_Update; @@ -609,7 +538,7 @@ 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->jointTable, + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_boss07_Skel_0099A0, &object_boss07_Anim_00A6AC, this->jointTable, this->morphTable, MAJORA_INCARNATION_LIMB_COUNT); if (this->actor.params == MAJORA_AFTERIMAGE) { this->timers[0] = this->actor.world.rot.z; @@ -655,7 +584,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->whipScale = 1.0; Audio_QueueSeqCmd(0x8069); } - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060335F0, &D_0603CBD0, this->jointTable, + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_boss07_Skel_0335F0, &object_boss07_Anim_03CBD0, 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); @@ -694,7 +623,7 @@ void Boss07_Destroy(Actor* thisx, GlobalContext* globalCtx2) { void Boss07_Wrath_SetupIntro(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Wrath_Intro; - Animation_MorphToLoop(&this->skelAnime, &D_06023DAC, 0.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_023DAC, 0.0f); this->actor.flags &= ~1; this->unk_17D8 = 0x7F00; this->unk_15C = 20; @@ -756,8 +685,8 @@ void Boss07_Wrath_Intro(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->csCamNextAt.y, sCamPoints[dataIndex][2], 0.075f, this->csCamSpeedMod * 7.0f); Math_ApproachF(&this->csCamSpeedMod, 1.0f, 1.0f, 0.01f); if (this->unk_ABC8 == 70) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06025018, -15.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06025018); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_025018, -15.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_025018); func_8019FE1C(&this->actor.projectedPos, NA_SE_EV_ICE_PILLAR_RISING, 1.0f); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_SHOUT); } @@ -779,7 +708,7 @@ void Boss07_Wrath_Intro(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_ABC8 == 137) { TitleCard_InitBossName(&globalCtx->state, &globalCtx->actorCtx.titleCtxt, - Lib_SegmentedToVirtual(&D_06032040), 0xA0, 0xB4, 0x80, 0x28); + Lib_SegmentedToVirtual(object_boss07_Tex_032040), 0xA0, 0xB4, 0x80, 0x28); } if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { s32 i; @@ -823,7 +752,7 @@ void Boss07_Wrath_SetupDeath(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_022BB4, 0.0f); this->actor.flags &= ~1; this->csState = 0; this->unk_ABC8 = 0; @@ -1066,7 +995,7 @@ void Boss07_Wrath_Death(Boss07* this, GlobalContext* globalCtx) { void Boss07_Wrath_SetupIdle(Boss07* this, GlobalContext* globalCtx, s16 delay) { this->actionFunc = Boss07_Wrath_Idle; - Animation_MorphToLoop(&this->skelAnime, &D_0603CBD0, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_03CBD0, -10.0f); if (delay != 0) { this->timers[0] = delay; } else { @@ -1108,7 +1037,7 @@ void Boss07_Wrath_Idle(Boss07* this, GlobalContext* globalCtx) { void Boss07_Wrath_SetupJump(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Wrath_StartJump; - Animation_MorphToPlayOnce(&this->skelAnime, &D_06025878, -5.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_025878, -5.0f); this->actionTimer = 0; } @@ -1154,10 +1083,10 @@ void Boss07_Wrath_SetupFlip(Boss07* this, GlobalContext* globalCtx) { temp = this->actor.yawTowardsPlayer - (s16)(Math_Acot2F(dz, dx) * (0x8000 / M_PI)); if (temp < 0) { dx = 200.0f; - Animation_MorphToPlayOnce(&this->skelAnime, &D_0603D224, -5.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_03D224, -5.0f); } else { dx = -200.0f; - Animation_MorphToPlayOnce(&this->skelAnime, &D_0603D7F0, -5.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_03D7F0, -5.0f); } Matrix_RotateYS(this->actor.yawTowardsPlayer, MTXMODE_NEW); Matrix_MultVecX(dx, &sp30); @@ -1197,7 +1126,7 @@ void Boss07_Wrath_SetupSidestep(Boss07* this, GlobalContext* globalCtx) { s16 sp22; this->actionFunc = Boss07_Wrath_Sidestep; - Animation_MorphToLoop(&this->skelAnime, &D_0603DD1C, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_03DD1C, -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)); @@ -1265,38 +1194,38 @@ void Boss07_Wrath_SetupAttack(Boss07* this, GlobalContext* globalCtx) { } switch (this->actionState) { case 0: - Animation_MorphToPlayOnce(&this->skelAnime, &D_06033F80, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06033F80); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_033F80, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_033F80); break; case 1: - Animation_MorphToPlayOnce(&this->skelAnime, &D_06034E64, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06034E64); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_034E64, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_034E64); break; case 2: - Animation_MorphToPlayOnce(&this->skelAnime, &D_060358C4, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_060358C4); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_0358C4, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_0358C4); break; case 3: - Animation_MorphToPlayOnce(&this->skelAnime, &D_06036A7C, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06036A7C); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_036A7C, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_036A7C); break; case 4: - Animation_MorphToPlayOnce(&this->skelAnime, &D_0603C4E0, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_0603C4E0); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_03C4E0, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_03C4E0); func_809F4D10(&this->unk_164, 650.0f); this->unk_170 = 0.0f; break; case 5: - Animation_MorphToPlayOnce(&this->skelAnime, &D_06037ADC, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06037ADC); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_037ADC, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_037ADC); break; case 6: - Animation_MorphToPlayOnce(&this->skelAnime, &D_0603918C, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_0603918C); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_03918C, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_03918C); break; case 7: - Animation_MorphToPlayOnce(&this->skelAnime, &D_06026204, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06026204); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_026204, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_026204); break; } this->actionTimer = 0; @@ -1442,8 +1371,8 @@ void Boss07_Wrath_Attack(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_026EA0, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_026EA0); this->actionTimer = 0; } @@ -1479,8 +1408,8 @@ void Boss07_Wrath_GrabPlayer(Boss07* this, GlobalContext* globalCtx) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_THROW_OLD); play_sound(NA_SE_EN_LAST3_COIL_ATTACK_OLD); this->actionFunc = Boss07_Wrath_ThrowPlayer; - Animation_MorphToPlayOnce(&this->skelAnime, &D_06027270, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06027270); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_027270, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_027270); this->actionTimer = 0; } if ((func_800B64FC(globalCtx, 1000.0f, &this->actor.world.pos, &sp2C) >= 0.0f) && (sp2C == 1)) { @@ -1572,8 +1501,8 @@ void Boss07_Wrath_Shock(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_32C > 4.0f) { this->actionFunc = Boss07_Wrath_ShockStun; - Animation_MorphToPlayOnce(&this->skelAnime, &D_0603B330, -10.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_0603B330); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_03B330, -10.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_03B330); this->unk_F7E = 0; if (&this->actor == player->actor.parent) { player->unk_AE8 = 101; @@ -1608,8 +1537,8 @@ void Boss07_Wrath_ShockStun(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_03B330, -10.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_03B330); } this->unk_158 = 10; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE_OLD); @@ -1617,8 +1546,8 @@ void Boss07_Wrath_SetupStunned(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_0269EC, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_0269EC); this->actionTimer = 0; } @@ -1695,15 +1624,15 @@ void Boss07_Wrath_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 damage } else { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE2_OLD); if (this->actionFunc != Boss07_Wrath_Damaged) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_0601DEB4, -10.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_01DEB4, -10.0f); this->actionFunc = Boss07_Wrath_Damaged; - this->unk_1D4 = Animation_GetLastFrame(&D_0601DEB4); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_01DEB4); this->unk_ABCC = 0; } else if (effect == 14) { if (this->skelAnime.curFrame <= (this->unk_1D4 - 5.0f)) { this->unk_158 = 30; } else { - Animation_MorphToPlayOnce(&this->skelAnime, &D_0601DEB4, -5.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_01DEB4, -5.0f); } } } @@ -2078,15 +2007,15 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { Boss07_Wrath_SetupDeath(this, globalCtx); } if (this->unk_1D8 != 0) { - u16* sp74 = SEGMENTED_TO_VIRTUAL(D_06040930); - u16* sp70 = SEGMENTED_TO_VIRTUAL(D_0603ED30); - u16* sp6C = SEGMENTED_TO_VIRTUAL(D_06040130); - u16* sp68 = SEGMENTED_TO_VIRTUAL(D_06041B30); - u16* sp64 = SEGMENTED_TO_VIRTUAL(D_0603F130); - u16* sp60 = SEGMENTED_TO_VIRTUAL(D_06042330); - u16* sp5C = SEGMENTED_TO_VIRTUAL(D_06040B30); - u16* sp58 = SEGMENTED_TO_VIRTUAL(D_06043330); - u16* sp54 = SEGMENTED_TO_VIRTUAL(D_0603DD30); + u16* sp74 = SEGMENTED_TO_VIRTUAL(object_boss07_Tex_040930); + u16* sp70 = SEGMENTED_TO_VIRTUAL(object_boss07_Tex_03ED30); + u16* sp6C = SEGMENTED_TO_VIRTUAL(object_boss07_Tex_040130); + u16* sp68 = SEGMENTED_TO_VIRTUAL(object_boss07_Tex_041B30); + u16* sp64 = SEGMENTED_TO_VIRTUAL(object_boss07_Tex_03F130); + u16* sp60 = SEGMENTED_TO_VIRTUAL(object_boss07_Tex_042330); + u16* sp5C = SEGMENTED_TO_VIRTUAL(object_boss07_Tex_040B30); + u16* sp58 = SEGMENTED_TO_VIRTUAL(object_boss07_Tex_043330); + u16* sp54 = SEGMENTED_TO_VIRTUAL(object_boss07_Tex_03DD30); for (i = 0; i < this->unk_1D8; i++) { s32 sp50; @@ -2255,7 +2184,7 @@ void Boss07_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* pos, Vec3f* OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, D_0602EEC8); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_02EEC8); 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++) { @@ -2266,11 +2195,11 @@ void Boss07_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* pos, Vec3f* 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, 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); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_02EEF8); } pos = vec2; rot = vec3; - gSPDisplayList(POLY_OPA_DISP++, D_0602EE50); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_02EE50); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); for (i = 0; i < (sWhipSegCount - phi_s6) - 1; i++, pos++, rot++) { Matrix_Translate(pos->x, pos->y, pos->z, MTXMODE_NEW); @@ -2279,7 +2208,7 @@ void Boss07_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* pos, Vec3f* 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, 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); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_02EEF8); } CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -2435,7 +2364,7 @@ void Boss07_DrawDeathLights(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2) 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); + gSPDisplayList(POLY_XLU_DISP++, object_boss07_DL_02EFE8); } } func_8012C2DC(globalCtx->state.gfxCtx); @@ -2650,10 +2579,10 @@ void Boss07_Wrath_DrawShadowTex(u8* shadowTex, Boss07* this, GlobalContext* glob 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); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_02EF68); 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); - gSPDisplayList(POLY_OPA_DISP++, D_0602EF88); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_02EF88); CLOSE_DISPS(pad3); } @@ -2670,7 +2599,7 @@ void func_809FCBC8(Boss07* this) { void Boss07_Incarnation_SetupIntro(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Incarnation_Intro; - Animation_MorphToLoop(&this->skelAnime, &D_06002D84, 0.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_002D84, 0.0f); this->actor.flags &= ~1; this->unk_17D8 = 0x6E00; } @@ -2772,8 +2701,8 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { break; case 5: if (this->unk_ABC8 == 20) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06002C40, 0.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06002C40); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_002C40, 0.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_002C40); } if (this->unk_ABC8 >= 20) { sREG(28) = this->unk_ABC8; @@ -2789,7 +2718,7 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { } } if (this->unk_ABC8 == 45) { - TitleCard_InitBossName(&globalCtx->state, &globalCtx->actorCtx.titleCtxt, Lib_SegmentedToVirtual(&D_06030C40), + TitleCard_InitBossName(&globalCtx->state, &globalCtx->actorCtx.titleCtxt, Lib_SegmentedToVirtual(object_boss07_Tex_030C40), 0xA0, 0xB4, 0x80, 0x28); } if (this->unk_ABC8 == 20) { @@ -2833,7 +2762,7 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { #endif void Boss07_Incarnation_SetupTaunt(Boss07* this, GlobalContext* globalCtx) { - static AnimationHeader* sTauntAnims[3] = { &D_0600A6AC, &D_0600AB04, &D_0600AD84 }; + static AnimationHeader* sTauntAnims[3] = { &object_boss07_Anim_00A6AC, &object_boss07_Anim_00AB04, &object_boss07_Anim_00AD84 }; this->actionFunc = Boss07_Incarnation_Taunt; this->actionState = Rand_ZeroFloat(2.999f); @@ -2863,8 +2792,8 @@ void Boss07_Incarnation_Taunt(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_009C7C, -10.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_009C7C); } this->unk_158 = 10; this->timers[0] = arg2; @@ -2879,7 +2808,7 @@ void Boss07_Incarnation_Stunned(Boss07* this, GlobalContext* globalCtx) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_LAND); } if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { - Animation_MorphToLoop(&this->skelAnime, &D_06009EA8, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_009EA8, -5.0f); this->unk_1D4 = 1000.0f; } if (this->unk_1D4 == 1000.0f) { @@ -2894,14 +2823,14 @@ void Boss07_Incarnation_Stunned(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_000D0C, -2.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_000D0C); } else if (arg3 == 14) { if (this->skelAnime.curFrame <= (this->unk_1D4 - 5.0f)) { this->unk_158 = 30; this->unk_15C = 30; } else { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06000D0C, -2.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_000D0C, -2.0f); } } @@ -2930,7 +2859,7 @@ void Boss07_Incarnation_Damaged(Boss07* this, GlobalContext* globalCtx) { } void Boss07_Incarnation_SetupRun(Boss07* this, GlobalContext* globalCtx) { - Animation_MorphToLoop(&this->skelAnime, &D_0600A400, -2.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_00A400, -2.0f); this->actionFunc = Boss07_Incarnation_Run; this->timers[0] = Rand_ZeroFloat(100.0f) + 150.0f; func_809FCBC8(this); @@ -2993,7 +2922,7 @@ void Boss07_Incarnation_Run(Boss07* this, GlobalContext* globalCtx) { void Boss07_Incarnation_SetupAttack(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Incarnation_Attack; - Animation_MorphToLoop(&this->skelAnime, &D_06000428, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_000428, -5.0f); this->timers[0] = Rand_ZeroFloat(50.0f) + 30.0f; this->unk_188C = 0.0f; } @@ -3018,7 +2947,7 @@ void Boss07_Incarnation_Attack(Boss07* this, GlobalContext* globalCtx) { void Boss07_Incarnation_SetupHopak(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Incarnation_Hopak; - Animation_MorphToLoop(&this->skelAnime, &D_06003A64, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_003A64, -5.0f); this->timers[0] = Rand_ZeroFloat(100.0f) + 100.0f; this->timers[1] = 0; this->unk_ABC8 = 0; @@ -3061,7 +2990,7 @@ void Boss07_Incarnation_Hopak(Boss07* this, GlobalContext* globalCtx) { void Boss07_Incarnation_SetupMoonwalk(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Incarnation_Moonwalk; - Animation_MorphToLoop(&this->skelAnime, &D_0600A194, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_00A194, -10.0f); this->timers[0] = Rand_ZeroFloat(50.0f) + 70.0f; this->timers[1] = 0; } @@ -3092,7 +3021,7 @@ void Boss07_Incarnation_Moonwalk(Boss07* this, GlobalContext* globalCtx) { void Boss07_Incarnation_SetupPirouette(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Incarnation_Pirouette; - Animation_MorphToPlayOnce(&this->skelAnime, &D_06000194, -10.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_000194, -10.0f); this->timers[0] = Rand_ZeroFloat(70.0f) + 70.0f; this->timers[1] = 0; } @@ -3127,8 +3056,8 @@ void Boss07_Incarnation_Pirouette(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &object_boss07_Anim_000D0C, -2.0f); + this->unk_1D4 = Animation_GetLastFrame(&object_boss07_Anim_000D0C); this->csState = 0; this->unk_ABC8 = 0; this->actor.flags &= ~1; @@ -3169,7 +3098,7 @@ void Boss07_Incarnation_Death(Boss07* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { this->unk_ABC8 = 0; this->csState = 1; - Animation_MorphToLoop(&this->skelAnime, &D_06003854, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_003854, -5.0f); } break; case 1: @@ -3186,7 +3115,7 @@ void Boss07_Incarnation_Death(Boss07* this, GlobalContext* globalCtx) { this->csCamNextAt.z = -20.0f; this->unk_17E8 = 1.0f; this->unk_17EC = 0.4f; - Animation_MorphToLoop(&this->skelAnime, &D_060031E4, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_0031E4, -5.0f); this->actor.shape.rot.y = 0; this->actor.world.rot.y = this->actor.shape.rot.y; Math_ApproachF(&this->actor.world.pos.x, 0.0f, 1.0f, 200.0f); @@ -3519,7 +3448,7 @@ void Boss07_Incarnation_Draw(Actor* thisx, GlobalContext* globalCtx2) { void Boss07_Mask_SetupIdle(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Mask_Idle; - Animation_MorphToLoop(&this->skelAnime, &D_06019E48, -20.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_019E48, -20.0f); this->timers[2] = Rand_ZeroFloat(150.0f) + 60.0f; this->unk_1870 = 1.0f; } @@ -3669,7 +3598,7 @@ void Boss07_Mask_Spin(Boss07* this, GlobalContext* globalCtx) { void Boss07_Mask_SetupStunned(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Mask_Stunned; - Animation_MorphToLoop(&this->skelAnime, &D_0600AE40, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_00AE40, -10.0f); this->timers[0] = 100; this->unk_170 = 0.0f; } @@ -4260,7 +4189,7 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.world.pos.y, 350.0f, 0.03f, 2.0f); if (this->unk_ABC8 == 55) { TitleCard_InitBossName(&globalCtx->state, &globalCtx->actorCtx.titleCtxt, - Lib_SegmentedToVirtual(&D_0602F840), 0xA0, 0xB4, 0x80, 0x28); + Lib_SegmentedToVirtual(object_boss07_Tex_02F840), 0xA0, 0xB4, 0x80, 0x28); } if (this->unk_ABC8 == 30) { Audio_QueueSeqCmd(0x806B); @@ -4320,7 +4249,7 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { void Boss07_Mask_SetupDeath(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Mask_Death; - Animation_MorphToLoop(&this->skelAnime, &D_0600AE40, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss07_Anim_00AE40, -10.0f); this->actor.world.rot.y = this->actor.shape.rot.y = Math_Acot2F(-this->actor.world.pos.z, -this->actor.world.pos.x) * (0x8000 / M_PI); this->csState = 0; @@ -4682,7 +4611,7 @@ void Boss07_Mask_DrawTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* ar } 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); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_00B020); } CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -4710,14 +4639,14 @@ void Boss07_Mask_DrawBeam(Boss07* this, GlobalContext* globalCtx) { Matrix_RotateYS(-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++, object_boss07_DL_00C7D8); Matrix_Pop(); Matrix_Translate(-250.0f, 0.0f, 200.0f, MTXMODE_APPLY); Matrix_RotateYS(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++, object_boss07_DL_00C7D8); gSPDisplayList(POLY_XLU_DISP++, gLightOrb1DL); Matrix_Pop(); @@ -4740,7 +4669,7 @@ void Boss07_Mask_DrawBeam(Boss07* this, GlobalContext* globalCtx) { Matrix_MultZero(&this->unk_189C); 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); + gSPDisplayList(POLY_XLU_DISP++, object_boss07_DL_00C7D8); Matrix_MultVecZ(20100.0f, &this->unk_18A8); if (this->unk_18C0 > 0.0f) { Vec3f sp50; @@ -4753,7 +4682,7 @@ void Boss07_Mask_DrawBeam(Boss07* this, GlobalContext* globalCtx) { 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); + gSPDisplayList(POLY_XLU_DISP++, object_boss07_DL_00C7D8); Matrix_MultVecZ(20100.0f, &this->unk_18B4); Matrix_Translate(sp50.x, sp50.y, sp50.z, MTXMODE_NEW); @@ -4778,7 +4707,7 @@ void Boss07_Mask_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi } void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { - static void* D_80A082E0[2] = { D_06042330, D_06045B30 }; + static void* D_80A082E0[2] = { object_boss07_Tex_042330, object_boss07_Tex_045B30 }; GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; s32 i; @@ -4806,7 +4735,7 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, Boss07_Mask_PostLimbDraw, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); - gSPDisplayList(POLY_OPA_DISP++, D_0600AFB0); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_00AFB0); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); phi_s6 = ((this->actionFunc == Boss07_Mask_Idle) && @@ -5250,16 +5179,16 @@ void Boss07_Remains_Draw(Actor* thisx, GlobalContext* globalCtx2) { 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); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_0149A0); break; case MAJORA_REMAINS + REMAINS_GOHT: - gSPDisplayList(POLY_OPA_DISP++, D_06016090); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_016090); break; case MAJORA_REMAINS + REMAINS_GYORG: - gSPDisplayList(POLY_OPA_DISP++, D_06017DE0); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_017DE0); break; case MAJORA_REMAINS + REMAINS_TWINMOLD: - gSPDisplayList(POLY_OPA_DISP++, D_06019328); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_019328); break; } POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); @@ -5558,7 +5487,7 @@ void Boss07_Top_Draw(Actor* thisx, GlobalContext* globalCtx2) { Matrix_RotateYF(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); + gSPDisplayList(POLY_OPA_DISP++, object_boss07_DL_02F640); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -5765,7 +5694,7 @@ void Boss07_Static_DrawEffects(GlobalContext* globalCtx) { Matrix_ReplaceRotation(&globalCtx->billboardMtxF); 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); + gSPDisplayList(POLY_XLU_DISP++, object_boss07_DL_00CEE8); } } CLOSE_DISPS(gfxCtx); From 7cda25fa0766fb438df998020855a60635f76d64 Mon Sep 17 00:00:00 2001 From: Tom Overton Date: Wed, 6 Jul 2022 16:53:33 -0700 Subject: [PATCH 15/28] Document object_boss07 and match Boss07_Incarnation_Intro (thanks Synray!) --- assets/xml/objects/object_boss07.xml | 478 ++++++++++-------- include/functions.h | 2 +- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 509 +++++++++----------- src/overlays/actors/ovl_Boss_07/z_boss_07.h | 6 +- 4 files changed, 487 insertions(+), 508 deletions(-) diff --git a/assets/xml/objects/object_boss07.xml b/assets/xml/objects/object_boss07.xml index 15a2e162d..82e06d98a 100644 --- a/assets/xml/objects/object_boss07.xml +++ b/assets/xml/objects/object_boss07.xml @@ -1,216 +1,270 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/functions.h b/include/functions.h index 0c7256309..370d4b481 100644 --- a/include/functions.h +++ b/include/functions.h @@ -577,7 +577,7 @@ void EffectSsStone1_Spawn(GlobalContext* globalCtx, Vec3f* pos, s32 reg0); void EffectSsHitMark_SpawnFixedScale(GlobalContext* globalCtx, s32 type, Vec3f* pos); void EffectSsHitMark_SpawnCustomScale(GlobalContext* globalCtx, s32 type, s16 scale, Vec3f* pos); // void EffectSsFhgFlash_SpawnShock(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, Vec3f* pzParm3, UNK_TYPE2 uParm4, UNK_TYPE1 param_5); -void EffectSsKFire_Spawn(GlobalContext* globalCtx, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, s32 param_5, s32 param_6); +void EffectSsKFire_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scaleMax, u8 type); void EffectSsSolderSrchBall_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, s16* linkDetected, s16 drawFlag); void EffectSsKakera_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* arg3, s16 gravity, s16 arg5, s16 arg6, s16 arg7, s16 arg8, s16 scale, s16 arg10, s16 arg11, s32 life, s16 colorIdx, s16 objId, Gfx* dList); // void EffectSsIcePiece_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, UNK_TYPE4 uParm3, Vec3f* pzParm4, Vec3f* param_5, UNK_TYPE4 param_6); 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 6ce34dbb3..c50e45e4d 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -19,8 +19,8 @@ typedef enum { /* 0 */ REMAINS_ODOLWA, - /* 1 */ REMAINS_GOHT, - /* 2 */ REMAINS_GYORG, + /* 1 */ REMAINS_GYORG, + /* 2 */ REMAINS_GOHT, /* 3 */ REMAINS_TWINMOLD, /* 4 */ REMAINS_COUNT } RemainsIndex; @@ -153,78 +153,6 @@ void Boss07_Static_UpdateEffects(GlobalContext* globalCtx); void Boss07_Static_DrawEffects(GlobalContext* globalCtx); #endif -#if 1 // object addresses -extern AnimationHeader D_06000194; -extern AnimationHeader D_06000428; -extern AnimationHeader D_06000D0C; -extern AnimationHeader D_06002C40; -extern AnimationHeader D_06002D84; -extern AnimationHeader D_060031E4; -extern AnimationHeader D_06003854; -extern AnimationHeader D_06003A64; -extern FlexSkeletonHeader D_060099A0; -extern AnimationHeader D_06009C7C; -extern AnimationHeader D_06009EA8; -extern AnimationHeader D_0600A194; -extern AnimationHeader D_0600A400; -extern AnimationHeader D_0600A6AC; -extern AnimationHeader D_0600AB04; -extern AnimationHeader D_0600AD84; -extern AnimationHeader D_0600AE40; -extern Gfx D_0600AFB0[]; -extern Gfx D_0600B020[]; -extern Gfx D_0600C7D8[]; -extern Gfx D_0600CEE8[]; -extern Gfx D_060149A0[]; -extern Gfx D_06016090[]; -extern Gfx D_06017DE0[]; -extern Gfx D_06019328[]; -extern SkeletonHeader D_06019C58; -extern AnimationHeader D_06019E48; -extern AnimationHeader D_0601DEB4; -extern AnimationHeader D_06022BB4; -extern AnimationHeader D_06023DAC; -extern AnimationHeader D_06025018; -extern AnimationHeader D_06025878; -extern AnimationHeader D_06026204; -extern AnimationHeader D_060269EC; -extern AnimationHeader D_06026EA0; -extern AnimationHeader D_06027270; -extern Gfx D_0602EE50[]; -extern Gfx D_0602EEC8[]; -extern Gfx D_0602EEF8[]; -extern Gfx D_0602EF68[]; -extern Gfx D_0602EF88[]; -extern Gfx D_0602EFE8[]; -extern Gfx D_0602F640[]; -extern UNK_TYPE D_0602F840; // title card -extern UNK_TYPE D_06030C40; // title card -extern UNK_TYPE D_06032040; // title card -extern FlexSkeletonHeader D_060335F0; -extern AnimationHeader D_06033F80; -extern AnimationHeader D_06034E64; -extern AnimationHeader D_060358C4; -extern AnimationHeader D_06036A7C; -extern AnimationHeader D_06037ADC; -extern AnimationHeader D_0603918C; -extern AnimationHeader D_0603B330; -extern AnimationHeader D_0603C4E0; -extern AnimationHeader D_0603CBD0; -extern AnimationHeader D_0603D224; -extern AnimationHeader D_0603D7F0; -extern AnimationHeader D_0603DD1C; -extern UNK_TYPE D_0603DD30[]; -extern UNK_TYPE D_0603ED30[]; -extern UNK_TYPE D_0603F130[]; -extern UNK_TYPE D_06040130[]; -extern UNK_TYPE D_06040930[]; -extern UNK_TYPE D_06040B30[]; -extern UNK_TYPE D_06041B30[]; -extern UNK_TYPE D_06042330[]; -extern UNK_TYPE D_06043330[]; -extern UNK_TYPE D_06045B30[]; -#endif - static s16 sColorsYRGB[4][3] = { { 255, 255, 100 }, // light yellow { 255, 100, 100 }, // light red @@ -575,8 +503,8 @@ 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, ActorShadow_DrawCircle, 15.0f); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06019C58, &D_06019E48, this->jointTable, this->morphTable, - MAJORA_MASK_LIMB_COUNT); + SkelAnime_Init(globalCtx, &this->skelAnime, &gMajorasMaskSkel, &gMajorasMaskFloatingAnim, this->jointTable, + this->morphTable, MAJORAS_MASK_LIMB_MAX); if (this->actor.params == MAJORA_MASK) { this->actor.update = Boss07_Mask_Update; this->actor.draw = Boss07_Mask_Draw; @@ -609,8 +537,9 @@ 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->jointTable, - this->morphTable, MAJORA_INCARNATION_LIMB_COUNT); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gMajorasIncarnationSkel, + &gMajorasIncarnationTauntDance1Anim, this->jointTable, this->morphTable, + MAJORAS_INCARNATION_LIMB_MAX); if (this->actor.params == MAJORA_AFTERIMAGE) { this->timers[0] = this->actor.world.rot.z; this->actor.world.rot.z = 0; @@ -631,10 +560,9 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { } else { Boss07_Incarnation_SetupTaunt(this, globalCtx); this->unk_14A = 1; - this->unk_17B8[1] = 1.0f; - this->unk_17B8[2] = 1.0f; - this->unk_17B8[3] = 1.0f; - this->unk_17B8[0] = 1.0f; + for (i = 0; i < 4; i++) { + this->unk_17B8[i] = 1.0f; + } globalCtx->envCtx.lightBlend = 0.0f; } this->unk_17E0 = 1.0f; @@ -652,11 +580,11 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { Boss07_Wrath_SetupIntro(this, globalCtx); } else { Boss07_Wrath_SetupIdle(this, globalCtx, 50); - this->whipScale = 1.0; + this->whipScale = 1.0f; Audio_QueueSeqCmd(0x8069); } - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060335F0, &D_0603CBD0, this->jointTable, - this->morphTable, MAJORA_WRATH_LIMB_COUNT); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gMajorasWrathSkel, &gMajorasWrathIdleAnim, + this->jointTable, this->morphTable, MAJORAS_WRATH_LIMB_MAX); 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); @@ -694,7 +622,7 @@ void Boss07_Destroy(Actor* thisx, GlobalContext* globalCtx2) { void Boss07_Wrath_SetupIntro(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Wrath_Intro; - Animation_MorphToLoop(&this->skelAnime, &D_06023DAC, 0.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasWrathHeavyBreathingAnim, 0.0f); this->actor.flags &= ~1; this->unk_17D8 = 0x7F00; this->unk_15C = 20; @@ -756,8 +684,8 @@ void Boss07_Wrath_Intro(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->csCamNextAt.y, sCamPoints[dataIndex][2], 0.075f, this->csCamSpeedMod * 7.0f); Math_ApproachF(&this->csCamSpeedMod, 1.0f, 1.0f, 0.01f); if (this->unk_ABC8 == 70) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06025018, -15.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06025018); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathIntroAnim, -15.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathIntroAnim); func_8019FE1C(&this->actor.projectedPos, NA_SE_EV_ICE_PILLAR_RISING, 1.0f); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_SHOUT); } @@ -779,7 +707,7 @@ void Boss07_Wrath_Intro(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_ABC8 == 137) { TitleCard_InitBossName(&globalCtx->state, &globalCtx->actorCtx.titleCtxt, - Lib_SegmentedToVirtual(&D_06032040), 0xA0, 0xB4, 0x80, 0x28); + Lib_SegmentedToVirtual(&gMajorasWrathTitleCardTex), 0xA0, 0xB4, 0x80, 0x28); } if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { s32 i; @@ -823,7 +751,7 @@ void Boss07_Wrath_SetupDeath(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathDeathAnim, 0.0f); this->actor.flags &= ~1; this->csState = 0; this->unk_ABC8 = 0; @@ -973,7 +901,8 @@ void Boss07_Wrath_Death(Boss07* this, GlobalContext* globalCtx) { } globalCtx->envCtx.fillScreen = 1; - globalCtx->envCtx.screenFillColor[0] = globalCtx->envCtx.screenFillColor[1] = globalCtx->envCtx.screenFillColor[2] = 255; + globalCtx->envCtx.screenFillColor[0] = globalCtx->envCtx.screenFillColor[1] = + globalCtx->envCtx.screenFillColor[2] = 255; if (this->unk_ABC8 < 350) { sp98 = 0.5f; sp94 = 0.02f; @@ -1066,7 +995,7 @@ void Boss07_Wrath_Death(Boss07* this, GlobalContext* globalCtx) { void Boss07_Wrath_SetupIdle(Boss07* this, GlobalContext* globalCtx, s16 delay) { this->actionFunc = Boss07_Wrath_Idle; - Animation_MorphToLoop(&this->skelAnime, &D_0603CBD0, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasWrathIdleAnim, -10.0f); if (delay != 0) { this->timers[0] = delay; } else { @@ -1108,7 +1037,7 @@ void Boss07_Wrath_Idle(Boss07* this, GlobalContext* globalCtx) { void Boss07_Wrath_SetupJump(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Wrath_StartJump; - Animation_MorphToPlayOnce(&this->skelAnime, &D_06025878, -5.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathBackflipAnim, -5.0f); this->actionTimer = 0; } @@ -1154,10 +1083,10 @@ void Boss07_Wrath_SetupFlip(Boss07* this, GlobalContext* globalCtx) { temp = this->actor.yawTowardsPlayer - (s16)(Math_Acot2F(dz, dx) * (0x8000 / M_PI)); if (temp < 0) { dx = 200.0f; - Animation_MorphToPlayOnce(&this->skelAnime, &D_0603D224, -5.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathFlipLeftAnim, -5.0f); } else { dx = -200.0f; - Animation_MorphToPlayOnce(&this->skelAnime, &D_0603D7F0, -5.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathFlipRightAnim, -5.0f); } Matrix_RotateYS(this->actor.yawTowardsPlayer, MTXMODE_NEW); Matrix_MultVecX(dx, &sp30); @@ -1197,7 +1126,7 @@ void Boss07_Wrath_SetupSidestep(Boss07* this, GlobalContext* globalCtx) { s16 sp22; this->actionFunc = Boss07_Wrath_Sidestep; - Animation_MorphToLoop(&this->skelAnime, &D_0603DD1C, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasWrathSidestepAnim, -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)); @@ -1265,38 +1194,38 @@ void Boss07_Wrath_SetupAttack(Boss07* this, GlobalContext* globalCtx) { } switch (this->actionState) { case 0: - Animation_MorphToPlayOnce(&this->skelAnime, &D_06033F80, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06033F80); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathShortSingleWhipAttackAnim, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathShortSingleWhipAttackAnim); break; case 1: - Animation_MorphToPlayOnce(&this->skelAnime, &D_06034E64, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06034E64); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathWhipFlurryAttackAnim, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathWhipFlurryAttackAnim); break; case 2: - Animation_MorphToPlayOnce(&this->skelAnime, &D_060358C4, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_060358C4); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathDoubleWhipAttackAnim, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathDoubleWhipAttackAnim); break; case 3: - Animation_MorphToPlayOnce(&this->skelAnime, &D_06036A7C, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06036A7C); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathLongSingleWhipAttackAnim, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathLongSingleWhipAttackAnim); break; case 4: - Animation_MorphToPlayOnce(&this->skelAnime, &D_0603C4E0, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_0603C4E0); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathSpinAttackAnim, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathSpinAttackAnim); func_809F4D10(&this->unk_164, 650.0f); this->unk_170 = 0.0f; break; case 5: - Animation_MorphToPlayOnce(&this->skelAnime, &D_06037ADC, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06037ADC); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathTauntAnim, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathTauntAnim); break; case 6: - Animation_MorphToPlayOnce(&this->skelAnime, &D_0603918C, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_0603918C); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathThreeAttackComboAnim, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathThreeAttackComboAnim); break; case 7: - Animation_MorphToPlayOnce(&this->skelAnime, &D_06026204, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06026204); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathKickAnim, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathKickAnim); break; } this->actionTimer = 0; @@ -1442,8 +1371,8 @@ void Boss07_Wrath_Attack(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathGrabAnim, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathGrabAnim); this->actionTimer = 0; } @@ -1479,8 +1408,8 @@ void Boss07_Wrath_GrabPlayer(Boss07* this, GlobalContext* globalCtx) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_THROW_OLD); play_sound(NA_SE_EN_LAST3_COIL_ATTACK_OLD); this->actionFunc = Boss07_Wrath_ThrowPlayer; - Animation_MorphToPlayOnce(&this->skelAnime, &D_06027270, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06027270); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathThrowAnim, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathThrowAnim); this->actionTimer = 0; } if ((func_800B64FC(globalCtx, 1000.0f, &this->actor.world.pos, &sp2C) >= 0.0f) && (sp2C == 1)) { @@ -1572,8 +1501,8 @@ void Boss07_Wrath_Shock(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_32C > 4.0f) { this->actionFunc = Boss07_Wrath_ShockStun; - Animation_MorphToPlayOnce(&this->skelAnime, &D_0603B330, -10.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_0603B330); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathStunAnim, -10.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathStunAnim); this->unk_F7E = 0; if (&this->actor == player->actor.parent) { player->unk_AE8 = 101; @@ -1608,8 +1537,8 @@ void Boss07_Wrath_ShockStun(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathStunAnim, -10.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathStunAnim); } this->unk_158 = 10; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE_OLD); @@ -1617,8 +1546,8 @@ void Boss07_Wrath_SetupStunned(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathReleaseTopAnim, -5.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathReleaseTopAnim); this->actionTimer = 0; } @@ -1695,15 +1624,15 @@ void Boss07_Wrath_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 damage } else { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE2_OLD); if (this->actionFunc != Boss07_Wrath_Damaged) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_0601DEB4, -10.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathDamageAnim, -10.0f); this->actionFunc = Boss07_Wrath_Damaged; - this->unk_1D4 = Animation_GetLastFrame(&D_0601DEB4); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathDamageAnim); this->unk_ABCC = 0; } else if (effect == 14) { if (this->skelAnime.curFrame <= (this->unk_1D4 - 5.0f)) { this->unk_158 = 30; } else { - Animation_MorphToPlayOnce(&this->skelAnime, &D_0601DEB4, -5.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathDamageAnim, -5.0f); } } } @@ -1774,8 +1703,8 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* arg0, f32 arg1, Boss07* this, Global f32 dxz1; player->actor.parent = &this->actor; - Audio_PlaySfxGeneral(NA_SE_VO_LI_DAMAGE_S, &player->actor.projectedPos, 4, &D_801DB4B0, &D_801DB4B0, - &D_801DB4B8); + Audio_PlaySfxGeneral(NA_SE_VO_LI_DAMAGE_S, &player->actor.projectedPos, 4, &D_801DB4B0, + &D_801DB4B0, &D_801DB4B8); this->unk_F7C = 0; this->unk_F7E = ((this->actor.xzDistToPlayer - 300.0f) / 22.0f) + 10.0f; dx1 = player->actor.world.pos.x - this->rightWhip.basePos.x; @@ -1950,17 +1879,17 @@ void Boss07_Wrath_DamageEffects(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->unk_17FC, 1.0f, 0.05f, 0.05f); } break; - if(1) { - case 20: - this->unk_1804 = 20; - this->unk_1806 = 40; - this->unk_17F8 = 1.0f; - } else { - case 30: - this->unk_1804 = 21; - this->unk_1806 = 40; - this->unk_17F8 = 3.0f; - } + if (1) { + case 20: + this->unk_1804 = 20; + this->unk_1806 = 40; + this->unk_17F8 = 1.0f; + } else { + case 30: + this->unk_1804 = 21; + this->unk_1806 = 40; + this->unk_17F8 = 3.0f; + } this->unk_1800 = 1.0f; this->unk_1805 = 21; case 21: @@ -2078,15 +2007,15 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { Boss07_Wrath_SetupDeath(this, globalCtx); } if (this->unk_1D8 != 0) { - u16* sp74 = SEGMENTED_TO_VIRTUAL(D_06040930); - u16* sp70 = SEGMENTED_TO_VIRTUAL(D_0603ED30); - u16* sp6C = SEGMENTED_TO_VIRTUAL(D_06040130); - u16* sp68 = SEGMENTED_TO_VIRTUAL(D_06041B30); - u16* sp64 = SEGMENTED_TO_VIRTUAL(D_0603F130); - u16* sp60 = SEGMENTED_TO_VIRTUAL(D_06042330); - u16* sp5C = SEGMENTED_TO_VIRTUAL(D_06040B30); - u16* sp58 = SEGMENTED_TO_VIRTUAL(D_06043330); - u16* sp54 = SEGMENTED_TO_VIRTUAL(D_0603DD30); + u16* sp74 = SEGMENTED_TO_VIRTUAL(gMajorasWrathEarTex); + u16* sp70 = SEGMENTED_TO_VIRTUAL(gMajoraStripesTex); + u16* sp6C = SEGMENTED_TO_VIRTUAL(gMajorasWrathMouthTex); + u16* sp68 = SEGMENTED_TO_VIRTUAL(gMajoraBloodshotEyeTex); + u16* sp64 = SEGMENTED_TO_VIRTUAL(gMajorasWrathEyeTex); + u16* sp60 = SEGMENTED_TO_VIRTUAL(gMajorasMaskWithNormalEyesTex); + u16* sp5C = SEGMENTED_TO_VIRTUAL(gMajoraVeinsTex); + u16* sp58 = SEGMENTED_TO_VIRTUAL(gMajoraHandTex); + u16* sp54 = SEGMENTED_TO_VIRTUAL(gMajoraBodyTex); for (i = 0; i < this->unk_1D8; i++) { s32 sp50; @@ -2116,8 +2045,8 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { } void Boss07_UpdateWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, - f32 gravity, f32 stiffness, f32 drag, f32 tension, Vec3s* baseRot, s16 argB, f32 scale, - s32 whipHand) { + f32 gravity, f32 stiffness, f32 drag, f32 tension, Vec3s* baseRot, s16 argB, f32 scale, + s32 whipHand) { s32 i; s32 phi_s6; f32 temp_f20; @@ -2255,7 +2184,7 @@ void Boss07_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* pos, Vec3f* OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, D_0602EEC8); + gSPDisplayList(POLY_OPA_DISP++, gMajorasMaskWhipShadowMaterialDL); 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++) { @@ -2266,11 +2195,11 @@ void Boss07_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* pos, Vec3f* 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, 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); + gSPDisplayList(POLY_OPA_DISP++, gMajorasWrathWhipModelDL); } pos = vec2; rot = vec3; - gSPDisplayList(POLY_OPA_DISP++, D_0602EE50); + gSPDisplayList(POLY_OPA_DISP++, gMajorasWrathWhipMaterialDL); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); for (i = 0; i < (sWhipSegCount - phi_s6) - 1; i++, pos++, rot++) { Matrix_Translate(pos->x, pos->y, pos->z, MTXMODE_NEW); @@ -2279,7 +2208,7 @@ void Boss07_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* pos, Vec3f* 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, 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); + gSPDisplayList(POLY_OPA_DISP++, gMajorasWrathWhipModelDL); } CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -2288,7 +2217,7 @@ s32 Boss07_Wrath_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** Actor* thisx) { Boss07* this = THIS; - if (limbIndex == 26) { + if (limbIndex == MAJORAS_WRATH_LIMB_HEAD) { rot->x += this->unk_17DA; rot->y += this->unk_17D8; rot->z += this->unk_17DC; @@ -2327,24 +2256,24 @@ void Boss07_Wrath_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL } Boss07_UpdateSpheres(sp6B, &this->sph1, &sp5C); } - if (limbIndex == 26) { + if (limbIndex == MAJORAS_WRATH_LIMB_HEAD) { Matrix_MultZero(&this->actor.focus.pos); } - if (limbIndex == 19) { + if (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_HAND) { Matrix_MultVec3f(&sWhipOffset, &this->rightWhip.basePos); } - if (limbIndex == 17) { + if (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_LOWER_ARM_ROOT) { Matrix_Get(&sp1C); Matrix_MtxFToYXZRot(&sp1C, &this->rightWhip.baseRot, 0); } - if (limbIndex == 24) { + if (limbIndex == MAJORAS_WRATH_LIMB_LEFT_HAND) { Matrix_MultVec3f(&sWhipOffset, &this->leftWhip.basePos); } - if (limbIndex == 22) { + if (limbIndex == MAJORAS_WRATH_LIMB_LEFT_LOWER_ARM_ROOT) { Matrix_Get(&sp1C); Matrix_MtxFToYXZRot(&sp1C, &this->leftWhip.baseRot, 0); } - if (limbIndex == 12) { + if (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_FOOT) { Matrix_MultZero(&sp5C); Boss07_UpdateSpheres(0, &this->sph2, &sp5C); } @@ -2353,9 +2282,13 @@ void Boss07_Wrath_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL 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 == 11) || (limbIndex == 12) || (limbIndex == 16) || (limbIndex == 18) || (limbIndex == 19) || - (limbIndex == 21) || (limbIndex == 23) || (limbIndex == 24) || (limbIndex == 26)) { + if ((limbIndex == MAJORAS_WRATH_LIMB_PELVIS) || (limbIndex == MAJORAS_WRATH_LIMB_LEFT_THIGH) || + (limbIndex == MAJORAS_WRATH_LIMB_LEFT_SHIN) || (limbIndex == MAJORAS_WRATH_LIMB_LEFT_FOOT) || + (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_THIGH) || (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_SHIN) || + (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_FOOT) || (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_UPPER_ARM) || + (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_FOREARM) || (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_HAND) || + (limbIndex == MAJORAS_WRATH_LIMB_LEFT_UPPER_ARM) || (limbIndex == MAJORAS_WRATH_LIMB_LEFT_FOREARM) || + (limbIndex == MAJORAS_WRATH_LIMB_LEFT_HAND) || (limbIndex == MAJORAS_WRATH_LIMB_HEAD)) { Matrix_Scale(1.0f, this->unk_17E0, this->unk_17E0, MTXMODE_APPLY); } } @@ -2374,7 +2307,7 @@ void Boss07_DrawShocks(Boss07* this, GlobalContext* globalCtx) { gSPDisplayList(POLY_XLU_DISP++, gLightOrb1DL); for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) { Matrix_Translate(this->bodyPartsPos[i].x, this->bodyPartsPos[i].y, this->bodyPartsPos[i].z, - MTXMODE_NEW); + MTXMODE_NEW); Matrix_ReplaceRotation(&globalCtx->billboardMtxF); Matrix_Scale(this->unk_32C, this->unk_32C, this->unk_32C, MTXMODE_APPLY); Matrix_RotateZF(Rand_ZeroFloat(2.0f * M_PI), MTXMODE_APPLY); @@ -2382,8 +2315,7 @@ void Boss07_DrawShocks(Boss07* this, GlobalContext* globalCtx) { gSPDisplayList(POLY_XLU_DISP++, gLightOrbVtxDL); } for (i = this->unk_780; i >= this->unk_784; i--) { - Matrix_Translate(this->rightWhip.pos[i].x, this->rightWhip.pos[i].y, this->rightWhip.pos[i].z, - 0); + Matrix_Translate(this->rightWhip.pos[i].x, this->rightWhip.pos[i].y, this->rightWhip.pos[i].z, 0); Matrix_ReplaceRotation(&globalCtx->billboardMtxF); Matrix_Scale(1.5f, 1.5f, 1.5f, MTXMODE_APPLY); Matrix_RotateZF(Rand_ZeroFloat(2.0f * M_PI), MTXMODE_APPLY); @@ -2395,8 +2327,8 @@ void Boss07_DrawShocks(Boss07* this, GlobalContext* globalCtx) { gSPDisplayList(POLY_XLU_DISP++, gLightOrb2DL); for (i = 0; i < 2 * ARRAY_COUNT(this->bodyPartsPos); i++) { Matrix_Translate(this->bodyPartsPos[i / 2].x + randPlusMinusPoint5Scaled(30.0f), - this->bodyPartsPos[i / 2].y + randPlusMinusPoint5Scaled(30.0f), - this->bodyPartsPos[i / 2].z + randPlusMinusPoint5Scaled(30.0f), MTXMODE_NEW); + this->bodyPartsPos[i / 2].y + randPlusMinusPoint5Scaled(30.0f), + this->bodyPartsPos[i / 2].z + randPlusMinusPoint5Scaled(30.0f), MTXMODE_NEW); Matrix_Scale(this->unk_330, this->unk_330, this->unk_330, MTXMODE_APPLY); Matrix_RotateXFApply(Rand_ZeroFloat(2.0f * M_PI)); Matrix_RotateZF(Rand_ZeroFloat(2.0f * M_PI), MTXMODE_APPLY); @@ -2425,9 +2357,8 @@ void Boss07_DrawDeathLights(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2) 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_Translate(this->bodyPartsPos[2].x, - this->bodyPartsPos[2].y - 30.0f + 50.0f + temp_f20 + 25.0f, - this->bodyPartsPos[2].z, MTXMODE_NEW); + Matrix_Translate(this->bodyPartsPos[2].x, this->bodyPartsPos[2].y - 30.0f + 50.0f + temp_f20 + 25.0f, + this->bodyPartsPos[2].z, MTXMODE_NEW); Matrix_Translate(arg2->x, arg2->y + temp_f20, arg2->z, MTXMODE_NEW); Matrix_RotateYF(Boss07_RandZeroOne() * M_PI * 2.0f, MTXMODE_APPLY); Matrix_RotateXFApply(-0.024999999f * temp_f20); @@ -2435,7 +2366,7 @@ void Boss07_DrawDeathLights(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2) 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); + gSPDisplayList(POLY_XLU_DISP++, gMajorasWrathDeathLightModelDL); } } func_8012C2DC(globalCtx->state.gfxCtx); @@ -2443,8 +2374,7 @@ void Boss07_DrawDeathLights(Boss07* this, GlobalContext* globalCtx, Vec3f* arg2) 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_Translate(this->bodyPartsPos[2].x, this->bodyPartsPos[2].y, this->bodyPartsPos[2].z, - MTXMODE_NEW); + Matrix_Translate(this->bodyPartsPos[2].x, this->bodyPartsPos[2].y, this->bodyPartsPos[2].z, MTXMODE_NEW); Matrix_ReplaceRotation(&globalCtx->billboardMtxF); Matrix_RotateZS(globalCtx->gameplayFrames * 0x80, MTXMODE_APPLY); temp_f12_2 = (sREG(17) + 800) * 0.01f * this->unk_AB4C; @@ -2482,8 +2412,8 @@ void Boss07_Static_DrawLight(Boss07* this, GlobalContext* globalCtx) { } Matrix_Translate(player->actor.world.pos.x, - player->actor.world.pos.y + Player_GetHeight(player) - 20.0f + sp54 + sREG(60), - player->actor.world.pos.z + sREG(61) - 15.0f + sp50, MTXMODE_NEW); + player->actor.world.pos.y + Player_GetHeight(player) - 20.0f + sp54 + sREG(60), + player->actor.world.pos.z + sREG(61) - 15.0f + sp50, MTXMODE_NEW); Matrix_ReplaceRotation(&globalCtx->billboardMtxF); Matrix_Scale(this->unk_AB44, this->unk_AB44, this->unk_AB44, MTXMODE_APPLY); @@ -2509,20 +2439,19 @@ void Boss07_Wrath_Draw(Actor* thisx, GlobalContext* globalCtx2) { } Matrix_RotateYF(this->unk_184, MTXMODE_APPLY); Matrix_RotateXFApply(this->unk_188); - SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, (s32)this->skelAnime.dListCount, - Boss07_Wrath_OverrideLimbDraw, Boss07_Wrath_PostLimbDraw, Boss07_Wrath_TransformLimbDraw, - &this->actor); + SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, + (s32)this->skelAnime.dListCount, 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) { Boss07_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, - this->whipScale, 0); + this->rightWhip.pull, this->rightWhip.gravity, this->rightWhip.stiffness, + this->rightWhip.drag, this->rightWhip.tension, &this->rightWhip.baseRot, this->unk_F7E, + this->whipScale, 0); Boss07_UpdateWhips(this, globalCtx, &this->leftWhip.basePos, this->leftWhip.pos, this->leftWhip.rot, - this->leftWhip.pull, this->leftWhip.gravity, this->leftWhip.stiffness, - this->leftWhip.drag, this->leftWhip.tension, &this->leftWhip.baseRot, 0, - this->whipScale, 1); + this->leftWhip.pull, this->leftWhip.gravity, this->leftWhip.stiffness, this->leftWhip.drag, + this->leftWhip.tension, &this->leftWhip.baseRot, 0, this->whipScale, 1); } Boss07_DrawWhips(this, globalCtx, this->rightWhip.pos, this->rightWhip.rot, this->whipScale, 0); Boss07_DrawWhips(this, globalCtx, this->leftWhip.pos, this->leftWhip.rot, this->whipScale, 1); @@ -2535,8 +2464,8 @@ void Boss07_Wrath_Draw(Actor* thisx, GlobalContext* globalCtx2) { sp58.y = this->bodyPartsPos[2].y - 30.0f + 50.0f; sp58.z = this->bodyPartsPos[2].z; Boss07_DrawDeathLights(this, globalCtx, &sp58); - Actor_DrawDamageEffects(globalCtx, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, - this->unk_1804); + Actor_DrawDamageEffects(globalCtx, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, + this->unk_1800, this->unk_1804); this->unk_149 = false; CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -2646,14 +2575,13 @@ 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_Translate(this->actor.world.pos.x, this->actor.floorHeight, this->actor.world.pos.z - 20.0f, - MTXMODE_NEW); + Matrix_Translate(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); + gSPDisplayList(POLY_OPA_DISP++, gMajorasWrathShadowMaterialDL); 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); - gSPDisplayList(POLY_OPA_DISP++, D_0602EF88); + gSPDisplayList(POLY_OPA_DISP++, gMajorasWrathShadowModelDL); CLOSE_DISPS(pad3); } @@ -2670,13 +2598,11 @@ void func_809FCBC8(Boss07* this) { void Boss07_Incarnation_SetupIntro(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Incarnation_Intro; - Animation_MorphToLoop(&this->skelAnime, &D_06002D84, 0.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationJerkingAnim, 0.0f); this->actor.flags &= ~1; this->unk_17D8 = 0x6E00; } -#ifdef NON_MATCHING -// float literals for 1.0f void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { s32 i; f32 sp58; @@ -2703,7 +2629,7 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { case 2: if (this->unk_ABC8 >= 20) { if (this->unk_ABC8 == 20) { - this->unk_17C8[3] = 1.0; + this->unk_17C8[3] = 1.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_TRANSFORM); } Math_ApproachF(&this->unk_17B8[3], 1.0f + (this->unk_17C8[3] * sp58), 1.0f, 0.5f); @@ -2744,10 +2670,9 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { if (this->unk_ABC8 == 80) { this->csState = 4; this->unk_ABC8 = 0; - this->unk_17B8[3] = 1.0f; - this->unk_17B8[2] = 1.0f; - this->unk_17B8[1] = 1.0f; - this->unk_17B8[0] = 1.0f; + for (i = 0; i < 4; i++) { + this->unk_17B8[i] = 1.0f; + } } break; case 4: @@ -2760,7 +2685,7 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { this->unk_17C8[3] = 1.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); } - Math_ApproachS(&this->unk_17D8, this->unk_17C8[3] * sp58 * 0x6000, 1, 0x4000); + Math_ApproachS(&this->unk_17D8, (this->unk_17C8[3] * sp58) * 0x6000, 1, 0x4000); } if (this->unk_ABC8 == 30) { this->csState = 5; @@ -2772,8 +2697,8 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { break; case 5: if (this->unk_ABC8 == 20) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06002C40, 0.0f); - this->unk_1D4 = Animation_GetLastFrame(&D_06002C40); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationIntroDanceAnim, 0.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasIncarnationIntroDanceAnim); } if (this->unk_ABC8 >= 20) { sREG(28) = this->unk_ABC8; @@ -2789,8 +2714,9 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { } } if (this->unk_ABC8 == 45) { - TitleCard_InitBossName(&globalCtx->state, &globalCtx->actorCtx.titleCtxt, Lib_SegmentedToVirtual(&D_06030C40), - 0xA0, 0xB4, 0x80, 0x28); + TitleCard_InitBossName(&globalCtx->state, &globalCtx->actorCtx.titleCtxt, + Lib_SegmentedToVirtual(&gMajorasIncarnationTitleCardTex), 0xA0, 0xB4, 0x80, + 0x28); } if (this->unk_ABC8 == 20) { Audio_QueueSeqCmd(0x806A); @@ -2801,7 +2727,7 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->csCamNextEye.y, 20.0f, 0.05f, this->csCamSpeedMod * 60.0f); Math_ApproachF(&this->csCamNextEye.z, 220.0f, 0.05f, this->csCamSpeedMod * 180.0f); Math_ApproachF(&this->csCamNextAt.y, 110.0f, 0.05f, this->csCamSpeedMod * 80.0f); - Math_ApproachF(&this->csCamSpeedMod, 0.1f, 1.f, 0.005f); + Math_ApproachF(&this->csCamSpeedMod, 0.1f, 1.0f, 0.005f); if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { Camera* sp54 = Play_GetCamera(globalCtx, 0); @@ -2828,12 +2754,13 @@ void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { Play_CameraSetAtEye(globalCtx, this->csCamIndex, &this->csCamAt, &this->csCamEye); } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Incarnation_Intro.s") -#endif void Boss07_Incarnation_SetupTaunt(Boss07* this, GlobalContext* globalCtx) { - static AnimationHeader* sTauntAnims[3] = { &D_0600A6AC, &D_0600AB04, &D_0600AD84 }; + static AnimationHeader* sTauntAnims[3] = { + &gMajorasIncarnationTauntDance1Anim, + &gMajorasIncarnationTauntDance2Anim, + &gMajorasIncarnationTauntJumpAnim, + }; this->actionFunc = Boss07_Incarnation_Taunt; this->actionState = Rand_ZeroFloat(2.999f); @@ -2863,8 +2790,8 @@ void Boss07_Incarnation_Taunt(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationFallOverStartAnim, -10.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasIncarnationFallOverStartAnim); } this->unk_158 = 10; this->timers[0] = arg2; @@ -2879,7 +2806,7 @@ void Boss07_Incarnation_Stunned(Boss07* this, GlobalContext* globalCtx) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_LAND); } if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { - Animation_MorphToLoop(&this->skelAnime, &D_06009EA8, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationFallOverLoopAnim, -5.0f); this->unk_1D4 = 1000.0f; } if (this->unk_1D4 == 1000.0f) { @@ -2894,14 +2821,14 @@ void Boss07_Incarnation_Stunned(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationDamageAnim, -2.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasIncarnationDamageAnim); } else if (arg3 == 14) { if (this->skelAnime.curFrame <= (this->unk_1D4 - 5.0f)) { this->unk_158 = 30; this->unk_15C = 30; } else { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06000D0C, -2.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationDamageAnim, -2.0f); } } @@ -2930,7 +2857,7 @@ void Boss07_Incarnation_Damaged(Boss07* this, GlobalContext* globalCtx) { } void Boss07_Incarnation_SetupRun(Boss07* this, GlobalContext* globalCtx) { - Animation_MorphToLoop(&this->skelAnime, &D_0600A400, -2.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationRunAnim, -2.0f); this->actionFunc = Boss07_Incarnation_Run; this->timers[0] = Rand_ZeroFloat(100.0f) + 150.0f; func_809FCBC8(this); @@ -2993,7 +2920,7 @@ void Boss07_Incarnation_Run(Boss07* this, GlobalContext* globalCtx) { void Boss07_Incarnation_SetupAttack(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Incarnation_Attack; - Animation_MorphToLoop(&this->skelAnime, &D_06000428, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationEnergyBallAttackAnim, -5.0f); this->timers[0] = Rand_ZeroFloat(50.0f) + 30.0f; this->unk_188C = 0.0f; } @@ -3018,7 +2945,7 @@ void Boss07_Incarnation_Attack(Boss07* this, GlobalContext* globalCtx) { void Boss07_Incarnation_SetupHopak(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Incarnation_Hopak; - Animation_MorphToLoop(&this->skelAnime, &D_06003A64, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationSquattingDanceAnim, -5.0f); this->timers[0] = Rand_ZeroFloat(100.0f) + 100.0f; this->timers[1] = 0; this->unk_ABC8 = 0; @@ -3061,7 +2988,7 @@ void Boss07_Incarnation_Hopak(Boss07* this, GlobalContext* globalCtx) { void Boss07_Incarnation_SetupMoonwalk(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Incarnation_Moonwalk; - Animation_MorphToLoop(&this->skelAnime, &D_0600A194, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationMoonwalkAnim, -10.0f); this->timers[0] = Rand_ZeroFloat(50.0f) + 70.0f; this->timers[1] = 0; } @@ -3092,7 +3019,7 @@ void Boss07_Incarnation_Moonwalk(Boss07* this, GlobalContext* globalCtx) { void Boss07_Incarnation_SetupPirouette(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Incarnation_Pirouette; - Animation_MorphToPlayOnce(&this->skelAnime, &D_06000194, -10.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationPirouetteAnim, -10.0f); this->timers[0] = Rand_ZeroFloat(70.0f) + 70.0f; this->timers[1] = 0; } @@ -3127,8 +3054,8 @@ void Boss07_Incarnation_Pirouette(Boss07* this, GlobalContext* globalCtx) { 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); + Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationDamageAnim, -2.0f); + this->unk_1D4 = Animation_GetLastFrame(&gMajorasIncarnationDamageAnim); this->csState = 0; this->unk_ABC8 = 0; this->actor.flags &= ~1; @@ -3169,7 +3096,7 @@ void Boss07_Incarnation_Death(Boss07* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { this->unk_ABC8 = 0; this->csState = 1; - Animation_MorphToLoop(&this->skelAnime, &D_06003854, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationFinalHitAnim, -5.0f); } break; case 1: @@ -3186,7 +3113,7 @@ void Boss07_Incarnation_Death(Boss07* this, GlobalContext* globalCtx) { this->csCamNextAt.z = -20.0f; this->unk_17E8 = 1.0f; this->unk_17EC = 0.4f; - Animation_MorphToLoop(&this->skelAnime, &D_060031E4, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationPumpingUpAnim, -5.0f); this->actor.shape.rot.y = 0; this->actor.world.rot.y = this->actor.shape.rot.y; Math_ApproachF(&this->actor.world.pos.x, 0.0f, 1.0f, 200.0f); @@ -3393,7 +3320,7 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { 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++) { + for (i = 0; i < MAJORAS_INCARNATION_LIMB_MAX; i++) { afterimage->skelAnime.jointTable[i] = this->skelAnime.jointTable[i]; } } @@ -3419,7 +3346,7 @@ s32 Boss07_Incarnation_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { Boss07* this = THIS; - if (limbIndex == 24) { + if (limbIndex == MAJORAS_INCARNATION_LIMB_EYESTALK) { rot->y += this->unk_17D8; } return false; @@ -3448,7 +3375,7 @@ void Boss07_Incarnation_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gf Vec3f sp28; s8 i; - if (limbIndex == 24) { + if (limbIndex == MAJORAS_INCARNATION_LIMB_EYESTALK) { Matrix_MultZero(&this->actor.focus.pos); } i = sLimbBodyPartIndex[limbIndex]; @@ -3464,16 +3391,16 @@ void Boss07_Incarnation_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gf } Boss07_UpdateSpheres(i, &this->sph1, &sp28); } - if (limbIndex == 8) { + if (limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_FOOT) { Matrix_MultZero(&this->unk_1788[0]); } - if (limbIndex == 23) { + if (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_FOOT) { Matrix_MultZero(&this->unk_1788[1]); } - if (limbIndex == 13) { + if (limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_HAND) { Matrix_MultZero(&this->unk_17AC); } - if (limbIndex == 18) { + if (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_HAND) { Matrix_MultZero(&this->unk_17A0); } i = sLimbPumpIndex[limbIndex]; @@ -3485,15 +3412,18 @@ void Boss07_Incarnation_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gf void Boss07_Incarnation_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { Boss07* this = THIS; - if (limbIndex == 3) { + if (limbIndex == MAJORAS_INCARNATION_LIMB_MASK) { Matrix_Scale(this->unk_17F4, this->unk_17F0, 1.0f, MTXMODE_APPLY); } - if ((limbIndex == 10) || (limbIndex == 12) || (limbIndex == 13) || (limbIndex == 15) || (limbIndex == 17) || - (limbIndex == 18)) { + if ((limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_UPPER_ARM) || + (limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_FOREARM) || (limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_HAND) || + (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_UPPER_ARM) || + (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_FOREARM) || (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_HAND)) { Matrix_Scale(1.0f, this->unk_17E0, this->unk_17E0, MTXMODE_APPLY); } - if ((limbIndex == 5) || (limbIndex == 7) || (limbIndex == 8) || (limbIndex == 20) || (limbIndex == 22) || - (limbIndex == 23)) { + if ((limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_THIGH) || (limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_SHIN) || + (limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_FOOT) || (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_THIGH) || + (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_SHIN) || (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_FOOT)) { Matrix_Scale(1.0f, this->unk_17E4, this->unk_17E4, MTXMODE_APPLY); } } @@ -3508,18 +3438,18 @@ void Boss07_Incarnation_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); } - SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, - Boss07_Incarnation_OverrideLimbDraw, Boss07_Incarnation_PostLimbDraw, - Boss07_Incarnation_TransformLimbDraw, &this->actor); + SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, + this->skelAnime.dListCount, Boss07_Incarnation_OverrideLimbDraw, + Boss07_Incarnation_PostLimbDraw, Boss07_Incarnation_TransformLimbDraw, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); - Actor_DrawDamageEffects(globalCtx, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, - this->unk_1804); + Actor_DrawDamageEffects(globalCtx, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, + this->unk_1800, this->unk_1804); CLOSE_DISPS(globalCtx->state.gfxCtx); } void Boss07_Mask_SetupIdle(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Mask_Idle; - Animation_MorphToLoop(&this->skelAnime, &D_06019E48, -20.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasMaskFloatingAnim, -20.0f); this->timers[2] = Rand_ZeroFloat(150.0f) + 60.0f; this->unk_1870 = 1.0f; } @@ -3669,7 +3599,7 @@ void Boss07_Mask_Spin(Boss07* this, GlobalContext* globalCtx) { void Boss07_Mask_SetupStunned(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Mask_Stunned; - Animation_MorphToLoop(&this->skelAnime, &D_0600AE40, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasMaskJerkingAnim, -10.0f); this->timers[0] = 100; this->unk_170 = 0.0f; } @@ -3847,8 +3777,8 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { sp180 = sqrtf(SQ(temp_f20) + SQ(temp_f12) + SQ(temp_f22)); Math_ApproachF(&this->unk_1894, sp180 * 0.2f, 1.0f, 7.0f); - if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->unk_189C, &this->unk_18A8, &sp14C, &sp158, 1, 1, 1, 1, - &sp144) && + if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->unk_189C, &this->unk_18A8, &sp14C, &sp158, 1, 1, 1, + 1, &sp144) && (this->actionState != 5)) { Vec3f sp138; Vec3f sp12C; @@ -4006,8 +3936,8 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { } } } - if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->unk_18A8, &this->unk_18B4, &sp14C, &sp158, 1, 1, 1, - 1, &sp144) && + if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->unk_18A8, &this->unk_18B4, &sp14C, + &sp158, 1, 1, 1, 1, &sp144) && (this->actionState != 5)) { Vec3f spBC; Vec3f spB0; @@ -4148,8 +4078,8 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_ABC8 == 20) { sBossRemains[REMAINS_ODOLWA]->actionState = 1; - sBossRemains[REMAINS_GOHT]->actionState = 1; sBossRemains[REMAINS_GYORG]->actionState = 1; + sBossRemains[REMAINS_GOHT]->actionState = 1; sBossRemains[REMAINS_TWINMOLD]->actionState = 1; } if (this->unk_ABC8 == 0) { @@ -4165,8 +4095,8 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { if (this->unk_ABC8 >= 160) { if (this->unk_ABC8 == 160) { sBossRemains[REMAINS_ODOLWA]->actionState = 2; - sBossRemains[REMAINS_GOHT]->actionState = 2; sBossRemains[REMAINS_GYORG]->actionState = 2; + sBossRemains[REMAINS_GOHT]->actionState = 2; sBossRemains[REMAINS_TWINMOLD]->actionState = 2; } if (this->unk_ABC8 == 161) { @@ -4192,8 +4122,8 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { this->csCamAt.y = this->actor.world.pos.y; this->csCamAt.z = this->actor.world.pos.z; 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_GOHT], globalCtx); Boss07_Remains_SetupFly(sBossRemains[REMAINS_TWINMOLD], globalCtx); this->csCamSpeedMod = 0.0f; sMajoraStatic->unk_AB44 = 0.0f; @@ -4260,7 +4190,7 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.world.pos.y, 350.0f, 0.03f, 2.0f); if (this->unk_ABC8 == 55) { TitleCard_InitBossName(&globalCtx->state, &globalCtx->actorCtx.titleCtxt, - Lib_SegmentedToVirtual(&D_0602F840), 0xA0, 0xB4, 0x80, 0x28); + Lib_SegmentedToVirtual(&gMajorasMaskTitleCardTex), 0xA0, 0xB4, 0x80, 0x28); } if (this->unk_ABC8 == 30) { Audio_QueueSeqCmd(0x806B); @@ -4320,7 +4250,7 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { void Boss07_Mask_SetupDeath(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Mask_Death; - Animation_MorphToLoop(&this->skelAnime, &D_0600AE40, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &gMajorasMaskJerkingAnim, -10.0f); this->actor.world.rot.y = this->actor.shape.rot.y = Math_Acot2F(-this->actor.world.pos.z, -this->actor.world.pos.x) * (0x8000 / M_PI); this->csState = 0; @@ -4509,8 +4439,7 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actor.colChkInfo.health = 0; } Boss07_Mask_CollisionCheck(this, globalCtx); - Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, - MTXMODE_NEW); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY); Matrix_RotateXS(this->actor.shape.rot.x, MTXMODE_APPLY); Matrix_RotateZS(this->actor.shape.rot.z, MTXMODE_APPLY); @@ -4682,7 +4611,7 @@ void Boss07_Mask_DrawTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* ar } 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); + gSPDisplayList(POLY_OPA_DISP++, gMajorasMaskTentacleModelDL); } CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -4697,8 +4626,7 @@ void Boss07_Mask_DrawBeam(Boss07* this, GlobalContext* globalCtx) { gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 60, 200); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128); - Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, - MTXMODE_NEW); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY); Matrix_RotateXS(this->actor.shape.rot.x, MTXMODE_APPLY); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); @@ -4710,14 +4638,14 @@ void Boss07_Mask_DrawBeam(Boss07* this, GlobalContext* globalCtx) { Matrix_RotateYS(-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++, gMajorasMaskBeamDL); Matrix_Pop(); Matrix_Translate(-250.0f, 0.0f, 200.0f, MTXMODE_APPLY); Matrix_RotateYS(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++, gMajorasMaskBeamDL); gSPDisplayList(POLY_XLU_DISP++, gLightOrb1DL); Matrix_Pop(); @@ -4740,7 +4668,7 @@ void Boss07_Mask_DrawBeam(Boss07* this, GlobalContext* globalCtx) { Matrix_MultZero(&this->unk_189C); 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); + gSPDisplayList(POLY_XLU_DISP++, gMajorasMaskBeamDL); Matrix_MultVecZ(20100.0f, &this->unk_18A8); if (this->unk_18C0 > 0.0f) { Vec3f sp50; @@ -4753,7 +4681,7 @@ void Boss07_Mask_DrawBeam(Boss07* this, GlobalContext* globalCtx) { 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); + gSPDisplayList(POLY_XLU_DISP++, gMajorasMaskBeamDL); Matrix_MultVecZ(20100.0f, &this->unk_18B4); Matrix_Translate(sp50.x, sp50.y, sp50.z, MTXMODE_NEW); @@ -4772,13 +4700,13 @@ void Boss07_Mask_DrawBeam(Boss07* this, GlobalContext* globalCtx) { void Boss07_Mask_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { Boss07* this = THIS; - if (limbIndex == 2) { + if (limbIndex == MAJORAS_MASK_LIMB_FACE) { Matrix_MultVecX(500.0f, &this->unk_1878); } } void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { - static void* D_80A082E0[2] = { D_06042330, D_06045B30 }; + static void* D_80A082E0[2] = { gMajorasMaskWithNormalEyesTex, gMajorasMaskWithDullEyesTex }; GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; s32 i; @@ -4806,7 +4734,7 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, Boss07_Mask_PostLimbDraw, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); - gSPDisplayList(POLY_OPA_DISP++, D_0600AFB0); + gSPDisplayList(POLY_OPA_DISP++, gMajorasMaskTentacleMaterialDL); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); phi_s6 = ((this->actionFunc == Boss07_Mask_Idle) && @@ -5250,16 +5178,16 @@ void Boss07_Remains_Draw(Actor* thisx, GlobalContext* globalCtx2) { 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); - break; - case MAJORA_REMAINS + REMAINS_GOHT: - gSPDisplayList(POLY_OPA_DISP++, D_06016090); + gSPDisplayList(POLY_OPA_DISP++, gBossMaskOdolwaDL); break; case MAJORA_REMAINS + REMAINS_GYORG: - gSPDisplayList(POLY_OPA_DISP++, D_06017DE0); + gSPDisplayList(POLY_OPA_DISP++, gBossMaskGyorgDL); + break; + case MAJORA_REMAINS + REMAINS_GOHT: + gSPDisplayList(POLY_OPA_DISP++, gBossMaskGohtDL); break; case MAJORA_REMAINS + REMAINS_TWINMOLD: - gSPDisplayList(POLY_OPA_DISP++, D_06019328); + gSPDisplayList(POLY_OPA_DISP++, gBossMaskTwinmoldDL); break; } POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); @@ -5268,8 +5196,7 @@ void Boss07_Remains_Draw(Actor* thisx, GlobalContext* globalCtx2) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 200, 200); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 100, 128); - Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, - MTXMODE_NEW); + Matrix_Translate(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_ReplaceRotation(&globalCtx->billboardMtxF); Matrix_RotateZS(this->unk_18C8, MTXMODE_APPLY); @@ -5558,7 +5485,7 @@ void Boss07_Top_Draw(Actor* thisx, GlobalContext* globalCtx2) { Matrix_RotateYF(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); + gSPDisplayList(POLY_OPA_DISP++, gMajorasWrathTopDL); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -5618,35 +5545,35 @@ void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->unk_ABC8 == 40) { this->csState = 3; this->unk_ABC8 = 0; - this->csCamEye.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x * 0.7f; - this->csCamEye.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y * 0.7f; - this->csCamEye.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z * 0.7f; - } else { - break; - } - case 3: - if (this->unk_ABC8 == 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; - this->csCamAt.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z; - if (this->unk_ABC8 == 40) { - this->csState = 4; - this->unk_ABC8 = 0; this->csCamEye.x = sBossRemains[REMAINS_GYORG]->actor.world.pos.x * 0.7f; this->csCamEye.y = sBossRemains[REMAINS_GYORG]->actor.world.pos.y * 0.7f; this->csCamEye.z = sBossRemains[REMAINS_GYORG]->actor.world.pos.z * 0.7f; } else { break; } - case 4: + case 3: if (this->unk_ABC8 == 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; this->csCamAt.z = sBossRemains[REMAINS_GYORG]->actor.world.pos.z; + if (this->unk_ABC8 == 40) { + this->csState = 4; + this->unk_ABC8 = 0; + this->csCamEye.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x * 0.7f; + this->csCamEye.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y * 0.7f; + this->csCamEye.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z * 0.7f; + } else { + break; + } + case 4: + if (this->unk_ABC8 == 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; + this->csCamAt.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z; if (this->unk_ABC8 == 40) { this->csState = 5; this->unk_ABC8 = 0; @@ -5765,7 +5692,7 @@ void Boss07_Static_DrawEffects(GlobalContext* globalCtx) { Matrix_ReplaceRotation(&globalCtx->billboardMtxF); 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); + gSPDisplayList(POLY_XLU_DISP++, gMajorasMaskFireDL); } } CLOSE_DISPS(gfxCtx); 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 f829455af..8b95241f8 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -2,6 +2,7 @@ #define Z_BOSS_07_H #include "global.h" +#include "objects/object_boss07/object_boss07.h" struct Boss07; @@ -10,10 +11,7 @@ struct Boss07; #define MAJORA_TENT_MAX 100 #define MAJORA_WHIP_MAX_LENGTH 50 -#define MAJORA_MASK_LIMB_COUNT 19 -#define MAJORA_INCARNATION_LIMB_COUNT 25 -#define MAJORA_WRATH_LIMB_COUNT 28 -#define MAJORA_LIMB_COUNT MAX(MAJORA_MASK_LIMB_COUNT, MAX(MAJORA_INCARNATION_LIMB_COUNT, MAJORA_WRATH_LIMB_COUNT)) +#define MAJORA_LIMB_COUNT MAX(MAJORAS_MASK_LIMB_MAX, MAX(MAJORAS_INCARNATION_LIMB_MAX, MAJORAS_WRATH_LIMB_MAX)) typedef void (*Boss07ActionFunc)(struct Boss07*, GlobalContext*); From 3345717ccf571d06e363eb0cba5fa98ce4b2807c Mon Sep 17 00:00:00 2001 From: petrie911 Date: Sat, 16 Jul 2022 09:07:54 -0500 Subject: [PATCH 16/28] more stuff --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 c50e45e4d..f3af6f227 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -423,13 +423,13 @@ static Vec3s sRemainsEnd[REMAINS_COUNT] = { { -712, 0x5500, 416 }, }; // y value here is y rotation, not position -#ifdef NON_MATCHING +#ifndef NON_MATCHING // reordering when loading Boss07_Projectile_Update void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { static s16 sRemainsParams[REMAINS_COUNT] = { MAJORA_REMAINS + REMAINS_ODOLWA, - MAJORA_REMAINS + REMAINS_GOHT, MAJORA_REMAINS + REMAINS_GYORG, + MAJORA_REMAINS + REMAINS_GOHT, MAJORA_REMAINS + REMAINS_TWINMOLD, }; static EffectTireMarkInit sTopTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; @@ -485,7 +485,6 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { } else if (this->actor.params == MAJORA_TOP) { this->actor.update = Boss07_Top_Update; this->actor.draw = Boss07_Top_Draw; - Boss07_Top_SetupThrown(this, globalCtx); this->actor.colChkInfo.damageTable = &sTopDmgTable; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, KREG(55) + 9.0f); From f91845a6114a8a8740e0956f76e1a1b443db5c2c Mon Sep 17 00:00:00 2001 From: petrie911 Date: Thu, 28 Jul 2022 10:03:44 -0500 Subject: [PATCH 17/28] play part 2 --- include/functions.h | 2 +- src/code/z_actor.c | 2 +- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 12 ++++++------ src/overlays/actors/ovl_En_Dragon/z_en_dragon.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/functions.h b/include/functions.h index 6cca776af..36070db21 100644 --- a/include/functions.h +++ b/include/functions.h @@ -617,7 +617,7 @@ void Flags_SetCollectible(PlayState* play, s32 flag); void TitleCard_InitBossName(GameState* gameState, TitleCardContext* titleCtx, TexturePtr texture, s16 x, s16 y, u8 width, u8 height); s32 func_800B648C(PlayState* play, s32 arg1, s32 arg2, f32 arg3, Vec3f* arg4); -f32 func_800B64FC(PlayState* play, f32 arg1, Vec3f* arg2, u32* arg3); +f32 func_800B64FC(PlayState* play, f32 arg1, Vec3f* arg2, s32* arg3); void* func_800B6584(PlayState* play, s16 id, void* arg2, size_t size); void* func_800B6608(PlayState* play, s16 id); void* func_800B6680(PlayState* play, s16 id); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index d792b276a..f3f4123d3 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -930,7 +930,7 @@ s32 func_800B648C(PlayState* play, s32 arg1, s32 arg2, f32 arg3, Vec3f* arg4) { return true; } -f32 func_800B64FC(PlayState* play, f32 arg1, Vec3f* arg2, u32* arg3) { +f32 func_800B64FC(PlayState* play, f32 arg1, Vec3f* arg2, s32* arg3) { f32 temp_f8; if ((play->actorCtx.unk1F5 == 0) || (arg1 == 0.0f)) { 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 a10d61dce..65bfb0add 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -1394,7 +1394,7 @@ void Boss07_Wrath_Grab(Boss07* this, PlayState* play) { } void Boss07_Wrath_GrabPlayer(Boss07* this, PlayState* play) { - u32 sp2C; + s32 sp2C; Player* player = GET_PLAYER(play); SkelAnime_Update(&this->skelAnime); @@ -1420,7 +1420,7 @@ void Boss07_Wrath_ThrowPlayer(Boss07* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 phi_f0; f32 phi_f2; - u32 sp30; + s32 sp30; SkelAnime_Update(&this->skelAnime); this->unk_15A = 20; @@ -1655,7 +1655,7 @@ void Boss07_Wrath_Damaged(Boss07* this, PlayState* play) { void Boss07_Wrath_WhipCollisionCheck(Vec3f* arg0, f32 arg1, Boss07* this, PlayState* play) { s32 i; - u32 sp98 = -1; + s32 sp98 = -1; Player* player = GET_PLAYER(play); f32 dx; f32 dy; @@ -2865,7 +2865,7 @@ void Boss07_Incarnation_SetupRun(Boss07* this, PlayState* play) { void Boss07_Incarnation_Run(Boss07* this, PlayState* play) { f32 sp34; f32 sp30; - u32 sp2C; + s32 sp2C; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_WALK_OLD - SFX_FLAG); this->unk_AB40++; @@ -5384,7 +5384,7 @@ void Boss07_Top_Collide(Boss07* this, PlayState* play) { } void Boss07_Top_CollisionCheck(Boss07* this, PlayState* play) { - u32 sp3C; + s32 sp3C; s32 sp38 = 0; Player* player = GET_PLAYER(play); s32 pad[3]; @@ -5497,7 +5497,7 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { if (sHeartbeatTimer != 0) { sHeartbeatTimer--; - dummy_label:; + dummy_label:; //!@fake play_sound(NA_SE_EN_LAST2_HEARTBEAT_OLD - SFX_FLAG); } if (this->unk_1808 != 0) { diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c index ece3c0903..37613dab4 100644 --- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c +++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c @@ -724,7 +724,7 @@ void EnDragon_Dead(EnDragon* this, PlayState* play) { void EnDragon_UpdateDamage(EnDragon* this, PlayState* play) { Player* player = GET_PLAYER(play); - u32 sp30; + s32 sp30; if (this->action == DEEP_PYTHON_ACTION_EXTEND) { if ((this->collider.elements[2].info.bumperFlags & BUMP_HIT) || From 0c00544467ad2c8552a02be7ed8d059262699da8 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Thu, 28 Jul 2022 10:38:18 -0500 Subject: [PATCH 18/28] lol merge --- docs/tutorial/intro_to_git.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/tutorial/intro_to_git.md b/docs/tutorial/intro_to_git.md index 9391b1b2e..59262a2d5 100644 --- a/docs/tutorial/intro_to_git.md +++ b/docs/tutorial/intro_to_git.md @@ -248,7 +248,11 @@ As such, if you only want to learn one of these, learn merging. If the two branches have both touched the same or nearby lines, git will not know which you want to keep. It will therefore pause the merge/rebase and tell you to decide. You will find a section of the file that looks like this: ```bash +<<<<<<< A +Some code +======= Some other code +>>>>>>> B ``` from which you should pick one (or combine parts of both as appropriate), then delete the rest. (You definitely do not want the git artefacts left in!) From ba1b4c81df834378000d4793cceae72f7a64c2db Mon Sep 17 00:00:00 2001 From: petrie911 Date: Thu, 4 Aug 2022 13:48:14 -0500 Subject: [PATCH 19/28] update --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 65bfb0add..c444cfb2c 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -1703,7 +1703,7 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* arg0, f32 arg1, Boss07* this, PlaySt player->actor.parent = &this->actor; Audio_PlaySfxGeneral(NA_SE_VO_LI_DAMAGE_S, &player->actor.projectedPos, 4, &D_801DB4B0, - &D_801DB4B0, &D_801DB4B8); + &D_801DB4B0, &gSfxDefaultReverb); this->unk_F7C = 0; this->unk_F7E = ((this->actor.xzDistToPlayer - 300.0f) / 22.0f) + 10.0f; dx1 = player->actor.world.pos.x - this->rightWhip.basePos.x; From 7efb660ab4cb09c23f0bf71cee08d12f3c60a080 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Fri, 12 Aug 2022 09:43:51 -0500 Subject: [PATCH 20/28] unk types --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 8 ++++---- src/overlays/actors/ovl_Boss_07/z_boss_07.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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 4e32f027f..ae489a939 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -31,13 +31,13 @@ typedef struct { /* 0x04 */ Vec3f pos; /* 0x10 */ Vec3f vel; /* 0x1C */ Vec3f accel; - /* 0x28 */ char unk28[4]; + /* 0x28 */ UNK_TYPE1 unk28[4]; /* 0x2C */ s16 alpha; - /* 0x2E */ char unk2E[2]; + /* 0x2E */ UNK_TYPE1 unk2E[2]; /* 0x30 */ s16 isFading; - /* 0x32 */ char unk32[2]; + /* 0x32 */ UNK_TYPE1 unk32[2]; /* 0x34 */ f32 unk_34; - /* 0x38 */ char unk38[0x10]; + /* 0x38 */ UNK_TYPE1 unk38[0x10]; } Boss07Effect; #if 1 // function prototypes 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 cee932d52..82763cc4d 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -160,7 +160,7 @@ typedef struct Boss07 { /* 0xAC08 */ f32 csCamRotVel; /* 0xAC0C */ f32 csCamSpeedMod; /* 0xAC10 */ Vec3f csCamEyeMod; - /* 0xAC1C */ char unkAC1C[4]; + /* 0xAC1C */ UNK_TYPE1 unkAC1C[4]; } Boss07; // size = 0xAC20 extern const ActorInit Boss_07_InitVars; From 3d0d08260cd313791a332fc1c6ae81f52c13ca2b Mon Sep 17 00:00:00 2001 From: petrie911 Date: Fri, 12 Aug 2022 16:01:10 -0500 Subject: [PATCH 21/28] SWEET GOOGLY MOOGLY IT MATCHES --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 372 ++++++++++---------- 1 file changed, 192 insertions(+), 180 deletions(-) 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 ae489a939..108b44e4f 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -36,9 +36,14 @@ typedef struct { /* 0x2E */ UNK_TYPE1 unk2E[2]; /* 0x30 */ s16 isFading; /* 0x32 */ UNK_TYPE1 unk32[2]; - /* 0x34 */ f32 unk_34; + /* 0x34 */ f32 scale; /* 0x38 */ UNK_TYPE1 unk38[0x10]; -} Boss07Effect; +} Boss07Effect; // size = 0x48 + +typedef enum { + /* 0 */ MAJORA_EFFECT_NONE, + /* 1 */ MAJORA_EFFECT_1 +} Boss07EffectType; #if 1 // function prototypes void func_809F4D10(Vec3f* arg0, f32 arg1); @@ -222,17 +227,17 @@ f32 Boss07_RandZeroOne(void) { return fabsf(randFloat); } -void Boss07_SpawnEffect(PlayState* play, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4) { +void Boss07_SpawnEffect(PlayState* play, Vec3f* pos, Vec3f* vel, Vec3f* accel, f32 arg4) { s32 i; Boss07Effect* effect = (Boss07Effect*)play->specialEffects; for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { - if (effect->type == 0) { - effect->type = 1; - effect->pos = *arg1; - effect->vel = *arg2; - effect->accel = *arg3; - effect->unk_34 = arg4 / 1000.0f; + if (effect->type == MAJORA_EFFECT_NONE) { + effect->type = MAJORA_EFFECT_1; + effect->pos = *pos; + effect->vel = *vel; + effect->accel = *accel; + effect->scale = arg4 / 1000.0f; effect->isFading = 0; effect->alpha = 0; effect->scroll = Rand_ZeroFloat(1000.0f); @@ -423,17 +428,13 @@ static Vec3s sRemainsEnd[REMAINS_COUNT] = { { -712, 0x5500, 416 }, }; // y value here is y rotation, not position -#ifdef NON_MATCHING -// reordering when loading Boss07_Projectile_Update void Boss07_Init(Actor* thisx, PlayState* play2) { static s16 sRemainsParams[REMAINS_COUNT] = { MAJORA_REMAINS + REMAINS_ODOLWA, MAJORA_REMAINS + REMAINS_GYORG, MAJORA_REMAINS + REMAINS_GOHT, MAJORA_REMAINS + REMAINS_TWINMOLD, - }; - static EffectTireMarkInit sTopTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; - static EffectTireMarkInit sMaskTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; + }; PlayState* play = play2; Boss07* this = THIS; s32 i; @@ -446,164 +447,175 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { sKillProjectiles = false; play->envCtx.lightSettingOverride = 0; play->envCtx.unk_E0 = 2; - } else { - if (this->actor.params == MAJORA_BOSS) { - this->actor.params = MAJORA_MASK; - Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, MAJORA_STATIC); - play->specialEffects = (void*)sEffects; + return; + } - for (i = 0; i < ARRAY_COUNT(sEffects); i++) { - sEffects[i].type = 0; - } - for (i = 0; i < ARRAY_COUNT(sBossRemains); i++) { - sBossRemains[i] = NULL; - } + if (this->actor.params == MAJORA_BOSS) { + this->actor.params = MAJORA_MASK; + Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, MAJORA_STATIC); + play->specialEffects = (void*)sEffects; + + for (i = 0; i < ARRAY_COUNT(sEffects); i++) { + sEffects[i].type = 0; } - - this->actor.targetMode = 5; - this->actor.colChkInfo.mass = MASS_HEAVY; - this->actor.gravity = -2.5f; - - if (this->actor.params >= MAJORA_REMAINS) { - this->actor.update = Boss07_Remains_Update; - this->actor.draw = Boss07_Remains_Draw; - if (1) {} - sBossRemains[this->actor.params - MAJORA_REMAINS] = this; - if (gSaveContext.eventInf[6] & 2) { - Actor_SetScale(&this->actor, 0.03f); - this->actor.world.pos.x = sRemainsEnd[this->actor.params - MAJORA_REMAINS].x; - 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; - Boss07_Remains_SetupFly(this, play); - } else { - Boss07_Remains_SetupIntro(this, play); - } - this->actor.flags &= ~1; - this->actor.colChkInfo.damageTable = &sRemainsDmgTable; - } else if (this->actor.params == MAJORA_TOP) { - this->actor.update = Boss07_Top_Update; - this->actor.draw = Boss07_Top_Draw; - Boss07_Top_SetupThrown(this, play); - this->actor.colChkInfo.damageTable = &sTopDmgTable; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, KREG(55) + 9.0f); - this->actor.shape.shadowAlpha = 180; - Collider_InitAndSetCylinder(play, &this->cyl2, &this->actor, &sTopCylInit); - Effect_Add(play, &this->effectIndex, 4, 0, 0, &sTopTireMarkInit); - this->actor.flags &= ~1; - } else if ((this->actor.params == MAJORA_REMAINS_SHOT) || (this->actor.params == MAJORA_INCARNATION_SHOT)) { - this->actor.update = Boss07_Projectile_Update; - this->actor.draw = Boss07_Projectile_Draw; - this->actor.flags &= ~1; - Collider_InitAndSetCylinder(play, &this->cyl2, &this->actor, &sShotCylInit); - func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); - this->unk_181C = Rand_ZeroFloat(3.99f); - } 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, ActorShadow_DrawCircle, 15.0f); - SkelAnime_Init(play, &this->skelAnime, &gMajorasMaskSkel, &gMajorasMaskFloatingAnim, this->jointTable, - this->morphTable, MAJORAS_MASK_LIMB_MAX); - if (this->actor.params == MAJORA_MASK) { - this->actor.update = Boss07_Mask_Update; - this->actor.draw = Boss07_Mask_Draw; - Effect_Add(play, &this->effectIndex, 4, 0, 0, &sMaskTireMarkInit); - sMajorasMask = this; - if (gSaveContext.eventInf[6] & 2) { - this->actor.world.pos.x = 0.0f; - this->actor.world.pos.y = sREG(17) + 277.0f; - this->actor.world.pos.z = -922.5f; - Boss07_Mask_SetupIdle(this, play); - this->unk_164.x = 0.0f; - this->unk_164.y = 200.0f; - this->unk_164.z = 0.0f; - this->unk_170 = 0.0f; - this->timers[0] = 50; - this->timers[2] = 200; - this->unk_1888 = 50; - this->actor.flags |= 1; - sMusicStartTimer = 20; - } else { - Boss07_Mask_SetupIntro(this, play); - } - Collider_InitAndSetQuad(play, &this->quad1, &this->actor, &sMaskQuadInit1); - Collider_InitAndSetQuad(play, &this->quad2, &this->actor, &sMaskQuadInit2); - this->actor.colChkInfo.health = 14; - for (i = 0; i < ARRAY_COUNT(sRemainsParams); i++) { - Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, 0.0f, 0.0f, 0.0f, 0, 0, 0, - sRemainsParams[i]); - } - } - } else if ((this->actor.params == MAJORA_INCARNATION) || (this->actor.params == MAJORA_AFTERIMAGE)) { - Actor_SetScale(&this->actor, 0.015000001f); - SkelAnime_InitFlex(play, &this->skelAnime, &gMajorasIncarnationSkel, - &gMajorasIncarnationTauntDance1Anim, this->jointTable, this->morphTable, - MAJORAS_INCARNATION_LIMB_MAX); - if (this->actor.params == MAJORA_AFTERIMAGE) { - this->timers[0] = this->actor.world.rot.z; - this->actor.world.rot.z = 0; - this->actor.update = Boss07_Afterimage_Update; - this->actor.draw = Boss07_Afterimage_Draw; - this->actor.flags &= ~1; - } else { - this->actor.colChkInfo.damageTable = &sIncarnationDmgTable; - this->actor.colChkInfo.health = 30; - this->actor.update = Boss07_Incarnation_Update; - this->actor.draw = Boss07_Incarnation_Draw; - Collider_InitAndSetJntSph(play, &this->sph1, &this->actor, &sIncarnationJntSphInit1, - this->sphElems1); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 80.0f); - this->csCamIndex = this->actor.shape.rot.z; - if (this->csCamIndex != 0) { - Boss07_Incarnation_SetupIntro(this, play); - } else { - Boss07_Incarnation_SetupTaunt(this, play); - this->unk_14A = 1; - for (i = 0; i < 4; i++) { - this->unk_17B8[i] = 1.0f; - } - play->envCtx.lightBlend = 0.0f; - } - this->unk_17E0 = 1.0f; - this->unk_17E4 = 1.0f; - this->unk_17F0 = 1.0f; - this->unk_17F4 = 1.0f; - } - } else { - sMajorasWrath = this; - this->actor.colChkInfo.health = 40; - this->actor.colChkInfo.damageTable = &sWrathDmgTable; - Actor_SetScale(&this->actor, 0.01f); - this->csCamIndex = this->actor.shape.rot.z; - if (this->csCamIndex != 0) { - Boss07_Wrath_SetupIntro(this, play); - } else { - Boss07_Wrath_SetupIdle(this, play, 50); - this->whipScale = 1.0f; - Audio_QueueSeqCmd(0x8069); - } - SkelAnime_InitFlex(play, &this->skelAnime, &gMajorasWrathSkel, &gMajorasWrathIdleAnim, - this->jointTable, this->morphTable, MAJORAS_WRATH_LIMB_MAX); - Collider_InitAndSetJntSph(play, &this->sph1, &this->actor, &sWrathJntSphInit1, this->sphElems1); - Collider_InitAndSetJntSph(play, &this->sph2, &this->actor, &sWrathJntSphInit2, this->sphElems2); - Collider_InitAndSetCylinder(play, &this->cyl1, &this->actor, &sWrathCylInit); - - 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; - - sWhipSegCount = 44; - this->unk_17E0 = 1.0f; + for (i = 0; i < ARRAY_COUNT(sBossRemains); i++) { + sBossRemains[i] = NULL; } } + this->actor.targetMode = 5; + this->actor.colChkInfo.mass = MASS_HEAVY; + this->actor.gravity = -2.5f; + + if (thisx->params >= MAJORA_REMAINS) { + this->actor.update = Boss07_Remains_Update; + this->actor.draw = Boss07_Remains_Draw; + + sBossRemains[thisx->params - MAJORA_REMAINS] = this; + if (gSaveContext.eventInf[6] & 2) { + Actor_SetScale(&this->actor, 0.03f); + this->actor.world.pos.x = sRemainsEnd[this->actor.params - MAJORA_REMAINS].x; + 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; + Boss07_Remains_SetupFly(this, play); + } else { + Boss07_Remains_SetupIntro(this, play); + } + this->actor.flags &= ~1; + this->actor.colChkInfo.damageTable = &sRemainsDmgTable; + return; + } + + if (this->actor.params == MAJORA_TOP) { + static EffectTireMarkInit sTopTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; + + this->actor.update = Boss07_Top_Update; + this->actor.draw = Boss07_Top_Draw; + Boss07_Top_SetupThrown(this, play); + this->actor.colChkInfo.damageTable = &sTopDmgTable; + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, KREG(55) + 9.0f); + this->actor.shape.shadowAlpha = 180; + Collider_InitAndSetCylinder(play, &this->cyl2, &this->actor, &sTopCylInit); + Effect_Add(play, &this->effectIndex, 4, 0, 0, &sTopTireMarkInit); + this->actor.flags &= ~1; + return; + } + + if ((this->actor.params == MAJORA_REMAINS_SHOT) || (this->actor.params == MAJORA_INCARNATION_SHOT)) { + this->actor.update = Boss07_Projectile_Update; + this->actor.draw = Boss07_Projectile_Draw; + this->actor.flags &= ~1; + Collider_InitAndSetCylinder(play, &this->cyl2, &this->actor, &sShotCylInit); + func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); + this->unk_181C = Rand_ZeroFloat(3.99f); + return; + } + + if ((this->actor.params == MAJORA_MASK) || (this->actor.params == MAJORA_MASK_CS)) { + this->actor.colChkInfo.damageTable = &sMaskDmgTable; + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 15.0f); + SkelAnime_Init(play, &this->skelAnime, &gMajorasMaskSkel, &gMajorasMaskFloatingAnim, this->jointTable, + this->morphTable, MAJORAS_MASK_LIMB_MAX); + if (this->actor.params == MAJORA_MASK) { + static EffectTireMarkInit sMaskTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; + + this->actor.update = Boss07_Mask_Update; + this->actor.draw = Boss07_Mask_Draw; + Effect_Add(play, &this->effectIndex, 4, 0, 0, &sMaskTireMarkInit); + sMajorasMask = this; + if (gSaveContext.eventInf[6] & 2) { + this->actor.world.pos.x = 0.0f; + this->actor.world.pos.y = sREG(17) + 277.0f; + this->actor.world.pos.z = -922.5f; + Boss07_Mask_SetupIdle(this, play); + this->unk_164.x = 0.0f; + this->unk_164.y = 200.0f; + this->unk_164.z = 0.0f; + this->unk_170 = 0.0f; + this->timers[0] = 50; + this->timers[2] = 200; + this->unk_1888 = 50; + this->actor.flags |= 1; + sMusicStartTimer = 20; + } else { + Boss07_Mask_SetupIntro(this, play); + } + Collider_InitAndSetQuad(play, &this->quad1, &this->actor, &sMaskQuadInit1); + Collider_InitAndSetQuad(play, &this->quad2, &this->actor, &sMaskQuadInit2); + this->actor.colChkInfo.health = 14; + for (i = 0; i < ARRAY_COUNT(sRemainsParams); i++) { + Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, 0.0f, 0.0f, 0.0f, 0, 0, 0, + sRemainsParams[i]); + } + } + return; + } + + if ((this->actor.params == MAJORA_INCARNATION) || (this->actor.params == MAJORA_AFTERIMAGE)) { + Actor_SetScale(&this->actor, 0.015000001f); + SkelAnime_InitFlex(play, &this->skelAnime, &gMajorasIncarnationSkel, + &gMajorasIncarnationTauntDance1Anim, this->jointTable, this->morphTable, + MAJORAS_INCARNATION_LIMB_MAX); + if (this->actor.params == MAJORA_AFTERIMAGE) { + this->timers[0] = this->actor.world.rot.z; + this->actor.world.rot.z = 0; + this->actor.update = Boss07_Afterimage_Update; + this->actor.draw = Boss07_Afterimage_Draw; + this->actor.flags &= ~1; + } else { + this->actor.colChkInfo.damageTable = &sIncarnationDmgTable; + this->actor.colChkInfo.health = 30; + this->actor.update = Boss07_Incarnation_Update; + this->actor.draw = Boss07_Incarnation_Draw; + Collider_InitAndSetJntSph(play, &this->sph1, &this->actor, &sIncarnationJntSphInit1, + this->sphElems1); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 80.0f); + this->csCamIndex = this->actor.shape.rot.z; + if (this->csCamIndex != 0) { + Boss07_Incarnation_SetupIntro(this, play); + } else { + Boss07_Incarnation_SetupTaunt(this, play); + this->unk_14A = 1; + for (i = 0; i < 4; i++) { + this->unk_17B8[i] = 1.0f; + } + play->envCtx.lightBlend = 0.0f; + } + this->unk_17E0 = 1.0f; + this->unk_17E4 = 1.0f; + this->unk_17F0 = 1.0f; + this->unk_17F4 = 1.0f; + } + return; + } + + sMajorasWrath = this; + this->actor.colChkInfo.health = 40; + this->actor.colChkInfo.damageTable = &sWrathDmgTable; + Actor_SetScale(&this->actor, 0.01f); + this->csCamIndex = this->actor.shape.rot.z; + if (this->csCamIndex != 0) { + Boss07_Wrath_SetupIntro(this, play); + } else { + Boss07_Wrath_SetupIdle(this, play, 50); + this->whipScale = 1.0f; + Audio_QueueSeqCmd(NA_BGM_MAJORAS_WRATH | 0x8000); + } + SkelAnime_InitFlex(play, &this->skelAnime, &gMajorasWrathSkel, &gMajorasWrathIdleAnim, + this->jointTable, this->morphTable, MAJORAS_WRATH_LIMB_MAX); + Collider_InitAndSetJntSph(play, &this->sph1, &this->actor, &sWrathJntSphInit1, this->sphElems1); + Collider_InitAndSetJntSph(play, &this->sph2, &this->actor, &sWrathJntSphInit2, this->sphElems2); + Collider_InitAndSetCylinder(play, &this->cyl1, &this->actor, &sWrathCylInit); + + 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; + + sWhipSegCount = 44; + this->unk_17E0 = 1.0f; } -#else -static s16 sRemainsParams[4] = { 200, 201, 202, 203 }; -static EffectTireMarkInit sTopTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; -static EffectTireMarkInit sMaskTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Init.s") -#endif void Boss07_Destroy(Actor* thisx, PlayState* play2) { PlayState* play = play2; @@ -702,7 +714,7 @@ void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { func_8019FE74(&gSfxVolume, 0.0f, 0x3C); } if (this->unk_ABC8 == 112) { - Audio_QueueSeqCmd(0x8069); + Audio_QueueSeqCmd(NA_BGM_MAJORAS_WRATH | 0x8000); } if (this->unk_ABC8 == 137) { TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtxt, @@ -743,7 +755,7 @@ void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { void Boss07_Wrath_SetupDeath(Boss07* this, PlayState* play) { s32 i; - Audio_QueueSeqCmd(0x100100FF); + Audio_QueueSeqCmd(NA_BGM_STOP | 0x10000); Boss07_MovePlayer(play); this->actionFunc = Boss07_Wrath_Death; this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; @@ -2718,7 +2730,7 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { 0x28); } if (this->unk_ABC8 == 20) { - Audio_QueueSeqCmd(0x806A); + Audio_QueueSeqCmd(NA_BGM_MAJORAS_INCARNATION | 0x8000); this->unk_14A = 1; play->envCtx.lightBlend = 0.0f; } @@ -3297,7 +3309,7 @@ void Boss07_Incarnation_Update(Actor* thisx, PlayState* play2) { if (this->unk_148 || KREG(88)) { KREG(88) = false; this->unk_148 = false; - Audio_QueueSeqCmd(0x100100FF); + Audio_QueueSeqCmd(NA_BGM_STOP | 0x10000); Boss07_Incarnation_SetupDeath(this, play); } } @@ -3507,7 +3519,7 @@ void Boss07_Mask_Idle(Boss07* this, PlayState* play) { if (this->unk_148 || KREG(88)) { KREG(88) = false; this->unk_148 = false; - Audio_QueueSeqCmd(0x100100FF); + Audio_QueueSeqCmd(NA_BGM_STOP | 0x10000); Boss07_Mask_SetupDeath(this, play); } } @@ -4126,7 +4138,7 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { Boss07_Remains_SetupFly(sBossRemains[REMAINS_TWINMOLD], play); this->csCamSpeedMod = 0.0f; sMajoraStatic->unk_AB44 = 0.0f; - Audio_QueueSeqCmd(0x100A00FF); + Audio_QueueSeqCmd(NA_BGM_STOP | 0xA0000); } } break; @@ -4192,7 +4204,7 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { Lib_SegmentedToVirtual(&gMajorasMaskTitleCardTex), 0xA0, 0xB4, 0x80, 0x28); } if (this->unk_ABC8 == 30) { - Audio_QueueSeqCmd(0x806B); + Audio_QueueSeqCmd(NA_BGM_MAJORAS_MASK | 0x8000); } if (this->unk_ABC8 > 100) { Math_ApproachF(&this->csCamEye.x, player->actor.world.pos.x + 40.0f, 0.1f, @@ -4387,7 +4399,7 @@ void Boss07_Mask_Update(Actor* thisx, PlayState* play2) { if (sMusicStartTimer != 0) { sMusicStartTimer--; if (sMusicStartTimer == 0) { - Audio_QueueSeqCmd(0x806B); + Audio_QueueSeqCmd(NA_BGM_MAJORAS_MASK | 0x8000); } } Math_Vec3f_Copy(&sSfxPoint, &this->actor.projectedPos); @@ -5643,7 +5655,7 @@ void Boss07_Static_UpdateEffects(PlayState* play) { s32 i; for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { - if (effect->type != 0) { + if (effect->type != MAJORA_EFFECT_NONE) { effect->scroll++; effect->pos.x += effect->vel.x; @@ -5653,12 +5665,12 @@ void Boss07_Static_UpdateEffects(PlayState* play) { effect->vel.x += effect->accel.x; effect->vel.y += effect->accel.y; effect->vel.z += effect->accel.z; - if (effect->type == 1) { + if (effect->type == MAJORA_EFFECT_1) { if (effect->isFading) { effect->alpha -= (i % 8U) + 13; if (effect->alpha <= 0) { effect->alpha = 0; - effect->type = 0; + effect->type = MAJORA_EFFECT_NONE; } } else { effect->alpha += 300; @@ -5680,7 +5692,7 @@ void Boss07_Static_DrawEffects(PlayState* play) { OPEN_DISPS(gfxCtx); func_8012C2DC(play->state.gfxCtx); for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { - if (effect->type > 0) { + if (effect->type > MAJORA_EFFECT_NONE) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, effect->alpha); gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 255, 215, 255, 128); @@ -5689,7 +5701,7 @@ void Boss07_Static_DrawEffects(PlayState* play) { (15 * -effect->scroll) % 0x100U, 0x20, 0x40, 1, 0, 0, 0x20, 0x20)); Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); - Matrix_Scale(effect->unk_34, effect->unk_34, 1.0f, MTXMODE_APPLY); + Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gMajorasMaskFireDL); } From ec3aa5c3e7cfe3cbd8b27e3fee73da774533ce60 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Fri, 19 Aug 2022 07:58:19 -0500 Subject: [PATCH 22/28] cam fixes --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 897 +++++++++++--------- src/overlays/actors/ovl_Boss_07/z_boss_07.h | 23 +- 2 files changed, 490 insertions(+), 430 deletions(-) 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 108b44e4f..9f0be0697 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -42,13 +42,70 @@ typedef struct { typedef enum { /* 0 */ MAJORA_EFFECT_NONE, - /* 1 */ MAJORA_EFFECT_1 + /* 1 */ MAJORA_EFFECT_FLAME } Boss07EffectType; +typedef enum { + MAJORAS_WRATH_ATTACK_0, + MAJORAS_WRATH_ATTACK_1, + MAJORAS_WRATH_ATTACK_2, + MAJORAS_WRATH_ATTACK_3, + MAJORAS_WRATH_ATTACK_4, + MAJORAS_WRATH_ATTACK_5, + MAJORAS_WRATH_ATTACK_6, + MAJORAS_WRATH_ATTACK_7, + MAJORAS_WRATH_ATTACK_MAX, +} Boss07WrathActionStates; + +typedef enum { + MAJORAS_INCARNATION_STATE_0, + MAJORAS_INCARNATION_STATE_1, + MAJORAS_INCARNATION_STATE_2, + MAJORAS_INCARNATION_STATE_MAX, +} Boss07IncarnationActionStates; + +typedef enum { + MAJORAS_MASK_SPIN_STATE_0, + MAJORAS_MASK_SPIN_STATE_1, + MAJORAS_MASK_SPIN_STATE_2, + MAJORAS_MASK_SPIN_STATE_MAX, +} Boss07MaskSpinStates; + +typedef enum { + MAJORAS_MASK_BEAM_STATE_0, + MAJORAS_MASK_BEAM_STATE_1, + MAJORAS_MASK_BEAM_STATE_2, + MAJORAS_MASK_BEAM_STATE_3, + MAJORAS_MASK_BEAM_STATE_4, + MAJORAS_MASK_BEAM_STATE_5, + MAJORAS_MASK_BEAM_STATE_MAX, +} Boss07MaskBeamStates; + +typedef enum { + MAJORAS_PROJECTILE_STATE_0, + MAJORAS_PROJECTILE_STATE_1, + MAJORAS_PROJECTILE_STATE_MAX, +} Boss07ProjectileStates; + +typedef enum { + MAJORAS_REMAINS_STATE_0, + MAJORAS_REMAINS_STATE_1, + MAJORAS_REMAINS_STATE_2, + MAJORAS_REMAINS_STATE_3, + MAJORAS_REMAINS_STATE_10=10, + MAJORAS_REMAINS_STATE_20=20, +} Boss07RemainsStates; + +typedef enum { + MAJORAS_TOP_STATE_0, + MAJORAS_TOP_STATE_1, + MAJORAS_TOP_STATE_MAX, +} Boss07TopState; + #if 1 // function prototypes -void func_809F4D10(Vec3f* arg0, f32 arg1); -void func_809FCBC8(Boss07* this); -void func_80A006D0(Boss07* this); +void Boss07_RandVec3fXZ(Vec3f* arg0, f32 arg1); +void Boss07_Incarnation_AvoidPlayer(Boss07* this); +void Boss07_Mask_ClearBeam(Boss07* this); void Boss07_Init(Actor* thisx, PlayState* play); void Boss07_Destroy(Actor* thisx, PlayState* play); @@ -233,7 +290,7 @@ void Boss07_SpawnEffect(PlayState* play, Vec3f* pos, Vec3f* vel, Vec3f* accel, f for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { if (effect->type == MAJORA_EFFECT_NONE) { - effect->type = MAJORA_EFFECT_1; + effect->type = MAJORA_EFFECT_FLAME; effect->pos = *pos; effect->vel = *vel; effect->accel = *accel; @@ -271,9 +328,9 @@ void Boss07_SmoothStop(Boss07* this, f32 maxStep) { } } -void func_809F4D10(Vec3f* dst, f32 scale) { +void Boss07_RandVec3fXZ(Vec3f* dst, f32 length) { Matrix_RotateYF(Rand_ZeroFloat(2 * M_PI), MTXMODE_NEW); - Matrix_MultVecZ(scale, dst); + Matrix_MultVecZ(length, dst); } void Boss07_SpawnDust(Boss07* this, PlayState* play, u8 spawnInterval, u8 mode) { @@ -529,9 +586,9 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { this->actor.world.pos.y = sREG(17) + 277.0f; this->actor.world.pos.z = -922.5f; Boss07_Mask_SetupIdle(this, play); - this->unk_164.x = 0.0f; - this->unk_164.y = 200.0f; - this->unk_164.z = 0.0f; + this->moveTarget.x = 0.0f; + this->moveTarget.y = 200.0f; + this->moveTarget.z = 0.0f; this->unk_170 = 0.0f; this->timers[0] = 50; this->timers[2] = 200; @@ -571,8 +628,8 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { Collider_InitAndSetJntSph(play, &this->sph1, &this->actor, &sIncarnationJntSphInit1, this->sphElems1); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 80.0f); - this->csCamIndex = this->actor.shape.rot.z; - if (this->csCamIndex != 0) { + this->subCamIndex = this->actor.shape.rot.z; + if (this->subCamIndex != 0) { Boss07_Incarnation_SetupIntro(this, play); } else { Boss07_Incarnation_SetupTaunt(this, play); @@ -594,8 +651,8 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { this->actor.colChkInfo.health = 40; this->actor.colChkInfo.damageTable = &sWrathDmgTable; Actor_SetScale(&this->actor, 0.01f); - this->csCamIndex = this->actor.shape.rot.z; - if (this->csCamIndex != 0) { + this->subCamIndex = this->actor.shape.rot.z; + if (this->subCamIndex != 0) { Boss07_Wrath_SetupIntro(this, play); } else { Boss07_Wrath_SetupIdle(this, play, 50); @@ -654,12 +711,12 @@ void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { case 0: this->unk_ABC8 = 0; this->csState = 1; - this->csCamNextAt.z = 0.f; - this->csCamNextEye.x = 0.0; - this->csCamNextEye.y = KREG(17) + 100.0f - 30.0f + 80.0f; - this->csCamNextEye.z = KREG(18) + 270.0f - 150.0f + 30.0f - 50.0f; - this->csCamNextAt.x = 0.0f; - this->csCamNextAt.y = 180.0f; + this->subCamNextAt.z = 0.f; + this->subCamNextEye.x = 0.0; + this->subCamNextEye.y = KREG(17) + 100.0f - 30.0f + 80.0f; + this->subCamNextEye.z = KREG(18) + 270.0f - 150.0f + 30.0f - 50.0f; + this->subCamNextAt.x = 0.0f; + this->subCamNextAt.y = 180.0f; case 1: if (this->unk_ABC8 < 40) { sHeartbeatTimer = 3; @@ -690,10 +747,10 @@ void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { dataIndex = 4; } - Math_ApproachF(&this->csCamNextEye.y, sCamPoints[dataIndex][0], 0.075f, this->csCamSpeedMod * 7.0f); - Math_ApproachF(&this->csCamNextEye.z, sCamPoints[dataIndex][1], 0.075f, this->csCamSpeedMod * 17.0f); - Math_ApproachF(&this->csCamNextAt.y, sCamPoints[dataIndex][2], 0.075f, this->csCamSpeedMod * 7.0f); - Math_ApproachF(&this->csCamSpeedMod, 1.0f, 1.0f, 0.01f); + Math_ApproachF(&this->subCamNextEye.y, sCamPoints[dataIndex][0], 0.075f, this->subCamSpeedMod * 7.0f); + Math_ApproachF(&this->subCamNextEye.z, sCamPoints[dataIndex][1], 0.075f, this->subCamSpeedMod * 17.0f); + Math_ApproachF(&this->subCamNextAt.y, sCamPoints[dataIndex][2], 0.075f, this->subCamSpeedMod * 7.0f); + Math_ApproachF(&this->subCamSpeedMod, 1.0f, 1.0f, 0.01f); if (this->unk_ABC8 == 70) { Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathIntroAnim, -15.0f); this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathIntroAnim); @@ -726,11 +783,11 @@ void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { this->csState = 0; Boss07_Wrath_SetupIdle(this, play, 50); - sp48->eye = this->csCamEye; - sp48->eyeNext = this->csCamEye; - sp48->at = this->csCamAt; - func_80169AFC(play, this->csCamIndex, 0); - this->csCamIndex = 0; + sp48->eye = this->subCamEye; + sp48->eyeNext = this->subCamEye; + sp48->at = this->subCamAt; + func_80169AFC(play, this->subCamIndex, 0); + this->subCamIndex = 0; Cutscene_End(play, &play->csCtx); func_800B7298(play, &this->actor, 6); this->actor.flags |= 1; @@ -744,11 +801,11 @@ void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { } break; } - Matrix_MultVec3f(&this->csCamNextEye, &this->csCamEye); - Matrix_MultVec3f(&this->csCamNextAt, &this->csCamAt); - if (this->csCamIndex != 0) { + Matrix_MultVec3f(&this->subCamNextEye, &this->subCamEye); + Matrix_MultVec3f(&this->subCamNextAt, &this->subCamAt); + if (this->subCamIndex != 0) { ShrinkWindow_SetLetterboxTarget(0x1B); - Play_SetCameraAtEye(play, this->csCamIndex, &this->csCamAt, &this->csCamEye); + Play_SetCameraAtEye(play, this->subCamIndex, &this->subCamAt, &this->subCamEye); } } @@ -768,7 +825,7 @@ void Boss07_Wrath_SetupDeath(Boss07* this, PlayState* play) { this->unk_ABC8 = 0; if (sBossRemains[REMAINS_ODOLWA] != NULL) { for (i = 0; i < 4; i++) { - sBossRemains[i]->actionState = 2; + sBossRemains[i]->actionState = MAJORAS_REMAINS_STATE_2; } } this->unk_15C = 1000; @@ -791,21 +848,21 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { } Cutscene_Start(play, &play->csCtx); func_800B7298(play, &this->actor, 1); - this->csCamIndex = Play_CreateSubCamera(play); + this->subCamIndex = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, 0, 1); - Play_ChangeCameraStatus(play, this->csCamIndex, 7); + Play_ChangeCameraStatus(play, this->subCamIndex, 7); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_DEAD_ROD); case 1: this->unk_ABC8 = 0; this->csState = 2; - this->csCamEye.x = camera->eye.x; - this->csCamEye.y = camera->eye.y; - this->csCamEye.z = camera->eye.z; - this->csCamAt.x = camera->at.x; - this->csCamAt.y = camera->at.y; - this->csCamAt.z = camera->at.z; - this->csCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; - this->csCamRotVel = this->csCamSpeedMod = sMajoraStatic->unk_180C = 0.0f; + this->subCamEye.x = camera->eye.x; + this->subCamEye.y = camera->eye.y; + this->subCamEye.z = camera->eye.z; + this->subCamAt.x = camera->at.x; + this->subCamAt.y = camera->at.y; + this->subCamAt.z = camera->at.z; + this->subCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; + this->subCamRotVel = this->subCamSpeedMod = sMajoraStatic->unk_180C = 0.0f; Boss07_InitRand(1, 0x71AC, 0x263A); for (i = 0; i < ARRAY_COUNT(this->deathLightScale); i++) { this->deathLightScale[i] = Boss07_RandZeroOne() - 1.0f; @@ -827,9 +884,9 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { spB4.x = 0.0f; spB4.y = -90.0f; spB4.z = 350.0f; - this->csCamNextAt.x = this->actor.focus.pos.x; - this->csCamNextAt.y = this->actor.focus.pos.y - 40.0f; - this->csCamNextAt.z = this->actor.focus.pos.z; + this->subCamNextAt.x = this->actor.focus.pos.x; + this->subCamNextAt.y = this->actor.focus.pos.y - 40.0f; + this->subCamNextAt.z = this->actor.focus.pos.z; if ((this->unk_ABC8 >= 50) && (this->unk_ABC8 < 80)) { if (this->unk_ABC8 == 50) { @@ -837,7 +894,7 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { } spB4.x = 30.0f; spB4.z = 120.0f; - this->csCamNextAt.y = this->actor.focus.pos.y - 40.0f + 30.0f; + this->subCamNextAt.y = this->actor.focus.pos.y - 40.0f + 30.0f; spA4 = 200.0f; spA0 = 1.0f; } else if ((this->unk_ABC8 >= 80) && (this->unk_ABC8 < 110)) { @@ -847,7 +904,7 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { } spB4.x = -10.0f; spB4.z = 150.0f; - this->csCamNextAt.y = this->actor.focus.pos.y - 40.0f - 60.0f; + this->subCamNextAt.y = this->actor.focus.pos.y - 40.0f - 60.0f; spA4 = 200.0f; spA0 = 1.0f; } else if ((this->unk_ABC8 >= 110) && (this->unk_ABC8 < 140)) { @@ -856,13 +913,13 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { } spB4.x = -70.0f; spB4.z = 110.0f; - this->csCamNextAt.y = this->actor.focus.pos.y - 40.0f + 30.0f; + this->subCamNextAt.y = this->actor.focus.pos.y - 40.0f + 30.0f; spA4 = 200.0f; spA0 = 1.0f; } if (this->unk_ABC8 >= (sREG(15) + 140)) { this->csState = 4; - this->csCamEyeMod.y = sREG(16) + 270.0f + 50.0f; + this->subCamEyeModY = sREG(16) + 270.0f + 50.0f; Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_DEAD_FLOAT); } else { break; @@ -870,16 +927,16 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { case 4: if ((this->unk_ABC8 >= (sREG(90) + 260)) && (this->unk_ABC8 < (sREG(91) + 370))) { spC0 = KREG(14) + 1; - this->csCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; + this->subCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; spB4.x = 0.0f; - spB4.y = this->csCamEyeMod.y + -190.0f; + spB4.y = this->subCamEyeModY + -190.0f; spB4.z = sREG(17) + 390.0f - 380.0f; - this->csCamNextAt.x = this->actor.focus.pos.x; - this->csCamNextAt.y = this->actor.focus.pos.y - 40.0f - 60.0f + sREG(18) + 130.0f; - this->csCamNextAt.z = this->actor.focus.pos.z; + this->subCamNextAt.x = this->actor.focus.pos.x; + this->subCamNextAt.y = this->actor.focus.pos.y - 40.0f - 60.0f + sREG(18) + 130.0f; + this->subCamNextAt.z = this->actor.focus.pos.z; - Math_ApproachF(&this->csCamEyeMod.y, sREG(19) + 240.0f, 0.05f, 1.0f + (sREG(20) * 0.1f)); + Math_ApproachF(&this->subCamEyeModY, sREG(19) + 240.0f, 0.05f, 1.0f + (sREG(20) * 0.1f)); spA4 = 2000.0f; spA0 = 1.0f; @@ -890,17 +947,17 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { spB4.x = 0.0f; spB4.y = -190.0f; spB4.z = 390.0f; - this->csCamNextAt.x = this->actor.focus.pos.x; - this->csCamNextAt.y = this->actor.focus.pos.y - 40.0f - 60.0f; - this->csCamNextAt.z = this->actor.focus.pos.z; + this->subCamNextAt.x = this->actor.focus.pos.x; + this->subCamNextAt.y = this->actor.focus.pos.y - 40.0f - 60.0f; + this->subCamNextAt.z = this->actor.focus.pos.z; this->unk_1D8 = 0; if (this->unk_ABC8 > 330) { spA4 = 2000.0f; spA0 = 1.0f; } - Math_ApproachZeroF(&this->actor.world.pos.x, 0.1f, this->csCamSpeedMod); - Math_ApproachZeroF(&this->actor.world.pos.z, 0.1f, this->csCamSpeedMod); - Math_ApproachF(&this->csCamSpeedMod, 5.0f, 1.0f, 0.1f); + Math_ApproachZeroF(&this->actor.world.pos.x, 0.1f, this->subCamSpeedMod); + Math_ApproachZeroF(&this->actor.world.pos.z, 0.1f, this->subCamSpeedMod); + Math_ApproachF(&this->subCamSpeedMod, 5.0f, 1.0f, 0.1f); } if (this->unk_ABC8 >= 260) { f32 sp98; @@ -946,10 +1003,10 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { Math_ApproachF(&play->envCtx.lightBlend, 1.0f, 1.0f, 0.1f); } } - this->csCamRotY += this->csCamRotVel; - this->csCamRotVel += 0.0004f; - if (this->csCamRotVel > 0.02f) { - this->csCamRotVel = 0.02f; + this->subCamRotY += this->subCamRotVel; + this->subCamRotVel += 0.0004f; + if (this->subCamRotVel > 0.02f) { + this->subCamRotVel = 0.02f; } if (this->unk_ABC8 >= (sREG(93) + 180)) { Vec3f sp84 = { 0.0f, 10.0f, 0.0f }; @@ -979,26 +1036,26 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { } break; } - Matrix_RotateYF(this->csCamRotY, MTXMODE_NEW); - Matrix_MultVec3f(&spB4, &this->csCamNextEye); - this->csCamNextEye.x += this->actor.focus.pos.x; - this->csCamNextEye.y += this->actor.focus.pos.y; - this->csCamNextEye.z += this->actor.focus.pos.z; + Matrix_RotateYF(this->subCamRotY, MTXMODE_NEW); + Matrix_MultVec3f(&spB4, &this->subCamNextEye); + this->subCamNextEye.x += this->actor.focus.pos.x; + this->subCamNextEye.y += this->actor.focus.pos.y; + this->subCamNextEye.z += this->actor.focus.pos.z; - Math_ApproachF(&this->csCamEye.x, this->csCamNextEye.x, spA0, 40.0f + spA4); - Math_ApproachF(&this->csCamEye.y, this->csCamNextEye.y, spA0, 40.0f + spA4); - Math_ApproachF(&this->csCamEye.z, this->csCamNextEye.z, spA0, 40.0f + spA4); + Math_ApproachF(&this->subCamEye.x, this->subCamNextEye.x, spA0, 40.0f + spA4); + Math_ApproachF(&this->subCamEye.y, this->subCamNextEye.y, spA0, 40.0f + spA4); + Math_ApproachF(&this->subCamEye.z, this->subCamNextEye.z, spA0, 40.0f + spA4); - Math_ApproachF(&this->csCamAt.x, this->csCamNextAt.x, spA0, 70.0f + spA4); - Math_ApproachF(&this->csCamAt.y, this->csCamNextAt.y, spA0, 70.0f + spA4); - Math_ApproachF(&this->csCamAt.z, this->csCamNextAt.z, spA0, 70.0f + spA4); - if (this->csCamIndex != 0) { + Math_ApproachF(&this->subCamAt.x, this->subCamNextAt.x, spA0, 70.0f + spA4); + Math_ApproachF(&this->subCamAt.y, this->subCamNextAt.y, spA0, 70.0f + spA4); + Math_ApproachF(&this->subCamAt.z, this->subCamNextAt.z, spA0, 70.0f + spA4); + if (this->subCamIndex != 0) { Vec3f sp5C; - sp5C.x = this->csCamAt.x + spA8.x; - sp5C.y = this->csCamAt.y + spA8.y; - sp5C.z = this->csCamAt.z + spA8.z; - Play_SetCameraAtEye(play, this->csCamIndex, &sp5C, &this->csCamEye); + sp5C.x = this->subCamAt.x + spA8.x; + sp5C.y = this->subCamAt.y + spA8.y; + sp5C.z = this->subCamAt.z + spA8.z; + Play_SetCameraAtEye(play, this->subCamIndex, &sp5C, &this->subCamEye); } SkelAnime_Update(&this->skelAnime); this->unk_ABC8++; @@ -1149,9 +1206,9 @@ void Boss07_Wrath_SetupSidestep(Boss07* this, PlayState* play) { this->skelAnime.playSpeed = -1.0f; phi_f14 = -300.0f; } - Matrix_MultVecX(phi_f14, &this->unk_164); - this->unk_164.x += this->actor.world.pos.x; - this->unk_164.z += this->actor.world.pos.z; + Matrix_MultVecX(phi_f14, &this->moveTarget); + this->moveTarget.x += this->actor.world.pos.x; + this->moveTarget.z += this->actor.world.pos.z; this->timers[1] = 21; this->unk_158 = 10; this->unk_170 = 0.0f; @@ -1172,8 +1229,8 @@ void Boss07_Wrath_Sidestep(Boss07* this, PlayState* play) { 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->actor.world.pos.x, this->moveTarget.x, 0.8f, this->unk_170); + Math_ApproachF(&this->actor.world.pos.z, this->moveTarget.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) { @@ -1190,51 +1247,51 @@ void Boss07_Wrath_SetupAttack(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Wrath_Attack; this->timers[1] = 0; if (player->stateFlags3 & 0x100) { - this->actionState = 4; + this->actionState = MAJORAS_WRATH_ATTACK_4; } else if (this->actor.xzDistToPlayer <= 300.0f) { if (this->actor.xzDistToPlayer <= 200.0f) { - this->actionState = 7; + this->actionState = MAJORAS_WRATH_ATTACK_7; } else { - this->actionState = 4; + this->actionState = MAJORAS_WRATH_ATTACK_4; } } else { this->actionState = Rand_ZeroFloat(6.99f); - if (((s8)this->actor.colChkInfo.health >= 28) && ((this->actionState == 1) || (this->actionState == 2))) { - this->actionState = 0; + if (((s8)this->actor.colChkInfo.health >= 28) && ((this->actionState == MAJORAS_WRATH_ATTACK_1) || (this->actionState == MAJORAS_WRATH_ATTACK_2))) { + this->actionState = MAJORAS_WRATH_ATTACK_0; } } switch (this->actionState) { - case 0: + case MAJORAS_WRATH_ATTACK_0: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathShortSingleWhipAttackAnim, -5.0f); this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathShortSingleWhipAttackAnim); break; - case 1: + case MAJORAS_WRATH_ATTACK_1: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathWhipFlurryAttackAnim, -5.0f); this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathWhipFlurryAttackAnim); break; - case 2: + case MAJORAS_WRATH_ATTACK_2: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathDoubleWhipAttackAnim, -5.0f); this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathDoubleWhipAttackAnim); break; - case 3: + case MAJORAS_WRATH_ATTACK_3: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathLongSingleWhipAttackAnim, -5.0f); this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathLongSingleWhipAttackAnim); break; - case 4: + case MAJORAS_WRATH_ATTACK_4: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathSpinAttackAnim, -5.0f); this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathSpinAttackAnim); - func_809F4D10(&this->unk_164, 650.0f); + Boss07_RandVec3fXZ(&this->moveTarget, 650.0f); this->unk_170 = 0.0f; break; - case 5: + case MAJORAS_WRATH_ATTACK_5: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathTauntAnim, -5.0f); this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathTauntAnim); break; - case 6: + case MAJORAS_WRATH_ATTACK_6: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathThreeAttackComboAnim, -5.0f); this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathThreeAttackComboAnim); break; - case 7: + case MAJORAS_WRATH_ATTACK_7: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathKickAnim, -5.0f); this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathKickAnim); break; @@ -1253,7 +1310,7 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { this->unk_174 = true; } switch (this->actionState) { - case 0: + case MAJORAS_WRATH_ATTACK_0: if (this->actionTimer == (s16)(KREG(92) + 1)) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } @@ -1270,7 +1327,7 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } break; - case 1: + case MAJORAS_WRATH_ATTACK_1: if (this->actionTimer == (s16)(KREG(91) + 3)) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_THROW_OLD); } @@ -1285,7 +1342,7 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); } break; - case 2: + case MAJORAS_WRATH_ATTACK_2: if (this->actionTimer == (s16)(KREG(84) + 5)) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } @@ -1303,7 +1360,7 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } break; - case 3: + case MAJORAS_WRATH_ATTACK_3: if (this->actionTimer == (s16)(KREG(84) + 5)) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } @@ -1322,33 +1379,33 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } break; - case 4: + case MAJORAS_WRATH_ATTACK_4: if ((this->actionTimer > 16) && (this->actionTimer <= 40)) { this->leftWhip.tension = this->rightWhip.tension = 200.0f; if ((this->actionTimer % 8) == 0) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_KOMA_OLD); } Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_ROD_DANCE_OLD - SFX_FLAG); - Math_ApproachF(&this->actor.world.pos.x, this->unk_164.x, 0.1f, this->unk_170); - Math_ApproachF(&this->actor.world.pos.z, this->unk_164.z, 0.1f, this->unk_170); + Math_ApproachF(&this->actor.world.pos.x, this->moveTarget.x, 0.1f, this->unk_170); + Math_ApproachF(&this->actor.world.pos.z, this->moveTarget.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 = false; } break; - case 7: + case MAJORAS_WRATH_ATTACK_7: this->unk_174 = false; if (this->actionTimer == 3) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_VOICE_KICK_OLD); } break; - case 5: + case MAJORAS_WRATH_ATTACK_5: 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 = true; break; - case 6: + case MAJORAS_WRATH_ATTACK_6: if (this->actionTimer == (s16)(KREG(85) + 5)) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } @@ -1693,7 +1750,7 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* arg0, f32 arg1, Boss07* this, PlaySt prop = prop->next; } } - if ((arg1 >= 50.0f) && (this->unk_15A == 0) && (!(player->stateFlags3 & 0x100) || (this->actionState == 4))) { + if ((arg1 >= 50.0f) && (this->unk_15A == 0) && (!(player->stateFlags3 & 0x100) || (this->actionState == MAJORAS_WRATH_ATTACK_4))) { if ((func_800B64FC(play, 1000.0f, &this->actor.world.pos, &sp98) >= 0.0f) && (sp98 != 1)) { sp98 = -1; } @@ -1986,7 +2043,7 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { } CollisionCheck_SetOC(play, &play->colChkCtx, &this->sph1.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->sph1.base); - if ((this->actionFunc == Boss07_Wrath_Attack) && (this->actionState == 7) && (this->actionTimer >= 6)) { + if ((this->actionFunc == Boss07_Wrath_Attack) && (this->actionState == MAJORAS_WRATH_ATTACK_7) && (this->actionTimer >= 6)) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->sph2.base); } else { if (this->unk_174 && Boss07_IsFacingPlayer(this, play)) { @@ -2596,14 +2653,14 @@ void Boss07_Wrath_DrawShadowTex(u8* shadowTex, Boss07* this, PlayState* play) { CLOSE_DISPS(pad3); } -void func_809FCBC8(Boss07* this) { +void Boss07_Incarnation_AvoidPlayer(Boss07* this) { s32 phi_v0 = (Rand_ZeroOne() < 0.5f) ? 0x4000 : -0x4000; Matrix_RotateYS(this->actor.yawTowardsPlayer + phi_v0, MTXMODE_NEW); - Matrix_MultVecZ(200.0f, &this->unk_164); + Matrix_MultVecZ(200.0f, &this->moveTarget); this->timers[1] = 30; - this->unk_164.x += this->actor.world.pos.x; - this->unk_164.z += this->actor.world.pos.z; + this->moveTarget.x += this->actor.world.pos.x; + this->moveTarget.z += this->actor.world.pos.z; this->unk_170 = 20000.0f; } @@ -2627,15 +2684,15 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { case 0: this->unk_ABC8 = 0; this->csState = 1; - this->csCamNextAt.z = 0.0f; + this->subCamNextAt.z = 0.0f; case 1: this->csState = 2; this->unk_ABC8 = 0; - this->csCamNextEye.x = 70.0f; - this->csCamNextEye.y = 70.0f; - this->csCamNextEye.z = 150.0f; - this->csCamNextAt.x = 20.0f; - this->csCamNextAt.y = 80.0f; + this->subCamNextEye.x = 70.0f; + this->subCamNextEye.y = 70.0f; + this->subCamNextEye.z = 150.0f; + this->subCamNextAt.x = 20.0f; + this->subCamNextAt.y = 80.0f; break; case 2: if (this->unk_ABC8 >= 20) { @@ -2651,12 +2708,12 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { } break; case 3: - Math_ApproachF(&this->csCamNextEye.x, 0.0f, 0.05f, this->csCamSpeedMod * 40.0f); - Math_ApproachF(&this->csCamNextEye.y, 100.0f, 0.05f, this->csCamSpeedMod * 30.0f); - Math_ApproachF(&this->csCamNextEye.z, 270.0f, 0.05f, this->csCamSpeedMod * 150.0f); - Math_ApproachF(&this->csCamNextAt.x, 0.0f, 0.05f, this->csCamSpeedMod * 20.0f); - Math_ApproachF(&this->csCamNextAt.y, 100.0f, 0.05f, this->csCamSpeedMod * 20.0f); - Math_ApproachF(&this->csCamSpeedMod, 0.05f, 1.0f, 0.002f); + Math_ApproachF(&this->subCamNextEye.x, 0.0f, 0.05f, this->subCamSpeedMod * 40.0f); + Math_ApproachF(&this->subCamNextEye.y, 100.0f, 0.05f, this->subCamSpeedMod * 30.0f); + Math_ApproachF(&this->subCamNextEye.z, 270.0f, 0.05f, this->subCamSpeedMod * 150.0f); + Math_ApproachF(&this->subCamNextAt.x, 0.0f, 0.05f, this->subCamSpeedMod * 20.0f); + Math_ApproachF(&this->subCamNextAt.y, 100.0f, 0.05f, this->subCamSpeedMod * 20.0f); + Math_ApproachF(&this->subCamSpeedMod, 0.05f, 1.0f, 0.002f); if (this->unk_ABC8 >= 20) { if (this->unk_ABC8 == 20) { this->unk_17C8[2] = 1.0f; @@ -2687,10 +2744,10 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { } break; case 4: - this->csCamNextEye.x = 0.0f; - this->csCamNextEye.y = 120.0f; - this->csCamNextEye.z = 140.0f; - this->csCamNextAt.y = 170.0f; + this->subCamNextEye.x = 0.0f; + this->subCamNextEye.y = 120.0f; + this->subCamNextEye.z = 140.0f; + this->subCamNextAt.y = 170.0f; if (this->unk_ABC8 >= 10) { if (this->unk_ABC8 == 10) { this->unk_17C8[3] = 1.0f; @@ -2701,7 +2758,7 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { if (this->unk_ABC8 == 30) { this->csState = 5; this->unk_ABC8 = 0; - this->csCamSpeedMod = 0.0f; + this->subCamSpeedMod = 0.0f; this->unk_1D4 = 1000.0f; func_80165690(); } @@ -2734,21 +2791,21 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { this->unk_14A = 1; play->envCtx.lightBlend = 0.0f; } - Math_ApproachF(&this->csCamNextEye.x, -80.0f, 0.05f, this->csCamSpeedMod * 80.0f); - Math_ApproachF(&this->csCamNextEye.y, 20.0f, 0.05f, this->csCamSpeedMod * 60.0f); - Math_ApproachF(&this->csCamNextEye.z, 220.0f, 0.05f, this->csCamSpeedMod * 180.0f); - Math_ApproachF(&this->csCamNextAt.y, 110.0f, 0.05f, this->csCamSpeedMod * 80.0f); - Math_ApproachF(&this->csCamSpeedMod, 0.1f, 1.0f, 0.005f); + Math_ApproachF(&this->subCamNextEye.x, -80.0f, 0.05f, this->subCamSpeedMod * 80.0f); + Math_ApproachF(&this->subCamNextEye.y, 20.0f, 0.05f, this->subCamSpeedMod * 60.0f); + Math_ApproachF(&this->subCamNextEye.z, 220.0f, 0.05f, this->subCamSpeedMod * 180.0f); + Math_ApproachF(&this->subCamNextAt.y, 110.0f, 0.05f, this->subCamSpeedMod * 80.0f); + Math_ApproachF(&this->subCamSpeedMod, 0.1f, 1.0f, 0.005f); if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { Camera* sp54 = Play_GetCamera(play, 0); this->csState = 0; Boss07_Incarnation_SetupTaunt(this, play); - sp54->eye = this->csCamEye; - sp54->eyeNext = this->csCamEye; - sp54->at = this->csCamAt; - func_80169AFC(play, this->csCamIndex, 0); - this->csCamIndex = 0; + sp54->eye = this->subCamEye; + sp54->eyeNext = this->subCamEye; + sp54->at = this->subCamAt; + func_80169AFC(play, this->subCamIndex, 0); + this->subCamIndex = 0; Cutscene_End(play, &play->csCtx); func_800B7298(play, &this->actor, 6); this->actor.flags |= 1; @@ -2758,11 +2815,11 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { for (i = 0; i < ARRAY_COUNT(this->unk_17C8); i++) { Math_ApproachZeroF(&this->unk_17C8[i], 0.5f, 0.1f); } - Matrix_MultVec3f(&this->csCamNextEye, &this->csCamEye); - Matrix_MultVec3f(&this->csCamNextAt, &this->csCamAt); - if (this->csCamIndex != 0) { + Matrix_MultVec3f(&this->subCamNextEye, &this->subCamEye); + Matrix_MultVec3f(&this->subCamNextAt, &this->subCamAt); + if (this->subCamIndex != 0) { ShrinkWindow_SetLetterboxTarget(0x1B); - Play_SetCameraAtEye(play, this->csCamIndex, &this->csCamAt, &this->csCamEye); + Play_SetCameraAtEye(play, this->subCamIndex, &this->subCamAt, &this->subCamEye); } } @@ -2774,7 +2831,7 @@ void Boss07_Incarnation_SetupTaunt(Boss07* this, PlayState* play) { }; this->actionFunc = Boss07_Incarnation_Taunt; - this->actionState = Rand_ZeroFloat(2.999f); + this->actionState = Rand_ZeroFloat(MAJORAS_INCARNATION_STATE_MAX - 0.001f); Animation_MorphToLoop(&this->skelAnime, sTauntAnims[this->actionState], -10.0f); this->actor.flags |= 1; this->timers[0] = Rand_ZeroFloat(50.0f) + 50.0f; @@ -2783,9 +2840,9 @@ void Boss07_Incarnation_SetupTaunt(Boss07* this, PlayState* play) { void Boss07_Incarnation_Taunt(Boss07* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (this->actionState < 2) { + if (this->actionState < MAJORAS_INCARNATION_STATE_2) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_WAIT_OLD - SFX_FLAG); - } else if ((this->actionState == 2) && Animation_OnFrame(&this->skelAnime, 5.0f)) { + } else if ((this->actionState == MAJORAS_INCARNATION_STATE_2) && Animation_OnFrame(&this->skelAnime, 5.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_JUMP_OLD); } SkelAnime_Update(&this->skelAnime); @@ -2871,7 +2928,7 @@ void Boss07_Incarnation_SetupRun(Boss07* this, PlayState* play) { Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationRunAnim, -2.0f); this->actionFunc = Boss07_Incarnation_Run; this->timers[0] = Rand_ZeroFloat(100.0f) + 150.0f; - func_809FCBC8(this); + Boss07_Incarnation_AvoidPlayer(this); } void Boss07_Incarnation_Run(Boss07* this, PlayState* play) { @@ -2890,8 +2947,8 @@ void Boss07_Incarnation_Run(Boss07* this, PlayState* play) { Boss07_Incarnation_SetupStunned(this, play, 50); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_DAMAGE_OLD); } else { - sp34 = this->unk_164.x - this->actor.world.pos.x; - sp30 = this->unk_164.z - this->actor.world.pos.z; + sp34 = this->moveTarget.x - this->actor.world.pos.x; + sp30 = this->moveTarget.z - this->actor.world.pos.z; if ((this->timers[1] == 0) || (SQ(sp34) + SQ(sp30) < SQ(173.20508f))) { // 100 * sqrt(3) if (Rand_ZeroOne() < 0.3f) { f32 temp_f0 = Rand_ZeroOne(); @@ -2908,7 +2965,7 @@ void Boss07_Incarnation_Run(Boss07* this, PlayState* play) { } else if (Rand_ZeroOne() < 0.01f) { Boss07_Incarnation_SetupStunned(this, play, 50); } else { - func_809F4D10(&this->unk_164, 500.0f); + Boss07_RandVec3fXZ(&this->moveTarget, 500.0f); this->timers[1] = Rand_ZeroFloat(50.0f) + 20.0f; this->unk_170 = 0.0f; } @@ -2920,7 +2977,7 @@ void Boss07_Incarnation_Run(Boss07* this, PlayState* play) { Boss07_Incarnation_SetupTaunt(this, play); } if ((this->actor.xzDistToPlayer < 200.0f) && (this->timers[2] == 0)) { - func_809FCBC8(this); + Boss07_Incarnation_AvoidPlayer(this); this->timers[0] = 50; this->timers[2] = 50; } @@ -3088,20 +3145,20 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { } Cutscene_Start(play, &play->csCtx); func_800B7298(play, &this->actor, 7); - this->csCamIndex = Play_CreateSubCamera(play); + this->subCamIndex = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, 0, 1); - Play_ChangeCameraStatus(play, this->csCamIndex, 7); + Play_ChangeCameraStatus(play, this->subCamIndex, 7); this->unk_ABC8 = 0; this->csState = 10; func_8016566C(150); case 10: sHeartbeatTimer = 5; - this->csCamNextEye.x = 0.0f; - this->csCamNextEye.y = 30.0f; - this->csCamNextEye.z = 210.0f; - this->csCamNextAt.x = 0.0f; - this->csCamNextAt.y = 150.0f; - this->csCamNextAt.z = 0.0f; + this->subCamNextEye.x = 0.0f; + this->subCamNextEye.y = 30.0f; + this->subCamNextEye.z = 210.0f; + this->subCamNextAt.x = 0.0f; + this->subCamNextAt.y = 150.0f; + this->subCamNextAt.z = 0.0f; Math_ApproachF(&this->actor.world.pos.x, 0.0f, 0.1f, 5.0f); Math_ApproachF(&this->actor.world.pos.z, 0.0f, 0.1f, 5.0f); if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { @@ -3112,16 +3169,16 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { break; case 1: sHeartbeatTimer = 5; - this->csCamNextAt.y = (Math_SinS(this->unk_ABC8 * 0x700) * 15.0f) + 150.0f; + this->subCamNextAt.y = (Math_SinS(this->unk_ABC8 * 0x700) * 15.0f) + 150.0f; if (this->unk_ABC8 == 40) { this->unk_ABC8 = 0; this->csState = 2; - this->csCamNextEye.x = -30.0f; - this->csCamNextEye.y = 120.0f; - this->csCamNextEye.z = 110.0f; - this->csCamNextAt.x = -70.0f; - this->csCamNextAt.y = 150.0f; - this->csCamNextAt.z = -20.0f; + this->subCamNextEye.x = -30.0f; + this->subCamNextEye.y = 120.0f; + this->subCamNextEye.z = 110.0f; + this->subCamNextAt.x = -70.0f; + this->subCamNextAt.y = 150.0f; + this->subCamNextAt.z = -20.0f; this->unk_17E8 = 1.0f; this->unk_17EC = 0.4f; Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationPumpingUpAnim, -5.0f); @@ -3141,12 +3198,12 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { if (this->unk_ABC8 == 40) { this->unk_ABC8 = 0; this->csState = 3; - this->csCamNextEye.x = 30.0f; - this->csCamNextEye.y = 120.0f; - this->csCamNextEye.z = 110.0f; - this->csCamNextAt.x = 50.0f; - this->csCamNextAt.y = 150.0f; - this->csCamNextAt.z = -20.0f; + this->subCamNextEye.x = 30.0f; + this->subCamNextEye.y = 120.0f; + this->subCamNextEye.z = 110.0f; + this->subCamNextAt.x = 50.0f; + this->subCamNextAt.y = 150.0f; + this->subCamNextAt.z = -20.0f; this->unk_17E8 = 1.0f; this->unk_17EC = 0.4f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_PUMP_UP_OLD); @@ -3158,12 +3215,12 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { if (this->unk_ABC8 == 40) { this->unk_ABC8 = 0; this->csState = 4; - this->csCamNextEye.x = 0.0f; - this->csCamNextEye.y = 90.0f; - this->csCamNextEye.z = 110.0f; - this->csCamNextAt.x = 0.0f; - this->csCamNextAt.y = 90.0f; - this->csCamNextAt.z = 0.0f; + this->subCamNextEye.x = 0.0f; + this->subCamNextEye.y = 90.0f; + this->subCamNextEye.z = 110.0f; + this->subCamNextAt.x = 0.0f; + this->subCamNextAt.y = 90.0f; + this->subCamNextAt.z = 0.0f; this->unk_17E8 = 1.0f; this->unk_17EC = 0.4f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_PUMP_UP_OLD); @@ -3177,15 +3234,15 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { } if (this->unk_ABC8 == 40) { Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, this->csCamIndex, MAJORA_WRATH); + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, this->subCamIndex, MAJORA_WRATH); Actor_MarkForDeath(&this->actor); } break; } Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY); - Matrix_MultVec3f(&this->csCamNextEye, &this->csCamEye); - Matrix_MultVec3f(&this->csCamNextAt, &this->csCamAt); + Matrix_MultVec3f(&this->subCamNextEye, &this->subCamEye); + Matrix_MultVec3f(&this->subCamNextAt, &this->subCamAt); if (sp4B == 1) { this->unk_17E0 = (Math_SinS(this->unk_ABC8 * 0x3000) * this->unk_17EC) + this->unk_17E8; Math_ApproachF(&this->unk_17E8, 2.0f, 1.0f, 0.05f); @@ -3197,9 +3254,9 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { } this->unk_17F0 = (Math_SinS(this->unk_ABC8 * 0x2000) * 0.1f) + 1.0f; this->unk_17F4 = (Math_CosS(this->unk_ABC8 * 0x2000) * 0.1f) + 1.0f; - if (this->csCamIndex != 0) { + if (this->subCamIndex != 0) { ShrinkWindow_SetLetterboxTarget(0x1B); - Play_SetCameraAtEye(play, this->csCamIndex, &this->csCamAt, &this->csCamEye); + Play_SetCameraAtEye(play, this->subCamIndex, &this->subCamAt, &this->subCamEye); } } @@ -3478,7 +3535,7 @@ void Boss07_Mask_Idle(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&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 <= 8) && (player->transformation != 0) && (Rand_ZeroOne() < 0.75f)) { + if (((s8)this->actor.colChkInfo.health <= 8) && (player->transformation != PLAYER_FORM_FIERCE_DEITY) && (Rand_ZeroOne() < 0.75f)) { Boss07_Mask_SetupBeam(this, play); } else { Boss07_Mask_SetupSpin(this, play); @@ -3487,16 +3544,16 @@ void Boss07_Mask_Idle(Boss07* this, PlayState* play) { this->unk_18C = 2.0f; this->timers[0] = Rand_ZeroFloat(50.0f) + 30.0f; } else { - func_809F4D10(&this->unk_164, 500.0f); - this->unk_164.y = Rand_ZeroFloat(350.0f) + 100.0f; + Boss07_RandVec3fXZ(&this->moveTarget, 500.0f); + this->moveTarget.y = Rand_ZeroFloat(350.0f) + 100.0f; this->timers[0] = Rand_ZeroFloat(50.0f) + 20.0f; this->unk_170 = 0.0f; this->unk_18C = Rand_ZeroFloat(12.0f) + 3.0f; } } - sp30 = this->unk_164.x - this->actor.world.pos.x; - sp2C = this->unk_164.y - this->actor.world.pos.y; - sp28 = this->unk_164.z - this->actor.world.pos.z; + sp30 = this->moveTarget.x - this->actor.world.pos.x; + sp2C = this->moveTarget.y - this->actor.world.pos.y; + sp28 = this->moveTarget.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->actionTimer * 0x1388) * 4000.0f); @@ -3526,7 +3583,7 @@ void Boss07_Mask_Idle(Boss07* this, PlayState* play) { void Boss07_Mask_SetupSpin(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Mask_Spin; - this->actionState = 0; + this->actionState = MAJORAS_MASK_SPIN_STATE_0; this->csState = 0; this->timers[0] = 30; this->unk_18D4 = 0; @@ -3544,13 +3601,13 @@ void Boss07_Mask_Spin(Boss07* this, PlayState* play) { this->actor.shape.rot.z -= this->unk_18D4; switch (this->actionState) { - case 0: + case MAJORAS_MASK_SPIN_STATE_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->actionState = 1; + this->actionState = MAJORAS_MASK_SPIN_STATE_1; this->actor.world.rot.x = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->timers[0] = 100; @@ -3558,19 +3615,19 @@ void Boss07_Mask_Spin(Boss07* this, PlayState* play) { this->unk_170 = 0.0f; } break; - case 1: + case MAJORAS_MASK_SPIN_STATE_1: Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 0xA, 0x400); Math_ApproachS(&this->unk_18D4, 0x2000, 1, 0x200); if (this->timers[1] != 0) { - this->unk_164.x = player->actor.world.pos.x; - this->unk_164.y = player->actor.world.pos.y + 10.0f; - this->unk_164.z = player->actor.world.pos.z; + this->moveTarget.x = player->actor.world.pos.x; + this->moveTarget.y = player->actor.world.pos.y + 10.0f; + this->moveTarget.z = player->actor.world.pos.z; } else { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_ROLLING_OLD - SFX_FLAG); } - sp30 = this->unk_164.x - this->actor.world.pos.x; - sp2C = this->unk_164.y - this->actor.world.pos.y; - sp28 = this->unk_164.z - this->actor.world.pos.z; + sp30 = this->moveTarget.x - this->actor.world.pos.x; + sp2C = this->moveTarget.y - this->actor.world.pos.y; + sp28 = this->moveTarget.z - this->actor.world.pos.z; sp34 = Math_Atan2S(sp30, sp28); sp24 = sqrtf(SQ(sp30) + SQ(sp28)); sp36 = Math_Atan2S(sp2C, sp24); @@ -3580,11 +3637,11 @@ void Boss07_Mask_Spin(Boss07* this, PlayState* play) { 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->actionState = 2; + this->actionState = MAJORAS_MASK_SPIN_STATE_2; this->timers[0] = 30; } else { - func_809F4D10(&this->unk_164, 500.0f); - this->unk_164.y = Rand_ZeroFloat(100.0f) + 100.0f; + Boss07_RandVec3fXZ(&this->moveTarget, 500.0f); + this->moveTarget.y = Rand_ZeroFloat(100.0f) + 100.0f; if (Rand_ZeroOne() < 0.3f) { this->timers[1] = 20; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_ATTACK_2ND_OLD); @@ -3598,7 +3655,7 @@ void Boss07_Mask_Spin(Boss07* this, PlayState* play) { } } break; - case 2: + case MAJORAS_MASK_SPIN_STATE_2: Math_ApproachS(&this->unk_18D4, 0, 1, 0x100); Math_ApproachS(&this->actor.world.rot.x, 0x2000, 0xA, 0x7D0); Boss07_SmoothStop(this, 0.5f); @@ -3690,9 +3747,9 @@ void Boss07_Mask_Damaged(Boss07* this, PlayState* play) { Audio_StopSfxByPos(&this->actor.projectedPos); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_DEAD_OLD); } else { - this->unk_164.x = this->actor.world.pos.x; - this->unk_164.y = 200.0f; - this->unk_164.z = this->actor.world.pos.z; + this->moveTarget.x = this->actor.world.pos.x; + this->moveTarget.y = 200.0f; + this->moveTarget.z = this->actor.world.pos.z; this->actor.world.rot.x = 0x3000; this->timers[0] = 50; this->timers[2] = 100; @@ -3702,7 +3759,7 @@ void Boss07_Mask_Damaged(Boss07* this, PlayState* play) { } } -void func_80A006D0(Boss07* this) { +void Boss07_Mask_ClearBeam(Boss07* this) { this->unk_188C = 0.0f; this->unk_1890 = 0.0f; this->unk_1894 = 0.0f; @@ -3712,7 +3769,7 @@ void func_80A006D0(Boss07* this) { void Boss07_Mask_SetupBeam(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Mask_Beam; - this->actionState = 0; + this->actionState = MAJORAS_MASK_BEAM_STATE_0; this->timers[0] = 30; this->unk_170 = 0.0f; } @@ -3752,35 +3809,35 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Math_ApproachF(&this->unk_170, 4000.0f, 1.0f, 200.0f); this->unk_1874 = 1; switch (this->actionState) { - case 0: + case MAJORAS_MASK_BEAM_STATE_0: if (this->timers[0] == 25) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST1_BLOW_OLD); } if (this->timers[0] == 0) { - this->actionState = 1; + this->actionState = MAJORAS_MASK_BEAM_STATE_1; this->timers[0] = 6; this->unk_1898 = 1.0f; } break; - case 1: + case MAJORAS_MASK_BEAM_STATE_1: Math_ApproachF(&this->unk_188C, 1.0f, 1.0f, 0.2f); if (this->timers[0] == 0) { - this->actionState = 2; + this->actionState = MAJORAS_MASK_BEAM_STATE_2; this->timers[0] = 8; } break; - case 2: + case MAJORAS_MASK_BEAM_STATE_2: 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->actionState = 3; + this->actionState = MAJORAS_MASK_BEAM_STATE_3; this->timers[0] = 100; } break; - case 3: - case 4: + case MAJORAS_MASK_BEAM_STATE_3: + case MAJORAS_MASK_BEAM_STATE_4: play_sound(NA_SE_EN_LAST1_BEAM_OLD - SFX_FLAG); - case 5: + case MAJORAS_MASK_BEAM_STATE_5: Math_ApproachF(&this->unk_1890, 1.0f, 0.2f, 0.2f); temp_f20 = player->actor.world.pos.x - this->unk_189C.x; temp_f12 = player->actor.world.pos.y - this->unk_189C.y + 20.0f; @@ -3790,7 +3847,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { if (BgCheck_EntityLineTest1(&play->colCtx, &this->unk_189C, &this->unk_18A8, &sp14C, &sp158, 1, 1, 1, 1, &sp144) && - (this->actionState != 5)) { + (this->actionState != MAJORAS_MASK_BEAM_STATE_5)) { Vec3f sp138; Vec3f sp12C; Vec3f sp120; @@ -3825,8 +3882,8 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Matrix_MtxFToYXZRot(&player->shieldMf, &sp118, 0); sp118.y += 0x8000; sp118.x = -sp118.x; - if (this->actionState == 3) { - this->actionState = 4; + if (this->actionState == MAJORAS_MASK_BEAM_STATE_3) { + this->actionState = MAJORAS_MASK_BEAM_STATE_4; this->unk_18C4 = sp118.x; this->unk_18C6 = sp118.y; } else { @@ -3846,7 +3903,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Matrix_Push(); Matrix_MultVec3f(&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->actionState != 5)) { + (sp160.z <= (this->unk_18C0 * 16.666668f)) && (this->actionState != MAJORAS_MASK_BEAM_STATE_5)) { s32 phi_s0_2; Vec3f sp108; Vec3f spFC; @@ -3872,7 +3929,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Audio_StopSfxByPos(&this->actor.projectedPos); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_DAMAGE2_OLD); Boss07_Mask_SetupDamaged(this, play, 2, NULL); - func_80A006D0(this); + Boss07_Mask_ClearBeam(this); for (phi_s0_2 = 0; phi_s0_2 < 20; phi_s0_2++) { sp108.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(50.0f); sp108.y = this->actor.world.pos.y + randPlusMinusPoint5Scaled(50.0f); @@ -3894,7 +3951,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { } Matrix_Pop(); for (sp178 = 0; sp178 < ARRAY_COUNT(sBossRemains); sp178++) { - if (sBossRemains[sp178]->actionState >= 2) { + if (sBossRemains[sp178]->actionState >= MAJORAS_REMAINS_STATE_2) { continue; } sp16C.x = sBossRemains[sp178]->actor.world.pos.x - this->unk_18A8.x; @@ -3903,7 +3960,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { sp180 = sqrtf(SQXYZ(sp16C)); Matrix_MultVec3f(&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->actionState != 5)) { + (sp160.z <= (this->unk_18C0 * 16.666668f)) && (this->actionState != MAJORAS_MASK_BEAM_STATE_5)) { s32 pad; Vec3f spE0; Vec3f spD4; @@ -3925,7 +3982,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Boss07_SpawnEffect(play, &spE0, &spD4, &spC8, Rand_ZeroFloat(10.0f) + 25.0f); sBossRemains[sp178]->unk_15E |= 0xA; } else { - sBossRemains[sp178]->actionState = 2; + sBossRemains[sp178]->actionState = MAJORAS_REMAINS_STATE_2; sBossRemains[sp178]->unk_18D6 = 60; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FOLLOWERS_DEAD); for (pad = 0; pad < 20; pad++) { @@ -3949,7 +4006,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { } if (BgCheck_EntityLineTest1(&play->colCtx, &this->unk_18A8, &this->unk_18B4, &sp14C, &sp158, 1, 1, 1, 1, &sp144) && - (this->actionState != 5)) { + (this->actionState != MAJORAS_MASK_BEAM_STATE_5)) { Vec3f spBC; Vec3f spB0; Vec3f spA4; @@ -3968,7 +4025,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Boss07_SpawnEffect(play, &spBC, &spB0, &spA4, Rand_ZeroFloat(10.0f) + 25.0f); } } - } else if (!player->isBurning && (this->actionState != 5)) { + } else if (!player->isBurning && (this->actionState != MAJORAS_MASK_BEAM_STATE_5)) { s32 pad2; func_800B8D50(play, &this->actor, 5.0f, this->actor.shape.rot.y, 0.0f, 0x10); @@ -3989,9 +4046,9 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { } this->unk_18E0 = sp14C; } - if (this->actionState != 5) { + if (this->actionState != MAJORAS_MASK_BEAM_STATE_5) { if (this->timers[0] == 0) { - this->actionState = 5; + this->actionState = MAJORAS_MASK_BEAM_STATE_5; this->timers[0] = 20; } } else { @@ -3999,7 +4056,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { if (this->timers[0] == 0) { Boss07_Mask_SetupIdle(this, play); this->timers[2] = 100; - func_80A006D0(this); + Boss07_Mask_ClearBeam(this); } } break; @@ -4040,47 +4097,49 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { this->actor.world.pos.x = 0.0f; this->actor.world.pos.y = 277.0f; this->actor.world.pos.z = -922.5f; - if ((player->actor.world.pos.z < 700.0f) && (ActorCutscene_GetCurrentIndex() == -1)) { - Cutscene_Start(play, &play->csCtx); - func_800B7298(play, &this->actor, 7); - this->csCamIndex = Play_CreateSubCamera(play); - Play_ChangeCameraStatus(play, 0, 1); - Play_ChangeCameraStatus(play, this->csCamIndex, 7); - this->unk_ABC8 = 0; - this->csState = 1; - this->unk_160 = KREG(76) + 150; - case 1: - if (this->unk_ABC8 >= 20) { - func_8019F128(NA_SE_EV_LIGHT_GATHER - SFX_FLAG); - Math_ApproachF(&sMajoraStatic->unk_AB44, sREG(50) + 1.0f, 0.05f, sREG(51) + 0.05f); - } - if (this->unk_ABC8 == 35) { - func_800B7298(play, &this->actor, 0xF); - } - player->actor.world.pos.x = 0.0f; - player->actor.world.pos.z = 700.0f; - player->actor.shape.rot.y = -0x8000; - player->actor.world.rot.y = player->actor.shape.rot.y; - this->csCamEye.x = 0.0f; - this->csCamEye.y = Player_GetHeight(player) + player->actor.world.pos.y - 24.0f; - this->csCamEye.z = player->actor.world.pos.z - 60.0f; - this->csCamAt.x = player->actor.world.pos.x; - this->csCamAt.y = Player_GetHeight(player) + player->actor.world.pos.y - 20.0f; - this->csCamAt.z = player->actor.world.pos.z; - if (player->transformation == PLAYER_FORM_FIERCE_DEITY) { - this->csCamAt.y -= 30.0f; - } - if (this->unk_ABC8 == 75) { - this->unk_ABC8 = 0; - this->csState = 2; - this->csCamEye.x = player->actor.world.pos.x; - this->csCamEye.y = player->actor.world.pos.y + 20.0f; - this->csCamEye.z = player->actor.world.pos.z - 60.0f + 120.0f; - this->csCamAt.x = player->actor.world.pos.x; - this->csCamAt.y = player->actor.world.pos.y + 24.0f + 5.0f; - this->csCamAt.z = player->actor.world.pos.z; - } + if (!((player->actor.world.pos.z < 700.0f) && (ActorCutscene_GetCurrentIndex() == -1))) { + break; } + Cutscene_Start(play, &play->csCtx); + func_800B7298(play, &this->actor, 7); + this->subCamIndex = Play_CreateSubCamera(play); + Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); + Play_ChangeCameraStatus(play, this->subCamIndex, CAM_STATUS_ACTIVE); + this->unk_ABC8 = 0; + this->csState = 1; + this->unk_160 = KREG(76) + 150; + case 1: + if (this->unk_ABC8 >= 20) { + func_8019F128(NA_SE_EV_LIGHT_GATHER - SFX_FLAG); + Math_ApproachF(&sMajoraStatic->unk_AB44, sREG(50) + 1.0f, 0.05f, sREG(51) + 0.05f); + } + if (this->unk_ABC8 == 35) { + func_800B7298(play, &this->actor, 0xF); + } + player->actor.world.pos.x = 0.0f; + player->actor.world.pos.z = 700.0f; + player->actor.shape.rot.y = -0x8000; + player->actor.world.rot.y = player->actor.shape.rot.y; + this->subCamEye.x = 0.0f; + this->subCamEye.y = Player_GetHeight(player) + player->actor.world.pos.y - 24.0f; + this->subCamEye.z = player->actor.world.pos.z - 60.0f; + this->subCamAt.x = player->actor.world.pos.x; + this->subCamAt.y = Player_GetHeight(player) + player->actor.world.pos.y - 20.0f; + this->subCamAt.z = player->actor.world.pos.z; + if (player->transformation == PLAYER_FORM_FIERCE_DEITY) { + this->subCamAt.y -= 30.0f; + } + if (this->unk_ABC8 == 75) { + this->unk_ABC8 = 0; + this->csState = 2; + this->subCamEye.x = player->actor.world.pos.x; + this->subCamEye.y = player->actor.world.pos.y + 20.0f; + this->subCamEye.z = player->actor.world.pos.z - 60.0f + 120.0f; + this->subCamAt.x = player->actor.world.pos.x; + this->subCamAt.y = player->actor.world.pos.y + 24.0f + 5.0f; + this->subCamAt.z = player->actor.world.pos.z; + } + break; case 2: this->unk_160 = KREG(77) + 150; @@ -4088,10 +4147,10 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { Math_ApproachZeroF(&sMajoraStatic->unk_AB44, 1.0f, 0.05f); } if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_ODOLWA]->actionState = 1; - sBossRemains[REMAINS_GYORG]->actionState = 1; - sBossRemains[REMAINS_GOHT]->actionState = 1; - sBossRemains[REMAINS_TWINMOLD]->actionState = 1; + sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_STATE_1; + sBossRemains[REMAINS_GYORG]->actionState = MAJORAS_REMAINS_STATE_1; + sBossRemains[REMAINS_GOHT]->actionState = MAJORAS_REMAINS_STATE_1; + sBossRemains[REMAINS_TWINMOLD]->actionState = MAJORAS_REMAINS_STATE_1; } if (this->unk_ABC8 == 0) { func_800B7298(play, &this->actor, 7); @@ -4100,43 +4159,43 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { func_800B7298(play, &this->actor, 0x15); } if (this->unk_ABC8 >= 0x1FU) { - Math_ApproachF(&this->csCamAt.y, player->actor.world.pos.y + 24.0f + 20.0f, 0.05f, this->csCamSpeedMod); - Math_ApproachF(&this->csCamSpeedMod, 1.0f, 1.0f, 0.01f); + Math_ApproachF(&this->subCamAt.y, player->actor.world.pos.y + 24.0f + 20.0f, 0.05f, this->subCamSpeedMod); + Math_ApproachF(&this->subCamSpeedMod, 1.0f, 1.0f, 0.01f); } if (this->unk_ABC8 >= 160) { if (this->unk_ABC8 == 160) { - sBossRemains[REMAINS_ODOLWA]->actionState = 2; - sBossRemains[REMAINS_GYORG]->actionState = 2; - sBossRemains[REMAINS_GOHT]->actionState = 2; - sBossRemains[REMAINS_TWINMOLD]->actionState = 2; + sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_STATE_2; + sBossRemains[REMAINS_GYORG]->actionState = MAJORAS_REMAINS_STATE_2; + sBossRemains[REMAINS_GOHT]->actionState = MAJORAS_REMAINS_STATE_2; + sBossRemains[REMAINS_TWINMOLD]->actionState = MAJORAS_REMAINS_STATE_2; } if (this->unk_ABC8 == 161) { - sBossRemains[REMAINS_ODOLWA]->actionState = 3; + sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_STATE_3; } if ((this->unk_ABC8 == 180) || (this->unk_ABC8 == 200) || (this->unk_ABC8 == 220)) { this->unk_ABCC++; - sBossRemains[this->unk_ABCC]->actionState = 3; + sBossRemains[this->unk_ABCC]->actionState = MAJORAS_REMAINS_STATE_3; } - this->csCamEye.x = sIntroCamEyes[this->unk_ABCC].x; - this->csCamEye.y = sIntroCamEyes[this->unk_ABCC].y; - this->csCamEye.z = sIntroCamEyes[this->unk_ABCC].z; - this->csCamAt.x = sIntroCamAts[this->unk_ABCC].x; - this->csCamAt.y = sIntroCamAts[this->unk_ABCC].y; - this->csCamAt.z = sIntroCamAts[this->unk_ABCC].z; + this->subCamEye.x = sIntroCamEyes[this->unk_ABCC].x; + this->subCamEye.y = sIntroCamEyes[this->unk_ABCC].y; + this->subCamEye.z = sIntroCamEyes[this->unk_ABCC].z; + this->subCamAt.x = sIntroCamAts[this->unk_ABCC].x; + this->subCamAt.y = sIntroCamAts[this->unk_ABCC].y; + this->subCamAt.z = sIntroCamAts[this->unk_ABCC].z; if (this->unk_ABC8 == 250) { this->csState = 3; this->unk_ABC8 = 0; - this->csCamEye.x = this->actor.world.pos.x; - this->csCamEye.y = this->actor.world.pos.y; - this->csCamEye.z = 300.0f; - this->csCamAt.x = this->actor.world.pos.x; - this->csCamAt.y = this->actor.world.pos.y; - this->csCamAt.z = this->actor.world.pos.z; + this->subCamEye.x = this->actor.world.pos.x; + this->subCamEye.y = this->actor.world.pos.y; + this->subCamEye.z = 300.0f; + this->subCamAt.x = this->actor.world.pos.x; + this->subCamAt.y = this->actor.world.pos.y; + this->subCamAt.z = this->actor.world.pos.z; Boss07_Remains_SetupFly(sBossRemains[REMAINS_ODOLWA], play); Boss07_Remains_SetupFly(sBossRemains[REMAINS_GYORG], play); Boss07_Remains_SetupFly(sBossRemains[REMAINS_GOHT], play); Boss07_Remains_SetupFly(sBossRemains[REMAINS_TWINMOLD], play); - this->csCamSpeedMod = 0.0f; + this->subCamSpeedMod = 0.0f; sMajoraStatic->unk_AB44 = 0.0f; Audio_QueueSeqCmd(NA_BGM_STOP | 0xA0000); } @@ -4145,7 +4204,7 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { case 3: this->unk_160 = KREG(78) + 150; if (this->unk_ABC8 >= 15) { - Math_ApproachF(&this->csCamEye.z, -700.0f, 0.4f, 100.0f); + Math_ApproachF(&this->subCamEye.z, -700.0f, 0.4f, 100.0f); } if (this->unk_ABC8 >= 55) { if (this->unk_ABC8 == 55) { @@ -4179,9 +4238,9 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { if (this->unk_ABC8 == 110) { this->csState = 4; this->unk_ABC8 = 0; - this->csCamEye.x = this->actor.world.pos.x + 200.0f; - this->csCamEye.y = this->actor.world.pos.y; - this->csCamEye.z = this->actor.world.pos.z + 400.0f; + this->subCamEye.x = this->actor.world.pos.x + 200.0f; + this->subCamEye.y = this->actor.world.pos.y; + this->subCamEye.z = this->actor.world.pos.z + 400.0f; player->actor.world.pos.z = 0.0f; func_800B7298(play, &this->actor, 1); this->unk_160 = KREG(74) + 200; @@ -4207,13 +4266,13 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { Audio_QueueSeqCmd(NA_BGM_MAJORAS_MASK | 0x8000); } if (this->unk_ABC8 > 100) { - Math_ApproachF(&this->csCamEye.x, player->actor.world.pos.x + 40.0f, 0.1f, - this->csCamSpeedMod * 20.0f); - Math_ApproachF(&this->csCamEye.y, player->actor.world.pos.y + 10.0f, 0.1f, - this->csCamSpeedMod * 20.0f); - Math_ApproachF(&this->csCamEye.z, player->actor.world.pos.z + 90.0f, 0.1f, - this->csCamSpeedMod * 60.0f); - Math_ApproachF(&this->csCamSpeedMod, 1.0f, 1.0f, 0.03f); + Math_ApproachF(&this->subCamEye.x, player->actor.world.pos.x + 40.0f, 0.1f, + this->subCamSpeedMod * 20.0f); + Math_ApproachF(&this->subCamEye.y, player->actor.world.pos.y + 10.0f, 0.1f, + this->subCamSpeedMod * 20.0f); + Math_ApproachF(&this->subCamEye.z, player->actor.world.pos.z + 90.0f, 0.1f, + this->subCamSpeedMod * 60.0f); + Math_ApproachF(&this->subCamSpeedMod, 1.0f, 1.0f, 0.03f); } if (this->unk_ABC8 == 175) { Camera* sp5C = Play_GetCamera(play, 0); @@ -4223,15 +4282,15 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { this->timers[0] = 50; this->timers[2] = 200; this->unk_1888 = 50; - this->unk_164.x = 0.0f; - this->unk_164.y = 200.0f; - this->unk_164.z = 0.0f; + this->moveTarget.x = 0.0f; + this->moveTarget.y = 200.0f; + this->moveTarget.z = 0.0f; this->unk_170 = 0.0f; - sp5C->eye = this->csCamEye; - sp5C->eyeNext = this->csCamEye; - sp5C->at = this->csCamAt; - func_80169AFC(play, this->csCamIndex, 0); - this->csCamIndex = 0; + sp5C->eye = this->subCamEye; + sp5C->eyeNext = this->subCamEye; + sp5C->at = this->subCamAt; + func_80169AFC(play, this->subCamIndex, 0); + this->subCamIndex = 0; Cutscene_End(play, &play->csCtx); func_800B7298(play, &this->actor, 6); this->actor.flags |= 1; @@ -4243,19 +4302,19 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { } else { this->actor.world.pos.x -= 2.0f; } - Math_ApproachF(&this->csCamAt.x, this->actor.world.pos.x, 0.05f, 10.0f); - Math_ApproachF(&this->csCamAt.y, this->actor.world.pos.y, 0.05f, 10.0f); - Math_ApproachF(&this->csCamAt.z, this->actor.world.pos.z, 0.05f, 10.0f); + Math_ApproachF(&this->subCamAt.x, this->actor.world.pos.x, 0.05f, 10.0f); + Math_ApproachF(&this->subCamAt.y, this->actor.world.pos.y, 0.05f, 10.0f); + Math_ApproachF(&this->subCamAt.z, this->actor.world.pos.z, 0.05f, 10.0f); break; } - if (this->csCamIndex != 0) { + if (this->subCamIndex != 0) { Vec3f sp50; ShrinkWindow_SetLetterboxTarget(0x1B); - sp50.x = this->csCamAt.x; - sp50.y = this->csCamAt.y + sp8C; - sp50.z = this->csCamAt.z; - Play_SetCameraAtEye(play, this->csCamIndex, &sp50, &this->csCamEye); + sp50.x = this->subCamAt.x; + sp50.y = this->subCamAt.y + sp8C; + sp50.z = this->subCamAt.z; + Play_SetCameraAtEye(play, this->subCamIndex, &sp50, &this->subCamEye); } } @@ -4290,21 +4349,21 @@ void Boss07_Mask_Death(Boss07* this, PlayState* play) { if (ActorCutscene_GetCurrentIndex() == -1) { Cutscene_Start(play, &play->csCtx); func_800B7298(play, &this->actor, 1U); - this->csCamIndex = Play_CreateSubCamera(play); + this->subCamIndex = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, 0, 1); - Play_ChangeCameraStatus(play, this->csCamIndex, 7); + Play_ChangeCameraStatus(play, this->subCamIndex, 7); this->unk_ABC8 = 0; this->csState = 1; - this->csCamNextAt.z = 0.0f; + this->subCamNextAt.z = 0.0f; this->unk_18D6 = 120; func_8016566C(150); - this->csCamNextEye.x = 0.0f; - this->csCamNextEye.y = -30.0f; - this->csCamNextEye.z = 270.0f; - this->csCamNextAt.x = 0.0f; - this->csCamNextAt.y = -30.0f; - Matrix_MultVec3f(&this->csCamNextEye, &this->csCamEye); - Matrix_MultVec3f(&this->csCamNextAt, &this->csCamAt); + this->subCamNextEye.x = 0.0f; + this->subCamNextEye.y = -30.0f; + this->subCamNextEye.z = 270.0f; + this->subCamNextAt.x = 0.0f; + this->subCamNextAt.y = -30.0f; + Matrix_MultVec3f(&this->subCamNextEye, &this->subCamEye); + Matrix_MultVec3f(&this->subCamNextAt, &this->subCamAt); } else { break; } @@ -4330,23 +4389,23 @@ void Boss07_Mask_Death(Boss07* this, PlayState* play) { } case 2: Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, 0.0f, 0.0f, 0.0f, 0, this->actor.shape.rot.y, - this->csCamIndex, MAJORA_INCARNATION); + this->subCamIndex, MAJORA_INCARNATION); Actor_MarkForDeath(&this->actor); break; } - Matrix_MultVec3f(&this->csCamNextEye, &this->csCamEye); - Matrix_MultVec3f(&this->csCamNextAt, &sp60); - Math_ApproachF(&this->csCamAt.x, sp60.x, 0.1f, 10.0f); - Math_ApproachF(&this->csCamAt.y, sp60.y, 0.1f, 10.0f); - Math_ApproachF(&this->csCamAt.z, sp60.z, 0.1f, 10.0f); - if (this->csCamIndex != 0) { + Matrix_MultVec3f(&this->subCamNextEye, &this->subCamEye); + Matrix_MultVec3f(&this->subCamNextAt, &sp60); + Math_ApproachF(&this->subCamAt.x, sp60.x, 0.1f, 10.0f); + Math_ApproachF(&this->subCamAt.y, sp60.y, 0.1f, 10.0f); + Math_ApproachF(&this->subCamAt.z, sp60.z, 0.1f, 10.0f); + if (this->subCamIndex != 0) { ShrinkWindow_SetLetterboxTarget(0x1B); - sp54 = this->csCamEye; + sp54 = this->subCamEye; if (sp54.y < 30.0f) { sp54.y = 30.0f; } - Play_SetCameraAtEye(play, this->csCamIndex, &this->csCamAt, &sp54); + Play_SetCameraAtEye(play, this->subCamIndex, &this->subCamAt, &sp54); } } @@ -4403,7 +4462,7 @@ void Boss07_Mask_Update(Actor* thisx, PlayState* play2) { } } Math_Vec3f_Copy(&sSfxPoint, &this->actor.projectedPos); - if ((sMajoraStatic == NULL) || (sMajoraStatic->csCamIndex == 0)) { + if ((sMajoraStatic == NULL) || (sMajoraStatic->subCamIndex == 0)) { this->unk_149 = true; play->envCtx.unk_C1 = 2; play->envCtx.unk_C2 = 0; @@ -4803,7 +4862,7 @@ void Boss07_Projectile_Update(Actor* thisx, PlayState* play2) { } if (KREG(63) == 0) { Actor_SetScale(&this->actor, 3.5f); - if (this->actionState == 0) { + if (this->actionState == MAJORAS_PROJECTILE_STATE_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; @@ -4811,7 +4870,7 @@ void Boss07_Projectile_Update(Actor* thisx, PlayState* play2) { 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->actionState = 1; + this->actionState = MAJORAS_PROJECTILE_STATE_1; this->actor.speedXZ = 30.0f; func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); if (this->actor.params == MAJORA_INCARNATION_SHOT) { @@ -4876,12 +4935,12 @@ void Boss07_Remains_CollisionCheck(Boss07* this, PlayState* play) { this->unk_15E = 15; this->actionFunc = Boss07_Remains_Fly; if ((s8)this->actor.colChkInfo.health <= 0) { - this->actionState = 2; + this->actionState = MAJORAS_REMAINS_STATE_2; this->unk_18DA = 1; Enemy_StartFinishingBlow(play, &this->actor); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FOLLOWERS_DEAD); } else { - this->actionState = 0xA; + this->actionState = MAJORAS_REMAINS_STATE_10; this->timers[0] = 0xF; Boss07_Remains_DamageSfx(this); } @@ -4920,12 +4979,12 @@ void Boss07_Remains_Intro(Boss07* this, PlayState* play) { 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; - this->unk_164.y = sRemainsStart[this->actor.params - MAJORA_REMAINS].y + player->actor.world.pos.y; - this->unk_164.z = sRemainsStart[this->actor.params - MAJORA_REMAINS].z + player->actor.world.pos.z; - sp54 = this->unk_164.x - this->actor.world.pos.x; - sp50 = this->unk_164.y - this->actor.world.pos.y; - sp4C = this->unk_164.z - this->actor.world.pos.z; + this->moveTarget.x = sRemainsStart[this->actor.params - MAJORA_REMAINS].x + player->actor.world.pos.x; + this->moveTarget.y = sRemainsStart[this->actor.params - MAJORA_REMAINS].y + player->actor.world.pos.y; + this->moveTarget.z = sRemainsStart[this->actor.params - MAJORA_REMAINS].z + player->actor.world.pos.z; + sp54 = this->moveTarget.x - this->actor.world.pos.x; + sp50 = this->moveTarget.y - this->actor.world.pos.y; + sp4C = this->moveTarget.z - this->actor.world.pos.z; this->actor.world.rot.y = Math_Atan2S(sp54, sp4C); this->actor.world.rot.x = Math_Atan2S(sp50, sqrtf(SQ(sp54) + SQ(sp4C))); this->unk_AB40 = Rand_ZeroFloat(100.0f); @@ -4938,9 +4997,9 @@ void Boss07_Remains_Intro(Boss07* this, PlayState* play) { Math_ApproachF(&this->actor.scale.x, 0.004f, 0.5f, 0.0002f); this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; if (this->unk_ABC8 > 90) { - this->unk_164.x = sRemainsEnd[this->actor.params - MAJORA_REMAINS].x; - this->unk_164.y = 370.0f; - this->unk_164.z = sRemainsEnd[this->actor.params - MAJORA_REMAINS].z; + this->moveTarget.x = sRemainsEnd[this->actor.params - MAJORA_REMAINS].x; + this->moveTarget.y = 370.0f; + this->moveTarget.z = sRemainsEnd[this->actor.params - MAJORA_REMAINS].z; sp38 = 20.0f; sp34 = 0.5f; sp40 = 4096.0f; @@ -4953,9 +5012,9 @@ void Boss07_Remains_Intro(Boss07* this, PlayState* play) { sp40 = 1500.0f; sp3C = 100.0f; } - sp54 = this->unk_164.x - this->actor.world.pos.x; - sp50 = this->unk_164.y - this->actor.world.pos.y + phi_f2; - sp4C = this->unk_164.z - this->actor.world.pos.z; + sp54 = this->moveTarget.x - this->actor.world.pos.x; + sp50 = this->moveTarget.y - this->actor.world.pos.y + phi_f2; + sp4C = this->moveTarget.z - this->actor.world.pos.z; sp30 = Math_Atan2S(sp54, sp4C); sp32 = Math_Atan2S(sp50, sqrtf(SQ(sp54) + SQ(sp4C))); Math_ApproachS(&this->actor.world.rot.y, sp30, 5, this->unk_170); @@ -4994,7 +5053,7 @@ void Boss07_Remains_SetupFly(Boss07* this, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); Collider_InitAndSetCylinder(play, &this->cyl2, &this->actor, &sRemainsCylInit); this->actor.colChkInfo.health = 5; - this->actionState = 0; + this->actionState = MAJORAS_REMAINS_STATE_0; } void Boss07_Remains_Fly(Boss07* this, PlayState* play) { @@ -5009,13 +5068,13 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { Vec3f sp48; switch (this->actionState) { - case 20: + case MAJORAS_REMAINS_STATE_20: Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MUJURA_FOLLOWERS_FLY - SFX_FLAG); this->timers[0] = 80; this->timers[2] = 100.0f + Rand_ZeroFloat(100.0f); this->unk_18C = 5.0f; this->actor.speedXZ = 5.0f; - this->unk_164 = gZeroVec3f; + this->moveTarget = gZeroVec3f; this->actor.world.rot.y = Math_Atan2S(-this->actor.world.pos.x, -this->actor.world.pos.z); this->actionState = 1; this->unk_1888 = 100; @@ -5023,7 +5082,7 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { this->actor.flags |= 0x201; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_DEMO_BREAK); break; - case 1: + case MAJORAS_REMAINS_STATE_1: Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MUJURA_FOLLOWERS_FLY - SFX_FLAG); if (this->timers[2] == 0) { this->unk_18DB = 1; @@ -5034,16 +5093,16 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { this->unk_18C = 1.0f; this->timers[0] = Rand_ZeroFloat(50.0f) + 30.0f; } else { - func_809F4D10(&this->unk_164, 500.0f); - this->unk_164.y = Rand_ZeroFloat(350.0f) + 100.0f; + Boss07_RandVec3fXZ(&this->moveTarget, 500.0f); + this->moveTarget.y = Rand_ZeroFloat(350.0f) + 100.0f; this->timers[0] = Rand_ZeroFloat(50.0f) + 20.0f; this->unk_170 = 0.0f; this->unk_18C = Rand_ZeroFloat(5.0f) + 5.0f; } } - sp78 = this->unk_164.x - this->actor.world.pos.x; - sp74 = this->unk_164.y - this->actor.world.pos.y; - sp70 = this->unk_164.z - this->actor.world.pos.z; + sp78 = this->moveTarget.x - this->actor.world.pos.x; + sp74 = this->moveTarget.y - this->actor.world.pos.y; + sp70 = this->moveTarget.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->actionTimer * 0x1388) * 4000.0f); @@ -5065,7 +5124,7 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { } Boss07_Remains_CollisionCheck(this, play); break; - case 2: + case MAJORAS_REMAINS_STATE_2: Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 1, 0x500); Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 100.0f, 100.0f, 5); @@ -5084,7 +5143,7 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { this->actor.shape.rot.z += 0x200; } break; - case 10: + case MAJORAS_REMAINS_STATE_10: Actor_MoveWithGravity(&this->actor); this->actor.world.pos.y -= 50.0f; this->actor.prevPos.y -= 50.0f; @@ -5095,10 +5154,10 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { this->actionState = 1; } break; - case 0: + case MAJORAS_REMAINS_STATE_0: break; } - if (this->actionState < 2) { + if (this->actionState < MAJORAS_REMAINS_STATE_2) { Collider_UpdateCylinder(&this->actor, &this->cyl2); CollisionCheck_SetAC(play, &play->colChkCtx, &this->cyl2.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->cyl2.base); @@ -5146,7 +5205,7 @@ void Boss07_Remains_Stunned(Boss07* this, PlayState* play) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->cyl2.base); if (this->timers[0] == 0) { this->actionFunc = Boss07_Remains_Fly; - this->actionState = 1; + this->actionState = MAJORAS_REMAINS_STATE_1; } } @@ -5316,9 +5375,9 @@ void Boss07_Top_Ground(Boss07* this, PlayState* play) { sp48 = this->actor.prevPos.z - this->actor.world.pos.z; func_800AE930(&play->colCtx, Effect_GetByIndex(this->effectIndex), &this->actor.world.pos, 3.0f, Math_Atan2S(sp4C, sp48), this->actor.floorPoly, this->actor.floorBgId); - this->actionState = 1; - } else if (this->actionState != 0) { - this->actionState = 0; + this->actionState = MAJORAS_TOP_STATE_1; + } else if (this->actionState != MAJORAS_TOP_STATE_0) { + this->actionState = MAJORAS_TOP_STATE_0; func_800AEF44(Effect_GetByIndex(this->effectIndex)); } this->actor.shape.rot.y = this->actor.world.rot.y; @@ -5534,84 +5593,84 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { if (ActorCutscene_GetCurrentIndex() == -1) { Cutscene_Start(play, &play->csCtx); func_800B7298(play, &this->actor, 7); - this->csCamIndex = Play_CreateSubCamera(play); + this->subCamIndex = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, 0, 1); - Play_ChangeCameraStatus(play, this->csCamIndex, 7); + Play_ChangeCameraStatus(play, this->subCamIndex, 7); this->unk_ABC8 = 0; this->csState = 2; func_8016566C(150); - this->csCamEye.x = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.x * 0.7f; - this->csCamEye.y = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.y * 0.7f; - this->csCamEye.z = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.z * 0.7f; + this->subCamEye.x = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.x * 0.7f; + this->subCamEye.y = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.y * 0.7f; + this->subCamEye.z = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.z * 0.7f; } else { break; } case 2: if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_ODOLWA]->actionState = 20; + sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_STATE_20; } - this->csCamAt.x = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.x; - this->csCamAt.y = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.y; - this->csCamAt.z = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.z; + this->subCamAt.x = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.x; + this->subCamAt.y = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.y; + this->subCamAt.z = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.z; if (this->unk_ABC8 == 40) { this->csState = 3; this->unk_ABC8 = 0; - this->csCamEye.x = sBossRemains[REMAINS_GYORG]->actor.world.pos.x * 0.7f; - this->csCamEye.y = sBossRemains[REMAINS_GYORG]->actor.world.pos.y * 0.7f; - this->csCamEye.z = sBossRemains[REMAINS_GYORG]->actor.world.pos.z * 0.7f; + this->subCamEye.x = sBossRemains[REMAINS_GYORG]->actor.world.pos.x * 0.7f; + this->subCamEye.y = sBossRemains[REMAINS_GYORG]->actor.world.pos.y * 0.7f; + this->subCamEye.z = sBossRemains[REMAINS_GYORG]->actor.world.pos.z * 0.7f; } else { break; } case 3: if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_GYORG]->actionState = 20; + sBossRemains[REMAINS_GYORG]->actionState = MAJORAS_REMAINS_STATE_20; } - this->csCamAt.x = sBossRemains[REMAINS_GYORG]->actor.world.pos.x; - this->csCamAt.y = sBossRemains[REMAINS_GYORG]->actor.world.pos.y; - this->csCamAt.z = sBossRemains[REMAINS_GYORG]->actor.world.pos.z; + this->subCamAt.x = sBossRemains[REMAINS_GYORG]->actor.world.pos.x; + this->subCamAt.y = sBossRemains[REMAINS_GYORG]->actor.world.pos.y; + this->subCamAt.z = sBossRemains[REMAINS_GYORG]->actor.world.pos.z; if (this->unk_ABC8 == 40) { this->csState = 4; this->unk_ABC8 = 0; - this->csCamEye.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x * 0.7f; - this->csCamEye.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y * 0.7f; - this->csCamEye.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z * 0.7f; + this->subCamEye.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x * 0.7f; + this->subCamEye.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y * 0.7f; + this->subCamEye.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z * 0.7f; } else { break; } case 4: if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_GOHT]->actionState = 20; + sBossRemains[REMAINS_GOHT]->actionState = MAJORAS_REMAINS_STATE_20; } - this->csCamAt.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x; - this->csCamAt.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y; - this->csCamAt.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z; + this->subCamAt.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x; + this->subCamAt.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y; + this->subCamAt.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z; if (this->unk_ABC8 == 40) { this->csState = 5; this->unk_ABC8 = 0; - this->csCamEye.x = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.x * 0.7f; - this->csCamEye.y = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.y * 0.7f; - this->csCamEye.z = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.z * 0.7f; + this->subCamEye.x = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.x * 0.7f; + this->subCamEye.y = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.y * 0.7f; + this->subCamEye.z = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.z * 0.7f; } else { break; } case 5: if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_TWINMOLD]->actionState = 20; + sBossRemains[REMAINS_TWINMOLD]->actionState = MAJORAS_REMAINS_STATE_20; } - this->csCamAt.x = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.x; - this->csCamAt.y = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.y; - this->csCamAt.z = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.z; + this->subCamAt.x = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.x; + this->subCamAt.y = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.y; + this->subCamAt.z = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.z; if (this->unk_ABC8 == 40) { Camera* camera = Play_GetCamera(play, CAM_ID_MAIN); s32 i; this->csState = 6; this->unk_ABC8 = 0; - camera->eye = this->csCamEye; - camera->eyeNext = this->csCamEye; - camera->at = this->csCamAt; - func_80169AFC(play, this->csCamIndex, 0); - this->csCamIndex = 0; + camera->eye = this->subCamEye; + camera->eyeNext = this->subCamEye; + camera->at = this->subCamAt; + func_80169AFC(play, this->subCamIndex, 0); + this->subCamIndex = SUB_CAM_ID_DONE; Cutscene_End(play, &play->csCtx); func_800B7298(play, &this->actor, 6); func_80165690(); @@ -5623,7 +5682,7 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { case 6: break; } - if (this->csCamIndex != 0) { + if (this->subCamIndex != 0) { if (this->unk_ABC8 < 20) { s32 j; @@ -5638,7 +5697,7 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { } } ShrinkWindow_SetLetterboxTarget(27); - Play_SetCameraAtEye(play, this->csCamIndex, &this->csCamAt, &this->csCamEye); + Play_SetCameraAtEye(play, this->subCamIndex, &this->subCamAt, &this->subCamEye); } } @@ -5665,7 +5724,7 @@ void Boss07_Static_UpdateEffects(PlayState* play) { effect->vel.x += effect->accel.x; effect->vel.y += effect->accel.y; effect->vel.z += effect->accel.z; - if (effect->type == MAJORA_EFFECT_1) { + if (effect->type == MAJORA_EFFECT_FLAME) { if (effect->isFading) { effect->alpha -= (i % 8U) + 13; if (effect->alpha <= 0) { 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 82763cc4d..75dadf0cb 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -53,7 +53,7 @@ typedef struct Boss07 { /* 0x015E */ s16 unk_15E; /* 0x0160 */ s16 unk_160; /* 0x0162 */ s16 unk_162; - /* 0x0164 */ Vec3f unk_164; + /* 0x0164 */ Vec3f moveTarget; /* 0x0170 */ f32 unk_170; /* 0x0174 */ u8 unk_174; /* 0x0178 */ f32 unk_178; @@ -151,16 +151,17 @@ typedef struct Boss07 { /* 0xABC8 */ u32 unk_ABC8; /* 0xABCC */ s32 unk_ABCC; /* 0xABD0 */ s16 csState; - /* 0xABD2 */ s16 csCamIndex; - /* 0xABD4 */ Vec3f csCamEye; - /* 0xABE0 */ Vec3f csCamAt; - /* 0xABEC */ Vec3f csCamNextEye; - /* 0xABF8 */ Vec3f csCamNextAt; - /* 0xAC04 */ f32 csCamRotY; - /* 0xAC08 */ f32 csCamRotVel; - /* 0xAC0C */ f32 csCamSpeedMod; - /* 0xAC10 */ Vec3f csCamEyeMod; - /* 0xAC1C */ UNK_TYPE1 unkAC1C[4]; + /* 0xABD2 */ s16 subCamIndex; + /* 0xABD4 */ Vec3f subCamEye; + /* 0xABE0 */ Vec3f subCamAt; + /* 0xABEC */ Vec3f subCamNextEye; + /* 0xABF8 */ Vec3f subCamNextAt; + /* 0xAC04 */ f32 subCamRotY; + /* 0xAC08 */ f32 subCamRotVel; + /* 0xAC0C */ f32 subCamSpeedMod; + /* 0xAC10 */ UNK_TYPE1 unkAC10; + /* 0xAC14 */ f32 subCamEyeModY; + /* 0xAC18 */ UNK_TYPE1 unkAC18[8]; } Boss07; // size = 0xAC20 extern const ActorInit Boss_07_InitVars; From c08238ddc64fd8f9584e7152095b820c5c56ced0 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Mon, 22 Aug 2022 12:41:06 -0500 Subject: [PATCH 23/28] adjust damage stuff --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 783 ++++++++++-------- src/overlays/actors/ovl_Boss_07/z_boss_07.h | 52 +- ..._boss_07_colchk.c => z_boss_07_colchk.inc} | 0 .../actors/ovl_Boss_07/z_boss_07_dmgtbl.c | 176 ---- .../actors/ovl_Boss_07/z_boss_07_dmgtbl.inc | 176 ++++ 5 files changed, 656 insertions(+), 531 deletions(-) rename src/overlays/actors/ovl_Boss_07/{z_boss_07_colchk.c => z_boss_07_colchk.inc} (100%) delete mode 100644 src/overlays/actors/ovl_Boss_07/z_boss_07_dmgtbl.c create mode 100644 src/overlays/actors/ovl_Boss_07/z_boss_07_dmgtbl.inc 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 ebfafbb87..5adaaaf99 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -17,13 +17,8 @@ #define EFFECT_COUNT 50 -typedef enum { - /* 0 */ REMAINS_ODOLWA, - /* 1 */ REMAINS_GYORG, - /* 2 */ REMAINS_GOHT, - /* 3 */ REMAINS_TWINMOLD, - /* 4 */ REMAINS_COUNT -} RemainsIndex; +#define RIGHT_HAND 0 +#define LEFT_HAND 1 typedef struct { /* 0x00 */ u8 type; @@ -41,8 +36,74 @@ typedef struct { } Boss07Effect; // size = 0x48 typedef enum { - /* 0 */ MAJORA_EFFECT_NONE, - /* 1 */ MAJORA_EFFECT_FLAME + MAJORAS_WRATH_DMGEFF_0, + MAJORAS_WRATH_DMGEFF_2=2, + MAJORAS_WRATH_DMGEFF_3, + MAJORAS_WRATH_DMGEFF_4, + MAJORAS_WRATH_DMGEFF_9=9, + MAJORAS_WRATH_DMGEFF_A, + MAJORAS_WRATH_DMGEFF_C=0xC, + MAJORAS_WRATH_DMGEFF_D, + MAJORAS_WRATH_DMGEFF_E, + MAJORAS_WRATH_DMGEFF_F, +} Boss07WrathDamageEffect; + +typedef enum { + MAJORAS_INCARNATION_DMGEFF_0, + MAJORAS_INCARNATION_DMGEFF_2=2, + MAJORAS_INCARNATION_DMGEFF_3, + MAJORAS_INCARNATION_DMGEFF_4, + MAJORAS_INCARNATION_DMGEFF_9=9, + MAJORAS_INCARNATION_DMGEFF_A, + MAJORAS_INCARNATION_DMGEFF_C=0xC, + MAJORAS_INCARNATION_DMGEFF_D, + MAJORAS_INCARNATION_DMGEFF_E, + MAJORAS_INCARNATION_DMGEFF_F, +} Boss07IncarnationDamageEffect; + +typedef enum { + MAJORAS_MASK_DMGEFF_0, + MAJORAS_MASK_DMGEFF_2=2, + MAJORAS_MASK_DMGEFF_3, + MAJORAS_MASK_DMGEFF_4, + MAJORAS_MASK_DMGEFF_9=9, + MAJORAS_MASK_DMGEFF_F=0xF, +} Boss07MaskDamageEffect; + +typedef enum { + MAJORAS_REMAINS_DMGEFF_0, + MAJORAS_REMAINS_DMGEFF_2=2, + MAJORAS_REMAINS_DMGEFF_3, + MAJORAS_REMAINS_DMGEFF_4, + MAJORAS_REMAINS_DMGEFF_9=9, + MAJORAS_REMAINS_DMGEFF_A, + MAJORAS_REMAINS_DMGEFF_C=0xC, + MAJORAS_REMAINS_DMGEFF_D, + MAJORAS_REMAINS_DMGEFF_E, + MAJORAS_REMAINS_DMGEFF_F, +} Boss07RemainsDamageEffect; + +typedef enum { + MAJORAS_TOP_DMGEFF_0, + MAJORAS_TOP_DMGEFF_A=0xA, + MAJORAS_TOP_DMGEFF_B, + MAJORAS_TOP_DMGEFF_C, + MAJORAS_TOP_DMGEFF_D, + MAJORAS_TOP_DMGEFF_E, + MAJORAS_TOP_DMGEFF_F, +} Boss07TopDamageEffect; + +typedef enum { + /* 0 */ REMAINS_ODOLWA, + /* 1 */ REMAINS_GYORG, + /* 2 */ REMAINS_GOHT, + /* 3 */ REMAINS_TWINMOLD, + /* 4 */ REMAINS_COUNT +} RemainsIndex; + +typedef enum { + /* 0 */ MAJORAS_EFFECT_NONE, + /* 1 */ MAJORAS_EFFECT_FLAME } Boss07EffectType; typedef enum { @@ -55,52 +116,116 @@ typedef enum { MAJORAS_WRATH_ATTACK_6, MAJORAS_WRATH_ATTACK_7, MAJORAS_WRATH_ATTACK_MAX, -} Boss07WrathActionStates; +} Boss07WrathActionState; typedef enum { MAJORAS_INCARNATION_STATE_0, MAJORAS_INCARNATION_STATE_1, MAJORAS_INCARNATION_STATE_2, MAJORAS_INCARNATION_STATE_MAX, -} Boss07IncarnationActionStates; +} Boss07IncarnationActionState; typedef enum { - MAJORAS_MASK_SPIN_STATE_0, - MAJORAS_MASK_SPIN_STATE_1, - MAJORAS_MASK_SPIN_STATE_2, + MAJORAS_MASK_SPIN_START, + MAJORAS_MASK_SPIN_ATTACK, + MAJORAS_MASK_SPIN_END, MAJORAS_MASK_SPIN_STATE_MAX, -} Boss07MaskSpinStates; +} Boss07MaskSpinState; typedef enum { - MAJORAS_MASK_BEAM_STATE_0, - MAJORAS_MASK_BEAM_STATE_1, - MAJORAS_MASK_BEAM_STATE_2, - MAJORAS_MASK_BEAM_STATE_3, - MAJORAS_MASK_BEAM_STATE_4, - MAJORAS_MASK_BEAM_STATE_5, + MAJORAS_MASK_BEAM_CHARGE, + MAJORAS_MASK_BEAM_EYES, + MAJORAS_MASK_BEAM_FOCUS, + MAJORAS_MASK_BEAM_ACTIVE, + MAJORAS_MASK_BEAM_REFLECT, + MAJORAS_MASK_BEAM_END, MAJORAS_MASK_BEAM_STATE_MAX, -} Boss07MaskBeamStates; +} Boss07MaskBeamState; typedef enum { MAJORAS_PROJECTILE_STATE_0, MAJORAS_PROJECTILE_STATE_1, MAJORAS_PROJECTILE_STATE_MAX, -} Boss07ProjectileStates; +} Boss07ProjectileState; typedef enum { - MAJORAS_REMAINS_STATE_0, - MAJORAS_REMAINS_STATE_1, - MAJORAS_REMAINS_STATE_2, - MAJORAS_REMAINS_STATE_3, - MAJORAS_REMAINS_STATE_10=10, - MAJORAS_REMAINS_STATE_20=20, -} Boss07RemainsStates; + MAJORAS_REMAINS_WAIT, + MAJORAS_REMAINS_FLY, + MAJORAS_REMAINS_DEATH, + MAJORAS_REMAINS_GONE, + MAJORAS_REMAINS_DAMAGED=10, + MAJORAS_REMAINS_ACTIVATE=20, +} Boss07RemainsState; + +typedef enum { + MAJORAS_REMAINS_CS_WAIT, + MAJORAS_REMAINS_CS_FLY, + MAJORAS_REMAINS_CS_ATTACH_WAIT, + MAJORAS_REMAINS_CS_ATTACH, +} Boss07RemainsCsState; typedef enum { MAJORAS_TOP_STATE_0, MAJORAS_TOP_STATE_1, MAJORAS_TOP_STATE_MAX, -} Boss07TopState; +} Boss07TopStates; + +typedef enum { + MAJORAS_MASK_INTRO_STATE_0, + MAJORAS_MASK_INTRO_STATE_1, + MAJORAS_MASK_INTRO_STATE_2, + MAJORAS_MASK_INTRO_STATE_3, + MAJORAS_MASK_INTRO_STATE_4, +} Boss07MaskIntroState; + +typedef enum { + MAJORAS_MASK_DEATH_STATE_0, + MAJORAS_MASK_DEATH_STATE_1, + MAJORAS_MASK_DEATH_STATE_2, + MAJORAS_MASK_DEATH_STATE_3, + MAJORAS_MASK_DEATH_STATE_4, +} Boss07MaskDeathState; + +typedef enum { + MAJORAS_INCARNATION_INTRO_STATE_0, + MAJORAS_INCARNATION_INTRO_STATE_1, + MAJORAS_INCARNATION_INTRO_STATE_2, + MAJORAS_INCARNATION_INTRO_STATE_3, + MAJORAS_INCARNATION_INTRO_STATE_4, + MAJORAS_INCARNATION_INTRO_STATE_5, +} Boss07IncarnationIntroState; + +typedef enum { + MAJORAS_INCARNATION_DEATH_STATE_0, + MAJORAS_INCARNATION_DEATH_STATE_1, + MAJORAS_INCARNATION_DEATH_STATE_2, + MAJORAS_INCARNATION_DEATH_STATE_3, + MAJORAS_INCARNATION_DEATH_STATE_4, + MAJORAS_INCARNATION_DEATH_STATE_10=10, +} Boss07IncarnationDeathState; + +typedef enum { + MAJORAS_WRATH_INTRO_STATE_0, + MAJORAS_WRATH_INTRO_STATE_1, +} Boss07WrathIntroState; + +typedef enum { + MAJORAS_WRATH_DEATH_STATE_0, + MAJORAS_WRATH_DEATH_STATE_1, + MAJORAS_WRATH_DEATH_STATE_2, + MAJORAS_WRATH_DEATH_STATE_3, + MAJORAS_WRATH_DEATH_STATE_4, +} Boss07WrathDeathState; + +typedef enum { + MAJORAS_STATIC_CS_STATE_0, + MAJORAS_STATIC_CS_STATE_1, + MAJORAS_STATIC_CS_STATE_2, + MAJORAS_STATIC_CS_STATE_3, + MAJORAS_STATIC_CS_STATE_4, + MAJORAS_STATIC_CS_STATE_5, + MAJORAS_STATIC_CS_STATE_6, +} Boss07StaticCsState; #if 1 // function prototypes void Boss07_RandVec3fXZ(Vec3f* arg0, f32 arg1); @@ -229,7 +354,7 @@ static s16 sColorsWhite[4][3] = { { 255, 255, 255 }, // white }; -#include "z_boss_07_dmgtbl.c" +#include "z_boss_07_dmgtbl.inc" const ActorInit Boss_07_InitVars = { ACTOR_BOSS_07, @@ -243,7 +368,7 @@ const ActorInit Boss_07_InitVars = { (ActorFunc)Boss07_Wrath_Draw, }; -#include "z_boss_07_colchk.c" +#include "z_boss_07_colchk.inc" static Vec3f sSfxPoint; static u8 sHeartbeatTimer; @@ -289,8 +414,8 @@ void Boss07_SpawnEffect(PlayState* play, Vec3f* pos, Vec3f* vel, Vec3f* accel, f Boss07Effect* effect = (Boss07Effect*)play->specialEffects; for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { - if (effect->type == MAJORA_EFFECT_NONE) { - effect->type = MAJORA_EFFECT_FLAME; + if (effect->type == MAJORAS_EFFECT_NONE) { + effect->type = MAJORAS_EFFECT_FLAME; effect->pos = *pos; effect->vel = *vel; effect->accel = *accel; @@ -487,19 +612,19 @@ static Vec3s sRemainsEnd[REMAINS_COUNT] = { void Boss07_Init(Actor* thisx, PlayState* play2) { static s16 sRemainsParams[REMAINS_COUNT] = { - MAJORA_REMAINS + REMAINS_ODOLWA, - MAJORA_REMAINS + REMAINS_GYORG, - MAJORA_REMAINS + REMAINS_GOHT, - MAJORA_REMAINS + REMAINS_TWINMOLD, + MAJORAS_REMAINS + REMAINS_ODOLWA, + MAJORAS_REMAINS + REMAINS_GYORG, + MAJORAS_REMAINS + REMAINS_GOHT, + MAJORAS_REMAINS + REMAINS_TWINMOLD, }; PlayState* play = play2; Boss07* this = THIS; s32 i; - if (this->actor.params == MAJORA_STATIC) { + if (this->actor.params == MAJORAS_STATIC) { this->actor.update = Boss07_Static_Update; this->actor.draw = Boss07_Static_Draw; - this->actor.flags &= ~1; + this->actor.flags &= ~ACTOR_FLAG_1; sMajoraStatic = this; sKillProjectiles = false; play->envCtx.lightSettingOverride = 0; @@ -507,10 +632,10 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { return; } - if (this->actor.params == MAJORA_BOSS) { - this->actor.params = MAJORA_MASK; + if (this->actor.params == MAJORAS_BOSS) { + this->actor.params = MAJORAS_MASK; Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, MAJORA_STATIC); + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, MAJORAS_STATIC); play->specialEffects = (void*)sEffects; for (i = 0; i < ARRAY_COUNT(sEffects); i++) { @@ -524,27 +649,27 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.gravity = -2.5f; - if (thisx->params >= MAJORA_REMAINS) { + if (thisx->params >= MAJORAS_REMAINS) { this->actor.update = Boss07_Remains_Update; this->actor.draw = Boss07_Remains_Draw; - sBossRemains[thisx->params - MAJORA_REMAINS] = this; + sBossRemains[thisx->params - MAJORAS_REMAINS] = this; if (gSaveContext.eventInf[6] & 2) { Actor_SetScale(&this->actor, 0.03f); - this->actor.world.pos.x = sRemainsEnd[this->actor.params - MAJORA_REMAINS].x; + this->actor.world.pos.x = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].x; 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; + this->actor.world.pos.z = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].z; + this->actor.shape.rot.y = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].y; Boss07_Remains_SetupFly(this, play); } else { Boss07_Remains_SetupIntro(this, play); } - this->actor.flags &= ~1; + this->actor.flags &= ~ACTOR_FLAG_1; this->actor.colChkInfo.damageTable = &sRemainsDmgTable; return; } - if (this->actor.params == MAJORA_TOP) { + if (this->actor.params == MAJORAS_TOP) { static EffectTireMarkInit sTopTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; this->actor.update = Boss07_Top_Update; @@ -555,26 +680,26 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { this->actor.shape.shadowAlpha = 180; Collider_InitAndSetCylinder(play, &this->cyl2, &this->actor, &sTopCylInit); Effect_Add(play, &this->effectIndex, 4, 0, 0, &sTopTireMarkInit); - this->actor.flags &= ~1; + this->actor.flags &= ~ACTOR_FLAG_1; return; } - if ((this->actor.params == MAJORA_REMAINS_SHOT) || (this->actor.params == MAJORA_INCARNATION_SHOT)) { + if ((this->actor.params == MAJORAS_REMAINS_SHOT) || (this->actor.params == MAJORAS_INCARNATION_SHOT)) { this->actor.update = Boss07_Projectile_Update; this->actor.draw = Boss07_Projectile_Draw; - this->actor.flags &= ~1; + this->actor.flags &= ~ACTOR_FLAG_1; Collider_InitAndSetCylinder(play, &this->cyl2, &this->actor, &sShotCylInit); func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); this->unk_181C = Rand_ZeroFloat(3.99f); return; } - if ((this->actor.params == MAJORA_MASK) || (this->actor.params == MAJORA_MASK_CS)) { + if ((this->actor.params == MAJORAS_MASK) || (this->actor.params == MAJORAS_MASK_CS)) { this->actor.colChkInfo.damageTable = &sMaskDmgTable; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 15.0f); SkelAnime_Init(play, &this->skelAnime, &gMajorasMaskSkel, &gMajorasMaskFloatingAnim, this->jointTable, this->morphTable, MAJORAS_MASK_LIMB_MAX); - if (this->actor.params == MAJORA_MASK) { + if (this->actor.params == MAJORAS_MASK) { static EffectTireMarkInit sMaskTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; this->actor.update = Boss07_Mask_Update; @@ -593,7 +718,7 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { this->timers[0] = 50; this->timers[2] = 200; this->unk_1888 = 50; - this->actor.flags |= 1; + this->actor.flags |= ACTOR_FLAG_1; sMusicStartTimer = 20; } else { Boss07_Mask_SetupIntro(this, play); @@ -609,17 +734,17 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { return; } - if ((this->actor.params == MAJORA_INCARNATION) || (this->actor.params == MAJORA_AFTERIMAGE)) { + if ((this->actor.params == MAJORAS_INCARNATION) || (this->actor.params == MAJORAS_AFTERIMAGE)) { Actor_SetScale(&this->actor, 0.015000001f); SkelAnime_InitFlex(play, &this->skelAnime, &gMajorasIncarnationSkel, &gMajorasIncarnationTauntDance1Anim, this->jointTable, this->morphTable, MAJORAS_INCARNATION_LIMB_MAX); - if (this->actor.params == MAJORA_AFTERIMAGE) { + if (this->actor.params == MAJORAS_AFTERIMAGE) { this->timers[0] = this->actor.world.rot.z; this->actor.world.rot.z = 0; this->actor.update = Boss07_Afterimage_Update; this->actor.draw = Boss07_Afterimage_Draw; - this->actor.flags &= ~1; + this->actor.flags &= ~ACTOR_FLAG_1; } else { this->actor.colChkInfo.damageTable = &sIncarnationDmgTable; this->actor.colChkInfo.health = 30; @@ -679,10 +804,10 @@ void Boss07_Destroy(Actor* thisx, PlayState* play2) { Boss07* this = THIS; switch (this->actor.params) { - case MAJORA_WRATH: + case MAJORAS_WRATH: Collider_DestroyQuad(play, &this->quad1); Collider_DestroyQuad(play, &this->quad2); - case MAJORA_TOP: + case MAJORAS_TOP: Effect_Destroy(play, this->effectIndex); break; } @@ -691,7 +816,7 @@ void Boss07_Destroy(Actor* thisx, PlayState* play2) { void Boss07_Wrath_SetupIntro(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Wrath_Intro; Animation_MorphToLoop(&this->skelAnime, &gMajorasWrathHeavyBreathingAnim, 0.0f); - this->actor.flags &= ~1; + this->actor.flags &= ~ACTOR_FLAG_1; this->unk_17D8 = 0x7F00; this->unk_15C = 20; this->unk_17E8 = 5120.0f; @@ -708,16 +833,16 @@ void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY); switch (this->csState) { - case 0: + case MAJORAS_WRATH_INTRO_STATE_0: this->unk_ABC8 = 0; - this->csState = 1; + this->csState = MAJORAS_WRATH_INTRO_STATE_1; this->subCamNextAt.z = 0.f; this->subCamNextEye.x = 0.0; this->subCamNextEye.y = KREG(17) + 100.0f - 30.0f + 80.0f; this->subCamNextEye.z = KREG(18) + 270.0f - 150.0f + 30.0f - 50.0f; this->subCamNextAt.x = 0.0f; this->subCamNextAt.y = 180.0f; - case 1: + case MAJORAS_WRATH_INTRO_STATE_1: if (this->unk_ABC8 < 40) { sHeartbeatTimer = 3; } @@ -779,18 +904,18 @@ void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { s32 i; - Camera* sp48 = Play_GetCamera(play, 0); + Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); - this->csState = 0; + this->csState = MAJORAS_WRATH_INTRO_STATE_0; Boss07_Wrath_SetupIdle(this, play, 50); - sp48->eye = this->subCamEye; - sp48->eyeNext = this->subCamEye; - sp48->at = this->subCamAt; + mainCam->eye = this->subCamEye; + mainCam->eyeNext = this->subCamEye; + mainCam->at = this->subCamAt; func_80169AFC(play, this->subCamIndex, 0); - this->subCamIndex = 0; + this->subCamIndex = SUB_CAM_ID_DONE; Cutscene_End(play, &play->csCtx); func_800B7298(play, &this->actor, 6); - this->actor.flags |= 1; + this->actor.flags |= ACTOR_FLAG_1; func_80165690(); if (sBossRemains[REMAINS_ODOLWA] != NULL) { for (i = 0; i < ARRAY_COUNT(sBossRemains); i++) { @@ -820,12 +945,12 @@ void Boss07_Wrath_SetupDeath(Boss07* this, PlayState* play) { this->leftWhip.tension = this->rightWhip.tension = 0.0f; this->leftWhip.gravity = this->rightWhip.gravity = -15.0f; Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathDeathAnim, 0.0f); - this->actor.flags &= ~1; - this->csState = 0; + this->actor.flags &= ~ACTOR_FLAG_1; + this->csState = MAJORAS_WRATH_DEATH_STATE_0; this->unk_ABC8 = 0; if (sBossRemains[REMAINS_ODOLWA] != NULL) { for (i = 0; i < 4; i++) { - sBossRemains[i]->actionState = MAJORAS_REMAINS_STATE_2; + sBossRemains[i]->actionState = MAJORAS_REMAINS_DEATH; } } this->unk_15C = 1000; @@ -837,30 +962,30 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { Vec3f spB4; Vec3f spA8 = { 0.0f, 0.0f, 0.0f }; f32 spA4 = 0.0f, spA0 = 0.1f; - Camera* camera = Play_GetCamera(play, 0); + Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); this->unk_15C = 1000; Boss07_SmoothStop(this, 1.0f); switch (this->csState) { - case 0: + case MAJORAS_WRATH_DEATH_STATE_0: if (ActorCutscene_GetCurrentIndex() != -1) { break; } Cutscene_Start(play, &play->csCtx); func_800B7298(play, &this->actor, 1); this->subCamIndex = Play_CreateSubCamera(play); - Play_ChangeCameraStatus(play, 0, 1); - Play_ChangeCameraStatus(play, this->subCamIndex, 7); + Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); + Play_ChangeCameraStatus(play, this->subCamIndex, CAM_STATUS_ACTIVE); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_DEAD_ROD); - case 1: + case MAJORAS_WRATH_DEATH_STATE_1: this->unk_ABC8 = 0; - this->csState = 2; - this->subCamEye.x = camera->eye.x; - this->subCamEye.y = camera->eye.y; - this->subCamEye.z = camera->eye.z; - this->subCamAt.x = camera->at.x; - this->subCamAt.y = camera->at.y; - this->subCamAt.z = camera->at.z; + this->csState = MAJORAS_WRATH_DEATH_STATE_2; + this->subCamEye.x = mainCam->eye.x; + this->subCamEye.y = mainCam->eye.y; + this->subCamEye.z = mainCam->eye.z; + this->subCamAt.x = mainCam->at.x; + this->subCamAt.y = mainCam->at.y; + this->subCamAt.z = mainCam->at.z; this->subCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; this->subCamRotVel = this->subCamSpeedMod = sMajoraStatic->unk_180C = 0.0f; Boss07_InitRand(1, 0x71AC, 0x263A); @@ -868,7 +993,7 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { this->deathLightScale[i] = Boss07_RandZeroOne() - 1.0f; } func_8016566C(150); - case 2: + case MAJORAS_WRATH_DEATH_STATE_2: if (this->unk_ABC8 == 20) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST2_WALK2_OLD); } @@ -918,13 +1043,13 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { spA0 = 1.0f; } if (this->unk_ABC8 >= (sREG(15) + 140)) { - this->csState = 4; + this->csState = MAJORAS_WRATH_DEATH_STATE_4; this->subCamEyeModY = sREG(16) + 270.0f + 50.0f; Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_DEAD_FLOAT); } else { break; } - case 4: + case MAJORAS_WRATH_DEATH_STATE_4: if ((this->unk_ABC8 >= (sREG(90) + 260)) && (this->unk_ABC8 < (sREG(91) + 370))) { spC0 = KREG(14) + 1; this->subCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; @@ -1069,7 +1194,7 @@ void Boss07_Wrath_SetupIdle(Boss07* this, PlayState* play, s16 delay) { } else { this->timers[0] = Rand_ZeroFloat(30.0f); } - this->actor.flags |= 1; + this->actor.flags |= ACTOR_FLAG_1; } void Boss07_Wrath_Idle(Boss07* this, PlayState* play) { @@ -1469,7 +1594,7 @@ void Boss07_Wrath_GrabPlayer(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 2.0f); player->actor.world.pos = this->unk_F80; - this->actor.flags &= ~1; + this->actor.flags &= ~ACTOR_FLAG_1; this->unk_15A = 20; this->unk_F7C++; if (this->actionTimer > (s16)(46 - this->unk_F7E)) { @@ -1550,7 +1675,7 @@ void Boss07_Wrath_Shock(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 2.0f); player->actor.world.pos = this->unk_F80; - this->actor.flags &= ~1; + this->actor.flags &= ~ACTOR_FLAG_1; this->unk_15A = 20; if (this->actionTimer <= (s16)(46 - this->unk_F7E)) { this->unk_F7C++; @@ -1629,7 +1754,7 @@ void Boss07_Wrath_SpawnTop(Boss07* this, PlayState* play) { } if (this->actionTimer == 8) { Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, this->actor.world.pos.y, - this->actor.world.pos.z, 0, 0, 0, MAJORA_TOP); + this->actor.world.pos.z, 0, 0, 0, MAJORAS_TOP); } if (1) {} if (this->actionTimer == 10) { @@ -1722,7 +1847,7 @@ void Boss07_Wrath_Damaged(Boss07* this, PlayState* play) { } } -void Boss07_Wrath_WhipCollisionCheck(Vec3f* arg0, f32 arg1, Boss07* this, PlayState* play) { +void Boss07_Wrath_WhipCollisionCheck(Vec3f* whipPos, f32 tension, Boss07* this, PlayState* play) { s32 i; s32 sp98 = -1; Player* player = GET_PLAYER(play); @@ -1731,15 +1856,15 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* arg0, f32 arg1, Boss07* this, PlaySt f32 dz; Vec3f sp7C; - if ((arg1 >= 50.0f) && (this->unk_15A == 0)) { + if ((tension >= 50.0f) && (this->unk_15A == 0)) { Actor* prop = play->actorCtx.actorLists[ACTORCAT_PROP].first; while (prop != NULL) { if (prop->id == ACTOR_OBJ_TSUBO) { for (i = 10; i < sWhipSegCount; i += 3) { - dx = prop->world.pos.x - arg0[i].x; - dy = prop->world.pos.y + 10.0f - arg0[i].y; - dz = prop->world.pos.z - arg0[i].z; + dx = prop->world.pos.x - whipPos[i].x; + dy = prop->world.pos.y + 10.0f - whipPos[i].y; + dz = prop->world.pos.z - whipPos[i].z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < (KREG(38) + 60.0f)) { ((ObjTsubo*)prop)->unk_19B = 1; @@ -1750,14 +1875,14 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* arg0, f32 arg1, Boss07* this, PlaySt prop = prop->next; } } - if ((arg1 >= 50.0f) && (this->unk_15A == 0) && (!(player->stateFlags3 & 0x100) || (this->actionState == MAJORAS_WRATH_ATTACK_4))) { + if ((tension >= 50.0f) && (this->unk_15A == 0) && (!(player->stateFlags3 & 0x100) || (this->actionState == MAJORAS_WRATH_ATTACK_4))) { if ((func_800B64FC(play, 1000.0f, &this->actor.world.pos, &sp98) >= 0.0f) && (sp98 != 1)) { sp98 = -1; } for (i = 10; i < sWhipSegCount; i += 3) { - dx = player->actor.world.pos.x - arg0[i].x; - dy = player->actor.world.pos.y + 30.0f - arg0[i].y; - dz = player->actor.world.pos.z - arg0[i].z; + dx = player->actor.world.pos.x - whipPos[i].x; + dy = player->actor.world.pos.y + 30.0f - whipPos[i].y; + dz = player->actor.world.pos.z - whipPos[i].z; dy *= 1.75f; @@ -1831,22 +1956,22 @@ void Boss07_Wrath_CollisionCheck(Boss07* this, PlayState* play) { this->unk_1806 = 0; } switch (this->actor.colChkInfo.damageEffect) { - case 3: + case MAJORAS_WRATH_DMGEFF_3: this->unk_1805 = 10; break; - case 2: + case MAJORAS_WRATH_DMGEFF_2: this->unk_1805 = 1; break; - case 4: + case MAJORAS_WRATH_DMGEFF_4: this->unk_1805 = 20; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 0, 4); break; - case 10: + case MAJORAS_WRATH_DMGEFF_A: this->unk_1805 = 40; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); break; - case 9: + case MAJORAS_WRATH_DMGEFF_9: this->unk_1805 = 30; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 3, 4); @@ -1854,14 +1979,14 @@ void Boss07_Wrath_CollisionCheck(Boss07* this, PlayState* play) { } 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)) { + if ((this->actionFunc == Boss07_Wrath_Stunned) && (this->actor.colChkInfo.damageEffect != MAJORAS_WRATH_DMGEFF_E) && + (this->actor.colChkInfo.damageEffect != MAJORAS_WRATH_DMGEFF_D) && (this->actor.colChkInfo.damageEffect != MAJORAS_WRATH_DMGEFF_9) && + (this->actor.colChkInfo.damageEffect != MAJORAS_WRATH_DMGEFF_C)) { Boss07_Wrath_SetupStunned(this, play); this->unk_15C = 6; } else { this->unk_15E = 15; - this->unk_15C = (this->actor.colChkInfo.damageEffect == 12) ? 15 : 5; + this->unk_15C = (this->actor.colChkInfo.damageEffect == MAJORAS_WRATH_DMGEFF_C) ? 15 : 5; Boss07_Wrath_SetupDamaged(this, play, damage, this->actor.colChkInfo.damageEffect); } } else { @@ -1902,7 +2027,7 @@ void Boss07_Wrath_BreakIce(Boss07* this, PlayState* play) { } } -void Boss07_Wrath_DamageEffects(Boss07* this, PlayState* play) { +void Boss07_DamageEffects(Boss07* this, PlayState* play) { DECR(this->unk_1806); switch (this->unk_1805) { @@ -2100,7 +2225,7 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { sp54[sp50] = 0; } } - Boss07_Wrath_DamageEffects(this, play); + Boss07_DamageEffects(this, play); if ((this->unk_156 == 1) || (this->unk_156 == 4)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_WALK2_OLD); } @@ -2112,9 +2237,9 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { } } -void Boss07_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, +void Boss07_Wrath_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, f32 gravity, f32 stiffness, f32 drag, f32 tension, Vec3s* baseRot, s16 argB, f32 scale, - s32 whipHand) { + s32 hand) { s32 i; s32 phi_s6; f32 temp_f20; @@ -2207,7 +2332,7 @@ void Boss07_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* pos, 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 == Boss07_Wrath_SpawnTop)) { + } else if ((hand == RIGHT_HAND) && (this->actionFunc == Boss07_Wrath_SpawnTop)) { if (i == KREG(90) + sWhipSegCount - this->unk_778 + 1) { spAC.x = KREG(60); spAC.y = KREG(61); @@ -2242,10 +2367,10 @@ void Boss07_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* pos, } } -void Boss07_DrawWhips(Boss07* this, PlayState* play, Vec3f* pos, Vec3f* rot, f32 arg4, s32 hand) { +void Boss07_Wrath_DrawWhips(Boss07* this, PlayState* play, Vec3f* pos, Vec3f* rot, f32 zScale, s32 hand) { s32 phi_s6; s32 i; - f32 phi_f12; + f32 xyScale; s32 pad[2]; Vec3f* vec2 = pos; Vec3f* vec3 = rot; @@ -2254,14 +2379,14 @@ void Boss07_DrawWhips(Boss07* this, PlayState* play, Vec3f* pos, Vec3f* rot, f32 func_8012C28C(play->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, gMajorasMaskWhipShadowMaterialDL); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sREG(48) + 45, 35, 75, 255); - phi_s6 = (hand == 0) ? this->unk_778 : 0; + phi_s6 = (hand == RIGHT_HAND) ? this->unk_778 : 0; for (i = 0; i < (sWhipSegCount - phi_s6) - 1; i++, pos++, rot++) { Matrix_Translate(pos->x, 0.0f, pos->z, MTXMODE_NEW); Matrix_Scale(1.0f, 0.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateYF(rot->y, MTXMODE_APPLY); Matrix_RotateXFApply(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, MTXMODE_APPLY); + xyScale = (i > 24) ? 0.025f : ((f32)(24 - i) * 1 * 0.001f) + 0.025f; + Matrix_Scale(xyScale, xyScale, ((2 * zScale) + 0.5f) * 0.01f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gMajorasWrathWhipModelDL); } @@ -2273,8 +2398,8 @@ void Boss07_DrawWhips(Boss07* this, PlayState* play, Vec3f* pos, Vec3f* rot, f32 Matrix_Translate(pos->x, pos->y, pos->z, MTXMODE_NEW); Matrix_RotateYF(rot->y, MTXMODE_APPLY); Matrix_RotateXFApply(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, MTXMODE_APPLY); + xyScale = (i > 24) ? 0.025f : ((f32)(24 - i) * 1 * 0.001f) + 0.025f; + Matrix_Scale(xyScale, xyScale, ((2 * zScale) + 0.5f) * 0.01f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gMajorasWrathWhipModelDL); } @@ -2361,7 +2486,7 @@ void Boss07_Wrath_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx } } -void Boss07_DrawShocks(Boss07* this, PlayState* play) { +void Boss07_Wrath_DrawShocks(Boss07* this, PlayState* play) { s32 i; GraphicsContext* gfxCtx; @@ -2408,7 +2533,7 @@ void Boss07_DrawShocks(Boss07* this, PlayState* play) { CLOSE_DISPS(gfxCtx); } -void Boss07_DrawDeathLights(Boss07* this, PlayState* play, Vec3f* arg2) { +void Boss07_Wrath_DrawDeathLights(Boss07* this, PlayState* play, Vec3f* arg2) { s32 i; f32 temp_f12_2; f32 temp_f20; @@ -2513,25 +2638,25 @@ void Boss07_Wrath_Draw(Actor* thisx, PlayState* play2) { POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP); if (((KREG(63) == 0) || (KREG(63) == 2)) && this->unk_149) { - Boss07_UpdateWhips(this, play, &this->rightWhip.basePos, this->rightWhip.pos, this->rightWhip.rot, + Boss07_Wrath_UpdateWhips(this, play, &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, - this->whipScale, 0); - Boss07_UpdateWhips(this, play, &this->leftWhip.basePos, this->leftWhip.pos, this->leftWhip.rot, + this->whipScale, RIGHT_HAND); + Boss07_Wrath_UpdateWhips(this, play, &this->leftWhip.basePos, this->leftWhip.pos, this->leftWhip.rot, this->leftWhip.pull, this->leftWhip.gravity, this->leftWhip.stiffness, this->leftWhip.drag, - this->leftWhip.tension, &this->leftWhip.baseRot, 0, this->whipScale, 1); + this->leftWhip.tension, &this->leftWhip.baseRot, 0, this->whipScale, LEFT_HAND); } - Boss07_DrawWhips(this, play, this->rightWhip.pos, this->rightWhip.rot, this->whipScale, 0); - Boss07_DrawWhips(this, play, this->leftWhip.pos, this->leftWhip.rot, this->whipScale, 1); + Boss07_Wrath_DrawWhips(this, play, this->rightWhip.pos, this->rightWhip.rot, this->whipScale, RIGHT_HAND); + Boss07_Wrath_DrawWhips(this, play, this->leftWhip.pos, this->leftWhip.rot, this->whipScale, LEFT_HAND); if (this->unk_AB48 == 0) { Boss07_Wrath_MakeShadowTex(shadowTex, this, play); Boss07_Wrath_DrawShadowTex(shadowTex, this, play); } - Boss07_DrawShocks(this, play); + Boss07_Wrath_DrawShocks(this, play); sp58.x = this->bodyPartsPos[2].x; sp58.y = this->bodyPartsPos[2].y - 30.0f + 50.0f; sp58.z = this->bodyPartsPos[2].z; - Boss07_DrawDeathLights(this, play, &sp58); + Boss07_Wrath_DrawDeathLights(this, play, &sp58); Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, this->unk_1804); this->unk_149 = false; @@ -2667,7 +2792,7 @@ void Boss07_Incarnation_AvoidPlayer(Boss07* this) { void Boss07_Incarnation_SetupIntro(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Incarnation_Intro; Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationJerkingAnim, 0.0f); - this->actor.flags &= ~1; + this->actor.flags &= ~ACTOR_FLAG_1; this->unk_17D8 = 0x6E00; } @@ -2681,12 +2806,12 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY); sp58 = Math_SinS(this->actionTimer * 0x4500) * 0.3f; switch (this->csState) { - case 0: + case MAJORAS_INCARNATION_INTRO_STATE_0: this->unk_ABC8 = 0; - this->csState = 1; + this->csState = MAJORAS_INCARNATION_INTRO_STATE_1; this->subCamNextAt.z = 0.0f; - case 1: - this->csState = 2; + case MAJORAS_INCARNATION_INTRO_STATE_1: + this->csState = MAJORAS_INCARNATION_INTRO_STATE_2; this->unk_ABC8 = 0; this->subCamNextEye.x = 70.0f; this->subCamNextEye.y = 70.0f; @@ -2694,7 +2819,7 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { this->subCamNextAt.x = 20.0f; this->subCamNextAt.y = 80.0f; break; - case 2: + case MAJORAS_INCARNATION_INTRO_STATE_2: if (this->unk_ABC8 >= 20) { if (this->unk_ABC8 == 20) { this->unk_17C8[3] = 1.0f; @@ -2703,11 +2828,11 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { Math_ApproachF(&this->unk_17B8[3], 1.0f + (this->unk_17C8[3] * sp58), 1.0f, 0.5f); } if (this->unk_ABC8 > 40) { - this->csState = 3; + this->csState = MAJORAS_INCARNATION_INTRO_STATE_3; this->unk_ABC8 = 0; } break; - case 3: + case MAJORAS_INCARNATION_INTRO_STATE_3: Math_ApproachF(&this->subCamNextEye.x, 0.0f, 0.05f, this->subCamSpeedMod * 40.0f); Math_ApproachF(&this->subCamNextEye.y, 100.0f, 0.05f, this->subCamSpeedMod * 30.0f); Math_ApproachF(&this->subCamNextEye.z, 270.0f, 0.05f, this->subCamSpeedMod * 150.0f); @@ -2736,14 +2861,14 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { Math_ApproachF(this->unk_17B8, 1.0f + (this->unk_17C8[0] * sp58), 1.0f, 0.5f); } if (this->unk_ABC8 == 80) { - this->csState = 4; + this->csState = MAJORAS_INCARNATION_INTRO_STATE_4; this->unk_ABC8 = 0; for (i = 0; i < 4; i++) { this->unk_17B8[i] = 1.0f; } } break; - case 4: + case MAJORAS_INCARNATION_INTRO_STATE_4: this->subCamNextEye.x = 0.0f; this->subCamNextEye.y = 120.0f; this->subCamNextEye.z = 140.0f; @@ -2756,14 +2881,14 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { Math_ApproachS(&this->unk_17D8, (this->unk_17C8[3] * sp58) * 0x6000, 1, 0x4000); } if (this->unk_ABC8 == 30) { - this->csState = 5; + this->csState = MAJORAS_INCARNATION_INTRO_STATE_5; this->unk_ABC8 = 0; this->subCamSpeedMod = 0.0f; this->unk_1D4 = 1000.0f; func_80165690(); } break; - case 5: + case MAJORAS_INCARNATION_INTRO_STATE_5: if (this->unk_ABC8 == 20) { Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationIntroDanceAnim, 0.0f); this->unk_1D4 = Animation_GetLastFrame(&gMajorasIncarnationIntroDanceAnim); @@ -2797,18 +2922,18 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { Math_ApproachF(&this->subCamNextAt.y, 110.0f, 0.05f, this->subCamSpeedMod * 80.0f); Math_ApproachF(&this->subCamSpeedMod, 0.1f, 1.0f, 0.005f); if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { - Camera* sp54 = Play_GetCamera(play, 0); + Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); - this->csState = 0; + this->csState = MAJORAS_INCARNATION_INTRO_STATE_0; Boss07_Incarnation_SetupTaunt(this, play); - sp54->eye = this->subCamEye; - sp54->eyeNext = this->subCamEye; - sp54->at = this->subCamAt; + mainCam->eye = this->subCamEye; + mainCam->eyeNext = this->subCamEye; + mainCam->at = this->subCamAt; func_80169AFC(play, this->subCamIndex, 0); - this->subCamIndex = 0; + this->subCamIndex = SUB_CAM_ID_DONE; Cutscene_End(play, &play->csCtx); func_800B7298(play, &this->actor, 6); - this->actor.flags |= 1; + this->actor.flags |= ACTOR_FLAG_1; } break; } @@ -2833,7 +2958,7 @@ void Boss07_Incarnation_SetupTaunt(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Incarnation_Taunt; this->actionState = Rand_ZeroFloat(MAJORAS_INCARNATION_STATE_MAX - 0.001f); Animation_MorphToLoop(&this->skelAnime, sTauntAnims[this->actionState], -10.0f); - this->actor.flags |= 1; + this->actor.flags |= ACTOR_FLAG_1; this->timers[0] = Rand_ZeroFloat(50.0f) + 50.0f; } @@ -2999,11 +3124,11 @@ void Boss07_Incarnation_Attack(Boss07* this, PlayState* play) { Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 0x3000); if (Animation_OnFrame(&this->skelAnime, 4.0f)) { Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->unk_17A0.x, this->unk_17A0.y, - this->unk_17A0.z, 0, 0, 0, MAJORA_INCARNATION_SHOT); + this->unk_17A0.z, 0, 0, 0, MAJORAS_INCARNATION_SHOT); } if (Animation_OnFrame(&this->skelAnime, 9.0f)) { Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->unk_17AC.x, this->unk_17AC.y, - this->unk_17AC.z, 0, 0, 0, MAJORA_INCARNATION_SHOT); + this->unk_17AC.z, 0, 0, 0, MAJORAS_INCARNATION_SHOT); } if (this->timers[0] == 0) { Boss07_Incarnation_SetupRun(this, play); @@ -3124,9 +3249,9 @@ void Boss07_Incarnation_SetupDeath(Boss07* this, PlayState* play) { Boss07_MovePlayer(play); Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationDamageAnim, -2.0f); this->unk_1D4 = Animation_GetLastFrame(&gMajorasIncarnationDamageAnim); - this->csState = 0; + this->csState = MAJORAS_INCARNATION_DEATH_STATE_0; this->unk_ABC8 = 0; - this->actor.flags &= ~1; + this->actor.flags &= ~ACTOR_FLAG_1; this->unk_15C = 20; } @@ -3139,19 +3264,19 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 3.0f); switch (this->csState) { - case 0: + case MAJORAS_INCARNATION_DEATH_STATE_0: if (ActorCutscene_GetCurrentIndex() != -1) { break; } Cutscene_Start(play, &play->csCtx); func_800B7298(play, &this->actor, 7); this->subCamIndex = Play_CreateSubCamera(play); - Play_ChangeCameraStatus(play, 0, 1); - Play_ChangeCameraStatus(play, this->subCamIndex, 7); + Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); + Play_ChangeCameraStatus(play, this->subCamIndex, CAM_STATUS_ACTIVE); this->unk_ABC8 = 0; - this->csState = 10; + this->csState = MAJORAS_INCARNATION_DEATH_STATE_10; func_8016566C(150); - case 10: + case MAJORAS_INCARNATION_DEATH_STATE_10: sHeartbeatTimer = 5; this->subCamNextEye.x = 0.0f; this->subCamNextEye.y = 30.0f; @@ -3163,16 +3288,16 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { Math_ApproachF(&this->actor.world.pos.z, 0.0f, 0.1f, 5.0f); if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { this->unk_ABC8 = 0; - this->csState = 1; + this->csState = MAJORAS_INCARNATION_DEATH_STATE_1; Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationFinalHitAnim, -5.0f); } break; - case 1: + case MAJORAS_INCARNATION_DEATH_STATE_1: sHeartbeatTimer = 5; this->subCamNextAt.y = (Math_SinS(this->unk_ABC8 * 0x700) * 15.0f) + 150.0f; if (this->unk_ABC8 == 40) { this->unk_ABC8 = 0; - this->csState = 2; + this->csState = MAJORAS_INCARNATION_DEATH_STATE_2; this->subCamNextEye.x = -30.0f; this->subCamNextEye.y = 120.0f; this->subCamNextEye.z = 110.0f; @@ -3192,12 +3317,12 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_PUMP_UP_OLD); } break; - case 2: + case MAJORAS_INCARNATION_DEATH_STATE_2: sHeartbeatTimer = 5; sp4B = 1; if (this->unk_ABC8 == 40) { this->unk_ABC8 = 0; - this->csState = 3; + this->csState =MAJORAS_INCARNATION_DEATH_STATE_3; this->subCamNextEye.x = 30.0f; this->subCamNextEye.y = 120.0f; this->subCamNextEye.z = 110.0f; @@ -3209,12 +3334,12 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_PUMP_UP_OLD); } break; - case 3: + case MAJORAS_INCARNATION_DEATH_STATE_3: sHeartbeatTimer = 5; sp4B = 1; if (this->unk_ABC8 == 40) { this->unk_ABC8 = 0; - this->csState = 4; + this->csState = MAJORAS_INCARNATION_DEATH_STATE_4; this->subCamNextEye.x = 0.0f; this->subCamNextEye.y = 90.0f; this->subCamNextEye.z = 110.0f; @@ -3226,7 +3351,7 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_PUMP_UP_OLD); } break; - case 4: + case MAJORAS_INCARNATION_DEATH_STATE_4: sHeartbeatTimer = 5; sp4B = 2; if (this->unk_ABC8 == 10) { @@ -3234,7 +3359,7 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { } if (this->unk_ABC8 == 40) { Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, this->subCamIndex, MAJORA_WRATH); + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, this->subCamIndex, MAJORAS_WRATH); Actor_MarkForDeath(&this->actor); } break; @@ -3275,22 +3400,22 @@ void Boss07_Incarnation_CollisionCheck(Boss07* this, PlayState* play) { this->unk_1806 = 0; } switch (this->actor.colChkInfo.damageEffect) { - case 3: + case MAJORAS_INCARNATION_DMGEFF_3: this->unk_1805 = 10; break; - case 2: + case MAJORAS_INCARNATION_DMGEFF_2: this->unk_1805 = 1; break; - case 4: + case MAJORAS_INCARNATION_DMGEFF_4: this->unk_1805 = 20; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 0, 4); break; - case 10: + case MAJORAS_INCARNATION_DMGEFF_A: this->unk_1805 = 40; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); break; - case 9: + case MAJORAS_INCARNATION_DMGEFF_9: this->unk_1805 = 30; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 3, 4); @@ -3299,7 +3424,7 @@ void Boss07_Incarnation_CollisionCheck(Boss07* this, PlayState* play) { if ((this->actionFunc == Boss07_Incarnation_Stunned) || (this->actionFunc == Boss07_Incarnation_Damaged)) { - this->unk_15C = (this->actor.colChkInfo.damageEffect == 12) ? 15 : 5; + this->unk_15C = (this->actor.colChkInfo.damageEffect == MAJORAS_INCARNATION_DMGEFF_C) ? 15 : 5; damage = this->actor.colChkInfo.damage; Boss07_Incarnation_SetupDamaged(this, play, damage, this->actor.colChkInfo.damageEffect); this->unk_15E = 15; @@ -3385,7 +3510,7 @@ void Boss07_Incarnation_Update(Actor* thisx, PlayState* play2) { Boss07* afterimage = (Boss07*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, 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); + this->actor.world.rot.x, this->actor.world.rot.y, 7, MAJORAS_AFTERIMAGE); if (afterimage != NULL) { for (i = 0; i < MAJORAS_INCARNATION_LIMB_MAX; i++) { @@ -3393,7 +3518,7 @@ void Boss07_Incarnation_Update(Actor* thisx, PlayState* play2) { } } } - Boss07_Wrath_DamageEffects(this, play); + Boss07_DamageEffects(this, play); } void Boss07_Afterimage_Draw(Actor* thisx, PlayState* play2) { @@ -3583,7 +3708,7 @@ void Boss07_Mask_Idle(Boss07* this, PlayState* play) { void Boss07_Mask_SetupSpin(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Mask_Spin; - this->actionState = MAJORAS_MASK_SPIN_STATE_0; + this->actionState = MAJORAS_MASK_SPIN_START; this->csState = 0; this->timers[0] = 30; this->unk_18D4 = 0; @@ -3601,13 +3726,13 @@ void Boss07_Mask_Spin(Boss07* this, PlayState* play) { this->actor.shape.rot.z -= this->unk_18D4; switch (this->actionState) { - case MAJORAS_MASK_SPIN_STATE_0: + case MAJORAS_MASK_SPIN_START: 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->actionState = MAJORAS_MASK_SPIN_STATE_1; + this->actionState = MAJORAS_MASK_SPIN_ATTACK; this->actor.world.rot.x = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->timers[0] = 100; @@ -3615,7 +3740,7 @@ void Boss07_Mask_Spin(Boss07* this, PlayState* play) { this->unk_170 = 0.0f; } break; - case MAJORAS_MASK_SPIN_STATE_1: + case MAJORAS_MASK_SPIN_ATTACK: Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 0xA, 0x400); Math_ApproachS(&this->unk_18D4, 0x2000, 1, 0x200); if (this->timers[1] != 0) { @@ -3637,7 +3762,7 @@ void Boss07_Mask_Spin(Boss07* this, PlayState* play) { 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->actionState = MAJORAS_MASK_SPIN_STATE_2; + this->actionState = MAJORAS_MASK_SPIN_END; this->timers[0] = 30; } else { Boss07_RandVec3fXZ(&this->moveTarget, 500.0f); @@ -3655,7 +3780,7 @@ void Boss07_Mask_Spin(Boss07* this, PlayState* play) { } } break; - case MAJORAS_MASK_SPIN_STATE_2: + case MAJORAS_MASK_SPIN_END: Math_ApproachS(&this->unk_18D4, 0, 1, 0x100); Math_ApproachS(&this->actor.world.rot.x, 0x2000, 0xA, 0x7D0); Boss07_SmoothStop(this, 0.5f); @@ -3769,7 +3894,7 @@ void Boss07_Mask_ClearBeam(Boss07* this) { void Boss07_Mask_SetupBeam(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Mask_Beam; - this->actionState = MAJORAS_MASK_BEAM_STATE_0; + this->actionState = MAJORAS_MASK_BEAM_CHARGE; this->timers[0] = 30; this->unk_170 = 0.0f; } @@ -3809,35 +3934,35 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Math_ApproachF(&this->unk_170, 4000.0f, 1.0f, 200.0f); this->unk_1874 = 1; switch (this->actionState) { - case MAJORAS_MASK_BEAM_STATE_0: + case MAJORAS_MASK_BEAM_CHARGE: if (this->timers[0] == 25) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST1_BLOW_OLD); } if (this->timers[0] == 0) { - this->actionState = MAJORAS_MASK_BEAM_STATE_1; + this->actionState = MAJORAS_MASK_BEAM_EYES; this->timers[0] = 6; this->unk_1898 = 1.0f; } break; - case MAJORAS_MASK_BEAM_STATE_1: + case MAJORAS_MASK_BEAM_EYES: Math_ApproachF(&this->unk_188C, 1.0f, 1.0f, 0.2f); if (this->timers[0] == 0) { - this->actionState = MAJORAS_MASK_BEAM_STATE_2; + this->actionState = MAJORAS_MASK_BEAM_FOCUS; this->timers[0] = 8; } break; - case MAJORAS_MASK_BEAM_STATE_2: + case MAJORAS_MASK_BEAM_FOCUS: 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->actionState = MAJORAS_MASK_BEAM_STATE_3; + this->actionState = MAJORAS_MASK_BEAM_ACTIVE; this->timers[0] = 100; } break; - case MAJORAS_MASK_BEAM_STATE_3: - case MAJORAS_MASK_BEAM_STATE_4: + case MAJORAS_MASK_BEAM_ACTIVE: + case MAJORAS_MASK_BEAM_REFLECT: play_sound(NA_SE_EN_LAST1_BEAM_OLD - SFX_FLAG); - case MAJORAS_MASK_BEAM_STATE_5: + case MAJORAS_MASK_BEAM_END: Math_ApproachF(&this->unk_1890, 1.0f, 0.2f, 0.2f); temp_f20 = player->actor.world.pos.x - this->unk_189C.x; temp_f12 = player->actor.world.pos.y - this->unk_189C.y + 20.0f; @@ -3847,7 +3972,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { if (BgCheck_EntityLineTest1(&play->colCtx, &this->unk_189C, &this->unk_18A8, &sp14C, &sp158, 1, 1, 1, 1, &sp144) && - (this->actionState != MAJORAS_MASK_BEAM_STATE_5)) { + (this->actionState != MAJORAS_MASK_BEAM_END)) { Vec3f sp138; Vec3f sp12C; Vec3f sp120; @@ -3882,8 +4007,8 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Matrix_MtxFToYXZRot(&player->shieldMf, &sp118, 0); sp118.y += 0x8000; sp118.x = -sp118.x; - if (this->actionState == MAJORAS_MASK_BEAM_STATE_3) { - this->actionState = MAJORAS_MASK_BEAM_STATE_4; + if (this->actionState == MAJORAS_MASK_BEAM_ACTIVE) { + this->actionState = MAJORAS_MASK_BEAM_REFLECT; this->unk_18C4 = sp118.x; this->unk_18C6 = sp118.y; } else { @@ -3903,7 +4028,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Matrix_Push(); Matrix_MultVec3f(&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->actionState != MAJORAS_MASK_BEAM_STATE_5)) { + (sp160.z <= (this->unk_18C0 * 16.666668f)) && (this->actionState != MAJORAS_MASK_BEAM_END)) { s32 phi_s0_2; Vec3f sp108; Vec3f spFC; @@ -3951,7 +4076,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { } Matrix_Pop(); for (sp178 = 0; sp178 < ARRAY_COUNT(sBossRemains); sp178++) { - if (sBossRemains[sp178]->actionState >= MAJORAS_REMAINS_STATE_2) { + if (sBossRemains[sp178]->actionState >= MAJORAS_REMAINS_DEATH) { continue; } sp16C.x = sBossRemains[sp178]->actor.world.pos.x - this->unk_18A8.x; @@ -3960,7 +4085,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { sp180 = sqrtf(SQXYZ(sp16C)); Matrix_MultVec3f(&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->actionState != MAJORAS_MASK_BEAM_STATE_5)) { + (sp160.z <= (this->unk_18C0 * 16.666668f)) && (this->actionState != MAJORAS_MASK_BEAM_END)) { s32 pad; Vec3f spE0; Vec3f spD4; @@ -3982,7 +4107,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Boss07_SpawnEffect(play, &spE0, &spD4, &spC8, Rand_ZeroFloat(10.0f) + 25.0f); sBossRemains[sp178]->unk_15E |= 0xA; } else { - sBossRemains[sp178]->actionState = MAJORAS_REMAINS_STATE_2; + sBossRemains[sp178]->actionState = MAJORAS_REMAINS_DEATH; sBossRemains[sp178]->unk_18D6 = 60; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FOLLOWERS_DEAD); for (pad = 0; pad < 20; pad++) { @@ -4006,7 +4131,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { } if (BgCheck_EntityLineTest1(&play->colCtx, &this->unk_18A8, &this->unk_18B4, &sp14C, &sp158, 1, 1, 1, 1, &sp144) && - (this->actionState != MAJORAS_MASK_BEAM_STATE_5)) { + (this->actionState != MAJORAS_MASK_BEAM_END)) { Vec3f spBC; Vec3f spB0; Vec3f spA4; @@ -4025,7 +4150,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Boss07_SpawnEffect(play, &spBC, &spB0, &spA4, Rand_ZeroFloat(10.0f) + 25.0f); } } - } else if (!player->isBurning && (this->actionState != MAJORAS_MASK_BEAM_STATE_5)) { + } else if (!player->isBurning && (this->actionState != MAJORAS_MASK_BEAM_END)) { s32 pad2; func_800B8D50(play, &this->actor, 5.0f, this->actor.shape.rot.y, 0.0f, 0x10); @@ -4046,9 +4171,9 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { } this->unk_18E0 = sp14C; } - if (this->actionState != MAJORAS_MASK_BEAM_STATE_5) { + if (this->actionState != MAJORAS_MASK_BEAM_END) { if (this->timers[0] == 0) { - this->actionState = MAJORAS_MASK_BEAM_STATE_5; + this->actionState = MAJORAS_MASK_BEAM_END; this->timers[0] = 20; } } else { @@ -4093,7 +4218,7 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { SREG(90) = this->unk_160; this->unk_1884 = 1; switch (this->csState) { - case 0: + case MAJORAS_MASK_INTRO_STATE_0: this->actor.world.pos.x = 0.0f; this->actor.world.pos.y = 277.0f; this->actor.world.pos.z = -922.5f; @@ -4106,9 +4231,9 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, this->subCamIndex, CAM_STATUS_ACTIVE); this->unk_ABC8 = 0; - this->csState = 1; + this->csState = MAJORAS_MASK_INTRO_STATE_1; this->unk_160 = KREG(76) + 150; - case 1: + case MAJORAS_MASK_INTRO_STATE_1: if (this->unk_ABC8 >= 20) { func_8019F128(NA_SE_EV_LIGHT_GATHER - SFX_FLAG); Math_ApproachF(&sMajoraStatic->unk_AB44, sREG(50) + 1.0f, 0.05f, sREG(51) + 0.05f); @@ -4131,7 +4256,7 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { } if (this->unk_ABC8 == 75) { this->unk_ABC8 = 0; - this->csState = 2; + this->csState = MAJORAS_MASK_INTRO_STATE_2; this->subCamEye.x = player->actor.world.pos.x; this->subCamEye.y = player->actor.world.pos.y + 20.0f; this->subCamEye.z = player->actor.world.pos.z - 60.0f + 120.0f; @@ -4141,16 +4266,16 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { } break; - case 2: + case MAJORAS_MASK_INTRO_STATE_2: this->unk_160 = KREG(77) + 150; if (this->unk_ABC8 >= 20) { Math_ApproachZeroF(&sMajoraStatic->unk_AB44, 1.0f, 0.05f); } if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_STATE_1; - sBossRemains[REMAINS_GYORG]->actionState = MAJORAS_REMAINS_STATE_1; - sBossRemains[REMAINS_GOHT]->actionState = MAJORAS_REMAINS_STATE_1; - sBossRemains[REMAINS_TWINMOLD]->actionState = MAJORAS_REMAINS_STATE_1; + sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_CS_FLY; + sBossRemains[REMAINS_GYORG]->actionState = MAJORAS_REMAINS_CS_FLY; + sBossRemains[REMAINS_GOHT]->actionState = MAJORAS_REMAINS_CS_FLY; + sBossRemains[REMAINS_TWINMOLD]->actionState = MAJORAS_REMAINS_CS_FLY; } if (this->unk_ABC8 == 0) { func_800B7298(play, &this->actor, 7); @@ -4158,23 +4283,23 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { if (this->unk_ABC8 == 120) { func_800B7298(play, &this->actor, 0x15); } - if (this->unk_ABC8 >= 0x1FU) { + if (this->unk_ABC8 > 30) { Math_ApproachF(&this->subCamAt.y, player->actor.world.pos.y + 24.0f + 20.0f, 0.05f, this->subCamSpeedMod); Math_ApproachF(&this->subCamSpeedMod, 1.0f, 1.0f, 0.01f); } if (this->unk_ABC8 >= 160) { if (this->unk_ABC8 == 160) { - sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_STATE_2; - sBossRemains[REMAINS_GYORG]->actionState = MAJORAS_REMAINS_STATE_2; - sBossRemains[REMAINS_GOHT]->actionState = MAJORAS_REMAINS_STATE_2; - sBossRemains[REMAINS_TWINMOLD]->actionState = MAJORAS_REMAINS_STATE_2; + sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_CS_ATTACH_WAIT; + sBossRemains[REMAINS_GYORG]->actionState = MAJORAS_REMAINS_CS_ATTACH_WAIT; + sBossRemains[REMAINS_GOHT]->actionState = MAJORAS_REMAINS_CS_ATTACH_WAIT; + sBossRemains[REMAINS_TWINMOLD]->actionState = MAJORAS_REMAINS_CS_ATTACH_WAIT; } if (this->unk_ABC8 == 161) { - sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_STATE_3; + sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_CS_ATTACH; } if ((this->unk_ABC8 == 180) || (this->unk_ABC8 == 200) || (this->unk_ABC8 == 220)) { this->unk_ABCC++; - sBossRemains[this->unk_ABCC]->actionState = MAJORAS_REMAINS_STATE_3; + sBossRemains[this->unk_ABCC]->actionState = MAJORAS_REMAINS_CS_ATTACH; } this->subCamEye.x = sIntroCamEyes[this->unk_ABCC].x; this->subCamEye.y = sIntroCamEyes[this->unk_ABCC].y; @@ -4183,7 +4308,7 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { this->subCamAt.y = sIntroCamAts[this->unk_ABCC].y; this->subCamAt.z = sIntroCamAts[this->unk_ABCC].z; if (this->unk_ABC8 == 250) { - this->csState = 3; + this->csState = MAJORAS_MASK_INTRO_STATE_3; this->unk_ABC8 = 0; this->subCamEye.x = this->actor.world.pos.x; this->subCamEye.y = this->actor.world.pos.y; @@ -4201,7 +4326,7 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { } } break; - case 3: + case MAJORAS_MASK_INTRO_STATE_3: this->unk_160 = KREG(78) + 150; if (this->unk_ABC8 >= 15) { Math_ApproachF(&this->subCamEye.z, -700.0f, 0.4f, 100.0f); @@ -4236,7 +4361,7 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { } } if (this->unk_ABC8 == 110) { - this->csState = 4; + this->csState = MAJORAS_MASK_INTRO_STATE_4; this->unk_ABC8 = 0; this->subCamEye.x = this->actor.world.pos.x + 200.0f; this->subCamEye.y = this->actor.world.pos.y; @@ -4246,7 +4371,7 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { this->unk_160 = KREG(74) + 200; } break; - case 4: + case MAJORAS_MASK_INTRO_STATE_4: this->unk_1884 = 0; if (this->unk_ABC8 >= 10) { Math_ApproachS(&this->unk_160, KREG(72), 1, KREG(73) + 2); @@ -4275,9 +4400,9 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { Math_ApproachF(&this->subCamSpeedMod, 1.0f, 1.0f, 0.03f); } if (this->unk_ABC8 == 175) { - Camera* sp5C = Play_GetCamera(play, 0); + Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); - this->csState = 0; + this->csState = MAJORAS_MASK_INTRO_STATE_0; Boss07_Mask_SetupIdle(this, play); this->timers[0] = 50; this->timers[2] = 200; @@ -4286,14 +4411,14 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { this->moveTarget.y = 200.0f; this->moveTarget.z = 0.0f; this->unk_170 = 0.0f; - sp5C->eye = this->subCamEye; - sp5C->eyeNext = this->subCamEye; - sp5C->at = this->subCamAt; + mainCam->eye = this->subCamEye; + mainCam->eyeNext = this->subCamEye; + mainCam->at = this->subCamAt; func_80169AFC(play, this->subCamIndex, 0); - this->subCamIndex = 0; + this->subCamIndex = SUB_CAM_ID_DONE; Cutscene_End(play, &play->csCtx); func_800B7298(play, &this->actor, 6); - this->actor.flags |= 1; + this->actor.flags |= ACTOR_FLAG_1; gSaveContext.eventInf[6] |= 2; func_80165690(); } @@ -4323,9 +4448,9 @@ void Boss07_Mask_SetupDeath(Boss07* this, PlayState* play) { Animation_MorphToLoop(&this->skelAnime, &gMajorasMaskJerkingAnim, -10.0f); this->actor.world.rot.y = this->actor.shape.rot.y = Math_Acot2F(-this->actor.world.pos.z, -this->actor.world.pos.x) * (0x8000 / M_PI); - this->csState = 0; + this->csState = MAJORAS_MASK_DEATH_STATE_0; this->unk_ABC8 = 0; - this->actor.flags &= ~1; + this->actor.flags &= ~ACTOR_FLAG_1; this->unk_15C = 20; } @@ -4345,15 +4470,15 @@ void Boss07_Mask_Death(Boss07* this, PlayState* play) { Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY); switch (this->csState) { - case 0: + case MAJORAS_MASK_DEATH_STATE_0: if (ActorCutscene_GetCurrentIndex() == -1) { Cutscene_Start(play, &play->csCtx); - func_800B7298(play, &this->actor, 1U); + func_800B7298(play, &this->actor, 1); this->subCamIndex = Play_CreateSubCamera(play); - Play_ChangeCameraStatus(play, 0, 1); - Play_ChangeCameraStatus(play, this->subCamIndex, 7); + Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); + Play_ChangeCameraStatus(play, this->subCamIndex, CAM_STATUS_ACTIVE); this->unk_ABC8 = 0; - this->csState = 1; + this->csState = MAJORAS_MASK_DEATH_STATE_1; this->subCamNextAt.z = 0.0f; this->unk_18D6 = 120; func_8016566C(150); @@ -4367,7 +4492,7 @@ void Boss07_Mask_Death(Boss07* this, PlayState* play) { } else { break; } - case 1: + case MAJORAS_MASK_DEATH_STATE_1: player->actor.world.pos.x = 0.0f; player->actor.world.pos.z = BREG(87) + 250.0f; player->actor.world.rot.y = player->actor.shape.rot.y = -0x8000; @@ -4383,13 +4508,13 @@ void Boss07_Mask_Death(Boss07* this, PlayState* play) { Math_ApproachZeroF(&this->unk_1870, 1.0f, 0.005f); } if (this->unk_ABC8 > 130) { - this->csState = 2; + this->csState = MAJORAS_MASK_DEATH_STATE_2; } else { break; } - case 2: + case MAJORAS_MASK_DEATH_STATE_2: Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, 0.0f, 0.0f, 0.0f, 0, this->actor.shape.rot.y, - this->subCamIndex, MAJORA_INCARNATION); + this->subCamIndex, MAJORAS_INCARNATION); Actor_MarkForDeath(&this->actor); break; } @@ -4594,7 +4719,7 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, PlayState* play, Vec3f* base, Vec Vec3f* sp7C = pull; if (this->unk_1874 != 0) { - for (i = 0; i < MAJORA_TENT_LENGTH; i++) { + for (i = 0; i < MAJORAS_TENT_LENGTH; i++) { Matrix_Push(); Matrix_RotateZF(arg9, MTXMODE_APPLY); sp98.x = Math_SinS((2 * i + this->actionTimer) * 0x1600) * 10; @@ -4607,7 +4732,7 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, PlayState* play, Vec3f* base, Vec Matrix_Pop(); } } - for (i = 0; i < MAJORA_TENT_LENGTH; i++, pull++) { + for (i = 0; i < MAJORAS_TENT_LENGTH; i++, pull++) { if (i == 0) { pos[0] = *base; } else { @@ -4622,11 +4747,11 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, PlayState* play, Vec3f* base, Vec pull = sp7C + 1; sp98.x = sp98.y = 0.0f; sp98.z = arg7 * 23.0f; - for (i = 1; i < MAJORA_TENT_LENGTH; i++, pull++, pos++, rot++) { - if (i < MAJORA_TENT_LENGTH / 2) { - sp80.x = arg6->x * (MAJORA_TENT_LENGTH / 2 - i) * 0.2f; - sp80.y = arg6->y * (MAJORA_TENT_LENGTH / 2 - i) * 0.2f; - sp80.z = arg6->z * (MAJORA_TENT_LENGTH / 2 - i) * 0.2f; + for (i = 1; i < MAJORAS_TENT_LENGTH; i++, pull++, pos++, rot++) { + if (i < MAJORAS_TENT_LENGTH / 2) { + sp80.x = arg6->x * (MAJORAS_TENT_LENGTH / 2 - i) * 0.2f; + sp80.y = arg6->y * (MAJORAS_TENT_LENGTH / 2 - i) * 0.2f; + sp80.z = arg6->z * (MAJORAS_TENT_LENGTH / 2 - i) * 0.2f; } else { sp80 = gZeroVec3f; } @@ -4669,15 +4794,15 @@ void Boss07_Mask_DrawTentacles(Boss07* this, PlayState* play, Vec3f* arg2, Vec3f f32 phi_f12; OPEN_DISPS(play->state.gfxCtx); - for (i = 0; i < MAJORA_TENT_LENGTH - 1; i++, arg2++, arg3++) { + for (i = 0; i < MAJORAS_TENT_LENGTH - 1; i++, arg2++, arg3++) { Matrix_Translate(arg2->x, arg2->y, arg2->z, MTXMODE_NEW); Matrix_RotateYF(arg3->y, MTXMODE_APPLY); Matrix_RotateXFApply(arg3->x); Matrix_RotateZF(arg5, MTXMODE_APPLY); - if (i <= (MAJORA_TENT_LENGTH - 1) / 2) { + if (i <= (MAJORAS_TENT_LENGTH - 1) / 2) { phi_f12 = 0.035f; } else { - phi_f12 = 0.035f - (i - (MAJORA_TENT_LENGTH - 1) / 2) * 60.0f * 0.0001f; + phi_f12 = 0.035f - (i - (MAJORAS_TENT_LENGTH - 1) / 2) * 60.0f * 0.0001f; } Matrix_Scale(phi_f12, phi_f12, arg4 * 0.01f * 2.3f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -4820,7 +4945,7 @@ void Boss07_Mask_Draw(Actor* thisx, PlayState* play2) { spA8.y = 20.0f; spA8.z = -2.0f; phi_f24 = 0.0f; - for (i = 0; i < MAJORA_TENT_COUNT; i++) { + for (i = 0; i < MAJORAS_TENT_COUNT; i++) { Matrix_Push(); Matrix_Push(); Matrix_RotateZF(phi_f24, MTXMODE_APPLY); @@ -4857,7 +4982,7 @@ void Boss07_Projectile_Update(Actor* thisx, PlayState* play2) { Player* player = GET_PLAYER(play); this->actionTimer++; - if (this->actor.params == MAJORA_REMAINS_SHOT) { + if (this->actor.params == MAJORAS_REMAINS_SHOT) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FOLLOWERS_BEAM - SFX_FLAG); } if (KREG(63) == 0) { @@ -4873,7 +4998,7 @@ void Boss07_Projectile_Update(Actor* thisx, PlayState* play2) { this->actionState = MAJORAS_PROJECTILE_STATE_1; this->actor.speedXZ = 30.0f; func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); - if (this->actor.params == MAJORA_INCARNATION_SHOT) { + if (this->actor.params == MAJORAS_INCARNATION_SHOT) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_FIRE_OLD); } } @@ -4922,8 +5047,8 @@ void Boss07_Remains_CollisionCheck(Boss07* this, PlayState* play) { Vec3f sp2C; ColliderInfo* hitbox; - if ((this->unk_15C == 0) && (this->cyl2.base.acFlags & 2)) { - this->cyl2.base.acFlags &= ~2; + if ((this->unk_15C == 0) && (this->cyl2.base.acFlags & AC_HIT)) { + this->cyl2.base.acFlags &= ~AC_HIT; this->unk_15C = 15; hitbox = this->cyl2.info.acHitInfo; if (hitbox->toucher.dmgFlags & 0x80) { @@ -4935,13 +5060,13 @@ void Boss07_Remains_CollisionCheck(Boss07* this, PlayState* play) { this->unk_15E = 15; this->actionFunc = Boss07_Remains_Fly; if ((s8)this->actor.colChkInfo.health <= 0) { - this->actionState = MAJORAS_REMAINS_STATE_2; + this->actionState = MAJORAS_REMAINS_DEATH; this->unk_18DA = 1; Enemy_StartFinishingBlow(play, &this->actor); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FOLLOWERS_DEAD); } else { - this->actionState = MAJORAS_REMAINS_STATE_10; - this->timers[0] = 0xF; + this->actionState = MAJORAS_REMAINS_DAMAGED; + this->timers[0] = 15; Boss07_Remains_DamageSfx(this); } Matrix_RotateYS(this->actor.yawTowardsPlayer, MTXMODE_NEW); @@ -4971,7 +5096,7 @@ void Boss07_Remains_Intro(Boss07* this, PlayState* play) { Player* player = GET_PLAYER(play); switch (this->actionState) { - case 0: + case MAJORAS_REMAINS_CS_WAIT: 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; @@ -4979,9 +5104,9 @@ void Boss07_Remains_Intro(Boss07* this, PlayState* play) { if (player->transformation == PLAYER_FORM_FIERCE_DEITY) { this->actor.world.pos.y += 30.0f + KREG(48); } - this->moveTarget.x = sRemainsStart[this->actor.params - MAJORA_REMAINS].x + player->actor.world.pos.x; - this->moveTarget.y = sRemainsStart[this->actor.params - MAJORA_REMAINS].y + player->actor.world.pos.y; - this->moveTarget.z = sRemainsStart[this->actor.params - MAJORA_REMAINS].z + player->actor.world.pos.z; + this->moveTarget.x = sRemainsStart[this->actor.params - MAJORAS_REMAINS].x + player->actor.world.pos.x; + this->moveTarget.y = sRemainsStart[this->actor.params - MAJORAS_REMAINS].y + player->actor.world.pos.y; + this->moveTarget.z = sRemainsStart[this->actor.params - MAJORAS_REMAINS].z + player->actor.world.pos.z; sp54 = this->moveTarget.x - this->actor.world.pos.x; sp50 = this->moveTarget.y - this->actor.world.pos.y; sp4C = this->moveTarget.z - this->actor.world.pos.z; @@ -4989,7 +5114,7 @@ void Boss07_Remains_Intro(Boss07* this, PlayState* play) { this->actor.world.rot.x = Math_Atan2S(sp50, sqrtf(SQ(sp54) + SQ(sp4C))); this->unk_AB40 = Rand_ZeroFloat(100.0f); break; - case 1: + case MAJORAS_REMAINS_CS_FLY: this->unk_ABC8++; this->unk_AB40++; this->unk_18C8 += 0x200; @@ -4997,9 +5122,9 @@ void Boss07_Remains_Intro(Boss07* this, PlayState* play) { Math_ApproachF(&this->actor.scale.x, 0.004f, 0.5f, 0.0002f); this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; if (this->unk_ABC8 > 90) { - this->moveTarget.x = sRemainsEnd[this->actor.params - MAJORA_REMAINS].x; + this->moveTarget.x = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].x; this->moveTarget.y = 370.0f; - this->moveTarget.z = sRemainsEnd[this->actor.params - MAJORA_REMAINS].z; + this->moveTarget.z = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].z; sp38 = 20.0f; sp34 = 0.5f; sp40 = 4096.0f; @@ -5025,24 +5150,24 @@ void Boss07_Remains_Intro(Boss07* this, PlayState* play) { Actor_UpdatePos(&this->actor); this->actor.shape.rot = this->actor.world.rot; break; - case 2: + case MAJORAS_REMAINS_CS_ATTACH_WAIT: Actor_SetScale(&this->actor, 0.0f); this->unk_188C = 0.0f; this->actor.speedXZ = 0.0f; - this->actor.world.pos.x = sRemainsEnd[this->actor.params - MAJORA_REMAINS].x * 0.6f; + this->actor.world.pos.x = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].x * 0.6f; this->actor.world.pos.y = 370.0f; - this->actor.world.pos.z = sRemainsEnd[this->actor.params - MAJORA_REMAINS].z * 0.6f; - this->actor.shape.rot.y = sRemainsEnd[this->actor.params - MAJORA_REMAINS].y; + this->actor.world.pos.z = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].z * 0.6f; + this->actor.shape.rot.y = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].y; this->unk_ABCC = 0; break; - case 3: + case MAJORAS_REMAINS_CS_ATTACH: this->unk_ABCC++; if (this->unk_ABCC == 10) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FOLLOWERS_STAY); } Actor_SetScale(&this->actor, 0.03f); - Math_ApproachF(&this->actor.world.pos.x, sRemainsEnd[this->actor.params - MAJORA_REMAINS].x, 0.5f, 40.0f); - Math_ApproachF(&this->actor.world.pos.z, sRemainsEnd[this->actor.params - MAJORA_REMAINS].z, 0.5f, 22.0f); + Math_ApproachF(&this->actor.world.pos.x, sRemainsEnd[this->actor.params - MAJORAS_REMAINS].x, 0.5f, 40.0f); + Math_ApproachF(&this->actor.world.pos.z, sRemainsEnd[this->actor.params - MAJORAS_REMAINS].z, 0.5f, 22.0f); break; } } @@ -5053,7 +5178,7 @@ void Boss07_Remains_SetupFly(Boss07* this, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); Collider_InitAndSetCylinder(play, &this->cyl2, &this->actor, &sRemainsCylInit); this->actor.colChkInfo.health = 5; - this->actionState = MAJORAS_REMAINS_STATE_0; + this->actionState = MAJORAS_REMAINS_WAIT; } void Boss07_Remains_Fly(Boss07* this, PlayState* play) { @@ -5068,7 +5193,7 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { Vec3f sp48; switch (this->actionState) { - case MAJORAS_REMAINS_STATE_20: + case MAJORAS_REMAINS_ACTIVATE: Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MUJURA_FOLLOWERS_FLY - SFX_FLAG); this->timers[0] = 80; this->timers[2] = 100.0f + Rand_ZeroFloat(100.0f); @@ -5076,13 +5201,13 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { this->actor.speedXZ = 5.0f; this->moveTarget = gZeroVec3f; this->actor.world.rot.y = Math_Atan2S(-this->actor.world.pos.x, -this->actor.world.pos.z); - this->actionState = 1; + this->actionState = MAJORAS_REMAINS_FLY; this->unk_1888 = 100; - this->cyl2.base.colType = 3; - this->actor.flags |= 0x201; + this->cyl2.base.colType = COLTYPE_HIT3; + this->actor.flags |= (ACTOR_FLAG_200 | ACTOR_FLAG_1); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_DEMO_BREAK); break; - case MAJORAS_REMAINS_STATE_1: + case MAJORAS_REMAINS_FLY: Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MUJURA_FOLLOWERS_FLY - SFX_FLAG); if (this->timers[2] == 0) { this->unk_18DB = 1; @@ -5124,7 +5249,7 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { } Boss07_Remains_CollisionCheck(this, play); break; - case MAJORAS_REMAINS_STATE_2: + case MAJORAS_REMAINS_DEATH: Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 1, 0x500); Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 100.0f, 100.0f, 5); @@ -5134,16 +5259,16 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { } Math_ApproachF(&this->actor.scale.z, 0.0f, 1.0f, 0.001f); if (this->actor.scale.z == 0.0f) { - this->actionState = 3; + this->actionState = MAJORAS_REMAINS_GONE; this->actor.draw = NULL; - this->actor.flags &= ~1; + this->actor.flags &= ~ACTOR_FLAG_1; } Boss07_SmoothStop(this, 2.0f); } else { this->actor.shape.rot.z += 0x200; } break; - case MAJORAS_REMAINS_STATE_10: + case MAJORAS_REMAINS_DAMAGED: Actor_MoveWithGravity(&this->actor); this->actor.world.pos.y -= 50.0f; this->actor.prevPos.y -= 50.0f; @@ -5154,10 +5279,10 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { this->actionState = 1; } break; - case MAJORAS_REMAINS_STATE_0: + case MAJORAS_REMAINS_WAIT: break; } - if (this->actionState < MAJORAS_REMAINS_STATE_2) { + if (this->actionState <= MAJORAS_REMAINS_FLY) { Collider_UpdateCylinder(&this->actor, &this->cyl2); CollisionCheck_SetAC(play, &play->colChkCtx, &this->cyl2.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->cyl2.base); @@ -5166,7 +5291,7 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { this->unk_18DB = 0; if ((Boss07_IsFacingPlayer(this, play) != 0) && (sMajorasMask->actionFunc != Boss07_Mask_Beam)) { Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, MAJORA_REMAINS_SHOT); + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, MAJORAS_REMAINS_SHOT); } } if (this->unk_18D6 != 0) { @@ -5205,7 +5330,7 @@ void Boss07_Remains_Stunned(Boss07* this, PlayState* play) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->cyl2.base); if (this->timers[0] == 0) { this->actionFunc = Boss07_Remains_Fly; - this->actionState = MAJORAS_REMAINS_STATE_1; + this->actionState = MAJORAS_REMAINS_FLY; } } @@ -5247,16 +5372,16 @@ void Boss07_Remains_Draw(Actor* thisx, PlayState* play2) { Matrix_RotateXFApply(sp60); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); switch (this->actor.params) { - case MAJORA_REMAINS + REMAINS_ODOLWA: + case MAJORAS_REMAINS + REMAINS_ODOLWA: gSPDisplayList(POLY_OPA_DISP++, gBossMaskOdolwaDL); break; - case MAJORA_REMAINS + REMAINS_GYORG: + case MAJORAS_REMAINS + REMAINS_GYORG: gSPDisplayList(POLY_OPA_DISP++, gBossMaskGyorgDL); break; - case MAJORA_REMAINS + REMAINS_GOHT: + case MAJORAS_REMAINS + REMAINS_GOHT: gSPDisplayList(POLY_OPA_DISP++, gBossMaskGohtDL); break; - case MAJORA_REMAINS + REMAINS_TWINMOLD: + case MAJORAS_REMAINS + REMAINS_TWINMOLD: gSPDisplayList(POLY_OPA_DISP++, gBossMaskTwinmoldDL); break; } @@ -5406,7 +5531,7 @@ void Boss07_Top_Collide(Boss07* this, PlayState* play) { top = (Boss07*)play->actorCtx.actorLists[ACTORCAT_BOSS].first; while (top != NULL) { - if ((this != top) && (top->actor.params == MAJORA_TOP) && (top->unk_158 == 0)) { + if ((this != top) && (top->actor.params == MAJORAS_TOP) && (top->unk_158 == 0)) { dx = top->actor.world.pos.x - this->actor.world.pos.x; dy = top->actor.world.pos.y - this->actor.world.pos.y; dz = top->actor.world.pos.z - this->actor.world.pos.z; @@ -5464,8 +5589,8 @@ void Boss07_Top_CollisionCheck(Boss07* this, PlayState* play) { this->cyl2.base.acFlags &= ~2; if (this->unk_15C == 0) { this->unk_15C = 5; - if ((this->actor.colChkInfo.damageEffect == 13) || (this->actor.colChkInfo.damageEffect == 10)) { - if (this->actor.colChkInfo.damageEffect == 13) { + if ((this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_D) || (this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_A)) { + if (this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_D) { player->unk_B84 = this->actor.yawTowardsPlayer; player->unk_B80 = 20.0f; } @@ -5478,17 +5603,17 @@ void Boss07_Top_CollisionCheck(Boss07* this, PlayState* play) { this->timers[0] = sREG(47) + 100; this->timers[1] = sREG(77) + 170; } - } else if (this->actor.colChkInfo.damageEffect == 10) { + } else if (this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_A) { this->actor.speedXZ = -15.0f; } else { this->actor.speedXZ = -7.0f; } } - } else if (this->actor.colChkInfo.damageEffect == 12) { + } else if (this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_C) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.speedXZ = 2.0f * -player->actor.speedXZ; sp38 = 1; - } else if (this->actor.colChkInfo.damageEffect == 11) { + } else if (this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_B) { this->actor.world.rot.y = Math_Atan2S(this->cyl2.base.ac->world.pos.x - this->actor.world.pos.x, this->cyl2.base.ac->world.pos.z - this->actor.world.pos.z); this->actor.speedXZ = -20.0f; @@ -5583,21 +5708,21 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { } this->unk_ABC8++; switch (this->csState) { - case 0: + case MAJORAS_STATIC_CS_STATE_0: if ((sMajorasMask != NULL) && sMajorasMask->unk_774) { - this->csState = 1; + this->csState = MAJORAS_STATIC_CS_STATE_1; this->unk_ABC8 = 0; } break; - case 1: + case MAJORAS_STATIC_CS_STATE_1: if (ActorCutscene_GetCurrentIndex() == -1) { Cutscene_Start(play, &play->csCtx); func_800B7298(play, &this->actor, 7); this->subCamIndex = Play_CreateSubCamera(play); - Play_ChangeCameraStatus(play, 0, 1); - Play_ChangeCameraStatus(play, this->subCamIndex, 7); + Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); + Play_ChangeCameraStatus(play, this->subCamIndex, CAM_STATUS_ACTIVE); this->unk_ABC8 = 0; - this->csState = 2; + this->csState = MAJORAS_STATIC_CS_STATE_2; func_8016566C(150); this->subCamEye.x = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.x * 0.7f; this->subCamEye.y = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.y * 0.7f; @@ -5605,15 +5730,15 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { } else { break; } - case 2: + case MAJORAS_STATIC_CS_STATE_2: if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_STATE_20; + sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_ACTIVATE; } this->subCamAt.x = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.x; this->subCamAt.y = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.y; this->subCamAt.z = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.z; if (this->unk_ABC8 == 40) { - this->csState = 3; + this->csState = MAJORAS_STATIC_CS_STATE_3; this->unk_ABC8 = 0; this->subCamEye.x = sBossRemains[REMAINS_GYORG]->actor.world.pos.x * 0.7f; this->subCamEye.y = sBossRemains[REMAINS_GYORG]->actor.world.pos.y * 0.7f; @@ -5621,15 +5746,15 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { } else { break; } - case 3: + case MAJORAS_STATIC_CS_STATE_3: if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_GYORG]->actionState = MAJORAS_REMAINS_STATE_20; + sBossRemains[REMAINS_GYORG]->actionState = MAJORAS_REMAINS_ACTIVATE; } this->subCamAt.x = sBossRemains[REMAINS_GYORG]->actor.world.pos.x; this->subCamAt.y = sBossRemains[REMAINS_GYORG]->actor.world.pos.y; this->subCamAt.z = sBossRemains[REMAINS_GYORG]->actor.world.pos.z; if (this->unk_ABC8 == 40) { - this->csState = 4; + this->csState = MAJORAS_STATIC_CS_STATE_4; this->unk_ABC8 = 0; this->subCamEye.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x * 0.7f; this->subCamEye.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y * 0.7f; @@ -5637,15 +5762,15 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { } else { break; } - case 4: + case MAJORAS_STATIC_CS_STATE_4: if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_GOHT]->actionState = MAJORAS_REMAINS_STATE_20; + sBossRemains[REMAINS_GOHT]->actionState = MAJORAS_REMAINS_ACTIVATE; } this->subCamAt.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x; this->subCamAt.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y; this->subCamAt.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z; if (this->unk_ABC8 == 40) { - this->csState = 5; + this->csState = MAJORAS_STATIC_CS_STATE_5; this->unk_ABC8 = 0; this->subCamEye.x = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.x * 0.7f; this->subCamEye.y = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.y * 0.7f; @@ -5653,22 +5778,22 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { } else { break; } - case 5: + case MAJORAS_STATIC_CS_STATE_5: if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_TWINMOLD]->actionState = MAJORAS_REMAINS_STATE_20; + sBossRemains[REMAINS_TWINMOLD]->actionState = MAJORAS_REMAINS_ACTIVATE; } this->subCamAt.x = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.x; this->subCamAt.y = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.y; this->subCamAt.z = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.z; if (this->unk_ABC8 == 40) { - Camera* camera = Play_GetCamera(play, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); s32 i; - this->csState = 6; + this->csState = MAJORAS_STATIC_CS_STATE_6; this->unk_ABC8 = 0; - camera->eye = this->subCamEye; - camera->eyeNext = this->subCamEye; - camera->at = this->subCamAt; + mainCam->eye = this->subCamEye; + mainCam->eyeNext = this->subCamEye; + mainCam->at = this->subCamAt; func_80169AFC(play, this->subCamIndex, 0); this->subCamIndex = SUB_CAM_ID_DONE; Cutscene_End(play, &play->csCtx); @@ -5679,7 +5804,7 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { } } break; - case 6: + case MAJORAS_STATIC_CS_STATE_6: break; } if (this->subCamIndex != 0) { @@ -5714,7 +5839,7 @@ void Boss07_Static_UpdateEffects(PlayState* play) { s32 i; for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { - if (effect->type != MAJORA_EFFECT_NONE) { + if (effect->type != MAJORAS_EFFECT_NONE) { effect->scroll++; effect->pos.x += effect->vel.x; @@ -5724,12 +5849,12 @@ void Boss07_Static_UpdateEffects(PlayState* play) { effect->vel.x += effect->accel.x; effect->vel.y += effect->accel.y; effect->vel.z += effect->accel.z; - if (effect->type == MAJORA_EFFECT_FLAME) { + if (effect->type == MAJORAS_EFFECT_FLAME) { if (effect->isFading) { effect->alpha -= (i % 8U) + 13; if (effect->alpha <= 0) { effect->alpha = 0; - effect->type = MAJORA_EFFECT_NONE; + effect->type = MAJORAS_EFFECT_NONE; } } else { effect->alpha += 300; @@ -5751,7 +5876,7 @@ void Boss07_Static_DrawEffects(PlayState* play) { OPEN_DISPS(gfxCtx); func_8012C2DC(play->state.gfxCtx); for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { - if (effect->type > MAJORA_EFFECT_NONE) { + if (effect->type > MAJORAS_EFFECT_NONE) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, effect->alpha); gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 255, 215, 255, 128); 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 75dadf0cb..124ed8e1c 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -6,20 +6,20 @@ struct Boss07; -#define MAJORA_TENT_LENGTH 10 -#define MAJORA_TENT_COUNT 25 -#define MAJORA_TENT_MAX 100 -#define MAJORA_WHIP_MAX_LENGTH 50 +#define MAJORAS_TENT_LENGTH 10 +#define MAJORAS_TENT_COUNT 25 +#define MAJORAS_TENT_MAX 100 +#define MAJORAS_WHIP_MAX_LENGTH 50 -#define MAJORA_LIMB_COUNT MAX(MAJORAS_MASK_LIMB_MAX, MAX(MAJORAS_INCARNATION_LIMB_MAX, MAJORAS_WRATH_LIMB_MAX)) +#define MAJORAS_LIMB_COUNT MAX(MAJORAS_MASK_LIMB_MAX, MAX(MAJORAS_INCARNATION_LIMB_MAX, MAJORAS_WRATH_LIMB_MAX)) typedef void (*Boss07ActionFunc)(struct Boss07*, struct PlayState*); typedef struct { Vec3f base; - Vec3f pos[MAJORA_TENT_LENGTH]; - Vec3f rot[MAJORA_TENT_LENGTH]; - Vec3f pull[MAJORA_TENT_LENGTH]; + Vec3f pos[MAJORAS_TENT_LENGTH]; + Vec3f rot[MAJORAS_TENT_LENGTH]; + Vec3f pull[MAJORAS_TENT_LENGTH]; } Boss07Tentacle; // size = 0x174 (0xC + 0x24 * length) typedef struct { @@ -29,10 +29,10 @@ typedef struct { f32 drag; f32 tension; Vec3f basePos; - 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 + Vec3f pos[MAJORAS_WHIP_MAX_LENGTH]; + Vec3f rot[MAJORAS_WHIP_MAX_LENGTH]; + Vec3f pull[MAJORAS_WHIP_MAX_LENGTH]; + f32 unk_72C[MAJORAS_WHIP_MAX_LENGTH]; // unused, probably a stretch factor } Boss07Whip; // size = 0x7F4 (0x24 + 0x28 * max) typedef struct Boss07 { @@ -65,8 +65,8 @@ typedef struct Boss07 { /* 0x0190 */ SkelAnime skelAnime; /* 0x01D4 */ f32 unk_1D4; /* 0x01D8 */ s32 unk_1D8; - /* 0x01DC */ Vec3s jointTable[MAJORA_LIMB_COUNT]; - /* 0x0284 */ Vec3s morphTable[MAJORA_LIMB_COUNT]; + /* 0x01DC */ Vec3s jointTable[MAJORAS_LIMB_COUNT]; + /* 0x0284 */ Vec3s morphTable[MAJORAS_LIMB_COUNT]; /* 0x032C */ f32 unk_32C; /* 0x0330 */ f32 unk_330; /* 0x0334 */ Vec3f bodyPartsPos[15]; @@ -142,7 +142,7 @@ typedef struct Boss07 { /* 0x18ED */ u8 unk_18ED; /* 0x18F0 */ ColliderQuad quad1; /* 0x1970 */ ColliderQuad quad2; - /* 0x19F0 */ Boss07Tentacle tentacles[MAJORA_TENT_MAX]; + /* 0x19F0 */ Boss07Tentacle tentacles[MAJORAS_TENT_MAX]; /* 0xAB40 */ s16 unk_AB40; /* 0xAB44 */ f32 unk_AB44; /* 0xAB48 */ u8 unk_AB48; @@ -167,17 +167,17 @@ typedef struct Boss07 { extern const ActorInit Boss_07_InitVars; typedef enum { - /* 0 */ MAJORA_BOSS, - /* 10 */ MAJORA_MASK = 10, - /* 11 */ MAJORA_MASK_CS, - /* 20 */ MAJORA_INCARNATION = 20, - /* 21 */ MAJORA_AFTERIMAGE, - /* 30 */ MAJORA_WRATH = 30, - /* 100 */ MAJORA_REMAINS_SHOT = 100, - /* 101 */ MAJORA_INCARNATION_SHOT, - /* 150 */ MAJORA_STATIC = 150, - /* 180 */ MAJORA_TOP = 180, - /* 200 */ MAJORA_REMAINS = 200, + /* 0 */ MAJORAS_BOSS, + /* 10 */ MAJORAS_MASK = 10, + /* 11 */ MAJORAS_MASK_CS, + /* 20 */ MAJORAS_INCARNATION = 20, + /* 21 */ MAJORAS_AFTERIMAGE, + /* 30 */ MAJORAS_WRATH = 30, + /* 100 */ MAJORAS_REMAINS_SHOT = 100, + /* 101 */ MAJORAS_INCARNATION_SHOT, + /* 150 */ MAJORAS_STATIC = 150, + /* 180 */ MAJORAS_TOP = 180, + /* 200 */ MAJORAS_REMAINS = 200, } MajoraParams; #endif // Z_BOSS_07_H diff --git a/src/overlays/actors/ovl_Boss_07/z_boss_07_colchk.c b/src/overlays/actors/ovl_Boss_07/z_boss_07_colchk.inc similarity index 100% rename from src/overlays/actors/ovl_Boss_07/z_boss_07_colchk.c rename to src/overlays/actors/ovl_Boss_07/z_boss_07_colchk.inc 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 deleted file mode 100644 index 99df08a94..000000000 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07_dmgtbl.c +++ /dev/null @@ -1,176 +0,0 @@ -#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/src/overlays/actors/ovl_Boss_07/z_boss_07_dmgtbl.inc b/src/overlays/actors/ovl_Boss_07/z_boss_07_dmgtbl.inc new file mode 100644 index 000000000..58387c660 --- /dev/null +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07_dmgtbl.inc @@ -0,0 +1,176 @@ +#include "global.h" + +static DamageTable sMaskDmgTable = { + /* Deku Nut */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* Deku Stick */ DMG_ENTRY(1, MAJORAS_MASK_DMGEFF_F), + /* Horse trample */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* Explosives */ DMG_ENTRY(2, MAJORAS_MASK_DMGEFF_F), + /* Zora boomerang */ DMG_ENTRY(1, MAJORAS_MASK_DMGEFF_F), + /* Normal arrow */ DMG_ENTRY(1, MAJORAS_MASK_DMGEFF_F), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* Hookshot */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* Goron punch */ DMG_ENTRY(1, MAJORAS_MASK_DMGEFF_F), + /* Sword */ DMG_ENTRY(1, MAJORAS_MASK_DMGEFF_F), + /* Goron pound */ DMG_ENTRY(1, MAJORAS_MASK_DMGEFF_F), + /* Fire arrow */ DMG_ENTRY(2, MAJORAS_MASK_DMGEFF_2), + /* Ice arrow */ DMG_ENTRY(2, MAJORAS_MASK_DMGEFF_3), + /* Light arrow */ DMG_ENTRY(2, MAJORAS_MASK_DMGEFF_4), + /* Goron spikes */ DMG_ENTRY(1, MAJORAS_MASK_DMGEFF_F), + /* Deku spin */ DMG_ENTRY(1, MAJORAS_MASK_DMGEFF_F), + /* Deku bubble */ DMG_ENTRY(1, MAJORAS_MASK_DMGEFF_F), + /* Deku launch */ DMG_ENTRY(1, MAJORAS_MASK_DMGEFF_F), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* Zora barrier */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* Normal shield */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* Light ray */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* Thrown object */ DMG_ENTRY(1, MAJORAS_MASK_DMGEFF_F), + /* Zora punch */ DMG_ENTRY(1, MAJORAS_MASK_DMGEFF_F), + /* Spin attack */ DMG_ENTRY(2, MAJORAS_MASK_DMGEFF_F), + /* Sword beam */ DMG_ENTRY(2, MAJORAS_MASK_DMGEFF_9), + /* Normal Roll */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* UNK_DMG_0x1B */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* UNK_DMG_0x1C */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* Unblockable */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* UNK_DMG_0x1E */ DMG_ENTRY(0, MAJORAS_MASK_DMGEFF_0), + /* Powder Keg */ DMG_ENTRY(2, MAJORAS_MASK_DMGEFF_F), +}; + +static DamageTable sIncarnationDmgTable = { + /* Deku Nut */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_0), + /* Deku Stick */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_F), + /* Horse trample */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_0), + /* Explosives */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_C), + /* Zora boomerang */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_F), + /* Normal arrow */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_F), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_0), + /* Hookshot */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_0), + /* Goron punch */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_E), + /* Sword */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_E), + /* Goron pound */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_F), + /* Fire arrow */ DMG_ENTRY(2, MAJORAS_INCARNATION_DMGEFF_2), + /* Ice arrow */ DMG_ENTRY(2, MAJORAS_INCARNATION_DMGEFF_3), + /* Light arrow */ DMG_ENTRY(2, MAJORAS_INCARNATION_DMGEFF_4), + /* Goron spikes */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_F), + /* Deku spin */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_F), + /* Deku bubble */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_F), + /* Deku launch */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_F), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_0), + /* Zora barrier */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_A), + /* Normal shield */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_0), + /* Light ray */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_0), + /* Thrown object */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_F), + /* Zora punch */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_F), + /* Spin attack */ DMG_ENTRY(1, MAJORAS_INCARNATION_DMGEFF_D), + /* Sword beam */ DMG_ENTRY(2, MAJORAS_INCARNATION_DMGEFF_9), + /* Normal Roll */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_0), + /* UNK_DMG_0x1B */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_0), + /* UNK_DMG_0x1C */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_0), + /* Unblockable */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_0), + /* UNK_DMG_0x1E */ DMG_ENTRY(0, MAJORAS_INCARNATION_DMGEFF_0), + /* Powder Keg */ DMG_ENTRY(4, MAJORAS_INCARNATION_DMGEFF_C), +}; + +static DamageTable sWrathDmgTable = { + /* Deku Nut */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_0), + /* Deku Stick */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_E), + /* Horse trample */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_0), + /* Explosives */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_C), + /* Zora boomerang */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_F), + /* Normal arrow */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_F), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_0), + /* Hookshot */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_0), + /* Goron punch */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_E), + /* Sword */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_E), + /* Goron pound */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_F), + /* Fire arrow */ DMG_ENTRY(2, MAJORAS_WRATH_DMGEFF_2), + /* Ice arrow */ DMG_ENTRY(2, MAJORAS_WRATH_DMGEFF_3), + /* Light arrow */ DMG_ENTRY(2, MAJORAS_WRATH_DMGEFF_4), + /* Goron spikes */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_E), + /* Deku spin */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_E), + /* Deku bubble */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_F), + /* Deku launch */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_E), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_0), + /* Zora barrier */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_A), + /* Normal shield */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_0), + /* Light ray */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_0), + /* Thrown object */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_F), + /* Zora punch */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_E), + /* Spin attack */ DMG_ENTRY(1, MAJORAS_WRATH_DMGEFF_D), + /* Sword beam */ DMG_ENTRY(2, MAJORAS_WRATH_DMGEFF_9), + /* Normal Roll */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_0), + /* UNK_DMG_0x1B */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_0), + /* UNK_DMG_0x1C */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_0), + /* Unblockable */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_0), + /* UNK_DMG_0x1E */ DMG_ENTRY(0, MAJORAS_WRATH_DMGEFF_0), + /* Powder Keg */ DMG_ENTRY(2, MAJORAS_WRATH_DMGEFF_C), +}; + +static DamageTable sRemainsDmgTable = { + /* Deku Nut */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* Deku Stick */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_F), + /* Horse trample */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* Explosives */ DMG_ENTRY(2, MAJORAS_REMAINS_DMGEFF_E), + /* Zora boomerang */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_F), + /* Normal arrow */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_F), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* Hookshot */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* Goron punch */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_E), + /* Sword */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_E), + /* Goron pound */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_F), + /* Fire arrow */ DMG_ENTRY(2, MAJORAS_REMAINS_DMGEFF_2), + /* Ice arrow */ DMG_ENTRY(2, MAJORAS_REMAINS_DMGEFF_3), + /* Light arrow */ DMG_ENTRY(2, MAJORAS_REMAINS_DMGEFF_4), + /* Goron spikes */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_F), + /* Deku spin */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_F), + /* Deku bubble */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_F), + /* Deku launch */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_F), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* Zora barrier */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* Normal shield */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* Light ray */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* Thrown object */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_F), + /* Zora punch */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_F), + /* Spin attack */ DMG_ENTRY(1, MAJORAS_REMAINS_DMGEFF_D), + /* Sword beam */ DMG_ENTRY(2, MAJORAS_REMAINS_DMGEFF_9), + /* Normal Roll */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* UNK_DMG_0x1B */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* UNK_DMG_0x1C */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* Unblockable */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* UNK_DMG_0x1E */ DMG_ENTRY(0, MAJORAS_REMAINS_DMGEFF_0), + /* Powder Keg */ DMG_ENTRY(2, MAJORAS_REMAINS_DMGEFF_E), +}; + +static DamageTable sTopDmgTable = { + /* Deku Nut */ DMG_ENTRY(0, MAJORAS_TOP_DMGEFF_0), + /* Deku Stick */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_D), + /* Horse trample */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_E), + /* Explosives */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_B), + /* Zora boomerang */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_F), + /* Normal arrow */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_F), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, MAJORAS_TOP_DMGEFF_0), + /* Hookshot */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_E), + /* Goron punch */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_E), + /* Sword */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_D), + /* Goron pound */ DMG_ENTRY(0, MAJORAS_TOP_DMGEFF_0), + /* Fire arrow */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_E), + /* Ice arrow */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_E), + /* Light arrow */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_E), + /* Goron spikes */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_C), + /* Deku spin */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_F), + /* Deku bubble */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_F), + /* Deku launch */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_F), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, MAJORAS_TOP_DMGEFF_0), + /* Zora barrier */ DMG_ENTRY(0, MAJORAS_TOP_DMGEFF_0), + /* Normal shield */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_D), + /* Light ray */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_D), + /* Thrown object */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_E), + /* Zora punch */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_E), + /* Spin attack */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_A), + /* Sword beam */ DMG_ENTRY(1, MAJORAS_TOP_DMGEFF_A), + /* Normal Roll */ DMG_ENTRY(0, MAJORAS_TOP_DMGEFF_0), + /* UNK_DMG_0x1B */ DMG_ENTRY(0, MAJORAS_TOP_DMGEFF_0), + /* UNK_DMG_0x1C */ DMG_ENTRY(0, MAJORAS_TOP_DMGEFF_0), + /* Unblockable */ DMG_ENTRY(0, MAJORAS_TOP_DMGEFF_0), + /* UNK_DMG_0x1E */ DMG_ENTRY(0, MAJORAS_TOP_DMGEFF_0), + /* Powder Keg */ DMG_ENTRY(2, MAJORAS_TOP_DMGEFF_B), +}; From b208ed5e7ac5730784f91e5d128001aa470f7427 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Thu, 25 Aug 2022 10:25:54 -0500 Subject: [PATCH 24/28] if? --- include/libc/math.h | 1 + src/overlays/actors/ovl_Boss_07/z_boss_07.c | 2098 +++++++++-------- src/overlays/actors/ovl_Boss_07/z_boss_07.h | 190 +- .../actors/ovl_Boss_07/z_boss_07_colchk.inc | 6 +- 4 files changed, 1166 insertions(+), 1129 deletions(-) diff --git a/include/libc/math.h b/include/libc/math.h index 1cdac0fb3..13c50d64b 100644 --- a/include/libc/math.h +++ b/include/libc/math.h @@ -5,6 +5,7 @@ #define M_PI 3.14159265358979323846f #define M_SQRT2 1.41421356237309504880f +#define M_SQRT3 1.7320508075688772935274463415059f #define M_SQRT1_2 0.70710678118654752440f /* 1/sqrt(2) */ #define FLT_MAX 340282346638528859811704183484516925440.0f #define SHT_MAX 32767.0f 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 5adaaaf99..b78d24897 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -37,12 +37,12 @@ typedef struct { typedef enum { MAJORAS_WRATH_DMGEFF_0, - MAJORAS_WRATH_DMGEFF_2=2, + MAJORAS_WRATH_DMGEFF_2 = 2, MAJORAS_WRATH_DMGEFF_3, MAJORAS_WRATH_DMGEFF_4, - MAJORAS_WRATH_DMGEFF_9=9, + MAJORAS_WRATH_DMGEFF_9 = 9, MAJORAS_WRATH_DMGEFF_A, - MAJORAS_WRATH_DMGEFF_C=0xC, + MAJORAS_WRATH_DMGEFF_C = 0xC, MAJORAS_WRATH_DMGEFF_D, MAJORAS_WRATH_DMGEFF_E, MAJORAS_WRATH_DMGEFF_F, @@ -50,12 +50,12 @@ typedef enum { typedef enum { MAJORAS_INCARNATION_DMGEFF_0, - MAJORAS_INCARNATION_DMGEFF_2=2, + MAJORAS_INCARNATION_DMGEFF_2 = 2, MAJORAS_INCARNATION_DMGEFF_3, MAJORAS_INCARNATION_DMGEFF_4, - MAJORAS_INCARNATION_DMGEFF_9=9, + MAJORAS_INCARNATION_DMGEFF_9 = 9, MAJORAS_INCARNATION_DMGEFF_A, - MAJORAS_INCARNATION_DMGEFF_C=0xC, + MAJORAS_INCARNATION_DMGEFF_C = 0xC, MAJORAS_INCARNATION_DMGEFF_D, MAJORAS_INCARNATION_DMGEFF_E, MAJORAS_INCARNATION_DMGEFF_F, @@ -63,21 +63,21 @@ typedef enum { typedef enum { MAJORAS_MASK_DMGEFF_0, - MAJORAS_MASK_DMGEFF_2=2, + MAJORAS_MASK_DMGEFF_2 = 2, MAJORAS_MASK_DMGEFF_3, MAJORAS_MASK_DMGEFF_4, - MAJORAS_MASK_DMGEFF_9=9, - MAJORAS_MASK_DMGEFF_F=0xF, + MAJORAS_MASK_DMGEFF_9 = 9, + MAJORAS_MASK_DMGEFF_F = 0xF, } Boss07MaskDamageEffect; typedef enum { MAJORAS_REMAINS_DMGEFF_0, - MAJORAS_REMAINS_DMGEFF_2=2, + MAJORAS_REMAINS_DMGEFF_2 = 2, MAJORAS_REMAINS_DMGEFF_3, MAJORAS_REMAINS_DMGEFF_4, - MAJORAS_REMAINS_DMGEFF_9=9, + MAJORAS_REMAINS_DMGEFF_9 = 9, MAJORAS_REMAINS_DMGEFF_A, - MAJORAS_REMAINS_DMGEFF_C=0xC, + MAJORAS_REMAINS_DMGEFF_C = 0xC, MAJORAS_REMAINS_DMGEFF_D, MAJORAS_REMAINS_DMGEFF_E, MAJORAS_REMAINS_DMGEFF_F, @@ -85,7 +85,7 @@ typedef enum { typedef enum { MAJORAS_TOP_DMGEFF_0, - MAJORAS_TOP_DMGEFF_A=0xA, + MAJORAS_TOP_DMGEFF_A = 0xA, MAJORAS_TOP_DMGEFF_B, MAJORAS_TOP_DMGEFF_C, MAJORAS_TOP_DMGEFF_D, @@ -107,15 +107,15 @@ typedef enum { } Boss07EffectType; typedef enum { - MAJORAS_WRATH_ATTACK_0, - MAJORAS_WRATH_ATTACK_1, - MAJORAS_WRATH_ATTACK_2, - MAJORAS_WRATH_ATTACK_3, - MAJORAS_WRATH_ATTACK_4, - MAJORAS_WRATH_ATTACK_5, - MAJORAS_WRATH_ATTACK_6, - MAJORAS_WRATH_ATTACK_7, - MAJORAS_WRATH_ATTACK_MAX, + MAJORAS_WRATH_QUICK_WHIP, + MAJORAS_WRATH_FLURRY, + MAJORAS_WRATH_DOUBLE_WHIP, + MAJORAS_WRATH_LONG_WHIP, + MAJORAS_WRATH_SPIN_ATTACK, + MAJORAS_WRATH_TAUNT, + MAJORAS_WRATH_THREE_HIT, + MAJORAS_WRATH_KICK, + MAJORAS_WRATH_ATTACK_MAX, } Boss07WrathActionState; typedef enum { @@ -153,8 +153,8 @@ typedef enum { MAJORAS_REMAINS_FLY, MAJORAS_REMAINS_DEATH, MAJORAS_REMAINS_GONE, - MAJORAS_REMAINS_DAMAGED=10, - MAJORAS_REMAINS_ACTIVATE=20, + MAJORAS_REMAINS_DAMAGED = 10, + MAJORAS_REMAINS_ACTIVATE = 20, } Boss07RemainsState; typedef enum { @@ -165,8 +165,8 @@ typedef enum { } Boss07RemainsCsState; typedef enum { - MAJORAS_TOP_STATE_0, - MAJORAS_TOP_STATE_1, + MAJORAS_TOP_IN_AIR, + MAJORAS_TOP_ON_GROUND, MAJORAS_TOP_STATE_MAX, } Boss07TopStates; @@ -201,7 +201,7 @@ typedef enum { MAJORAS_INCARNATION_DEATH_STATE_2, MAJORAS_INCARNATION_DEATH_STATE_3, MAJORAS_INCARNATION_DEATH_STATE_4, - MAJORAS_INCARNATION_DEATH_STATE_10=10, + MAJORAS_INCARNATION_DEATH_STATE_10 = 10, } Boss07IncarnationDeathState; typedef enum { @@ -261,7 +261,7 @@ void Boss07_Wrath_SetupSpawnTop(Boss07* this, PlayState* play); void Boss07_Wrath_SpawnTop(Boss07* this, PlayState* play); void Boss07_Wrath_SetupStunned(Boss07* this, PlayState* play); void Boss07_Wrath_Stunned(Boss07* this, PlayState* play); -void Boss07_Wrath_SetupDamaged(Boss07* this, PlayState* play, u8 damage, u8 effect); +void Boss07_Wrath_SetupDamaged(Boss07* this, PlayState* play, u8 damage, u8 dmgEffect); void Boss07_Wrath_Damaged(Boss07* this, PlayState* play); void Boss07_Wrath_ThrowPlayer(Boss07* this, PlayState* play); @@ -296,7 +296,7 @@ void Boss07_Mask_SetupBeam(Boss07* this, PlayState* play); void Boss07_Mask_Beam(Boss07* this, PlayState* play); void Boss07_Mask_SetupStunned(Boss07* this, PlayState* play); void Boss07_Mask_Stunned(Boss07* this, PlayState* play); -void Boss07_Mask_SetupDamaged(Boss07* this, PlayState* play, u8 arg2, Actor* hitActor); +void Boss07_Mask_SetupDamaged(Boss07* this, PlayState* play, u8 damage, Actor* hitActor); void Boss07_Mask_Damaged(Boss07* this, PlayState* play); void Boss07_Mask_SetupIntro(Boss07* this, PlayState* play); void Boss07_Mask_Intro(Boss07* this, PlayState* play); @@ -316,8 +316,8 @@ void Boss07_Incarnation_Hopak(Boss07* this, PlayState* play); void Boss07_Incarnation_Moonwalk(Boss07* this, PlayState* play); void Boss07_Incarnation_Pirouette(Boss07* this, PlayState* play); void Boss07_Incarnation_Death(Boss07* this, PlayState* play); -void Boss07_Incarnation_SetupDamaged(Boss07* this, PlayState* play, u8 arg2, u8 arg3); -void Boss07_Incarnation_SetupStunned(Boss07* this, PlayState* play, s16 arg2); +void Boss07_Incarnation_SetupDamaged(Boss07* this, PlayState* play, u8 damage, u8 dmgEffect); +void Boss07_Incarnation_SetupStunned(Boss07* this, PlayState* play, s16 stunTime); void Boss07_Incarnation_SetupDeath(Boss07* this, PlayState* play); void Boss07_Incarnation_SetupRun(Boss07* this, PlayState* play); void Boss07_Incarnation_SetupTaunt(Boss07* this, PlayState* play); @@ -340,14 +340,14 @@ void Boss07_Static_UpdateEffects(PlayState* play); void Boss07_Static_DrawEffects(PlayState* play); #endif -static s16 sColorsYRGB[4][3] = { +static s16 sShotEnvColors[4][3] = { { 255, 255, 100 }, // light yellow { 255, 100, 100 }, // light red { 100, 255, 100 }, // light green { 100, 100, 255 }, // light blue }; -static s16 sColorsWhite[4][3] = { +static s16 sShotPrimColors[4][3] = { { 255, 255, 255 }, // white { 255, 255, 255 }, // white { 255, 255, 255 }, // white @@ -409,7 +409,7 @@ f32 Boss07_RandZeroOne(void) { return fabsf(randFloat); } -void Boss07_SpawnEffect(PlayState* play, Vec3f* pos, Vec3f* vel, Vec3f* accel, f32 arg4) { +void Boss07_SpawnEffect(PlayState* play, Vec3f* pos, Vec3f* vel, Vec3f* accel, f32 scale) { s32 i; Boss07Effect* effect = (Boss07Effect*)play->specialEffects; @@ -419,7 +419,7 @@ void Boss07_SpawnEffect(PlayState* play, Vec3f* pos, Vec3f* vel, Vec3f* accel, f effect->pos = *pos; effect->vel = *vel; effect->accel = *accel; - effect->scale = arg4 / 1000.0f; + effect->scale = scale / 1000.0f; effect->isFading = 0; effect->alpha = 0; effect->scroll = Rand_ZeroFloat(1000.0f); @@ -458,7 +458,7 @@ void Boss07_RandVec3fXZ(Vec3f* dst, f32 length) { Matrix_MultVecZ(length, dst); } -void Boss07_SpawnDust(Boss07* this, PlayState* play, u8 spawnInterval, u8 mode) { +void Boss07_Incarnation_SpawnDust(Boss07* this, PlayState* play, u8 spawnInterval, u8 spawnAtFocus) { static Color_RGBA8 sDarkOrange = { 60, 50, 20, 255 }; static Color_RGBA8 sDarkRed = { 40, 30, 30, 255 }; u8 i; @@ -475,12 +475,12 @@ void Boss07_SpawnDust(Boss07* this, PlayState* play, u8 spawnInterval, u8 mode) accel.x = accel.z = 0.0f; accel.y = -0.1f; pos.y = Rand_ZeroFloat(10.0f) + 3.0f; - if (mode) { + if (spawnAtFocus) { pos.x = this->actor.focus.pos.x + randPlusMinusPoint5Scaled(150.0f); pos.z = this->actor.focus.pos.z + randPlusMinusPoint5Scaled(150.0f); } else { - pos.z = this->unk_1788[i].z + randPlusMinusPoint5Scaled(20.0f); - pos.x = this->unk_1788[i].x + randPlusMinusPoint5Scaled(20.0f); + pos.z = this->incFeetPos[i].z + randPlusMinusPoint5Scaled(20.0f); + pos.x = this->incFeetPos[i].x + randPlusMinusPoint5Scaled(20.0f); } func_800B0EB0(play, &pos, &vel, &accel, &sDarkOrange, &sDarkRed, Rand_ZeroFloat(150.0f) + 350.0f, 10, Rand_ZeroFloat(5.0f) + 14.0f); @@ -519,20 +519,20 @@ void Boss07_SpawnDustAtPos(PlayState* play, Vec3f* spawnPos, u8 count) { } } -void Boss07_Wrath_Dodge(Boss07* this, PlayState* play, u8 arg2) { +void Boss07_Wrath_Dodge(Boss07* this, PlayState* play, u8 canCancel) { Player* player = GET_PLAYER(play); - if ((this->unk_15C == 0) && + if ((this->invincibilityTimer == 0) && (((this->actionFunc != Boss07_Wrath_Flip) && (this->actionFunc != Boss07_Wrath_StartJump) && (this->actionFunc != Boss07_Wrath_Jump)) || - arg2)) { + canCancel)) { if (Rand_ZeroOne() < 0.5f) { Boss07_Wrath_SetupFlip(this, play); } else { Boss07_Wrath_SetupJump(this, play); } this->unk_158 = 10; - this->unk_F7E = 0; + this->whipGrabIndex = 0; if (&this->actor == player->actor.parent) { player->unk_AE8 = 101; player->actor.parent = NULL; @@ -557,17 +557,17 @@ void Boss07_Wrath_CheckExplosives(Boss07* this, PlayState* play) { } } -void Boss07_Wrath_BlastWhip(Vec3f* bombPos, Vec3f* pos, Vec3f* pull) { +void Boss07_Wrath_BlastWhip(Vec3f* bombPos, Vec3f* pos, Vec3f* vel) { s32 i; f32 push; f32 dx; f32 dy; f32 dz; - Vec3f sp50; + Vec3f impulse; - sp50.x = 0.0f; + impulse.x = 0.0f; - for (i = 0; i < sWhipSegCount; i++, pos++, pull++) { + for (i = 0; i < sWhipSegCount; i++, pos++, vel++) { dx = pos->x - bombPos->x; dy = pos->y - bombPos->y; dz = pos->z - bombPos->z; @@ -577,10 +577,10 @@ void Boss07_Wrath_BlastWhip(Vec3f* bombPos, Vec3f* pos, Vec3f* pull) { push = 300.0f - sqrtf(SQ(dx) + SQ(dy) + SQ(dz)); push = CLAMP_MAX(push, 200.0f); - sp50.y = push; - sp50.z = push; + impulse.y = push; + impulse.z = push; Matrix_RotateYF(Math_Acot2F(dz, dx), MTXMODE_NEW); - Matrix_MultVec3f(&sp50, pull); + Matrix_MultVec3f(&impulse, vel); } } } @@ -590,8 +590,8 @@ void Boss07_Wrath_BombWhips(Boss07* this, PlayState* play) { while (explosive != NULL) { if (explosive->params == 1) { - Boss07_Wrath_BlastWhip(&explosive->world.pos, this->rightWhip.pos, this->rightWhip.pull); - Boss07_Wrath_BlastWhip(&explosive->world.pos, this->leftWhip.pos, this->leftWhip.pull); + Boss07_Wrath_BlastWhip(&explosive->world.pos, this->rightWhip.pos, this->rightWhip.vel); + Boss07_Wrath_BlastWhip(&explosive->world.pos, this->leftWhip.pos, this->leftWhip.vel); } explosive = explosive->next; } @@ -616,7 +616,7 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { MAJORAS_REMAINS + REMAINS_GYORG, MAJORAS_REMAINS + REMAINS_GOHT, MAJORAS_REMAINS + REMAINS_TWINMOLD, - }; + }; PlayState* play = play2; Boss07* this = THIS; s32 i; @@ -634,8 +634,8 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { if (this->actor.params == MAJORAS_BOSS) { this->actor.params = MAJORAS_MASK; - Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, MAJORAS_STATIC); + Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, MAJORAS_STATIC); play->specialEffects = (void*)sEffects; for (i = 0; i < ARRAY_COUNT(sEffects); i++) { @@ -678,19 +678,19 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { this->actor.colChkInfo.damageTable = &sTopDmgTable; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, KREG(55) + 9.0f); this->actor.shape.shadowAlpha = 180; - Collider_InitAndSetCylinder(play, &this->cyl2, &this->actor, &sTopCylInit); + Collider_InitAndSetCylinder(play, &this->spawnCollider, &this->actor, &sTopCylInit); Effect_Add(play, &this->effectIndex, 4, 0, 0, &sTopTireMarkInit); this->actor.flags &= ~ACTOR_FLAG_1; return; - } + } if ((this->actor.params == MAJORAS_REMAINS_SHOT) || (this->actor.params == MAJORAS_INCARNATION_SHOT)) { this->actor.update = Boss07_Projectile_Update; this->actor.draw = Boss07_Projectile_Draw; this->actor.flags &= ~ACTOR_FLAG_1; - Collider_InitAndSetCylinder(play, &this->cyl2, &this->actor, &sShotCylInit); + Collider_InitAndSetCylinder(play, &this->spawnCollider, &this->actor, &sShotCylInit); func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); - this->unk_181C = Rand_ZeroFloat(3.99f); + this->shotColorIndex = Rand_ZeroFloat(ARRAY_COUNT(sShotEnvColors) - 0.01f); return; } @@ -698,7 +698,7 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { this->actor.colChkInfo.damageTable = &sMaskDmgTable; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 15.0f); SkelAnime_Init(play, &this->skelAnime, &gMajorasMaskSkel, &gMajorasMaskFloatingAnim, this->jointTable, - this->morphTable, MAJORAS_MASK_LIMB_MAX); + this->morphTable, MAJORAS_MASK_LIMB_MAX); if (this->actor.params == MAJORAS_MASK) { static EffectTireMarkInit sMaskTireMarkInit = { 0, 40, { 0, 0, 15, 200 } }; @@ -714,21 +714,20 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { this->moveTarget.x = 0.0f; this->moveTarget.y = 200.0f; this->moveTarget.z = 0.0f; - this->unk_170 = 0.0f; + this->vel_170 = 0.0f; this->timers[0] = 50; this->timers[2] = 200; - this->unk_1888 = 50; + this->noclipTimer = 50; this->actor.flags |= ACTOR_FLAG_1; sMusicStartTimer = 20; } else { Boss07_Mask_SetupIntro(this, play); } - Collider_InitAndSetQuad(play, &this->quad1, &this->actor, &sMaskQuadInit1); - Collider_InitAndSetQuad(play, &this->quad2, &this->actor, &sMaskQuadInit2); + Collider_InitAndSetQuad(play, &this->maskFrontCollider, &this->actor, &sMaskQuadInit1); + Collider_InitAndSetQuad(play, &this->maskBackCollider, &this->actor, &sMaskQuadInit2); this->actor.colChkInfo.health = 14; for (i = 0; i < ARRAY_COUNT(sRemainsParams); i++) { - Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, 0.0f, 0.0f, 0.0f, 0, 0, 0, - sRemainsParams[i]); + Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, 0.0f, 0.0f, 0.0f, 0, 0, 0, sRemainsParams[i]); } } return; @@ -736,9 +735,8 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { if ((this->actor.params == MAJORAS_INCARNATION) || (this->actor.params == MAJORAS_AFTERIMAGE)) { Actor_SetScale(&this->actor, 0.015000001f); - SkelAnime_InitFlex(play, &this->skelAnime, &gMajorasIncarnationSkel, - &gMajorasIncarnationTauntDance1Anim, this->jointTable, this->morphTable, - MAJORAS_INCARNATION_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gMajorasIncarnationSkel, &gMajorasIncarnationTauntDance1Anim, + this->jointTable, this->morphTable, MAJORAS_INCARNATION_LIMB_MAX); if (this->actor.params == MAJORAS_AFTERIMAGE) { this->timers[0] = this->actor.world.rot.z; this->actor.world.rot.z = 0; @@ -750,24 +748,24 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { this->actor.colChkInfo.health = 30; this->actor.update = Boss07_Incarnation_Update; this->actor.draw = Boss07_Incarnation_Draw; - Collider_InitAndSetJntSph(play, &this->sph1, &this->actor, &sIncarnationJntSphInit1, - this->sphElems1); + Collider_InitAndSetJntSph(play, &this->bodyCollider, &this->actor, &sIncarnationJntSphInit1, + this->bodyElements); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 80.0f); this->subCamIndex = this->actor.shape.rot.z; - if (this->subCamIndex != 0) { + if (this->subCamIndex != SUB_CAM_ID_DONE) { Boss07_Incarnation_SetupIntro(this, play); } else { Boss07_Incarnation_SetupTaunt(this, play); - this->unk_14A = 1; + this->envEffectOn = 1; for (i = 0; i < 4; i++) { this->unk_17B8[i] = 1.0f; } play->envCtx.lightBlend = 0.0f; } - this->unk_17E0 = 1.0f; - this->unk_17E4 = 1.0f; - this->unk_17F0 = 1.0f; - this->unk_17F4 = 1.0f; + this->armScale = 1.0f; + this->legScale = 1.0f; + this->chestScaleY = 1.0f; + this->chestScaleX = 1.0f; } return; } @@ -777,26 +775,26 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { this->actor.colChkInfo.damageTable = &sWrathDmgTable; Actor_SetScale(&this->actor, 0.01f); this->subCamIndex = this->actor.shape.rot.z; - if (this->subCamIndex != 0) { + if (this->subCamIndex != SUB_CAM_ID_DONE) { Boss07_Wrath_SetupIntro(this, play); } else { Boss07_Wrath_SetupIdle(this, play, 50); this->whipScale = 1.0f; Audio_QueueSeqCmd(NA_BGM_MAJORAS_WRATH | 0x8000); } - SkelAnime_InitFlex(play, &this->skelAnime, &gMajorasWrathSkel, &gMajorasWrathIdleAnim, - this->jointTable, this->morphTable, MAJORAS_WRATH_LIMB_MAX); - Collider_InitAndSetJntSph(play, &this->sph1, &this->actor, &sWrathJntSphInit1, this->sphElems1); - Collider_InitAndSetJntSph(play, &this->sph2, &this->actor, &sWrathJntSphInit2, this->sphElems2); - Collider_InitAndSetCylinder(play, &this->cyl1, &this->actor, &sWrathCylInit); + SkelAnime_InitFlex(play, &this->skelAnime, &gMajorasWrathSkel, &gMajorasWrathIdleAnim, this->jointTable, + this->morphTable, MAJORAS_WRATH_LIMB_MAX); + Collider_InitAndSetJntSph(play, &this->bodyCollider, &this->actor, &sWrathJntSphInit1, this->bodyElements); + Collider_InitAndSetJntSph(play, &this->kickCollider, &this->actor, &sWrathJntSphInit2, this->kickElements); + Collider_InitAndSetCylinder(play, &this->unusedCollider, &this->actor, &sWrathCylInit); - this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.mobility = this->rightWhip.mobility = 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; sWhipSegCount = 44; - this->unk_17E0 = 1.0f; + this->armScale = 1.0f; } void Boss07_Destroy(Actor* thisx, PlayState* play2) { @@ -805,8 +803,8 @@ void Boss07_Destroy(Actor* thisx, PlayState* play2) { switch (this->actor.params) { case MAJORAS_WRATH: - Collider_DestroyQuad(play, &this->quad1); - Collider_DestroyQuad(play, &this->quad2); + Collider_DestroyQuad(play, &this->maskFrontCollider); + Collider_DestroyQuad(play, &this->maskBackCollider); case MAJORAS_TOP: Effect_Destroy(play, this->effectIndex); break; @@ -817,9 +815,9 @@ void Boss07_Wrath_SetupIntro(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Wrath_Intro; Animation_MorphToLoop(&this->skelAnime, &gMajorasWrathHeavyBreathingAnim, 0.0f); this->actor.flags &= ~ACTOR_FLAG_1; - this->unk_17D8 = 0x7F00; - this->unk_15C = 20; - this->unk_17E8 = 5120.0f; + this->csHeadRot.x = 0x7F00; + this->invincibilityTimer = 20; + this->unk_17E8 = 0x1400; } void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { @@ -827,14 +825,14 @@ void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { { 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 }, }; - this->unk_15C = 20; + this->invincibilityTimer = 20; SkelAnime_Update(&this->skelAnime); - this->unk_ABC8++; + this->timer_ABC8++; Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY); switch (this->csState) { case MAJORAS_WRATH_INTRO_STATE_0: - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->csState = MAJORAS_WRATH_INTRO_STATE_1; this->subCamNextAt.z = 0.f; this->subCamNextEye.x = 0.0; @@ -843,21 +841,21 @@ void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { this->subCamNextAt.x = 0.0f; this->subCamNextAt.y = 180.0f; case MAJORAS_WRATH_INTRO_STATE_1: - if (this->unk_ABC8 < 40) { + if (this->timer_ABC8 < 40) { sHeartbeatTimer = 3; } - if (this->unk_ABC8 > 20) { - if (this->unk_ABC8 == 21) { + if (this->timer_ABC8 > 20) { + if (this->timer_ABC8 == 21) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_GROW_HEAD_OLD); } - Math_ApproachS(&this->unk_17D8, 0, 5, 0x1000); - this->unk_17DA = Math_SinS(this->unk_ABC8 * 0x1000) * this->unk_17E8; - this->unk_17DC = Math_SinS(this->unk_ABC8 * 0xB00) * this->unk_17E8 * 0.5f; - if (this->unk_ABC8 > 40) { + Math_ApproachS(&this->csHeadRot.x, 0, 5, 0x1000); + this->csHeadRot.y = Math_SinS(this->timer_ABC8 * 0x1000) * this->unk_17E8; + this->csHeadRot.z = Math_SinS(this->timer_ABC8 * 0xB00) * this->unk_17E8 * 0.5f; + if (this->timer_ABC8 > 40) { Math_ApproachZeroF(&this->unk_17E8, 1.0f, 200.0f); } } - if (this->unk_ABC8 > 60) { + if (this->timer_ABC8 > 60) { Player* player = GET_PLAYER(play); s32 dataIndex = 0; if (0) {} @@ -876,33 +874,33 @@ void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { Math_ApproachF(&this->subCamNextEye.z, sCamPoints[dataIndex][1], 0.075f, this->subCamSpeedMod * 17.0f); Math_ApproachF(&this->subCamNextAt.y, sCamPoints[dataIndex][2], 0.075f, this->subCamSpeedMod * 7.0f); Math_ApproachF(&this->subCamSpeedMod, 1.0f, 1.0f, 0.01f); - if (this->unk_ABC8 == 70) { + if (this->timer_ABC8 == 70) { Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathIntroAnim, -15.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathIntroAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathIntroAnim); func_8019FE1C(&this->actor.projectedPos, NA_SE_EV_ICE_PILLAR_RISING, 1.0f); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_SHOUT); } - if (this->unk_ABC8 >= 110) { + if (this->timer_ABC8 >= 110) { Math_ApproachF(&this->whipScale, 1.0f, 1.0f, 0.05f); - this->leftWhip.stiffness = this->rightWhip.stiffness = 0.01f * 80; + this->leftWhip.mobility = this->rightWhip.mobility = 0.01f * 80; this->leftWhip.drag = this->rightWhip.drag = 1.0f; } - if (this->unk_ABC8 == 127) { + if (this->timer_ABC8 == 127) { this->whipScale = 1.0f; } - if (this->unk_ABC8 == 120) { + if (this->timer_ABC8 == 120) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_ROD_HOP2_OLD); Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_KICK_OLD); func_8019FE74(&gSfxVolume, 0.0f, 0x3C); } - if (this->unk_ABC8 == 112) { + if (this->timer_ABC8 == 112) { Audio_QueueSeqCmd(NA_BGM_MAJORAS_WRATH | 0x8000); } - if (this->unk_ABC8 == 137) { + if (this->timer_ABC8 == 137) { TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtxt, Lib_SegmentedToVirtual(&gMajorasWrathTitleCardTex), 0xA0, 0xB4, 0x80, 0x28); } - if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { + if (Animation_OnFrame(&this->skelAnime, this->animEndFrame)) { s32 i; Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); @@ -928,7 +926,7 @@ void Boss07_Wrath_Intro(Boss07* this, PlayState* play) { } Matrix_MultVec3f(&this->subCamNextEye, &this->subCamEye); Matrix_MultVec3f(&this->subCamNextAt, &this->subCamAt); - if (this->subCamIndex != 0) { + if (this->subCamIndex != SUB_CAM_ID_DONE) { ShrinkWindow_SetLetterboxTarget(0x1B); Play_SetCameraAtEye(play, this->subCamIndex, &this->subCamAt, &this->subCamEye); } @@ -940,20 +938,20 @@ void Boss07_Wrath_SetupDeath(Boss07* this, PlayState* play) { Audio_QueueSeqCmd(NA_BGM_STOP | 0x10000); Boss07_MovePlayer(play); this->actionFunc = Boss07_Wrath_Death; - this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.mobility = this->rightWhip.mobility = 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, &gMajorasWrathDeathAnim, 0.0f); this->actor.flags &= ~ACTOR_FLAG_1; this->csState = MAJORAS_WRATH_DEATH_STATE_0; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; if (sBossRemains[REMAINS_ODOLWA] != NULL) { for (i = 0; i < 4; i++) { sBossRemains[i]->actionState = MAJORAS_REMAINS_DEATH; } } - this->unk_15C = 1000; + this->invincibilityTimer = 1000; } void Boss07_Wrath_Death(Boss07* this, PlayState* play) { @@ -964,7 +962,7 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { f32 spA4 = 0.0f, spA0 = 0.1f; Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); - this->unk_15C = 1000; + this->invincibilityTimer = 1000; Boss07_SmoothStop(this, 1.0f); switch (this->csState) { case MAJORAS_WRATH_DEATH_STATE_0: @@ -978,7 +976,7 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { Play_ChangeCameraStatus(play, this->subCamIndex, CAM_STATUS_ACTIVE); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_DEAD_ROD); case MAJORAS_WRATH_DEATH_STATE_1: - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->csState = MAJORAS_WRATH_DEATH_STATE_2; this->subCamEye.x = mainCam->eye.x; this->subCamEye.y = mainCam->eye.y; @@ -987,23 +985,23 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { this->subCamAt.y = mainCam->at.y; this->subCamAt.z = mainCam->at.z; this->subCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; - this->subCamRotVel = this->subCamSpeedMod = sMajoraStatic->unk_180C = 0.0f; + this->subCamRotVel = this->subCamSpeedMod = sMajoraStatic->lensFlareScale = 0.0f; Boss07_InitRand(1, 0x71AC, 0x263A); for (i = 0; i < ARRAY_COUNT(this->deathLightScale); i++) { this->deathLightScale[i] = Boss07_RandZeroOne() - 1.0f; } func_8016566C(150); case MAJORAS_WRATH_DEATH_STATE_2: - if (this->unk_ABC8 == 20) { + if (this->timer_ABC8 == 20) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST2_WALK2_OLD); } - if (this->unk_ABC8 == 40) { + if (this->timer_ABC8 == 40) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST2_WALK2_OLD); } - if (this->unk_ABC8 == 60) { + if (this->timer_ABC8 == 60) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST2_WALK2_OLD); } - if (this->unk_ABC8 == 80) { + if (this->timer_ABC8 == 80) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST2_WALK2_OLD); } spB4.x = 0.0f; @@ -1013,8 +1011,8 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { this->subCamNextAt.y = this->actor.focus.pos.y - 40.0f; this->subCamNextAt.z = this->actor.focus.pos.z; - if ((this->unk_ABC8 >= 50) && (this->unk_ABC8 < 80)) { - if (this->unk_ABC8 == 50) { + if ((this->timer_ABC8 >= 50) && (this->timer_ABC8 < 80)) { + if (this->timer_ABC8 == 50) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_DEAD_WIND1_OLD); } spB4.x = 30.0f; @@ -1022,8 +1020,8 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { this->subCamNextAt.y = this->actor.focus.pos.y - 40.0f + 30.0f; spA4 = 200.0f; spA0 = 1.0f; - } else if ((this->unk_ABC8 >= 80) && (this->unk_ABC8 < 110)) { - if (this->unk_ABC8 == 80) { + } else if ((this->timer_ABC8 >= 80) && (this->timer_ABC8 < 110)) { + if (this->timer_ABC8 == 80) { this->skelAnime.curFrame -= 30.0f; Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_DEAD_WIND2_OLD); } @@ -1032,8 +1030,8 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { this->subCamNextAt.y = this->actor.focus.pos.y - 40.0f - 60.0f; spA4 = 200.0f; spA0 = 1.0f; - } else if ((this->unk_ABC8 >= 110) && (this->unk_ABC8 < 140)) { - if (this->unk_ABC8 == 110) { + } else if ((this->timer_ABC8 >= 110) && (this->timer_ABC8 < 140)) { + if (this->timer_ABC8 == 110) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_DEAD_WIND3_OLD); } spB4.x = -70.0f; @@ -1042,7 +1040,7 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { spA4 = 200.0f; spA0 = 1.0f; } - if (this->unk_ABC8 >= (sREG(15) + 140)) { + if (this->timer_ABC8 >= (sREG(15) + 140)) { this->csState = MAJORAS_WRATH_DEATH_STATE_4; this->subCamEyeModY = sREG(16) + 270.0f + 50.0f; Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_DEAD_FLOAT); @@ -1050,7 +1048,7 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { break; } case MAJORAS_WRATH_DEATH_STATE_4: - if ((this->unk_ABC8 >= (sREG(90) + 260)) && (this->unk_ABC8 < (sREG(91) + 370))) { + if ((this->timer_ABC8 >= (sREG(90) + 260)) && (this->timer_ABC8 < (sREG(91) + 370))) { spC0 = KREG(14) + 1; this->subCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; spB4.x = 0.0f; @@ -1065,8 +1063,8 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { spA4 = 2000.0f; spA0 = 1.0f; - this->unk_1D8 = KREG(81) + 10; - this->unk_AB48 = 1; + this->bodyDecayRate = KREG(81) + 10; + this->noShadow = true; Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EV_BURN_OUT - SFX_FLAG); } else { spB4.x = 0.0f; @@ -1075,8 +1073,8 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { this->subCamNextAt.x = this->actor.focus.pos.x; this->subCamNextAt.y = this->actor.focus.pos.y - 40.0f - 60.0f; this->subCamNextAt.z = this->actor.focus.pos.z; - this->unk_1D8 = 0; - if (this->unk_ABC8 > 330) { + this->bodyDecayRate = 0; + if (this->timer_ABC8 > 330) { spA4 = 2000.0f; spA0 = 1.0f; } @@ -1084,44 +1082,43 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { Math_ApproachZeroF(&this->actor.world.pos.z, 0.1f, this->subCamSpeedMod); Math_ApproachF(&this->subCamSpeedMod, 5.0f, 1.0f, 0.1f); } - if (this->unk_ABC8 >= 260) { + if (this->timer_ABC8 >= 260) { f32 sp98; f32 sp94; s16 temp_a0; - if (this->unk_ABC8 == 260) { - func_801A479C(&sSfxPoint, NA_SE_EN_LAST3_DEAD_LIGHTS_OLD, 0x3C); + if (this->timer_ABC8 == 260) { + func_801A479C(&sSfxPoint, NA_SE_EN_LAST3_DEAD_LIGHTS_OLD, 60); } play->envCtx.fillScreen = 1; - play->envCtx.screenFillColor[0] = play->envCtx.screenFillColor[1] = - play->envCtx.screenFillColor[2] = 255; - if (this->unk_ABC8 < 350) { + play->envCtx.screenFillColor[0] = play->envCtx.screenFillColor[1] = play->envCtx.screenFillColor[2] = + 255; + if (this->timer_ABC8 < 350) { sp98 = 0.5f; sp94 = 0.02f; play->envCtx.screenFillColor[3] = 0; } else { sp98 = 5.0f; sp94 = 0.1f; - temp_a0 = (this->unk_ABC8 * 2) - 700; - if (temp_a0 > 250) { - temp_a0 = 250; - } + temp_a0 = (this->timer_ABC8 * 2) - 700; + if (temp_a0 > 250) temp_a0 = 250; + play->envCtx.screenFillColor[3] = temp_a0; - if (this->unk_ABC8 == 400) { + if (this->timer_ABC8 == 400) { func_8019FE74(&gSfxVolume, 0.0f, 90); } - if (this->unk_ABC8 == (KREG(94) + 440)) { + if (this->timer_ABC8 == (KREG(94) + 440)) { play->nextEntrance = 0x5400; gSaveContext.nextCutsceneIndex = 0xFFF7; play->transitionTrigger = TRANS_TRIGGER_START; } } - if (this->unk_ABC8 > 300) { - sMajoraStatic->unk_1808 = 1; - 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); + if (this->timer_ABC8 > 300) { + sMajoraStatic->lensFlareOn = true; + Math_ApproachF(&sMajoraStatic->lensFlareScale, 30.0f, 0.1f, 1.5f); + sMajoraStatic->lensFlarePos = this->bodyPartsPos[2]; + Math_ApproachF(&this->deathOrbScale, 1.0f, 0.1f, 0.05f); for (i = 0; i < ARRAY_COUNT(this->deathLightScale); i++) { Math_ApproachF(&this->deathLightScale[i], sp98, 1.0f, sp94); } @@ -1130,10 +1127,9 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { } this->subCamRotY += this->subCamRotVel; this->subCamRotVel += 0.0004f; - if (this->subCamRotVel > 0.02f) { - this->subCamRotVel = 0.02f; - } - if (this->unk_ABC8 >= (sREG(93) + 180)) { + if (this->subCamRotVel > 0.02f) this->subCamRotVel = 0.02f; + + if (this->timer_ABC8 >= (sREG(93) + 180)) { Vec3f sp84 = { 0.0f, 10.0f, 0.0f }; Vec3f sp78 = { 0.0f, -0.5f, 0.0f }; Vec3f sp6C; @@ -1145,18 +1141,18 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { } else { sp68 = (KREG(53) * 0.01f) + 0.2f; } - spA8.x = Math_SinS(this->unk_ABC8 * 0x7000) * sp68; - spA8.y = Math_SinS(this->unk_ABC8 * 0x5000) * sp68 * 2.5f; - spA8.z = Math_CosS(this->unk_ABC8 * 0x8000) * sp68; + spA8.x = Math_SinS(this->timer_ABC8 * 0x7000) * sp68; + spA8.y = Math_SinS(this->timer_ABC8 * 0x5000) * sp68 * 2.5f; + spA8.z = Math_CosS(this->timer_ABC8 * 0x8000) * sp68; for (i = 0; i < 2; i++) { sp6C.x = randPlusMinusPoint5Scaled(500.0f) + this->actor.world.pos.x; sp6C.y = Rand_ZeroFloat(50.0f) + this->actor.world.pos.y + 200.0f; sp6C.z = randPlusMinusPoint5Scaled(500.0f) + this->actor.world.pos.z; - EffectSsHahen_Spawn(play, &sp6C, &sp84, &sp78, 0, Rand_ZeroFloat(5.0f) + 20.0f, -1, 0xA, NULL); + EffectSsHahen_Spawn(play, &sp6C, &sp84, &sp78, 0, Rand_ZeroFloat(5.0f) + 20.0f, -1, 10, NULL); } } - if (this->unk_ABC8 >= (sREG(94) + 290)) { - this->unk_1D8 = KREG(86) + 25; + if (this->timer_ABC8 >= (sREG(94) + 290)) { + this->bodyDecayRate = KREG(86) + 25; Math_ApproachZeroF(&this->whipScale, 1.0f, 0.015f); } break; @@ -1174,7 +1170,7 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { Math_ApproachF(&this->subCamAt.x, this->subCamNextAt.x, spA0, 70.0f + spA4); Math_ApproachF(&this->subCamAt.y, this->subCamNextAt.y, spA0, 70.0f + spA4); Math_ApproachF(&this->subCamAt.z, this->subCamNextAt.z, spA0, 70.0f + spA4); - if (this->subCamIndex != 0) { + if (this->subCamIndex != SUB_CAM_ID_DONE) { Vec3f sp5C; sp5C.x = this->subCamAt.x + spA8.x; @@ -1183,7 +1179,7 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { Play_SetCameraAtEye(play, this->subCamIndex, &sp5C, &this->subCamEye); } SkelAnime_Update(&this->skelAnime); - this->unk_ABC8++; + this->timer_ABC8++; } void Boss07_Wrath_SetupIdle(Boss07* this, PlayState* play, s16 delay) { @@ -1202,7 +1198,7 @@ void Boss07_Wrath_Idle(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 2.0f); - this->rightWhip.stiffness = this->leftWhip.stiffness = 0.7f; + this->rightWhip.mobility = this->leftWhip.mobility = 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; @@ -1225,7 +1221,7 @@ void Boss07_Wrath_Idle(Boss07* this, PlayState* play) { } } Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); - this->unk_174 = true; + this->canDodge = true; } void Boss07_Wrath_SetupJump(Boss07* this, PlayState* play) { @@ -1236,7 +1232,7 @@ void Boss07_Wrath_SetupJump(Boss07* this, PlayState* play) { void Boss07_Wrath_StartJump(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.mobility = this->rightWhip.mobility = 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; @@ -1256,7 +1252,7 @@ void Boss07_Wrath_Jump(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 1) { Boss07_Wrath_SetupIdle(this, play, 1); - this->unk_156 = 5; + this->jumpSfxTimer = 5; } Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x4000); } @@ -1293,7 +1289,7 @@ void Boss07_Wrath_SetupFlip(Boss07* this, PlayState* play) { void Boss07_Wrath_Flip(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIBOSS_JUMP2 - SFX_FLAG); SkelAnime_Update(&this->skelAnime); - this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.mobility = this->rightWhip.mobility = 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; @@ -1307,7 +1303,7 @@ void Boss07_Wrath_Flip(Boss07* this, PlayState* play) { Boss07_Wrath_SetupIdle(this, play, 1); this->actor.speedXZ = 5.0f; } - this->unk_156 = 5; + this->jumpSfxTimer = 5; } Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x4000); } @@ -1336,8 +1332,8 @@ void Boss07_Wrath_SetupSidestep(Boss07* this, PlayState* play) { this->moveTarget.z += this->actor.world.pos.z; this->timers[1] = 21; this->unk_158 = 10; - this->unk_170 = 0.0f; - this->unk_ABCC = 0; + this->vel_170 = 0.0f; + this->timer_ABCC = 0; } void Boss07_Wrath_Sidestep(Boss07* this, PlayState* play) { @@ -1345,18 +1341,18 @@ void Boss07_Wrath_Sidestep(Boss07* this, PlayState* play) { if (this->actionTimer == 20) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_VOICE_KICK_OLD); } - this->unk_ABCC++; - if ((this->unk_ABCC % 16) == 0) { + this->timer_ABCC++; + if ((this->timer_ABCC % 16) == 0) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST2_WALK2_OLD); } - this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.mobility = this->rightWhip.mobility = 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->moveTarget.x, 0.8f, this->unk_170); - Math_ApproachF(&this->actor.world.pos.z, this->moveTarget.z, 0.8f, this->unk_170); - Math_ApproachF(&this->unk_170, 20.0f, 1.0f, 10.0f); + Math_ApproachF(&this->actor.world.pos.x, this->moveTarget.x, 0.8f, this->vel_170); + Math_ApproachF(&this->actor.world.pos.z, this->moveTarget.z, 0.8f, this->vel_170); + Math_ApproachF(&this->vel_170, 20.0f, 1.0f, 10.0f); if (this->timers[1] == 0) { if (Rand_ZeroOne() < 0.3f) { Boss07_Wrath_SetupSidestep(this, play); @@ -1371,54 +1367,55 @@ void Boss07_Wrath_SetupAttack(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Wrath_Attack; this->timers[1] = 0; - if (player->stateFlags3 & 0x100) { - this->actionState = MAJORAS_WRATH_ATTACK_4; + if (player->stateFlags3 & PLAYER_STATE3_100) { + this->actionState = MAJORAS_WRATH_SPIN_ATTACK; } else if (this->actor.xzDistToPlayer <= 300.0f) { if (this->actor.xzDistToPlayer <= 200.0f) { - this->actionState = MAJORAS_WRATH_ATTACK_7; + this->actionState = MAJORAS_WRATH_KICK; } else { - this->actionState = MAJORAS_WRATH_ATTACK_4; + this->actionState = MAJORAS_WRATH_SPIN_ATTACK; } } else { this->actionState = Rand_ZeroFloat(6.99f); - if (((s8)this->actor.colChkInfo.health >= 28) && ((this->actionState == MAJORAS_WRATH_ATTACK_1) || (this->actionState == MAJORAS_WRATH_ATTACK_2))) { - this->actionState = MAJORAS_WRATH_ATTACK_0; + if (((s8)this->actor.colChkInfo.health >= 28) && + ((this->actionState == MAJORAS_WRATH_FLURRY) || (this->actionState == MAJORAS_WRATH_DOUBLE_WHIP))) { + this->actionState = MAJORAS_WRATH_QUICK_WHIP; } } switch (this->actionState) { - case MAJORAS_WRATH_ATTACK_0: + case MAJORAS_WRATH_QUICK_WHIP: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathShortSingleWhipAttackAnim, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathShortSingleWhipAttackAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathShortSingleWhipAttackAnim); break; - case MAJORAS_WRATH_ATTACK_1: + case MAJORAS_WRATH_FLURRY: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathWhipFlurryAttackAnim, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathWhipFlurryAttackAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathWhipFlurryAttackAnim); break; - case MAJORAS_WRATH_ATTACK_2: + case MAJORAS_WRATH_DOUBLE_WHIP: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathDoubleWhipAttackAnim, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathDoubleWhipAttackAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathDoubleWhipAttackAnim); break; - case MAJORAS_WRATH_ATTACK_3: + case MAJORAS_WRATH_LONG_WHIP: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathLongSingleWhipAttackAnim, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathLongSingleWhipAttackAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathLongSingleWhipAttackAnim); break; - case MAJORAS_WRATH_ATTACK_4: + case MAJORAS_WRATH_SPIN_ATTACK: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathSpinAttackAnim, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathSpinAttackAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathSpinAttackAnim); Boss07_RandVec3fXZ(&this->moveTarget, 650.0f); - this->unk_170 = 0.0f; + this->vel_170 = 0.0f; break; - case MAJORAS_WRATH_ATTACK_5: + case MAJORAS_WRATH_TAUNT: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathTauntAnim, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathTauntAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathTauntAnim); break; - case MAJORAS_WRATH_ATTACK_6: + case MAJORAS_WRATH_THREE_HIT: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathThreeAttackComboAnim, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathThreeAttackComboAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathThreeAttackComboAnim); break; - case MAJORAS_WRATH_ATTACK_7: + case MAJORAS_WRATH_KICK: Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathKickAnim, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathKickAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathKickAnim); break; } this->actionTimer = 0; @@ -1427,15 +1424,15 @@ void Boss07_Wrath_SetupAttack(Boss07* this, PlayState* play) { void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 2.0f); - this->leftWhip.stiffness = this->rightWhip.stiffness = 0.01f * 80; + this->leftWhip.mobility = this->rightWhip.mobility = 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; + this->canDodge = true; } switch (this->actionState) { - case MAJORAS_WRATH_ATTACK_0: + case MAJORAS_WRATH_QUICK_WHIP: if (this->actionTimer == (s16)(KREG(92) + 1)) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } @@ -1443,7 +1440,7 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { this->rightWhip.tension = 500.0f; } if (this->actionTimer == 9) { - this->unk_14F = 11; + this->whipCrackTimer = 11; } if (this->actionTimer == 1) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_ROD_HOP_OLD); @@ -1452,7 +1449,7 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } break; - case MAJORAS_WRATH_ATTACK_1: + case MAJORAS_WRATH_FLURRY: if (this->actionTimer == (s16)(KREG(91) + 3)) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_THROW_OLD); } @@ -1467,7 +1464,7 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); } break; - case MAJORAS_WRATH_ATTACK_2: + case MAJORAS_WRATH_DOUBLE_WHIP: if (this->actionTimer == (s16)(KREG(84) + 5)) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } @@ -1476,7 +1473,7 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { this->leftWhip.tension = 300.0f; } if (this->actionTimer == 28) { - this->unk_14F = 11; + this->whipCrackTimer = 11; } if (this->actionTimer == 10) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_ROD_HOP_OLD); @@ -1485,7 +1482,7 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } break; - case MAJORAS_WRATH_ATTACK_3: + case MAJORAS_WRATH_LONG_WHIP: if (this->actionTimer == (s16)(KREG(84) + 5)) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } @@ -1493,7 +1490,7 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { this->rightWhip.tension = 1200.0f; } if (this->actionTimer == 23) { - this->unk_14F = 11; + this->whipCrackTimer = 11; } Math_ApproachF(&this->unk_184, -0.1f, 0.5f, 0.1f); Math_ApproachF(&this->unk_188, 0.3f, 0.5f, 0.1f); @@ -1504,33 +1501,33 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } break; - case MAJORAS_WRATH_ATTACK_4: + case MAJORAS_WRATH_SPIN_ATTACK: if ((this->actionTimer > 16) && (this->actionTimer <= 40)) { this->leftWhip.tension = this->rightWhip.tension = 200.0f; if ((this->actionTimer % 8) == 0) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_KOMA_OLD); } Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_ROD_DANCE_OLD - SFX_FLAG); - Math_ApproachF(&this->actor.world.pos.x, this->moveTarget.x, 0.1f, this->unk_170); - Math_ApproachF(&this->actor.world.pos.z, this->moveTarget.z, 0.1f, this->unk_170); - Math_ApproachF(&this->unk_170, 20.0f, 1.0f, 4.0f); + Math_ApproachF(&this->actor.world.pos.x, this->moveTarget.x, 0.1f, this->vel_170); + Math_ApproachF(&this->actor.world.pos.z, this->moveTarget.z, 0.1f, this->vel_170); + Math_ApproachF(&this->vel_170, 20.0f, 1.0f, 4.0f); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x2000); - this->unk_174 = false; + this->canDodge = false; } break; - case MAJORAS_WRATH_ATTACK_7: - this->unk_174 = false; + case MAJORAS_WRATH_KICK: + this->canDodge = false; if (this->actionTimer == 3) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_VOICE_KICK_OLD); } break; - case MAJORAS_WRATH_ATTACK_5: - this->rightWhip.stiffness = this->leftWhip.stiffness = 0.7f; + case MAJORAS_WRATH_TAUNT: + this->rightWhip.mobility = this->leftWhip.mobility = 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 = true; + this->canDodge = true; break; - case MAJORAS_WRATH_ATTACK_6: + case MAJORAS_WRATH_THREE_HIT: if (this->actionTimer == (s16)(KREG(85) + 5)) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } @@ -1557,7 +1554,7 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { } break; } - if (Animation_OnFrame(&this->skelAnime, this->unk_1D4) || (this->timers[1] == 1)) { + if (Animation_OnFrame(&this->skelAnime, this->animEndFrame) || (this->timers[1] == 1)) { Boss07_Wrath_SetupIdle(this, play, 0); } } @@ -1565,7 +1562,7 @@ void Boss07_Wrath_Attack(Boss07* this, PlayState* play) { void Boss07_Wrath_SetupGrab(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Wrath_Grab; Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathGrabAnim, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathGrabAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathGrabAnim); this->actionTimer = 0; } @@ -1573,7 +1570,7 @@ void Boss07_Wrath_Grab(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer - 0x800, 3, 0x2000); Boss07_SmoothStop(this, 2.0f); - this->leftWhip.stiffness = this->rightWhip.stiffness = 0.01f * 80; + this->leftWhip.mobility = this->rightWhip.mobility = 0.01f * 80; this->leftWhip.drag = this->rightWhip.drag = 1.0f; this->leftWhip.tension = this->rightWhip.tension = 0.0f; this->rightWhip.gravity = -5.0f; @@ -1593,16 +1590,16 @@ void Boss07_Wrath_GrabPlayer(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 2.0f); - player->actor.world.pos = this->unk_F80; + player->actor.world.pos = this->whipGrabPos; this->actor.flags &= ~ACTOR_FLAG_1; - this->unk_15A = 20; - this->unk_F7C++; - if (this->actionTimer > (s16)(46 - this->unk_F7E)) { + this->whipCollisionTimer = 20; + this->whipWrapIndex++; + if (this->actionTimer > (s16)(46 - this->whipGrabIndex)) { Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST3_VOICE_THROW_OLD); play_sound(NA_SE_EN_LAST3_COIL_ATTACK_OLD); this->actionFunc = Boss07_Wrath_ThrowPlayer; Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathThrowAnim, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathThrowAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathThrowAnim); this->actionTimer = 0; } if ((func_800B64FC(play, 1000.0f, &this->actor.world.pos, &sp2C) >= 0.0f) && (sp2C == 1)) { @@ -1617,9 +1614,9 @@ void Boss07_Wrath_ThrowPlayer(Boss07* this, PlayState* play) { s32 sp30; SkelAnime_Update(&this->skelAnime); - this->unk_15A = 20; + this->whipCollisionTimer = 20; if (this->actionTimer == 6) { - this->unk_F7E = 0; + this->whipGrabIndex = 0; if (&this->actor == player->actor.parent) { player->unk_AE8 = 101; player->actor.parent = NULL; @@ -1641,12 +1638,12 @@ void Boss07_Wrath_ThrowPlayer(Boss07* this, PlayState* play) { } } if (this->actionTimer < 7) { - player->actor.world.pos = this->unk_F80; + player->actor.world.pos = this->whipGrabPos; if ((func_800B64FC(play, 1000.0f, &this->actor.world.pos, &sp30) >= 0.0f) && (sp30 == 1)) { Boss07_Wrath_SetupShock(this, play); } } - if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { + if (Animation_OnFrame(&this->skelAnime, this->animEndFrame)) { Boss07_Wrath_SetupIdle(this, play, 0); } } @@ -1657,12 +1654,12 @@ void Boss07_Wrath_SetupShock(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Wrath_Shock; - temp_v0 = this->unk_F7E + 10; - this->unk_780 = this->unk_784 = temp_v0; + temp_v0 = this->whipGrabIndex + 10; + this->whipShockIndexHigh = this->whipShockIndexLow = temp_v0; temp_v1 = sWhipSegCount - 1; if (temp_v1 < temp_v0) { - this->unk_780 = this->unk_784 = temp_v1; + this->whipShockIndexHigh = this->whipShockIndexLow = temp_v1; } this->actionTimer = 0; play_sound(NA_SE_EV_ELECTRIC_EXPLOSION); @@ -1674,18 +1671,18 @@ void Boss07_Wrath_Shock(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 2.0f); - player->actor.world.pos = this->unk_F80; + player->actor.world.pos = this->whipGrabPos; this->actor.flags &= ~ACTOR_FLAG_1; - this->unk_15A = 20; - if (this->actionTimer <= (s16)(46 - this->unk_F7E)) { - this->unk_F7C++; + this->whipCollisionTimer = 20; + if (this->actionTimer <= (s16)(46 - this->whipGrabIndex)) { + this->whipWrapIndex++; } for (i = 0; i < 4; i++) { - if (this->unk_784 != 0) { - this->unk_784--; + if (this->whipShockIndexLow != 0) { + this->whipShockIndexLow--; } } - if (this->unk_784 == 0) { + if (this->whipShockIndexLow == 0) { Math_ApproachF(&play->envCtx.lightBlend, 1.0f, 1.0f, 0.3f); Math_ApproachF(&this->unk_32C, 5.0f, 0.5f, 3.0f); play_sound(NA_SE_EN_BIRI_SPARK - SFX_FLAG); @@ -1695,15 +1692,15 @@ void Boss07_Wrath_Shock(Boss07* this, PlayState* play) { if (this->unk_32C > 4.0f) { this->actionFunc = Boss07_Wrath_ShockStun; Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathStunAnim, -10.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathStunAnim); - this->unk_F7E = 0; + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathStunAnim); + this->whipGrabIndex = 0; if (&this->actor == player->actor.parent) { player->unk_AE8 = 101; player->actor.parent = NULL; player->csMode = 0; } - Actor_Spawn(&play->actorCtx, play, 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); + Actor_Spawn(&play->actorCtx, play, 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->actionTimer = 0; } } @@ -1712,9 +1709,9 @@ void Boss07_Wrath_ShockStun(Boss07* this, PlayState* play) { s32 i; SkelAnime_Update(&this->skelAnime); - this->unk_15A = 20; + this->whipCollisionTimer = 20; for (i = 0; i < 2; i++) { - DECR(this->unk_780); + DECR(this->whipShockIndexHigh); } if (this->actionTimer < 70) { Math_ApproachF(&this->unk_32C, 5.0f, 0.5f, 3.0f); @@ -1722,7 +1719,7 @@ void Boss07_Wrath_ShockStun(Boss07* this, PlayState* play) { play_sound(NA_SE_EN_BIRI_SPARK - SFX_FLAG); Math_ApproachF(&play->envCtx.lightBlend, 1.0f, 1.0f, 0.3f); } - if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { + if (Animation_OnFrame(&this->skelAnime, this->animEndFrame)) { Boss07_Wrath_Dodge(this, play, true); } } @@ -1731,7 +1728,7 @@ void Boss07_Wrath_SetupStunned(Boss07* this, PlayState* play) { if (this->actionFunc != Boss07_Wrath_Stunned) { this->actionFunc = Boss07_Wrath_Stunned; Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathStunAnim, -10.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathStunAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathStunAnim); } this->unk_158 = 10; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE_OLD); @@ -1740,17 +1737,16 @@ void Boss07_Wrath_SetupStunned(Boss07* this, PlayState* play) { void Boss07_Wrath_SetupSpawnTop(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Wrath_SpawnTop; Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathReleaseTopAnim, -5.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathReleaseTopAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathReleaseTopAnim); this->actionTimer = 0; } void Boss07_Wrath_SpawnTop(Boss07* this, PlayState* play) { - this->unk_15A = 20; + this->whipCollisionTimer = 20; if (this->actionTimer < (s16)(KREG(40) + 14)) { - this->unk_778 += 6; - if (this->unk_778 > 44) { - this->unk_778 = 44; - } + this->whipTopIndex += 6; + if (this->whipTopIndex > 44) this->whipTopIndex = 44; + } if (this->actionTimer == 8) { Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, this->actor.world.pos.y, @@ -1768,14 +1764,13 @@ void Boss07_Wrath_SpawnTop(Boss07* this, PlayState* play) { } 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; - } + this->whipTopIndex -= KREG(39) + 5; + if (this->whipTopIndex < 0) this->whipTopIndex = 0; + } 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.01f * 80; + this->leftWhip.mobility = this->rightWhip.mobility = 0.01f * 80; this->leftWhip.drag = this->rightWhip.drag = 1.0f; this->leftWhip.tension = this->rightWhip.tension = 0.0f; this->rightWhip.gravity = -5.0f; @@ -1793,16 +1788,16 @@ void Boss07_Wrath_Stunned(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_COMMON_WEAKENED - SFX_FLAG); Boss07_SmoothStop(this, 2.0f); - this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.mobility = this->rightWhip.mobility = 0.7f; this->leftWhip.gravity = this->rightWhip.gravity = -15.0f; this->leftWhip.tension = this->rightWhip.tension = 0.0f; this->leftWhip.drag = this->rightWhip.drag = 2.0f; - if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { + if (Animation_OnFrame(&this->skelAnime, this->animEndFrame)) { Boss07_Wrath_Dodge(this, play, true); } } -void Boss07_Wrath_SetupDamaged(Boss07* this, PlayState* play, u8 damage, u8 effect) { +void Boss07_Wrath_SetupDamaged(Boss07* this, PlayState* play, u8 damage, u8 dmgEffect) { if ((s8)this->actor.colChkInfo.health >= 0) { this->actor.colChkInfo.health -= damage; } @@ -1812,17 +1807,17 @@ void Boss07_Wrath_SetupDamaged(Boss07* this, PlayState* play, u8 damage, u8 effe } else { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_VOICE_DEAD_OLD); } - this->unk_148 = true; + this->startDeath = true; Enemy_StartFinishingBlow(play, &this->actor); } else { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE2_OLD); if (this->actionFunc != Boss07_Wrath_Damaged) { Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathDamageAnim, -10.0f); this->actionFunc = Boss07_Wrath_Damaged; - this->unk_1D4 = Animation_GetLastFrame(&gMajorasWrathDamageAnim); - this->unk_ABCC = 0; - } else if (effect == 14) { - if (this->skelAnime.curFrame <= (this->unk_1D4 - 5.0f)) { + this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathDamageAnim); + this->timer_ABCC = 0; + } else if (dmgEffect == MAJORAS_WRATH_DMGEFF_E) { + if (this->skelAnime.curFrame <= (this->animEndFrame - 5.0f)) { this->unk_158 = 30; } else { Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathDamageAnim, -5.0f); @@ -1833,16 +1828,16 @@ void Boss07_Wrath_SetupDamaged(Boss07* this, PlayState* play, u8 damage, u8 effe void Boss07_Wrath_Damaged(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - this->unk_ABCC++; - if ((this->unk_ABCC % 16) == 0) { + this->timer_ABCC++; + if ((this->timer_ABCC % 16) == 0) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_WALK2_OLD); } Boss07_SmoothStop(this, 2.0f); - this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.mobility = this->rightWhip.mobility = 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)) { + if (Animation_OnFrame(&this->skelAnime, this->animEndFrame)) { Boss07_Wrath_Dodge(this, play, true); } } @@ -1856,7 +1851,7 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* whipPos, f32 tension, Boss07* this, f32 dz; Vec3f sp7C; - if ((tension >= 50.0f) && (this->unk_15A == 0)) { + if ((tension >= 50.0f) && (this->whipCollisionTimer == 0)) { Actor* prop = play->actorCtx.actorLists[ACTORCAT_PROP].first; while (prop != NULL) { @@ -1875,7 +1870,8 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* whipPos, f32 tension, Boss07* this, prop = prop->next; } } - if ((tension >= 50.0f) && (this->unk_15A == 0) && (!(player->stateFlags3 & 0x100) || (this->actionState == MAJORAS_WRATH_ATTACK_4))) { + if ((tension >= 50.0f) && (this->whipCollisionTimer == 0) && + (!(player->stateFlags3 & PLAYER_STATE3_100) || (this->actionState == MAJORAS_WRATH_SPIN_ATTACK))) { if ((func_800B64FC(play, 1000.0f, &this->actor.world.pos, &sp98) >= 0.0f) && (sp98 != 1)) { sp98 = -1; } @@ -1887,8 +1883,9 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* whipPos, f32 tension, Boss07* this, dy *= 1.75f; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 140.0f) { - if ((this->actionFunc == Boss07_Wrath_Grab) && (sp98 != 1) && !(player->stateFlags3 & 0x1000) && - (520.0f <= this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer <= 900.0f)) { + if ((this->actionFunc == Boss07_Wrath_Grab) && (sp98 != 1) && + !(player->stateFlags3 & PLAYER_STATE3_1000) && (520.0f <= this->actor.xzDistToPlayer) && + (this->actor.xzDistToPlayer <= 900.0f)) { if (play->grabPlayer(play, player)) { f32 dx1; f32 dy1; @@ -1896,10 +1893,10 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* whipPos, f32 tension, Boss07* this, f32 dxz1; player->actor.parent = &this->actor; - AudioSfx_PlaySfx(NA_SE_VO_LI_DAMAGE_S, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - this->unk_F7C = 0; - this->unk_F7E = ((this->actor.xzDistToPlayer - 300.0f) / 22.0f) + 10.0f; + AudioSfx_PlaySfx(NA_SE_VO_LI_DAMAGE_S, &player->actor.projectedPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + this->whipWrapIndex = 0; + this->whipGrabIndex = ((this->actor.xzDistToPlayer - 300.0f) / 22.0f) + 10.0f; dx1 = player->actor.world.pos.x - this->rightWhip.basePos.x; dy1 = player->actor.world.pos.y - this->rightWhip.basePos.y + 50.0f; dz1 = player->actor.world.pos.z - this->rightWhip.basePos.z; @@ -1911,14 +1908,14 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* whipPos, f32 tension, Boss07* this, this->rightWhip.tension = 0.0f; play_sound(NA_SE_EN_LAST3_GET_LINK_OLD); } - } else if ((player->stateFlags1 & 0x400000) && Boss07_IsFacingPlayer(this, play)) { + } else if ((player->stateFlags1 & PLAYER_STATE1_400000) && Boss07_IsFacingPlayer(this, play)) { player->unk_B80 = 10.0f; player->unk_B84 = this->actor.yawTowardsPlayer; play_sound(NA_SE_IT_SHIELD_BOUND); - this->unk_15A = 4; + this->whipCollisionTimer = 4; } else { func_800B8D50(play, NULL, 5.0f, this->actor.shape.rot.y, 0.0f, 8); - this->unk_15A = 20; + this->whipCollisionTimer = 20; } sp7C = player->actor.world.pos; @@ -1939,18 +1936,18 @@ void Boss07_Wrath_CollisionCheck(Boss07* this, PlayState* play) { u8 damage; Player* player = GET_PLAYER(play); - if (this->unk_15C == 0) { - if (this->sph2.elements[0].info.toucherFlags & 2) { - this->sph2.elements[0].info.toucherFlags &= ~2; + if (this->invincibilityTimer == 0) { + if (this->kickCollider.elements[0].info.toucherFlags & TOUCH_HIT) { + this->kickCollider.elements[0].info.toucherFlags &= ~TOUCH_HIT; player->unk_B84 = this->actor.yawTowardsPlayer; player->unk_B80 = 20.0f; Boss07_SpawnDustAtPos(play, &player->actor.world.pos, 12); play_sound(NA_SE_IT_HOOKSHOT_STICK_OBJ); } - for (i = 0; i < ARRAY_COUNT(this->sphElems1); i++) { - if (this->sph1.elements[i].info.bumperFlags & 2) { - for (j = 0; j < ARRAY_COUNT(this->sphElems1); j++) { - this->sph1.elements[j].info.bumperFlags &= ~2; + for (i = 0; i < ARRAY_COUNT(this->bodyElements); i++) { + if (this->bodyCollider.elements[i].info.bumperFlags & BUMP_HIT) { + for (j = 0; j < ARRAY_COUNT(this->bodyElements); j++) { + this->bodyCollider.elements[j].info.bumperFlags &= ~BUMP_HIT; } if (this->unk_1804 == 10) { this->unk_1806 = 0; @@ -1979,20 +1976,23 @@ void Boss07_Wrath_CollisionCheck(Boss07* this, PlayState* play) { } 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 != MAJORAS_WRATH_DMGEFF_E) && - (this->actor.colChkInfo.damageEffect != MAJORAS_WRATH_DMGEFF_D) && (this->actor.colChkInfo.damageEffect != MAJORAS_WRATH_DMGEFF_9) && + if ((this->actionFunc == Boss07_Wrath_Stunned) && + (this->actor.colChkInfo.damageEffect != MAJORAS_WRATH_DMGEFF_E) && + (this->actor.colChkInfo.damageEffect != MAJORAS_WRATH_DMGEFF_D) && + (this->actor.colChkInfo.damageEffect != MAJORAS_WRATH_DMGEFF_9) && (this->actor.colChkInfo.damageEffect != MAJORAS_WRATH_DMGEFF_C)) { Boss07_Wrath_SetupStunned(this, play); - this->unk_15C = 6; + this->invincibilityTimer = 6; } else { - this->unk_15E = 15; - this->unk_15C = (this->actor.colChkInfo.damageEffect == MAJORAS_WRATH_DMGEFF_C) ? 15 : 5; + this->dmgFogEffectTimer = 15; + this->invincibilityTimer = + (this->actor.colChkInfo.damageEffect == MAJORAS_WRATH_DMGEFF_C) ? 15 : 5; Boss07_Wrath_SetupDamaged(this, play, damage, this->actor.colChkInfo.damageEffect); } } else { - this->unk_15C = 15; + this->invincibilityTimer = 15; Boss07_Wrath_SetupStunned(this, play); - this->unk_F7E = 0; + this->whipGrabIndex = 0; if (&this->actor == player->actor.parent) { player->unk_AE8 = 101; player->actor.parent = NULL; @@ -2022,8 +2022,7 @@ void Boss07_Wrath_BreakIce(Boss07* this, PlayState* play) { pos.x = this->bodyPartsPos[i / 2].x + vel.x; pos.y = this->bodyPartsPos[i / 2].y + vel.y; pos.z = this->bodyPartsPos[i / 2].z + vel.z; - EffectSsEnIce_Spawn(play, &pos, Rand_ZeroFloat(1.0f) + 1.5f, &vel, &sIceAccel, &sLightCyan, &sLightBlue, - 30); + EffectSsEnIce_Spawn(play, &pos, Rand_ZeroFloat(1.0f) + 1.5f, &vel, &sIceAccel, &sLightCyan, &sLightBlue, 30); } } @@ -2124,10 +2123,10 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { play->envCtx.unk_C2 = 0; this->actor.hintId = 52; Math_ApproachF(&play->envCtx.lightBlend, 0.0f, 1.0f, 0.03f); - this->unk_149 = true; + this->updateWhips = true; Math_Vec3f_Copy(&sSfxPoint, &this->actor.projectedPos); if (KREG(63) == 0) { - this->unk_174 = false; + this->canDodge = false; this->actionTimer++; Actor_SetScale(&this->actor, 0.015f); Math_ApproachZeroF(&this->unk_184, 1.0f, 0.02f); @@ -2135,20 +2134,20 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { for (i = 0; i < 3; i++) { DECR(this->timers[i]); } - DECR(this->unk_15A); + DECR(this->whipCollisionTimer); DECR(this->unk_158); - DECR(this->unk_15C); - DECR(this->unk_15E); - DECR(this->unk_156); + DECR(this->invincibilityTimer); + DECR(this->dmgFogEffectTimer); + DECR(this->jumpSfxTimer); Math_ApproachZeroF(&this->unk_32C, 1.0f, 0.2f); Math_ApproachZeroF(&this->unk_330, 1.0f, 0.04f); this->actionFunc(this, play); Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 100.0f, 100.0f, 5); - if (this->unk_14F != 0) { - this->unk_14F--; - if ((this->actionFunc == Boss07_Wrath_Attack) && (this->unk_14F == 0)) { + if (this->whipCrackTimer != 0) { + this->whipCrackTimer--; + if ((this->actionFunc == Boss07_Wrath_Attack) && (this->whipCrackTimer == 0)) { play_sound(NA_SE_EN_LAST3_ROD_FLOOR_OLD); } } @@ -2158,21 +2157,22 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { Boss07_Wrath_WhipCollisionCheck(this->rightWhip.pos, this->rightWhip.tension, this, play); Boss07_Wrath_WhipCollisionCheck(this->leftWhip.pos, this->leftWhip.tension, this, play); if (this->unk_158 != 0) { - for (i = 0; i < ARRAY_COUNT(this->sphElems1); i++) { - this->sph1.elements[i].info.bumperFlags &= ~2; + for (i = 0; i < ARRAY_COUNT(this->bodyElements); i++) { + this->bodyCollider.elements[i].info.bumperFlags &= ~BUMP_HIT; } } Boss07_Wrath_CollisionCheck(this, play); - if (this->unk_15C != 0) { - this->unk_778 = 0; + if (this->invincibilityTimer != 0) { + this->whipTopIndex = 0; } - CollisionCheck_SetOC(play, &play->colChkCtx, &this->sph1.base); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->sph1.base); - if ((this->actionFunc == Boss07_Wrath_Attack) && (this->actionState == MAJORAS_WRATH_ATTACK_7) && (this->actionTimer >= 6)) { - CollisionCheck_SetAT(play, &play->colChkCtx, &this->sph2.base); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->bodyCollider.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base); + if ((this->actionFunc == Boss07_Wrath_Attack) && (this->actionState == MAJORAS_WRATH_KICK) && + (this->actionTimer >= 6)) { + CollisionCheck_SetAT(play, &play->colChkCtx, &this->kickCollider.base); } else { - if (this->unk_174 && Boss07_IsFacingPlayer(this, play)) { - if ((player->unk_D57 == 4) && (player->itemActionParam != 0xC)) { + if (this->canDodge && Boss07_IsFacingPlayer(this, play)) { + if ((player->unk_D57 == 4) && (player->itemActionParam != PLAYER_AP_BOW_LIGHT)) { if ((this->actor.xzDistToPlayer >= 400.0f) && (Rand_ZeroOne() < 0.5f)) { Boss07_Wrath_SetupSidestep(this, play); } else { @@ -2184,22 +2184,22 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { } } if ((this->actionFunc != Boss07_Wrath_Stunned) && (this->actionFunc != Boss07_Wrath_Damaged)) { - if ((player->stateFlags3 & 0x00001000) && !(player->stateFlags3 & 0x00080000) && + if ((player->stateFlags3 & PLAYER_STATE3_1000) && !(player->stateFlags3 & PLAYER_STATE3_80000) && (this->actor.xzDistToPlayer <= 250.0f)) { Boss07_Wrath_Dodge(this, play, false); } } } - if (this->unk_174) { + if (this->canDodge) { Boss07_Wrath_CheckExplosives(this, play); } Boss07_Wrath_BombWhips(this, play); - if (KREG(88) || this->unk_148) { + if (KREG(88) || this->startDeath) { KREG(88) = false; - this->unk_148 = false; + this->startDeath = false; Boss07_Wrath_SetupDeath(this, play); } - if (this->unk_1D8 != 0) { + if (this->bodyDecayRate != 0) { u16* sp74 = SEGMENTED_TO_VIRTUAL(gMajorasWrathEarTex); u16* sp70 = SEGMENTED_TO_VIRTUAL(gMajoraStripesTex); u16* sp6C = SEGMENTED_TO_VIRTUAL(gMajorasWrathMouthTex); @@ -2210,7 +2210,7 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { u16* sp58 = SEGMENTED_TO_VIRTUAL(gMajoraHandTex); u16* sp54 = SEGMENTED_TO_VIRTUAL(gMajoraBodyTex); - for (i = 0; i < this->unk_1D8; i++) { + for (i = 0; i < this->bodyDecayRate; i++) { s32 sp50; s32 sp4C; s32 sp48; @@ -2226,7 +2226,7 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { } } Boss07_DamageEffects(this, play); - if ((this->unk_156 == 1) || (this->unk_156 == 4)) { + if ((this->jumpSfxTimer == 1) || (this->jumpSfxTimer == 4)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_WALK2_OLD); } if ((player->actor.world.pos.y > 100.0f) && (player->actor.world.pos.z < KREG(82) + -850.0f)) { @@ -2237,34 +2237,63 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { } } -void Boss07_Wrath_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* pull, - f32 gravity, f32 stiffness, f32 drag, f32 tension, Vec3s* baseRot, s16 argB, f32 scale, - s32 hand) { +/** + * Whip physics works by first assuming each point moves freely, using its current velocity and various forces to find + * the next position. Then, starting from the base of the whip, each point is moved radially away from the previous + * point until it is a fixed distance away. The new velocity of each point is found from the scaled difference between + * its updated position and previous position. The forces applied are + * - drag, which reduces the magnitude of each velocity component by a fixed amount (or to zero if smaller) + * - gravity, which applies to the y-component of velocity + * - tension, an outward force that makes the whip "crack" + * - additional forces for special movements like wrapping around Link + * The scaling factor of the velocity is the whip's mobility--how well movements at the base are transmitted to the + * ends. + * + * The whip physics algorithm is as follows: + * - Set the position of the 0th point to the position of Wrath's hand (base) + * - Move each component of each point's velocity towards 0 by drag. Set it to zero if the magnitude is less than drag. + * - Calculate the tension force. This is away from Wrath's hand (baserot) for whip movements, in the direction Wrath + * is facing for grab and throw movements. + * - Calculate shaping forces. These are the force from Wrath's hand on the whip base and the force that wraps the whip + * around grabbed objects. Set tension to 0 for the latter segments. + * - Calculate the provisional position of the point by applying the velocity, forces, and gravity. For the y-component, + * set a minimum of 2 to not clip through the floor. + * - Subtract the current position of the previous point along the whip from the calculated position to get the relative + * vector between them + * - Set this vector's rotation to the previous point's rot (used by draw so the segments connect). + * - Calculate a new vector with the same direction and length 22*scale. Add this to the previous point's position to + * get the final position of the point. + * - For grab and throw movements, update the position of the grab point. + * - The point's final velocity is the difference between its current and previous positions, scaled by mobility and + * capped at 200. + */ + +void Boss07_Wrath_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* vel, + f32 gravity, f32 mobility, f32 drag, f32 tension, Vec3s* baseRot, s16 grabIndex, + f32 scale, s32 hand) { s32 i; - s32 phi_s6; - f32 temp_f20; - f32 temp_f24; - f32 temp_f26; - f32 temp_f22; - f32 phi_f0; - Vec3f* temp = pull; - f32 temp1; - Vec3f spB8 = { 0.0f, 0.0f, 0.0f }; + s32 j; + Vec3f tempPos; + f32 segYaw; + f32 tempY; + Vec3f* vel0 = vel; + f32 segPitch; + Vec3f baseSegVec = { 0.0f, 0.0f, 0.0f }; Vec3f spAC; - Vec3f spA0; - Vec3f sp94; - Vec3f sp88; - Vec3f sp7C; + Vec3f segVec; + Vec3f handForce; + Vec3f shapeForce; + Vec3f tensForce; - spB8.z = 22.0f * scale; + baseSegVec.z = 22.0f * scale; - for (i = 0; i < (s16)sWhipSegCount; i++, pull++) { + for (i = 0; i < (s16)sWhipSegCount; i++, vel++) { if (i == 0) { pos[0] = *base; } else { - Math_ApproachF(&pull->x, 0.0f, 1.0f, drag); - Math_ApproachF(&pull->y, 0.0f, 1.0f, drag); - Math_ApproachF(&pull->z, 0.0f, 1.0f, drag); + Math_ApproachF(&vel->x, 0.0f, 1.0f, drag); + Math_ApproachF(&vel->y, 0.0f, 1.0f, drag); + Math_ApproachF(&vel->z, 0.0f, 1.0f, drag); } } spAC.z = 20.0f; @@ -2272,103 +2301,111 @@ void Boss07_Wrath_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* Matrix_RotateXS(baseRot->x, MTXMODE_APPLY); Matrix_RotateZS(baseRot->z, MTXMODE_APPLY); Matrix_RotateYS(0x4000, MTXMODE_APPLY); - Matrix_MultVecZ(spAC.z, &sp94); - if (argB != 0) { + Matrix_MultVecZ(spAC.z, &handForce); + if (grabIndex != 0) { spAC.z = 200.0f; Matrix_RotateYF(this->unk_F8C, MTXMODE_NEW); Matrix_RotateXFApply(this->unk_F90); } else { spAC.z = tension; } - Matrix_MultVecZ(spAC.z, &sp7C); + Matrix_MultVecZ(spAC.z, &tensForce); pos++; rot++; - pull = temp + 1; - phi_s6 = 0; + vel = vel0 + 1; + j = 0; - for (i = 1; i < (s16)sWhipSegCount; i++, pull++, pos++, rot++) { + for (i = 1; i < (s16)sWhipSegCount; i++, vel++, pos++, rot++) { if (i < 6) { - sp88.x = (6 - i) * sp94.x * 0.2f; - sp88.y = (6 - i) * sp94.y * 0.2f; - sp88.z = (6 - i) * sp94.z * 0.2f; - } else if (argB != 0) { - if (argB <= i && i < (s16)(argB + this->unk_F7C)) { - sp88.y = 0.0f; - sp88.x = sinf(this->actor.yawTowardsPlayer * M_PI / 0x8000 + (phi_s6 * 1.4f)) * 100.0f; - sp88.z = cosf(this->actor.yawTowardsPlayer * M_PI / 0x8000 + (phi_s6 * 1.4f)) * 100.0f; - sp7C = gZeroVec3f; - phi_s6++; + shapeForce.x = (6 - i) * handForce.x * 0.2f; + shapeForce.y = (6 - i) * handForce.y * 0.2f; + shapeForce.z = (6 - i) * handForce.z * 0.2f; + } else if (grabIndex != 0) { + if (grabIndex <= i && i < (s16)(grabIndex + this->whipWrapIndex)) { + shapeForce.y = 0.0f; + shapeForce.x = sinf(this->actor.yawTowardsPlayer * M_PI / 0x8000 + (j * 1.4f)) * 100.0f; + shapeForce.z = cosf(this->actor.yawTowardsPlayer * M_PI / 0x8000 + (j * 1.4f)) * 100.0f; + tensForce = gZeroVec3f; + j++; } } else { - sp88 = gZeroVec3f; + shapeForce = gZeroVec3f; } - temp_f24 = pos->x + pull->x - (pos - 1)->x + sp88.x + sp7C.x; - phi_f0 = pos->y + pull->y + gravity + sp88.y + sp7C.y; - phi_f0 = CLAMP_MIN(phi_f0, 2.0f); - temp_f26 = phi_f0 - (pos - 1)->y; - temp_f20 = pos->z + pull->z - (pos - 1)->z + sp88.z + sp7C.z; - temp_f22 = Math_Acot2F(temp_f20, temp_f24); - temp1 = -Math_Acot2F(sqrtf(SQ(temp_f24) + SQ(temp_f20)), temp_f26); - (rot - 1)->y = temp_f22; - (rot - 1)->x = temp1; - Matrix_RotateYF(temp_f22, MTXMODE_NEW); - Matrix_RotateXFApply(temp1); - Matrix_MultVecZ(spB8.z, &spA0); - if (1) {} - temp_f24 = pos->x; - temp_f26 = pos->y; - temp_f20 = pos->z; + tempPos.x = pos->x + vel->x - (pos - 1)->x + shapeForce.x + tensForce.x; + tempY = pos->y + vel->y + gravity + shapeForce.y + tensForce.y; + if (tempY < 2.0f) tempY = 2.0f; + // tempY = CLAMP_MIN(tempY, 2.0f); + tempPos.y = tempY - (pos - 1)->y; + tempPos.z = pos->z + vel->z - (pos - 1)->z + shapeForce.z + tensForce.z; + segYaw = Math_Acot2F(tempPos.z, tempPos.x); + segPitch = -Math_Acot2F(sqrtf(SQ(tempPos.x) + SQ(tempPos.z)), tempPos.y); + (rot - 1)->y = segYaw; + (rot - 1)->x = segPitch; + Matrix_RotateYF(segYaw, MTXMODE_NEW); + Matrix_RotateXFApply(segPitch); + Matrix_MultVecZ(baseSegVec.z, &segVec); + // if (1) {} + tempPos.x = pos->x; + tempPos.y = pos->y; + tempPos.z = pos->z; - pos->x = (pos - 1)->x + spA0.x; - pos->y = (pos - 1)->y + spA0.y; - pos->z = (pos - 1)->z + spA0.z; + pos->x = (pos - 1)->x + segVec.x; + pos->y = (pos - 1)->y + segVec.y; + pos->z = (pos - 1)->z + segVec.z; - if ((i != 0) && (i == argB)) { + if ((i != 0) && (i == grabIndex)) { spAC.x = 15.0f; spAC.y = -30.0f; spAC.z = -12.0f; - Matrix_MultVec3f(&spAC, &spA0); - this->unk_F80.x = pos->x + spA0.x; - this->unk_F80.y = pos->y + spA0.y; - this->unk_F80.z = pos->z + spA0.z; + Matrix_MultVec3f(&spAC, &segVec); + this->whipGrabPos.x = pos->x + segVec.x; + this->whipGrabPos.y = pos->y + segVec.y; + this->whipGrabPos.z = pos->z + segVec.z; } else if ((hand == RIGHT_HAND) && (this->actionFunc == Boss07_Wrath_SpawnTop)) { - if (i == KREG(90) + sWhipSegCount - this->unk_778 + 1) { + if (i == KREG(90) + sWhipSegCount - this->whipTopIndex + 1) { spAC.x = KREG(60); spAC.y = KREG(61); spAC.z = KREG(62); - Matrix_MultVec3f(&spAC, &spA0); - this->unk_F80.x = pos->x + spA0.x; - this->unk_F80.y = pos->y + spA0.y; - this->unk_F80.z = pos->z + spA0.z; + Matrix_MultVec3f(&spAC, &segVec); + this->whipGrabPos.x = pos->x + segVec.x; + this->whipGrabPos.y = pos->y + segVec.y; + this->whipGrabPos.z = pos->z + segVec.z; } } - pull->x = (pos->x - temp_f24) * stiffness; - pull->y = (pos->y - temp_f26) * stiffness; - pull->z = (pos->z - temp_f20) * stiffness; - if (pull->x > 200.0f) { - pull->x = 200.0f; - } - if (pull->x < -200.0f) { - pull->x = -200.0f; - } - if (pull->y > 200.0f) { - pull->y = 200.0f; - } - if (pull->y < -200.0f) { - pull->y = -200.0f; - } - if (pull->z > 200.0f) { - pull->z = 200.0f; - } - if (pull->z < -200.0f) { - pull->z = -200.0f; - } + vel->x = (pos->x - tempPos.x) * mobility; + vel->y = (pos->y - tempPos.y) * mobility; + vel->z = (pos->z - tempPos.z) * mobility; + + #define CLAMP_VAR(x, xmin, xmax) if (x > (xmax)) x = (xmax);if (x < (xmin)) x = (xmin) + + // if (vel->x > 200.0f) vel->x = 200.0f;if (vel->x < -200.0f) vel->x = -200.0f; + CLAMP_VAR(vel->x, -200.0f, 200.0f); + CLAMP_VAR(vel->y, -200.0f, 200.0f); + CLAMP_VAR(vel->z, -200.0f, 200.0f); + // if (vel->x > 200.0f) { + // vel->x = 200.0f; + // } + // if (vel->x < -200.0f) { + // vel->x = -200.0f; + // } + // if (vel->y > 200.0f) { + // vel->y = 200.0f; + // } + // if (vel->y < -200.0f) { + // vel->y = -200.0f; + // } + // if (vel->z > 200.0f) { + // vel->z = 200.0f; + // } + // if (vel->z < -200.0f) { + // vel->z = -200.0f; + // } } } void Boss07_Wrath_DrawWhips(Boss07* this, PlayState* play, Vec3f* pos, Vec3f* rot, f32 zScale, s32 hand) { - s32 phi_s6; + s32 topSegIndex; s32 i; f32 xyScale; s32 pad[2]; @@ -2379,8 +2416,8 @@ void Boss07_Wrath_DrawWhips(Boss07* this, PlayState* play, Vec3f* pos, Vec3f* ro func_8012C28C(play->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, gMajorasMaskWhipShadowMaterialDL); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sREG(48) + 45, 35, 75, 255); - phi_s6 = (hand == RIGHT_HAND) ? this->unk_778 : 0; - for (i = 0; i < (sWhipSegCount - phi_s6) - 1; i++, pos++, rot++) { + topSegIndex = (hand == RIGHT_HAND) ? this->whipTopIndex : 0; + for (i = 0; i < (sWhipSegCount - topSegIndex) - 1; i++, pos++, rot++) { Matrix_Translate(pos->x, 0.0f, pos->z, MTXMODE_NEW); Matrix_Scale(1.0f, 0.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateYF(rot->y, MTXMODE_APPLY); @@ -2394,7 +2431,7 @@ void Boss07_Wrath_DrawWhips(Boss07* this, PlayState* play, Vec3f* pos, Vec3f* ro rot = vec3; gSPDisplayList(POLY_OPA_DISP++, gMajorasWrathWhipMaterialDL); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); - for (i = 0; i < (sWhipSegCount - phi_s6) - 1; i++, pos++, rot++) { + for (i = 0; i < (sWhipSegCount - topSegIndex) - 1; i++, pos++, rot++) { Matrix_Translate(pos->x, pos->y, pos->z, MTXMODE_NEW); Matrix_RotateYF(rot->y, MTXMODE_APPLY); Matrix_RotateXFApply(rot->x); @@ -2406,14 +2443,13 @@ void Boss07_Wrath_DrawWhips(Boss07* this, PlayState* play, Vec3f* pos, Vec3f* ro CLOSE_DISPS(play->state.gfxCtx); } -s32 Boss07_Wrath_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, - Actor* thisx) { +s32 Boss07_Wrath_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { Boss07* this = THIS; if (limbIndex == MAJORAS_WRATH_LIMB_HEAD) { - rot->x += this->unk_17DA; - rot->y += this->unk_17D8; - rot->z += this->unk_17DC; + rot->x += this->csHeadRot.y; + rot->y += this->csHeadRot.x; + rot->z += this->csHeadRot.z; } return false; } @@ -2432,22 +2468,22 @@ void Boss07_Wrath_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 }; static Vec3f sWhipOffset = { 1000.0f, 100.0f, 0.0f }; Boss07* this = THIS; - s8 sp6B; - Vec3f sp5C; - MtxF sp1C; + s8 index; + Vec3f colliderPos; + MtxF curMtxF; - sp6B = sWrathBodyParts[limbIndex]; - if (sp6B >= 0) { - Matrix_MultZero(&this->bodyPartsPos[sp6B]); + index = sWrathBodyParts[limbIndex]; + if (index >= 0) { + Matrix_MultZero(&this->bodyPartsPos[index]); } - sp6B = sLimbColliderIndex[limbIndex]; - if (sp6B >= 0) { + index = sLimbColliderIndex[limbIndex]; + if (index >= 0) { if (this->unk_158 != 0) { - Matrix_MultVecZ(100000.0f, &sp5C); + Matrix_MultVecZ(100000.0f, &colliderPos); } else { - Matrix_MultVec3f(&sWrathColliderOffsets[sp6B], &sp5C); + Matrix_MultVec3f(&sWrathColliderOffsets[index], &colliderPos); } - Boss07_UpdateSpheres(sp6B, &this->sph1, &sp5C); + Boss07_UpdateSpheres(index, &this->bodyCollider, &colliderPos); } if (limbIndex == MAJORAS_WRATH_LIMB_HEAD) { Matrix_MultZero(&this->actor.focus.pos); @@ -2456,19 +2492,19 @@ void Boss07_Wrath_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 Matrix_MultVec3f(&sWhipOffset, &this->rightWhip.basePos); } if (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_LOWER_ARM_ROOT) { - Matrix_Get(&sp1C); - Matrix_MtxFToYXZRot(&sp1C, &this->rightWhip.baseRot, 0); + Matrix_Get(&curMtxF); + Matrix_MtxFToYXZRot(&curMtxF, &this->rightWhip.baseRot, false); } if (limbIndex == MAJORAS_WRATH_LIMB_LEFT_HAND) { Matrix_MultVec3f(&sWhipOffset, &this->leftWhip.basePos); } if (limbIndex == MAJORAS_WRATH_LIMB_LEFT_LOWER_ARM_ROOT) { - Matrix_Get(&sp1C); - Matrix_MtxFToYXZRot(&sp1C, &this->leftWhip.baseRot, 0); + Matrix_Get(&curMtxF); + Matrix_MtxFToYXZRot(&curMtxF, &this->leftWhip.baseRot, false); } if (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_FOOT) { - Matrix_MultZero(&sp5C); - Boss07_UpdateSpheres(0, &this->sph2, &sp5C); + Matrix_MultZero(&colliderPos); + Boss07_UpdateSpheres(0, &this->kickCollider, &colliderPos); } } @@ -2482,7 +2518,7 @@ void Boss07_Wrath_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_FOREARM) || (limbIndex == MAJORAS_WRATH_LIMB_RIGHT_HAND) || (limbIndex == MAJORAS_WRATH_LIMB_LEFT_UPPER_ARM) || (limbIndex == MAJORAS_WRATH_LIMB_LEFT_FOREARM) || (limbIndex == MAJORAS_WRATH_LIMB_LEFT_HAND) || (limbIndex == MAJORAS_WRATH_LIMB_HEAD)) { - Matrix_Scale(1.0f, this->unk_17E0, this->unk_17E0, MTXMODE_APPLY); + Matrix_Scale(1.0f, this->armScale, this->armScale, MTXMODE_APPLY); } } @@ -2507,7 +2543,7 @@ void Boss07_Wrath_DrawShocks(Boss07* this, PlayState* play) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gLightOrbVtxDL); } - for (i = this->unk_780; i >= this->unk_784; i--) { + for (i = this->whipShockIndexHigh; i >= this->whipShockIndexLow; i--) { Matrix_Translate(this->rightWhip.pos[i].x, this->rightWhip.pos[i].y, this->rightWhip.pos[i].z, 0); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_Scale(1.5f, 1.5f, 1.5f, MTXMODE_APPLY); @@ -2533,7 +2569,7 @@ void Boss07_Wrath_DrawShocks(Boss07* this, PlayState* play) { CLOSE_DISPS(gfxCtx); } -void Boss07_Wrath_DrawDeathLights(Boss07* this, PlayState* play, Vec3f* arg2) { +void Boss07_Wrath_DrawDeathLights(Boss07* this, PlayState* play, Vec3f* pos) { s32 i; f32 temp_f12_2; f32 temp_f20; @@ -2542,17 +2578,17 @@ void Boss07_Wrath_DrawDeathLights(Boss07* this, PlayState* play, Vec3f* arg2) { OPEN_DISPS(gfxCtx = play->state.gfxCtx); - if (this->unk_AB4C > 0.0f) { + if (this->deathOrbScale > 0.0f) { 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->deathLightScale); i++) { - temp = sColorsYRGB[0]; + temp = sShotEnvColors[0]; gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, temp[0], temp[1], temp[2], 40); temp_f20 = (Boss07_RandZeroOne() * 40.0f) - 30.0f; Matrix_Translate(this->bodyPartsPos[2].x, this->bodyPartsPos[2].y - 30.0f + 50.0f + temp_f20 + 25.0f, this->bodyPartsPos[2].z, MTXMODE_NEW); - Matrix_Translate(arg2->x, arg2->y + temp_f20, arg2->z, MTXMODE_NEW); + Matrix_Translate(pos->x, pos->y + temp_f20, pos->z, MTXMODE_NEW); Matrix_RotateYF(Boss07_RandZeroOne() * M_PI * 2.0f, MTXMODE_APPLY); Matrix_RotateXFApply(-0.024999999f * temp_f20); Matrix_RotateZF(Boss07_RandZeroOne() * M_PI * 2.0f, MTXMODE_APPLY); @@ -2570,7 +2606,7 @@ void Boss07_Wrath_DrawDeathLights(Boss07* this, PlayState* play, Vec3f* arg2) { Matrix_Translate(this->bodyPartsPos[2].x, this->bodyPartsPos[2].y, this->bodyPartsPos[2].z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_RotateZS(play->gameplayFrames * 0x80, MTXMODE_APPLY); - temp_f12_2 = (sREG(17) + 800) * 0.01f * this->unk_AB4C; + temp_f12_2 = (sREG(17) + 800) * 0.01f * this->deathOrbScale; Matrix_Scale(temp_f12_2, temp_f12_2, 1.0f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gLightOrbVtxDL); @@ -2588,7 +2624,7 @@ void Boss07_Static_DrawLight(Boss07* this, PlayState* play) { OPEN_DISPS(gfxCtx = play->state.gfxCtx); player = GET_PLAYER(play); - if (this->unk_AB44 > 0.0f) { + if (this->introOrbScale > 0.0f) { func_8012C2DC(play->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)(sREG(52) + 255)); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 0); @@ -2609,7 +2645,7 @@ void Boss07_Static_DrawLight(Boss07* this, PlayState* play) { player->actor.world.pos.z + sREG(61) - 15.0f + sp50, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); - Matrix_Scale(this->unk_AB44, this->unk_AB44, this->unk_AB44, MTXMODE_APPLY); + Matrix_Scale(this->introOrbScale, this->introOrbScale, this->introOrbScale, MTXMODE_APPLY); Matrix_RotateZS(play->gameplayFrames * 0x40, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gLightOrbVtxDL); @@ -2627,7 +2663,7 @@ void Boss07_Wrath_Draw(Actor* thisx, PlayState* play2) { func_8012C28C(play->state.gfxCtx); func_8012C2DC(play->state.gfxCtx); - if ((this->unk_15E % 2) != 0) { + if ((this->dmgFogEffectTimer % 2) != 0) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); } Matrix_RotateYF(this->unk_184, MTXMODE_APPLY); @@ -2637,18 +2673,19 @@ void Boss07_Wrath_Draw(Actor* thisx, PlayState* play2) { Boss07_Wrath_PostLimbDraw, Boss07_Wrath_TransformLimbDraw, &this->actor); POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP); - if (((KREG(63) == 0) || (KREG(63) == 2)) && this->unk_149) { + if (((KREG(63) == 0) || (KREG(63) == 2)) && this->updateWhips) { Boss07_Wrath_UpdateWhips(this, play, &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, - this->whipScale, RIGHT_HAND); + this->rightWhip.vel, this->rightWhip.gravity, this->rightWhip.mobility, + this->rightWhip.drag, this->rightWhip.tension, &this->rightWhip.baseRot, + this->whipGrabIndex, this->whipScale, RIGHT_HAND); Boss07_Wrath_UpdateWhips(this, play, &this->leftWhip.basePos, this->leftWhip.pos, this->leftWhip.rot, - this->leftWhip.pull, this->leftWhip.gravity, this->leftWhip.stiffness, this->leftWhip.drag, - this->leftWhip.tension, &this->leftWhip.baseRot, 0, this->whipScale, LEFT_HAND); + this->leftWhip.vel, this->leftWhip.gravity, this->leftWhip.mobility, + this->leftWhip.drag, this->leftWhip.tension, &this->leftWhip.baseRot, 0, + this->whipScale, LEFT_HAND); } Boss07_Wrath_DrawWhips(this, play, this->rightWhip.pos, this->rightWhip.rot, this->whipScale, RIGHT_HAND); Boss07_Wrath_DrawWhips(this, play, this->leftWhip.pos, this->leftWhip.rot, this->whipScale, LEFT_HAND); - if (this->unk_AB48 == 0) { + if (!this->noShadow) { Boss07_Wrath_MakeShadowTex(shadowTex, this, play); Boss07_Wrath_DrawShadowTex(shadowTex, this, play); } @@ -2657,9 +2694,9 @@ void Boss07_Wrath_Draw(Actor* thisx, PlayState* play2) { sp58.y = this->bodyPartsPos[2].y - 30.0f + 50.0f; sp58.z = this->bodyPartsPos[2].z; Boss07_Wrath_DrawDeathLights(this, play, &sp58); - Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, - this->unk_1800, this->unk_1804); - this->unk_149 = false; + Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, + this->unk_1804); + this->updateWhips = false; CLOSE_DISPS(play->state.gfxCtx); } @@ -2786,14 +2823,14 @@ void Boss07_Incarnation_AvoidPlayer(Boss07* this) { this->timers[1] = 30; this->moveTarget.x += this->actor.world.pos.x; this->moveTarget.z += this->actor.world.pos.z; - this->unk_170 = 20000.0f; + this->vel_170 = 0x4E20; } void Boss07_Incarnation_SetupIntro(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Incarnation_Intro; Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationJerkingAnim, 0.0f); this->actor.flags &= ~ACTOR_FLAG_1; - this->unk_17D8 = 0x6E00; + this->csHeadRot.x = 0x6E00; } void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { @@ -2801,18 +2838,18 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { f32 sp58; SkelAnime_Update(&this->skelAnime); - this->unk_ABC8++; + this->timer_ABC8++; Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY); sp58 = Math_SinS(this->actionTimer * 0x4500) * 0.3f; switch (this->csState) { case MAJORAS_INCARNATION_INTRO_STATE_0: - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->csState = MAJORAS_INCARNATION_INTRO_STATE_1; this->subCamNextAt.z = 0.0f; case MAJORAS_INCARNATION_INTRO_STATE_1: this->csState = MAJORAS_INCARNATION_INTRO_STATE_2; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->subCamNextEye.x = 70.0f; this->subCamNextEye.y = 70.0f; this->subCamNextEye.z = 150.0f; @@ -2820,16 +2857,16 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { this->subCamNextAt.y = 80.0f; break; case MAJORAS_INCARNATION_INTRO_STATE_2: - if (this->unk_ABC8 >= 20) { - if (this->unk_ABC8 == 20) { + if (this->timer_ABC8 >= 20) { + if (this->timer_ABC8 == 20) { this->unk_17C8[3] = 1.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_TRANSFORM); } Math_ApproachF(&this->unk_17B8[3], 1.0f + (this->unk_17C8[3] * sp58), 1.0f, 0.5f); } - if (this->unk_ABC8 > 40) { + if (this->timer_ABC8 > 40) { this->csState = MAJORAS_INCARNATION_INTRO_STATE_3; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; } break; case MAJORAS_INCARNATION_INTRO_STATE_3: @@ -2839,30 +2876,30 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { Math_ApproachF(&this->subCamNextAt.x, 0.0f, 0.05f, this->subCamSpeedMod * 20.0f); Math_ApproachF(&this->subCamNextAt.y, 100.0f, 0.05f, this->subCamSpeedMod * 20.0f); Math_ApproachF(&this->subCamSpeedMod, 0.05f, 1.0f, 0.002f); - if (this->unk_ABC8 >= 20) { - if (this->unk_ABC8 == 20) { + if (this->timer_ABC8 >= 20) { + if (this->timer_ABC8 == 20) { this->unk_17C8[2] = 1.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_TRANSFORM); } Math_ApproachF(&this->unk_17B8[2], 1.0f + (this->unk_17C8[2] * sp58), 1.0f, 0.5f); } - if (this->unk_ABC8 >= 50) { - if (this->unk_ABC8 == 50) { + if (this->timer_ABC8 >= 50) { + if (this->timer_ABC8 == 50) { this->unk_17C8[1] = 1.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_TRANSFORM); } Math_ApproachF(&this->unk_17B8[1], 1.0f + (this->unk_17C8[1] * sp58), 1.0f, 0.5f); } - if (this->unk_ABC8 >= 60) { - if (this->unk_ABC8 == 60) { + if (this->timer_ABC8 >= 60) { + if (this->timer_ABC8 == 60) { this->unk_17C8[0] = 1.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_TRANSFORM); } - Math_ApproachF(this->unk_17B8, 1.0f + (this->unk_17C8[0] * sp58), 1.0f, 0.5f); + Math_ApproachF(&this->unk_17B8[0], 1.0f + (this->unk_17C8[0] * sp58), 1.0f, 0.5f); } - if (this->unk_ABC8 == 80) { + if (this->timer_ABC8 == 80) { this->csState = MAJORAS_INCARNATION_INTRO_STATE_4; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; for (i = 0; i < 4; i++) { this->unk_17B8[i] = 1.0f; } @@ -2873,47 +2910,47 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { this->subCamNextEye.y = 120.0f; this->subCamNextEye.z = 140.0f; this->subCamNextAt.y = 170.0f; - if (this->unk_ABC8 >= 10) { - if (this->unk_ABC8 == 10) { + if (this->timer_ABC8 >= 10) { + if (this->timer_ABC8 == 10) { this->unk_17C8[3] = 1.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); } - Math_ApproachS(&this->unk_17D8, (this->unk_17C8[3] * sp58) * 0x6000, 1, 0x4000); + Math_ApproachS(&this->csHeadRot.x, (this->unk_17C8[3] * sp58) * 0x6000, 1, 0x4000); } - if (this->unk_ABC8 == 30) { + if (this->timer_ABC8 == 30) { this->csState = MAJORAS_INCARNATION_INTRO_STATE_5; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->subCamSpeedMod = 0.0f; - this->unk_1D4 = 1000.0f; + this->animEndFrame = 1000.0f; func_80165690(); } break; case MAJORAS_INCARNATION_INTRO_STATE_5: - if (this->unk_ABC8 == 20) { + if (this->timer_ABC8 == 20) { Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationIntroDanceAnim, 0.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasIncarnationIntroDanceAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasIncarnationIntroDanceAnim); } - if (this->unk_ABC8 >= 20) { - sREG(28) = this->unk_ABC8; - if ((this->unk_ABC8 == (KREG(16) + 28)) || (this->unk_ABC8 == (KREG(17) + 60))) { + if (this->timer_ABC8 >= 20) { + sREG(28) = this->timer_ABC8; + if ((this->timer_ABC8 == (KREG(16) + 28)) || (this->timer_ABC8 == (KREG(17) + 60))) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_VOICE_UAUOO2_OLD); } - if ((this->unk_ABC8 == (KREG(18) + 38)) || (this->unk_ABC8 == (KREG(19) + 48)) || - (this->unk_ABC8 == (KREG(20) + 68)) || (this->unk_ABC8 == (KREG(21) + 78))) { + if ((this->timer_ABC8 == (KREG(18) + 38)) || (this->timer_ABC8 == (KREG(19) + 48)) || + (this->timer_ABC8 == (KREG(20) + 68)) || (this->timer_ABC8 == (KREG(21) + 78))) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_GYM_B_OLD); } - if (this->unk_ABC8 == (KREG(38) + 93)) { + if (this->timer_ABC8 == (KREG(38) + 93)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_UAUOO_OLD); } } - if (this->unk_ABC8 == 45) { + if (this->timer_ABC8 == 45) { TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtxt, Lib_SegmentedToVirtual(&gMajorasIncarnationTitleCardTex), 0xA0, 0xB4, 0x80, 0x28); } - if (this->unk_ABC8 == 20) { + if (this->timer_ABC8 == 20) { Audio_QueueSeqCmd(NA_BGM_MAJORAS_INCARNATION | 0x8000); - this->unk_14A = 1; + this->envEffectOn = 1; play->envCtx.lightBlend = 0.0f; } Math_ApproachF(&this->subCamNextEye.x, -80.0f, 0.05f, this->subCamSpeedMod * 80.0f); @@ -2921,7 +2958,7 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { Math_ApproachF(&this->subCamNextEye.z, 220.0f, 0.05f, this->subCamSpeedMod * 180.0f); Math_ApproachF(&this->subCamNextAt.y, 110.0f, 0.05f, this->subCamSpeedMod * 80.0f); Math_ApproachF(&this->subCamSpeedMod, 0.1f, 1.0f, 0.005f); - if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { + if (Animation_OnFrame(&this->skelAnime, this->animEndFrame)) { Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); this->csState = MAJORAS_INCARNATION_INTRO_STATE_0; @@ -2942,7 +2979,7 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { } Matrix_MultVec3f(&this->subCamNextEye, &this->subCamEye); Matrix_MultVec3f(&this->subCamNextAt, &this->subCamAt); - if (this->subCamIndex != 0) { + if (this->subCamIndex != SUB_CAM_ID_DONE) { ShrinkWindow_SetLetterboxTarget(0x1B); Play_SetCameraAtEye(play, this->subCamIndex, &this->subCamAt, &this->subCamEye); } @@ -2977,17 +3014,17 @@ void Boss07_Incarnation_Taunt(Boss07* this, PlayState* play) { Boss07_Incarnation_SetupRun(this, play); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_VOICE_SURPRISED_OLD); } - Boss07_SpawnDust(this, play, 1, false); + Boss07_Incarnation_SpawnDust(this, play, 1, false); } -void Boss07_Incarnation_SetupStunned(Boss07* this, PlayState* play, s16 arg2) { +void Boss07_Incarnation_SetupStunned(Boss07* this, PlayState* play, s16 stunTime) { if (this->actionFunc != Boss07_Incarnation_Stunned) { this->actionFunc = Boss07_Incarnation_Stunned; Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationFallOverStartAnim, -10.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasIncarnationFallOverStartAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasIncarnationFallOverStartAnim); } this->unk_158 = 10; - this->timers[0] = arg2; + this->timers[0] = stunTime; this->timers[1] = 12; } @@ -2998,39 +3035,39 @@ void Boss07_Incarnation_Stunned(Boss07* this, PlayState* play) { if (this->timers[1] == 1) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_LAND); } - if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { + if (Animation_OnFrame(&this->skelAnime, this->animEndFrame)) { Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationFallOverLoopAnim, -5.0f); - this->unk_1D4 = 1000.0f; + this->animEndFrame = 1000.0f; } - if (this->unk_1D4 == 1000.0f) { + if (this->animEndFrame == 1000.0f) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_BIRD_OLD - SFX_FLAG); } if (this->timers[0] == 0) { Boss07_Incarnation_SetupTaunt(this, play); } - Boss07_SpawnDust(this, play, 1, true); + Boss07_Incarnation_SpawnDust(this, play, 1, true); } -void Boss07_Incarnation_SetupDamaged(Boss07* this, PlayState* play, u8 arg2, u8 arg3) { +void Boss07_Incarnation_SetupDamaged(Boss07* this, PlayState* play, u8 damage, u8 dmgEffect) { if (this->actionFunc != Boss07_Incarnation_Damaged) { this->actionFunc = Boss07_Incarnation_Damaged; Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationDamageAnim, -2.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasIncarnationDamageAnim); - } else if (arg3 == 14) { - if (this->skelAnime.curFrame <= (this->unk_1D4 - 5.0f)) { + this->animEndFrame = Animation_GetLastFrame(&gMajorasIncarnationDamageAnim); + } else if (dmgEffect == MAJORAS_INCARNATION_DMGEFF_E) { + if (this->skelAnime.curFrame <= (this->animEndFrame - 5.0f)) { this->unk_158 = 30; - this->unk_15C = 30; + this->invincibilityTimer = 30; } else { Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationDamageAnim, -2.0f); } } if (this->actor.colChkInfo.health != 0) { - this->actor.colChkInfo.health -= arg2; + this->actor.colChkInfo.health -= damage; if ((s8)this->actor.colChkInfo.health <= 0) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_DEAD_OLD); - this->unk_148 = true; - this->unk_15C = 100; + this->startDeath = true; + this->invincibilityTimer = 100; this->unk_158 = 100; Enemy_StartFinishingBlow(play, &this->actor); return; @@ -3043,10 +3080,10 @@ void Boss07_Incarnation_Damaged(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&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)) { + if (Animation_OnFrame(&this->skelAnime, this->animEndFrame)) { Boss07_Incarnation_SetupRun(this, play); } - Boss07_SpawnDust(this, play, 1, false); + Boss07_Incarnation_SpawnDust(this, play, 1, false); } void Boss07_Incarnation_SetupRun(Boss07* this, PlayState* play) { @@ -3062,10 +3099,10 @@ void Boss07_Incarnation_Run(Boss07* this, PlayState* play) { s32 sp2C; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_WALK_OLD - SFX_FLAG); - this->unk_AB40++; - if (this->unk_AB40 >= 2) { + this->timer_AB40++; + if (this->timer_AB40 >= 2) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_WALK2_OLD); - this->unk_AB40 = 0; + this->timer_AB40 = 0; } SkelAnime_Update(&this->skelAnime); if ((func_800B64FC(play, 5.0f, &this->actor.world.pos, &sp2C) >= 0.0f) && (sp2C == 0)) { @@ -3074,17 +3111,17 @@ void Boss07_Incarnation_Run(Boss07* this, PlayState* play) { } else { sp34 = this->moveTarget.x - this->actor.world.pos.x; sp30 = this->moveTarget.z - this->actor.world.pos.z; - if ((this->timers[1] == 0) || (SQ(sp34) + SQ(sp30) < SQ(173.20508f))) { // 100 * sqrt(3) + if ((this->timers[1] == 0) || (SQ(sp34) + SQ(sp30) < 30000.0f)) { // dist ~ 173.2 if (Rand_ZeroOne() < 0.3f) { - f32 temp_f0 = Rand_ZeroOne(); + f32 rand = Rand_ZeroOne(); - if (temp_f0 < 0.25f) { + if (rand < 0.25f) { Boss07_Incarnation_SetupAttack(this, play); - } else if (temp_f0 < 0.5f) { + } else if (rand < 0.5f) { Boss07_Incarnation_SetupHopak(this, play); - } else if (temp_f0 < 0.75f) { + } else if (rand < 0.75f) { Boss07_Incarnation_SetupMoonwalk(this, play); - } else if (temp_f0 < 1.0f) { + } else if (rand < 1.0f) { Boss07_Incarnation_SetupPirouette(this, play); } } else if (Rand_ZeroOne() < 0.01f) { @@ -3092,11 +3129,11 @@ void Boss07_Incarnation_Run(Boss07* this, PlayState* play) { } else { Boss07_RandVec3fXZ(&this->moveTarget, 500.0f); this->timers[1] = Rand_ZeroFloat(50.0f) + 20.0f; - this->unk_170 = 0.0f; + this->vel_170 = 0.0f; } } - Math_ApproachS(&this->actor.world.rot.y, Math_Atan2S(sp34, sp30), 5, this->unk_170); - Math_ApproachF(&this->unk_170, 4000.0f, 1.0f, 500.0f); + Math_ApproachS(&this->actor.world.rot.y, Math_Atan2S(sp34, sp30), 5, this->vel_170); + Math_ApproachF(&this->vel_170, 0xFA0, 1.0f, 0x1F4); Math_ApproachF(&this->actor.speedXZ, 25.0f, 1.0f, 20.0f); if (this->timers[0] == 0) { Boss07_Incarnation_SetupTaunt(this, play); @@ -3106,8 +3143,8 @@ void Boss07_Incarnation_Run(Boss07* this, PlayState* play) { this->timers[0] = 50; this->timers[2] = 50; } - Boss07_SpawnDust(this, play, 3, false); - this->unk_18D6 = 5; + Boss07_Incarnation_SpawnDust(this, play, 3, false); + this->timer_18D6 = 5; } } @@ -3115,7 +3152,7 @@ void Boss07_Incarnation_SetupAttack(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Incarnation_Attack; Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationEnergyBallAttackAnim, -5.0f); this->timers[0] = Rand_ZeroFloat(50.0f) + 30.0f; - this->unk_188C = 0.0f; + this->eyeBeamsZscale = 0.0f; } void Boss07_Incarnation_Attack(Boss07* this, PlayState* play) { @@ -3123,17 +3160,17 @@ void Boss07_Incarnation_Attack(Boss07* this, PlayState* play) { Boss07_SmoothStop(this, 3.0f); Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 0x3000); if (Animation_OnFrame(&this->skelAnime, 4.0f)) { - Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->unk_17A0.x, this->unk_17A0.y, - this->unk_17A0.z, 0, 0, 0, MAJORAS_INCARNATION_SHOT); + Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->incLeftHandPos.x, this->incLeftHandPos.y, + this->incLeftHandPos.z, 0, 0, 0, MAJORAS_INCARNATION_SHOT); } if (Animation_OnFrame(&this->skelAnime, 9.0f)) { - Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->unk_17AC.x, this->unk_17AC.y, - this->unk_17AC.z, 0, 0, 0, MAJORAS_INCARNATION_SHOT); + Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->incRightHandPos.x, this->incRightHandPos.y, + this->incRightHandPos.z, 0, 0, 0, MAJORAS_INCARNATION_SHOT); } if (this->timers[0] == 0) { Boss07_Incarnation_SetupRun(this, play); } - Boss07_SpawnDust(this, play, 1, false); + Boss07_Incarnation_SpawnDust(this, play, 1, false); } void Boss07_Incarnation_SetupHopak(Boss07* this, PlayState* play) { @@ -3141,19 +3178,19 @@ void Boss07_Incarnation_SetupHopak(Boss07* this, PlayState* play) { Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationSquattingDanceAnim, -5.0f); this->timers[0] = Rand_ZeroFloat(100.0f) + 100.0f; this->timers[1] = 0; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; } void Boss07_Incarnation_Hopak(Boss07* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - if ((this->unk_ABC8 % 2) == 0) { + if ((this->timer_ABC8 % 2) == 0) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_VOICE_UAUOO1_OLD); } else { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_VOICE_UAUOO2_OLD); } Audio_PlaySfxAtPos(&sSfxPoint, NA_SE_EN_LAST2_JUMP_OLD); - this->unk_ABC8++; + this->timer_ABC8++; } Math_ApproachF(&this->actor.speedXZ, KREG(67) + 10.0f, 1.0f, 3.0f); if (this->timers[1] == 0) { @@ -3176,7 +3213,7 @@ void Boss07_Incarnation_Hopak(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_VOICE_SURPRISED_OLD); } } - Boss07_SpawnDust(this, play, 7, false); + Boss07_Incarnation_SpawnDust(this, play, 7, false); } void Boss07_Incarnation_SetupMoonwalk(Boss07* this, PlayState* play) { @@ -3193,12 +3230,12 @@ void Boss07_Incarnation_Moonwalk(Boss07* this, PlayState* play) { if (this->timers[1] == 0) { if ((this->actionTimer == 0) && (Rand_ZeroOne() < 0.5f)) { if (Rand_ZeroOne() < 0.75f) { - this->unk_180 = randPlusMinusPoint5Scaled(65536.0f); + this->unk_180 = randPlusMinusPoint5Scaled(0x10000); } else { this->unk_180 = this->actor.yawTowardsPlayer + 0x8000; } } - if ((this->actor.bgCheckFlags & 8) != 0) { + if (this->actor.bgCheckFlags & 8) { this->timers[1] = 20; this->unk_180 = this->actor.yawTowardsPlayer + 0x8000; } @@ -3207,7 +3244,7 @@ void Boss07_Incarnation_Moonwalk(Boss07* this, PlayState* play) { if (this->timers[0] == 0) { Boss07_Incarnation_SetupRun(this, play); } - Boss07_SpawnDust(this, play, 7, false); + Boss07_Incarnation_SpawnDust(this, play, 7, false); } void Boss07_Incarnation_SetupPirouette(Boss07* this, PlayState* play) { @@ -3224,7 +3261,7 @@ void Boss07_Incarnation_Pirouette(Boss07* this, PlayState* play) { if (this->timers[1] == 0) { if (((this->actionTimer % 0x40) == 0) && (Rand_ZeroOne() < 0.5f)) { if (Rand_ZeroOne() < 0.75f) { - this->unk_180 = randPlusMinusPoint5Scaled(65536.0f); + this->unk_180 = randPlusMinusPoint5Scaled(0x10000); } else { this->unk_180 = this->actor.yawTowardsPlayer; } @@ -3248,19 +3285,19 @@ void Boss07_Incarnation_SetupDeath(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Incarnation_Death; Boss07_MovePlayer(play); Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationDamageAnim, -2.0f); - this->unk_1D4 = Animation_GetLastFrame(&gMajorasIncarnationDamageAnim); + this->animEndFrame = Animation_GetLastFrame(&gMajorasIncarnationDamageAnim); this->csState = MAJORAS_INCARNATION_DEATH_STATE_0; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->actor.flags &= ~ACTOR_FLAG_1; - this->unk_15C = 20; + this->invincibilityTimer = 20; } void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { Player* player = GET_PLAYER(play); u8 sp4B = 0; - this->unk_15C = 20; - this->unk_ABC8++; + this->invincibilityTimer = 20; + this->timer_ABC8++; SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 3.0f); switch (this->csState) { @@ -3273,7 +3310,7 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { this->subCamIndex = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, this->subCamIndex, CAM_STATUS_ACTIVE); - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->csState = MAJORAS_INCARNATION_DEATH_STATE_10; func_8016566C(150); case MAJORAS_INCARNATION_DEATH_STATE_10: @@ -3286,17 +3323,17 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { this->subCamNextAt.z = 0.0f; Math_ApproachF(&this->actor.world.pos.x, 0.0f, 0.1f, 5.0f); Math_ApproachF(&this->actor.world.pos.z, 0.0f, 0.1f, 5.0f); - if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { - this->unk_ABC8 = 0; + if (Animation_OnFrame(&this->skelAnime, this->animEndFrame)) { + this->timer_ABC8 = 0; this->csState = MAJORAS_INCARNATION_DEATH_STATE_1; Animation_MorphToLoop(&this->skelAnime, &gMajorasIncarnationFinalHitAnim, -5.0f); } break; case MAJORAS_INCARNATION_DEATH_STATE_1: sHeartbeatTimer = 5; - this->subCamNextAt.y = (Math_SinS(this->unk_ABC8 * 0x700) * 15.0f) + 150.0f; - if (this->unk_ABC8 == 40) { - this->unk_ABC8 = 0; + this->subCamNextAt.y = (Math_SinS(this->timer_ABC8 * 0x700) * 15.0f) + 150.0f; + if (this->timer_ABC8 == 40) { + this->timer_ABC8 = 0; this->csState = MAJORAS_INCARNATION_DEATH_STATE_2; this->subCamNextEye.x = -30.0f; this->subCamNextEye.y = 120.0f; @@ -3320,9 +3357,9 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { case MAJORAS_INCARNATION_DEATH_STATE_2: sHeartbeatTimer = 5; sp4B = 1; - if (this->unk_ABC8 == 40) { - this->unk_ABC8 = 0; - this->csState =MAJORAS_INCARNATION_DEATH_STATE_3; + if (this->timer_ABC8 == 40) { + this->timer_ABC8 = 0; + this->csState = MAJORAS_INCARNATION_DEATH_STATE_3; this->subCamNextEye.x = 30.0f; this->subCamNextEye.y = 120.0f; this->subCamNextEye.z = 110.0f; @@ -3337,8 +3374,8 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { case MAJORAS_INCARNATION_DEATH_STATE_3: sHeartbeatTimer = 5; sp4B = 1; - if (this->unk_ABC8 == 40) { - this->unk_ABC8 = 0; + if (this->timer_ABC8 == 40) { + this->timer_ABC8 = 0; this->csState = MAJORAS_INCARNATION_DEATH_STATE_4; this->subCamNextEye.x = 0.0f; this->subCamNextEye.y = 90.0f; @@ -3354,12 +3391,12 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { case MAJORAS_INCARNATION_DEATH_STATE_4: sHeartbeatTimer = 5; sp4B = 2; - if (this->unk_ABC8 == 10) { + if (this->timer_ABC8 == 10) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_PUMP_UP_OLD); } - if (this->unk_ABC8 == 40) { - Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, this->subCamIndex, MAJORAS_WRATH); + if (this->timer_ABC8 == 40) { + Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, this->subCamIndex, MAJORAS_WRATH); Actor_MarkForDeath(&this->actor); } break; @@ -3369,17 +3406,17 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { Matrix_MultVec3f(&this->subCamNextEye, &this->subCamEye); Matrix_MultVec3f(&this->subCamNextAt, &this->subCamAt); if (sp4B == 1) { - this->unk_17E0 = (Math_SinS(this->unk_ABC8 * 0x3000) * this->unk_17EC) + this->unk_17E8; + this->armScale = (Math_SinS(this->timer_ABC8 * 0x3000) * this->unk_17EC) + this->unk_17E8; Math_ApproachF(&this->unk_17E8, 2.0f, 1.0f, 0.05f); Math_ApproachZeroF(&this->unk_17EC, 1.0f, 0.01f); } else if (sp4B == 2) { - this->unk_17E4 = (Math_SinS(this->unk_ABC8 * 0x3000) * this->unk_17EC) + this->unk_17E8; + this->legScale = (Math_SinS(this->timer_ABC8 * 0x3000) * this->unk_17EC) + this->unk_17E8; Math_ApproachF(&this->unk_17E8, 2.0f, 1.0f, 0.05f); Math_ApproachZeroF(&this->unk_17EC, 1.0f, 0.01f); } - this->unk_17F0 = (Math_SinS(this->unk_ABC8 * 0x2000) * 0.1f) + 1.0f; - this->unk_17F4 = (Math_CosS(this->unk_ABC8 * 0x2000) * 0.1f) + 1.0f; - if (this->subCamIndex != 0) { + this->chestScaleY = (Math_SinS(this->timer_ABC8 * 0x2000) * 0.1f) + 1.0f; + this->chestScaleX = (Math_CosS(this->timer_ABC8 * 0x2000) * 0.1f) + 1.0f; + if (this->subCamIndex != SUB_CAM_ID_DONE) { ShrinkWindow_SetLetterboxTarget(0x1B); Play_SetCameraAtEye(play, this->subCamIndex, &this->subCamAt, &this->subCamEye); } @@ -3390,11 +3427,11 @@ void Boss07_Incarnation_CollisionCheck(Boss07* this, PlayState* play) { s32 j; u8 damage; - if (this->unk_15C == 0) { - for (i = 0; i < ARRAY_COUNT(this->sphElems1); i++) { - if (this->sph1.elements[i].info.bumperFlags & 2) { - for (j = 0; j < ARRAY_COUNT(this->sphElems1); j++) { - this->sph1.elements[j].info.bumperFlags &= ~2; + if (this->invincibilityTimer == 0) { + for (i = 0; i < ARRAY_COUNT(this->bodyElements); i++) { + if (this->bodyCollider.elements[i].info.bumperFlags & BUMP_HIT) { + for (j = 0; j < ARRAY_COUNT(this->bodyElements); j++) { + this->bodyCollider.elements[j].info.bumperFlags &= ~BUMP_HIT; } if (this->unk_1804 == 10) { this->unk_1806 = 0; @@ -3424,12 +3461,13 @@ void Boss07_Incarnation_CollisionCheck(Boss07* this, PlayState* play) { if ((this->actionFunc == Boss07_Incarnation_Stunned) || (this->actionFunc == Boss07_Incarnation_Damaged)) { - this->unk_15C = (this->actor.colChkInfo.damageEffect == MAJORAS_INCARNATION_DMGEFF_C) ? 15 : 5; + this->invincibilityTimer = + (this->actor.colChkInfo.damageEffect == MAJORAS_INCARNATION_DMGEFF_C) ? 15 : 5; damage = this->actor.colChkInfo.damage; Boss07_Incarnation_SetupDamaged(this, play, damage, this->actor.colChkInfo.damageEffect); - this->unk_15E = 15; + this->dmgFogEffectTimer = 15; } else { - this->unk_15C = 15; + this->invincibilityTimer = 15; Boss07_Incarnation_SetupStunned(this, play, 150); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_DAMAGE_OLD); } @@ -3458,59 +3496,58 @@ void Boss07_Incarnation_Update(Actor* thisx, PlayState* play2) { this->actor.hintId = 51; this->actionTimer++; Math_Vec3f_Copy(&sSfxPoint, &this->actor.projectedPos); - if (this->unk_14A == 1) { + if (this->envEffectOn == 1) { s32 pad; Math_ApproachF(&play->envCtx.lightBlend, 1.0f, 1.0f, 0.1f); if (play->envCtx.lightBlend == 1.0f) { play->envCtx.lightBlend = 0.0f; - this->unk_14B++; - if (this->unk_14B >= 8) { - this->unk_14B = 0; + this->envEffectTimer++; + if (this->envEffectTimer >= 8) { + this->envEffectTimer = 0; } } - play->envCtx.unk_C2 = D_80A08198[this->unk_14B]; - play->envCtx.unk_C1 = D_80A081A0[this->unk_14B]; + play->envCtx.unk_C2 = D_80A08198[this->envEffectTimer]; + play->envCtx.unk_C1 = D_80A081A0[this->envEffectTimer]; } Math_ApproachF(&play->envCtx.lightBlend, 0.0f, 1.0f, 0.03f); if (KREG(63) == 0) { - this->unk_174 = false; + this->canDodge = false; this->actor.shape.shadowAlpha = 130; for (i = 0; i < 3; i++) { DECR(this->timers[i]); } - DECR(this->unk_15C); - DECR(this->unk_15E); + DECR(this->invincibilityTimer); + DECR(this->dmgFogEffectTimer); DECR(this->unk_158); - DECR(this->unk_18D6); + DECR(this->timer_18D6); Math_ApproachZeroF(&this->unk_330, 1.0f, 0.04f); this->actionFunc(this, play); Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 200.0f, 100.0f, 5); - if (this->unk_148 || KREG(88)) { + if (this->startDeath || KREG(88)) { KREG(88) = false; - this->unk_148 = false; + this->startDeath = false; Audio_QueueSeqCmd(NA_BGM_STOP | 0x10000); Boss07_Incarnation_SetupDeath(this, play); } } if (this->unk_158 != 0) { - for (i = 0; i < ARRAY_COUNT(this->sphElems1); i++) { - this->sph1.elements[i].info.bumperFlags &= ~BUMP_HIT; + for (i = 0; i < ARRAY_COUNT(this->bodyElements); i++) { + this->bodyCollider.elements[i].info.bumperFlags &= ~BUMP_HIT; } } Boss07_Incarnation_CollisionCheck(this, play); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->sph1.base); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->sph1.base); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->bodyCollider.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base); 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->actionTimer & 1)) { - Boss07* afterimage = - (Boss07*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, 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, MAJORAS_AFTERIMAGE); + if ((this->timer_18D6 != 0) && !(this->actionTimer & 1)) { + Boss07* afterimage = (Boss07*)Actor_SpawnAsChild( + &play->actorCtx, &this->actor, play, 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, MAJORAS_AFTERIMAGE); if (afterimage != NULL) { for (i = 0; i < MAJORAS_INCARNATION_LIMB_MAX; i++) { @@ -3529,8 +3566,8 @@ void Boss07_Afterimage_Draw(Actor* thisx, PlayState* play2) { OPEN_DISPS(play->state.gfxCtx); func_8012C28C(play->state.gfxCtx); POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 0, 0, 100, 155, 900, 1099); - SkelAnime_DrawFlexOpa(play, sp34->skelAnime.skeleton, this->skelAnime.jointTable, sp34->skelAnime.dListCount, - NULL, NULL, &this->actor); + SkelAnime_DrawFlexOpa(play, sp34->skelAnime.skeleton, this->skelAnime.jointTable, sp34->skelAnime.dListCount, NULL, + NULL, &this->actor); POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP); CLOSE_DISPS(play->state.gfxCtx); } @@ -3540,7 +3577,7 @@ s32 Boss07_Incarnation_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dL Boss07* this = THIS; if (limbIndex == MAJORAS_INCARNATION_LIMB_EYESTALK) { - rot->y += this->unk_17D8; + rot->y += this->csHeadRot.x; } return false; } @@ -3582,19 +3619,19 @@ void Boss07_Incarnation_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList } else { Matrix_MultVec3f(&sIncarnationColliderOffsets[i], &sp28); } - Boss07_UpdateSpheres(i, &this->sph1, &sp28); + Boss07_UpdateSpheres(i, &this->bodyCollider, &sp28); } if (limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_FOOT) { - Matrix_MultZero(&this->unk_1788[0]); + Matrix_MultZero(&this->incFeetPos[0]); } if (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_FOOT) { - Matrix_MultZero(&this->unk_1788[1]); + Matrix_MultZero(&this->incFeetPos[1]); } if (limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_HAND) { - Matrix_MultZero(&this->unk_17AC); + Matrix_MultZero(&this->incRightHandPos); } if (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_HAND) { - Matrix_MultZero(&this->unk_17A0); + Matrix_MultZero(&this->incLeftHandPos); } i = sLimbPumpIndex[limbIndex]; if (i >= 0) { @@ -3606,18 +3643,18 @@ void Boss07_Incarnation_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* Boss07* this = THIS; if (limbIndex == MAJORAS_INCARNATION_LIMB_MASK) { - Matrix_Scale(this->unk_17F4, this->unk_17F0, 1.0f, MTXMODE_APPLY); + Matrix_Scale(this->chestScaleX, this->chestScaleY, 1.0f, MTXMODE_APPLY); } if ((limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_UPPER_ARM) || (limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_FOREARM) || (limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_HAND) || (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_UPPER_ARM) || (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_FOREARM) || (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_HAND)) { - Matrix_Scale(1.0f, this->unk_17E0, this->unk_17E0, MTXMODE_APPLY); + Matrix_Scale(1.0f, this->armScale, this->armScale, MTXMODE_APPLY); } if ((limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_THIGH) || (limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_SHIN) || (limbIndex == MAJORAS_INCARNATION_LIMB_RIGHT_FOOT) || (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_THIGH) || (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_SHIN) || (limbIndex == MAJORAS_INCARNATION_LIMB_LEFT_FOOT)) { - Matrix_Scale(1.0f, this->unk_17E4, this->unk_17E4, MTXMODE_APPLY); + Matrix_Scale(1.0f, this->legScale, this->legScale, MTXMODE_APPLY); } } @@ -3628,15 +3665,15 @@ void Boss07_Incarnation_Draw(Actor* thisx, PlayState* play2) { OPEN_DISPS(play->state.gfxCtx); func_8012C28C(play->state.gfxCtx); func_8012C2DC(play->state.gfxCtx); - if ((this->unk_15E % 2) != 0) { + if ((this->dmgFogEffectTimer % 2) != 0) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); } SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, Boss07_Incarnation_OverrideLimbDraw, Boss07_Incarnation_PostLimbDraw, Boss07_Incarnation_TransformLimbDraw, &this->actor); POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP); - Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, - this->unk_1800, this->unk_1804); + Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, + this->unk_1804); CLOSE_DISPS(play->state.gfxCtx); } @@ -3644,7 +3681,7 @@ void Boss07_Mask_SetupIdle(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Mask_Idle; Animation_MorphToLoop(&this->skelAnime, &gMajorasMaskFloatingAnim, -20.0f); this->timers[2] = Rand_ZeroFloat(150.0f) + 60.0f; - this->unk_1870 = 1.0f; + this->tentLengthScale = 1.0f; } void Boss07_Mask_Idle(Boss07* this, PlayState* play) { @@ -3660,20 +3697,21 @@ void Boss07_Mask_Idle(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&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 <= 8) && (player->transformation != PLAYER_FORM_FIERCE_DEITY) && (Rand_ZeroOne() < 0.75f)) { + if (((s8)this->actor.colChkInfo.health <= 8) && (player->transformation != PLAYER_FORM_FIERCE_DEITY) && + (Rand_ZeroOne() < 0.75f)) { Boss07_Mask_SetupBeam(this, play); } else { Boss07_Mask_SetupSpin(this, play); } } else if (Rand_ZeroOne() < 0.15f) { - this->unk_18C = 2.0f; + this->flySpeedTarget = 2.0f; this->timers[0] = Rand_ZeroFloat(50.0f) + 30.0f; } else { Boss07_RandVec3fXZ(&this->moveTarget, 500.0f); this->moveTarget.y = Rand_ZeroFloat(350.0f) + 100.0f; this->timers[0] = Rand_ZeroFloat(50.0f) + 20.0f; - this->unk_170 = 0.0f; - this->unk_18C = Rand_ZeroFloat(12.0f) + 3.0f; + this->vel_170 = 0.0f; + this->flySpeedTarget = Rand_ZeroFloat(12.0f) + 3.0f; } } sp30 = this->moveTarget.x - this->actor.world.pos.x; @@ -3681,14 +3719,14 @@ void Boss07_Mask_Idle(Boss07* this, PlayState* play) { sp28 = this->moveTarget.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->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); - Math_ApproachF(&this->actor.speedXZ, this->unk_18C, 1.0f, 1.0f); + sp36 += (s16)(Math_SinS(this->actionTimer * 0x1388) * 0xFA0); + Math_ApproachS(&this->actor.world.rot.y, sp34, 0xA, this->vel_170); + Math_ApproachS(&this->actor.world.rot.x, sp36, 5, this->vel_170); + Math_ApproachF(&this->vel_170, 0x7D0, 1.0f, 0x64); + Math_ApproachF(&this->actor.speedXZ, this->flySpeedTarget, 1.0f, 1.0f); if (this->timers[1] != 0) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x3000); - } else if (this->unk_18C < 7.0f) { + } else if (this->flySpeedTarget < 7.0f) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x2000); } else { Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 5, 0x2000); @@ -3698,9 +3736,9 @@ void Boss07_Mask_Idle(Boss07* this, PlayState* play) { } Math_ApproachS(&this->actor.shape.rot.x, 0, 0xA, 0x200); Math_ApproachS(&this->actor.shape.rot.z, 0, 0xA, 0x400); - if (this->unk_148 || KREG(88)) { + if (this->startDeath || KREG(88)) { KREG(88) = false; - this->unk_148 = false; + this->startDeath = false; Audio_QueueSeqCmd(NA_BGM_STOP | 0x10000); Boss07_Mask_SetupDeath(this, play); } @@ -3711,7 +3749,7 @@ void Boss07_Mask_SetupSpin(Boss07* this, PlayState* play) { this->actionState = MAJORAS_MASK_SPIN_START; this->csState = 0; this->timers[0] = 30; - this->unk_18D4 = 0; + this->spinVel = 0; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_ATTACK_OLD); } @@ -3724,25 +3762,25 @@ void Boss07_Mask_Spin(Boss07* this, PlayState* play) { f32 sp24; Player* player = GET_PLAYER(play); - this->actor.shape.rot.z -= this->unk_18D4; + this->actor.shape.rot.z -= this->spinVel; switch (this->actionState) { case MAJORAS_MASK_SPIN_START: 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); + Math_ApproachS(&this->spinVel, 0x2000, 1, 0x100); if (this->timers[0] == 0) { this->actionState = MAJORAS_MASK_SPIN_ATTACK; this->actor.world.rot.x = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->timers[0] = 100; this->timers[1] = 20; - this->unk_170 = 0.0f; + this->vel_170 = 0.0f; } break; case MAJORAS_MASK_SPIN_ATTACK: Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 0xA, 0x400); - Math_ApproachS(&this->unk_18D4, 0x2000, 1, 0x200); + Math_ApproachS(&this->spinVel, 0x2000, 1, 0x200); if (this->timers[1] != 0) { this->moveTarget.x = player->actor.world.pos.x; this->moveTarget.y = player->actor.world.pos.y + 10.0f; @@ -3756,9 +3794,9 @@ void Boss07_Mask_Spin(Boss07* this, PlayState* play) { sp34 = Math_Atan2S(sp30, sp28); sp24 = sqrtf(SQ(sp30) + SQ(sp28)); sp36 = Math_Atan2S(sp2C, sp24); - Math_ApproachS(&this->actor.world.rot.y, sp34, 0xA, this->unk_170); - Math_ApproachS(&this->actor.world.rot.x, sp36, 0xA, this->unk_170); - Math_ApproachF(&this->unk_170, 3000.0f, 1.0f, 100.0f); + Math_ApproachS(&this->actor.world.rot.y, sp34, 0xA, this->vel_170); + Math_ApproachS(&this->actor.world.rot.x, sp36, 0xA, this->vel_170); + Math_ApproachF(&this->vel_170, 0xBB8, 1.0f, 0x64); 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) { @@ -3776,12 +3814,12 @@ void Boss07_Mask_Spin(Boss07* this, PlayState* play) { this->csState = 0; } this->timers[0] = 50; - this->unk_170 = 0.0f; + this->vel_170 = 0.0f; } } break; case MAJORAS_MASK_SPIN_END: - Math_ApproachS(&this->unk_18D4, 0, 1, 0x100); + Math_ApproachS(&this->spinVel, 0, 1, 0x100); Math_ApproachS(&this->actor.world.rot.x, 0x2000, 0xA, 0x7D0); Boss07_SmoothStop(this, 0.5f); if (this->timers[0] == 0) { @@ -3794,7 +3832,7 @@ void Boss07_Mask_SetupStunned(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Mask_Stunned; Animation_MorphToLoop(&this->skelAnime, &gMajorasMaskJerkingAnim, -10.0f); this->timers[0] = 100; - this->unk_170 = 0.0f; + this->vel_170 = 0.0f; } void Boss07_Mask_Stunned(Boss07* this, PlayState* play) { @@ -3806,11 +3844,11 @@ void Boss07_Mask_Stunned(Boss07* this, PlayState* play) { if (this->actor.world.pos.y > 51.0f) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_FALL_OLD - SFX_FLAG); } - 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); + Math_ApproachF(&this->actor.world.pos.y, 50.0f + 10.0f * Math_SinS(this->actionTimer * 0x5DC), 0.1f, this->vel_170); + Math_ApproachF(&this->vel_170, 15.0f, 1.0f, 1.0f); if ((this->timers[0] > 30) || ((this->timers[0] & 2) != 0)) { - this->unk_1884 = 1; + this->maskEyeState = 1; } if (this->timers[0] == 0) { Boss07_Mask_SetupIdle(this, play); @@ -3818,7 +3856,7 @@ void Boss07_Mask_Stunned(Boss07* this, PlayState* play) { } } -void Boss07_Mask_SetupDamaged(Boss07* this, PlayState* play, u8 damage, Actor* arg3) { +void Boss07_Mask_SetupDamaged(Boss07* this, PlayState* play, u8 damage, Actor* hitActor) { Player* player = GET_PLAYER(play); this->actionFunc = Boss07_Mask_Damaged; @@ -3826,19 +3864,19 @@ void Boss07_Mask_SetupDamaged(Boss07* this, PlayState* play, u8 damage, Actor* a if (damage) { this->actor.speedXZ = 30.0f; this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; - this->unk_18D4 = 0x1500; + this->spinVel = 0x1500; } else { - if (player->stateFlags3 & 0x200) { + if (player->stateFlags3 & PLAYER_STATE3_200) { this->actor.speedXZ = 20.0f; this->actor.velocity.y = 20.0f; } else { this->actor.speedXZ = 13.0f; this->actor.velocity.y = 10.0f; - if (arg3 != NULL) { - this->actor.world.rot.y = arg3->world.rot.y; + if (hitActor != NULL) { + this->actor.world.rot.y = hitActor->world.rot.y; } } - this->unk_18D4 = 0x1000; + this->spinVel = 0x1000; } this->actor.colChkInfo.health -= damage; if ((s8)this->actor.colChkInfo.health <= 0) { @@ -3848,26 +3886,26 @@ void Boss07_Mask_SetupDamaged(Boss07* this, PlayState* play, u8 damage, Actor* a } void Boss07_Mask_Damaged(Boss07* this, PlayState* play) { - this->unk_15C = 20; + this->invincibilityTimer = 20; SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 1) { Boss07_SmoothStop(this, 1.0f); Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 1, 0x1000); - Math_ApproachS(&this->unk_18D4, 0, 1, 0x100); + Math_ApproachS(&this->spinVel, 0, 1, 0x100); } else { this->actor.shape.rot.x += 0x2000; } - this->actor.shape.rot.z += this->unk_18D4; + this->actor.shape.rot.z += this->spinVel; if ((this->timers[0] > 30) || ((this->timers[0] & 2) != 0)) { - this->unk_1884 = 1; + this->maskEyeState = 1; } if ((this->timers[0] == 15) && ((s8)this->actor.colChkInfo.health < 10)) { - this->unk_774 = true; + this->activateRemains = true; } if (this->timers[0] == 0) { Boss07_Mask_SetupIdle(this, play); if ((s8)this->actor.colChkInfo.health <= 0) { - this->unk_148 = true; + this->startDeath = true; Enemy_StartFinishingBlow(play, &this->actor); AudioSfx_StopByPos(&this->actor.projectedPos); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_DEAD_OLD); @@ -3878,17 +3916,17 @@ void Boss07_Mask_Damaged(Boss07* this, PlayState* play) { this->actor.world.rot.x = 0x3000; this->timers[0] = 50; this->timers[2] = 100; - this->unk_18C = 6.0f; - this->unk_170 = 0.0f; + this->flySpeedTarget = 6.0f; + this->vel_170 = 0.0f; } } } void Boss07_Mask_ClearBeam(Boss07* this) { - this->unk_188C = 0.0f; - this->unk_1890 = 0.0f; + this->eyeBeamsZscale = 0.0f; + this->beamFocusOrbScale = 0.0f; this->unk_1894 = 0.0f; - this->unk_1898 = 0.0f; + this->beamXYscale = 0.0f; this->unk_18C0 = 0.0f; } @@ -3896,7 +3934,7 @@ void Boss07_Mask_SetupBeam(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Mask_Beam; this->actionState = MAJORAS_MASK_BEAM_CHARGE; this->timers[0] = 30; - this->unk_170 = 0.0f; + this->vel_170 = 0.0f; } void Boss07_Mask_Beam(Boss07* this, PlayState* play) { @@ -3911,27 +3949,27 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Vec3f sp160; Player* player = GET_PLAYER(play); CollisionPoly* sp158; - Vec3f sp14C; + Vec3f beamMarkPos; u8 sp14B = 0; s32 sp144; - this->unk_15C = 20; + this->invincibilityTimer = 20; Boss07_SmoothStop(this, 0.5f); 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)) { + if ((player->unk_730 != NULL) && (player->stateFlags1 & PLAYER_STATE1_400000)) { phi_f24 = (player->transformation == PLAYER_FORM_HUMAN) ? 20 : 30.0f; } else { 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); + phi_s0 = (player->stateFlags1 & PLAYER_STATE1_400000) ? 1 : 10; + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, phi_s0, this->vel_170); temp_f20 = player->actor.world.pos.x - this->actor.world.pos.x; temp_f12 = player->actor.world.pos.y - this->actor.world.pos.y + phi_f24; temp_f22 = player->actor.world.pos.z - this->actor.world.pos.z; Math_ApproachS(&this->actor.shape.rot.x, -Math_Atan2S(temp_f12, sqrtf(SQ(temp_f20) + SQ(temp_f22))), phi_s0, - this->unk_170); - Math_ApproachF(&this->unk_170, 4000.0f, 1.0f, 200.0f); + this->vel_170); + Math_ApproachF(&this->vel_170, 0xFA0, 1.0f, 0xC8); this->unk_1874 = 1; switch (this->actionState) { case MAJORAS_MASK_BEAM_CHARGE: @@ -3941,11 +3979,11 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { if (this->timers[0] == 0) { this->actionState = MAJORAS_MASK_BEAM_EYES; this->timers[0] = 6; - this->unk_1898 = 1.0f; + this->beamXYscale = 1.0f; } break; case MAJORAS_MASK_BEAM_EYES: - Math_ApproachF(&this->unk_188C, 1.0f, 1.0f, 0.2f); + Math_ApproachF(&this->eyeBeamsZscale, 1.0f, 1.0f, 0.2f); if (this->timers[0] == 0) { this->actionState = MAJORAS_MASK_BEAM_FOCUS; this->timers[0] = 8; @@ -3953,7 +3991,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { break; case MAJORAS_MASK_BEAM_FOCUS: play_sound(NA_SE_EN_LAST1_BEAM_OLD - SFX_FLAG); - Math_ApproachF(&this->unk_1890, 1.0f, 0.2f, 0.2f); + Math_ApproachF(&this->beamFocusOrbScale, 1.0f, 0.2f, 0.2f); if (this->timers[0] == 0) { this->actionState = MAJORAS_MASK_BEAM_ACTIVE; this->timers[0] = 100; @@ -3963,23 +4001,23 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { case MAJORAS_MASK_BEAM_REFLECT: play_sound(NA_SE_EN_LAST1_BEAM_OLD - SFX_FLAG); case MAJORAS_MASK_BEAM_END: - Math_ApproachF(&this->unk_1890, 1.0f, 0.2f, 0.2f); + Math_ApproachF(&this->beamFocusOrbScale, 1.0f, 0.2f, 0.2f); temp_f20 = player->actor.world.pos.x - this->unk_189C.x; temp_f12 = player->actor.world.pos.y - this->unk_189C.y + 20.0f; temp_f22 = player->actor.world.pos.z - this->unk_189C.z; sp180 = sqrtf(SQ(temp_f20) + SQ(temp_f12) + SQ(temp_f22)); Math_ApproachF(&this->unk_1894, sp180 * 0.2f, 1.0f, 7.0f); - if (BgCheck_EntityLineTest1(&play->colCtx, &this->unk_189C, &this->unk_18A8, &sp14C, &sp158, 1, 1, 1, + if (BgCheck_EntityLineTest1(&play->colCtx, &this->unk_189C, &this->unk_18A8, &beamMarkPos, &sp158, 1, 1, 1, 1, &sp144) && (this->actionState != MAJORAS_MASK_BEAM_END)) { Vec3f sp138; Vec3f sp12C; Vec3f sp120; - sp138.x = randPlusMinusPoint5Scaled(20.0f) + sp14C.x; - sp138.y = randPlusMinusPoint5Scaled(20.0f) + sp14C.y; - sp138.z = randPlusMinusPoint5Scaled(20.0f) + sp14C.z; + sp138.x = randPlusMinusPoint5Scaled(20.0f) + beamMarkPos.x; + sp138.y = randPlusMinusPoint5Scaled(20.0f) + beamMarkPos.y; + sp138.z = randPlusMinusPoint5Scaled(20.0f) + beamMarkPos.z; sp12C.x = 0.0f; sp12C.y = 6.0f; sp12C.z = 0.0f; @@ -3998,7 +4036,8 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { if ((fabsf(sp160.x) < 20.0f) && (fabsf(sp160.y) < 50.0f) && (sp160.z > 40.0f) && (sp160.z <= (this->unk_1894 * 20))) { if (Player_HasMirrorShieldEquipped(play) && (player->transformation == PLAYER_FORM_HUMAN) && - (player->stateFlags1 & 0x400000) && (FACING_ANGLE(&player->actor, &this->actor) < 0x2000) && + (player->stateFlags1 & PLAYER_STATE1_400000) && + (FACING_ANGLE(&player->actor, &this->actor) < 0x2000) && (FACING_ANGLE(&player->actor, &this->actor) > -0x2000)) { Vec3s sp118; @@ -4009,34 +4048,35 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { sp118.x = -sp118.x; if (this->actionState == MAJORAS_MASK_BEAM_ACTIVE) { this->actionState = MAJORAS_MASK_BEAM_REFLECT; - this->unk_18C4 = sp118.x; - this->unk_18C6 = sp118.y; + this->beamTargetPitch = sp118.x; + this->beamTargetYaw = sp118.y; } else { player->unk_B84 = this->actor.yawTowardsPlayer; - player->unk_B80 = this->unk_1898 * 0.5f; - sMajoraStatic->unk_1808 = 1; - sMajoraStatic->unk_180C = this->unk_1898 * 30.0f; - sMajoraStatic->unk_1810 = this->unk_18A8; - Math_ApproachS(&this->unk_18C4, sp118.x, 2, 0x2000); - Math_ApproachS(&this->unk_18C6, sp118.y, 2, 0x2000); + player->unk_B80 = this->beamXYscale * 0.5f; + sMajoraStatic->lensFlareOn = true; + sMajoraStatic->lensFlareScale = this->beamXYscale * 30.0f; + sMajoraStatic->lensFlarePos = this->unk_18A8; + Math_ApproachS(&this->beamTargetPitch, sp118.x, 2, 0x2000); + Math_ApproachS(&this->beamTargetYaw, sp118.y, 2, 0x2000); sp16C.x = this->actor.world.pos.x - this->unk_18A8.x; 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_RotateXS(-this->unk_18C4, MTXMODE_NEW); - Matrix_RotateYS(-this->unk_18C6, MTXMODE_APPLY); + Matrix_RotateXS(-this->beamTargetPitch, MTXMODE_NEW); + Matrix_RotateYS(-this->beamTargetYaw, MTXMODE_APPLY); Matrix_Push(); Matrix_MultVec3f(&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->actionState != MAJORAS_MASK_BEAM_END)) { + (sp160.z <= (this->unk_18C0 * 16.666668f)) && + (this->actionState != MAJORAS_MASK_BEAM_END)) { s32 phi_s0_2; Vec3f sp108; Vec3f spFC; Vec3f spF0; - this->unk_18D8 += 2; + this->beamDmgTimer += 2; this->unk_18C0 = sp180 * 0.062f; - if (this->unk_18D8 < 10) { + if (this->beamDmgTimer < 10) { sp108.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(40.0f); sp108.y = this->actor.world.pos.y + randPlusMinusPoint5Scaled(40.0f); sp108.z = this->actor.world.pos.z + randPlusMinusPoint5Scaled(40.0f); @@ -4047,10 +4087,10 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { spF0.y = spFC.y * -0.05f; spF0.z = spFC.z * -0.05f; Boss07_SpawnEffect(play, &sp108, &spFC, &spF0, Rand_ZeroFloat(10.0f) + 25.0f); - this->unk_15E |= 0xA; + this->dmgFogEffectTimer |= 0xA; } else { - this->unk_15C = 50; - this->unk_15E = 15; + this->invincibilityTimer = 50; + this->dmgFogEffectTimer = 15; AudioSfx_StopByPos(&this->actor.projectedPos); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_DAMAGE2_OLD); Boss07_Mask_SetupDamaged(this, play, 2, NULL); @@ -4068,9 +4108,9 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Boss07_SpawnEffect(play, &sp108, &spFC, &spF0, Rand_ZeroFloat(10.0f) + 25.0f); } if ((s8)this->actor.colChkInfo.health <= 0) { - this->unk_18D6 = 200; + this->timer_18D6 = 200; } else { - this->unk_18D6 = 60; + this->timer_18D6 = 60; } } } @@ -4085,15 +4125,16 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { sp180 = sqrtf(SQXYZ(sp16C)); Matrix_MultVec3f(&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->actionState != MAJORAS_MASK_BEAM_END)) { + (sp160.z <= (this->unk_18C0 * 16.666668f)) && + (this->actionState != MAJORAS_MASK_BEAM_END)) { s32 pad; Vec3f spE0; Vec3f spD4; Vec3f spC8; - this->unk_18D8 += 2; + this->beamDmgTimer += 2; this->unk_18C0 = sp180 * 0.062f; - if (this->unk_18D8 < 5) { + if (this->beamDmgTimer < 5) { spE0.x = sBossRemains[sp178]->actor.world.pos.x + randPlusMinusPoint5Scaled(40.0f); spE0.y = sBossRemains[sp178]->actor.world.pos.y + randPlusMinusPoint5Scaled(40.0f); spE0.z = sBossRemains[sp178]->actor.world.pos.z + randPlusMinusPoint5Scaled(40.0f); @@ -4105,10 +4146,10 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { spC8.z = spD4.z * -0.05f; Boss07_SpawnEffect(play, &spE0, &spD4, &spC8, Rand_ZeroFloat(10.0f) + 25.0f); - sBossRemains[sp178]->unk_15E |= 0xA; + sBossRemains[sp178]->dmgFogEffectTimer |= 0xA; } else { sBossRemains[sp178]->actionState = MAJORAS_REMAINS_DEATH; - sBossRemains[sp178]->unk_18D6 = 60; + sBossRemains[sp178]->timer_18D6 = 60; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FOLLOWERS_DEAD); for (pad = 0; pad < 20; pad++) { spE0.x = @@ -4123,13 +4164,12 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { spC8.x = spD4.x * -0.05f; spC8.y = spD4.y * -0.05f; spC8.z = spD4.z * -0.05f; - Boss07_SpawnEffect(play, &spE0, &spD4, &spC8, - Rand_ZeroFloat(10.0f) + 25.0f); + Boss07_SpawnEffect(play, &spE0, &spD4, &spC8, Rand_ZeroFloat(10.0f) + 25.0f); } } } } - if (BgCheck_EntityLineTest1(&play->colCtx, &this->unk_18A8, &this->unk_18B4, &sp14C, + if (BgCheck_EntityLineTest1(&play->colCtx, &this->unk_18A8, &this->unk_18B4, &beamMarkPos, &sp158, 1, 1, 1, 1, &sp144) && (this->actionState != MAJORAS_MASK_BEAM_END)) { Vec3f spBC; @@ -4137,9 +4177,9 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { Vec3f spA4; sp14B = true; - spBC.x = randPlusMinusPoint5Scaled(20.0f) + sp14C.x; - spBC.y = randPlusMinusPoint5Scaled(20.0f) + sp14C.y; - spBC.z = randPlusMinusPoint5Scaled(20.0f) + sp14C.z; + spBC.x = randPlusMinusPoint5Scaled(20.0f) + beamMarkPos.x; + spBC.y = randPlusMinusPoint5Scaled(20.0f) + beamMarkPos.y; + spBC.z = randPlusMinusPoint5Scaled(20.0f) + beamMarkPos.z; spB0.x = 0.0f; spB0.y = 6.0f; spB0.z = 0.0f; @@ -4162,14 +4202,14 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { } } if (sp14B) { - if (sp14C.y == 0.0f) { - temp_f20 = this->unk_18E0.x - sp14C.x; - temp_f22 = this->unk_18E0.z - sp14C.z; - func_800AE930(&play->colCtx, Effect_GetByIndex(this->effectIndex), &sp14C, 15.0f, + if (beamMarkPos.y == 0.0f) { + temp_f20 = this->beamMarkLastPos.x - beamMarkPos.x; + temp_f22 = this->beamMarkLastPos.z - beamMarkPos.z; + func_800AE930(&play->colCtx, Effect_GetByIndex(this->effectIndex), &beamMarkPos, 15.0f, Math_Atan2S(temp_f20, temp_f22), sp158, sp144); - this->unk_18EC = 1; + this->beamOn = true; } - this->unk_18E0 = sp14C; + this->beamMarkLastPos = beamMarkPos; } if (this->actionState != MAJORAS_MASK_BEAM_END) { if (this->timers[0] == 0) { @@ -4177,7 +4217,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { this->timers[0] = 20; } } else { - Math_ApproachZeroF(&this->unk_1898, 1.0f, 0.05f); + Math_ApproachZeroF(&this->beamXYscale, 1.0f, 0.05f); if (this->timers[0] == 0) { Boss07_Mask_SetupIdle(this, play); this->timers[2] = 100; @@ -4193,8 +4233,8 @@ void Boss07_Mask_SetupIntro(Boss07* this, PlayState* play) { this->actor.world.pos.x = 0.0f; this->actor.world.pos.y = 300.0f; this->actor.world.pos.z = -922.5f; - this->unk_160 = KREG(75) + 150; - func_8016566C(this->unk_160); + this->motionBlurAlpha = KREG(75) + 150; + func_8016566C(this->motionBlurAlpha); } static Vec3s sIntroCamEyes[4] = { @@ -4214,9 +4254,9 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { f32 sp8C = 0.0f; Player* player = GET_PLAYER(play); - this->unk_ABC8++; - SREG(90) = this->unk_160; - this->unk_1884 = 1; + this->timer_ABC8++; + SREG(90) = this->motionBlurAlpha; + this->maskEyeState = 1; switch (this->csState) { case MAJORAS_MASK_INTRO_STATE_0: this->actor.world.pos.x = 0.0f; @@ -4230,15 +4270,15 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { this->subCamIndex = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, this->subCamIndex, CAM_STATUS_ACTIVE); - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->csState = MAJORAS_MASK_INTRO_STATE_1; - this->unk_160 = KREG(76) + 150; + this->motionBlurAlpha = KREG(76) + 150; case MAJORAS_MASK_INTRO_STATE_1: - if (this->unk_ABC8 >= 20) { + if (this->timer_ABC8 >= 20) { func_8019F128(NA_SE_EV_LIGHT_GATHER - SFX_FLAG); - Math_ApproachF(&sMajoraStatic->unk_AB44, sREG(50) + 1.0f, 0.05f, sREG(51) + 0.05f); + Math_ApproachF(&sMajoraStatic->introOrbScale, sREG(50) + 1.0f, 0.05f, sREG(51) + 0.05f); } - if (this->unk_ABC8 == 35) { + if (this->timer_ABC8 == 35) { func_800B7298(play, &this->actor, 0xF); } player->actor.world.pos.x = 0.0f; @@ -4254,8 +4294,8 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { if (player->transformation == PLAYER_FORM_FIERCE_DEITY) { this->subCamAt.y -= 30.0f; } - if (this->unk_ABC8 == 75) { - this->unk_ABC8 = 0; + if (this->timer_ABC8 == 75) { + this->timer_ABC8 = 0; this->csState = MAJORAS_MASK_INTRO_STATE_2; this->subCamEye.x = player->actor.world.pos.x; this->subCamEye.y = player->actor.world.pos.y + 20.0f; @@ -4264,52 +4304,53 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { this->subCamAt.y = player->actor.world.pos.y + 24.0f + 5.0f; this->subCamAt.z = player->actor.world.pos.z; } - + break; case MAJORAS_MASK_INTRO_STATE_2: - this->unk_160 = KREG(77) + 150; - if (this->unk_ABC8 >= 20) { - Math_ApproachZeroF(&sMajoraStatic->unk_AB44, 1.0f, 0.05f); + this->motionBlurAlpha = KREG(77) + 150; + if (this->timer_ABC8 >= 20) { + Math_ApproachZeroF(&sMajoraStatic->introOrbScale, 1.0f, 0.05f); } - if (this->unk_ABC8 == 20) { + if (this->timer_ABC8 == 20) { sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_CS_FLY; sBossRemains[REMAINS_GYORG]->actionState = MAJORAS_REMAINS_CS_FLY; sBossRemains[REMAINS_GOHT]->actionState = MAJORAS_REMAINS_CS_FLY; sBossRemains[REMAINS_TWINMOLD]->actionState = MAJORAS_REMAINS_CS_FLY; } - if (this->unk_ABC8 == 0) { + if (this->timer_ABC8 == 0) { func_800B7298(play, &this->actor, 7); } - if (this->unk_ABC8 == 120) { + if (this->timer_ABC8 == 120) { func_800B7298(play, &this->actor, 0x15); } - if (this->unk_ABC8 > 30) { - Math_ApproachF(&this->subCamAt.y, player->actor.world.pos.y + 24.0f + 20.0f, 0.05f, this->subCamSpeedMod); + if (this->timer_ABC8 > 30) { + Math_ApproachF(&this->subCamAt.y, player->actor.world.pos.y + 24.0f + 20.0f, 0.05f, + this->subCamSpeedMod); Math_ApproachF(&this->subCamSpeedMod, 1.0f, 1.0f, 0.01f); } - if (this->unk_ABC8 >= 160) { - if (this->unk_ABC8 == 160) { + if (this->timer_ABC8 >= 160) { + if (this->timer_ABC8 == 160) { sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_CS_ATTACH_WAIT; sBossRemains[REMAINS_GYORG]->actionState = MAJORAS_REMAINS_CS_ATTACH_WAIT; sBossRemains[REMAINS_GOHT]->actionState = MAJORAS_REMAINS_CS_ATTACH_WAIT; sBossRemains[REMAINS_TWINMOLD]->actionState = MAJORAS_REMAINS_CS_ATTACH_WAIT; } - if (this->unk_ABC8 == 161) { + if (this->timer_ABC8 == 161) { sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_CS_ATTACH; } - if ((this->unk_ABC8 == 180) || (this->unk_ABC8 == 200) || (this->unk_ABC8 == 220)) { - this->unk_ABCC++; - sBossRemains[this->unk_ABCC]->actionState = MAJORAS_REMAINS_CS_ATTACH; + if ((this->timer_ABC8 == 180) || (this->timer_ABC8 == 200) || (this->timer_ABC8 == 220)) { + this->timer_ABCC++; + sBossRemains[this->timer_ABCC]->actionState = MAJORAS_REMAINS_CS_ATTACH; } - this->subCamEye.x = sIntroCamEyes[this->unk_ABCC].x; - this->subCamEye.y = sIntroCamEyes[this->unk_ABCC].y; - this->subCamEye.z = sIntroCamEyes[this->unk_ABCC].z; - this->subCamAt.x = sIntroCamAts[this->unk_ABCC].x; - this->subCamAt.y = sIntroCamAts[this->unk_ABCC].y; - this->subCamAt.z = sIntroCamAts[this->unk_ABCC].z; - if (this->unk_ABC8 == 250) { + this->subCamEye.x = sIntroCamEyes[this->timer_ABCC].x; + this->subCamEye.y = sIntroCamEyes[this->timer_ABCC].y; + this->subCamEye.z = sIntroCamEyes[this->timer_ABCC].z; + this->subCamAt.x = sIntroCamAts[this->timer_ABCC].x; + this->subCamAt.y = sIntroCamAts[this->timer_ABCC].y; + this->subCamAt.z = sIntroCamAts[this->timer_ABCC].z; + if (this->timer_ABC8 == 250) { this->csState = MAJORAS_MASK_INTRO_STATE_3; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->subCamEye.x = this->actor.world.pos.x; this->subCamEye.y = this->actor.world.pos.y; this->subCamEye.z = 300.0f; @@ -4321,33 +4362,33 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { Boss07_Remains_SetupFly(sBossRemains[REMAINS_GOHT], play); Boss07_Remains_SetupFly(sBossRemains[REMAINS_TWINMOLD], play); this->subCamSpeedMod = 0.0f; - sMajoraStatic->unk_AB44 = 0.0f; + sMajoraStatic->introOrbScale = 0.0f; Audio_QueueSeqCmd(NA_BGM_STOP | 0xA0000); } } break; case MAJORAS_MASK_INTRO_STATE_3: - this->unk_160 = KREG(78) + 150; - if (this->unk_ABC8 >= 15) { + this->motionBlurAlpha = KREG(78) + 150; + if (this->timer_ABC8 >= 15) { Math_ApproachF(&this->subCamEye.z, -700.0f, 0.4f, 100.0f); } - if (this->unk_ABC8 >= 55) { - if (this->unk_ABC8 == 55) { + if (this->timer_ABC8 >= 55) { + if (this->timer_ABC8 == 55) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_PAMET_BREAK); } - this->unk_1884 = 0; + this->maskEyeState = 0; } - if (this->unk_ABC8 >= 75) { + if (this->timer_ABC8 >= 75) { s32 i; Vec3f sp78 = { 0.0f, 0.0f, 0.0f }; Vec3f sp6C = { 0.0f, -0.5f, 0.0f }; Vec3f sp60; - if (this->unk_ABC8 == 75) { + if (this->timer_ABC8 == 75) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_DEMO_WALL); } - sp8C = 2.0f * (this->unk_ABC8 % 2); - if ((this->unk_ABC8 % 2) != 0) { + sp8C = 2.0f * (this->timer_ABC8 % 2); + if ((this->timer_ABC8 % 2) != 0) { this->actor.world.pos.x += 2.0f; } else { this->actor.world.pos.x -= 2.0f; @@ -4356,41 +4397,40 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { sp60.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(110.0f); sp60.y = this->actor.world.pos.y + randPlusMinusPoint5Scaled(110.0f); sp60.z = this->actor.world.pos.z + 10.0f; - EffectSsHahen_Spawn(play, &sp60, &sp78, &sp6C, 0, (Rand_ZeroOne() * 5.0f) + 10.0f, -1, 10, - NULL); + EffectSsHahen_Spawn(play, &sp60, &sp78, &sp6C, 0, (Rand_ZeroOne() * 5.0f) + 10.0f, -1, 10, NULL); } } - if (this->unk_ABC8 == 110) { + if (this->timer_ABC8 == 110) { this->csState = MAJORAS_MASK_INTRO_STATE_4; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->subCamEye.x = this->actor.world.pos.x + 200.0f; this->subCamEye.y = this->actor.world.pos.y; this->subCamEye.z = this->actor.world.pos.z + 400.0f; player->actor.world.pos.z = 0.0f; func_800B7298(play, &this->actor, 1); - this->unk_160 = KREG(74) + 200; + this->motionBlurAlpha = KREG(74) + 200; } break; case MAJORAS_MASK_INTRO_STATE_4: - this->unk_1884 = 0; - if (this->unk_ABC8 >= 10) { - Math_ApproachS(&this->unk_160, KREG(72), 1, KREG(73) + 2); - if (this->unk_ABC8 == 10) { + this->maskEyeState = 0; + if (this->timer_ABC8 >= 10) { + Math_ApproachS(&this->motionBlurAlpha, KREG(72), 1, KREG(73) + 2); + if (this->timer_ABC8 == 10) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_DEMO_BREAK); } SkelAnime_Update(&this->skelAnime); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_FLOAT_OLD - SFX_FLAG); - Math_ApproachF(&this->unk_1870, 1.0f, 1.0f, 0.02f); + Math_ApproachF(&this->tentLengthScale, 1.0f, 1.0f, 0.02f); Math_ApproachF(&this->actor.world.pos.z, -642.5f, 0.05f, 30.0f); Math_ApproachF(&this->actor.world.pos.y, 350.0f, 0.03f, 2.0f); - if (this->unk_ABC8 == 55) { + if (this->timer_ABC8 == 55) { TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtxt, Lib_SegmentedToVirtual(&gMajorasMaskTitleCardTex), 0xA0, 0xB4, 0x80, 0x28); } - if (this->unk_ABC8 == 30) { + if (this->timer_ABC8 == 30) { Audio_QueueSeqCmd(NA_BGM_MAJORAS_MASK | 0x8000); } - if (this->unk_ABC8 > 100) { + if (this->timer_ABC8 > 100) { Math_ApproachF(&this->subCamEye.x, player->actor.world.pos.x + 40.0f, 0.1f, this->subCamSpeedMod * 20.0f); Math_ApproachF(&this->subCamEye.y, player->actor.world.pos.y + 10.0f, 0.1f, @@ -4399,18 +4439,18 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { this->subCamSpeedMod * 60.0f); Math_ApproachF(&this->subCamSpeedMod, 1.0f, 1.0f, 0.03f); } - if (this->unk_ABC8 == 175) { + if (this->timer_ABC8 == 175) { Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); this->csState = MAJORAS_MASK_INTRO_STATE_0; Boss07_Mask_SetupIdle(this, play); this->timers[0] = 50; this->timers[2] = 200; - this->unk_1888 = 50; + this->noclipTimer = 50; this->moveTarget.x = 0.0f; this->moveTarget.y = 200.0f; this->moveTarget.z = 0.0f; - this->unk_170 = 0.0f; + this->vel_170 = 0.0f; mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; mainCam->at = this->subCamAt; @@ -4422,7 +4462,7 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { gSaveContext.eventInf[6] |= 2; func_80165690(); } - } else if ((this->unk_ABC8 % 2) != 0) { + } else if ((this->timer_ABC8 % 2) != 0) { this->actor.world.pos.x += 2.0f; } else { this->actor.world.pos.x -= 2.0f; @@ -4432,7 +4472,7 @@ void Boss07_Mask_Intro(Boss07* this, PlayState* play) { Math_ApproachF(&this->subCamAt.z, this->actor.world.pos.z, 0.05f, 10.0f); break; } - if (this->subCamIndex != 0) { + if (this->subCamIndex != SUB_CAM_ID_DONE) { Vec3f sp50; ShrinkWindow_SetLetterboxTarget(0x1B); @@ -4449,9 +4489,9 @@ void Boss07_Mask_SetupDeath(Boss07* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y = Math_Acot2F(-this->actor.world.pos.z, -this->actor.world.pos.x) * (0x8000 / M_PI); this->csState = MAJORAS_MASK_DEATH_STATE_0; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->actor.flags &= ~ACTOR_FLAG_1; - this->unk_15C = 20; + this->invincibilityTimer = 20; } void Boss07_Mask_Death(Boss07* this, PlayState* play) { @@ -4459,9 +4499,9 @@ void Boss07_Mask_Death(Boss07* this, PlayState* play) { Vec3f sp60; Vec3f sp54; - this->unk_ABC8++; - this->unk_15C = 20; - this->unk_1884 = 1; + this->timer_ABC8++; + this->invincibilityTimer = 20; + this->maskEyeState = 1; SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 0.5f); Math_ApproachF(&this->actor.world.pos.x, 0.0f, 0.05f, 5.0f); @@ -4477,10 +4517,10 @@ void Boss07_Mask_Death(Boss07* this, PlayState* play) { this->subCamIndex = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, this->subCamIndex, CAM_STATUS_ACTIVE); - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->csState = MAJORAS_MASK_DEATH_STATE_1; this->subCamNextAt.z = 0.0f; - this->unk_18D6 = 120; + this->timer_18D6 = 120; func_8016566C(150); this->subCamNextEye.x = 0.0f; this->subCamNextEye.y = -30.0f; @@ -4498,16 +4538,16 @@ void Boss07_Mask_Death(Boss07* this, PlayState* play) { player->actor.world.rot.y = player->actor.shape.rot.y = -0x8000; this->unk_1874 = 2; - if (this->unk_ABC8 > 60) { + if (this->timer_ABC8 > 60) { Math_ApproachS(&this->actor.shape.rot.x, 0, 0xA, 0x200); Math_ApproachS(&this->actor.shape.rot.z, 0, 0xA, 0x200); - Math_ApproachZeroF(&this->unk_1870, 1.0f, 0.01f); + Math_ApproachZeroF(&this->tentLengthScale, 1.0f, 0.01f); } else { this->actor.shape.rot.x += 0x1000; this->actor.shape.rot.z += 0x1200; - Math_ApproachZeroF(&this->unk_1870, 1.0f, 0.005f); + Math_ApproachZeroF(&this->tentLengthScale, 1.0f, 0.005f); } - if (this->unk_ABC8 > 130) { + if (this->timer_ABC8 > 130) { this->csState = MAJORAS_MASK_DEATH_STATE_2; } else { break; @@ -4524,12 +4564,11 @@ void Boss07_Mask_Death(Boss07* this, PlayState* play) { Math_ApproachF(&this->subCamAt.x, sp60.x, 0.1f, 10.0f); Math_ApproachF(&this->subCamAt.y, sp60.y, 0.1f, 10.0f); Math_ApproachF(&this->subCamAt.z, sp60.z, 0.1f, 10.0f); - if (this->subCamIndex != 0) { + if (this->subCamIndex != SUB_CAM_ID_DONE) { ShrinkWindow_SetLetterboxTarget(0x1B); sp54 = this->subCamEye; - if (sp54.y < 30.0f) { - sp54.y = 30.0f; - } + if (sp54.y < 30.0f) sp54.y = 30.0f; + Play_SetCameraAtEye(play, this->subCamIndex, &this->subCamAt, &sp54); } } @@ -4540,25 +4579,25 @@ void Boss07_Mask_CollisionCheck(Boss07* this, PlayState* play) { u8 damage; Actor* hitActor; - if (this->unk_15C == 0) { - if (this->quad1.base.acFlags & AC_HIT) { - this->quad1.base.acFlags &= ~AC_HIT; - this->unk_186C = 7; + if (this->invincibilityTimer == 0) { + if (this->maskFrontCollider.base.acFlags & AC_HIT) { + this->maskFrontCollider.base.acFlags &= ~AC_HIT; + this->dmgShakeTimer = 7; } - if (this->quad2.base.acFlags & AC_HIT) { - this->quad2.base.acFlags &= ~AC_HIT; - this->unk_186C = 15; - if ((this->actionFunc == Boss07_Mask_Stunned) || (player->stateFlags3 & 0x200)) { - hitActor = this->quad2.base.ac; - hitbox = this->quad2.info.acHitInfo; + if (this->maskBackCollider.base.acFlags & AC_HIT) { + this->maskBackCollider.base.acFlags &= ~AC_HIT; + this->dmgShakeTimer = 15; + if ((this->actionFunc == Boss07_Mask_Stunned) || (player->stateFlags3 & PLAYER_STATE3_200)) { + hitActor = this->maskBackCollider.base.ac; + hitbox = this->maskBackCollider.info.acHitInfo; damage = (hitbox->toucher.dmgFlags & 0xF7CFFFFF) ? this->actor.colChkInfo.damage : 0; - this->unk_15C = 50; - this->unk_15E = 15; + this->invincibilityTimer = 50; + this->dmgFogEffectTimer = 15; AudioSfx_StopByPos(&this->actor.projectedPos); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_DAMAGE2_OLD); Boss07_Mask_SetupDamaged(this, play, damage, hitActor); } else { - this->unk_15C = 15; + this->invincibilityTimer = 15; AudioSfx_StopByPos(&this->actor.projectedPos); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_DAMAGE1_OLD); Boss07_Mask_SetupStunned(this, play); @@ -4587,33 +4626,33 @@ void Boss07_Mask_Update(Actor* thisx, PlayState* play2) { } } Math_Vec3f_Copy(&sSfxPoint, &this->actor.projectedPos); - if ((sMajoraStatic == NULL) || (sMajoraStatic->subCamIndex == 0)) { - this->unk_149 = true; + if ((sMajoraStatic == NULL) || (sMajoraStatic->subCamIndex == SUB_CAM_ID_DONE)) { + this->updateWhips = true; play->envCtx.unk_C1 = 2; play->envCtx.unk_C2 = 0; - Math_ApproachF(&play->envCtx.lightBlend, this->unk_1898, 1.0f, 0.1f); + Math_ApproachF(&play->envCtx.lightBlend, this->beamXYscale, 1.0f, 0.1f); this->actionTimer++; if (KREG(63) == 0) { - this->unk_174 = false; - this->unk_1884 = 0; + this->canDodge = false; + this->maskEyeState = 0; this->unk_1874 = 0; Actor_SetScale(&this->actor, 0.1f); this->actor.focus.pos = this->actor.world.pos; for (i = 0; i < 3; i++) { DECR(this->timers[i]); } - DECR(this->unk_186C); - DECR(this->unk_15C); - DECR(this->unk_15E); - DECR(this->unk_18D6); - DECR(this->unk_18D8); + DECR(this->dmgShakeTimer); + DECR(this->invincibilityTimer); + DECR(this->dmgFogEffectTimer); + DECR(this->timer_18D6); + DECR(this->beamDmgTimer); - this->unk_18EC = 0; + this->beamOn = false; this->actionFunc(this, play); - if ((this->unk_18EC == 0) && (this->unk_18ED != 0)) { + if (!this->beamOn && this->beamOnLastFrame) { func_800AEF44(Effect_GetByIndex(this->effectIndex)); } - this->unk_18ED = this->unk_18EC; + this->beamOnLastFrame = this->beamOn; if (this->actionFunc != Boss07_Mask_Intro) { if (this->actionFunc != Boss07_Mask_Damaged) { Actor_UpdateVelocityWithoutGravity(&this->actor); @@ -4624,10 +4663,10 @@ void Boss07_Mask_Update(Actor* thisx, PlayState* play2) { } Actor_MoveWithGravity(&this->actor); } - if (this->unk_1888 == 0) { + if (this->noclipTimer == 0) { Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 60.0f, 100.0f, 5); } else { - this->unk_1888--; + this->noclipTimer--; } } } else { @@ -4651,9 +4690,9 @@ void Boss07_Mask_Update(Actor* thisx, PlayState* play2) { sp6C.x = 55.0f; sp6C.y = -55.0f; Matrix_MultVec3f(&sp6C, &sp78); - Collider_SetQuadVertices(&this->quad1, &sp9C, &sp90, &sp84, &sp78); + Collider_SetQuadVertices(&this->maskFrontCollider, &sp9C, &sp90, &sp84, &sp78); - sp68 = (player->stateFlags3 & 0x200) ? 70.0f : 40.0f; + sp68 = (player->stateFlags3 & PLAYER_STATE3_200) ? 70.0f : 40.0f; sp6C.x = -sp68; sp6C.y = sp68; sp6C.z = -10.0f; @@ -4667,21 +4706,21 @@ void Boss07_Mask_Update(Actor* thisx, PlayState* play2) { sp6C.x = sp68; sp6C.y = -sp68; Matrix_MultVec3f(&sp6C, &sp78); - Collider_SetQuadVertices(&this->quad2, &sp9C, &sp90, &sp84, &sp78); + Collider_SetQuadVertices(&this->maskBackCollider, &sp9C, &sp90, &sp84, &sp78); - if (player->stateFlags3 & 0x200) { - CollisionCheck_SetAC(play, &play->colChkCtx, &this->quad2.base); + if (player->stateFlags3 & PLAYER_STATE3_200) { + CollisionCheck_SetAC(play, &play->colChkCtx, &this->maskBackCollider.base); } else { if ((this->actionFunc != Boss07_Mask_Stunned) && (this->actionFunc != Boss07_Mask_Damaged)) { - CollisionCheck_SetAC(play, &play->colChkCtx, &this->quad1.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->maskFrontCollider.base); } - CollisionCheck_SetAC(play, &play->colChkCtx, &this->quad2.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->maskBackCollider.base); if (this->actionFunc == Boss07_Mask_Spin) { - CollisionCheck_SetAT(play, &play->colChkCtx, &this->quad1.base); - CollisionCheck_SetAT(play, &play->colChkCtx, &this->quad2.base); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->maskFrontCollider.base); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->maskBackCollider.base); } } - if (this->unk_18D6 != 0) { + if (this->timer_18D6 != 0) { Vec3f sp5C; Vec3f sp50; Vec3f sp44; @@ -4702,8 +4741,8 @@ void Boss07_Mask_Update(Actor* thisx, PlayState* play2) { } } -void Boss07_Mask_UpdateTentacles(Boss07* this, PlayState* play, Vec3f* base, Vec3f* pos, Vec3f* rot, - Vec3f* pull, Vec3f* arg6, f32 arg7, u8 arg8, f32 arg9) { +void Boss07_Mask_UpdateTentacles(Boss07* this, PlayState* play, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* vel, + Vec3f* arg6, f32 arg7, u8 arg8, f32 arg9) { f32 temp_f20; f32 temp_f22; f32 temp_f24; @@ -4716,7 +4755,7 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, PlayState* play, Vec3f* base, Vec Vec3f sp98 = { 0.0f, 0.0f, 0.0f }; Vec3f sp8C; Vec3f sp80; - Vec3f* sp7C = pull; + Vec3f* sp7C = vel; if (this->unk_1874 != 0) { for (i = 0; i < MAJORAS_TENT_LENGTH; i++) { @@ -4732,22 +4771,22 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, PlayState* play, Vec3f* base, Vec Matrix_Pop(); } } - for (i = 0; i < MAJORAS_TENT_LENGTH; i++, pull++) { + for (i = 0; i < MAJORAS_TENT_LENGTH; i++, vel++) { if (i == 0) { pos[0] = *base; } else { - Math_ApproachF(&pull->x, 0.0f, 1.0f, 1.0f); - Math_ApproachF(&pull->y, 0.0f, 1.0f, 1.0f); - Math_ApproachF(&pull->z, 0.0f, 1.0f, 1.0f); + Math_ApproachF(&vel->x, 0.0f, 1.0f, 1.0f); + Math_ApproachF(&vel->y, 0.0f, 1.0f, 1.0f); + Math_ApproachF(&vel->z, 0.0f, 1.0f, 1.0f); } } pos++; rot++; - pull = sp7C + 1; + vel = sp7C + 1; sp98.x = sp98.y = 0.0f; sp98.z = arg7 * 23.0f; - for (i = 1; i < MAJORAS_TENT_LENGTH; i++, pull++, pos++, rot++) { + for (i = 1; i < MAJORAS_TENT_LENGTH; i++, vel++, pos++, rot++) { if (i < MAJORAS_TENT_LENGTH / 2) { sp80.x = arg6->x * (MAJORAS_TENT_LENGTH / 2 - i) * 0.2f; sp80.y = arg6->y * (MAJORAS_TENT_LENGTH / 2 - i) * 0.2f; @@ -4755,20 +4794,19 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, PlayState* play, Vec3f* base, Vec } else { sp80 = gZeroVec3f; } - temp_f24 = pos->x + pull->x - (pos - 1)->x + sp80.x; + temp_f24 = pos->x + vel->x - (pos - 1)->x + sp80.x; if (this->unk_1874 != 0) { phi_f0 = 0.0f; - } else if ((arg8 != 0) && ((this->actor.world.pos.y - 30.0f) < (pos - 1)->y)) { + } else if (arg8 && ((this->actor.world.pos.y - 30.0f) < (pos - 1)->y)) { phi_f0 = -30.0f; } else { phi_f0 = -3.0f - ((s32)(i % 8U) * 0.05f); } - phi_f2 = pos->y + pull->y + phi_f0 + sp80.y; - if (phi_f2 < 2.0f) { - phi_f2 = 2.0f; - } + phi_f2 = pos->y + vel->y + phi_f0 + sp80.y; + if (phi_f2 < 2.0f) phi_f2 = 2.0f; + temp_f22 = phi_f2 - (pos - 1)->y; - temp_f20 = pos->z + pull->z - (pos - 1)->z + sp80.x; + temp_f20 = pos->z + vel->z - (pos - 1)->z + sp80.x; temp_f26 = Math_Acot2F(temp_f20, temp_f24); temp2 = sqrtf(SQ(temp_f24) + SQ(temp_f20)); temp1 = -Math_Acot2F(temp2, temp_f22); @@ -4783,9 +4821,9 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, PlayState* play, Vec3f* base, Vec pos->x = (pos - 1)->x + sp8C.x; pos->y = (pos - 1)->y + sp8C.y; pos->z = (pos - 1)->z + sp8C.z; - pull->x = (pos->x - temp_f24) * 0.85f; - pull->y = (pos->y - temp_f22) * 0.85f; - pull->z = (pos->z - temp_f20) * 0.85f; + vel->x = (pos->x - temp_f24) * 0.85f; + vel->y = (pos->y - temp_f22) * 0.85f; + vel->z = (pos->z - temp_f20) * 0.85f; } } @@ -4831,14 +4869,14 @@ void Boss07_Mask_DrawBeam(Boss07* this, PlayState* play) { Matrix_Translate(250.0f, 0.0f, 200.0f, MTXMODE_APPLY); Matrix_RotateYS(-0xA00, MTXMODE_APPLY); - Matrix_Scale(this->unk_1898 * 0.05f, this->unk_1898 * 0.05f, this->unk_188C * 0.05f, MTXMODE_APPLY); + Matrix_Scale(this->beamXYscale * 0.05f, this->beamXYscale * 0.05f, this->eyeBeamsZscale * 0.05f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gMajorasMaskBeamDL); Matrix_Pop(); Matrix_Translate(-250.0f, 0.0f, 200.0f, MTXMODE_APPLY); Matrix_RotateYS(0xA00, MTXMODE_APPLY); - Matrix_Scale(this->unk_1898 * 0.05f, this->unk_1898 * 0.05f, this->unk_188C * 0.05f, MTXMODE_APPLY); + Matrix_Scale(this->beamXYscale * 0.05f, this->beamXYscale * 0.05f, this->eyeBeamsZscale * 0.05f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gMajorasMaskBeamDL); gSPDisplayList(POLY_XLU_DISP++, gLightOrb1DL); @@ -4846,8 +4884,8 @@ void Boss07_Mask_DrawBeam(Boss07* this, PlayState* play) { Matrix_Translate(0.0f, 0.0f, 1200.0f, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - Matrix_Scale(this->unk_1890 * 40.0f * this->unk_1898, this->unk_1890 * 40.0f * this->unk_1898, 0.0f, - MTXMODE_APPLY); + Matrix_Scale(this->beamFocusOrbScale * 40.0f * this->beamXYscale, + this->beamFocusOrbScale * 40.0f * this->beamXYscale, 0.0f, MTXMODE_APPLY); Matrix_RotateZS(this->actionTimer * 0x100, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gLightOrbVtxDL); @@ -4861,7 +4899,8 @@ void Boss07_Mask_DrawBeam(Boss07* this, PlayState* play) { Matrix_Translate(0.0f, 0.0f, 1150.0f, MTXMODE_APPLY); Matrix_MultZero(&this->unk_189C); - Matrix_Scale(this->unk_1898 * 0.05f, this->unk_1898 * 0.05f, (this->unk_1894 * 0.01f) - 0.01f, MTXMODE_APPLY); + Matrix_Scale(this->beamXYscale * 0.05f, this->beamXYscale * 0.05f, (this->unk_1894 * 0.01f) - 0.01f, + MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gMajorasMaskBeamDL); Matrix_MultVecZ(20100.0f, &this->unk_18A8); @@ -4870,21 +4909,19 @@ void Boss07_Mask_DrawBeam(Boss07* this, PlayState* play) { Matrix_MultVecZ(20000.0f, &sp50); Matrix_Translate(this->unk_18A8.x, this->unk_18A8.y, this->unk_18A8.z, MTXMODE_NEW); - Matrix_RotateYS(this->unk_18C6, MTXMODE_APPLY); - Matrix_RotateXS(this->unk_18C4, MTXMODE_APPLY); + Matrix_RotateYS(this->beamTargetYaw, MTXMODE_APPLY); + Matrix_RotateXS(this->beamTargetPitch, 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(play->state.gfxCtx), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + Matrix_Scale(this->beamXYscale * 0.05f, this->beamXYscale * 0.05f, this->unk_18C0 * 0.01f, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gMajorasMaskBeamDL); Matrix_MultVecZ(20100.0f, &this->unk_18B4); Matrix_Translate(sp50.x, sp50.y, sp50.z, MTXMODE_NEW); Matrix_ReplaceRotation(&play->billboardMtxF); - Matrix_Scale(this->unk_1898 * 5.0f, this->unk_1898 * 5.0f, 0.0f, MTXMODE_APPLY); + Matrix_Scale(this->beamXYscale * 5.0f, this->beamXYscale * 5.0f, 0.0f, MTXMODE_APPLY); Matrix_RotateZS(this->actionTimer * 0x100, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gLightOrb1DL); gSPDisplayList(POLY_XLU_DISP++, gLightOrbVtxDL); } @@ -4896,7 +4933,7 @@ void Boss07_Mask_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s Boss07* this = THIS; if (limbIndex == MAJORAS_MASK_LIMB_FACE) { - Matrix_MultVecX(500.0f, &this->unk_1878); + Matrix_MultVecX(500.0f, &this->tentAttachPos); } } @@ -4918,14 +4955,14 @@ void Boss07_Mask_Draw(Actor* thisx, PlayState* play2) { func_8012C28C(play->state.gfxCtx); func_8012C2DC(play->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_RotateYF(Math_SinS(this->unk_186C * 0x4500) * temp_f20, MTXMODE_APPLY); + temp_f20 = this->dmgShakeTimer * (M_PI / 4.0f) * 0.06666667f; + temp_f22 = Math_SinS(this->dmgShakeTimer * 0x3500) * temp_f20 * 0.5f; + Matrix_RotateYF(Math_SinS(this->dmgShakeTimer * 0x4500) * temp_f20, MTXMODE_APPLY); Matrix_RotateXFApply(temp_f22); - if ((this->unk_15E % 2) != 0) { + if ((this->dmgFogEffectTimer % 2) != 0) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); } - gSPSegment(POLY_OPA_DISP++, 8, Lib_SegmentedToVirtual(D_80A082E0[this->unk_1884])); + gSPSegment(POLY_OPA_DISP++, 8, Lib_SegmentedToVirtual(D_80A082E0[this->maskEyeState])); SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, Boss07_Mask_PostLimbDraw, &this->actor); POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP); @@ -4934,8 +4971,8 @@ void Boss07_Mask_Draw(Actor* thisx, PlayState* play2) { phi_s6 = ((this->actionFunc == Boss07_Mask_Idle) && (ABS_ALT((s16)(this->actor.world.rot.y - this->actor.shape.rot.y)) > 0x4000)) - ? 1 - : 0; + ? true + : false; Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_NEW); Matrix_RotateXS(this->actor.shape.rot.x, MTXMODE_APPLY); @@ -4950,15 +4987,15 @@ void Boss07_Mask_Draw(Actor* thisx, PlayState* play2) { Matrix_Push(); Matrix_RotateZF(phi_f24, MTXMODE_APPLY); Matrix_MultVec3f(&spA8, &sp9C); - this->tentacles[i].base.x = this->unk_1878.x + sp9C.x; - this->tentacles[i].base.y = this->unk_1878.y + sp9C.y; - this->tentacles[i].base.z = this->unk_1878.z + sp9C.z; + this->tentacles[i].base.x = this->tentAttachPos.x + sp9C.x; + this->tentacles[i].base.y = this->tentAttachPos.y + sp9C.y; + this->tentacles[i].base.z = this->tentAttachPos.z + sp9C.z; - pad2 = (1 - (i * 0.008f)) * this->unk_1870; + pad2 = (1 - (i * 0.008f)) * this->tentLengthScale; Matrix_Pop(); - if (this->unk_149) { + if (this->updateWhips) { Boss07_Mask_UpdateTentacles(this, play, &this->tentacles[i].base, this->tentacles[i].pos, - this->tentacles[i].rot, this->tentacles[i].pull, &sp90, pad2, phi_s6, phi_f24); + this->tentacles[i].rot, this->tentacles[i].vel, &sp90, pad2, phi_s6, phi_f24); } Boss07_Mask_DrawTentacles(this, play, this->tentacles[i].pos, this->tentacles[i].rot, pad2, i * 0.9f); phi_f24 += 0.5f; @@ -4967,7 +5004,7 @@ void Boss07_Mask_Draw(Actor* thisx, PlayState* play2) { Matrix_Pop(); } Boss07_Mask_DrawBeam(this, play); - this->unk_149 = false; + this->updateWhips = false; CLOSE_DISPS(play->state.gfxCtx); } @@ -5009,16 +5046,15 @@ void Boss07_Projectile_Update(Actor* thisx, PlayState* play2) { Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 31.0f, 100.0f, 7); this->actor.shape.rot.z += 0x1200; - if ((this->actor.bgCheckFlags & 0x19) || (this->cyl2.base.atFlags & 2) || (this->cyl2.base.atFlags & 2) || - sKillProjectiles) { + if ((this->actor.bgCheckFlags & 0x19) || (this->spawnCollider.base.atFlags & AT_HIT) || + (this->spawnCollider.base.atFlags & AT_HIT) || sKillProjectiles) { Actor_MarkForDeath(&this->actor); - Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, this->unk_181C, - CLEAR_TAG_SMALL_LIGHT_RAYS); + Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, this->shotColorIndex, CLEAR_TAG_SMALL_LIGHT_RAYS); } - Collider_UpdateCylinder(&this->actor, &this->cyl2); - CollisionCheck_SetAT(play, &play->colChkCtx, &this->cyl2.base); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->cyl2.base); + Collider_UpdateCylinder(&this->actor, &this->spawnCollider); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->spawnCollider.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->spawnCollider.base); } } @@ -5029,10 +5065,10 @@ void Boss07_Projectile_Draw(Actor* thisx, PlayState* play2) { OPEN_DISPS(play->state.gfxCtx); func_8012C2DC(play->state.gfxCtx); gDPPipeSync(POLY_XLU_DISP++); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, sColorsWhite[this->unk_181C][0], sColorsWhite[this->unk_181C][1], - 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); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, sShotPrimColors[this->shotColorIndex][0], + sShotPrimColors[this->shotColorIndex][1], sShotPrimColors[this->shotColorIndex][2], 255); + gDPSetEnvColor(POLY_XLU_DISP++, sShotEnvColors[this->shotColorIndex][0], sShotEnvColors[this->shotColorIndex][1], + sShotEnvColors[this->shotColorIndex][2], 128); Matrix_Translate(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_ReplaceRotation(&play->billboardMtxF); @@ -5047,21 +5083,21 @@ void Boss07_Remains_CollisionCheck(Boss07* this, PlayState* play) { Vec3f sp2C; ColliderInfo* hitbox; - if ((this->unk_15C == 0) && (this->cyl2.base.acFlags & AC_HIT)) { - this->cyl2.base.acFlags &= ~AC_HIT; - this->unk_15C = 15; - hitbox = this->cyl2.info.acHitInfo; - if (hitbox->toucher.dmgFlags & 0x80) { + if ((this->invincibilityTimer == 0) && (this->spawnCollider.base.acFlags & AC_HIT)) { + this->spawnCollider.base.acFlags &= ~AC_HIT; + this->invincibilityTimer = 15; + hitbox = this->spawnCollider.info.acHitInfo; + if (hitbox->toucher.dmgFlags & DMG_HOOKSHOT) { Boss07_Remains_SetupStunned(this, play); } else { u8 damage = this->actor.colChkInfo.damage; this->actor.colChkInfo.health -= damage; - this->unk_15E = 15; + this->dmgFogEffectTimer = 15; this->actionFunc = Boss07_Remains_Fly; if ((s8)this->actor.colChkInfo.health <= 0) { this->actionState = MAJORAS_REMAINS_DEATH; - this->unk_18DA = 1; + this->readyDeath = true; Enemy_StartFinishingBlow(play, &this->actor); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FOLLOWERS_DEAD); } else { @@ -5071,8 +5107,8 @@ void Boss07_Remains_CollisionCheck(Boss07* this, PlayState* play) { } Matrix_RotateYS(this->actor.yawTowardsPlayer, MTXMODE_NEW); Matrix_MultVecZ(-20.0f, &sp2C); - this->unk_18CC = sp2C.x; - this->unk_18D0 = sp2C.z; + this->xRecoil = sp2C.x; + this->zRecoil = sp2C.z; } } } @@ -5112,39 +5148,39 @@ void Boss07_Remains_Intro(Boss07* this, PlayState* play) { sp4C = this->moveTarget.z - this->actor.world.pos.z; this->actor.world.rot.y = Math_Atan2S(sp54, sp4C); this->actor.world.rot.x = Math_Atan2S(sp50, sqrtf(SQ(sp54) + SQ(sp4C))); - this->unk_AB40 = Rand_ZeroFloat(100.0f); + this->timer_AB40 = Rand_ZeroFloat(100.0f); break; case MAJORAS_REMAINS_CS_FLY: - this->unk_ABC8++; - this->unk_AB40++; - this->unk_18C8 += 0x200; - Math_ApproachF(&this->unk_188C, 1.2f, 1.0f, 0.1f); + this->timer_ABC8++; + this->timer_AB40++; + this->remainsOrbRot += 0x200; + Math_ApproachF(&this->eyeBeamsZscale, 1.2f, 1.0f, 0.1f); Math_ApproachF(&this->actor.scale.x, 0.004f, 0.5f, 0.0002f); this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; - if (this->unk_ABC8 > 90) { + if (this->timer_ABC8 > 90) { this->moveTarget.x = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].x; this->moveTarget.y = 370.0f; this->moveTarget.z = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].z; sp38 = 20.0f; sp34 = 0.5f; - sp40 = 4096.0f; - sp3C = 400.0f; + sp40 = 0x1000; + sp3C = 0x190; phi_f2 = 0.0f; } else { - phi_f2 = Math_SinS(this->unk_AB40 * 0x300) * 20.0f; + phi_f2 = Math_SinS(this->timer_AB40 * 0x300) * 20.0f; sp38 = 1.0f; sp34 = 0.1f; - sp40 = 1500.0f; - sp3C = 100.0f; + sp40 = 0x5DC; + sp3C = 0x64; } sp54 = this->moveTarget.x - this->actor.world.pos.x; sp50 = this->moveTarget.y - this->actor.world.pos.y + phi_f2; sp4C = this->moveTarget.z - this->actor.world.pos.z; sp30 = Math_Atan2S(sp54, sp4C); sp32 = Math_Atan2S(sp50, sqrtf(SQ(sp54) + SQ(sp4C))); - Math_ApproachS(&this->actor.world.rot.y, sp30, 5, this->unk_170); - Math_ApproachS(&this->actor.world.rot.x, sp32, 5, this->unk_170); - Math_ApproachF(&this->unk_170, sp40, 1.0f, sp3C); + Math_ApproachS(&this->actor.world.rot.y, sp30, 5, this->vel_170); + Math_ApproachS(&this->actor.world.rot.x, sp32, 5, this->vel_170); + Math_ApproachF(&this->vel_170, sp40, 1.0f, sp3C); Math_ApproachF(&this->actor.speedXZ, sp38, 1.0f, sp34); Actor_UpdateVelocityWithoutGravity(&this->actor); Actor_UpdatePos(&this->actor); @@ -5152,17 +5188,17 @@ void Boss07_Remains_Intro(Boss07* this, PlayState* play) { break; case MAJORAS_REMAINS_CS_ATTACH_WAIT: Actor_SetScale(&this->actor, 0.0f); - this->unk_188C = 0.0f; + this->eyeBeamsZscale = 0.0f; this->actor.speedXZ = 0.0f; this->actor.world.pos.x = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].x * 0.6f; this->actor.world.pos.y = 370.0f; this->actor.world.pos.z = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].z * 0.6f; this->actor.shape.rot.y = sRemainsEnd[this->actor.params - MAJORAS_REMAINS].y; - this->unk_ABCC = 0; + this->timer_ABCC = 0; break; case MAJORAS_REMAINS_CS_ATTACH: - this->unk_ABCC++; - if (this->unk_ABCC == 10) { + this->timer_ABCC++; + if (this->timer_ABCC == 10) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FOLLOWERS_STAY); } Actor_SetScale(&this->actor, 0.03f); @@ -5176,7 +5212,7 @@ void Boss07_Remains_SetupFly(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Remains_Fly; this->actor.gravity = -0.75f; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); - Collider_InitAndSetCylinder(play, &this->cyl2, &this->actor, &sRemainsCylInit); + Collider_InitAndSetCylinder(play, &this->spawnCollider, &this->actor, &sRemainsCylInit); this->actor.colChkInfo.health = 5; this->actionState = MAJORAS_REMAINS_WAIT; } @@ -5197,32 +5233,32 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MUJURA_FOLLOWERS_FLY - SFX_FLAG); this->timers[0] = 80; this->timers[2] = 100.0f + Rand_ZeroFloat(100.0f); - this->unk_18C = 5.0f; + this->flySpeedTarget = 5.0f; this->actor.speedXZ = 5.0f; this->moveTarget = gZeroVec3f; this->actor.world.rot.y = Math_Atan2S(-this->actor.world.pos.x, -this->actor.world.pos.z); this->actionState = MAJORAS_REMAINS_FLY; - this->unk_1888 = 100; - this->cyl2.base.colType = COLTYPE_HIT3; + this->noclipTimer = 100; + this->spawnCollider.base.colType = COLTYPE_HIT3; this->actor.flags |= (ACTOR_FLAG_200 | ACTOR_FLAG_1); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_DEMO_BREAK); break; case MAJORAS_REMAINS_FLY: Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MUJURA_FOLLOWERS_FLY - SFX_FLAG); if (this->timers[2] == 0) { - this->unk_18DB = 1; + this->readyShot = true; this->timers[2] = Rand_ZeroFloat(200.0f) + 100.0f; } if (this->timers[0] == 0) { if (Rand_ZeroOne() < 0.35f) { - this->unk_18C = 1.0f; + this->flySpeedTarget = 1.0f; this->timers[0] = Rand_ZeroFloat(50.0f) + 30.0f; } else { Boss07_RandVec3fXZ(&this->moveTarget, 500.0f); this->moveTarget.y = Rand_ZeroFloat(350.0f) + 100.0f; this->timers[0] = Rand_ZeroFloat(50.0f) + 20.0f; - this->unk_170 = 0.0f; - this->unk_18C = Rand_ZeroFloat(5.0f) + 5.0f; + this->vel_170 = 0.0f; + this->flySpeedTarget = Rand_ZeroFloat(5.0f) + 5.0f; } } sp78 = this->moveTarget.x - this->actor.world.pos.x; @@ -5230,22 +5266,22 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { sp70 = this->moveTarget.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->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); - Math_ApproachF(&this->actor.speedXZ, this->unk_18C, 1.0f, 1.0f); - if ((this->unk_18C < 8.0f) && (Play_InCsMode(play) == 0)) { + sp7E += (s16)(Math_SinS(this->actionTimer * 0x1388) * 0xFA0); + Math_ApproachS(&this->actor.world.rot.y, sp7C, 0xA, this->vel_170); + Math_ApproachS(&this->actor.world.rot.x, sp7E, 5, this->vel_170); + Math_ApproachF(&this->vel_170, 0x7D0, 1.0f, 0x64); + Math_ApproachF(&this->actor.speedXZ, this->flySpeedTarget, 1.0f, 1.0f); + if ((this->flySpeedTarget < 8.0f) && !Play_InCsMode(play)) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); } else { Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0xA, 0x1000); } Actor_UpdateVelocityWithoutGravity(&this->actor); Actor_UpdatePos(&this->actor); - if (this->unk_1888 == 0) { - Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 100.0f, 100.0f, 5); + if (this->noclipTimer == 0) { + Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 100.0f, 100, 5); } else { - this->unk_1888--; + this->noclipTimer--; } Boss07_Remains_CollisionCheck(this, play); break; @@ -5254,8 +5290,8 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 100.0f, 100.0f, 5); if (this->actor.bgCheckFlags & 1) { - if (this->unk_18DA != 0) { - this->unk_18D6 |= 4; + if (this->readyDeath) { + this->timer_18D6 |= 4; } Math_ApproachF(&this->actor.scale.z, 0.0f, 1.0f, 0.001f); if (this->actor.scale.z == 0.0f) { @@ -5283,21 +5319,21 @@ void Boss07_Remains_Fly(Boss07* this, PlayState* play) { break; } if (this->actionState <= MAJORAS_REMAINS_FLY) { - Collider_UpdateCylinder(&this->actor, &this->cyl2); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->cyl2.base); - CollisionCheck_SetAT(play, &play->colChkCtx, &this->cyl2.base); + Collider_UpdateCylinder(&this->actor, &this->spawnCollider); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->spawnCollider.base); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->spawnCollider.base); } - if (this->unk_18DB != 0) { - this->unk_18DB = 0; - if ((Boss07_IsFacingPlayer(this, play) != 0) && (sMajorasMask->actionFunc != Boss07_Mask_Beam)) { - Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, MAJORAS_REMAINS_SHOT); + if (this->readyShot) { + this->readyShot = false; + if (Boss07_IsFacingPlayer(this, play) && (sMajorasMask->actionFunc != Boss07_Mask_Beam)) { + Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, MAJORAS_REMAINS_SHOT); } } - if (this->unk_18D6 != 0) { + if (this->timer_18D6 != 0) { sp60.x = randPlusMinusPoint5Scaled(80.0f) + this->actor.world.pos.x; sp60.z = randPlusMinusPoint5Scaled(80.0f) + this->actor.world.pos.z; - if (this->unk_18DA != 0) { + if (this->readyDeath) { sp48.x = sp48.z = 0.0f; sp48.y = 0.03f; sp60.y = Rand_ZeroFloat(10.0f) + this->actor.world.pos.y; @@ -5325,9 +5361,9 @@ void Boss07_Remains_SetupStunned(Boss07* this, PlayState* play) { void Boss07_Remains_Stunned(Boss07* this, PlayState* play) { Boss07_Remains_CollisionCheck(this, play); - Collider_UpdateCylinder(&this->actor, &this->cyl2); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->cyl2.base); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->cyl2.base); + Collider_UpdateCylinder(&this->actor, &this->spawnCollider); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->spawnCollider.base); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->spawnCollider.base); if (this->timers[0] == 0) { this->actionFunc = Boss07_Remains_Fly; this->actionState = MAJORAS_REMAINS_FLY; @@ -5343,15 +5379,15 @@ void Boss07_Remains_Update(Actor* thisx, PlayState* play2) { for (i = 0; i < 3; i++) { DECR(this->timers[i]); } - DECR(this->unk_18D6); - DECR(this->unk_15C); - DECR(this->unk_15E); + DECR(this->timer_18D6); + DECR(this->invincibilityTimer); + DECR(this->dmgFogEffectTimer); this->actionFunc(this, play); this->actor.focus.pos = this->actor.world.pos; - this->actor.world.pos.x += this->unk_18CC; - this->actor.world.pos.z += this->unk_18D0; - Math_ApproachZeroF(&this->unk_18CC, 1.0f, 1.0f); - Math_ApproachZeroF(&this->unk_18D0, 1.0f, 1.0f); + this->actor.world.pos.x += this->xRecoil; + this->actor.world.pos.z += this->zRecoil; + Math_ApproachZeroF(&this->xRecoil, 1.0f, 1.0f); + Math_ApproachZeroF(&this->zRecoil, 1.0f, 1.0f); } void Boss07_Remains_Draw(Actor* thisx, PlayState* play2) { @@ -5363,12 +5399,12 @@ void Boss07_Remains_Draw(Actor* thisx, PlayState* play2) { OPEN_DISPS(play->state.gfxCtx); func_8012C28C(play->state.gfxCtx); - if ((this->unk_15E % 2) != 0) { + if ((this->dmgFogEffectTimer % 2) != 0) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); } - sp64 = this->unk_15C * (M_PI / 4.0f) * 0.06666667f; - sp60 = Math_SinS(this->unk_15C * 0x3500) * sp64 * 0.5f; - Matrix_RotateYF(Math_SinS(this->unk_15C * 0x4500) * sp64, MTXMODE_APPLY); + sp64 = this->invincibilityTimer * (M_PI / 4.0f) * 0.06666667f; + sp60 = Math_SinS(this->invincibilityTimer * 0x3500) * sp64 * 0.5f; + Matrix_RotateYF(Math_SinS(this->invincibilityTimer * 0x4500) * sp64, MTXMODE_APPLY); Matrix_RotateXFApply(sp60); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); switch (this->actor.params) { @@ -5392,9 +5428,9 @@ void Boss07_Remains_Draw(Actor* thisx, PlayState* play2) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 100, 128); Matrix_Translate(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_Scale(this->eyeBeamsZscale, this->eyeBeamsZscale, 0.0f, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); - Matrix_RotateZS(this->unk_18C8, MTXMODE_APPLY); + Matrix_RotateZS(this->remainsOrbRot, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gLightOrb1DL); gSPDisplayList(POLY_XLU_DISP++, gLightOrbVtxDL); @@ -5405,17 +5441,17 @@ void Boss07_Remains_Draw(Actor* thisx, PlayState* play2) { void Boss07_Top_SetupThrown(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Top_Thrown; this->actor.gravity = 0.0f; - this->unk_17C = (sREG(42) * 0.01f) + 0.9f; + this->topSpinRate = (sREG(42) * 0.01f) + 0.9f; this->timers[0] = 200; } void Boss07_Top_Thrown(Boss07* this, PlayState* play) { if (sMajorasWrath->actionFunc == Boss07_Wrath_SpawnTop) { - Math_Vec3f_Copy(&this->actor.world.pos, &sMajorasWrath->unk_F80); + Math_Vec3f_Copy(&this->actor.world.pos, &sMajorasWrath->whipGrabPos); this->actor.world.pos.y -= 25.0f + sREG(78); } Actor_UpdateBgCheckInfo(play, &this->actor, 40.0f, 50.0f, 80.0f, 1); - if ((sMajorasWrath->actionTimer >= (s16)(KREG(50) + 21)) || (sMajorasWrath->unk_15C != 0)) { + if ((sMajorasWrath->actionTimer >= (s16)(KREG(50) + 21)) || (sMajorasWrath->invincibilityTimer != 0)) { Boss07_Top_SetupGround(this, play); } else if (this->actor.bgCheckFlags & 8) { Boss07_Top_SetupGround(this, play); @@ -5428,7 +5464,7 @@ void Boss07_Top_Thrown(Boss07* this, PlayState* play) { void Boss07_Top_SetupGround(Boss07* this, PlayState* play) { this->actionFunc = Boss07_Top_Ground; this->actor.gravity = -2.0f; - if (sMajorasWrath->unk_15C != 0) { + if (sMajorasWrath->invincibilityTimer != 0) { this->timers[0] = sREG(47) + 80; this->timers[1] = sREG(77) + 150; } else { @@ -5438,22 +5474,22 @@ void Boss07_Top_SetupGround(Boss07* this, PlayState* play) { this->actor.speedXZ = (sREG(44) * 0.1f) + -3.0f; } this->actor.world.rot.y = (sREG(45) * 0x1000) + sMajorasWrath->actor.shape.rot.y; - this->actor.shape.rot.z = Rand_ZeroFloat((sREG(29) + 10) * 256.0f); + this->actor.shape.rot.z = Rand_ZeroFloat((f32)(sREG(29) + 10) * 0x100); } void Boss07_Top_Ground(Boss07* this, PlayState* play) { f32 sp4C; f32 sp48; - func_8019FAD8(&this->actor.projectedPos, NA_SE_EN_LAST3_KOMA_OLD - SFX_FLAG, this->unk_17C * 1.1111112f); + func_8019FAD8(&this->actor.projectedPos, NA_SE_EN_LAST3_KOMA_OLD - SFX_FLAG, this->topSpinRate * 1.1111112f); Actor_MoveWithGravity(&this->actor); - this->actor.world.pos.x += this->unk_18CC; - this->actor.world.pos.z += this->unk_18D0; + this->actor.world.pos.x += this->xRecoil; + this->actor.world.pos.z += this->zRecoil; Actor_UpdateBgCheckInfo(play, &this->actor, 40.0f, 40.0f, 80.0f, 5); if ((this->unk_158 == 0) && (this->actor.bgCheckFlags & 8)) { this->unk_158 = 10; - if (this->unk_17C > 0.01f) { - if (this->unk_17C < 0.45f) { + if (this->topSpinRate > 0.01f) { + if (this->topSpinRate < 0.45f) { this->actor.speedXZ *= -1.0f; } else { this->actor.speedXZ = -10.0f; @@ -5466,19 +5502,19 @@ void Boss07_Top_Ground(Boss07* this, PlayState* play) { if (this->timers[0] < (s16)(sREG(24) + 70)) { if (this->timers[0] >= (s16)(sREG(25) + 35)) { Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, (sREG(17) * 0.01f) + 0.1f); - Math_ApproachS(&this->actor.shape.rot.z, (sREG(19) * 0x800) + 0x2000, 1, sREG(18) + 416); - Math_ApproachZeroF(&this->unk_17C, 1.0f, (sREG(16) * 0.0001f) + 0.005f); - Math_ApproachS(&this->unk_180, (sREG(20) * 0x800) + 0x2000, 1, (sREG(21) * 16) + 192); + Math_ApproachS(&this->actor.shape.rot.z, (sREG(19) * 0x800) + 0x2000, 1, sREG(18) + 0x1A0); + Math_ApproachZeroF(&this->topSpinRate, 1.0f, (sREG(16) * 0.0001f) + 0.005f); + Math_ApproachS(&this->unk_180, (sREG(20) * 0x800) + 0x2000, 1, (sREG(21) * 16) + 0xC0); } else if (this->timers[0] == 0) { Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, (sREG(26) * 0.01f) + 0.5f); Math_ApproachS(&this->actor.shape.rot.z, (sREG(19) * 0x800) + 0x2000, 1, 0x800); - Math_ApproachZeroF(&this->unk_17C, 1.0f, (sREG(27) * 0.001f) + 0.024f); + Math_ApproachZeroF(&this->topSpinRate, 1.0f, (sREG(27) * 0.001f) + 0.024f); Math_ApproachS(&this->unk_180, 0, 2, sREG(28) + 106); } else { Math_ApproachF(&this->actor.speedXZ, sREG(22) + 10.0f, 1.0f, (sREG(23) * 0.01f) + 0.6f); - Math_ApproachS(&this->actor.shape.rot.z, (sREG(19) * 0x800) + 0x2000, 1, sREG(18) + 1040); - Math_ApproachZeroF(&this->unk_17C, 1.0f, (sREG(16) * 0.0001f) + 0.005f); - Math_ApproachS(&this->unk_180, (sREG(29) * 0x800) - 0x800, 1, (sREG(30) * 16) + 832); + Math_ApproachS(&this->actor.shape.rot.z, (sREG(19) * 0x800) + 0x2000, 1, sREG(18) + 0x410); + Math_ApproachZeroF(&this->topSpinRate, 1.0f, (sREG(16) * 0.0001f) + 0.005f); + Math_ApproachS(&this->unk_180, (sREG(29) * 0x800) - 0x800, 1, (sREG(30) * 16) + 0x340); } this->actor.world.rot.y += this->unk_180; } else { @@ -5486,8 +5522,8 @@ void Boss07_Top_Ground(Boss07* this, PlayState* play) { Math_ApproachF(&this->actor.speedXZ, (sREG(48) * 0.1f) + 2.0f + 8.0f, 1.0f, (sREG(46) * 0.01f) + 0.100000024f + 0.2f); } - Math_ApproachZeroF(&this->unk_18CC, 1.0f, 1.0f); - Math_ApproachZeroF(&this->unk_18D0, 1.0f, 1.0f); + Math_ApproachZeroF(&this->xRecoil, 1.0f, 1.0f); + Math_ApproachZeroF(&this->zRecoil, 1.0f, 1.0f); if (this->actor.velocity.y < (sREG(40) + -2.0f)) { this->actor.velocity.y *= -(0.5f + (sREG(41) * 0.01f)); Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW); @@ -5500,23 +5536,23 @@ void Boss07_Top_Ground(Boss07* this, PlayState* play) { sp48 = this->actor.prevPos.z - this->actor.world.pos.z; func_800AE930(&play->colCtx, Effect_GetByIndex(this->effectIndex), &this->actor.world.pos, 3.0f, Math_Atan2S(sp4C, sp48), this->actor.floorPoly, this->actor.floorBgId); - this->actionState = MAJORAS_TOP_STATE_1; - } else if (this->actionState != MAJORAS_TOP_STATE_0) { - this->actionState = MAJORAS_TOP_STATE_0; + this->actionState = MAJORAS_TOP_ON_GROUND; + } else if (this->actionState != MAJORAS_TOP_IN_AIR) { + this->actionState = MAJORAS_TOP_IN_AIR; func_800AEF44(Effect_GetByIndex(this->effectIndex)); } this->actor.shape.rot.y = this->actor.world.rot.y; if (this->timers[1] == 0) { EnBom* bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, - this->actor.world.pos.y + 25.0f, this->actor.world.pos.z, 0, 0, 0, 0); + this->actor.world.pos.y + 25.0f, this->actor.world.pos.z, 0, 0, 0, ENBOM_0); if (bomb != NULL) { bomb->timer = 0; } Actor_MarkForDeath(&this->actor); } else if (this->timers[1] == 25) { - this->unk_15E = 25; - func_800BC154(play, &play->actorCtx, &this->actor, 3); + this->dmgFogEffectTimer = 25; + func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_EXPLOSIVES); } } @@ -5544,27 +5580,27 @@ void Boss07_Top_Collide(Boss07* this, PlayState* play) { this->actor.speedXZ = -10.0f; } else { this->actor.speedXZ = -5.0f; - this->unk_17C = (sREG(89) * 0.01f) + 0.2f; + this->topSpinRate = (sREG(89) * 0.01f) + 0.2f; this->unk_180 = 0x800; } if (top->timers[0] > 0) { top->actor.speedXZ = -10.0f; } else { top->actor.speedXZ = -5.0f; - top->unk_17C = (sREG(89) * 0.01f) + 0.2f; + top->topSpinRate = (sREG(89) * 0.01f) + 0.2f; top->unk_180 = 0x800; } CollisionCheck_SpawnShieldParticles(play, &this->actor.focus.pos); CollisionCheck_SpawnShieldParticles(play, &top->actor.focus.pos); if (this->timers[0] > 80) { - this->actor.shape.rot.z = randPlusMinusPoint5Scaled((sREG(29) + 20) * 256.0f); + this->actor.shape.rot.z = randPlusMinusPoint5Scaled((f32)(sREG(29) + 20) * 0x100); for (i = 0; i < 5; i++) { DECR(this->timers[0]); DECR(this->timers[1]); } } if (top->timers[0] > 80) { - top->actor.shape.rot.z = randPlusMinusPoint5Scaled((sREG(29) + 20) * 256.0f); + top->actor.shape.rot.z = randPlusMinusPoint5Scaled((f32)(sREG(29) + 20) * 0x100); for (i = 0; i < 5; i++) { DECR(top->timers[0]); DECR(top->timers[1]); @@ -5581,15 +5617,16 @@ void Boss07_Top_Collide(Boss07* this, PlayState* play) { void Boss07_Top_CollisionCheck(Boss07* this, PlayState* play) { s32 sp3C; - s32 sp38 = 0; + s32 sp38 = false; Player* player = GET_PLAYER(play); s32 pad[3]; - if (this->cyl2.base.acFlags & 2) { - this->cyl2.base.acFlags &= ~2; - if (this->unk_15C == 0) { - this->unk_15C = 5; - if ((this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_D) || (this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_A)) { + if (this->spawnCollider.base.acFlags & AC_HIT) { + this->spawnCollider.base.acFlags &= ~AC_HIT; + if (this->invincibilityTimer == 0) { + this->invincibilityTimer = 5; + if ((this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_D) || + (this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_A)) { if (this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_D) { player->unk_B84 = this->actor.yawTowardsPlayer; player->unk_B80 = 20.0f; @@ -5612,13 +5649,14 @@ void Boss07_Top_CollisionCheck(Boss07* this, PlayState* play) { } else if (this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_C) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.speedXZ = 2.0f * -player->actor.speedXZ; - sp38 = 1; + sp38 = true; } else if (this->actor.colChkInfo.damageEffect == MAJORAS_TOP_DMGEFF_B) { - this->actor.world.rot.y = Math_Atan2S(this->cyl2.base.ac->world.pos.x - this->actor.world.pos.x, - this->cyl2.base.ac->world.pos.z - this->actor.world.pos.z); + this->actor.world.rot.y = + Math_Atan2S(this->spawnCollider.base.ac->world.pos.x - this->actor.world.pos.x, + this->spawnCollider.base.ac->world.pos.z - this->actor.world.pos.z); this->actor.speedXZ = -20.0f; this->actor.velocity.y = sREG(55) + 15.0f; - sp38 = 1; + sp38 = true; } } } @@ -5626,11 +5664,11 @@ void Boss07_Top_CollisionCheck(Boss07* this, PlayState* play) { if ((func_800B64FC(play, 5.0f, &this->actor.world.pos, &sp3C) >= 0.0f) && (sp3C == 0)) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.velocity.y = sREG(55) + 25.0f; - sp38 = 1; + sp38 = true; } } if (sp38 && (this->timers[0] > 90)) { - this->actor.shape.rot.z = randPlusMinusPoint5Scaled((sREG(29) + 30) * 256.0f); + this->actor.shape.rot.z = randPlusMinusPoint5Scaled((f32)(sREG(29) + 30) * 0x100); this->timers[0] = Rand_ZeroFloat(10.0f) + 70.0f; this->timers[1] = this->timers[0] + 70; } @@ -5643,20 +5681,20 @@ void Boss07_Top_Update(Actor* thisx, PlayState* play2) { this->actionTimer++; DECR(this->timers[0]); DECR(this->timers[1]); - DECR(this->unk_15E); - DECR(this->unk_15C); + DECR(this->dmgFogEffectTimer); + DECR(this->invincibilityTimer); DECR(this->unk_158); this->actionFunc(this, play); Math_Vec3f_Copy(&this->actor.focus.pos, &this->actor.world.pos); this->actor.focus.pos.y += 25.0f; Boss07_Top_CollisionCheck(this, play); - Collider_UpdateCylinder(&this->actor, &this->cyl2); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->cyl2.base); - CollisionCheck_SetAT(play, &play->colChkCtx, &this->cyl2.base); + Collider_UpdateCylinder(&this->actor, &this->spawnCollider); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->spawnCollider.base); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->spawnCollider.base); Boss07_Top_Collide(this, play); - this->unk_178 -= this->unk_17C; - if (this->unk_178 < -2.0f * M_PI) { - this->unk_178 += 2.0f * M_PI; + this->topSpinAngle -= this->topSpinRate; + if (this->topSpinAngle < -2.0f * M_PI) { + this->topSpinAngle += 2.0f * M_PI; } if (sMajorasWrath->actionFunc == Boss07_Wrath_Death) { Actor_MarkForDeath(&this->actor); @@ -5671,13 +5709,13 @@ void Boss07_Top_Draw(Actor* thisx, PlayState* play2) { OPEN_DISPS(play->state.gfxCtx); func_8012C28C(play->state.gfxCtx); - if ((this->unk_15E % 2) != 0) { + if ((this->dmgFogEffectTimer % 2) != 0) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 780, 1099); } Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY); Matrix_RotateZS(this->actor.shape.rot.z, MTXMODE_APPLY); - Matrix_RotateYF(this->unk_178, MTXMODE_APPLY); + Matrix_RotateYF(this->topSpinAngle, MTXMODE_APPLY); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gMajorasWrathTopDL); @@ -5696,22 +5734,22 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { dummy_label:; //!@fake play_sound(NA_SE_EN_LAST2_HEARTBEAT_OLD - SFX_FLAG); } - if (this->unk_1808 != 0) { - D_801F4E32 = 1; - D_801F4E38 = this->unk_1810; - D_801F4E44 = this->unk_180C; + if (this->lensFlareOn) { + D_801F4E32 = true; + D_801F4E38 = this->lensFlarePos; + D_801F4E44 = this->lensFlareScale; D_801F4E48 = 10.0f; D_801F4E4C = 0; - this->unk_1808 = 0; + this->lensFlareOn = false; } else { - D_801F4E32 = 0; + D_801F4E32 = false; } - this->unk_ABC8++; + this->timer_ABC8++; switch (this->csState) { case MAJORAS_STATIC_CS_STATE_0: - if ((sMajorasMask != NULL) && sMajorasMask->unk_774) { + if ((sMajorasMask != NULL) && sMajorasMask->activateRemains) { this->csState = MAJORAS_STATIC_CS_STATE_1; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; } break; case MAJORAS_STATIC_CS_STATE_1: @@ -5721,7 +5759,7 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { this->subCamIndex = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, this->subCamIndex, CAM_STATUS_ACTIVE); - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->csState = MAJORAS_STATIC_CS_STATE_2; func_8016566C(150); this->subCamEye.x = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.x * 0.7f; @@ -5731,15 +5769,15 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { break; } case MAJORAS_STATIC_CS_STATE_2: - if (this->unk_ABC8 == 20) { + if (this->timer_ABC8 == 20) { sBossRemains[REMAINS_ODOLWA]->actionState = MAJORAS_REMAINS_ACTIVATE; } this->subCamAt.x = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.x; this->subCamAt.y = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.y; this->subCamAt.z = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.z; - if (this->unk_ABC8 == 40) { + if (this->timer_ABC8 == 40) { this->csState = MAJORAS_STATIC_CS_STATE_3; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->subCamEye.x = sBossRemains[REMAINS_GYORG]->actor.world.pos.x * 0.7f; this->subCamEye.y = sBossRemains[REMAINS_GYORG]->actor.world.pos.y * 0.7f; this->subCamEye.z = sBossRemains[REMAINS_GYORG]->actor.world.pos.z * 0.7f; @@ -5747,15 +5785,15 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { break; } case MAJORAS_STATIC_CS_STATE_3: - if (this->unk_ABC8 == 20) { + if (this->timer_ABC8 == 20) { sBossRemains[REMAINS_GYORG]->actionState = MAJORAS_REMAINS_ACTIVATE; } this->subCamAt.x = sBossRemains[REMAINS_GYORG]->actor.world.pos.x; this->subCamAt.y = sBossRemains[REMAINS_GYORG]->actor.world.pos.y; this->subCamAt.z = sBossRemains[REMAINS_GYORG]->actor.world.pos.z; - if (this->unk_ABC8 == 40) { + if (this->timer_ABC8 == 40) { this->csState = MAJORAS_STATIC_CS_STATE_4; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->subCamEye.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x * 0.7f; this->subCamEye.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y * 0.7f; this->subCamEye.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z * 0.7f; @@ -5763,15 +5801,15 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { break; } case MAJORAS_STATIC_CS_STATE_4: - if (this->unk_ABC8 == 20) { + if (this->timer_ABC8 == 20) { sBossRemains[REMAINS_GOHT]->actionState = MAJORAS_REMAINS_ACTIVATE; } this->subCamAt.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x; this->subCamAt.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y; this->subCamAt.z = sBossRemains[REMAINS_GOHT]->actor.world.pos.z; - if (this->unk_ABC8 == 40) { + if (this->timer_ABC8 == 40) { this->csState = MAJORAS_STATIC_CS_STATE_5; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; this->subCamEye.x = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.x * 0.7f; this->subCamEye.y = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.y * 0.7f; this->subCamEye.z = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.z * 0.7f; @@ -5779,18 +5817,18 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { break; } case MAJORAS_STATIC_CS_STATE_5: - if (this->unk_ABC8 == 20) { + if (this->timer_ABC8 == 20) { sBossRemains[REMAINS_TWINMOLD]->actionState = MAJORAS_REMAINS_ACTIVATE; } this->subCamAt.x = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.x; this->subCamAt.y = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.y; this->subCamAt.z = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.z; - if (this->unk_ABC8 == 40) { + if (this->timer_ABC8 == 40) { Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); s32 i; this->csState = MAJORAS_STATIC_CS_STATE_6; - this->unk_ABC8 = 0; + this->timer_ABC8 = 0; mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; mainCam->at = this->subCamAt; @@ -5807,12 +5845,12 @@ void Boss07_Static_Update(Actor* thisx, PlayState* play2) { case MAJORAS_STATIC_CS_STATE_6: break; } - if (this->subCamIndex != 0) { - if (this->unk_ABC8 < 20) { + if (this->subCamIndex != SUB_CAM_ID_DONE) { + if (this->timer_ABC8 < 20) { s32 j; for (j = 0; j < ARRAY_COUNT(sBossRemains); j++) { - if ((this->unk_ABC8 % 2) != 0) { + if ((this->timer_ABC8 % 2) != 0) { sBossRemains[j]->actor.world.pos.x += 2.0f; sBossRemains[j]->actor.world.pos.z += 2.0f; } else { 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 124ed8e1c..cf17e0e4d 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -19,137 +19,135 @@ typedef struct { Vec3f base; Vec3f pos[MAJORAS_TENT_LENGTH]; Vec3f rot[MAJORAS_TENT_LENGTH]; - Vec3f pull[MAJORAS_TENT_LENGTH]; + Vec3f vel[MAJORAS_TENT_LENGTH]; } Boss07Tentacle; // size = 0x174 (0xC + 0x24 * length) typedef struct { Vec3s baseRot; f32 gravity; - f32 stiffness; + f32 mobility; f32 drag; f32 tension; Vec3f basePos; Vec3f pos[MAJORAS_WHIP_MAX_LENGTH]; Vec3f rot[MAJORAS_WHIP_MAX_LENGTH]; - Vec3f pull[MAJORAS_WHIP_MAX_LENGTH]; + Vec3f vel[MAJORAS_WHIP_MAX_LENGTH]; f32 unk_72C[MAJORAS_WHIP_MAX_LENGTH]; // unused, probably a stretch factor } Boss07Whip; // size = 0x7F4 (0x24 + 0x28 * max) typedef struct Boss07 { /* 0x0000 */ Actor actor; /* 0x0144 */ Boss07ActionFunc actionFunc; - /* 0x0148 */ u8 unk_148; - /* 0x0149 */ u8 unk_149; - /* 0x014A */ u8 unk_14A; - /* 0x014B */ u8 unk_14B; + /* 0x0148 */ u8 startDeath; + /* 0x0149 */ u8 updateWhips; + /* 0x014A */ u8 envEffectOn; + /* 0x014B */ u8 envEffectTimer; /* 0x014C */ s16 actionTimer; /* 0x014E */ u8 actionState; - /* 0x014F */ u8 unk_14F; + /* 0x014F */ u8 whipCrackTimer; /* 0x0150 */ s16 timers[3]; - /* 0x0156 */ s16 unk_156; - /* 0x0158 */ s16 unk_158; - /* 0x015A */ s16 unk_15A; - /* 0x015C */ s16 unk_15C; - /* 0x015E */ s16 unk_15E; - /* 0x0160 */ s16 unk_160; - /* 0x0162 */ s16 unk_162; + /* 0x0156 */ s16 jumpSfxTimer; + /* 0x0158 */ s16 unk_158; // turns off collision + /* 0x015A */ s16 whipCollisionTimer; + /* 0x015C */ s16 invincibilityTimer; + /* 0x015E */ s16 dmgFogEffectTimer; + /* 0x0160 */ s16 motionBlurAlpha; + /* 0x0162 */ s16 unused_162; /* 0x0164 */ Vec3f moveTarget; - /* 0x0170 */ f32 unk_170; - /* 0x0174 */ u8 unk_174; - /* 0x0178 */ f32 unk_178; - /* 0x017C */ f32 unk_17C; - /* 0x0180 */ s16 unk_180; - /* 0x0184 */ f32 unk_184; - /* 0x0188 */ f32 unk_188; - /* 0x018C */ f32 unk_18C; + /* 0x0170 */ f32 vel_170; // move speed for wrath sidestep and spin, turn rate for all others + /* 0x0174 */ u8 canDodge; + /* 0x0178 */ f32 topSpinAngle; + /* 0x017C */ f32 topSpinRate; + /* 0x0180 */ s16 unk_180; // top precess angle and incarnation yaw target + /* 0x0184 */ f32 unk_184; // y rot during long whip attack + /* 0x0188 */ f32 unk_188; // x rot during long whip attack + /* 0x018C */ f32 flySpeedTarget; /* 0x0190 */ SkelAnime skelAnime; - /* 0x01D4 */ f32 unk_1D4; - /* 0x01D8 */ s32 unk_1D8; + /* 0x01D4 */ f32 animEndFrame; + /* 0x01D8 */ s32 bodyDecayRate; /* 0x01DC */ Vec3s jointTable[MAJORAS_LIMB_COUNT]; /* 0x0284 */ Vec3s morphTable[MAJORAS_LIMB_COUNT]; - /* 0x032C */ f32 unk_32C; - /* 0x0330 */ f32 unk_330; + /* 0x032C */ f32 unk_32C; // shock scale related + /* 0x0330 */ f32 unk_330; // shock scale related /* 0x0334 */ Vec3f bodyPartsPos[15]; - /* 0x03E8 */ ColliderJntSph sph1; - /* 0x0408 */ ColliderJntSphElement sphElems1[11]; - /* 0x06C8 */ ColliderJntSph sph2; - /* 0x06E8 */ ColliderJntSphElement sphElems2[1]; - /* 0x0728 */ ColliderCylinder cyl1; - /* 0x0774 */ u8 unk_774; - /* 0x0778 */ s32 unk_778; + /* 0x03E8 */ ColliderJntSph bodyCollider; + /* 0x0408 */ ColliderJntSphElement bodyElements[11]; + /* 0x06C8 */ ColliderJntSph kickCollider; + /* 0x06E8 */ ColliderJntSphElement kickElements[1]; + /* 0x0728 */ ColliderCylinder unusedCollider; + /* 0x0774 */ u8 activateRemains; + /* 0x0778 */ s32 whipTopIndex; // whip top spawn index /* 0x077C */ f32 whipScale; - /* 0x0780 */ s32 unk_780; - /* 0x0784 */ s32 unk_784; + /* 0x0780 */ s32 whipShockIndexHigh; // whip shock index + /* 0x0784 */ s32 whipShockIndexLow; // whip shock index /* 0x0788 */ Boss07Whip rightWhip; - /* 0x0F7C */ s16 unk_F7C; - /* 0x0F7E */ s16 unk_F7E; - /* 0x0F80 */ Vec3f unk_F80; + /* 0x0F7C */ s16 whipWrapIndex; + /* 0x0F7E */ s16 whipGrabIndex; + /* 0x0F80 */ Vec3f whipGrabPos; /* 0x0F8C */ f32 unk_F8C; /* 0x0F90 */ f32 unk_F90; /* 0x0F94 */ Boss07Whip leftWhip; - /* 0x1788 */ Vec3f unk_1788[2]; - /* 0x17A0 */ Vec3f unk_17A0; - /* 0x17AC */ Vec3f unk_17AC; - /* 0x17B8 */ f32 unk_17B8[4]; - /* 0x17C8 */ f32 unk_17C8[4]; - /* 0x17D8 */ s16 unk_17D8; - /* 0x17DA */ s16 unk_17DA; - /* 0x17DA */ s16 unk_17DC; - /* 0x17E0 */ f32 unk_17E0; - /* 0x17E4 */ f32 unk_17E4; - /* 0x17E8 */ f32 unk_17E8; - /* 0x17E8 */ f32 unk_17EC; - /* 0x17F0 */ f32 unk_17F0; - /* 0x17F4 */ f32 unk_17F4; - /* 0x17F8 */ f32 unk_17F8; - /* 0x17FC */ f32 unk_17FC; - /* 0x1800 */ f32 unk_1800; - /* 0x1804 */ u8 unk_1804; - /* 0x1805 */ u8 unk_1805; - /* 0x1806 */ s16 unk_1806; - /* 0x1808 */ u8 unk_1808; - /* 0x180c */ f32 unk_180C; - /* 0x1810 */ Vec3f unk_1810; - /* 0x181C */ s16 unk_181C; - /* 0x1820 */ ColliderCylinder cyl2; - /* 0x186C */ s16 unk_186C; - /* 0x1870 */ f32 unk_1870; - /* 0x1874 */ u8 unk_1874; - /* 0x1878 */ Vec3f unk_1878; - /* 0x1884 */ s32 unk_1884; - /* 0x1888 */ u8 unk_1888; - /* 0x188C */ f32 unk_188C; - /* 0x1890 */ f32 unk_1890; + /* 0x1788 */ Vec3f incFeetPos[2]; + /* 0x17A0 */ Vec3f incLeftHandPos; + /* 0x17AC */ Vec3f incRightHandPos; + /* 0x17B8 */ f32 unk_17B8[4]; // limb scale stuff in inc intro + /* 0x17C8 */ f32 unk_17C8[4]; // limb scale stuff in inc intro + /* 0x17D8 */ Vec3s csHeadRot; + /* 0x17E0 */ f32 armScale; + /* 0x17E4 */ f32 legScale; + /* 0x17E8 */ f32 unk_17E8; // limb pump average + /* 0x17E8 */ f32 unk_17EC; // limb pump amplitude + /* 0x17F0 */ f32 chestScaleY; + /* 0x17F4 */ f32 chestScaleX; + /* 0x17F8 */ f32 unk_17F8; // effect scale + /* 0x17FC */ f32 unk_17FC; // effect steam + /* 0x1800 */ f32 unk_1800; // effect alpha + /* 0x1804 */ u8 unk_1804; // damage effect type + /* 0x1805 */ u8 unk_1805; // damage state + /* 0x1806 */ s16 unk_1806; // timer related to damage + /* 0x1808 */ u8 lensFlareOn; + /* 0x180c */ f32 lensFlareScale; + /* 0x1810 */ Vec3f lensFlarePos; + /* 0x181C */ s16 shotColorIndex; + /* 0x1820 */ ColliderCylinder spawnCollider; + /* 0x186C */ s16 dmgShakeTimer; + /* 0x1870 */ f32 tentLengthScale; + /* 0x1874 */ u8 unk_1874; // wavy tentacles + /* 0x1878 */ Vec3f tentAttachPos; + /* 0x1884 */ s32 maskEyeState; + /* 0x1888 */ u8 noclipTimer; + /* 0x188C */ f32 eyeBeamsZscale; + /* 0x1890 */ f32 beamFocusOrbScale; /* 0x1894 */ f32 unk_1894; - /* 0x1898 */ f32 unk_1898; + /* 0x1898 */ f32 beamXYscale; /* 0x189C */ Vec3f unk_189C; /* 0x18A8 */ Vec3f unk_18A8; /* 0x18B4 */ Vec3f unk_18B4; /* 0x18C0 */ f32 unk_18C0; - /* 0x18C4 */ s16 unk_18C4; - /* 0x18C6 */ s16 unk_18C6; - /* 0x18C8 */ s16 unk_18C8; - /* 0x18CC */ f32 unk_18CC; - /* 0x18D0 */ f32 unk_18D0; - /* 0x18D4 */ s16 unk_18D4; - /* 0x18D6 */ s16 unk_18D6; - /* 0x18D8 */ s16 unk_18D8; - /* 0x18DA */ u8 unk_18DA; - /* 0x18DB */ u8 unk_18DB; + /* 0x18C4 */ s16 beamTargetPitch; + /* 0x18C6 */ s16 beamTargetYaw; + /* 0x18C8 */ s16 remainsOrbRot; + /* 0x18CC */ f32 xRecoil; + /* 0x18D0 */ f32 zRecoil; + /* 0x18D4 */ s16 spinVel; + /* 0x18D6 */ s16 timer_18D6; + /* 0x18D8 */ s16 beamDmgTimer; + /* 0x18DA */ u8 readyDeath; + /* 0x18DB */ u8 readyShot; /* 0x18DC */ s32 effectIndex; - /* 0x18E0 */ Vec3f unk_18E0; - /* 0x18EC */ u8 unk_18EC; - /* 0x18ED */ u8 unk_18ED; - /* 0x18F0 */ ColliderQuad quad1; - /* 0x1970 */ ColliderQuad quad2; + /* 0x18E0 */ Vec3f beamMarkLastPos; + /* 0x18EC */ u8 beamOn; + /* 0x18ED */ u8 beamOnLastFrame; + /* 0x18F0 */ ColliderQuad maskFrontCollider; + /* 0x1970 */ ColliderQuad maskBackCollider; /* 0x19F0 */ Boss07Tentacle tentacles[MAJORAS_TENT_MAX]; - /* 0xAB40 */ s16 unk_AB40; - /* 0xAB44 */ f32 unk_AB44; - /* 0xAB48 */ u8 unk_AB48; - /* 0xAB4C */ f32 unk_AB4C; + /* 0xAB40 */ s16 timer_AB40; + /* 0xAB44 */ f32 introOrbScale; + /* 0xAB48 */ u8 noShadow; + /* 0xAB4C */ f32 deathOrbScale; /* 0xAB50 */ f32 deathLightScale[30]; - /* 0xABC8 */ u32 unk_ABC8; - /* 0xABCC */ s32 unk_ABCC; + /* 0xABC8 */ u32 timer_ABC8; + /* 0xABCC */ s32 timer_ABCC; /* 0xABD0 */ s16 csState; /* 0xABD2 */ s16 subCamIndex; /* 0xABD4 */ Vec3f subCamEye; @@ -159,9 +157,9 @@ typedef struct Boss07 { /* 0xAC04 */ f32 subCamRotY; /* 0xAC08 */ f32 subCamRotVel; /* 0xAC0C */ f32 subCamSpeedMod; - /* 0xAC10 */ UNK_TYPE1 unkAC10; + /* 0xAC10 */ UNK_TYPE1 unkAC10[4]; // probably float /* 0xAC14 */ f32 subCamEyeModY; - /* 0xAC18 */ UNK_TYPE1 unkAC18[8]; + /* 0xAC18 */ UNK_TYPE1 unkAC18[8]; // probably floats } Boss07; // size = 0xAC20 extern const ActorInit Boss_07_InitVars; diff --git a/src/overlays/actors/ovl_Boss_07/z_boss_07_colchk.inc b/src/overlays/actors/ovl_Boss_07/z_boss_07_colchk.inc index 13cdf9dc0..eb8247096 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07_colchk.inc +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07_colchk.inc @@ -133,7 +133,7 @@ static ColliderJntSphInit sWrathJntSphInit1 = { OC2_TYPE_1, COLSHAPE_JNTSPH, }, - 11, + ARRAY_COUNT(sWrathJntSphElementsInit1), sWrathJntSphElementsInit1, }; @@ -180,7 +180,7 @@ static ColliderJntSphInit sWrathJntSphInit2 = { OC2_TYPE_1, COLSHAPE_JNTSPH, }, - 1, + ARRAY_COUNT(sWrathJntSphElementsInit2), sWrathJntSphElementsInit2, }; @@ -357,7 +357,7 @@ static ColliderJntSphInit sIncarnationJntSphInit1 = { OC2_TYPE_1, COLSHAPE_JNTSPH, }, - 11, + ARRAY_COUNT(sIncarnationJntSphElementsInit), sIncarnationJntSphElementsInit, }; From bd5c225fa8b320009182efa0260642043c11d3a1 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Tue, 6 Sep 2022 08:45:17 -0500 Subject: [PATCH 25/28] stuff --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 506 +++++++++++--------- 1 file changed, 280 insertions(+), 226 deletions(-) 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 b78d24897..30716e69f 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -36,61 +36,61 @@ typedef struct { } Boss07Effect; // size = 0x48 typedef enum { - MAJORAS_WRATH_DMGEFF_0, - MAJORAS_WRATH_DMGEFF_2 = 2, - MAJORAS_WRATH_DMGEFF_3, - MAJORAS_WRATH_DMGEFF_4, - MAJORAS_WRATH_DMGEFF_9 = 9, - MAJORAS_WRATH_DMGEFF_A, - MAJORAS_WRATH_DMGEFF_C = 0xC, - MAJORAS_WRATH_DMGEFF_D, - MAJORAS_WRATH_DMGEFF_E, - MAJORAS_WRATH_DMGEFF_F, + /* 0x0 */ MAJORAS_WRATH_DMGEFF_0, + /* 0x2 */ MAJORAS_WRATH_DMGEFF_2 = 2, + /* 0x3 */ MAJORAS_WRATH_DMGEFF_3, + /* 0x4 */ MAJORAS_WRATH_DMGEFF_4, + /* 0x9 */ MAJORAS_WRATH_DMGEFF_9 = 9, + /* 0xA */ MAJORAS_WRATH_DMGEFF_A, + /* 0xC */ MAJORAS_WRATH_DMGEFF_C = 0xC, + /* 0xD */ MAJORAS_WRATH_DMGEFF_D, + /* 0xE */ MAJORAS_WRATH_DMGEFF_E, + /* 0xF */ MAJORAS_WRATH_DMGEFF_F, } Boss07WrathDamageEffect; typedef enum { - MAJORAS_INCARNATION_DMGEFF_0, - MAJORAS_INCARNATION_DMGEFF_2 = 2, - MAJORAS_INCARNATION_DMGEFF_3, - MAJORAS_INCARNATION_DMGEFF_4, - MAJORAS_INCARNATION_DMGEFF_9 = 9, - MAJORAS_INCARNATION_DMGEFF_A, - MAJORAS_INCARNATION_DMGEFF_C = 0xC, - MAJORAS_INCARNATION_DMGEFF_D, - MAJORAS_INCARNATION_DMGEFF_E, - MAJORAS_INCARNATION_DMGEFF_F, + /* 0x0 */ MAJORAS_INCARNATION_DMGEFF_0, + /* 0x2 */ MAJORAS_INCARNATION_DMGEFF_2 = 2, + /* 0x3 */ MAJORAS_INCARNATION_DMGEFF_3, + /* 0x4 */ MAJORAS_INCARNATION_DMGEFF_4, + /* 0x9 */ MAJORAS_INCARNATION_DMGEFF_9 = 9, + /* 0xA */ MAJORAS_INCARNATION_DMGEFF_A, + /* 0xC */ MAJORAS_INCARNATION_DMGEFF_C = 0xC, + /* 0xD */ MAJORAS_INCARNATION_DMGEFF_D, + /* 0xE */ MAJORAS_INCARNATION_DMGEFF_E, + /* 0xF */ MAJORAS_INCARNATION_DMGEFF_F, } Boss07IncarnationDamageEffect; typedef enum { - MAJORAS_MASK_DMGEFF_0, - MAJORAS_MASK_DMGEFF_2 = 2, - MAJORAS_MASK_DMGEFF_3, - MAJORAS_MASK_DMGEFF_4, - MAJORAS_MASK_DMGEFF_9 = 9, - MAJORAS_MASK_DMGEFF_F = 0xF, + /* 0x0 */ MAJORAS_MASK_DMGEFF_0, + /* 0x2 */ MAJORAS_MASK_DMGEFF_2 = 2, + /* 0x3 */ MAJORAS_MASK_DMGEFF_3, + /* 0x4 */ MAJORAS_MASK_DMGEFF_4, + /* 0x9 */ MAJORAS_MASK_DMGEFF_9 = 9, + /* 0xF */ MAJORAS_MASK_DMGEFF_F = 0xF, } Boss07MaskDamageEffect; typedef enum { - MAJORAS_REMAINS_DMGEFF_0, - MAJORAS_REMAINS_DMGEFF_2 = 2, - MAJORAS_REMAINS_DMGEFF_3, - MAJORAS_REMAINS_DMGEFF_4, - MAJORAS_REMAINS_DMGEFF_9 = 9, - MAJORAS_REMAINS_DMGEFF_A, - MAJORAS_REMAINS_DMGEFF_C = 0xC, - MAJORAS_REMAINS_DMGEFF_D, - MAJORAS_REMAINS_DMGEFF_E, - MAJORAS_REMAINS_DMGEFF_F, + /* 0x0 */ MAJORAS_REMAINS_DMGEFF_0, + /* 0x2 */ MAJORAS_REMAINS_DMGEFF_2 = 2, + /* 0x3 */ MAJORAS_REMAINS_DMGEFF_3, + /* 0x4 */ MAJORAS_REMAINS_DMGEFF_4, + /* 0x9 */ MAJORAS_REMAINS_DMGEFF_9 = 9, + /* 0xA */ MAJORAS_REMAINS_DMGEFF_A, + /* 0xC */ MAJORAS_REMAINS_DMGEFF_C = 0xC, + /* 0xD */ MAJORAS_REMAINS_DMGEFF_D, + /* 0xE */ MAJORAS_REMAINS_DMGEFF_E, + /* 0xF */ MAJORAS_REMAINS_DMGEFF_F, } Boss07RemainsDamageEffect; typedef enum { - MAJORAS_TOP_DMGEFF_0, - MAJORAS_TOP_DMGEFF_A = 0xA, - MAJORAS_TOP_DMGEFF_B, - MAJORAS_TOP_DMGEFF_C, - MAJORAS_TOP_DMGEFF_D, - MAJORAS_TOP_DMGEFF_E, - MAJORAS_TOP_DMGEFF_F, + /* 0x0 */ MAJORAS_TOP_DMGEFF_0, + /* 0xA */ MAJORAS_TOP_DMGEFF_A = 0xA, + /* 0xB */ MAJORAS_TOP_DMGEFF_B, + /* 0xC */ MAJORAS_TOP_DMGEFF_C, + /* 0xD */ MAJORAS_TOP_DMGEFF_D, + /* 0xE */ MAJORAS_TOP_DMGEFF_E, + /* 0xF */ MAJORAS_TOP_DMGEFF_F, } Boss07TopDamageEffect; typedef enum { @@ -107,124 +107,137 @@ typedef enum { } Boss07EffectType; typedef enum { - MAJORAS_WRATH_QUICK_WHIP, - MAJORAS_WRATH_FLURRY, - MAJORAS_WRATH_DOUBLE_WHIP, - MAJORAS_WRATH_LONG_WHIP, - MAJORAS_WRATH_SPIN_ATTACK, - MAJORAS_WRATH_TAUNT, - MAJORAS_WRATH_THREE_HIT, - MAJORAS_WRATH_KICK, - MAJORAS_WRATH_ATTACK_MAX, + /* 0 */ MAJORAS_WRATH_QUICK_WHIP, + /* 1 */ MAJORAS_WRATH_FLURRY, + /* 2 */ MAJORAS_WRATH_DOUBLE_WHIP, + /* 3 */ MAJORAS_WRATH_LONG_WHIP, + /* 4 */ MAJORAS_WRATH_SPIN_ATTACK, + /* 5 */ MAJORAS_WRATH_TAUNT, + /* 6 */ MAJORAS_WRATH_THREE_HIT, + /* 7 */ MAJORAS_WRATH_KICK, + /* 8 */ MAJORAS_WRATH_ATTACK_MAX, } Boss07WrathActionState; typedef enum { - MAJORAS_INCARNATION_STATE_0, - MAJORAS_INCARNATION_STATE_1, - MAJORAS_INCARNATION_STATE_2, - MAJORAS_INCARNATION_STATE_MAX, + /* 0 */ MAJORAS_INCARNATION_STATE_0, + /* 1 */ MAJORAS_INCARNATION_STATE_1, + /* 2 */ MAJORAS_INCARNATION_STATE_2, + /* 3 */ MAJORAS_INCARNATION_STATE_MAX, } Boss07IncarnationActionState; typedef enum { - MAJORAS_MASK_SPIN_START, - MAJORAS_MASK_SPIN_ATTACK, - MAJORAS_MASK_SPIN_END, - MAJORAS_MASK_SPIN_STATE_MAX, + /* 0 */ MAJORAS_MASK_SPIN_START, + /* 1 */ MAJORAS_MASK_SPIN_ATTACK, + /* 2 */ MAJORAS_MASK_SPIN_END, + /* 3 */ MAJORAS_MASK_SPIN_STATE_MAX, } Boss07MaskSpinState; typedef enum { - MAJORAS_MASK_BEAM_CHARGE, - MAJORAS_MASK_BEAM_EYES, - MAJORAS_MASK_BEAM_FOCUS, - MAJORAS_MASK_BEAM_ACTIVE, - MAJORAS_MASK_BEAM_REFLECT, - MAJORAS_MASK_BEAM_END, - MAJORAS_MASK_BEAM_STATE_MAX, + /* 0 */ MAJORAS_MASK_BEAM_CHARGE, + /* 1 */ MAJORAS_MASK_BEAM_EYES, + /* 2 */ MAJORAS_MASK_BEAM_FOCUS, + /* 3 */ MAJORAS_MASK_BEAM_ACTIVE, + /* 4 */ MAJORAS_MASK_BEAM_REFLECT, + /* 5 */ MAJORAS_MASK_BEAM_END, + /* 6 */ MAJORAS_MASK_BEAM_STATE_MAX, } Boss07MaskBeamState; typedef enum { - MAJORAS_PROJECTILE_STATE_0, - MAJORAS_PROJECTILE_STATE_1, - MAJORAS_PROJECTILE_STATE_MAX, + /* 0 */ MAJORAS_PROJECTILE_STATE_0, + /* 1 */ MAJORAS_PROJECTILE_STATE_1, + /* 2 */ MAJORAS_PROJECTILE_STATE_MAX, } Boss07ProjectileState; typedef enum { - MAJORAS_REMAINS_WAIT, - MAJORAS_REMAINS_FLY, - MAJORAS_REMAINS_DEATH, - MAJORAS_REMAINS_GONE, - MAJORAS_REMAINS_DAMAGED = 10, - MAJORAS_REMAINS_ACTIVATE = 20, + /* 0 */ MAJORAS_REMAINS_WAIT, + /* 1 */ MAJORAS_REMAINS_FLY, + /* 2 */ MAJORAS_REMAINS_DEATH, + /* 3 */ MAJORAS_REMAINS_GONE, + /* 10 */ MAJORAS_REMAINS_DAMAGED = 10, + /* 20 */ MAJORAS_REMAINS_ACTIVATE = 20, } Boss07RemainsState; typedef enum { - MAJORAS_REMAINS_CS_WAIT, - MAJORAS_REMAINS_CS_FLY, - MAJORAS_REMAINS_CS_ATTACH_WAIT, - MAJORAS_REMAINS_CS_ATTACH, + /* 0 */ MAJORAS_REMAINS_CS_WAIT, + /* 1 */ MAJORAS_REMAINS_CS_FLY, + /* 2 */ MAJORAS_REMAINS_CS_ATTACH_WAIT, + /* 3 */ MAJORAS_REMAINS_CS_ATTACH, } Boss07RemainsCsState; typedef enum { - MAJORAS_TOP_IN_AIR, - MAJORAS_TOP_ON_GROUND, - MAJORAS_TOP_STATE_MAX, + /* 0 */ MAJORAS_TOP_IN_AIR, + /* 1 */ MAJORAS_TOP_ON_GROUND, + /* 2 */ MAJORAS_TOP_STATE_MAX, } Boss07TopStates; typedef enum { - MAJORAS_MASK_INTRO_STATE_0, - MAJORAS_MASK_INTRO_STATE_1, - MAJORAS_MASK_INTRO_STATE_2, - MAJORAS_MASK_INTRO_STATE_3, - MAJORAS_MASK_INTRO_STATE_4, + /* 0 */ MAJORAS_MASK_INTRO_STATE_0, + /* 1 */ MAJORAS_MASK_INTRO_STATE_1, + /* 2 */ MAJORAS_MASK_INTRO_STATE_2, + /* 3 */ MAJORAS_MASK_INTRO_STATE_3, + /* 4 */ MAJORAS_MASK_INTRO_STATE_4, } Boss07MaskIntroState; typedef enum { - MAJORAS_MASK_DEATH_STATE_0, - MAJORAS_MASK_DEATH_STATE_1, - MAJORAS_MASK_DEATH_STATE_2, - MAJORAS_MASK_DEATH_STATE_3, - MAJORAS_MASK_DEATH_STATE_4, + /* 0 */ MAJORAS_MASK_DEATH_STATE_0, + /* 1 */ MAJORAS_MASK_DEATH_STATE_1, + /* 2 */ MAJORAS_MASK_DEATH_STATE_2, + /* 3 */ MAJORAS_MASK_DEATH_STATE_3, + /* 4 */ MAJORAS_MASK_DEATH_STATE_4, } Boss07MaskDeathState; typedef enum { - MAJORAS_INCARNATION_INTRO_STATE_0, - MAJORAS_INCARNATION_INTRO_STATE_1, - MAJORAS_INCARNATION_INTRO_STATE_2, - MAJORAS_INCARNATION_INTRO_STATE_3, - MAJORAS_INCARNATION_INTRO_STATE_4, - MAJORAS_INCARNATION_INTRO_STATE_5, + /* 0 */ MAJORAS_INCARNATION_INTRO_STATE_0, + /* 1 */ MAJORAS_INCARNATION_INTRO_STATE_1, + /* 2 */ MAJORAS_INCARNATION_INTRO_STATE_2, + /* 3 */ MAJORAS_INCARNATION_INTRO_STATE_3, + /* 4 */ MAJORAS_INCARNATION_INTRO_STATE_4, + /* 5 */ MAJORAS_INCARNATION_INTRO_STATE_5, } Boss07IncarnationIntroState; typedef enum { - MAJORAS_INCARNATION_DEATH_STATE_0, - MAJORAS_INCARNATION_DEATH_STATE_1, - MAJORAS_INCARNATION_DEATH_STATE_2, - MAJORAS_INCARNATION_DEATH_STATE_3, - MAJORAS_INCARNATION_DEATH_STATE_4, - MAJORAS_INCARNATION_DEATH_STATE_10 = 10, + /* 0 */ MAJORAS_INCARNATION_DEATH_STATE_0, + /* 1 */ MAJORAS_INCARNATION_DEATH_STATE_1, + /* 2 */ MAJORAS_INCARNATION_DEATH_STATE_2, + /* 3 */ MAJORAS_INCARNATION_DEATH_STATE_3, + /* 4 */ MAJORAS_INCARNATION_DEATH_STATE_4, + /* 10 */ MAJORAS_INCARNATION_DEATH_STATE_10 = 10, } Boss07IncarnationDeathState; typedef enum { - MAJORAS_WRATH_INTRO_STATE_0, - MAJORAS_WRATH_INTRO_STATE_1, + /* 0 */ MAJORAS_WRATH_INTRO_STATE_0, + /* 1 */ MAJORAS_WRATH_INTRO_STATE_1, } Boss07WrathIntroState; typedef enum { - MAJORAS_WRATH_DEATH_STATE_0, - MAJORAS_WRATH_DEATH_STATE_1, - MAJORAS_WRATH_DEATH_STATE_2, - MAJORAS_WRATH_DEATH_STATE_3, - MAJORAS_WRATH_DEATH_STATE_4, + /* 0 */ MAJORAS_WRATH_DEATH_STATE_0, + /* 1 */ MAJORAS_WRATH_DEATH_STATE_1, + /* 2 */ MAJORAS_WRATH_DEATH_STATE_2, + /* 3 */ MAJORAS_WRATH_DEATH_STATE_3, + /* 4 */ MAJORAS_WRATH_DEATH_STATE_4, } Boss07WrathDeathState; typedef enum { - MAJORAS_STATIC_CS_STATE_0, - MAJORAS_STATIC_CS_STATE_1, - MAJORAS_STATIC_CS_STATE_2, - MAJORAS_STATIC_CS_STATE_3, - MAJORAS_STATIC_CS_STATE_4, - MAJORAS_STATIC_CS_STATE_5, - MAJORAS_STATIC_CS_STATE_6, + /* 0 */ MAJORAS_DAMAGE_STATE_0, + /* 1 */ MAJORAS_DAMAGE_STATE_1, + /* 2 */ MAJORAS_DAMAGE_STATE_2, + /* 10 */ MAJORAS_DAMAGE_STATE_10 = 10, + /* 11 */ MAJORAS_DAMAGE_STATE_11, + /* 20 */ MAJORAS_DAMAGE_STATE_20 = 20, + /* 21 */ MAJORAS_DAMAGE_STATE_21, + /* 30 */ MAJORAS_DAMAGE_STATE_30 = 30, + /* 40 */ MAJORAS_DAMAGE_STATE_40 = 40, + /* 41 */ MAJORAS_DAMAGE_STATE_41, +} Boss07DamageState; + +typedef enum { + /* 0 */ MAJORAS_STATIC_CS_STATE_0, + /* 1 */ MAJORAS_STATIC_CS_STATE_1, + /* 2 */ MAJORAS_STATIC_CS_STATE_2, + /* 3 */ MAJORAS_STATIC_CS_STATE_3, + /* 4 */ MAJORAS_STATIC_CS_STATE_4, + /* 5 */ MAJORAS_STATIC_CS_STATE_5, + /* 6 */ MAJORAS_STATIC_CS_STATE_6, } Boss07StaticCsState; #if 1 // function prototypes @@ -639,7 +652,7 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { play->specialEffects = (void*)sEffects; for (i = 0; i < ARRAY_COUNT(sEffects); i++) { - sEffects[i].type = 0; + sEffects[i].type = MAJORAS_EFFECT_NONE; } for (i = 0; i < ARRAY_COUNT(sBossRemains); i++) { sBossRemains[i] = NULL; @@ -757,7 +770,7 @@ void Boss07_Init(Actor* thisx, PlayState* play2) { } else { Boss07_Incarnation_SetupTaunt(this, play); this->envEffectOn = 1; - for (i = 0; i < 4; i++) { + for (i = 0; i < ARRAY_COUNT(this->unk_17B8); i++) { this->unk_17B8[i] = 1.0f; } play->envCtx.lightBlend = 0.0f; @@ -802,6 +815,7 @@ void Boss07_Destroy(Actor* thisx, PlayState* play2) { Boss07* this = THIS; switch (this->actor.params) { + //! @bug this should be MAJORAS_MASK case MAJORAS_WRATH: Collider_DestroyQuad(play, &this->maskFrontCollider); Collider_DestroyQuad(play, &this->maskBackCollider); @@ -947,7 +961,7 @@ void Boss07_Wrath_SetupDeath(Boss07* this, PlayState* play) { this->csState = MAJORAS_WRATH_DEATH_STATE_0; this->timer_ABC8 = 0; if (sBossRemains[REMAINS_ODOLWA] != NULL) { - for (i = 0; i < 4; i++) { + for (i = 0; i < ARRAY_COUNT(sBossRemains); i++) { sBossRemains[i]->actionState = MAJORAS_REMAINS_DEATH; } } @@ -1102,7 +1116,9 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { sp98 = 5.0f; sp94 = 0.1f; temp_a0 = (this->timer_ABC8 * 2) - 700; - if (temp_a0 > 250) temp_a0 = 250; + if (temp_a0 > 250) { + temp_a0 = 250; + } play->envCtx.screenFillColor[3] = temp_a0; if (this->timer_ABC8 == 400) { @@ -1127,8 +1143,10 @@ void Boss07_Wrath_Death(Boss07* this, PlayState* play) { } this->subCamRotY += this->subCamRotVel; this->subCamRotVel += 0.0004f; - if (this->subCamRotVel > 0.02f) this->subCamRotVel = 0.02f; - + if (this->subCamRotVel > 0.02f) { + this->subCamRotVel = 0.02f; + } + if (this->timer_ABC8 >= (sREG(93) + 180)) { Vec3f sp84 = { 0.0f, 10.0f, 0.0f }; Vec3f sp78 = { 0.0f, -0.5f, 0.0f }; @@ -1745,8 +1763,9 @@ void Boss07_Wrath_SpawnTop(Boss07* this, PlayState* play) { this->whipCollisionTimer = 20; if (this->actionTimer < (s16)(KREG(40) + 14)) { this->whipTopIndex += 6; - if (this->whipTopIndex > 44) this->whipTopIndex = 44; - + if (this->whipTopIndex > 44) { + this->whipTopIndex = 44; + } } if (this->actionTimer == 8) { Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, this->actor.world.pos.y, @@ -1765,8 +1784,9 @@ void Boss07_Wrath_SpawnTop(Boss07* this, PlayState* play) { if ((this->actionTimer >= (s16)(KREG(40) + 14)) && ((this->actionTimer <= (s16)(KREG(41) + 17)) || ((s16)(KREG(42) + 21) <= this->actionTimer))) { this->whipTopIndex -= KREG(39) + 5; - if (this->whipTopIndex < 0) this->whipTopIndex = 0; - + if (this->whipTopIndex < 0) { + this->whipTopIndex = 0; + } } Math_ApproachS(&this->actor.shape.rot.y, KREG(8) * 0x100 + this->actor.yawTowardsPlayer + 0xF00, 3, 0x2000); Boss07_SmoothStop(this, 2.0f); @@ -2014,7 +2034,7 @@ void Boss07_Wrath_BreakIce(Boss07* this, PlayState* play) { s32 i; SoundSource_PlaySfxAtFixedWorldPos(play, this->bodyPartsPos, 30, NA_SE_EV_ICE_BROKEN); - for (i = 0; i < 30; i++) { + for (i = 0; i < 2 * ARRAY_COUNT(this->bodyPartsPos); i++) { vel.x = randPlusMinusPoint5Scaled(7.0f); vel.z = randPlusMinusPoint5Scaled(7.0f); vel.y = Rand_ZeroFloat(6.0f) + 4.0f; @@ -2030,19 +2050,19 @@ void Boss07_DamageEffects(Boss07* this, PlayState* play) { DECR(this->unk_1806); switch (this->unk_1805) { - case 0: + case MAJORAS_DAMAGE_STATE_0: this->unk_1804 = 0; this->unk_1806 = 0; this->unk_1800 = 0.0f; break; - case 1: + case MAJORAS_DAMAGE_STATE_1: this->unk_1804 = 0; this->unk_1806 = 40; this->unk_1800 = 1.0f; this->unk_17F8 = 0.0f; this->unk_1805++; Actor_SetColorFilter(&this->actor, 0x4000, 120, 0, 60); - case 2: + case MAJORAS_DAMAGE_STATE_2: if (this->unk_1806 == 0) { Math_ApproachZeroF(&this->unk_1800, 1.0f, 0.02f); if (this->unk_1800 == 0.0f) { @@ -2052,14 +2072,14 @@ void Boss07_DamageEffects(Boss07* this, PlayState* play) { Math_ApproachF(&this->unk_17F8, 1.0f, 0.1f, 0.5f); } break; - case 10: + case MAJORAS_DAMAGE_STATE_10: this->unk_1804 = 11; this->unk_1806 = 40; this->unk_1800 = 1.0f; this->unk_17FC = 1.0f; this->unk_17F8 = 0.0f; this->unk_1805++; - case 11: + case MAJORAS_DAMAGE_STATE_11: if (this->unk_1806 == 0) { Boss07_Wrath_BreakIce(this, play); this->unk_1805 = 0; @@ -2072,19 +2092,19 @@ void Boss07_DamageEffects(Boss07* this, PlayState* play) { } break; if (1) { - case 20: + case MAJORAS_DAMAGE_STATE_20: this->unk_1804 = 20; this->unk_1806 = 40; this->unk_17F8 = 1.0f; } else { - case 30: + case MAJORAS_DAMAGE_STATE_30: this->unk_1804 = 21; this->unk_1806 = 40; this->unk_17F8 = 3.0f; } this->unk_1800 = 1.0f; - this->unk_1805 = 21; - case 21: + this->unk_1805 = MAJORAS_DAMAGE_STATE_21; + case MAJORAS_DAMAGE_STATE_21: if (this->unk_1806 == 0) { Math_ApproachZeroF(&this->unk_17F8, 1.0f, 0.03f); if (this->unk_17F8 == 0.0f) { @@ -2095,13 +2115,13 @@ void Boss07_DamageEffects(Boss07* this, PlayState* play) { Math_ApproachF(&this->unk_17F8, 1.5f, 0.5f, 0.5f); } break; - case 40: + case MAJORAS_DAMAGE_STATE_40: this->unk_1804 = 30; this->unk_1806 = 50; this->unk_1800 = 1.0f; this->unk_17F8 = (KREG(18) * 0.1f) + 1.0f; this->unk_1805++; - case 41: + case MAJORAS_DAMAGE_STATE_41: if (this->unk_1806 == 0) { Math_ApproachZeroF(&this->unk_17F8, 1.0f, 0.05f); if (this->unk_17F8 == 0.0f) { @@ -2238,10 +2258,10 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { } /** - * Whip physics works by first assuming each point moves freely, using its current velocity and various forces to find - * the next position. Then, starting from the base of the whip, each point is moved radially away from the previous - * point until it is a fixed distance away. The new velocity of each point is found from the scaled difference between - * its updated position and previous position. The forces applied are + * The whip physics model works by first assuming each point moves freely, using its current velocity and various forces + * to find the next position. Then, starting from the base of the whip, each point is moved away from the previous point + * until it is a fixed distance away. The new velocity of each point is found from the scaled difference between its + * updated position and previous position. The forces applied are * - drag, which reduces the magnitude of each velocity component by a fixed amount (or to zero if smaller) * - gravity, which applies to the y-component of velocity * - tension, an outward force that makes the whip "crack" @@ -2249,13 +2269,14 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { * The scaling factor of the velocity is the whip's mobility--how well movements at the base are transmitted to the * ends. * - * The whip physics algorithm is as follows: + * The algorithm used to implement this physics model is as follows: * - Set the position of the 0th point to the position of Wrath's hand (base) - * - Move each component of each point's velocity towards 0 by drag. Set it to zero if the magnitude is less than drag. - * - Calculate the tension force. This is away from Wrath's hand (baserot) for whip movements, in the direction Wrath - * is facing for grab and throw movements. + * - Move each component of each point's velocity towards 0 by drag. Set that component to zero if the magnitude is less + * than drag. + * - Calculate the tension force. This points away from Wrath's hand (baserot) for whip movements and towards Link when + * grabbed * - Calculate shaping forces. These are the force from Wrath's hand on the whip base and the force that wraps the whip - * around grabbed objects. Set tension to 0 for the latter segments. + * around Link. Set tension to 0 for the latter segments. * - Calculate the provisional position of the point by applying the velocity, forces, and gravity. For the y-component, * set a minimum of 2 to not clip through the floor. * - Subtract the current position of the previous point along the whip from the calculated position to get the relative @@ -2265,7 +2286,7 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { * get the final position of the point. * - For grab and throw movements, update the position of the grab point. * - The point's final velocity is the difference between its current and previous positions, scaled by mobility and - * capped at 200. + * with each component's magnitude capped at 200. */ void Boss07_Wrath_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* pos, Vec3f* rot, Vec3f* vel, @@ -2285,7 +2306,7 @@ void Boss07_Wrath_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* Vec3f shapeForce; Vec3f tensForce; - baseSegVec.z = 22.0f * scale; + baseSegVec.z = 22.0f * scale; // sets the fixed length of each whip segment for (i = 0; i < (s16)sWhipSegCount; i++, vel++) { if (i == 0) { @@ -2297,13 +2318,17 @@ void Boss07_Wrath_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* } } spAC.z = 20.0f; + + // calculates rotation away from Wrath's hand Matrix_RotateYS(baseRot->y, MTXMODE_NEW); Matrix_RotateXS(baseRot->x, MTXMODE_APPLY); Matrix_RotateZS(baseRot->z, MTXMODE_APPLY); Matrix_RotateYS(0x4000, MTXMODE_APPLY); + Matrix_MultVecZ(spAC.z, &handForce); if (grabIndex != 0) { spAC.z = 200.0f; + // replaces the tension direction with the direction from Wrath's hand to Link Matrix_RotateYF(this->unk_F8C, MTXMODE_NEW); Matrix_RotateXFApply(this->unk_F90); } else { @@ -2318,10 +2343,12 @@ void Boss07_Wrath_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* for (i = 1; i < (s16)sWhipSegCount; i++, vel++, pos++, rot++) { if (i < 6) { + // keeps the whip outward from Wrath's hand near the base shapeForce.x = (6 - i) * handForce.x * 0.2f; shapeForce.y = (6 - i) * handForce.y * 0.2f; shapeForce.z = (6 - i) * handForce.z * 0.2f; } else if (grabIndex != 0) { + // wraps the whip around Link if (grabIndex <= i && i < (s16)(grabIndex + this->whipWrapIndex)) { shapeForce.y = 0.0f; shapeForce.x = sinf(this->actor.yawTowardsPlayer * M_PI / 0x8000 + (j * 1.4f)) * 100.0f; @@ -2332,20 +2359,30 @@ void Boss07_Wrath_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* } else { shapeForce = gZeroVec3f; } + + // Advances the physics one frame to find the provisional position relative to the previous point tempPos.x = pos->x + vel->x - (pos - 1)->x + shapeForce.x + tensForce.x; tempY = pos->y + vel->y + gravity + shapeForce.y + tensForce.y; - if (tempY < 2.0f) tempY = 2.0f; + if (tempY < 2.0f) { + tempY = 2.0f; + } // tempY = CLAMP_MIN(tempY, 2.0f); tempPos.y = tempY - (pos - 1)->y; tempPos.z = pos->z + vel->z - (pos - 1)->z + shapeForce.z + tensForce.z; + + // calculates the rotation angles from the previous point segYaw = Math_Acot2F(tempPos.z, tempPos.x); segPitch = -Math_Acot2F(sqrtf(SQ(tempPos.x) + SQ(tempPos.z)), tempPos.y); (rot - 1)->y = segYaw; (rot - 1)->x = segPitch; + + // Sets the position to be in the same direction as the provisional position relative to the previous point, but + // a fixed distance away Matrix_RotateYF(segYaw, MTXMODE_NEW); Matrix_RotateXFApply(segPitch); Matrix_MultVecZ(baseSegVec.z, &segVec); // if (1) {} + tempPos.x = pos->x; tempPos.y = pos->y; tempPos.z = pos->z; @@ -2355,6 +2392,7 @@ void Boss07_Wrath_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* pos->z = (pos - 1)->z + segVec.z; if ((i != 0) && (i == grabIndex)) { + // Updates the grab point for when Link is grabbed spAC.x = 15.0f; spAC.y = -30.0f; spAC.z = -12.0f; @@ -2363,6 +2401,7 @@ void Boss07_Wrath_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* this->whipGrabPos.y = pos->y + segVec.y; this->whipGrabPos.z = pos->z + segVec.z; } else if ((hand == RIGHT_HAND) && (this->actionFunc == Boss07_Wrath_SpawnTop)) { + // Updates the grab point when throwing a top if (i == KREG(90) + sWhipSegCount - this->whipTopIndex + 1) { spAC.x = KREG(60); spAC.y = KREG(61); @@ -2373,12 +2412,18 @@ void Boss07_Wrath_UpdateWhips(Boss07* this, PlayState* play, Vec3f* base, Vec3f* this->whipGrabPos.z = pos->z + segVec.z; } } + + // calculates the velocity for the next frame vel->x = (pos->x - tempPos.x) * mobility; vel->y = (pos->y - tempPos.y) * mobility; vel->z = (pos->z - tempPos.z) * mobility; - #define CLAMP_VAR(x, xmin, xmax) if (x > (xmax)) x = (xmax);if (x < (xmin)) x = (xmin) - +#define CLAMP_VAR(x, xmin, xmax) \ + if (x > (xmax)) \ + x = (xmax); \ + if (x < (xmin)) \ + x = (xmin) + // if (vel->x > 200.0f) vel->x = 200.0f;if (vel->x < -200.0f) vel->x = -200.0f; CLAMP_VAR(vel->x, -200.0f, 200.0f); CLAMP_VAR(vel->y, -200.0f, 200.0f); @@ -2659,7 +2704,6 @@ void Boss07_Wrath_Draw(Actor* thisx, PlayState* play2) { u8* shadowTex = GRAPH_ALLOC(play->state.gfxCtx, sizeof(u8[0x40][0x40])); OPEN_DISPS(play->state.gfxCtx); - Vec3f sp58; func_8012C28C(play->state.gfxCtx); func_8012C2DC(play->state.gfxCtx); @@ -2669,8 +2713,8 @@ void Boss07_Wrath_Draw(Actor* thisx, PlayState* play2) { Matrix_RotateYF(this->unk_184, MTXMODE_APPLY); Matrix_RotateXFApply(this->unk_188); SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, - (s32)this->skelAnime.dListCount, Boss07_Wrath_OverrideLimbDraw, - Boss07_Wrath_PostLimbDraw, Boss07_Wrath_TransformLimbDraw, &this->actor); + this->skelAnime.dListCount, Boss07_Wrath_OverrideLimbDraw, Boss07_Wrath_PostLimbDraw, + Boss07_Wrath_TransformLimbDraw, &this->actor); POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP); if (((KREG(63) == 0) || (KREG(63) == 2)) && this->updateWhips) { @@ -2690,11 +2734,14 @@ void Boss07_Wrath_Draw(Actor* thisx, PlayState* play2) { Boss07_Wrath_DrawShadowTex(shadowTex, this, play); } Boss07_Wrath_DrawShocks(this, play); - sp58.x = this->bodyPartsPos[2].x; - sp58.y = this->bodyPartsPos[2].y - 30.0f + 50.0f; - sp58.z = this->bodyPartsPos[2].z; - Boss07_Wrath_DrawDeathLights(this, play, &sp58); - Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, + { + Vec3f sp58; + sp58.x = this->bodyPartsPos[2].x; + sp58.y = this->bodyPartsPos[2].y - 30.0f + 50.0f; + sp58.z = this->bodyPartsPos[2].z; + Boss07_Wrath_DrawDeathLights(this, play, &sp58); + } + Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, 15, this->unk_17F8, this->unk_17FC, this->unk_1800, this->unk_1804); this->updateWhips = false; CLOSE_DISPS(play->state.gfxCtx); @@ -2735,41 +2782,41 @@ void Boss07_Wrath_MakeShadowCircles(Boss07* this, u8* shadowTex, f32 weight) { sp68.x *= 0.2f; sp68.y *= 0.2f; - temp_t0 = (u16)(s32)(sp68.x + 32.0f); - temp_t1 = (u16)((s32)sp68.y << 6); + temp_t0 = (u16)(s32)(sp68.x + 32); + temp_t1 = (u16)((s32)sp68.y * 64); if (sShadowSize[i] == 2) { - for (j = 0, phi_a3 = -0x180; j < 12; j++, phi_a3 += 0x40) { + for (j = 0, phi_a3 = -6 * 0x40; j < ARRAY_COUNT(sShadowWidths12); j++, phi_a3 += 0x40) { for (phi_a0 = -sShadowWidths12[j]; phi_a0 < sShadowWidths12[j]; phi_a0++) { temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; - if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { + if ((temp_v0 >= 0) && (temp_v0 < 0x40 * 0x40)) { shadowTex[temp_v0] = 255; } } } } else if (sShadowSize[i] == 1) { - for (j = 0, phi_a3 = -0x100; j < 8; j++, phi_a3 += 0x40) { + for (j = 0, phi_a3 = -4 * 0x40; j < ARRAY_COUNT(sShadowWidths8); j++, phi_a3 += 0x40) { for (phi_a0 = -sShadowWidths8[j]; phi_a0 < sShadowWidths8[j]; phi_a0++) { temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; - if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { + if ((temp_v0 >= 0) && (temp_v0 < 0x40 * 0x40)) { shadowTex[temp_v0] = 255; } } } } else if (sShadowSize[i] == 0) { - for (j = 0, phi_a3 = -0xC0; j < 7; j++, phi_a3 += 0x40) { + for (j = 0, phi_a3 = -3 * 0x40; j < ARRAY_COUNT(sShadowWidths7); j++, phi_a3 += 0x40) { for (phi_a0 = -sShadowWidths7[j]; phi_a0 < sShadowWidths7[j] - 1; phi_a0++) { temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; - if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { + if ((temp_v0 >= 0) && (temp_v0 < 0x40 * 0x40)) { shadowTex[temp_v0] = 255; } } } } else { - for (j = 0, phi_a3 = -0x80; j < 6; j++, phi_a3 += 0x40) { + for (j = 0, phi_a3 = -2 * 0x40; j < ARRAY_COUNT(sShadowWidths6); j++, phi_a3 += 0x40) { for (phi_a0 = -sShadowWidths6[j]; phi_a0 < sShadowWidths6[j] - 1; phi_a0++) { temp_v0 = temp_t0 + phi_a0 + temp_t1 + phi_a3; - if ((temp_v0 >= 0) && (temp_v0 < 0x1000)) { + if ((temp_v0 >= 0) && (temp_v0 < 0x40 * 0x40)) { shadowTex[temp_v0] = 255; } } @@ -2783,11 +2830,12 @@ void Boss07_Wrath_MakeShadowTex(u8* shadowTex, Boss07* this, PlayState* play) { s32 i; s32* shadowTex32 = (s32*)shadowTex; - for (i = 0; i < 0x400; i++, shadowTex32++) { + for (i = 0; i < 0x40 * 0x40 / sizeof(s32); i++, shadowTex32++) { *shadowTex32 = 0; } + // angle of light source Matrix_RotateXFNew(1.0f); - for (i = 0; i < 6; i++) { + for (i = 0; i <= 5; i++) { Boss07_Wrath_MakeShadowCircles(this, shadowTex, i / 5.0f); } } @@ -2795,14 +2843,14 @@ void Boss07_Wrath_MakeShadowTex(u8* shadowTex, Boss07* this, PlayState* play) { void Boss07_Wrath_DrawShadowTex(u8* shadowTex, Boss07* this, PlayState* play) { s32 pad[2]; f32 phi_f0; - GraphicsContext* pad3 = play->state.gfxCtx; + GraphicsContext* gfxCtx = play->state.gfxCtx; - OPEN_DISPS(pad3); + OPEN_DISPS(gfxCtx); func_8012C28C(play->state.gfxCtx); phi_f0 = (400.0f - this->actor.world.pos.y) * 0.0025f; phi_f0 = CLAMP_MIN(phi_f0, 0.0f); - phi_f0 = CLAMP_MAX(phi_f0, 1.0f); + phi_f0 = CLAMP_MAX(phi_f0, 1.0f); // could be variant of clamp_var 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_Translate(this->actor.world.pos.x, this->actor.floorHeight, this->actor.world.pos.z - 20.0f, MTXMODE_NEW); @@ -2812,7 +2860,7 @@ void Boss07_Wrath_DrawShadowTex(u8* shadowTex, Boss07* this, PlayState* play) { 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); gSPDisplayList(POLY_OPA_DISP++, gMajorasWrathShadowModelDL); - CLOSE_DISPS(pad3); + CLOSE_DISPS(gfxCtx); } void Boss07_Incarnation_AvoidPlayer(Boss07* this) { @@ -2900,7 +2948,7 @@ void Boss07_Incarnation_Intro(Boss07* this, PlayState* play) { if (this->timer_ABC8 == 80) { this->csState = MAJORAS_INCARNATION_INTRO_STATE_4; this->timer_ABC8 = 0; - for (i = 0; i < 4; i++) { + for (i = 0; i < ARRAY_COUNT(this->unk_17B8); i++) { this->unk_17B8[i] = 1.0f; } } @@ -3514,7 +3562,7 @@ void Boss07_Incarnation_Update(Actor* thisx, PlayState* play2) { if (KREG(63) == 0) { this->canDodge = false; this->actor.shape.shadowAlpha = 130; - for (i = 0; i < 3; i++) { + for (i = 0; i < ARRAY_COUNT(this->timers); i++) { DECR(this->timers[i]); } DECR(this->invincibilityTimer); @@ -4194,7 +4242,7 @@ void Boss07_Mask_Beam(Boss07* this, PlayState* play) { s32 pad2; func_800B8D50(play, &this->actor, 5.0f, this->actor.shape.rot.y, 0.0f, 0x10); - for (pad2 = 0; pad2 < 18; pad2++) { + for (pad2 = 0; pad2 < ARRAY_COUNT(player->flameTimers); pad2++) { player->flameTimers[pad2] = Rand_S16Offset(0, 200); } player->isBurning = true; @@ -4567,8 +4615,10 @@ void Boss07_Mask_Death(Boss07* this, PlayState* play) { if (this->subCamIndex != SUB_CAM_ID_DONE) { ShrinkWindow_SetLetterboxTarget(0x1B); sp54 = this->subCamEye; - if (sp54.y < 30.0f) sp54.y = 30.0f; - + if (sp54.y < 30.0f) { + sp54.y = 30.0f; + } + Play_SetCameraAtEye(play, this->subCamIndex, &this->subCamAt, &sp54); } } @@ -4638,7 +4688,7 @@ void Boss07_Mask_Update(Actor* thisx, PlayState* play2) { this->unk_1874 = 0; Actor_SetScale(&this->actor, 0.1f); this->actor.focus.pos = this->actor.world.pos; - for (i = 0; i < 3; i++) { + for (i = 0; i < ARRAY_COUNT(this->timers); i++) { DECR(this->timers[i]); } DECR(this->dmgShakeTimer); @@ -4803,8 +4853,10 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, PlayState* play, Vec3f* base, Vec phi_f0 = -3.0f - ((s32)(i % 8U) * 0.05f); } phi_f2 = pos->y + vel->y + phi_f0 + sp80.y; - if (phi_f2 < 2.0f) phi_f2 = 2.0f; - + if (phi_f2 < 2.0f) { + phi_f2 = 2.0f; + } + temp_f22 = phi_f2 - (pos - 1)->y; temp_f20 = pos->z + vel->z - (pos - 1)->z + sp80.x; temp_f26 = Math_Acot2F(temp_f20, temp_f24); @@ -4941,17 +4993,10 @@ void Boss07_Mask_Draw(Actor* thisx, PlayState* play2) { static void* D_80A082E0[2] = { gMajorasMaskWithNormalEyesTex, gMajorasMaskWithDullEyesTex }; PlayState* play = play2; Boss07* this = THIS; - s32 i; - s32 phi_s6; f32 temp_f20; f32 temp_f22; - f32 phi_f24; OPEN_DISPS(play->state.gfxCtx); - Vec3f spA8; - Vec3f sp9C; - Vec3f sp90; - f32 pad2; func_8012C28C(play->state.gfxCtx); func_8012C2DC(play->state.gfxCtx); @@ -4969,39 +5014,48 @@ void Boss07_Mask_Draw(Actor* thisx, PlayState* play2) { gSPDisplayList(POLY_OPA_DISP++, gMajorasMaskTentacleMaterialDL); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); - phi_s6 = ((this->actionFunc == Boss07_Mask_Idle) && - (ABS_ALT((s16)(this->actor.world.rot.y - this->actor.shape.rot.y)) > 0x4000)) - ? true - : false; + { + Vec3f spA8; + Vec3f sp9C; + Vec3f sp90; + f32 phi_f24; + f32 pad2; + s32 i; + s32 phi_s6 = ((this->actionFunc == Boss07_Mask_Idle) && + (ABS_ALT((s16)(this->actor.world.rot.y - this->actor.shape.rot.y)) > 0x4000)) + ? true + : false; - Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_NEW); - Matrix_RotateXS(this->actor.shape.rot.x, MTXMODE_APPLY); - Matrix_RotateZS(this->actor.shape.rot.z, MTXMODE_APPLY); - Matrix_MultVecZ(-3.0f, &sp90); - spA8.x = 0.0f; - spA8.y = 20.0f; - spA8.z = -2.0f; - phi_f24 = 0.0f; - for (i = 0; i < MAJORAS_TENT_COUNT; i++) { - Matrix_Push(); - Matrix_Push(); - Matrix_RotateZF(phi_f24, MTXMODE_APPLY); - Matrix_MultVec3f(&spA8, &sp9C); - this->tentacles[i].base.x = this->tentAttachPos.x + sp9C.x; - this->tentacles[i].base.y = this->tentAttachPos.y + sp9C.y; - this->tentacles[i].base.z = this->tentAttachPos.z + sp9C.z; + Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_NEW); + Matrix_RotateXS(this->actor.shape.rot.x, MTXMODE_APPLY); + Matrix_RotateZS(this->actor.shape.rot.z, MTXMODE_APPLY); + Matrix_MultVecZ(-3.0f, &sp90); + spA8.x = 0.0f; + spA8.y = 20.0f; + spA8.z = -2.0f; + phi_f24 = 0.0f; + for (i = 0; i < MAJORAS_TENT_COUNT; i++) { + Matrix_Push(); + Matrix_Push(); + Matrix_RotateZF(phi_f24, MTXMODE_APPLY); + Matrix_MultVec3f(&spA8, &sp9C); + this->tentacles[i].base.x = this->tentAttachPos.x + sp9C.x; + this->tentacles[i].base.y = this->tentAttachPos.y + sp9C.y; + this->tentacles[i].base.z = this->tentAttachPos.z + sp9C.z; - pad2 = (1 - (i * 0.008f)) * this->tentLengthScale; - Matrix_Pop(); - if (this->updateWhips) { - Boss07_Mask_UpdateTentacles(this, play, &this->tentacles[i].base, this->tentacles[i].pos, - this->tentacles[i].rot, this->tentacles[i].vel, &sp90, pad2, phi_s6, phi_f24); + pad2 = (1 - (i * 0.008f)) * this->tentLengthScale; + Matrix_Pop(); + if (this->updateWhips) { + Boss07_Mask_UpdateTentacles(this, play, &this->tentacles[i].base, this->tentacles[i].pos, + this->tentacles[i].rot, this->tentacles[i].vel, &sp90, pad2, phi_s6, + phi_f24); + } + Boss07_Mask_DrawTentacles(this, play, this->tentacles[i].pos, this->tentacles[i].rot, pad2, i * 0.9f); + phi_f24 += 0.5f; + spA8.y += 1.0f; + + Matrix_Pop(); } - Boss07_Mask_DrawTentacles(this, play, this->tentacles[i].pos, this->tentacles[i].rot, pad2, i * 0.9f); - phi_f24 += 0.5f; - spA8.y += 1.0f; - - Matrix_Pop(); } Boss07_Mask_DrawBeam(this, play); this->updateWhips = false; @@ -5039,7 +5093,7 @@ void Boss07_Projectile_Update(Actor* thisx, PlayState* play2) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST2_FIRE_OLD); } } - for (i = 0; i < 3; i++) { + for (i = 0; i < ARRAY_COUNT(this->timers); i++) { DECR(this->timers[i]); } Actor_UpdateVelocityWithoutGravity(&this->actor); @@ -5376,7 +5430,7 @@ void Boss07_Remains_Update(Actor* thisx, PlayState* play2) { s32 i; this->actionTimer++; - for (i = 0; i < 3; i++) { + for (i = 0; i < ARRAY_COUNT(this->timers); i++) { DECR(this->timers[i]); } DECR(this->timer_18D6); From 9e9f497975772e0a46bf816d8ea9e6b8502b84e8 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Tue, 6 Sep 2022 09:38:24 -0500 Subject: [PATCH 26/28] signs --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 30716e69f..cd69929cd 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -2830,7 +2830,7 @@ void Boss07_Wrath_MakeShadowTex(u8* shadowTex, Boss07* this, PlayState* play) { s32 i; s32* shadowTex32 = (s32*)shadowTex; - for (i = 0; i < 0x40 * 0x40 / sizeof(s32); i++, shadowTex32++) { + for (i = 0; i < 0x40 * 0x40 / (s32)sizeof(s32); i++, shadowTex32++) { *shadowTex32 = 0; } // angle of light source From a7bd2d48a8efa61e2d7f50e767930ed983fb489a Mon Sep 17 00:00:00 2001 From: petrie911 Date: Thu, 15 Sep 2022 07:56:18 -0500 Subject: [PATCH 27/28] macro stuff. clean up later --- pptest.c | 54 ++++++++++++++ src/overlays/actors/ovl_Boss_07/z_boss_07.c | 80 ++++++++++++++++++++- 2 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 pptest.c diff --git a/pptest.c b/pptest.c new file mode 100644 index 000000000..acfe0715e --- /dev/null +++ b/pptest.c @@ -0,0 +1,54 @@ +#define IDENTITY(...) __VA_ARGS__ +#define GROUP(...) __VA_ARGS__ +#define EVAL4(x) GROUP(x) +#define EVAL3(x) EVAL4(EVAL4(EVAL4(GROUP(x)))) +#define EVAL2(x) EVAL3(EVAL3(EVAL3(GROUP(x)))) +#define EVAL1(x) EVAL2(EVAL2(EVAL2(GROUP(x)))) +#define EVAL(x) EVAL1(EVAL1(EVAL1(GROUP(x)))) + +#define MAP_OUT +#define MAP_END(a,b,...) b +#define MAP_NULL(...) +#define END_TEST(com) 0 , com +#define GET_SECOND(a, b, ...) b +#define GET_COMMAND(com, ecom, a, b, ...) GET_SECOND MAP_OUT (END_TEST b (ecom) , com) + +#define CHECK_ARR_VAL_R(val, i, ...) ((val==i)?0:(1+VALIDATE_ARR MAP_OUT (val, __VA_ARGS__-1))) +#define VALIDATE_ARR(val, ...) (GET_COMMAND (CHECK_ARR_VAL_R, MAP_END, __VA_ARGS__, ) (val, __VA_ARGS__)) +#define CHECK_ARR_VAL(val, ...) CHECK_ARR_VAL_R(val, __VA_ARGS__,-1) + +#define INVERT_ARRAY_R(vals, n, b, ...) CHECK_ARR_VAL(n, IDENTITY vals) , VALIDATE_INVERSE MAP_OUT (vals, n b, __VA_ARGS__) +#define VALIDATE_INVERSE(vals, n, ...) GET_COMMAND (INVERT_ARRAY_R, MAP_NULL, __VA_ARGS__, ) (vals, n, __VA_ARGS__) +#define INVERT_ARRAY(count, ...) EVAL(INVERT_ARRAY_R((__VA_ARGS__),0,+1,COUNTER_##count)) + +#define COUNTER_6 +1,+1,+1,+1,+1,+1 +#define COUNTER_20 +1,+1,+1,+1,+1,+1,+1,+1,+1,+1,+1,+1,+1,+1,+1,+1,+1,+1,+1,+1 +#define COUNTER_30 COUNTER_6,COUNTER_6,COUNTER_6,COUNTER_6,COUNTER_6 +#define COUNTER_100 COUNTER_20,COUNTER_20,COUNTER_20,COUNTER_20,COUNTER_20 + +// EVAL(CHECK_ARR_VAL(3, 1, 2, 3, 4)) + +INVERT_ARRAY(30, 26, 14, 2, 21, 22, 23, 16, 17, 18, 4, 6, 7, 9, 11, 12) +// EVAL3(INVERT_ARRAY(30, 1, 4)) +// EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4))) +// EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4)))) +// EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4))))) +// EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4)))))) +// EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4))))))) +// EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4)))))))) +// EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4))))))))) +// EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4)) )))))))) +// EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4))) )))))))) +// EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4)))) )))))))) +// EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4))))) )))))))) +// EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4)))))) )))))))) +// EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4))))))) )))))))) +// EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4)))))))) )))))))) +// EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(EVAL3(INVERT_ARRAY(30, 1, 4))))))))))))))))) + +int temp[] = { + ((0 == 1) ? 0 : (1 + (((0 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 == 1) ? 0 : (1 + (((0 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , ((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 1) ? 0 : (1 + (((0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 == 4) ? 0 : (1 + (-1 - 1 - 1)))))) , +}; +int main() { + printf("%d %d %d %d %d %d", temp[0], temp[1], temp[2], temp[3], temp[4], temp[5]); +} 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 cd69929cd..a7291806a 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -2499,6 +2499,60 @@ s32 Boss07_Wrath_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V return false; } +typedef enum { + MAJORAS_WRATH_PART_NONE = -1, + MAJORAS_WRATH_PART_HEAD, + MAJORAS_WRATH_PART_TORSO, + MAJORAS_WRATH_PART_PELVIS, + MAJORAS_WRATH_PART_LEFT_UPPER_ARM, + MAJORAS_WRATH_PART_LEFT_LOWER_ARM_ROOT, + MAJORAS_WRATH_PART_LEFT_FOREARM, + MAJORAS_WRATH_PART_RIGHT_UPPER_ARM, + MAJORAS_WRATH_PART_RIGHT_LOWER_ARM_ROOT, + MAJORAS_WRATH_PART_RIGHT_FOREARM, + MAJORAS_WRATH_PART_RIGHT_THIGH, + MAJORAS_WRATH_PART_RIGHT_SHIN, + MAJORAS_WRATH_PART_RIGHT_FOOT, + MAJORAS_WRATH_PART_LEFT_THIGH, + MAJORAS_WRATH_PART_LEFT_SHIN, + MAJORAS_WRATH_PART_LEFT_FOOT, + MAJORAS_WRATH_PART_MAX, +} MajorasWrathBodyPart; + +// typedef enum MajorasWrathLimbs { +// /* -1 */ MAJORAS_WRATH_LIMB_NONE, +// /* -1 */ MAJORAS_WRATH_LIMB_ROOT, +// /* 2 */ MAJORAS_WRATH_LIMB_PELVIS, +// /* -1 */ MAJORAS_WRATH_LIMB_LEFT_LEG_ROOT, +// /* 12 */ MAJORAS_WRATH_LIMB_LEFT_THIGH, +// /* -1 */ MAJORAS_WRATH_LIMB_LEFT_LOWER_LEG_ROOT, +// /* 13 */ MAJORAS_WRATH_LIMB_LEFT_SHIN, +// /* 14 */ MAJORAS_WRATH_LIMB_LEFT_FOOT, +// /* -1 */ MAJORAS_WRATH_LIMB_RIGHT_LEG_ROOT, +// /* 9 */ MAJORAS_WRATH_LIMB_RIGHT_THIGH, +// /* -1 */ MAJORAS_WRATH_LIMB_RIGHT_LOWER_LEG_ROOT, +// /* 10 */ MAJORAS_WRATH_LIMB_RIGHT_SHIN, +// /* 11 */ MAJORAS_WRATH_LIMB_RIGHT_FOOT, +// /* -1 */ MAJORAS_WRATH_LIMB_TORSO_ROOT, +// /* 1 */ MAJORAS_WRATH_LIMB_TORSO, +// /* -1 */ MAJORAS_WRATH_LIMB_RIGHT_ARM_ROOT, +// /* 6 */ MAJORAS_WRATH_LIMB_RIGHT_UPPER_ARM, +// /* 7 */ MAJORAS_WRATH_LIMB_RIGHT_LOWER_ARM_ROOT, +// /* 8 */ MAJORAS_WRATH_LIMB_RIGHT_FOREARM, +// /* -1 */ MAJORAS_WRATH_LIMB_RIGHT_HAND, +// /* -1 */ MAJORAS_WRATH_LIMB_LEFT_ARM_ROOT, +// /* 3 */ MAJORAS_WRATH_LIMB_LEFT_UPPER_ARM, +// /* 4 */ MAJORAS_WRATH_LIMB_LEFT_LOWER_ARM_ROOT, +// /* 5 */ MAJORAS_WRATH_LIMB_LEFT_FOREARM, +// /* -1 */ MAJORAS_WRATH_LIMB_LEFT_HAND, +// /* -1 */ MAJORAS_WRATH_LIMB_HEAD_ROOT, +// /* 0 */ MAJORAS_WRATH_LIMB_HEAD, +// /* -1 */ MAJORAS_WRATH_LIMB_THIRD_EYE, +// /* -1 */ MAJORAS_WRATH_LIMB_MAX +// } MajorasWrathLimbs; + + + void Boss07_Wrath_PostLimbDraw(PlayState* play, 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, @@ -3630,6 +3684,30 @@ s32 Boss07_Incarnation_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dL return false; } +// #define IDENTITY(...) __VA_ARGS__ +// #define GROUP(...) __VA_ARGS__ +// #define EVAL3(x) GROUP(x) +// #define EVAL2(x) EVAL3(EVAL3(EVAL3(GROUP(x)))) +// #define EVAL1(x) EVAL2(EVAL2(EVAL2(GROUP(x)))) +// #define EVAL(x) EVAL1(EVAL1(EVAL1(GROUP(x)))) + +// #define MAP_OUT +// #define MAP_END(a,b,...) b +// #define MAP_NULL(...) +// #define END_TEST(com) 0 , com +// #define GET_SECOND(a, b, ...) b +// #define GET_COMMAND(com, ecom, a, b, ...) GET_SECOND MAP_OUT (END_TEST b (ecom) , com) + +// #define CHECK_ARR_VAL_R(val, i, ...) ((val == i) ? 0 : (1 + VALIDATE_ARR MAP_OUT (val, __VA_ARGS__ - 1))) +// #define VALIDATE_ARR(val, ...) (GET_COMMAND (CHECK_ARR_VAL_R, MAP_END, __VA_ARGS__, ) (val, __VA_ARGS__)) +// #define CHECK_ARR_VAL(val, ...) CHECK_ARR_VAL_R(val, __VA_ARGS__, -1) + +// #define INVERT_ARRAY_R(vals, n, b, ...) CHECK_ARR_VAL(n, IDENTITY vals) , VALIDATE_INVERSE MAP_OUT (vals, n b, __VA_ARGS__) +// #define VALIDATE_INVERSE(vals, n, ...) GET_COMMAND (INVERT_ARRAY_R, MAP_NULL, __VA_ARGS__, ) (vals, n, __VA_ARGS__) +// #define INVERT_ARRAY(count, ...) INVERT_ARRAY_R((__VA_ARGS__), 0, +1, COUNTER_##count) + +// #define COUNTER_30 +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1, +1 + void Boss07_Incarnation_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { static s8 sLimbColliderIndex[30] = { -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, @@ -3646,7 +3724,7 @@ void Boss07_Incarnation_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList }; 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, 4, 5, -1, 12, -1, 13, 14, 0, -1, -1, -1, -1, -1 }; Boss07* this = THIS; From fe77339adba7519366f7507d2d9a739d95b4dbbd Mon Sep 17 00:00:00 2001 From: petrie911 Date: Fri, 14 Apr 2023 11:58:24 -0500 Subject: [PATCH 28/28] names --- src/overlays/actors/ovl_Boss_07/z_boss_07.c | 84 ++++++++++----------- src/overlays/actors/ovl_Boss_07/z_boss_07.h | 2 +- 2 files changed, 43 insertions(+), 43 deletions(-) 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 54a5e241b..55b98ead2 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -546,7 +546,7 @@ void Boss07_Wrath_Dodge(Boss07* this, PlayState* play, u8 canCancel) { } else { Boss07_Wrath_SetupJump(this, play); } - this->unk_158 = 10; + this->collisionTimer = 10; this->whipGrabIndex = 0; if (&this->actor == player->actor.parent) { player->unk_AE8 = 101; @@ -1351,7 +1351,7 @@ void Boss07_Wrath_SetupSidestep(Boss07* this, PlayState* play) { this->moveTarget.x += this->actor.world.pos.x; this->moveTarget.z += this->actor.world.pos.z; this->timers[1] = 21; - this->unk_158 = 10; + this->collisionTimer = 10; this->vel_170 = 0.0f; this->timer_ABCC = 0; } @@ -1750,7 +1750,7 @@ void Boss07_Wrath_SetupStunned(Boss07* this, PlayState* play) { Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathStunAnim, -10.0f); this->animEndFrame = Animation_GetLastFrame(&gMajorasWrathStunAnim); } - this->unk_158 = 10; + this->collisionTimer = 10; Actor_PlaySfx(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE_OLD); } @@ -1840,7 +1840,7 @@ void Boss07_Wrath_SetupDamaged(Boss07* this, PlayState* play, u8 damage, u8 dmgE this->timer_ABCC = 0; } else if (dmgEffect == MAJORAS_WRATH_DMGEFF_E) { if (this->skelAnime.curFrame <= (this->animEndFrame - 5.0f)) { - this->unk_158 = 30; + this->collisionTimer = 30; } else { Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasWrathDamageAnim, -5.0f); } @@ -1971,27 +1971,27 @@ void Boss07_Wrath_CollisionCheck(Boss07* this, PlayState* play) { for (j = 0; j < ARRAY_COUNT(this->bodyElements); j++) { this->bodyCollider.elements[j].info.bumperFlags &= ~BUMP_HIT; } - if (this->unk_1804 == 10) { + if (this->unk_1804 == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { this->unk_1806 = 0; } switch (this->actor.colChkInfo.damageEffect) { case MAJORAS_WRATH_DMGEFF_3: - this->unk_1805 = 10; + this->unk_1805 = MAJORAS_DAMAGE_STATE_10; break; case MAJORAS_WRATH_DMGEFF_2: - this->unk_1805 = 1; + this->unk_1805 = MAJORAS_DAMAGE_STATE_1; break; case MAJORAS_WRATH_DMGEFF_4: - this->unk_1805 = 20; + this->unk_1805 = MAJORAS_DAMAGE_STATE_20; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 0, 4); break; case MAJORAS_WRATH_DMGEFF_A: - this->unk_1805 = 40; + this->unk_1805 = MAJORAS_DAMAGE_STATE_40; Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); break; case MAJORAS_WRATH_DMGEFF_9: - this->unk_1805 = 30; + this->unk_1805 = MAJORAS_DAMAGE_STATE_30; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 3, 4); break; @@ -2053,12 +2053,12 @@ void Boss07_DamageEffects(Boss07* this, PlayState* play) { switch (this->unk_1805) { case MAJORAS_DAMAGE_STATE_0: - this->unk_1804 = 0; + this->unk_1804 = ACTOR_DRAW_DMGEFF_FIRE; this->unk_1806 = 0; this->unk_1800 = 0.0f; break; case MAJORAS_DAMAGE_STATE_1: - this->unk_1804 = 0; + this->unk_1804 = ACTOR_DRAW_DMGEFF_FIRE; this->unk_1806 = 40; this->unk_1800 = 1.0f; this->unk_17F8 = 0.0f; @@ -2068,14 +2068,14 @@ void Boss07_DamageEffects(Boss07* this, PlayState* play) { if (this->unk_1806 == 0) { Math_ApproachZeroF(&this->unk_1800, 1.0f, 0.02f); if (this->unk_1800 == 0.0f) { - this->unk_1805 = 0; + this->unk_1805 = MAJORAS_DAMAGE_STATE_0; } } else { Math_ApproachF(&this->unk_17F8, 1.0f, 0.1f, 0.5f); } break; case MAJORAS_DAMAGE_STATE_10: - this->unk_1804 = 11; + this->unk_1804 = ACTOR_DRAW_DMGEFF_FROZEN_SFX; this->unk_1806 = 40; this->unk_1800 = 1.0f; this->unk_17FC = 1.0f; @@ -2084,10 +2084,10 @@ void Boss07_DamageEffects(Boss07* this, PlayState* play) { case MAJORAS_DAMAGE_STATE_11: if (this->unk_1806 == 0) { Boss07_Wrath_BreakIce(this, play); - this->unk_1805 = 0; + this->unk_1805 = MAJORAS_DAMAGE_STATE_0; } else { if (this->unk_1806 == 50) { - this->unk_1804 = 10; + this->unk_1804 = ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX; } Math_ApproachF(&this->unk_17F8, 1.0f, 1.0f, 0.08f); Math_ApproachF(&this->unk_17FC, 1.0f, 0.05f, 0.05f); @@ -2095,12 +2095,12 @@ void Boss07_DamageEffects(Boss07* this, PlayState* play) { break; if (1) { case MAJORAS_DAMAGE_STATE_20: - this->unk_1804 = 20; + this->unk_1804 = ACTOR_DRAW_DMGEFF_LIGHT_ORBS; this->unk_1806 = 40; this->unk_17F8 = 1.0f; } else { case MAJORAS_DAMAGE_STATE_30: - this->unk_1804 = 21; + this->unk_1804 = ACTOR_DRAW_DMGEFF_BLUE_LIGHT_ORBS; this->unk_1806 = 40; this->unk_17F8 = 3.0f; } @@ -2110,7 +2110,7 @@ void Boss07_DamageEffects(Boss07* this, PlayState* play) { if (this->unk_1806 == 0) { Math_ApproachZeroF(&this->unk_17F8, 1.0f, 0.03f); if (this->unk_17F8 == 0.0f) { - this->unk_1805 = 0; + this->unk_1805 = MAJORAS_DAMAGE_STATE_0; this->unk_1800 = 0.0f; } } else { @@ -2118,7 +2118,7 @@ void Boss07_DamageEffects(Boss07* this, PlayState* play) { } break; case MAJORAS_DAMAGE_STATE_40: - this->unk_1804 = 30; + this->unk_1804 = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_SMALL; this->unk_1806 = 50; this->unk_1800 = 1.0f; this->unk_17F8 = (KREG(18) * 0.1f) + 1.0f; @@ -2127,7 +2127,7 @@ void Boss07_DamageEffects(Boss07* this, PlayState* play) { if (this->unk_1806 == 0) { Math_ApproachZeroF(&this->unk_17F8, 1.0f, 0.05f); if (this->unk_17F8 == 0.0f) { - this->unk_1805 = 0; + this->unk_1805 = MAJORAS_DAMAGE_STATE_0; this->unk_1800 = 0.0f; } } @@ -2157,7 +2157,7 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { DECR(this->timers[i]); } DECR(this->whipCollisionTimer); - DECR(this->unk_158); + DECR(this->collisionTimer); DECR(this->invincibilityTimer); DECR(this->dmgFogEffectTimer); DECR(this->jumpSfxTimer); @@ -2178,7 +2178,7 @@ void Boss07_Wrath_Update(Actor* thisx, PlayState* play2) { } Boss07_Wrath_WhipCollisionCheck(this->rightWhip.pos, this->rightWhip.tension, this, play); Boss07_Wrath_WhipCollisionCheck(this->leftWhip.pos, this->leftWhip.tension, this, play); - if (this->unk_158 != 0) { + if (this->collisionTimer != 0) { for (i = 0; i < ARRAY_COUNT(this->bodyElements); i++) { this->bodyCollider.elements[i].info.bumperFlags &= ~BUMP_HIT; } @@ -2577,7 +2577,7 @@ void Boss07_Wrath_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 } index = sLimbColliderIndex[limbIndex]; if (index >= 0) { - if (this->unk_158 != 0) { + if (this->collisionTimer != 0) { Matrix_MultVecZ(100000.0f, &colliderPos); } else { Matrix_MultVec3f(&sWrathColliderOffsets[index], &colliderPos); @@ -3125,7 +3125,7 @@ void Boss07_Incarnation_SetupStunned(Boss07* this, PlayState* play, s16 stunTime Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationFallOverStartAnim, -10.0f); this->animEndFrame = Animation_GetLastFrame(&gMajorasIncarnationFallOverStartAnim); } - this->unk_158 = 10; + this->collisionTimer = 10; this->timers[0] = stunTime; this->timers[1] = 12; } @@ -3157,7 +3157,7 @@ void Boss07_Incarnation_SetupDamaged(Boss07* this, PlayState* play, u8 damage, u this->animEndFrame = Animation_GetLastFrame(&gMajorasIncarnationDamageAnim); } else if (dmgEffect == MAJORAS_INCARNATION_DMGEFF_E) { if (this->skelAnime.curFrame <= (this->animEndFrame - 5.0f)) { - this->unk_158 = 30; + this->collisionTimer = 30; this->invincibilityTimer = 30; } else { Animation_MorphToPlayOnce(&this->skelAnime, &gMajorasIncarnationDamageAnim, -2.0f); @@ -3170,7 +3170,7 @@ void Boss07_Incarnation_SetupDamaged(Boss07* this, PlayState* play, u8 damage, u Actor_PlaySfx(&this->actor, NA_SE_EN_LAST2_DEAD_OLD); this->startDeath = true; this->invincibilityTimer = 100; - this->unk_158 = 100; + this->collisionTimer = 100; Enemy_StartFinishingBlow(play, &this->actor); return; } @@ -3535,27 +3535,27 @@ void Boss07_Incarnation_CollisionCheck(Boss07* this, PlayState* play) { for (j = 0; j < ARRAY_COUNT(this->bodyElements); j++) { this->bodyCollider.elements[j].info.bumperFlags &= ~BUMP_HIT; } - if (this->unk_1804 == 10) { + if (this->unk_1804 == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { this->unk_1806 = 0; } switch (this->actor.colChkInfo.damageEffect) { case MAJORAS_INCARNATION_DMGEFF_3: - this->unk_1805 = 10; + this->unk_1805 = MAJORAS_DAMAGE_STATE_10; break; case MAJORAS_INCARNATION_DMGEFF_2: - this->unk_1805 = 1; + this->unk_1805 = MAJORAS_DAMAGE_STATE_1; break; case MAJORAS_INCARNATION_DMGEFF_4: - this->unk_1805 = 20; + this->unk_1805 = MAJORAS_DAMAGE_STATE_20; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 0, 4); break; case MAJORAS_INCARNATION_DMGEFF_A: - this->unk_1805 = 40; + this->unk_1805 = MAJORAS_DAMAGE_STATE_40; Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); break; case MAJORAS_INCARNATION_DMGEFF_9: - this->unk_1805 = 30; + this->unk_1805 = MAJORAS_DAMAGE_STATE_30; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 3, 4); break; @@ -3621,7 +3621,7 @@ void Boss07_Incarnation_Update(Actor* thisx, PlayState* play2) { } DECR(this->invincibilityTimer); DECR(this->dmgFogEffectTimer); - DECR(this->unk_158); + DECR(this->collisionTimer); DECR(this->timer_18D6); Math_ApproachZeroF(&this->unk_330, 1.0f, 0.04f); @@ -3635,7 +3635,7 @@ void Boss07_Incarnation_Update(Actor* thisx, PlayState* play2) { Boss07_Incarnation_SetupDeath(this, play); } } - if (this->unk_158 != 0) { + if (this->collisionTimer != 0) { for (i = 0; i < ARRAY_COUNT(this->bodyElements); i++) { this->bodyCollider.elements[i].info.bumperFlags &= ~BUMP_HIT; } @@ -3739,7 +3739,7 @@ void Boss07_Incarnation_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList } i = sLimbColliderIndex[limbIndex]; if (i >= 0) { - if (this->unk_158 != 0) { + if (this->collisionTimer != 0) { Matrix_MultVecZ(100000.0f, &sp28); } else { Matrix_MultVec3f(&sIncarnationColliderOffsets[i], &sp28); @@ -5617,8 +5617,8 @@ void Boss07_Top_Ground(Boss07* this, PlayState* play) { this->actor.world.pos.x += this->xRecoil; this->actor.world.pos.z += this->zRecoil; Actor_UpdateBgCheckInfo(play, &this->actor, 40.0f, 40.0f, 80.0f, 5); - if ((this->unk_158 == 0) && (this->actor.bgCheckFlags & 8)) { - this->unk_158 = 10; + if ((this->collisionTimer == 0) && (this->actor.bgCheckFlags & 8)) { + this->collisionTimer = 10; if (this->topSpinRate > 0.01f) { if (this->topSpinRate < 0.45f) { this->actor.speed *= -1.0f; @@ -5695,17 +5695,17 @@ void Boss07_Top_Collide(Boss07* this, PlayState* play) { f32 dy; f32 dz; - if (this->unk_158 == 0) { + if (this->collisionTimer == 0) { top = (Boss07*)play->actorCtx.actorLists[ACTORCAT_BOSS].first; while (top != NULL) { - if ((this != top) && (top->actor.params == MAJORAS_TOP) && (top->unk_158 == 0)) { + if ((this != top) && (top->actor.params == MAJORAS_TOP) && (top->collisionTimer == 0)) { dx = top->actor.world.pos.x - this->actor.world.pos.x; dy = top->actor.world.pos.y - this->actor.world.pos.y; dz = top->actor.world.pos.z - this->actor.world.pos.z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < (sREG(28) + 50.0f)) { - top->unk_158 = this->unk_158 = 10; + top->collisionTimer = this->collisionTimer = 10; this->actor.world.rot.y = Math_Atan2S(dx, dz); top->actor.world.rot.y = this->actor.world.rot.y + 0x7FFF; if (this->timers[0] > 0) { @@ -5815,7 +5815,7 @@ void Boss07_Top_Update(Actor* thisx, PlayState* play2) { DECR(this->timers[1]); DECR(this->dmgFogEffectTimer); DECR(this->invincibilityTimer); - DECR(this->unk_158); + DECR(this->collisionTimer); this->actionFunc(this, play); Math_Vec3f_Copy(&this->actor.focus.pos, &this->actor.world.pos); this->actor.focus.pos.y += 25.0f; 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 3914ff587..05ac53ec9 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -61,7 +61,7 @@ typedef struct Boss07 { /* 0x014F */ u8 whipCrackTimer; /* 0x0150 */ s16 timers[3]; /* 0x0156 */ s16 jumpSfxTimer; - /* 0x0158 */ s16 unk_158; // turns off collision + /* 0x0158 */ s16 collisionTimer; // turns off collision /* 0x015A */ s16 whipCollisionTimer; /* 0x015C */ s16 invincibilityTimer; /* 0x015E */ s16 dmgFogEffectTimer;