From 9a371e84268305b483b9d5a01e15b325c1f1ef21 Mon Sep 17 00:00:00 2001 From: Elliptic Ellipsis Date: Sun, 18 Sep 2022 22:51:19 +0100 Subject: [PATCH 1/9] Init, Destroy, Update, easy actions --- src/overlays/actors/ovl_Boss_05/z_boss_05.c | 2109 ++++++++++++++++++- src/overlays/actors/ovl_Boss_05/z_boss_05.h | 60 +- tools/permuter_settings.toml | 2 + 3 files changed, 2133 insertions(+), 38 deletions(-) diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.c b/src/overlays/actors/ovl_Boss_05/z_boss_05.c index 7b40069d7..d6285fe19 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.c +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.c @@ -15,16 +15,26 @@ void Boss05_Destroy(Actor* thisx, PlayState* play); void Boss05_Update(Actor* thisx, PlayState* play); void Boss05_Draw(Actor* thisx, PlayState* play); +void func_809EEDD0(Boss05* this, PlayState* play); void func_809EEDE8(Boss05* this, PlayState* play); void func_809EF9BC(Boss05* this, PlayState* play); void func_809EFAB4(Boss05* this, PlayState* play); +void func_809F00CC(Boss05* this, PlayState* play); void func_809F010C(Boss05* this, PlayState* play); +void func_809F01CC(Boss05* this, PlayState* play); void func_809F0244(Boss05* this, PlayState* play); +void func_809F02D0(Boss05* this, PlayState* play); void func_809F0374(Boss05* this, PlayState* play); +void func_809F0474(Boss05* this, PlayState* play); void func_809F04C0(Boss05* this, PlayState* play); +void func_809F0538(Boss05 *this, PlayState *arg1); void func_809F0590(Boss05* this, PlayState* play); +void func_809F0650(Boss05 *this, PlayState *arg1); void func_809F06B8(Boss05* this, PlayState* play); +void func_809F0708(Boss05* this, PlayState* play); void func_809F0780(Boss05* this, PlayState* play); +void func_809F0A0C(Boss05* this, PlayState* play); +void func_809F0A64(Boss05* this, PlayState* play); void func_809F0ABC(Boss05* this, PlayState* play); void func_809F0B0C(Boss05* this, PlayState* play); @@ -161,6 +171,7 @@ const ActorInit Boss_05_InitVars = { #endif +extern CollisionHeader D_809F1B00; extern ColliderJntSphElementInit D_809F1B2C[2]; extern ColliderJntSphInit D_809F1B74; extern ColliderJntSphElementInit D_809F1B84[1]; @@ -170,77 +181,558 @@ extern ColliderJntSphInit D_809F1BDC; extern DamageTable D_809F1C00; extern DamageTable D_809F1C20; -extern UNK_TYPE D_060006A4; -extern UNK_TYPE D_06000A5C; -extern UNK_TYPE D_06000ABC; -extern UNK_TYPE D_06002F0C; -extern UNK_TYPE D_06003448; -extern UNK_TYPE D_06006240; -extern UNK_TYPE D_06006E50; -extern UNK_TYPE D_06007488; -extern UNK_TYPE D_06007908; +extern AnimationHeader D_060006A4; +extern AnimationHeader D_06000A5C; +extern AnimationHeader D_06000ABC; +extern FlexSkeletonHeader D_060024E0; +extern AnimationHeader D_06002F0C; +extern AnimationHeader D_06003448; +extern AnimatedMaterial D_06006240[]; +extern FlexSkeletonHeader D_06006378; +extern AnimationHeader D_06006484; +extern AnimationHeader D_06006E50; +extern AnimationHeader D_06007488; +extern AnimationHeader D_06007908; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EE4E0.s") +extern Color_RGBA8 D_809F1BEC; +extern Color_RGBA8 D_809F1BF0; +extern Vec3f D_809F1BF4; +// static Color_RGBA8 D_809F1BEC = { 0xAA, 0xFF, 0xFF, 0xFF }; +// static Color_RGBA8 D_809F1BF0 = { 0xC8, 0xC8, 0xFF, 0xFF }; +// static Vec3f D_809F1BF4 = { 0.0f, -1.0f, 0.0f }; + +void func_809EE4E0(Boss05* this, PlayState* play) { + Vec3f sp8C; + Vec3f sp80; + s32 i; + + SoundSource_PlaySfxAtFixedWorldPos(play, &this->unk18C, 30, NA_SE_EV_ICE_BROKEN); + for (i = 0; i < 8; i++) { + sp80.x = randPlusMinusPoint5Scaled(7.0f); + sp80.z = randPlusMinusPoint5Scaled(7.0f); + sp80.y = Rand_ZeroFloat(6.0f) + 4.0f; + sp8C.x = this->unk18C.x + sp80.x; + sp8C.y = this->unk18C.y + sp80.y; + sp8C.z = this->unk18C.z + sp80.z; + EffectSsEnIce_Spawn(play, &sp8C, Rand_ZeroFloat(0.5f) + 0.7f, &sp80, &D_809F1BF4, &D_809F1BEC, &D_809F1BF0, 30); + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EE668.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/Boss05_Init.s") +void Boss05_Init(Actor* thisx, PlayState* play) { + s32 pad; + Boss05* this = THIS; + CollisionHeader* colHeader = NULL; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/Boss05_Destroy.s") + this->dyna.actor.targetMode = 3; + this->dyna.actor.colChkInfo.mass = MASS_HEAVY; + this->dyna.actor.colChkInfo.health = 2; + this->unk160 = (s32)Rand_ZeroFloat(1000.0f); + this->unk35C = 1.0f; + this->dyna.actor.gravity = -0.3f; + + Actor_SetScale(&this->dyna.actor, 0.01f); + + if ((this->dyna.actor.params == 0) || (this->dyna.actor.params == 1)) { + if (this->dyna.actor.world.rot.z == 0) { + this->dyna.actor.world.rot.z = 0; + } + + this->dyna.actor.shape.rot.z = 0; + this->unk168 = this->dyna.actor.world.rot.z; + this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z; + this->dyna.actor.colChkInfo.damageTable = &D_809F1C00; + + DynaPolyActor_Init(&this->dyna, 0); + CollisionHeader_GetVirtual(&D_809F1B00, &colHeader); + this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + func_809EEDD0(this, play); + + SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 10); + SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 20); + this->unk4FC = Animation_GetLastFrame(&D_06006484); + + Collider_InitAndSetJntSph(play, &this->unk1C8, &this->dyna.actor, &D_809F1B74, this->unk1E8); + Collider_InitAndSetJntSph(play, &this->unk368, &this->dyna.actor, &D_809F1BA8, this->unk388); + + if (Flags_GetClear(play, play->roomCtx.currRoom.num)) { + this->dyna.actor.params = 2; + this->actionFunc = func_809EF9BC; + this->dyna.actor.flags &= ~ACTOR_FLAG_1; + func_800BC154(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_BG); + } + } else if (this->dyna.actor.params == 2) { + this->actionFunc = func_809EF9BC; + + CollisionHeader_GetVirtual(&D_809F1B00, &colHeader); + this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + + SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 10); + this->dyna.actor.flags &= ~ACTOR_FLAG_1; + func_800BC154(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_BG); + } else if (this->dyna.actor.params == 3) { + this->actionFunc = func_809EFAB4; + this->unk198 = 1.0f; + + SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 10); + SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 0x14); + this->unk4FC = Animation_GetLastFrame(&D_06006484); + + Collider_InitAndSetJntSph(play, &this->unk1C8, &this->dyna.actor, &D_809F1B74, this->unk1E8); + Collider_InitAndSetJntSph(play, &this->unk368, &this->dyna.actor, &D_809F1BA8, this->unk388); + + ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); + this->dyna.actor.colChkInfo.damageTable = &D_809F1C00; + } else if (this->dyna.actor.params == 4) { + func_809F00CC(this, play); + this->dyna.actor.colChkInfo.mass = 90; + + SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 20); + + Collider_InitAndSetJntSph(play, &this->unk368, &this->dyna.actor, &D_809F1BDC, this->unk388); + + ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); + this->dyna.actor.colChkInfo.damageTable = &D_809F1C20; + this->dyna.actor.flags |= ACTOR_FLAG_10 | ACTOR_FLAG_20; + } else if (this->dyna.actor.params >= 10) { + SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 20); + + this->dyna.actor.gravity = 0.0f; + this->dyna.actor.world.rot.y = (s32)Rand_ZeroFloat(0x8000); + this->dyna.actor.speedXZ = Rand_ZeroFloat(3.0f) + 3.0f; + this->dyna.actor.velocity.y = Rand_ZeroFloat(1.5f) + 1.5f; + + this->unk500 = (s32)randPlusMinusPoint5Scaled(700.0f); + this->unk502 = (s32)randPlusMinusPoint5Scaled(1500.0f); + this->unk162[0] = (s32)(Rand_ZeroFloat(30.0f) + 50.0f); + + this->dyna.actor.flags &= ~ACTOR_FLAG_1; + this->actionFunc = func_809F0B0C; + } +} + +void Boss05_Destroy(Actor* thisx, PlayState* play) { + Boss05* this = THIS; + + if ((this->dyna.actor.params == 2) || (this->dyna.actor.params == 0) || (this->dyna.actor.params == 1)) { + DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EECBC.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EEDD0.s") +void func_809EEDD0(Boss05* this, PlayState* play) { + this->actionFunc = func_809EEDE8; +} +// The big one #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EEDE8.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EF9BC.s") +void func_809EF9BC(Boss05* this, PlayState* play) { + Player* player = GET_PLAYER(play); + f32 temp_fv0 = sqrtf(this->dyna.actor.xyzDistToPlayerSq); + s16 var_a1; + + if ((temp_fv0 < 50.0f) && (player->actor.bgCheckFlags & 1)) { + var_a1 = (s32)(temp_fv0 * 80.0f); + var_a1 = CLAMP_MAX(var_a1, 0x7D0); + // if (var_a1 > 0x7D0) { + // var_a1 = 0x7D0; + // } + Math_ApproachS(&this->unk178, var_a1, 0x14, 0x7D0); + Math_ApproachS(&this->unk176, this->dyna.actor.yawTowardsPlayer, 0x14, 0xFA0); + if (!(this->unk160 & 0xF)) { + EffectSsGRipple_Spawn(play, &this->dyna.actor.world.pos, 0x1F4, 0x3E8, 0); + } + } else { + Math_ApproachS(&this->unk178, 0, 0x14, 0x100); + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EFAB4.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EFE50.s") +void func_809EFE50(Actor* thisx, PlayState* play2) { + PlayState* play = play2; + Boss05* this = THIS; + u8 var_a2 = 0; + ColliderInfo* temp; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0014.s") + if ((this->unk16A == 0) && (this->unk368.elements[0].info.bumperFlags & BUMP_HIT)) { + this->unk368.elements[0].info.bumperFlags &= ~BUMP_HIT; + temp = this->unk368.elements[0].info.acHitInfo; + if (temp->toucher.dmgFlags & 0x300000) { // (DMG_NORMAL_SHIELD | DMG_LIGHT_RAY) + this->unk338 = -12.0f; + this->unk348 = this->dyna.actor.yawTowardsPlayer; + this->unk16A = 6; + return; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0058.s") + this->unk16A = 0xA; + this->dyna.actor.speedXZ = 0.0f; + this->unk338 = -20.0f; + this->unk348 = this->dyna.actor.yawTowardsPlayer; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F00CC.s") + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_DAMAGE); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F010C.s") + switch (this->dyna.actor.colChkInfo.damageEffect) { + case 1: + func_809F0A0C(this, play); + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F01CC.s") + case 2: + this->unk188 = 1; + var_a2 = 1; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0244.s") + case 3: + func_809F0A64(this, play); + this->unk188 = 0xA; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F02D0.s") + case 4: + this->unk188 = 0x14; + var_a2 = 1; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0374.s") + default: + var_a2 = 1; + break; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0474.s") + if (var_a2 != 0) { + u8 damage; // Probably fake? -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F04C0.s") + if ((this->actionFunc == func_809F0ABC) && (this->unk189 == 0xA) && (this->unk17A != 0)) { + func_809EE4E0(this, play); + this->unk188 = 0; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0538.s") + damage = this->dyna.actor.colChkInfo.damage; + this->dyna.actor.colChkInfo.health -= damage; + if ((s8)this->dyna.actor.colChkInfo.health <= 0) { + Enemy_StartFinishingBlow(play, &this->dyna.actor); + } + func_809F0708(this, play); + this->unk16C = 0xF; + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0590.s") +s32 func_809F0014(Boss05* this, PlayState* play) { + s16 var_v1 = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0650.s") + if (ABS_ALT(var_v1) < 0x3000) { + return true; + } else { + return false; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F06B8.s") +void func_809F0058(Boss05* this, PlayState* play) { + if (func_809F0014(this, play) && (this->dyna.actor.xyzDistToPlayerSq <= SQ(200.0f)) && + (fabsf(this->dyna.actor.playerHeightRel) < 70.0f)) { + func_809F0474(this, play); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0708.s") +void func_809F00CC(Boss05* this, PlayState* play) { + this->actionFunc = func_809F010C; + Animation_MorphToPlayOnce(&this->unk3C8, &D_06006E50, -5.0f); +} + +void func_809F010C(Boss05* this, PlayState* play) { + SkelAnime_Update(&this->unk3C8); + Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 2, 0x400); + Math_ApproachS(&this->dyna.actor.shape.rot.z, 0, 2, 0x400); + Math_ApproachF(&this->unk360, 1.0f, 1.0f, 0.5f); + Math_ApproachF(&this->unk364, 1.0f, 1.0f, 0.14f); + if (this->unk364 == 1.0f) { + func_809F01CC(this, play); + } +} + +void func_809F01CC(Boss05* this, PlayState* play) { + this->actionFunc = func_809F0244; + Animation_MorphToLoop(&this->unk3C8, &D_06007488, -10.0f); + this->unk162[0] = (s32)(Rand_ZeroFloat(25.0f) + 25.0f); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA1_MOUTH); +} + +void func_809F0244(Boss05* this, PlayState* play) { + SkelAnime_Update(&this->unk3C8); + Math_ApproachZeroF(&this->dyna.actor.speedXZ, 1.0f, 2.5f); + Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 2, 0x400); + Math_ApproachS(&this->dyna.actor.shape.rot.z, 0, 2, 0x400); + + if (this->unk162[0] == 0) { + func_809F02D0(this, play); + } + + func_809F0058(this, play); +} + +void func_809F02D0(Boss05* this, PlayState* play) { + this->actionFunc = func_809F0374; + Animation_MorphToLoop(&this->unk3C8, &D_06007908, 0.0f); + this->unk162[0] = (s32)(Rand_ZeroFloat(80.0f) + 60.0f); + this->unk34C = randPlusMinusPoint5Scaled(400.0f) + this->dyna.actor.world.pos.x; + this->unk354 = randPlusMinusPoint5Scaled(400.0f) + this->dyna.actor.world.pos.z; + this->unk358 = 0.0f; +} + +void func_809F0374(Boss05* this, PlayState* play) { + f32 sp24; + f32 sp20; + + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_WALK - SFX_FLAG); + SkelAnime_Update(&this->unk3C8); + Math_ApproachF(&this->dyna.actor.speedXZ, 5.0f, 1.0f, 2.0f); + sp24 = this->unk34C - this->dyna.actor.world.pos.x; + sp20 = this->unk354 - this->dyna.actor.world.pos.z; + Math_ApproachS(&this->dyna.actor.world.rot.y, Math_Atan2S(sp24, sp20), 5, (s32)this->unk358); + Math_ApproachF(&this->unk358, 2000.0f, 1.0f, 100.0f); + + if ((this->unk162[0] == 0) || ((SQ(sp24) + SQ(sp20)) < 2500.0f)) { + func_809F01CC(this, play); + } + + func_809F0058(this, play); +} + +void func_809F0474(Boss05* this, PlayState* play) { + this->actionFunc = func_809F04C0; + Animation_MorphToPlayOnce(&this->unk3C8, &D_06003448, 0.0f); + this->unk162[0] = 20; +} + +void func_809F04C0(Boss05 *this, PlayState *play) { + SkelAnime_Update(&this->unk3C8); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_VOICE - SFX_FLAG); + Math_ApproachZeroF(&this->dyna.actor.speedXZ, 1.0f, 2.5f); + Math_ApproachS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 5, 0x1000); + if (this->unk162[0] == 0) { + func_809F0538(this, play); + } +} + +void func_809F0538(Boss05 *this, PlayState *arg1) { + this->actionFunc = func_809F0590; + Animation_MorphToLoop(&this->unk3C8, &D_06000A5C, 0.0f); + this->unk162[0] = 60; + this->unk358 = 0.0f; +} + +void func_809F0590(Boss05 *this, PlayState *play) { + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_VOICE - SFX_FLAG); + SkelAnime_Update(&this->unk3C8); + Math_ApproachF(&this->dyna.actor.speedXZ, 8.0f, 1.0f, 4.0f); + Math_ApproachS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 5, (s32) this->unk358); + Math_ApproachF(&this->unk358, 4000.0f, 1.0f, 400.0f); + if ((this->unk162[0] == 0) || (this->dyna.actor.xyzDistToPlayerSq <= 22500.0f)) { + func_809F0650(this, play); + } +} + +void func_809F0650(Boss05 *this, PlayState *arg1) { + this->actionFunc = func_809F06B8; + Animation_MorphToPlayOnce(&this->unk3C8, &D_060006A4, 0.0f); + this->unk4FC = Animation_GetLastFrame(&D_060006A4); + Actor_PlaySfxAtPos(this, NA_SE_EN_MIZUBABA2_ATTACK); +} + +void func_809F06B8(Boss05 *this, PlayState *play) { + SkelAnime_Update(&this->unk3C8); + if (Animation_OnFrame(&this->unk3C8, this->unk4FC)) { + func_809F01CC(this, play); + } +} + +void func_809F0708(Boss05 *this, PlayState *play) { + this->actionFunc = func_809F0780; + Animation_MorphToPlayOnce(&this->unk3C8, &D_06002F0C, 0.0f); + this->unk4FC = Animation_GetLastFrame(&D_060006A4); + Actor_SetColorFilter(&this->dyna.actor, 0x4000U, 120, 0, 30); +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0780.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0A0C.s") +void func_809F0A0C(Boss05* this, PlayState* play) { + this->actionFunc = func_809F0ABC; + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_DAMAGE); + this->unk162[0] = 40; + Actor_SetColorFilter(&this->dyna.actor, 0, 120, 0, 40); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0A64.s") +void func_809F0A64(Boss05* this, PlayState* play) { + this->actionFunc = func_809F0ABC; + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_DAMAGE); + this->unk162[0] = 80; + Actor_SetColorFilter(&this->dyna.actor, 0, 120, 0, 80); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0ABC.s") +void func_809F0ABC(Boss05* this, PlayState* play) { + Math_ApproachZeroF(&this->dyna.actor.speedXZ, 1.0f, 2.5f); + if (this->unk162[0] == 0) { + func_809F01CC(this, play); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0B0C.s") +void func_809F0B0C(Boss05* this, PlayState* play) { + Actor_MoveWithGravity(&this->dyna.actor); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/Boss05_Update.s") + if (this->unk15C == 0) { + Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x44); + if (this->dyna.actor.bgCheckFlags & 0x20) { + this->unk15C = 1; + } else { + this->unk15C = 2; + } + } + + if (this->unk15C == 1) { + Math_ApproachF(&this->dyna.actor.velocity.y, 1.0f, 1.0f, 0.1f); + Math_ApproachZeroF(&this->dyna.actor.speedXZ, 0.5f, 0.5f); + this->dyna.actor.shape.rot.x += this->unk500; + this->dyna.actor.shape.rot.y += this->unk502; + + if (this->unk162[0] == 0) { + Actor_MarkForDeath(&this->dyna.actor); + } + } else { + switch (this->unk15C) { + case 2: + this->dyna.actor.velocity.y = Rand_ZeroFloat(3.0f) + 3.0f; + this->dyna.actor.speedXZ = randPlusMinusPoint5Scaled(5.0f) + 5.0f; + this->dyna.actor.world.rot.y = (s32)Rand_ZeroFloat(0x10000); + this->dyna.actor.gravity = -1.0f; + this->unk15C = 3; + break; + + case 3: + Actor_MoveWithGravity(&this->dyna.actor); + + if (this->unk324.y < (this->dyna.actor.floorHeight - 30.0f)) { + Actor_MarkForDeath(&this->dyna.actor); + } + break; + + default: + break; + } + } +} + +void Boss05_Update(Actor* thisx, PlayState* play) { + s32 pad; + Boss05* this = (Boss05*)thisx; + s16 var_v0; + + this->unk160++; + + for (var_v0 = 0; var_v0 < 3; var_v0++) { + if (this->unk162[var_v0] != 0) { + this->unk162[var_v0]--; + } + } + + if (this->unk16A != 0) { + this->unk16A--; + } + + if (this->unk16C != 0) { + this->unk16C--; + } + if (this->unk168 != 0) { + this->unk168--; + } + + if (this->unk17A != 0) { + this->unk17A--; + } + + this->actionFunc(this, play); + + if (this->dyna.actor.params == 4) { + Actor_MoveWithGravity(&this->dyna.actor); + Matrix_RotateYS(this->unk348, MTXMODE_NEW); + Matrix_MultVecZ(this->unk338, &this->unk33C); + this->dyna.actor.world.pos.x += this->unk33C.x; + this->dyna.actor.world.pos.z += this->unk33C.z; + Math_ApproachZeroF(&this->unk338, 1.0f, 1.0f); + Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x45); + func_809EFE50(this, play); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk368.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk368.base); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->unk368.base); + this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y; + } + + switch (this->unk188) { + case 0: + this->unk189 = 0; + this->unk17A = 0; + this->unk184 = 0.0f; + break; + + case 1: + this->unk189 = 0; + this->unk17A = 80; + this->unk184 = 1.0f; + this->unk188++; + this->unk17C = 0.0f; + // fallthrough + case 2: + if (this->unk17A == 0) { + Math_ApproachZeroF(&this->unk184, 1.0f, 0.02f); + if (this->unk184 == 0.0f) { + this->unk188 = 0; + } + } else { + Math_ApproachF(&this->unk17C, 1.0f, 0.1f, 0.5f); + } + break; + + case 10: + this->unk189 = 0xA; + this->unk17A = 80; + this->unk184 = 1.0f; + this->unk188++; + this->unk17C = 0.0f; + this->unk180 = 2.0f; + // fallthrough + case 11: + if (this->unk17A == 0) { + func_809EE4E0(this, play); + this->unk188 = 0; + } else { + Math_ApproachF(&this->unk17C, 1.0f, 1.0f, 0.25f); + Math_ApproachF(&this->unk180, 1.0f, 0.1f, 0.1f); + } + break; + + case 20: + this->unk189 = 0x14; + this->unk17A = 80; + this->unk184 = 1.0f; + this->unk188++; + this->unk17C = 0.0f; + break; + + case 21: + if (this->unk17A == 0) { + Math_ApproachZeroF(&this->unk17C, 1.0f, 0.03f); + + if (this->unk17C == 0.0f) { + this->unk188 = 0; + this->unk184 = 0.0f; + } + } else { + Math_ApproachF(&this->unk17C, 1.0f, 0.5f, 0.5f); + } + break; + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F1050.s") @@ -263,3 +755,1550 @@ extern UNK_TYPE D_06007908; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F1550.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/Boss05_Draw.s") + +// typedef struct Boss05 { +// /* 0x000 */ DynaPolyActor dyna; +// /* 0x15C */ u8 unk15C; +// /* 0x15D */ char pad15D[1]; +// /* 0x15E */ s16 unk15E; /* inferred */ +// /* 0x160 */ s16 unk160; +// /* 0x162 */ s16 unk162[3]; +// /* 0x168 */ s16 unk168; +// /* 0x16A */ s16 unk16A; +// /* 0x16C */ s16 unk16C; +// /* 0x16E */ char pad16E[2]; +// /* 0x170 */ void (*actionFunc)(Boss05 *, PlayState *); +// /* 0x174 */ u8 unk174; /* inferred */ +// /* 0x175 */ char pad175[1]; +// /* 0x176 */ s16 unk176; +// /* 0x178 */ s16 unk178; +// /* 0x17A */ s16 unk17A; +// /* 0x17C */ f32 unk17C; +// /* 0x180 */ f32 unk180; +// /* 0x184 */ f32 unk184; +// /* 0x188 */ u8 unk188; +// /* 0x189 */ u8 unk189; +// /* 0x18A */ char pad18A[2]; /* maybe part of unk189[3]? */ +// /* 0x18C */ Vec3f unk18C; +// /* 0x198 */ f32 unk198; +// /* 0x19C */ s16 unk19C; /* inferred */ +// /* 0x19E */ s16 unk19E; /* inferred */ +// /* 0x1A0 */ s16 unk1A0; /* inferred */ +// /* 0x1A2 */ s16 unk1A2; /* inferred */ +// /* 0x1A4 */ char pad1A4[0x24]; /* maybe part of unk1A2[0x13]? */ +// /* 0x1C8 */ ColliderJntSph unk1C8; +// /* 0x1E8 */ ColliderJntSphElement unk1E8[2]; +// /* 0x268 */ SkelAnime unk268; +// /* 0x2AC */ Vec3s unk2AC[0xA]; +// /* 0x2E8 */ Vec3s unk2E8[0xA]; +// /* 0x324 */ Vec3f unk324; +// /* 0x330 */ s8 unk330[8]; +// /* 0x338 */ f32 unk338; +// /* 0x33C */ Vec3f unk33C; +// /* 0x348 */ s16 unk348; +// /* 0x34A */ s8 unk34A[0x12]; +// /* 0x35C */ f32 unk35C; +// /* 0x360 */ f32 unk360; /* inferred */ +// /* 0x364 */ f32 unk364; /* inferred */ +// /* 0x368 */ ColliderJntSph unk368; +// /* 0x388 */ ColliderJntSphElement unk388[1]; +// /* 0x3C8 */ SkelAnime unk3C8; +// /* 0x40C */ Vec3s unk40C[0x14]; +// /* 0x484 */ Vec3s unk484[0x14]; +// /* 0x4FC */ f32 unk4FC; +// /* 0x500 */ s16 unk500; +// /* 0x502 */ s16 unk502; +// /* 0x504 */ char pad504[4]; /* maybe part of unk502[3]? */ +// } Boss05; /* size = 0x508 */ + +// void func_809F00CC(Boss05 *arg0, PlayState *arg1); /* static */ +// void func_809F02D0(Boss05 *arg0, PlayState *arg1); /* static */ +// void func_809F0474(Boss05 *arg0, PlayState *arg1); /* static */ +// void func_809F0538(Boss05 *arg0, PlayState *arg1); /* static */ +// void func_809F0650(Boss05 *arg0, PlayState *arg1); /* static */ +// static BgCamInfo D_809F1A20 = { 0, 0, NULL }; +// static SurfaceType D_809F1A28 = { { 0x10000, 0x7C8 } }; +// static CollisionPoly D_809F1A30[0xA]; /* unable to generate initializer */ +// static Vec3s D_809F1AD0[8] = { +// { -0xDAC, 0, -0xDAC }, +// { -0xDAC, 0, 0xDAC }, +// { 0xDAC, 0, 0xDAC }, +// { 0xDAC, 0, -0xDAC }, +// { 0xDAC, -0xFA0, -0xDAC }, +// { -0xDAC, -0xFA0, -0xDAC }, +// { 0xDAC, -0xFA0, 0xDAC }, +// { -0xDAC, -0xFA0, 0xDAC }, +// }; +// static ? D_809F1C60; /* unable to generate initializer */ +// static ? D_809F1C8C; /* unable to generate initializer */ +// static ? D_809F1CB8; /* unable to generate initializer */ +// static s32 D_809F1CC0[1] = { 0x06FFFF00 }; +// static Vec3f D_809F1CC4 = { 0.0f, -1400.0f, 600.0f }; +// static Vec3f D_809F1CD0 = { 1600.0f, -300.0f, 0.0f }; +// static Vec3f D_809F1CDC[5] = { +// { 700.0f, 0.0f, 0.0f }, +// { 3e-45.0f, 4e-45.0f, 1e-45.0f }, +// { 6e-45.0f, 7e-45.0f, 1e-44.0f }, +// { 1.1e-44f, 1.4e-44f, 1.5e-44f }, +// { 1.8e-44f, 2e-44.0f, 2.2e-44f }, +// }; /* extra bytes: 8 */ +// static Vec3f D_809F2110; +// CollisionHeader D_809F1B00 = { +// { -0xDAC, -0xFA0, -0xDAC }, +// { 0xDAC, 0, 0xDAC }, +// 8, +// D_809F1AD0, +// 0xA, +// D_809F1A30, +// &D_809F1A28, +// &D_809F1A20, +// 0, +// NULL, +// }; +// ColliderJntSphElementInit D_809F1B2C[2] = { +// { +// { 3, { 0xF7CFFFFF, 0, 8 }, { 0xF7CFFFFF, 0, 0 }, 9, 1, 1 }, +// { 0, { { 0, 0, 0 }, 0xF }, 0x64 }, +// }, +// { +// { 3, { 0xF7CFFFFF, 0, 8 }, { 0xF7CFFFFF, 0, 0 }, 9, 1, 1 }, +// { 0, { { 0, 0, 0 }, 0xF }, 0x64 }, +// }, +// }; +// ColliderJntSphInit D_809F1B74 = { { 3, 0x11, 9, 9, 0x10, 0 }, 2, D_809F1B2C }; +// ColliderJntSphElementInit D_809F1B84[1] = { +// { +// { 3, { 0xF7CFFFFF, 0, 8 }, { 0xF7CFFFFF, 0, 0 }, 9, 1, 1 }, +// { 0, { { 0, 0, 0 }, 0x14 }, 0x64 }, +// }, +// }; +// ColliderJntSphInit D_809F1BA8 = { { 3, 0x11, 9, 9, 0x10, 0 }, 1, D_809F1B84 }; +// ColliderJntSphElementInit D_809F1BB8[1] = { +// { +// { 3, { 0xF7CFFFFF, 0, 8 }, { 0xF7FFFFFF, 0, 0 }, 9, 1, 1 }, +// { 0, { { 0, 0, 0 }, 0xF }, 0x64 }, +// }, +// }; +// ColliderJntSphInit D_809F1BDC = { { 3, 0x11, 9, 9, 0x10, 0 }, 1, D_809F1BB8 }; +// Color_RGBA8 D_809F1BEC = { 0xAA, 0xFF, 0xFF, 0xFF }; +// Color_RGBA8 D_809F1BF0 = { 0xC8, 0xC8, 0xFF, 0xFF }; +// Vec3f D_809F1BF4 = { 0.0f, -1.0f, 0.0f }; +// DamageTable D_809F1C00 = { +// { +// 0, +// 0xF1, +// 0, +// 0xF1, +// 0xF1, +// 0xF3, +// 0, +// 3, +// 0xF2, +// 0xE1, +// 0xF1, +// 0x21, +// 0x31, +// 0x43, +// 0xF1, +// 0xF1, +// 0xF3, +// 0xF2, +// 0, +// 0xF1, +// 0, +// 0, +// 0xF1, +// 0xF1, +// 0xF1, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0xF1, +// }, +// }; +// DamageTable D_809F1C20 = { +// { +// 0x10, +// 0xF3, +// 0, +// 0xF1, +// 0xF1, +// 0xF1, +// 0, +// 0x10, +// 0xF1, +// 0xF1, +// 0xF1, +// 0x22, +// 0x32, +// 0x42, +// 0xF1, +// 0x10, +// 0xF1, +// 0xF2, +// 0x10, +// 0xF1, +// 0, +// 0, +// 0xF1, +// 0xF1, +// 0xF1, +// 0, +// 0, +// 0x21, +// 0, +// 0, +// 0, +// 0xF1, +// }, +// }; + +// void func_809EE4E0(Boss05 *this, PlayState *play) { +// f32 sp94; +// f32 sp90; +// f32 sp8C; +// f32 sp88; +// f32 sp84; +// f32 sp80; +// s32 var_s1; + +// SoundSource_PlaySfxAtFixedWorldPos(play, &this->unk18C, 0x1EU, 0x28CBU); +// var_s1 = 0; +// do { +// sp80 = randPlusMinusPoint5Scaled(7.0f); +// sp88 = randPlusMinusPoint5Scaled(7.0f); +// sp84 = Rand_ZeroFloat(6.0f) + 4.0f; +// sp8C = this->unk18C.x + sp80; +// sp90 = this->unk18C.y + sp84; +// sp94 = this->unk18C.z + sp88; +// EffectSsEnIce_Spawn(play, (Vec3f *) &sp8C, Rand_ZeroFloat(0.5f) + 0.7f, (Vec3f *) &sp80, &D_809F1BF4, +// &D_809F1BEC, &D_809F1BF0, 0x1E); var_s1 += 1; +// } while (var_s1 != 8); +// } + +// void func_809EE668(s32 arg0, void *arg1, Vec3f *arg2) { +// s32 temp_v0; +// void *temp_v1; + +// temp_v0 = arg0 << 6; +// (arg1->unk1C + temp_v0)->unk30 = (s16) (s32) arg2->x; +// (arg1->unk1C + temp_v0)->unk32 = (s16) (s32) arg2->y; +// (arg1->unk1C + temp_v0)->unk34 = (s16) (s32) arg2->z; +// temp_v1 = arg1->unk1C + temp_v0; +// temp_v1->unk36 = (s16) (s32) (temp_v1->unk38 * (f32) temp_v1->unk2E); +// } + +// void Boss05_Init(Actor *thisx, PlayState *play) { +// CollisionHeader *sp34; +// s16 temp_v0; +// s32 temp_ft0; +// s32 temp_t0; +// Boss05 *this = (Boss05 *) thisx; + +// sp34 = NULL; +// this->dyna.actor.targetMode = 3; +// this->dyna.actor.colChkInfo.mass = 0xFE; +// this->dyna.actor.colChkInfo.health = 2; +// temp_t0 = (s32) Rand_ZeroFloat(1000.0f); +// this->unk35C = 1.0f; +// this->unk160 = (s16) temp_t0; +// this->dyna.actor.gravity = -0.3f; +// Actor_SetScale(&this->dyna.actor, 0.01f); +// temp_v0 = this->dyna.actor.params; +// if ((temp_v0 == 0) || (temp_v0 == 1)) { +// if (this->dyna.actor.world.rot.z == 0) { +// this->dyna.actor.world.rot.z = 0; +// } +// this->dyna.actor.shape.rot.z = 0; +// this->unk168 = this->dyna.actor.world.rot.z; +// this->dyna.actor.colChkInfo.damageTable = &D_809F1C00; +// this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z; +// DynaPolyActor_Init(&this->dyna, 0); +// CollisionHeader_GetVirtual(&D_809F1B00, &sp34); +// this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp34); +// func_809EEDD0(this, play); +// SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 0xA); +// SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 0x14); +// this->unk4FC = (f32) Animation_GetLastFrame(&D_06006484); +// Collider_InitAndSetJntSph(play, &this->unk1C8, &this->dyna.actor, &D_809F1B74, this->unk1E8); +// Collider_InitAndSetJntSph(play, &this->unk368, &this->dyna.actor, &D_809F1BA8, this->unk388); +// if (Flags_GetClear(play, (s32) play->roomCtx.currRoom.num) != 0) { +// this->dyna.actor.params = 2; +// this->actionFunc = func_809EF9BC; +// this->dyna.actor.flags &= ~1; +// func_800BC154(play, &play->actorCtx, &this->dyna.actor, 1U); +// } +// } else { +// if (temp_v0 == 2) { +// this->actionFunc = func_809EF9BC; +// CollisionHeader_GetVirtual(&D_809F1B00, &sp34); +// this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp34); +// SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 0xA); +// this->dyna.actor.flags &= ~1; +// func_800BC154(play, &play->actorCtx, &this->dyna.actor, 1U); +// return; +// } +// if (temp_v0 == 3) { +// this->actionFunc = func_809EFAB4; +// this->unk198 = 1.0f; +// SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 0xA); +// SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 0x14); +// this->unk4FC = (f32) Animation_GetLastFrame(&D_06006484); +// Collider_InitAndSetJntSph(play, &this->unk1C8, &this->dyna.actor, &D_809F1B74, this->unk1E8); +// Collider_InitAndSetJntSph(play, &this->unk368, &this->dyna.actor, &D_809F1BA8, this->unk388); +// ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); +// this->dyna.actor.colChkInfo.damageTable = &D_809F1C00; +// return; +// } +// if (temp_v0 == 4) { +// func_809F00CC(this, play); +// this->dyna.actor.colChkInfo.mass = 0x5A; +// SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 0x14); +// Collider_InitAndSetJntSph(play, &this->unk368, &this->dyna.actor, &D_809F1BDC, this->unk388); +// ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); +// this->dyna.actor.colChkInfo.damageTable = &D_809F1C20; +// this->dyna.actor.flags |= 0x30; +// return; +// } +// if (temp_v0 >= 0xA) { +// SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 0x14); +// this->dyna.actor.gravity = 0.0f; +// this->dyna.actor.world.rot.y = (s16) (s32) Rand_ZeroFloat(32768.0f); +// this->dyna.actor.speedXZ = Rand_ZeroFloat(3.0f) + 3.0f; +// this->dyna.actor.velocity.y = Rand_ZeroFloat(1.5f) + 1.5f; +// this->unk500 = (s16) (s32) randPlusMinusPoint5Scaled(700.0f); +// this->unk502 = (s16) (s32) randPlusMinusPoint5Scaled(1500.0f); +// temp_ft0 = (s32) (Rand_ZeroFloat(30.0f) + 50.0f); +// this->dyna.actor.flags &= ~1; +// this->actionFunc = func_809F0B0C; +// this->unk162[0] = (s16) temp_ft0; +// } +// } +// } + +// void Boss05_Destroy(Actor *thisx, PlayState *play) { +// s16 temp_v0; +// Boss05 *this = (Boss05 *) thisx; + +// temp_v0 = this->dyna.actor.params; +// if ((temp_v0 == 2) || (temp_v0 == 0) || (temp_v0 == 1)) { +// DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); +// } +// } + +// s32 func_809EECBC(Actor *arg0, PlayState *arg1) { +// s32 var_v0; +// u8 temp_v0; +// void *var_v1; + +// var_v0 = 0; +// if (arg0->unk16C == 0) { +// var_v1 = arg0->unk1E4; +// loop_2: +// var_v0 += 0x40; +// if (var_v1->unk16 & 2) { +// temp_v0 = arg0->colChkInfo.damageEffect; +// switch (temp_v0) { /* irregular */ +// case 2: +// return 0xB; +// case 3: +// return 0x14; +// case 4: +// return 0x1E; +// default: +// return 0xA; +// } +// } else { +// var_v1 += 0x40; +// if (var_v0 == 0x80) { +// if (arg0->unk384->unk16 & 2) { +// arg0->colChkInfo.health -= arg0->colChkInfo.damage; +// if ((s8) arg0->colChkInfo.health <= 0) { +// Enemy_StartFinishingBlow(arg1, arg0); +// return 2; +// } +// Actor_PlaySfxAtPos(arg0, 0x3807U); +// arg0->unk16C = 0xF; +// arg0->unk15C = 0; +// arg0->unk162 = 0x1E; +// return 0; +// } +// goto block_16; +// } +// goto loop_2; +// } +// } else { +// block_16: +// return 0; +// } +// } + +// void func_809EEDD0(Boss05 *this, PlayState *play) { +// this->actionFunc = func_809EEDE8; +// } + +// void func_809EEDE8(Boss05 *this, PlayState *play) { +// Actor *sp108; +// u8 sp103; +// ? spD8; +// s32 spD4; +// s32 spD0; +// s32 spCC; +// s32 spC8; +// s32 spC4; +// s32 spC0; +// s32 spBC; +// s32 spB8; +// s32 spB4; +// f32 spA4; +// Vec3f sp94; +// f32 sp80; +// s32 sp74; +// f32 sp70; +// s16 *sp6C; +// s16 *sp60; +// s16 *sp5C; +// ? *temp_t5; +// ? *var_s1; +// ? temp_t2_2; +// ? temp_t4; +// ? temp_t5_4; +// Actor *temp_v0_6; +// Actor *temp_v0_7; +// Actor *temp_v1; +// ActorContext *temp_s0_2; +// CollisionCheckContext *temp_s0_3; +// CollisionCheckContext *temp_s0_4; +// SkelAnime *temp_s0; +// f32 *temp_s1; +// f32 temp_ft4; +// f32 var_fv1; +// s16 var_s4; +// s16 var_s5; +// s16 var_s6; +// s16 var_s7; +// s32 temp_lo; +// s32 temp_v0_5; +// s32 var_s0; +// s32 var_s0_2; +// s32 var_s0_3; +// s32 var_s3; +// s32 var_s3_2; +// s32 var_s4_2; +// s32 var_v1; +// u8 temp_v0; +// u8 temp_v0_2; +// void *temp_t1; +// void *temp_t1_2; +// void *temp_t2; +// void *temp_t2_3; +// void *temp_t2_4; +// void *temp_t3; +// void *temp_t3_2; +// void *temp_t5_2; +// void *temp_t5_3; +// void *temp_t6; +// void *temp_t6_2; +// void *temp_t7; +// void *temp_t8; +// void *temp_t8_2; +// void *temp_t9; +// void *temp_t9_2; +// void *temp_t9_3; +// void *temp_v0_3; +// void *temp_v0_4; + +// sp103 = 0; +// var_s3 = 0; +// sp108 = play->actorCtx.actorLists[2].first; +// temp_v0 = this->unk174; +// this->dyna.actor.hintId = 8; +// var_s0 = 0; +// var_s1 = &spD8; +// if (temp_v0 == 0) { +// spD4 = 0x3E8; +// spD0 = 0x3E80; +// spCC = 0x7D0; +// spC8 = 0x5DC; +// spC4 = 0x1770; +// spC0 = 0xBB8; +// spBC = 0x514; +// spB8 = 0x5208; +// spB4 = 0xDAC; +// var_s6 = 0xA; +// var_s7 = 0x300; +// if (this->unk16C != 0) { +// spD4 = 0x1B58; +// spCC = 0x1770; +// spC0 = 0x1770; +// spBC = 0x1C84; +// spB4 = 0x1964; +// var_s6 = 1; +// var_s7 = 0x1000; +// } +// } else { +// var_s7 = 0; +// if (temp_v0 == 3) { +// spD4 = 0x1B58; +// spD0 = 0x3E80; +// spCC = 0x1388; +// spC8 = 0x5DC; +// spC4 = 0x2328; +// spC0 = 0x1388; +// spBC = 0x1C84; +// spB8 = 0x5208; +// spB4 = 0x157C; +// var_s6 = 1; +// var_s7 = 0x1000; +// } else { +// var_s6 = 0; +// spB4 = 0; +// spB8 = 0; +// spBC = 0; +// spC0 = 0; +// spC4 = 0; +// spC8 = 0; +// spCC = 0; +// spD0 = 0; +// spD4 = 0; +// } +// } +// sp5C = &this->unk1A2; +// sp60 = &this->unk1A0; +// sp6C = &this->unk19E; +// do { +// temp_v0_2 = this->unk174; +// if ((temp_v0_2 == 0) || (temp_v0_2 == 3)) { +// temp_lo = var_s3 * spB8; +// var_s5 = var_s7; +// var_s4 = var_s6; +// sp70 = (f32) spB4; +// if (var_s3 < 3) { +// var_s1->unk2 = 0; +// sp74 = temp_lo; +// sp80 = (f32) spCC; +// var_s1->unk0 = (s16) (s32) (Math_SinS((s16) ((this->unk160 * spD4) + (var_s3 * spD0))) * sp80); +// } else { +// var_s1->unk0 = 0; +// sp74 = temp_lo; +// sp80 = (f32) spC0; +// var_s1->unk2 = (s16) (s32) (Math_SinS((s16) ((this->unk160 * spC8) + (var_s3 * spC4))) * sp80); +// } +// if ((var_s3 == 4) || (var_s3 == 6)) { +// var_s1->unk4 = (s16) (s32) (2.0f * (Math_SinS((s16) ((this->unk160 * spBC) + temp_lo)) * sp70)); +// } else { +// var_s1->unk4 = (s16) (s32) (Math_SinS((s16) ((this->unk160 * spBC) + temp_lo)) * sp70); +// } +// } else { +// if (temp_v0_2 == 1) { +// temp_v0_3 = var_s0 + &D_809F1C60; +// var_s6 = 5; +// var_s7 = 0x1000; +// var_s1->unk0 = (s16) temp_v0_3->unk0; +// var_s1->unk2 = (s16) temp_v0_3->unk2; +// var_s1->unk4 = (s16) temp_v0_3->unk4; +// } else if (temp_v0_2 == 2) { +// temp_v0_4 = var_s0 + &D_809F1C8C; +// var_s6 = 1; +// var_s7 = 0x2000; +// var_s1->unk0 = (s16) temp_v0_4->unk0; +// var_s1->unk2 = (s16) temp_v0_4->unk2; +// var_s1->unk4 = (s16) temp_v0_4->unk4; +// } +// var_s5 = var_s7; +// var_s4 = var_s6; +// } +// Math_ApproachS(sp6C, var_s1->unk0, var_s4, var_s5); +// Math_ApproachS(sp60, var_s1->unk2, var_s4, var_s5); +// Math_ApproachS(sp5C, var_s1->unk4, var_s4, var_s5); +// var_s3 += 1; +// sp5C += 6; +// sp60 += 6; +// sp6C += 6; +// var_s0 += 6; +// var_s1 += 6; +// } while (var_s3 < 7); +// temp_ft4 = (sp108->world.pos.y - this->dyna.actor.world.pos.y) + 10.0f; +// spA4 = temp_ft4; +// if (temp_ft4 < 0.0f) { +// Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, var_s4, var_s5); +// } +// temp_s0 = &this->unk3C8; +// SkelAnime_Update(temp_s0); +// temp_s1 = &this->unk35C; +// Math_ApproachF(temp_s1, 1.0f, 0.1f, 0.1f); +// if (this->unk15C != (u8) 0xA) { +// Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 0x14, 0x800); +// } +// switch (this->unk15C) { /* irregular */ +// case 0: +// this->unk174 = 0; +// this->unk3C8.playSpeed = 1.0f; +// if (spA4 < 0.0f) { +// if (sp108->speedXZ > 10.0f) { +// var_fv1 = 220.0f; +// } else { +// var_fv1 = 150.0f; +// } +// if ((this->unk162[0] == 0) && (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= var_fv1)) { +// this->unk15C = 1; +// this->unk162[0] = 0xA; +// } +// goto block_42; +// } +// sp103 = 1; +// if (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= 40.0f) { +// this->unk15E += 1; +// if (this->unk15E >= 0x1F) { +// this->unk15C = 0xA; +// this->unk162[0] = 0x1E; +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); +// } +// } else { +// block_42: +// this->unk15E = 0; +// } +// if (!(this->unk160 & 3) && (Rand_ZeroOne() < 0.5f)) { +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); +// } +// break; +// case 10: +// if (!(this->unk160 & 1)) { +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); +// } +// this->unk19C = (this->unk162[0] & 1) << 9; +// this->unk174 = 3; +// this->unk3C8.playSpeed = 4.0f; +// Math_ApproachS(&this->dyna.actor.shape.rot.x, -0x8000, 2, 0x2000); +// Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, 2, 0x2000); +// if (this->unk162[0] == 0) { +// this->unk162[0] = 0x64; +// this->unk15E = 0; +// this->unk15C = 0; +// } +// if (this->unk162[0] == 0x1B) { +// Math_Vec3f_Copy(&sp94, &this->dyna.actor.world.pos); +// sp94.y += 40.0f; +// EffectSsGSplash_Spawn(play, &sp94, NULL, NULL, (s16) 1, (s16) 0x7D0); +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x2808U); +// } +// break; +// case 1: +// if (Animation_OnFrame(temp_s0, this->unk4FC) != 0) { +// this->unk3C8.playSpeed = 0.0f; +// } +// this->unk174 = 1; +// if (this->unk162[0] == 0) { +// this->unk15C = 2; +// this->unk162[0] = 0x14; +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); +// } +// break; +// case 2: +// if (!(this->unk160 & 1)) { +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); +// } +// this->unk19C = (this->unk162[0] & 1) << 9; +// this->unk3C8.playSpeed = 4.0f; +// Math_ApproachF(temp_s1, 1.5f, 1.0f, 0.7f); +// this->unk174 = 2; +// if (this->unk162[0] == 0) { +// this->unk15C = 0; +// this->unk162[0] = 0x1E; +// } +// break; +// } +// temp_v0_5 = func_809EECBC(&this->dyna.actor, play); +// var_s4_2 = temp_v0_5; +// if ((temp_v0_5 != 0) || (this->unk168 == 1)) { +// this->dyna.actor.params = 2; +// this->actionFunc = func_809EF9BC; +// this->dyna.actor.flags &= ~1; +// temp_s0_2 = &play->actorCtx; +// func_800BC154(play, temp_s0_2, &this->dyna.actor, 1U); +// if (this->unk168 != 0) { +// var_s4_2 = 0xA; +// } +// if (var_s4_2 >= 0xA) { +// temp_v0_6 = Actor_SpawnAsChild(temp_s0_2, &this->dyna.actor, play, 0x12D, this->dyna.actor.world.pos.x, +// this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, (s16) (s32) this->dyna.actor.shape.rot.x, +// (s16) (s32) this->dyna.actor.shape.rot.y, (s16) (s32) this->dyna.actor.shape.rot.z, 3); if (temp_v0_6 != +// NULL) { +// var_s0_2 = 0; +// temp_v1 = play->actorCtx.actorLists[2].first; +// if (this == temp_v1->unk730) { +// temp_v1->unk730 = temp_v0_6; +// play->actorCtx.targetContext.arrowPointedActor = temp_v0_6; +// play->actorCtx.targetContext.targetedActor = temp_v0_6; +// } +// do { +// temp_t5 = this->unk268.jointTable + var_s0_2; +// temp_t4 = (unaligned s32) temp_t5->unk0; +// temp_t1 = temp_v0_6->unk288 + var_s0_2; +// var_s0_2 += 6; +// temp_t1->unk0 = (unaligned s32) temp_t4; +// temp_t1->unk4 = (u16) temp_t5->unk4; +// } while (var_s0_2 < 0x3C); +// var_s0_3 = 0; +// do { +// temp_t9 = this->unk3C8.jointTable + var_s0_3; +// temp_t7 = temp_v0_6->unk3E8 + var_s0_3; +// temp_t7->unk0 = (unaligned s32) temp_t9->unk0; +// temp_t7->unk4 = (u16) temp_t9->unk4; +// temp_t6 = this->unk3C8.jointTable + var_s0_3; +// temp_t3 = temp_v0_6->unk3E8 + var_s0_3; +// temp_t3->unk6 = (unaligned s32) temp_t6->unk6; +// temp_t3->unkA = (u16) temp_t6->unkA; +// temp_t5_2 = this->unk3C8.jointTable + var_s0_3; +// temp_t2 = temp_v0_6->unk3E8 + var_s0_3; +// temp_t2->unkC = (unaligned s32) temp_t5_2->unkC; +// temp_t2->unk10 = (u16) temp_t5_2->unk10; +// temp_t9_2 = this->unk3C8.jointTable + var_s0_3; +// temp_t2_2 = (unaligned s32) temp_t9_2->unk12; +// temp_t8 = temp_v0_6->unk3E8 + var_s0_3; +// var_s0_3 += 0x18; +// temp_t8->unk12 = (unaligned s32) temp_t2_2; +// temp_t8->unk16 = (u16) temp_t9_2->unk16; +// } while (var_s0_3 != 0x78); +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x381EU); +// if (var_s4_2 >= 0xB) { +// temp_v0_6->unk188 = (s8) (var_s4_2 - 0xA); +// } +// } +// } else { +// var_s3_2 = 0; +// if (var_s4_2 == 2) { +// do { +// temp_v0_7 = Actor_SpawnAsChild(temp_s0_2, &this->dyna.actor, play, 0x12D, this->unk324.x, +// this->unk324.y, this->unk324.z, (s16) (s32) this->unk330, (s16) (s32) this->unk332, (s16) (s32) +// this->unk334, var_s3_2 + 0xA); if (temp_v0_7 != NULL) { +// var_v1 = 0; +// do { +// temp_t2_3 = this->unk3C8.jointTable + var_v1; +// temp_t9_3 = temp_v0_7->unk3E8 + var_v1; +// temp_t9_3->unk0 = (unaligned s32) temp_t2_3->unk0; +// temp_t9_3->unk4 = (u16) temp_t2_3->unk4; +// temp_t8_2 = this->unk3C8.jointTable + var_v1; +// temp_t6_2 = temp_v0_7->unk3E8 + var_v1; +// temp_t6_2->unk6 = (unaligned s32) temp_t8_2->unk6; +// temp_t6_2->unkA = (u16) temp_t8_2->unkA; +// temp_t3_2 = this->unk3C8.jointTable + var_v1; +// temp_t5_3 = temp_v0_7->unk3E8 + var_v1; +// temp_t5_3->unkC = (unaligned s32) temp_t3_2->unkC; +// temp_t5_3->unk10 = (u16) temp_t3_2->unk10; +// temp_t2_4 = this->unk3C8.jointTable + var_v1; +// temp_t5_4 = (unaligned s32) temp_t2_4->unk12; +// temp_t1_2 = temp_v0_7->unk3E8 + var_v1; +// var_v1 += 0x18; +// temp_t1_2->unk12 = (unaligned s32) temp_t5_4; +// temp_t1_2->unk16 = (u16) temp_t2_4->unk16; +// } while (var_v1 != 0x78); +// temp_v0_7->unk162 = (s16) (s32) (Rand_ZeroFloat(20.0f) + 20.0f); +// } +// var_s3_2 += 1; +// } while (var_s3_2 != 2); +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x381FU); +// } +// } +// } +// if (sp103 == 0) { +// temp_s0_3 = &play->colChkCtx; +// CollisionCheck_SetAT(play, temp_s0_3, &this->unk1C8.base); +// CollisionCheck_SetAT(play, temp_s0_3, &this->unk368.base); +// } +// temp_s0_4 = &play->colChkCtx; +// CollisionCheck_SetAC(play, temp_s0_4, &this->unk1C8.base); +// CollisionCheck_SetAC(play, temp_s0_4, &this->unk368.base); +// } + +// void func_809EF9BC(Boss05 *this, PlayState *play) { +// f32 temp_fv0; +// s16 var_a1; +// s32 temp_ft3; + +// temp_fv0 = sqrtf(this->dyna.actor.xyzDistToPlayerSq); +// if ((temp_fv0 < 50.0f) && (play->actorCtx.actorLists[2].first->bgCheckFlags & 1)) { +// temp_ft3 = (s32) (temp_fv0 * 80.0f); +// var_a1 = (s16) temp_ft3; +// if ((s16) temp_ft3 >= 0x7D1) { +// var_a1 = 0x7D0; +// } +// Math_ApproachS(&this->unk178, var_a1, 0x14, 0x7D0); +// Math_ApproachS(&this->unk176, this->dyna.actor.yawTowardsPlayer, 0x14, 0xFA0); +// if (!(this->unk160 & 0xF)) { +// EffectSsGRipple_Spawn(play, &this->dyna.actor.world.pos, 0x1F4, 0x3E8, (s16) 0); +// } +// } else { +// Math_ApproachS(&this->unk178, 0, 0x14, 0x100); +// } +// } + +// void func_809EFAB4(Boss05 *this, PlayState *play) { +// Vec3f sp80; +// f32 sp7C; +// f32 sp78; +// f32 sp74; +// ? temp_t8; +// Actor *temp_v0; +// Actor *temp_v1; +// PosRot *temp_s1; +// s32 var_s1; +// s32 var_v1; +// void *temp_t1; +// void *temp_t3; +// void *temp_t3_2; +// void *temp_t5; +// void *temp_t6; +// void *temp_t7; +// void *temp_t7_2; +// void *temp_t9; + +// Actor_MoveWithGravity(&this->dyna.actor); +// this->dyna.actor.world.pos.y -= 85.0f; +// this->dyna.actor.prevPos.y -= 85.0f; +// Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x44U); +// this->dyna.actor.world.pos.y += 85.0f; +// this->dyna.actor.prevPos.y += 85.0f; +// if (this->dyna.actor.bgCheckFlags & 0x20) { +// this->dyna.actor.gravity = -0.3f; +// this->dyna.actor.terminalVelocity = -5.0f; +// } else { +// this->dyna.actor.gravity = -2.0f; +// this->dyna.actor.terminalVelocity = -20.0f; +// } +// temp_s1 = &this->dyna.actor.world; +// if (this->dyna.actor.bgCheckFlags & 0x40) { +// this->dyna.actor.velocity.y = -3.0f; +// this->dyna.actor.gravity = -0.3f; +// this->dyna.actor.terminalVelocity = -5.0f; +// Math_Vec3f_Copy(&sp80, &temp_s1->pos); +// sp80.y += 20.0f; +// EffectSsGSplash_Spawn(play, &temp_s1->pos, NULL, NULL, (s16) 1, (s16) 0x3E8); +// this->unk162[2] = 0x14; +// } +// var_s1 = 0; +// if (this->unk162[2] != 0) { +// do { +// sp74 = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.x; +// sp78 = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.y; +// sp7C = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.z; +// EffectSsBubble_Spawn(play, (Vec3f *) &sp74, 20.0f, 10.0f, 20.0f, 0.13f); +// var_s1 += 1; +// } while (var_s1 != 3); +// } +// if (this->dyna.actor.bgCheckFlags & 1) { +// if ((this->unk189 == 0xA) && (this->unk17A != 0)) { +// this->unk17A = 0; +// } +// Math_ApproachZeroF(&this->unk198, 1.0f, 0.05f); +// if (this->unk198 == 0.0f) { +// temp_v0 = Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, this->unk324.x, +// this->unk324.y, this->unk324.z, (s16) (s32) this->unk330, (s16) (s32) this->unk332, (s16) (s32) +// this->unk334, 4); if (temp_v0 != NULL) { +// temp_v1 = play->actorCtx.actorLists[2].first; +// if (this == temp_v1->unk730) { +// temp_v1->unk730 = temp_v0; +// play->actorCtx.targetContext.arrowPointedActor = temp_v0; +// play->actorCtx.targetContext.targetedActor = temp_v0; +// } +// var_v1 = 0; +// do { +// temp_t7 = this->unk3C8.jointTable + var_v1; +// temp_t5 = temp_v0->unk3E8 + var_v1; +// temp_t5->unk0 = (unaligned s32) temp_t7->unk0; +// temp_t5->unk4 = (u16) temp_t7->unk4; +// temp_t3 = this->unk3C8.jointTable + var_v1; +// temp_t1 = temp_v0->unk3E8 + var_v1; +// temp_t1->unk6 = (unaligned s32) temp_t3->unk6; +// temp_t1->unkA = (u16) temp_t3->unkA; +// temp_t9 = this->unk3C8.jointTable + var_v1; +// temp_t7_2 = temp_v0->unk3E8 + var_v1; +// temp_t7_2->unkC = (unaligned s32) temp_t9->unkC; +// temp_t7_2->unk10 = (u16) temp_t9->unk10; +// temp_t6 = this->unk3C8.jointTable + var_v1; +// temp_t8 = (unaligned s32) temp_t6->unk12; +// temp_t3_2 = temp_v0->unk3E8 + var_v1; +// var_v1 += 0x18; +// temp_t3_2->unk12 = (unaligned s32) temp_t8; +// temp_t3_2->unk16 = (u16) temp_t6->unk16; +// } while (var_v1 != 0x78); +// Actor_PlaySfxAtPos(temp_v0, 0x3825U); +// } +// Actor_MarkForDeath(&this->dyna.actor); +// } +// } +// } + +// void func_809EFE50(Actor *thisx, PlayState *play2) { +// u8 sp27; +// u8 temp_a0; +// u8 temp_v0; +// u8 var_a2; +// void *temp_v1; + +// if ((thisx->unk16A == 0) && (temp_v1 = thisx->unk384, temp_a0 = temp_v1->unk16, ((temp_a0 & 2) != 0))) { +// temp_v1->unk16 = (u8) (temp_a0 & 0xFFFD); +// if (*thisx->unk384->unk24 & 0x300000) { +// thisx->unk16A = 6; +// thisx->unk338 = -12.0f; +// thisx->unk348 = (s16) thisx->yawTowardsPlayer; +// return; +// } +// thisx->unk16A = 0xA; +// thisx->speedXZ = 0.0f; +// thisx->unk338 = -20.0f; +// thisx->unk348 = (s16) thisx->yawTowardsPlayer; +// sp27 = 0; +// Actor_PlaySfxAtPos(thisx, 0x3807U); +// temp_v0 = thisx->colChkInfo.damageEffect; +// switch (temp_v0) { /* irregular */ +// case 1: +// sp27 = 0; +// func_809F0A0C((Boss05 *) thisx, play2); +// var_a2 = 0; +// break; +// case 2: +// thisx->unk188 = 1; +// default: +// block_13: +// var_a2 = 1; +// break; +// case 3: +// sp27 = 0; +// func_809F0A64((Boss05 *) thisx, play2); +// var_a2 = 0; +// thisx->unk188 = 0xA; +// break; +// case 4: +// thisx->unk188 = 0x14; +// goto block_13; +// } +// if (var_a2 != 0) { +// if ((func_809F0ABC == thisx->unk170) && (thisx->unk189 == 0xA) && (thisx->unk17A != 0)) { +// func_809EE4E0((Boss05 *) thisx, play2); +// thisx->unk188 = 0; +// } +// thisx->colChkInfo.health -= thisx->colChkInfo.damage; +// if ((s8) thisx->colChkInfo.health <= 0) { +// Enemy_StartFinishingBlow(play2, thisx); +// } +// func_809F0708((Boss05 *) thisx, play2); +// thisx->unk16C = 0xF; +// } +// } +// } + +// s32 func_809F0014(PlayState *arg0, ? arg1) { +// s16 temp_v0; +// s16 var_v1; + +// temp_v0 = arg0->unk92 - arg0->unkBE; +// var_v1 = temp_v0; +// if (temp_v0 < 0) { +// var_v1 = -temp_v0; +// } +// if (var_v1 < 0x3000) { +// return 1; +// } +// return 0; +// } + +// void func_809F0058(Boss05 *arg0, PlayState *arg1) { +// if ((func_809F0014(arg1) != 0) && (arg0->dyna.actor.xyzDistToPlayerSq <= 40000.0f) && +// (fabsf(arg0->dyna.actor.playerHeightRel) < 70.0f)) { +// func_809F0474(arg0, arg1); +// } +// } + +// void func_809F00CC(Boss05 *arg0, PlayState *arg1) { +// arg0->actionFunc = func_809F010C; +// Animation_MorphToPlayOnce(arg0 + 0x3C8, &D_06006E50, -5.0f); +// } + +// void func_809F010C(Boss05 *this, PlayState *play) { +// SkelAnime_Update(&this->unk3C8); +// Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 2, 0x400); +// Math_ApproachS(&this->dyna.actor.shape.rot.z, 0, 2, 0x400); +// Math_ApproachF(&this->unk360, 1.0f, 1.0f, 0.5f); +// Math_ApproachF(&this->unk364, 1.0f, 1.0f, 0.14f); +// if (this->unk364 == 1.0f) { +// func_809F01CC(this, play); +// } +// } + +// void func_809F01CC(Boss05 *this, PlayState *play) { +// this->actionFunc = func_809F0244; +// Animation_MorphToLoop(&this->unk3C8, &D_06007488, -10.0f); +// this->unk162[0] = (s16) (s32) (Rand_ZeroFloat(25.0f) + 25.0f); +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); +// } + +// void func_809F0244(Boss05 *this, PlayState *play) { +// SkelAnime_Update(&this->unk3C8); +// Math_ApproachZeroF(&this->dyna.actor.speedXZ, 1.0f, 2.5f); +// Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 2, 0x400); +// Math_ApproachS(&this->dyna.actor.shape.rot.z, 0, 2, 0x400); +// if (this->unk162[0] == 0) { +// func_809F02D0(this, play); +// } +// func_809F0058(this, play); +// } + +// void func_809F02D0(Boss05 *arg0, PlayState *arg1) { +// f32 temp_ft0; + +// arg0->actionFunc = func_809F0374; +// Animation_MorphToLoop(arg0 + 0x3C8, &D_06007908, 0.0f); +// arg0->unk162[0] = (s16) (s32) (Rand_ZeroFloat(80.0f) + 60.0f); +// arg0->unk34C = (f32) (randPlusMinusPoint5Scaled(400.0f) + arg0->dyna.actor.world.pos.x); +// temp_ft0 = randPlusMinusPoint5Scaled(400.0f) + arg0->dyna.actor.world.pos.z; +// arg0->unk358 = 0.0f; +// arg0->unk354 = temp_ft0; +// } + +// void func_809F0374(Boss05 *this, PlayState *play) { +// f32 sp24; +// f32 sp20; +// f32 temp_fa0; +// f32 temp_fa1; + +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3027U); +// SkelAnime_Update(&this->unk3C8); +// Math_ApproachF(&this->dyna.actor.speedXZ, 5.0f, 1.0f, 2.0f); +// temp_fa0 = this->unk34C - this->dyna.actor.world.pos.x; +// temp_fa1 = this->unk354 - this->dyna.actor.world.pos.z; +// sp24 = temp_fa0; +// sp20 = temp_fa1; +// Math_ApproachS(&this->dyna.actor.world.rot.y, Math_Atan2S(temp_fa0, temp_fa1), 5, (s16) (s32) this->unk358); +// Math_ApproachF((f32 *) &this->unk34A[0xE], 2000.0f, 1.0f, 100.0f); +// if ((this->unk162[0] == 0) || (((sp24 * sp24) + (sp20 * sp20)) < 2500.0f)) { +// func_809F01CC(this, play); +// } +// func_809F0058(this, play); +// } + +// void func_809F0474(Boss05 *arg0, PlayState *arg1) { +// arg0->actionFunc = func_809F04C0; +// Animation_MorphToPlayOnce(arg0 + 0x3C8, &D_06003448, 0.0f); +// arg0->unk162[0] = 0x14; +// } + +// void func_809F04C0(Boss05 *this, PlayState *play) { +// SkelAnime_Update(&this->unk3C8); +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3006U); +// Math_ApproachZeroF(&this->dyna.actor.speedXZ, 1.0f, 2.5f); +// Math_ApproachS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 5, 0x1000); +// if (this->unk162[0] == 0) { +// func_809F0538(this, play); +// } +// } + +// void func_809F0538(Boss05 *arg0, PlayState *arg1) { +// arg0->actionFunc = func_809F0590; +// Animation_MorphToLoop(arg0 + 0x3C8, &D_06000A5C, 0.0f); +// arg0->unk162[0] = 0x3C; +// arg0->unk358 = 0.0f; +// } + +// void func_809F0590(Boss05 *this, PlayState *play) { +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3006U); +// SkelAnime_Update(&this->unk3C8); +// Math_ApproachF(&this->dyna.actor.speedXZ, 8.0f, 1.0f, 4.0f); +// Math_ApproachS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 5, (s16) (s32) this->unk358); +// Math_ApproachF((f32 *) &this->unk34A[0xE], 4000.0f, 1.0f, 400.0f); +// if ((this->unk162[0] == 0) || (this->dyna.actor.xyzDistToPlayerSq <= 22500.0f)) { +// func_809F0650(this, play); +// } +// } + +// void func_809F0650(Actor *arg0, PlayState *arg1) { +// arg0->unk170 = func_809F06B8; +// Animation_MorphToPlayOnce(arg0 + 0x3C8, &D_060006A4, 0.0f); +// arg0->unk4FC = (f32) Animation_GetLastFrame(&D_060006A4); +// Actor_PlaySfxAtPos(arg0, 0x3837U); +// } + +// void func_809F06B8(Boss05 *this, PlayState *play) { +// SkelAnime *sp1C; +// SkelAnime *temp_a0; + +// temp_a0 = &this->unk3C8; +// sp1C = temp_a0; +// SkelAnime_Update(temp_a0); +// if (Animation_OnFrame(temp_a0, this->unk4FC) != 0) { +// func_809F01CC(this, play); +// } +// } + +// void func_809F0708(Boss05 *this, PlayState *play) { +// this->actionFunc = func_809F0780; +// Animation_MorphToPlayOnce(&this->unk3C8, &D_06002F0C, 0.0f); +// this->unk4FC = (f32) Animation_GetLastFrame(&D_060006A4); +// Actor_SetColorFilter(&this->dyna.actor, 0x4000U, 0x78U, 0U, (u16) 0x1E); +// } + +// void func_809F0780(Boss05 *this, PlayState *play) { +// f32 sp84; +// f32 sp80; +// f32 sp7C; +// ? temp_t5; +// Actor *temp_v0; +// PosRot *temp_s1_2; +// SkelAnime *temp_s1; +// s32 var_s2; +// s32 var_s2_2; +// s32 var_v1; +// void *temp_t0; +// void *temp_t0_2; +// void *temp_t2; +// void *temp_t3; +// void *temp_t4; +// void *temp_t4_2; +// void *temp_t6; +// void *temp_t8; + +// temp_s1 = &this->unk3C8; +// SkelAnime_Update(temp_s1); +// if ((s8) this->dyna.actor.colChkInfo.health <= 0) { +// var_s2 = 0; +// if (Animation_OnFrame(temp_s1, 22.0f) != 0) { +// do { +// temp_v0 = Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, +// this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, (s16) (s32) +// this->dyna.actor.shape.rot.x, (s16) (s32) this->dyna.actor.shape.rot.y, (s16) (s32) +// this->dyna.actor.shape.rot.z, var_s2 + 0xA); var_s2 += 1; if (temp_v0 != NULL) { +// var_v1 = 0; +// do { +// temp_t4 = this->unk3C8.jointTable + var_v1; +// temp_t2 = temp_v0->unk3E8 + var_v1; +// temp_t2->unk0 = (unaligned s32) temp_t4->unk0; +// temp_t2->unk4 = (u16) temp_t4->unk4; +// temp_t0 = this->unk3C8.jointTable + var_v1; +// temp_t8 = temp_v0->unk3E8 + var_v1; +// temp_t8->unk6 = (unaligned s32) temp_t0->unk6; +// temp_t8->unkA = (u16) temp_t0->unkA; +// temp_t6 = this->unk3C8.jointTable + var_v1; +// temp_t4_2 = temp_v0->unk3E8 + var_v1; +// temp_t4_2->unkC = (unaligned s32) temp_t6->unkC; +// temp_t4_2->unk10 = (u16) temp_t6->unk10; +// temp_t3 = this->unk3C8.jointTable + var_v1; +// temp_t5 = (unaligned s32) temp_t3->unk12; +// temp_t0_2 = temp_v0->unk3E8 + var_v1; +// var_v1 += 0x18; +// temp_t0_2->unk12 = (unaligned s32) temp_t5; +// temp_t0_2->unk16 = (u16) temp_t3->unk16; +// } while (var_v1 != 0x78); +// } +// } while (var_s2 < 0xE); +// var_s2_2 = 0; +// do { +// sp7C = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.x; +// sp80 = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.y; +// sp84 = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.z; +// EffectSsBubble_Spawn(play, (Vec3f *) &sp7C, 20.0f, 10.0f, 20.0f, 0.13f); +// var_s2_2 += 1; +// } while (var_s2_2 != 0x14); +// temp_s1_2 = &this->dyna.actor.world; +// SoundSource_PlaySfxAtFixedWorldPos(play, &temp_s1_2->pos, 0x28U, 0x381FU); +// Actor_MarkForDeath(&this->dyna.actor); +// Item_DropCollectibleRandom(play, NULL, &temp_s1_2->pos, 0xE0); +// } +// } else if (Animation_OnFrame(temp_s1, this->unk4FC) != 0) { +// func_809F0474(this, play); +// } +// } + +// void func_809F0A0C(Boss05 *this, PlayState *play) { +// this->actionFunc = func_809F0ABC; +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3807U); +// this->unk162[0] = 0x28; +// Actor_SetColorFilter(&this->dyna.actor, 0U, 0x78U, 0U, (u16) 0x28); +// } + +// void func_809F0A64(Boss05 *this, PlayState *play) { +// this->actionFunc = func_809F0ABC; +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3807U); +// this->unk162[0] = 0x50; +// Actor_SetColorFilter(&this->dyna.actor, 0U, 0x78U, 0U, (u16) 0x50); +// } + +// void func_809F0ABC(Boss05 *this, PlayState *play) { +// Math_ApproachZeroF(&this->dyna.actor.speedXZ, 1.0f, 2.5f); +// if (this->unk162[0] == 0) { +// func_809F01CC(this, play); +// } +// } + +// void func_809F0B0C(Boss05 *this, PlayState *play) { +// s32 temp_t9; +// u8 var_v0; + +// Actor_MoveWithGravity(&this->dyna.actor); +// var_v0 = this->unk15C; +// if (var_v0 == 0) { +// Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x44U); +// var_v0 = 2U & 0xFF; +// if (this->dyna.actor.bgCheckFlags & 0x20) { +// this->unk15C = 1; +// var_v0 = 1U & 0xFF; +// } else { +// this->unk15C = 2; +// } +// } +// if (var_v0 == 1) { +// Math_ApproachF(&this->dyna.actor.velocity.y, 1.0f, 1.0f, 0.1f); +// Math_ApproachZeroF(&this->dyna.actor.speedXZ, 0.5f, 0.5f); +// this->dyna.actor.shape.rot.x += this->unk500; +// this->dyna.actor.shape.rot.y += this->unk502; +// if (this->unk162[0] == 0) { +// Actor_MarkForDeath(&this->dyna.actor); +// } +// } else { +// switch (var_v0) { /* irregular */ +// case 2: +// this->dyna.actor.velocity.y = Rand_ZeroFloat(3.0f) + 3.0f; +// this->dyna.actor.speedXZ = randPlusMinusPoint5Scaled(5.0f) + 5.0f; +// temp_t9 = (s32) Rand_ZeroFloat(65536.0f); +// this->unk15C = 3; +// this->dyna.actor.gravity = -1.0f; +// this->dyna.actor.world.rot.y = (s16) temp_t9; +// return; +// case 3: +// Actor_MoveWithGravity(&this->dyna.actor); +// if (this->unk324.y < (this->dyna.actor.floorHeight - 30.0f)) { +// Actor_MarkForDeath(&this->dyna.actor); +// } +// return; +// } +// } +// } + +// void Boss05_Update(Actor *thisx, PlayState *play) { +// CollisionCheckContext *sp30; +// ColliderJntSph *sp2C; +// ColliderJntSph *temp_a2; +// CollisionCheckContext *temp_a1; +// s16 temp_a0; +// s16 temp_v0; +// s16 temp_v0_2; +// s16 temp_v0_3; +// s16 temp_v0_4; +// s16 var_v0; +// u8 temp_v0_5; +// void *temp_v1; +// Boss05 *this = (Boss05 *) thisx; + +// var_v0 = 0; +// this->unk160 += 1; +// do { +// temp_v1 = this + (var_v0 * 2); +// temp_a0 = this->unk162[var_v0]; +// var_v0 += 1; +// if (temp_a0 != 0) { +// temp_v1->unk162 = (s16) (temp_a0 - 1); +// } +// } while (var_v0 < 3); +// temp_v0 = this->unk16A; +// if (temp_v0 != 0) { +// this->unk16A = temp_v0 - 1; +// } +// temp_v0_2 = this->unk16C; +// if (temp_v0_2 != 0) { +// this->unk16C = temp_v0_2 - 1; +// } +// temp_v0_3 = this->unk168; +// if (temp_v0_3 != 0) { +// this->unk168 = temp_v0_3 - 1; +// } +// temp_v0_4 = this->unk17A; +// if (temp_v0_4 != 0) { +// this->unk17A = temp_v0_4 - 1; +// } +// this->actionFunc(this, play); +// if (this->dyna.actor.params == 4) { +// Actor_MoveWithGravity(&this->dyna.actor); +// Matrix_RotateYS(this->unk348, MTXMODE_NEW); +// Matrix_MultVecZ(this->unk338, &this->unk33C); +// this->dyna.actor.world.pos.x += this->unk33C.x; +// this->dyna.actor.world.pos.z += this->unk33C.z; +// Math_ApproachZeroF(&this->unk338, 1.0f, 1.0f); +// Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x45U); +// func_809EFE50(&this->dyna.actor, play); +// temp_a2 = &this->unk368; +// temp_a1 = &play->colChkCtx; +// sp30 = temp_a1; +// sp2C = temp_a2; +// CollisionCheck_SetAT(play, temp_a1, &temp_a2->base); +// CollisionCheck_SetAC(play, temp_a1, &temp_a2->base); +// CollisionCheck_SetOC(play, temp_a1, &temp_a2->base); +// this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y; +// } +// temp_v0_5 = this->unk188; +// switch (temp_v0_5) { +// case 0: +// this->unk189 = 0; +// this->unk17A = 0; +// this->unk184 = 0.0f; +// return; +// case 1: +// this->unk189 = 0; +// this->unk17A = 0x50; +// this->unk184 = 1.0f; +// this->unk188 = temp_v0_5 + 1; +// this->unk17C = 0.0f; +// /* fallthrough */ +// case 2: +// if (this->unk17A == 0) { +// Math_ApproachZeroF(&this->unk184, 1.0f, 0.02f); +// if (this->unk184 == 0.0f) { +// this->unk188 = 0; +// return; +// } +// default: +// return; +// } +// Math_ApproachF(&this->unk17C, 1.0f, 0.1f, 0.5f); +// return; +// case 10: +// this->unk189 = 0xA; +// this->unk17A = 0x50; +// this->unk184 = 1.0f; +// this->unk188 = temp_v0_5 + 1; +// this->unk17C = 0.0f; +// this->unk180 = 2.0f; +// /* fallthrough */ +// case 11: +// if (this->unk17A == 0) { +// func_809EE4E0(this, play); +// this->unk188 = 0; +// return; +// } +// Math_ApproachF(&this->unk17C, 1.0f, 1.0f, 0.25f); +// Math_ApproachF(&this->unk180, 1.0f, 0.1f, 0.1f); +// return; +// case 20: +// this->unk189 = 0x14; +// this->unk17A = 0x50; +// this->unk184 = 1.0f; +// this->unk188 = temp_v0_5 + 1; +// this->unk17C = 0.0f; +// return; +// case 21: +// if (this->unk17A == 0) { +// Math_ApproachZeroF(&this->unk17C, 1.0f, 0.03f); +// if (this->unk17C == 0.0f) { +// this->unk188 = 0; +// this->unk184 = 0.0f; +// return; +// } +// } else { +// Math_ApproachF(&this->unk17C, 1.0f, 0.5f, 0.5f); +// } +// break; +// } +// } + +// s32 func_809F1050(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3f *arg3, Vec3s *arg4, Actor *arg5) { +// s8 temp_v1; +// void *temp_a1; + +// if (arg1 == gGameInfo->data[0x500]) { +// if (!(arg5->unk160 & 3)) { +// *arg2 = NULL; +// } +// arg4->x += gGameInfo->data[0x501] << 8; +// arg4->y += gGameInfo->data[0x502] << 8; +// arg4->z += gGameInfo->data[0x503] << 8; +// } +// if ((arg5->params == 1) && (arg1 == 9)) { +// *arg2 = NULL; +// } +// if (arg1 == 2) { +// arg4->x += arg5->unk19C; +// } +// temp_v1 = *(&D_809F1CB8 + arg1); +// if (temp_v1 >= 0) { +// temp_a1 = arg5 + (temp_v1 * 6); +// arg4->x += temp_a1->unk19E; +// arg4->y += temp_a1->unk1A0; +// arg4->z += temp_a1->unk1A2; +// } +// return 0; +// } + +// void func_809F1170(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3s *arg3, Actor *arg4) { +// MtxF sp3C; +// Vec3f sp30; +// Vec3f sp24; +// void *sp20; + +// if (arg1 == 4) { +// Matrix_MultVec3f(&D_809F1CC4, arg4 + 0x324); +// if (func_809EFAB4 == arg4->unk170) { +// Matrix_MultVec3f(&D_809F1CC4, &arg4->focus.pos); +// } +// Matrix_Get(&sp3C); +// Matrix_MtxFToYXZRot(&sp3C, arg4 + 0x330, 0); +// arg4->unk330 = (s16) (arg4->unk330 + 0xF00); +// } +// if (arg1 == 2) { +// Matrix_MultZero(&sp30); +// func_809EE668(0, arg4 + 0x1C8, &sp30); +// } +// if (arg1 == 3) { +// sp20 = arg4 + 0x1C8; +// Matrix_MultVecY(-500.0f, &sp24); +// func_809EE668(1, sp20, &sp24); +// if (func_809EEDE8 == arg4->unk170) { +// Matrix_MultVecY(1500.0f, &arg4->focus.pos); +// } +// } +// } + +// s32 func_809F1284(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3f *arg3, Vec3s *rot, Actor *thisx) { +// return 0; +// } + +// void func_809F12A0(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3s *arg3, Actor *arg4) { +// if (arg1 == 1) { +// Matrix_MultVec3f(&D_809F1CD0, &D_809F2110); +// func_809EE668(0, arg4 + 0x368, &D_809F2110); +// if (arg4->params == 4) { +// Matrix_MultVec3f(D_809F1CDC, &arg4->focus.pos); +// } +// if (arg4->unk188 != 0) { +// Matrix_MultVec3f(D_809F1CDC, arg4 + 0x18C); +// if (arg4->unk189 == 0) { +// arg4->unk190 = (f32) (arg4->unk190 - 15.0f); +// } +// } +// } +// } + +// void func_809F135C(PlayState *arg0, s32 arg1, Actor *arg2) { +// f32 temp_fa0; +// f32 temp_fa0_2; +// f32 temp_fa0_3; + +// if ((arg1 == 2) || (arg1 == 3)) { +// temp_fa0 = arg2->unk35C; +// Matrix_Scale(temp_fa0, 1.0f, temp_fa0, MTXMODE_APPLY); +// } +// if (arg1 == 1) { +// temp_fa0_2 = arg2->unk360; +// Matrix_Scale(temp_fa0_2, temp_fa0_2, temp_fa0_2, MTXMODE_APPLY); +// } +// if ((arg1 >= 4) && (arg1 < 0x14)) { +// temp_fa0_3 = arg2->unk364; +// Matrix_Scale(temp_fa0_3, temp_fa0_3, temp_fa0_3, MTXMODE_APPLY); +// } +// } + +// s32 func_809F1404(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3f *arg3, Vec3s *arg4, Actor *arg5) { +// if ((arg1 >= 3) && (arg1 < 9)) { +// *arg2 = NULL; +// } +// return 0; +// } + +// s32 func_809F1430(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3f *arg3, Vec3s *rot, Actor *thisx) { +// if ((arg1 == 1) || (arg1 == 2) || (arg1 == 9)) { +// *arg2 = NULL; +// } +// return 0; +// } + +// void func_809F1464(PlayState *arg0, s32 arg1, Actor *arg2) { +// f32 temp_fa0; + +// if ((arg1 >= 3) && (arg1 < 9)) { +// temp_fa0 = arg2->unk198; +// Matrix_Scale(temp_fa0, temp_fa0, temp_fa0, MTXMODE_APPLY); +// } +// } + +// s32 func_809F14AC(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3f *arg3, Vec3s *arg4, Actor *arg5) { +// if (arg1 != D_809F1CC0[arg5->params]) { +// *arg2 = NULL; +// } else if ((s32) arg5->unk15C >= 2) { +// arg4->x += arg5->unk160 * 0x3000; +// arg4->y += arg5->unk160 * 0x1A00; +// arg4->z += arg5->unk160 << 0xD; +// } +// return 0; +// } + +// void func_809F1550(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3s *arg3, Actor *arg4) { +// if (arg1 != D_809F1CC0[arg4->params]) { +// Matrix_MultZero(arg4 + 0x324); +// } +// } + +// void Boss05_Draw(Actor *thisx, PlayState *play) { +// GraphicsContext *sp34; +// GraphicsContext *temp_a0; +// s16 temp_v0; +// Boss05 *this = (Boss05 *) thisx; + +// temp_a0 = play->state.gfxCtx; +// sp34 = temp_a0; +// func_8012C28C(temp_a0); +// if (func_809EEDE8 == this->actionFunc) { +// SkelAnime_DrawFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, (s32) this->unk268.dListCount, +// func_809F1050, func_809F1170, &this->dyna.actor); if (this->unk16C & 1) { +// sp34->polyOpa.p = Gfx_SetFog(sp34->polyOpa.p, 0xFF, 0, 0, 0xFF, 0x384, 0x44B); +// } +// Matrix_Translate(this->unk324.x, this->unk324.y, this->unk324.z, MTXMODE_NEW); +// Matrix_RotateYS(this->unk332, MTXMODE_APPLY); +// Matrix_RotateXS(this->unk330, MTXMODE_APPLY); +// Matrix_RotateZS(this->unk334, MTXMODE_APPLY); +// Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY); +// AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); +// SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, (s32) +// this->unk3C8.dListCount, func_809F1284, func_809F12A0, func_809F135C, &this->dyna.actor); +// } else { +// temp_v0 = this->dyna.actor.params; +// if (temp_v0 == 2) { +// Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, +// this->dyna.actor.world.pos.z, MTXMODE_NEW); Matrix_RotateYS(this->unk176, MTXMODE_APPLY); +// Matrix_RotateXS(this->unk178, MTXMODE_APPLY); +// Matrix_RotateYS((s16) (this->unk176 * -1), MTXMODE_APPLY); +// Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_APPLY); +// Matrix_RotateXS(this->dyna.actor.shape.rot.x, MTXMODE_APPLY); +// Matrix_RotateZS(this->dyna.actor.shape.rot.z, MTXMODE_APPLY); +// Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, +// MTXMODE_APPLY); SkelAnime_DrawFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, (s32) +// this->unk268.dListCount, func_809F1404, NULL, &this->dyna.actor); +// } else if (temp_v0 == 3) { +// SkelAnime_DrawTransformFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, (s32) +// this->unk268.dListCount, func_809F1430, func_809F1170, func_809F1464, &this->dyna.actor); +// Matrix_Translate(this->unk324.x, this->unk324.y, this->unk324.z, MTXMODE_NEW); +// Matrix_RotateYS(this->unk332, MTXMODE_APPLY); +// Matrix_RotateXS(this->unk330, MTXMODE_APPLY); +// Matrix_RotateZS(this->unk334, MTXMODE_APPLY); +// Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, +// MTXMODE_APPLY); AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); +// SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, (s32) +// this->unk3C8.dListCount, func_809F1284, func_809F12A0, func_809F135C, &this->dyna.actor); +// Actor_DrawDamageEffects(play, &this->dyna.actor, &this->unk18C, 1, this->unk17C, this->unk180, +// this->unk184, (u8) (s32) this->unk189); +// } else if (temp_v0 == 4) { +// AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); +// if (this->unk16C & 1) { +// sp34->polyOpa.p = Gfx_SetFog(sp34->polyOpa.p, 0xFF, 0, 0, 0xFF, 0x384, 0x44B); +// } +// SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, (s32) +// this->unk3C8.dListCount, func_809F1284, func_809F12A0, func_809F135C, &this->dyna.actor); +// Actor_DrawDamageEffects(play, &this->dyna.actor, &this->unk18C, 1, this->unk17C, this->unk180, +// this->unk184, (u8) (s32) this->unk189); +// } else if (temp_v0 >= 0xA) { +// AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); +// SkelAnime_DrawFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, (s32) +// this->unk3C8.dListCount, func_809F14AC, func_809F1550, &this->dyna.actor); +// } +// } +// sp34->polyOpa.p = func_801660B8(play, sp34->polyOpa.p); +// } diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.h b/src/overlays/actors/ovl_Boss_05/z_boss_05.h index 7a3f29507..d15a4e397 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.h +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.h @@ -7,13 +7,67 @@ struct Boss05; typedef void (*Boss05ActionFunc)(struct Boss05*, PlayState*); +// typedef struct Boss05 { +// /* 0x000 */ DynaPolyActor dyna; +// /* 0x15C */ char unk_15C[0x14]; +// /* 0x170 */ Boss05ActionFunc actionFunc; +// /* 0x174 */ char unk_174[0x394]; +// } Boss05; // size = 0x508 + typedef struct Boss05 { - /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x2C]; + /* 0x000 */ DynaPolyActor dyna; + /* 0x15C */ u8 unk15C; /* inferred */ + /* 0x15D */ char pad15D[3]; /* maybe part of unk15C[4]? */ + /* 0x160 */ s16 unk160; /* inferred */ + /* 0x162 */ s16 unk162[3]; + /* 0x168 */ s16 unk168; /* inferred */ + /* 0x16A */ s16 unk16A; /* inferred */ + /* 0x16C */ s16 unk16C; /* inferred */ + /* 0x16E */ char pad16E[2]; /* 0x170 */ Boss05ActionFunc actionFunc; - /* 0x174 */ char unk_174[0x394]; + /* 0x174 */ char pad174[2]; // possibly this is a Vec3s + /* 0x176 */ s16 unk176; + /* 0x178 */ s16 unk178; + /* 0x17A */ s16 unk17A; /* inferred */ + /* 0x17C */ f32 unk17C; /* inferred */ + /* 0x180 */ f32 unk180; /* inferred */ + /* 0x184 */ f32 unk184; /* inferred */ + /* 0x188 */ u8 unk188; /* inferred */ + /* 0x189 */ u8 unk189; /* inferred */ + /* 0x18A */ char pad18A[2]; /* maybe part of unk189[3]? */ + /* 0x18C */ Vec3f unk18C; + /* 0x198 */ f32 unk198; + /* 0x19C */ char pad19C[0x2C]; /* maybe part of unk198[0xC]? */ + /* 0x1C8 */ ColliderJntSph unk1C8; /* inferred */ + /* 0x1E8 */ ColliderJntSphElement unk1E8[2]; + /* 0x268 */ SkelAnime unk268; + /* 0x2AC */ Vec3s unk2AC[10]; + /* 0x2E8 */ Vec3s unk2E8[10]; + /* 0x324 */ Vec3f unk324; + /* 0x330 */ char unk330[0x8]; // possibly a Vec3f + /* 0x330 */ f32 unk338; + /* 0x33C */ Vec3f unk33C; + /* 0x348 */ s16 unk348; + /* 0x34A */ char unk34A[0x2]; + /* 0x34C */ f32 unk34C; + /* 0x350 */ char unk350[0x4]; + /* 0x35C */ f32 unk354; + /* 0x35C */ f32 unk358; + /* 0x35C */ f32 unk35C; + /* 0x360 */ f32 unk360; + /* 0x364 */ f32 unk364; + /* 0x368 */ ColliderJntSph unk368; + /* 0x388 */ ColliderJntSphElement unk388[1]; + /* 0x3C8 */ SkelAnime unk3C8; + /* 0x40C */ Vec3s unk40C[20]; + /* 0x484 */ Vec3s unk484[20]; + /* 0x4FC */ f32 unk4FC; /* inferred */ + /* 0x500 */ s16 unk500; /* inferred */ + /* 0x502 */ s16 unk502; /* inferred */ + /* 0x504 */ char pad504[4]; /* maybe part of unk502[3]? */ } Boss05; // size = 0x508 + extern const ActorInit Boss_05_InitVars; #endif // Z_BOSS_05_H diff --git a/tools/permuter_settings.toml b/tools/permuter_settings.toml index bf61be341..380acbfc2 100644 --- a/tools/permuter_settings.toml +++ b/tools/permuter_settings.toml @@ -1,3 +1,5 @@ +compiler_type = "ido" + [preserve_macros] "g[DS]P.*" = "void" "gs[DS]P.*" = "void" From d823ec3254f612e4bbed33004b6ee1494787e9f8 Mon Sep 17 00:00:00 2001 From: Elliptic Ellipsis Date: Mon, 19 Sep 2022 01:38:09 +0100 Subject: [PATCH 2/9] Just the hard 3 + 1 left --- src/overlays/actors/ovl_Boss_05/z_boss_05.c | 502 ++++++++++++++------ src/overlays/actors/ovl_Boss_05/z_boss_05.h | 9 +- tools/disasm/variables.txt | 10 +- 3 files changed, 374 insertions(+), 147 deletions(-) diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.c b/src/overlays/actors/ovl_Boss_05/z_boss_05.c index d6285fe19..249bfcc0e 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.c +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.c @@ -27,9 +27,9 @@ void func_809F02D0(Boss05* this, PlayState* play); void func_809F0374(Boss05* this, PlayState* play); void func_809F0474(Boss05* this, PlayState* play); void func_809F04C0(Boss05* this, PlayState* play); -void func_809F0538(Boss05 *this, PlayState *arg1); +void func_809F0538(Boss05* this, PlayState* arg1); void func_809F0590(Boss05* this, PlayState* play); -void func_809F0650(Boss05 *this, PlayState *arg1); +void func_809F0650(Boss05* this, PlayState* arg1); void func_809F06B8(Boss05* this, PlayState* play); void func_809F0708(Boss05* this, PlayState* play); void func_809F0780(Boss05* this, PlayState* play); @@ -218,7 +218,14 @@ void func_809EE4E0(Boss05* this, PlayState* play) { } } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EE668.s") +void func_809EE668(s32 elementIndex, ColliderJntSph* collider, Vec3f* pos) { + collider->elements[elementIndex].dim.worldSphere.center.x = (s32)pos->x; + collider->elements[elementIndex].dim.worldSphere.center.y = (s32)pos->y; + collider->elements[elementIndex].dim.worldSphere.center.z = (s32)pos->z; + + collider->elements[elementIndex].dim.worldSphere.radius = + (s32)(collider->elements[elementIndex].dim.modelSphere.radius * collider->elements[elementIndex].dim.scale); +} void Boss05_Init(Actor* thisx, PlayState* play) { s32 pad; @@ -506,7 +513,7 @@ void func_809F0474(Boss05* this, PlayState* play) { this->unk162[0] = 20; } -void func_809F04C0(Boss05 *this, PlayState *play) { +void func_809F04C0(Boss05* this, PlayState* play) { SkelAnime_Update(&this->unk3C8); Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_VOICE - SFX_FLAG); Math_ApproachZeroF(&this->dyna.actor.speedXZ, 1.0f, 2.5f); @@ -516,39 +523,39 @@ void func_809F04C0(Boss05 *this, PlayState *play) { } } -void func_809F0538(Boss05 *this, PlayState *arg1) { +void func_809F0538(Boss05* this, PlayState* arg1) { this->actionFunc = func_809F0590; Animation_MorphToLoop(&this->unk3C8, &D_06000A5C, 0.0f); this->unk162[0] = 60; this->unk358 = 0.0f; } -void func_809F0590(Boss05 *this, PlayState *play) { +void func_809F0590(Boss05* this, PlayState* play) { Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_VOICE - SFX_FLAG); SkelAnime_Update(&this->unk3C8); Math_ApproachF(&this->dyna.actor.speedXZ, 8.0f, 1.0f, 4.0f); - Math_ApproachS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 5, (s32) this->unk358); + Math_ApproachS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 5, (s32)this->unk358); Math_ApproachF(&this->unk358, 4000.0f, 1.0f, 400.0f); if ((this->unk162[0] == 0) || (this->dyna.actor.xyzDistToPlayerSq <= 22500.0f)) { func_809F0650(this, play); } } -void func_809F0650(Boss05 *this, PlayState *arg1) { +void func_809F0650(Boss05* this, PlayState* arg1) { this->actionFunc = func_809F06B8; Animation_MorphToPlayOnce(&this->unk3C8, &D_060006A4, 0.0f); this->unk4FC = Animation_GetLastFrame(&D_060006A4); - Actor_PlaySfxAtPos(this, NA_SE_EN_MIZUBABA2_ATTACK); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_ATTACK); } -void func_809F06B8(Boss05 *this, PlayState *play) { +void func_809F06B8(Boss05* this, PlayState* play) { SkelAnime_Update(&this->unk3C8); if (Animation_OnFrame(&this->unk3C8, this->unk4FC)) { func_809F01CC(this, play); } } -void func_809F0708(Boss05 *this, PlayState *play) { +void func_809F0708(Boss05* this, PlayState* play) { this->actionFunc = func_809F0780; Animation_MorphToPlayOnce(&this->unk3C8, &D_06002F0C, 0.0f); this->unk4FC = Animation_GetLastFrame(&D_060006A4); @@ -661,7 +668,7 @@ void Boss05_Update(Actor* thisx, PlayState* play) { this->dyna.actor.world.pos.z += this->unk33C.z; Math_ApproachZeroF(&this->unk338, 1.0f, 1.0f); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x45); - func_809EFE50(this, play); + func_809EFE50(&this->dyna.actor, play); CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk368.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk368.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->unk368.base); @@ -734,27 +741,242 @@ void Boss05_Update(Actor* thisx, PlayState* play) { } } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F1050.s") +extern u8 D_809F1CB8[]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F1170.s") +s32 func_809F1050(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + Boss05* this = THIS; + s8 temp_v1; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F1284.s") + if (limbIndex == KREG(32)) { + if (!(this->unk160 & 3)) { + *dList = NULL; + } + rot->x += KREG(33) * 0x100; + rot->y += KREG(34) * 0x100; + rot->z += KREG(35) * 0x100; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F12A0.s") + if ((thisx->params == 1) && (limbIndex == 9)) { + *dList = NULL; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F135C.s") + if (limbIndex == 2) { + rot->x += this->unk19C; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F1404.s") + temp_v1 = D_809F1CB8[limbIndex]; + if (temp_v1 >= 0) { + rot->x = rot->x + this->unk19E[temp_v1].x; + rot->y = rot->y + this->unk19E[temp_v1].y; + rot->z = rot->z + this->unk19E[temp_v1].z; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F1430.s") + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F1464.s") +extern Vec3f D_809F1CC4; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F14AC.s") +void func_809F1170(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + Boss05* this = THIS; + MtxF sp3C; + Vec3f sp30; + Vec3f sp24; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F1550.s") + if (limbIndex == 4) { + Matrix_MultVec3f(&D_809F1CC4, &this->unk324); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/Boss05_Draw.s") + if (this->actionFunc == func_809EFAB4) { + Matrix_MultVec3f(&D_809F1CC4, &this->dyna.actor.focus.pos); + } + + Matrix_Get(&sp3C); + Matrix_MtxFToYXZRot(&sp3C, &this->unk330, false); + this->unk330.x += 0xF00; + } + + if (limbIndex == 2) { + Matrix_MultZero(&sp30); + func_809EE668(0, &this->unk1C8, &sp30); + } + + if (limbIndex == 3) { + Matrix_MultVecY(-500.0f, &sp24); + func_809EE668(1, &this->unk1C8, &sp24); + + if (this->actionFunc == func_809EEDE8) { + Matrix_MultVecY(1500.0f, &thisx->focus.pos); + } + } +} + +s32 func_809F1284(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + return false; +} + +extern Vec3f D_809F1CD0; +extern Vec3f D_809F1CDC; +extern Vec3f D_809F2110; // bss + +void func_809F12A0(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + Boss05* this = THIS; + + if (limbIndex == 1) { + Matrix_MultVec3f(&D_809F1CD0, &D_809F2110); + func_809EE668(0, &this->unk368, &D_809F2110); + if (thisx->params == 4) { + Matrix_MultVec3f(&D_809F1CDC, &thisx->focus.pos); + } + if (this->unk188 != 0) { + Matrix_MultVec3f(&D_809F1CDC, &this->unk18C); + if (this->unk189 == 0) { + this->unk18C.y -= 15.0f; + } + } + } +} + +void func_809F135C(PlayState* play, s32 limbIndex, Actor* thisx) { + Boss05* this = THIS; + + if ((limbIndex == 2) || (limbIndex == 3)) { + Matrix_Scale(this->unk35C, 1.0f, this->unk35C, MTXMODE_APPLY); + } + + if (limbIndex == 1) { + Matrix_Scale(this->unk360, this->unk360, this->unk360, MTXMODE_APPLY); + } + + if ((limbIndex >= 4) && (limbIndex < 20)) { + Matrix_Scale(this->unk364, this->unk364, this->unk364, MTXMODE_APPLY); + } +} + +s32 func_809F1404(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + if ((limbIndex >= 3) && (limbIndex < 9)) { + *dList = NULL; + } + + return false; +} + +s32 func_809F1430(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + if ((limbIndex == 1) || (limbIndex == 2) || (limbIndex == 9)) { + *dList = NULL; + } + + return false; +} + +void func_809F1464(PlayState* play, s32 limbIndex, Actor* thisx) { + Boss05* this = THIS; + + if ((limbIndex >= 3) && (limbIndex < 9)) { + Matrix_Scale(this->unk198, this->unk198, this->unk198, MTXMODE_APPLY); + } +} + +extern s32 D_809F1CE8[]; + +s32 func_809F14AC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + Boss05* this = THIS; + + if (limbIndex != D_809F1CE8[thisx->params - 10]) { + *dList = NULL; + } else if (this->unk15C >= 2) { + rot->x += this->unk160 * 0x3000; + rot->y += this->unk160 * 0x1A00; + rot->z += this->unk160 * 0x2000; + } + return false; +} + +void func_809F1550(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + Boss05* this = THIS; + + if (limbIndex != D_809F1CE8[thisx->params - 10]) { + Matrix_MultZero(&this->unk324); + } +} + +void Boss05_Draw(Actor* thisx, PlayState* play) { + s32 pad; + Boss05* this = THIS; + + OPEN_DISPS(play->state.gfxCtx); + + func_8012C28C(play->state.gfxCtx); + + if (this->actionFunc == func_809EEDE8) { + SkelAnime_DrawFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, this->unk268.dListCount, + func_809F1050, func_809F1170, &this->dyna.actor); + + if (this->unk16C & 1) { + POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); + } + + Matrix_Translate(this->unk324.x, this->unk324.y, this->unk324.z, MTXMODE_NEW); + Matrix_RotateYS(this->unk330.y, MTXMODE_APPLY); + Matrix_RotateXS(this->unk330.x, MTXMODE_APPLY); + Matrix_RotateZS(this->unk330.z, MTXMODE_APPLY); + Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY); + + AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); + + SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, this->unk3C8.dListCount, + func_809F1284, func_809F12A0, func_809F135C, &this->dyna.actor); + } else if (this->dyna.actor.params == 2) { + Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, + MTXMODE_NEW); + Matrix_RotateYS(this->unk176, MTXMODE_APPLY); + Matrix_RotateXS(this->unk178, MTXMODE_APPLY); + Matrix_RotateYS(-this->unk176, MTXMODE_APPLY); + Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_APPLY); + Matrix_RotateXS(this->dyna.actor.shape.rot.x, MTXMODE_APPLY); + Matrix_RotateZS(this->dyna.actor.shape.rot.z, MTXMODE_APPLY); + Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY); + + SkelAnime_DrawFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, this->unk268.dListCount, + func_809F1404, NULL, &this->dyna.actor); + } else if (this->dyna.actor.params == 3) { + SkelAnime_DrawTransformFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, this->unk268.dListCount, + func_809F1430, func_809F1170, func_809F1464, &this->dyna.actor); + + Matrix_Translate(this->unk324.x, this->unk324.y, this->unk324.z, MTXMODE_NEW); + Matrix_RotateYS(this->unk330.y, MTXMODE_APPLY); + Matrix_RotateXS(this->unk330.x, MTXMODE_APPLY); + Matrix_RotateZS(this->unk330.z, MTXMODE_APPLY); + Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY); + + AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); + + SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, this->unk3C8.dListCount, + func_809F1284, func_809F12A0, func_809F135C, &this->dyna.actor); + + Actor_DrawDamageEffects(play, &this->dyna.actor, &this->unk18C, 1, this->unk17C, this->unk180, this->unk184, + this->unk189); + } else if (this->dyna.actor.params == 4) { + AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); + + if (this->unk16C & 1) { + POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); + } + + SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, this->unk3C8.dListCount, + func_809F1284, func_809F12A0, func_809F135C, &this->dyna.actor); + + Actor_DrawDamageEffects(play, &this->dyna.actor, &this->unk18C, 1, this->unk17C, this->unk180, this->unk184, + this->unk189); + } else if (this->dyna.actor.params >= 0xA) { + AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); + + SkelAnime_DrawFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, this->unk3C8.dListCount, + func_809F14AC, func_809F1550, &this->dyna.actor); + } + + POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP); + + CLOSE_DISPS(play->state.gfxCtx); +} // typedef struct Boss05 { // /* 0x000 */ DynaPolyActor dyna; @@ -792,14 +1014,19 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // /* 0x2AC */ Vec3s unk2AC[0xA]; // /* 0x2E8 */ Vec3s unk2E8[0xA]; // /* 0x324 */ Vec3f unk324; -// /* 0x330 */ s8 unk330[8]; +// /* 0x330 */ Vec3s unk330; +// /* 0x336 */ s8 unk336[2]; // /* 0x338 */ f32 unk338; // /* 0x33C */ Vec3f unk33C; // /* 0x348 */ s16 unk348; -// /* 0x34A */ s8 unk34A[0x12]; +// /* 0x34A */ s8 unk34A[2]; +// /* 0x34C */ f32 unk34C; +// /* 0x350 */ s8 unk350[4]; +// /* 0x354 */ f32 unk354; +// /* 0x358 */ f32 unk358; // /* 0x35C */ f32 unk35C; -// /* 0x360 */ f32 unk360; /* inferred */ -// /* 0x364 */ f32 unk364; /* inferred */ +// /* 0x360 */ f32 unk360; +// /* 0x364 */ f32 unk364; // /* 0x368 */ ColliderJntSph unk368; // /* 0x388 */ ColliderJntSphElement unk388[1]; // /* 0x3C8 */ SkelAnime unk3C8; @@ -811,11 +1038,6 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // /* 0x504 */ char pad504[4]; /* maybe part of unk502[3]? */ // } Boss05; /* size = 0x508 */ -// void func_809F00CC(Boss05 *arg0, PlayState *arg1); /* static */ -// void func_809F02D0(Boss05 *arg0, PlayState *arg1); /* static */ -// void func_809F0474(Boss05 *arg0, PlayState *arg1); /* static */ -// void func_809F0538(Boss05 *arg0, PlayState *arg1); /* static */ -// void func_809F0650(Boss05 *arg0, PlayState *arg1); /* static */ // static BgCamInfo D_809F1A20 = { 0, 0, NULL }; // static SurfaceType D_809F1A28 = { { 0x10000, 0x7C8 } }; // static CollisionPoly D_809F1A30[0xA]; /* unable to generate initializer */ @@ -1473,8 +1695,8 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // if (var_s4_2 == 2) { // do { // temp_v0_7 = Actor_SpawnAsChild(temp_s0_2, &this->dyna.actor, play, 0x12D, this->unk324.x, -// this->unk324.y, this->unk324.z, (s16) (s32) this->unk330, (s16) (s32) this->unk332, (s16) (s32) -// this->unk334, var_s3_2 + 0xA); if (temp_v0_7 != NULL) { +// this->unk324.y, this->unk324.z, (s16) (s32) this->unk330.x, (s16) (s32) this->unk330.y, (s16) +// (s32) this->unk330.z, var_s3_2 + 0xA); if (temp_v0_7 != NULL) { // var_v1 = 0; // do { // temp_t2_3 = this->unk3C8.jointTable + var_v1; @@ -1596,8 +1818,8 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // Math_ApproachZeroF(&this->unk198, 1.0f, 0.05f); // if (this->unk198 == 0.0f) { // temp_v0 = Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, this->unk324.x, -// this->unk324.y, this->unk324.z, (s16) (s32) this->unk330, (s16) (s32) this->unk332, (s16) (s32) -// this->unk334, 4); if (temp_v0 != NULL) { +// this->unk324.y, this->unk324.z, (s16) (s32) this->unk330.x, (s16) (s32) this->unk330.y, (s16) (s32) +// this->unk330.z, 4); if (temp_v0 != NULL) { // temp_v1 = play->actorCtx.actorLists[2].first; // if (this == temp_v1->unk730) { // temp_v1->unk730 = temp_v0; @@ -1691,11 +1913,11 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // } // } -// s32 func_809F0014(PlayState *arg0, ? arg1) { +// s32 func_809F0014(Boss05 *this, PlayState *play) { // s16 temp_v0; // s16 var_v1; -// temp_v0 = arg0->unk92 - arg0->unkBE; +// temp_v0 = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y; // var_v1 = temp_v0; // if (temp_v0 < 0) { // var_v1 = -temp_v0; @@ -1706,16 +1928,16 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // return 0; // } -// void func_809F0058(Boss05 *arg0, PlayState *arg1) { -// if ((func_809F0014(arg1) != 0) && (arg0->dyna.actor.xyzDistToPlayerSq <= 40000.0f) && -// (fabsf(arg0->dyna.actor.playerHeightRel) < 70.0f)) { -// func_809F0474(arg0, arg1); +// void func_809F0058(Boss05 *this, PlayState *play) { +// if ((func_809F0014(this, play) != 0) && (this->dyna.actor.xyzDistToPlayerSq <= 40000.0f) && +// (fabsf(this->dyna.actor.playerHeightRel) < 70.0f)) { +// func_809F0474(this, play); // } // } -// void func_809F00CC(Boss05 *arg0, PlayState *arg1) { -// arg0->actionFunc = func_809F010C; -// Animation_MorphToPlayOnce(arg0 + 0x3C8, &D_06006E50, -5.0f); +// void func_809F00CC(Boss05 *this, PlayState *play) { +// this->actionFunc = func_809F010C; +// Animation_MorphToPlayOnce(&this->unk3C8, &D_06006E50, -5.0f); // } // void func_809F010C(Boss05 *this, PlayState *play) { @@ -1747,16 +1969,16 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // func_809F0058(this, play); // } -// void func_809F02D0(Boss05 *arg0, PlayState *arg1) { +// void func_809F02D0(Boss05 *this, PlayState *play) { // f32 temp_ft0; -// arg0->actionFunc = func_809F0374; -// Animation_MorphToLoop(arg0 + 0x3C8, &D_06007908, 0.0f); -// arg0->unk162[0] = (s16) (s32) (Rand_ZeroFloat(80.0f) + 60.0f); -// arg0->unk34C = (f32) (randPlusMinusPoint5Scaled(400.0f) + arg0->dyna.actor.world.pos.x); -// temp_ft0 = randPlusMinusPoint5Scaled(400.0f) + arg0->dyna.actor.world.pos.z; -// arg0->unk358 = 0.0f; -// arg0->unk354 = temp_ft0; +// this->actionFunc = func_809F0374; +// Animation_MorphToLoop(&this->unk3C8, &D_06007908, 0.0f); +// this->unk162[0] = (s16) (s32) (Rand_ZeroFloat(80.0f) + 60.0f); +// this->unk34C = randPlusMinusPoint5Scaled(400.0f) + this->dyna.actor.world.pos.x; +// temp_ft0 = randPlusMinusPoint5Scaled(400.0f) + this->dyna.actor.world.pos.z; +// this->unk358 = 0.0f; +// this->unk354 = temp_ft0; // } // void func_809F0374(Boss05 *this, PlayState *play) { @@ -1773,17 +1995,17 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // sp24 = temp_fa0; // sp20 = temp_fa1; // Math_ApproachS(&this->dyna.actor.world.rot.y, Math_Atan2S(temp_fa0, temp_fa1), 5, (s16) (s32) this->unk358); -// Math_ApproachF((f32 *) &this->unk34A[0xE], 2000.0f, 1.0f, 100.0f); +// Math_ApproachF(&this->unk358, 2000.0f, 1.0f, 100.0f); // if ((this->unk162[0] == 0) || (((sp24 * sp24) + (sp20 * sp20)) < 2500.0f)) { // func_809F01CC(this, play); // } // func_809F0058(this, play); // } -// void func_809F0474(Boss05 *arg0, PlayState *arg1) { -// arg0->actionFunc = func_809F04C0; -// Animation_MorphToPlayOnce(arg0 + 0x3C8, &D_06003448, 0.0f); -// arg0->unk162[0] = 0x14; +// void func_809F0474(Boss05 *this, PlayState *play) { +// this->actionFunc = func_809F04C0; +// Animation_MorphToPlayOnce(&this->unk3C8, &D_06003448, 0.0f); +// this->unk162[0] = 0x14; // } // void func_809F04C0(Boss05 *this, PlayState *play) { @@ -1796,11 +2018,11 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // } // } -// void func_809F0538(Boss05 *arg0, PlayState *arg1) { -// arg0->actionFunc = func_809F0590; -// Animation_MorphToLoop(arg0 + 0x3C8, &D_06000A5C, 0.0f); -// arg0->unk162[0] = 0x3C; -// arg0->unk358 = 0.0f; +// void func_809F0538(Boss05 *this, PlayState *arg1) { +// this->actionFunc = func_809F0590; +// Animation_MorphToLoop(&this->unk3C8, &D_06000A5C, 0.0f); +// this->unk162[0] = 0x3C; +// this->unk358 = 0.0f; // } // void func_809F0590(Boss05 *this, PlayState *play) { @@ -1808,17 +2030,17 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // SkelAnime_Update(&this->unk3C8); // Math_ApproachF(&this->dyna.actor.speedXZ, 8.0f, 1.0f, 4.0f); // Math_ApproachS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 5, (s16) (s32) this->unk358); -// Math_ApproachF((f32 *) &this->unk34A[0xE], 4000.0f, 1.0f, 400.0f); +// Math_ApproachF(&this->unk358, 4000.0f, 1.0f, 400.0f); // if ((this->unk162[0] == 0) || (this->dyna.actor.xyzDistToPlayerSq <= 22500.0f)) { // func_809F0650(this, play); // } // } -// void func_809F0650(Actor *arg0, PlayState *arg1) { -// arg0->unk170 = func_809F06B8; -// Animation_MorphToPlayOnce(arg0 + 0x3C8, &D_060006A4, 0.0f); -// arg0->unk4FC = (f32) Animation_GetLastFrame(&D_060006A4); -// Actor_PlaySfxAtPos(arg0, 0x3837U); +// void func_809F0650(Boss05 *this, PlayState *arg1) { +// this->actionFunc = func_809F06B8; +// Animation_MorphToPlayOnce(&this->unk3C8, &D_060006A4, 0.0f); +// this->unk4FC = (f32) Animation_GetLastFrame(&D_060006A4); +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3837U); // } // void func_809F06B8(Boss05 *this, PlayState *play) { @@ -2101,139 +2323,139 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // } // } -// s32 func_809F1050(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3f *arg3, Vec3s *arg4, Actor *arg5) { +// s32 func_809F1050(PlayState *play, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { // s8 temp_v1; // void *temp_a1; -// if (arg1 == gGameInfo->data[0x500]) { -// if (!(arg5->unk160 & 3)) { -// *arg2 = NULL; +// if (limbIndex == gGameInfo->data[0x500]) { +// if (!(thisx->unk160 & 3)) { +// *dList = NULL; // } -// arg4->x += gGameInfo->data[0x501] << 8; -// arg4->y += gGameInfo->data[0x502] << 8; -// arg4->z += gGameInfo->data[0x503] << 8; +// rot->x += gGameInfo->data[0x501] << 8; +// rot->y += gGameInfo->data[0x502] << 8; +// rot->z += gGameInfo->data[0x503] << 8; // } -// if ((arg5->params == 1) && (arg1 == 9)) { -// *arg2 = NULL; +// if ((thisx->params == 1) && (limbIndex == 9)) { +// *dList = NULL; // } -// if (arg1 == 2) { -// arg4->x += arg5->unk19C; +// if (limbIndex == 2) { +// rot->x += thisx->unk19C; // } -// temp_v1 = *(&D_809F1CB8 + arg1); +// temp_v1 = *(&D_809F1CB8 + limbIndex); // if (temp_v1 >= 0) { -// temp_a1 = arg5 + (temp_v1 * 6); -// arg4->x += temp_a1->unk19E; -// arg4->y += temp_a1->unk1A0; -// arg4->z += temp_a1->unk1A2; +// temp_a1 = thisx + (temp_v1 * 6); +// rot->x += temp_a1->unk19E; +// rot->y += temp_a1->unk1A0; +// rot->z += temp_a1->unk1A2; // } // return 0; // } -// void func_809F1170(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3s *arg3, Actor *arg4) { +// void func_809F1170(PlayState *play, s32 limbIndex, Gfx **dList, Vec3s *rot, Actor *thisx) { // MtxF sp3C; // Vec3f sp30; // Vec3f sp24; // void *sp20; -// if (arg1 == 4) { -// Matrix_MultVec3f(&D_809F1CC4, arg4 + 0x324); -// if (func_809EFAB4 == arg4->unk170) { -// Matrix_MultVec3f(&D_809F1CC4, &arg4->focus.pos); +// if (limbIndex == 4) { +// Matrix_MultVec3f(&D_809F1CC4, thisx + 0x324); +// if (func_809EFAB4 == thisx->unk170) { +// Matrix_MultVec3f(&D_809F1CC4, &thisx->focus.pos); // } // Matrix_Get(&sp3C); -// Matrix_MtxFToYXZRot(&sp3C, arg4 + 0x330, 0); -// arg4->unk330 = (s16) (arg4->unk330 + 0xF00); +// Matrix_MtxFToYXZRot(&sp3C, thisx + 0x330, 0); +// thisx->unk330 = (s16) (thisx->unk330 + 0xF00); // } -// if (arg1 == 2) { +// if (limbIndex == 2) { // Matrix_MultZero(&sp30); -// func_809EE668(0, arg4 + 0x1C8, &sp30); +// func_809EE668(0, thisx + 0x1C8, &sp30); // } -// if (arg1 == 3) { -// sp20 = arg4 + 0x1C8; +// if (limbIndex == 3) { +// sp20 = thisx + 0x1C8; // Matrix_MultVecY(-500.0f, &sp24); // func_809EE668(1, sp20, &sp24); -// if (func_809EEDE8 == arg4->unk170) { -// Matrix_MultVecY(1500.0f, &arg4->focus.pos); +// if (func_809EEDE8 == thisx->unk170) { +// Matrix_MultVecY(1500.0f, &thisx->focus.pos); // } // } // } -// s32 func_809F1284(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3f *arg3, Vec3s *rot, Actor *thisx) { +// s32 func_809F1284(PlayState *play, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { // return 0; // } -// void func_809F12A0(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3s *arg3, Actor *arg4) { -// if (arg1 == 1) { +// void func_809F12A0(PlayState *play, s32 limbIndex, Gfx **dList, Vec3s *rot, Actor *thisx) { +// if (limbIndex == 1) { // Matrix_MultVec3f(&D_809F1CD0, &D_809F2110); -// func_809EE668(0, arg4 + 0x368, &D_809F2110); -// if (arg4->params == 4) { -// Matrix_MultVec3f(D_809F1CDC, &arg4->focus.pos); +// func_809EE668(0, thisx + 0x368, &D_809F2110); +// if (thisx->params == 4) { +// Matrix_MultVec3f(D_809F1CDC, &thisx->focus.pos); // } -// if (arg4->unk188 != 0) { -// Matrix_MultVec3f(D_809F1CDC, arg4 + 0x18C); -// if (arg4->unk189 == 0) { -// arg4->unk190 = (f32) (arg4->unk190 - 15.0f); +// if (thisx->unk188 != 0) { +// Matrix_MultVec3f(D_809F1CDC, thisx + 0x18C); +// if (thisx->unk189 == 0) { +// thisx->unk190 = (f32) (thisx->unk190 - 15.0f); // } // } // } // } -// void func_809F135C(PlayState *arg0, s32 arg1, Actor *arg2) { +// void func_809F135C(PlayState *play, s32 limbIndex, Actor *thisx) { // f32 temp_fa0; // f32 temp_fa0_2; // f32 temp_fa0_3; -// if ((arg1 == 2) || (arg1 == 3)) { -// temp_fa0 = arg2->unk35C; +// if ((limbIndex == 2) || (limbIndex == 3)) { +// temp_fa0 = thisx->unk35C; // Matrix_Scale(temp_fa0, 1.0f, temp_fa0, MTXMODE_APPLY); // } -// if (arg1 == 1) { -// temp_fa0_2 = arg2->unk360; +// if (limbIndex == 1) { +// temp_fa0_2 = thisx->unk360; // Matrix_Scale(temp_fa0_2, temp_fa0_2, temp_fa0_2, MTXMODE_APPLY); // } -// if ((arg1 >= 4) && (arg1 < 0x14)) { -// temp_fa0_3 = arg2->unk364; +// if ((limbIndex >= 4) && (limbIndex < 0x14)) { +// temp_fa0_3 = thisx->unk364; // Matrix_Scale(temp_fa0_3, temp_fa0_3, temp_fa0_3, MTXMODE_APPLY); // } // } -// s32 func_809F1404(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3f *arg3, Vec3s *arg4, Actor *arg5) { -// if ((arg1 >= 3) && (arg1 < 9)) { -// *arg2 = NULL; +// s32 func_809F1404(PlayState *play, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { +// if ((limbIndex >= 3) && (limbIndex < 9)) { +// *dList = NULL; // } // return 0; // } -// s32 func_809F1430(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3f *arg3, Vec3s *rot, Actor *thisx) { -// if ((arg1 == 1) || (arg1 == 2) || (arg1 == 9)) { -// *arg2 = NULL; +// s32 func_809F1430(PlayState *play, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { +// if ((limbIndex == 1) || (limbIndex == 2) || (limbIndex == 9)) { +// *dList = NULL; // } // return 0; // } -// void func_809F1464(PlayState *arg0, s32 arg1, Actor *arg2) { +// void func_809F1464(PlayState *play, s32 limbIndex, Actor *thisx) { // f32 temp_fa0; -// if ((arg1 >= 3) && (arg1 < 9)) { -// temp_fa0 = arg2->unk198; +// if ((limbIndex >= 3) && (limbIndex < 9)) { +// temp_fa0 = thisx->unk198; // Matrix_Scale(temp_fa0, temp_fa0, temp_fa0, MTXMODE_APPLY); // } // } -// s32 func_809F14AC(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3f *arg3, Vec3s *arg4, Actor *arg5) { -// if (arg1 != D_809F1CC0[arg5->params]) { -// *arg2 = NULL; -// } else if ((s32) arg5->unk15C >= 2) { -// arg4->x += arg5->unk160 * 0x3000; -// arg4->y += arg5->unk160 * 0x1A00; -// arg4->z += arg5->unk160 << 0xD; +// s32 func_809F14AC(PlayState *play, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { +// if (limbIndex != D_809F1CC0[thisx->params]) { +// *dList = NULL; +// } else if ((s32) thisx->unk15C >= 2) { +// rot->x += thisx->unk160 * 0x3000; +// rot->y += thisx->unk160 * 0x1A00; +// rot->z += thisx->unk160 << 0xD; // } // return 0; // } -// void func_809F1550(PlayState *arg0, s32 arg1, Gfx **arg2, Vec3s *arg3, Actor *arg4) { -// if (arg1 != D_809F1CC0[arg4->params]) { -// Matrix_MultZero(arg4 + 0x324); +// void func_809F1550(PlayState *play, s32 limbIndex, Gfx **dList, Vec3s *rot, Actor *thisx) { +// if (limbIndex != D_809F1CC0[thisx->params]) { +// Matrix_MultZero(thisx + 0x324); // } // } @@ -2252,9 +2474,9 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // sp34->polyOpa.p = Gfx_SetFog(sp34->polyOpa.p, 0xFF, 0, 0, 0xFF, 0x384, 0x44B); // } // Matrix_Translate(this->unk324.x, this->unk324.y, this->unk324.z, MTXMODE_NEW); -// Matrix_RotateYS(this->unk332, MTXMODE_APPLY); -// Matrix_RotateXS(this->unk330, MTXMODE_APPLY); -// Matrix_RotateZS(this->unk334, MTXMODE_APPLY); +// Matrix_RotateYS(this->unk330.y, MTXMODE_APPLY); +// Matrix_RotateXS(this->unk330.x, MTXMODE_APPLY); +// Matrix_RotateZS(this->unk330.z, MTXMODE_APPLY); // Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY); // AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); // SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, (s32) @@ -2276,9 +2498,9 @@ void Boss05_Update(Actor* thisx, PlayState* play) { // SkelAnime_DrawTransformFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, (s32) // this->unk268.dListCount, func_809F1430, func_809F1170, func_809F1464, &this->dyna.actor); // Matrix_Translate(this->unk324.x, this->unk324.y, this->unk324.z, MTXMODE_NEW); -// Matrix_RotateYS(this->unk332, MTXMODE_APPLY); -// Matrix_RotateXS(this->unk330, MTXMODE_APPLY); -// Matrix_RotateZS(this->unk334, MTXMODE_APPLY); +// Matrix_RotateYS(this->unk330.y, MTXMODE_APPLY); +// Matrix_RotateXS(this->unk330.x, MTXMODE_APPLY); +// Matrix_RotateZS(this->unk330.z, MTXMODE_APPLY); // Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, // MTXMODE_APPLY); AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); // SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, (s32) diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.h b/src/overlays/actors/ovl_Boss_05/z_boss_05.h index d15a4e397..36cfd9a7b 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.h +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.h @@ -37,14 +37,19 @@ typedef struct Boss05 { /* 0x18A */ char pad18A[2]; /* maybe part of unk189[3]? */ /* 0x18C */ Vec3f unk18C; /* 0x198 */ f32 unk198; - /* 0x19C */ char pad19C[0x2C]; /* maybe part of unk198[0xC]? */ + /* 0x19C */ s16 unk19C; + /* 0x19E */ Vec3s unk19E[1]; + // /* 0x1A0 */ s16 unk1A0; + // /* 0x1A2 */ s16 unk1A2; + /* 0x1A4 */ char pad1A4[0x24]; // Some number of other Vec3s in here /* 0x1C8 */ ColliderJntSph unk1C8; /* inferred */ /* 0x1E8 */ ColliderJntSphElement unk1E8[2]; /* 0x268 */ SkelAnime unk268; /* 0x2AC */ Vec3s unk2AC[10]; /* 0x2E8 */ Vec3s unk2E8[10]; /* 0x324 */ Vec3f unk324; - /* 0x330 */ char unk330[0x8]; // possibly a Vec3f + /* 0x330 */ Vec3s unk330; // ? + /* 0x330 */ char unk336[0x2]; /* 0x330 */ f32 unk338; /* 0x33C */ Vec3f unk33C; /* 0x348 */ s16 unk348; diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index ab5318936..223251099 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -10368,11 +10368,11 @@ 0x809F1C40:("Boss_05_InitVars","UNK_TYPE1","",0x1), 0x809F1C60:("D_809F1C60","UNK_TYPE2","",0x2), 0x809F1C8C:("D_809F1C8C","UNK_TYPE2","",0x2), - 0x809F1CB8:("D_809F1CB8","UNK_TYPE1","",0x1), - 0x809F1CC0:("D_809F1CC0","UNK_TYPE1","",0x1), - 0x809F1CC4:("D_809F1CC4","UNK_TYPE1","",0x1), - 0x809F1CD0:("D_809F1CD0","UNK_TYPE1","",0x1), - 0x809F1CDC:("D_809F1CDC","UNK_TYPE1","",0x1), + 0x809F1CB8:("D_809F1CB8","s8","[12]",0xC), + 0x809F1CC4:("D_809F1CC4","Vec3f","",0xC), + 0x809F1CD0:("D_809F1CD0","Vec3f","",0xC), + 0x809F1CDC:("D_809F1CDC","Vec3f","",0xC), + 0x809F1CE8:("D_809F1CE8","s32","[]",0x38), 0x809F1D20:("D_809F1D20","f32","",0x4), 0x809F1D24:("D_809F1D24","f32","",0x4), 0x809F1D28:("D_809F1D28","f32","",0x4), From 4a6a66ce62e654a9a46b1dcb5acd1f0ef9bf2646 Mon Sep 17 00:00:00 2001 From: Elliptic Ellipsis Date: Tue, 20 Sep 2022 16:24:55 +0100 Subject: [PATCH 3/9] One left --- src/overlays/actors/ovl_Boss_05/z_boss_05.c | 2312 ++++++++----------- src/overlays/actors/ovl_Boss_05/z_boss_05.h | 7 +- 2 files changed, 966 insertions(+), 1353 deletions(-) diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.c b/src/overlays/actors/ovl_Boss_05/z_boss_05.c index 249bfcc0e..521149654 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.c +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.c @@ -327,14 +327,864 @@ void Boss05_Destroy(Actor* thisx, PlayState* play) { } } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EECBC.s") +s32 func_809EECBC(Boss05* this, PlayState* play) { + if (this->unk16C == 0) { + s32 var_v0 = 0; + ColliderJntSphElement* var_v1 = &this->unk1C8.elements[0]; + + while (true) { + var_v0 += 0x40; + + if (var_v1->info.bumperFlags & BUMP_HIT) { + switch (this->dyna.actor.colChkInfo.damageEffect) { + case 2: + return 11; + case 3: + return 20; + case 4: + return 30; + default: + return 10; + } + } + var_v1++; + + if (var_v0 == 0x80) { + if (this->unk368.elements[0].info.bumperFlags & BUMP_HIT) { + u8 damage = this->dyna.actor.colChkInfo.damage; + this->dyna.actor.colChkInfo.health -= damage; + if ((s8)this->dyna.actor.colChkInfo.health <= 0) { + Enemy_StartFinishingBlow(play, &this->dyna.actor); + return 2; + } else { + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_DAMAGE); + this->unk16C = 15; + this->unk15C = 0; + this->unk162[0] = 30; + return 0; + } + } + + break; + } + } + } + + return 0; +} void func_809EEDD0(Boss05* this, PlayState* play) { this->actionFunc = func_809EEDE8; } +extern Vec3s D_809F1C60[]; +extern Vec3s D_809F1C8C[]; +// Vec3s D_809F1C60[7] = { +// { 0x3200, 0, 0 }, +// { -0x1E00, 0, 0 }, +// { -0x1400, 0, 0 }, +// { 0, 0, 0 }, +// { 0, 0, 0 }, +// { 0, 0, 0 }, +// { 0, 0, 0 }, +// }; + +// Vec3s D_809F1C8C[7] = { +// { -0x3200, 0, 0 }, +// { 0, 0, 0 }, +// { 0x1E00, 0, 0 }, +// { 0, 0, 0 }, +// { 0, 0, 0 }, +// { 0, 0, 0 }, +// { 0, 0, 0 }, +// }; + // The big one -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EEDE8.s") +// #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EEDE8.s") +// struct _m2c_stack_func_809EEDE8 { +// /* 0x000 */ char pad0[0x5C]; +// /* 0x05C */ s16 *sp5C; +// /* 0x060 */ s16 *sp60; +// /* 0x064 */ char pad64[8]; /* maybe part of sp60[3]? */ +// /* 0x06C */ Vec3s *sp6C; +// /* 0x070 */ f32 sp70; +// /* 0x074 */ s32 sp74; +// /* 0x078 */ char pad78[8]; /* maybe part of sp74[3]? */ +// /* 0x080 */ f32 sp80; +// /* 0x084 */ char pad84[0x10]; /* maybe part of sp80[5]? */ +// /* 0x094 */ Vec3f sp94; +// /* 0x0A0 */ char padA0[4]; +// /* 0x0A4 */ f32 spA4; +// /* 0x0A8 */ char padA8[0xC]; /* maybe part of spA4[4]? */ +// /* 0x0B4 */ s32 spB4; +// /* 0x0B8 */ s32 spB8; +// /* 0x0BC */ s32 spBC; +// /* 0x0C0 */ s32 spC0; +// /* 0x0C4 */ s32 spC4; +// /* 0x0C8 */ s32 spC8; +// /* 0x0CC */ s32 spCC; +// /* 0x0D0 */ s32 spD0; +// /* 0x0D4 */ s32 spD4; +// /* 0x0D8 */ Vec3s spD8; +// /* 0x0DE */ char padDE[0x25]; /* maybe part of spD8[7]? */ +// /* 0x103 */ u8 sp103; +// /* 0x104 */ char pad104[4]; /* maybe part of sp103[5]? */ +// /* 0x108 */ Player *sp108; +// /* 0x10C */ char pad10C[4]; +// }; /* size = 0x110 */ + +// Vec3s D_809F1C60[7] = { +// { 0x3200, 0, 0 }, +// { -0x1E00, 0, 0 }, +// { -0x1400, 0, 0 }, +// { 0, 0, 0 }, +// { 0, 0, 0 }, +// { 0, 0, 0 }, +// { 0, 0, 0 }, +// }; +// Vec3s D_809F1C8C[7] = { +// { -0x3200, 0, 0 }, +// { 0, 0, 0 }, +// { 0x1E00, 0, 0 }, +// { 0, 0, 0 }, +// { 0, 0, 0 }, +// { 0, 0, 0 }, +// { 0, 0, 0 }, +// }; + +extern Vec3s D_809F1C60[]; +extern Vec3s D_809F1C8C[]; + +void func_809EEDE8(Boss05 *this, PlayState *play) { + s32 pad; + + Player *sp108; + + s32 pad1; + + u8 sp103; + Vec3s spD8[7]; + s32 spD4; + s32 spD0; + s32 spCC; + s32 spC8; + s32 spC4; + s32 spC0; + s32 spBC; + s32 spB8; + s32 spB4; + + s32 pad2; + + f32 spA4; + Vec3f sp94; + // f32 sp80; + // s32 sp74; + // f32 sp70; + // Vec3s *sp6C; + // s16 *sp60; + // s16 *sp5C; + // ? *temp_t5; + // ? temp_t2_2; + // ? temp_t4; + // ? temp_t5_4; + // Boss05 *temp_v0_6; + // Boss05 *temp_v0_7; + // Player *temp_v1; + // ActorContext *temp_s0_2; + // CollisionCheckContext *temp_s0_3; + // CollisionCheckContext *temp_s0_4; + // SkelAnime *temp_s0; + // Vec3s *var_s1; + // f32 *temp_s1; + // f32 temp_ft4; + f32 var_fv1; + // s16 var_s4; + // s16 var_s5; + s16 var_s6; + s16 var_s7; + // s32 temp_lo; + // s32 temp_v0_5; + // s32 var_s0; + s32 var_s0_2; + s32 var_s0_3; + s32 var_s3; + // s32 var_s3_2; + s32 var_s4_2; + s32 var_v1; + // u8 temp_v0; + // u8 temp_v0_2; + // void *temp_t1; + // void *temp_t1_2; + // void *temp_t2; + // void *temp_t2_3; + // void *temp_t2_4; + // void *temp_t3; + // void *temp_t3_2; + // void *temp_t5_2; + // void *temp_t5_3; + // void *temp_t6; + // void *temp_t6_2; + // void *temp_t7; + // void *temp_t8; + // void *temp_t8_2; + // void *temp_t9; + // void *temp_t9_2; + // void *temp_t9_3; + // Vec3s *temp_v0_3; + // Vec3s *temp_v0_4; + + + + sp108 = GET_PLAYER(play); + sp103 = 0; + // var_s3 = 0; + // temp_v0 = this->unk174; + this->dyna.actor.hintId = 8; + // var_s0 = 0; + // var_s1 = spD8; + if (this->unk174 == 0) { + spD4 = 0x3E8; + spD0 = 0x3E80; + spCC = 0x7D0; + spC8 = 0x5DC; + spC4 = 0x1770; + spC0 = 0xBB8; + spBC = 0x514; + spB8 = 0x5208; + spB4 = 0xDAC; + var_s6 = 0xA; + var_s7 = 0x300; + if (this->unk16C != 0) { + spD4 = 0x1B58; + spCC = 0x1770; + spC0 = 0x1770; + spBC = 0x1C84; + spB4 = 0x1964; + var_s6 = 1; + var_s7 = 0x1000; + } + } else { + if (this->unk174 == 3) { + spD4 = 0x1B58; + spD0 = 0x3E80; + spCC = 0x1388; + spC8 = 0x5DC; + spC4 = 0x2328; + spC0 = 0x1388; + spBC = 0x1C84; + spB8 = 0x5208; + spB4 = 0x157C; + var_s6 = 1; + var_s7 = 0x1000; + } else { + var_s6 = 0; + var_s7 = 0; + spB4 = 0; + spB8 = 0; + spBC = 0; + spC0 = 0; + spC4 = 0; + spC8 = 0; + spCC = 0; + spD0 = 0; + spD4 = 0; + } + } + + for (var_s3 = 0; var_s3 < 7; var_s3++) { + if ((this->unk174 == 0) || (this->unk174 == 3)) { + if (var_s3 < 3) { + spD8[var_s3].y = 0; + spD8[var_s3].x = (s32) (Math_SinS((this->unk160 * spD4) + (var_s3 * spD0)) * spCC); + } else { + spD8[var_s3].x = 0; + spD8[var_s3].y = (s32) (Math_SinS((this->unk160 * spC8) + (var_s3 * spC4)) * spC0); + } + + if ((var_s3 == 4) || (var_s3 == 6)) { + spD8[var_s3].z = (s32) (2.0f * (Math_SinS((this->unk160 * spBC) + var_s3 * spB8) * spB4)); + } else { + spD8[var_s3].z = (s32) (Math_SinS((this->unk160 * spBC) + var_s3 * spB8) * spB4); + } + } else if (this->unk174 == 1) { + var_s6 = 5; + var_s7 = 0x1000; + spD8[var_s3].x = D_809F1C60[var_s3].x; + spD8[var_s3].y = D_809F1C60[var_s3].y; + spD8[var_s3].z = D_809F1C60[var_s3].z; + } else if (this->unk174 == 2) { + var_s6 = 1; + var_s7 = 0x2000; + spD8[var_s3].x = D_809F1C8C[var_s3].x; + spD8[var_s3].y = D_809F1C8C[var_s3].y; + spD8[var_s3].z = D_809F1C8C[var_s3].z; + } + + Math_ApproachS(&this->unk19E[var_s3].x, spD8[var_s3].x, var_s6, var_s7); + Math_ApproachS(&this->unk19E[var_s3].y, spD8[var_s3].y, var_s6, var_s7); + Math_ApproachS(&this->unk19E[var_s3].z, spD8[var_s3].z, var_s6, var_s7); + + } + + spA4 = (sp108->actor.world.pos.y - this->dyna.actor.world.pos.y) + 10.0f; + if (spA4 < 0.0f) { + Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, var_s6, var_s7); + } + + SkelAnime_Update(&this->unk3C8); + Math_ApproachF(&this->unk35C, 1.0f, 0.1f, 0.1f); + if (this->unk15C != 0xA) { + Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 0x14, 0x800); + } + + switch (this->unk15C) { /* irregular */ + case 0: + this->unk174 = 0; + this->unk3C8.playSpeed = 1.0f; + if (spA4 < 0.0f) { + if (sp108->actor.speedXZ > 10.0f) { + var_fv1 = 220.0f; + } else { + var_fv1 = 150.0f; + } + if ((this->unk162[0] == 0) && (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= var_fv1)) { + this->unk15C = 1; + this->unk162[0] = 0xA; + } + this->unk15E = 0; + // goto block_42; + } else { + + sp103 = 1; + if (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= 40.0f) { + this->unk15E++; + if (this->unk15E > 0x1E) { + this->unk15C = 0xA; + this->unk162[0] = 0x1E; + Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); + } + } else { + // block_42: + this->unk15E = 0; + } + } + if (!(this->unk160 & 3) && (Rand_ZeroOne() < 0.5f)) { + Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); + } + break; + + case 10: + if (!(this->unk160 & 1)) { + Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); + } + this->unk19C = (this->unk162[0] & 1) << 9; + this->unk174 = 3; + this->unk3C8.playSpeed = 4.0f; + Math_ApproachS(&this->dyna.actor.shape.rot.x, -0x8000, 2, 0x2000); + Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, 2, 0x2000); + if (this->unk162[0] == 0) { + this->unk15E = 0; + this->unk15C = 0; + this->unk162[0] = 0x64; + } + if (this->unk162[0] == 0x1B) { + Math_Vec3f_Copy(&sp94, &this->dyna.actor.world.pos); + sp94.y += 40.0f; + EffectSsGSplash_Spawn(play, &sp94, NULL, NULL, 1, 0x7D0); + Actor_PlaySfxAtPos(&this->dyna.actor, 0x2808U); + } + break; + + case 1: + if (Animation_OnFrame(&this->unk3C8, this->unk4FC)) { + this->unk3C8.playSpeed = 0.0f; + } + this->unk174 = 1; + if (this->unk162[0] == 0) { + this->unk15C = 2; + this->unk162[0] = 0x14; + Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); + } + break; + + case 2: + if (!(this->unk160 & 1)) { + Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); + } + this->unk19C = (this->unk162[0] & 1) << 9; + this->unk3C8.playSpeed = 4.0f; + Math_ApproachF(&this->unk35C, 1.5f, 1.0f, 0.7f); + this->unk174 = 2; + if (this->unk162[0] == 0) { + this->unk15C = 0; + this->unk162[0] = 0x1E; + } + break; + } + + var_s4_2 = func_809EECBC(this, play); + if ((var_s4_2 != 0) || (this->unk168 == 1)) { + this->dyna.actor.params = 2; + this->actionFunc = func_809EF9BC; + this->dyna.actor.flags &= ~1; + func_800BC154(play, &play->actorCtx, &this->dyna.actor, 1); + if (this->unk168 != 0) { + var_s4_2 = 0xA; + } + if (var_s4_2 >= 0xA) { + Boss05 *temp_v0_6 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 3); + if (temp_v0_6 != NULL) { + Player* temp_v1 = GET_PLAYER(play); + if (&this->dyna.actor == temp_v1->targetActor) { + temp_v1->targetActor = &temp_v0_6->dyna.actor; + play->actorCtx.targetContext.arrowPointedActor = &temp_v0_6->dyna.actor; + play->actorCtx.targetContext.targetedActor = &temp_v0_6->dyna.actor; + } + + for (var_s0_2 = 0; var_s0_2 < 10; var_s0_2++) { + temp_v0_6->unk268.jointTable[var_s0_2] = this->unk268.jointTable[var_s0_2]; + } + + for (var_s0_2 = 0; var_s0_2 < 20; var_s0_2++) { + temp_v0_6->unk3C8.jointTable[var_s0_2] = this->unk3C8.jointTable[var_s0_2]; + } + + Actor_PlaySfxAtPos(&this->dyna.actor, 0x381EU); + if (var_s4_2 >= 0xB) { + temp_v0_6->unk188 = var_s4_2 - 0xA; + } + } + } else if (var_s4_2 == 2) { + for (var_s3 = 0; var_s3 < 2; var_s3++) { + Boss05 *temp_v0_6 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, this->unk324.x, this->unk324.y, this->unk324.z, this->unk330.x, this->unk330.y, this->unk330.z, var_s3 + 0xA); + if (temp_v0_6 != NULL) { + + for (var_v1 = 0; var_v1 < 20; var_v1++) { + temp_v0_6->unk3C8.jointTable[var_v1] = this->unk3C8.jointTable[var_v1]; + } + + temp_v0_6->unk162[0] = (s32) (Rand_ZeroFloat(20.0f) + 20.0f); + } + } + Actor_PlaySfxAtPos(&this->dyna.actor, 0x381FU); + } + + } + + if (sp103 == 0) { + CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk1C8.base); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk368.base); + } + + CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk1C8.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk368.base); +} +// void func_809EEDE8(Boss05 *this, PlayState *play) { +// Player *sp108; +// u8 sp103; +// Vec3s spD8; +// s32 spD4; +// s32 spD0; +// s32 spCC; +// s32 spC8; +// s32 spC4; +// s32 spC0; +// s32 spBC; +// s32 spB8; +// s32 spB4; +// f32 spA4; +// Vec3f sp94; +// f32 sp80; +// s32 sp74; +// f32 sp70; +// Vec3s *sp6C; +// s16 *sp60; +// s16 *sp5C; +// // ? *temp_t5; +// // ? temp_t2_2; +// // ? temp_t4; +// // ? temp_t5_4; +// Boss05 *temp_v0_6; +// Boss05 *temp_v0_7; +// Player *temp_v1; +// ActorContext *temp_s0_2; +// // CollisionCheckContext *temp_s0_3; +// // CollisionCheckContext *temp_s0_4; +// SkelAnime *temp_s0; +// Vec3s *var_s1; +// // f32 *temp_s1; +// f32 temp_ft4; +// f32 var_fv1; +// s16 var_s4; +// s16 var_s5; +// s16 var_s6; +// s16 var_s7; +// s32 temp_lo; +// s32 temp_v0_5; +// s32 var_s0; +// s32 var_s0_2; +// s32 var_s0_3; +// s32 var_s3; +// s32 var_s3_2; +// s32 var_s4_2; +// s32 var_v1; +// u8 temp_v0; +// u8 temp_v0_2; +// // void *temp_t1; +// // void *temp_t1_2; +// // void *temp_t2; +// // void *temp_t2_3; +// // void *temp_t2_4; +// // void *temp_t3; +// // void *temp_t3_2; +// // void *temp_t5_2; +// // void *temp_t5_3; +// // void *temp_t6; +// // void *temp_t6_2; +// // void *temp_t7; +// // void *temp_t8; +// // void *temp_t8_2; +// // void *temp_t9; +// // void *temp_t9_2; +// // void *temp_t9_3; +// Vec3s *temp_v0_3; +// Vec3s *temp_v0_4; + +// sp103 = 0; +// var_s3 = 0; +// sp108 = GET_PLAYER(play); +// temp_v0 = this->unk174; +// this->dyna.actor.hintId = 8; +// var_s0 = 0; +// var_s1 = &spD8; +// if (temp_v0 == 0) { +// spD4 = 0x3E8; +// spD0 = 0x3E80; +// spCC = 0x7D0; +// spC8 = 0x5DC; +// spC4 = 0x1770; +// spC0 = 0xBB8; +// spBC = 0x514; +// spB8 = 0x5208; +// spB4 = 0xDAC; +// var_s6 = 0xA; +// var_s7 = 0x300; +// if (this->unk16C != 0) { +// spD4 = 0x1B58; +// spCC = 0x1770; +// spC0 = 0x1770; +// spBC = 0x1C84; +// spB4 = 0x1964; +// var_s6 = 1; +// var_s7 = 0x1000; +// } +// } else { +// var_s7 = 0; +// if (temp_v0 == 3) { +// spD4 = 0x1B58; +// spD0 = 0x3E80; +// spCC = 0x1388; +// spC8 = 0x5DC; +// spC4 = 0x2328; +// spC0 = 0x1388; +// spBC = 0x1C84; +// spB8 = 0x5208; +// spB4 = 0x157C; +// var_s6 = 1; +// var_s7 = 0x1000; +// } else { +// var_s6 = 0; +// spB4 = 0; +// spB8 = 0; +// spBC = 0; +// spC0 = 0; +// spC4 = 0; +// spC8 = 0; +// spCC = 0; +// spD0 = 0; +// spD4 = 0; +// } +// } +// sp5C = &this->unk19E[0].z; +// sp60 = &this->unk19E[0].y; +// sp6C = this->unk19E; +// do { +// // temp_v0_2 = this->unk174; +// if ((this->unk174 == 0) || (this->unk174 == 3)) { +// temp_lo = var_s3 * spB8; +// var_s5 = var_s7; +// var_s4 = var_s6; +// sp70 = (f32) spB4; +// if (var_s3 < 3) { +// var_s1->y = 0; +// sp74 = temp_lo; +// sp80 = (f32) spCC; +// var_s1->x = (s32) (Math_SinS((this->unk160 * spD4) + (var_s3 * spD0)) * sp80); +// } else { +// var_s1->x = 0; +// sp74 = temp_lo; +// sp80 = (f32) spC0; +// var_s1->y = (s32) (Math_SinS((s16) ((this->unk160 * spC8) + (var_s3 * spC4))) * sp80); +// } +// if ((var_s3 == 4) || (var_s3 == 6)) { +// var_s1->z = (s32) (2.0f * (Math_SinS((this->unk160 * spBC) + temp_lo) * sp70)); +// } else { +// var_s1->z = (s32) (Math_SinS((this->unk160 * spBC) + temp_lo) * sp70); +// } +// } else { +// if (this->unk174 == 1) { +// temp_v0_3 = var_s0 + D_809F1C60; +// var_s6 = 5; +// var_s7 = 0x1000; +// var_s1->x = temp_v0_3->x; +// var_s1->y = temp_v0_3->y; +// var_s1->z = temp_v0_3->z; +// } else if (this->unk174 == 2) { +// temp_v0_4 = var_s0 + D_809F1C8C; +// var_s6 = 1; +// var_s7 = 0x2000; +// var_s1->x = temp_v0_4->x; +// var_s1->y = temp_v0_4->y; +// var_s1->z = temp_v0_4->z; +// } +// var_s5 = var_s7; +// var_s4 = var_s6; +// } +// Math_ApproachS(&sp6C->x, var_s1->x, var_s4, var_s5); +// Math_ApproachS(sp60, var_s1->y, var_s4, var_s5); +// Math_ApproachS(sp5C, var_s1->z, var_s4, var_s5); +// var_s3 += 1; +// sp5C += 6; +// sp60 += 6; +// sp6C += 6; +// var_s0 += 6; +// var_s1 += 6; +// } while (var_s3 < 7); + + +// temp_ft4 = (sp108->actor.world.pos.y - this->dyna.actor.world.pos.y) + 10.0f; +// spA4 = temp_ft4; +// if (temp_ft4 < 0.0f) { +// Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, var_s4, var_s5); +// } +// // temp_s0 = &this->unk3C8; +// SkelAnime_Update(&this->unk3C8); +// // temp_s1 = &this->unk35C; +// Math_ApproachF(&this->unk35C, 1.0f, 0.1f, 0.1f); +// if (this->unk15C != 0xA) { +// Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 0x14, 0x800); +// } + +// switch (this->unk15C) { /* irregular */ +// case 0: +// this->unk174 = 0; +// this->unk3C8.playSpeed = 1.0f; +// if (spA4 < 0.0f) { +// if (sp108->actor.speedXZ > 10.0f) { +// var_fv1 = 220.0f; +// } else { +// var_fv1 = 150.0f; +// } +// if ((this->unk162[0] == 0) && (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= var_fv1)) { +// this->unk15C = 1; +// this->unk162[0] = 0xA; +// } +// goto block_42; +// } +// sp103 = 1; +// if (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= 40.0f) { +// this->unk15E++; +// if (this->unk15E >= 0x1F) { +// this->unk15C = 0xA; +// this->unk162[0] = 0x1E; +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); +// } +// } else { +// block_42: +// this->unk15E = 0; +// } +// if (!(this->unk160 & 3) && (Rand_ZeroOne() < 0.5f)) { +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); +// } +// break; +// case 10: +// if (!(this->unk160 & 1)) { +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); +// } +// this->unk19C = (this->unk162[0] & 1) << 9; +// this->unk174 = 3; +// this->unk3C8.playSpeed = 4.0f; +// Math_ApproachS(&this->dyna.actor.shape.rot.x, -0x8000, 2, 0x2000); +// Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, 2, 0x2000); +// if (this->unk162[0] == 0) { +// this->unk162[0] = 0x64; +// this->unk15E = 0; +// this->unk15C = 0; +// } +// if (this->unk162[0] == 0x1B) { +// Math_Vec3f_Copy(&sp94, &this->dyna.actor.world.pos); +// sp94.y += 40.0f; +// EffectSsGSplash_Spawn(play, &sp94, NULL, NULL, (s16) 1, (s16) 0x7D0); +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x2808U); +// } +// break; +// case 1: +// if (Animation_OnFrame(temp_s0, this->unk4FC)) { +// this->unk3C8.playSpeed = 0.0f; +// } +// this->unk174 = 1; +// if (this->unk162[0] == 0) { +// this->unk15C = 2; +// this->unk162[0] = 0x14; +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); +// } +// break; +// case 2: +// if (!(this->unk160 & 1)) { +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); +// } +// this->unk19C = (this->unk162[0] & 1) << 9; +// this->unk3C8.playSpeed = 4.0f; +// Math_ApproachF(&this->unk35C, 1.5f, 1.0f, 0.7f); +// this->unk174 = 2; +// if (this->unk162[0] == 0) { +// this->unk15C = 0; +// this->unk162[0] = 0x1E; +// } +// break; +// } + +// temp_v0_5 = func_809EECBC(this, play); +// var_s4_2 = temp_v0_5; +// if ((temp_v0_5 != 0) || (this->unk168 == 1)) { +// this->dyna.actor.params = 2; +// this->actionFunc = func_809EF9BC; +// this->dyna.actor.flags &= ~1; +// temp_s0_2 = &play->actorCtx; +// func_800BC154(play, temp_s0_2, &this->dyna.actor, 1); +// if (this->unk168 != 0) { +// var_s4_2 = 0xA; +// } +// if (var_s4_2 >= 0xA) { +// temp_v0_6 = (Boss05*)Actor_SpawnAsChild(temp_s0_2, &this->dyna.actor, play, 0x12D, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 3); +// if (temp_v0_6 != NULL) { +// var_s0_2 = 0; +// temp_v1 = GET_PLAYER(play); +// if (&this->dyna.actor == temp_v1->targetActor) { +// temp_v1->targetActor = temp_v0_6; +// play->actorCtx.targetContext.arrowPointedActor = temp_v0_6; +// play->actorCtx.targetContext.targetedActor = temp_v0_6; +// } + +// // do { +// // temp_t5 = this->unk268.jointTable + var_s0_2; +// // temp_t4 = (unaligned s32) temp_t5->unk0; +// // temp_t1 = temp_v0_6->unk288 + var_s0_2; +// // var_s0_2 += 6; +// // temp_t1->unk0 = (unaligned s32) temp_t4; +// // temp_t1->unk4 = (u16) temp_t5->unk4; +// // } while (var_s0_2 < 0x3C); + +// for (var_s0_2 = 0; var_s0_2 < 10; var_s0_2++) { +// temp_v0_6->unk268.jointTable[var_s0_2] = this->unk268.jointTable[var_s0_2]; +// } + +// for (var_s0_3 = 0; var_s0_3 < 20; var_s0_3++) { +// temp_v0_6->unk3C8.jointTable[var_s0_3] = this->unk3C8.jointTable[var_s0_3]; +// } + +// // var_s0_3 = 0; +// // do { +// // temp_t9 = this->unk3C8.jointTable + var_s0_3; +// // temp_t7 = temp_v0_6->unk3E8 + var_s0_3; +// // temp_t7->unk0 = (unaligned s32) temp_t9->unk0; +// // temp_t7->unk4 = (u16) temp_t9->unk4; +// // temp_t6 = this->unk3C8.jointTable + var_s0_3; +// // temp_t3 = temp_v0_6->unk3E8 + var_s0_3; +// // temp_t3->unk6 = (unaligned s32) temp_t6->unk6; +// // temp_t3->unkA = (u16) temp_t6->unkA; +// // temp_t5_2 = this->unk3C8.jointTable + var_s0_3; +// // temp_t2 = temp_v0_6->unk3E8 + var_s0_3; +// // temp_t2->unkC = (unaligned s32) temp_t5_2->unkC; +// // temp_t2->unk10 = (u16) temp_t5_2->unk10; +// // temp_t9_2 = this->unk3C8.jointTable + var_s0_3; +// // temp_t2_2 = (unaligned s32) temp_t9_2->unk12; +// // temp_t8 = temp_v0_6->unk3E8 + var_s0_3; +// // var_s0_3 += 0x18; +// // temp_t8->unk12 = (unaligned s32) temp_t2_2; +// // temp_t8->unk16 = (u16) temp_t9_2->unk16; +// // } while (var_s0_3 != 0x78); + + +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x381EU); +// if (var_s4_2 >= 0xB) { +// temp_v0_6->unk188 = (s8) (var_s4_2 - 0xA); +// } +// } +// } else { +// var_s3_2 = 0; +// if (var_s4_2 == 2) { +// for (var_s3_2 = 0; var_s3_2 < 2; var_s3_2++) { +// temp_v0_7 = (Boss05*)Actor_SpawnAsChild(temp_s0_2, &this->dyna.actor, play, 0x12D, this->unk324.x, this->unk324.y, this->unk324.z, this->unk330.x, this->unk330.y, this->unk330.z, var_s3_2 + 0xA); +// if (temp_v0_7 != NULL) { + +// for (var_v1 = 0; var_v1 < 20; var_v1++) { +// temp_v0_6->unk3C8.jointTable[var_v1] = this->unk3C8.jointTable[var_v1]; +// } + +// temp_v0_7->unk162[0] = (s32) (Rand_ZeroFloat(20.0f) + 20.0f); +// } +// } +// // do { +// // temp_v0_7 = (Boss05*)Actor_SpawnAsChild(temp_s0_2, &this->dyna.actor, play, 0x12D, this->unk324.x, this->unk324.y, this->unk324.z, this->unk330.x, this->unk330.y, this->unk330.z, var_s3_2 + 0xA); +// // if (temp_v0_7 != NULL) { + +// // for (var_v1 = 0; var_v1 < 20; var_v1++) { +// // temp_v0_6->unk3C8.jointTable[var_v1] = this->unk3C8.jointTable[var_v1]; +// // } + +// // // var_v1 = 0; +// // // do { +// // // temp_t2_3 = this->unk3C8.jointTable + var_v1; +// // // temp_t9_3 = temp_v0_7->unk3E8 + var_v1; +// // // temp_t9_3->unk0 = (unaligned s32) temp_t2_3->unk0; +// // // temp_t9_3->unk4 = (u16) temp_t2_3->unk4; +// // // temp_t8_2 = this->unk3C8.jointTable + var_v1; +// // // temp_t6_2 = temp_v0_7->unk3E8 + var_v1; +// // // temp_t6_2->unk6 = (unaligned s32) temp_t8_2->unk6; +// // // temp_t6_2->unkA = (u16) temp_t8_2->unkA; +// // // temp_t3_2 = this->unk3C8.jointTable + var_v1; +// // // temp_t5_3 = temp_v0_7->unk3E8 + var_v1; +// // // temp_t5_3->unkC = (unaligned s32) temp_t3_2->unkC; +// // // temp_t5_3->unk10 = (u16) temp_t3_2->unk10; +// // // temp_t2_4 = this->unk3C8.jointTable + var_v1; +// // // temp_t5_4 = (unaligned s32) temp_t2_4->unk12; +// // // temp_t1_2 = temp_v0_7->unk3E8 + var_v1; +// // // var_v1 += 0x18; +// // // temp_t1_2->unk12 = (unaligned s32) temp_t5_4; +// // // temp_t1_2->unk16 = (u16) temp_t2_4->unk16; +// // // } while (var_v1 != 0x78); + +// // temp_v0_7->unk162[0] = (s32) (Rand_ZeroFloat(20.0f) + 20.0f); +// // } +// // var_s3_2 += 1; +// // } while (var_s3_2 != 2); + +// Actor_PlaySfxAtPos(&this->dyna.actor, 0x381FU); +// } +// } +// } + +// if (sp103 == 0) { +// CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk1C8.base); +// CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk368.base); +// } + +// CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk1C8.base); +// CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk368.base); +// } + void func_809EF9BC(Boss05* this, PlayState* play) { Player* player = GET_PLAYER(play); @@ -357,7 +1207,77 @@ void func_809EF9BC(Boss05* this, PlayState* play) { } } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EFAB4.s") +void func_809EFAB4(Boss05* this, PlayState* play) { + s32 i; + Vec3f sp80; + Vec3f sp74; + Boss05* temp_v0; + Player* player; + + Actor_MoveWithGravity(&this->dyna.actor); + this->dyna.actor.world.pos.y -= 85.0f; + this->dyna.actor.prevPos.y -= 85.0f; + Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x44U); + this->dyna.actor.world.pos.y += 85.0f; + this->dyna.actor.prevPos.y += 85.0f; + + if (this->dyna.actor.bgCheckFlags & 0x20) { + this->dyna.actor.gravity = -0.3f; + this->dyna.actor.terminalVelocity = -5.0f; + } else { + this->dyna.actor.gravity = -2.0f; + this->dyna.actor.terminalVelocity = -20.0f; + } + + if (this->dyna.actor.bgCheckFlags & 0x40) { + this->dyna.actor.velocity.y = -3.0f; + this->dyna.actor.gravity = -0.3f; + this->dyna.actor.terminalVelocity = -5.0f; + Math_Vec3f_Copy(&sp80, &this->dyna.actor.world.pos); + sp80.y += 20.0f; + EffectSsGSplash_Spawn(play, &this->dyna.actor.world.pos, NULL, NULL, 1, 1000); + this->unk162[2] = 20; + } + + if (this->unk162[2] != 0) { + for (i = 0; i < 3; i++) { + sp74.x = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.x; + sp74.y = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.y; + sp74.z = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.z; + EffectSsBubble_Spawn(play, &sp74, 20.0f, 10.0f, 20.0f, 0.13f); + } + } + + if (this->dyna.actor.bgCheckFlags & 1) { + if ((this->unk189 == 0xA) && (this->unk17A != 0)) { + this->unk17A = 0; + } + + Math_ApproachZeroF(&this->unk198, 1.0f, 0.05f); + + if (this->unk198 == 0.0f) { + temp_v0 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, this->unk324.x, + this->unk324.y, this->unk324.z, this->unk330.x, this->unk330.y, + this->unk330.z, 4); + + if (temp_v0 != NULL) { + player = GET_PLAYER(play); + if (&this->dyna.actor == player->unk_730) { + player->unk_730 = temp_v0; + play->actorCtx.targetContext.arrowPointedActor = temp_v0; + play->actorCtx.targetContext.targetedActor = temp_v0; + } + + for (i = 0; i < 20; i++) { + temp_v0->unk3C8.jointTable[i] = this->unk3C8.jointTable[i]; + } + + Actor_PlaySfxAtPos(&temp_v0->dyna.actor, NA_SE_EN_MIZUBABA_TRANSFORM); + } + Actor_MarkForDeath(&this->dyna.actor); + } + } +} void func_809EFE50(Actor* thisx, PlayState* play2) { PlayState* play = play2; @@ -562,7 +1482,44 @@ void func_809F0708(Boss05* this, PlayState* play) { Actor_SetColorFilter(&this->dyna.actor, 0x4000U, 120, 0, 30); } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0780.s") +// #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0780.s") +void func_809F0780(Boss05* this, PlayState* play) { + s32 i; + s32 j; + Vec3f sp7C; + Boss05* temp_v0; + + SkelAnime_Update(&this->unk3C8); + if ((s8)this->dyna.actor.colChkInfo.health <= 0) { + if (Animation_OnFrame(&this->unk3C8, 22.0f)) { + for (i = 0; i < 14; i++) { + temp_v0 = (Boss05*)Actor_SpawnAsChild( + &play->actorCtx, &this->dyna.actor, play, 0x12D, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, + this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, i + 0xA); + + if (temp_v0 != NULL) { + for (j = 0; j < 20; j++) { + temp_v0->unk3C8.jointTable[j] = this->unk3C8.jointTable[j]; + } + } + } + + for (i = 0; i < 20; i++) { + sp7C.x = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.x; + sp7C.y = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.y; + sp7C.z = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.z; + EffectSsBubble_Spawn(play, &sp7C, 20.0f, 10.0f, 20.0f, 0.13f); + } + + SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, 0x381F); + Actor_MarkForDeath(&this->dyna.actor); + Item_DropCollectibleRandom(play, NULL, &this->dyna.actor.world.pos, 0xE0); + } + } else if (Animation_OnFrame(&this->unk3C8, this->unk4FC)) { + func_809F0474(this, play); + } +} void func_809F0A0C(Boss05* this, PlayState* play) { this->actionFunc = func_809F0ABC; @@ -1177,1350 +2134,3 @@ void Boss05_Draw(Actor* thisx, PlayState* play) { // 0xF1, // }, // }; - -// void func_809EE4E0(Boss05 *this, PlayState *play) { -// f32 sp94; -// f32 sp90; -// f32 sp8C; -// f32 sp88; -// f32 sp84; -// f32 sp80; -// s32 var_s1; - -// SoundSource_PlaySfxAtFixedWorldPos(play, &this->unk18C, 0x1EU, 0x28CBU); -// var_s1 = 0; -// do { -// sp80 = randPlusMinusPoint5Scaled(7.0f); -// sp88 = randPlusMinusPoint5Scaled(7.0f); -// sp84 = Rand_ZeroFloat(6.0f) + 4.0f; -// sp8C = this->unk18C.x + sp80; -// sp90 = this->unk18C.y + sp84; -// sp94 = this->unk18C.z + sp88; -// EffectSsEnIce_Spawn(play, (Vec3f *) &sp8C, Rand_ZeroFloat(0.5f) + 0.7f, (Vec3f *) &sp80, &D_809F1BF4, -// &D_809F1BEC, &D_809F1BF0, 0x1E); var_s1 += 1; -// } while (var_s1 != 8); -// } - -// void func_809EE668(s32 arg0, void *arg1, Vec3f *arg2) { -// s32 temp_v0; -// void *temp_v1; - -// temp_v0 = arg0 << 6; -// (arg1->unk1C + temp_v0)->unk30 = (s16) (s32) arg2->x; -// (arg1->unk1C + temp_v0)->unk32 = (s16) (s32) arg2->y; -// (arg1->unk1C + temp_v0)->unk34 = (s16) (s32) arg2->z; -// temp_v1 = arg1->unk1C + temp_v0; -// temp_v1->unk36 = (s16) (s32) (temp_v1->unk38 * (f32) temp_v1->unk2E); -// } - -// void Boss05_Init(Actor *thisx, PlayState *play) { -// CollisionHeader *sp34; -// s16 temp_v0; -// s32 temp_ft0; -// s32 temp_t0; -// Boss05 *this = (Boss05 *) thisx; - -// sp34 = NULL; -// this->dyna.actor.targetMode = 3; -// this->dyna.actor.colChkInfo.mass = 0xFE; -// this->dyna.actor.colChkInfo.health = 2; -// temp_t0 = (s32) Rand_ZeroFloat(1000.0f); -// this->unk35C = 1.0f; -// this->unk160 = (s16) temp_t0; -// this->dyna.actor.gravity = -0.3f; -// Actor_SetScale(&this->dyna.actor, 0.01f); -// temp_v0 = this->dyna.actor.params; -// if ((temp_v0 == 0) || (temp_v0 == 1)) { -// if (this->dyna.actor.world.rot.z == 0) { -// this->dyna.actor.world.rot.z = 0; -// } -// this->dyna.actor.shape.rot.z = 0; -// this->unk168 = this->dyna.actor.world.rot.z; -// this->dyna.actor.colChkInfo.damageTable = &D_809F1C00; -// this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z; -// DynaPolyActor_Init(&this->dyna, 0); -// CollisionHeader_GetVirtual(&D_809F1B00, &sp34); -// this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp34); -// func_809EEDD0(this, play); -// SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 0xA); -// SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 0x14); -// this->unk4FC = (f32) Animation_GetLastFrame(&D_06006484); -// Collider_InitAndSetJntSph(play, &this->unk1C8, &this->dyna.actor, &D_809F1B74, this->unk1E8); -// Collider_InitAndSetJntSph(play, &this->unk368, &this->dyna.actor, &D_809F1BA8, this->unk388); -// if (Flags_GetClear(play, (s32) play->roomCtx.currRoom.num) != 0) { -// this->dyna.actor.params = 2; -// this->actionFunc = func_809EF9BC; -// this->dyna.actor.flags &= ~1; -// func_800BC154(play, &play->actorCtx, &this->dyna.actor, 1U); -// } -// } else { -// if (temp_v0 == 2) { -// this->actionFunc = func_809EF9BC; -// CollisionHeader_GetVirtual(&D_809F1B00, &sp34); -// this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, sp34); -// SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 0xA); -// this->dyna.actor.flags &= ~1; -// func_800BC154(play, &play->actorCtx, &this->dyna.actor, 1U); -// return; -// } -// if (temp_v0 == 3) { -// this->actionFunc = func_809EFAB4; -// this->unk198 = 1.0f; -// SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 0xA); -// SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 0x14); -// this->unk4FC = (f32) Animation_GetLastFrame(&D_06006484); -// Collider_InitAndSetJntSph(play, &this->unk1C8, &this->dyna.actor, &D_809F1B74, this->unk1E8); -// Collider_InitAndSetJntSph(play, &this->unk368, &this->dyna.actor, &D_809F1BA8, this->unk388); -// ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); -// this->dyna.actor.colChkInfo.damageTable = &D_809F1C00; -// return; -// } -// if (temp_v0 == 4) { -// func_809F00CC(this, play); -// this->dyna.actor.colChkInfo.mass = 0x5A; -// SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 0x14); -// Collider_InitAndSetJntSph(play, &this->unk368, &this->dyna.actor, &D_809F1BDC, this->unk388); -// ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); -// this->dyna.actor.colChkInfo.damageTable = &D_809F1C20; -// this->dyna.actor.flags |= 0x30; -// return; -// } -// if (temp_v0 >= 0xA) { -// SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 0x14); -// this->dyna.actor.gravity = 0.0f; -// this->dyna.actor.world.rot.y = (s16) (s32) Rand_ZeroFloat(32768.0f); -// this->dyna.actor.speedXZ = Rand_ZeroFloat(3.0f) + 3.0f; -// this->dyna.actor.velocity.y = Rand_ZeroFloat(1.5f) + 1.5f; -// this->unk500 = (s16) (s32) randPlusMinusPoint5Scaled(700.0f); -// this->unk502 = (s16) (s32) randPlusMinusPoint5Scaled(1500.0f); -// temp_ft0 = (s32) (Rand_ZeroFloat(30.0f) + 50.0f); -// this->dyna.actor.flags &= ~1; -// this->actionFunc = func_809F0B0C; -// this->unk162[0] = (s16) temp_ft0; -// } -// } -// } - -// void Boss05_Destroy(Actor *thisx, PlayState *play) { -// s16 temp_v0; -// Boss05 *this = (Boss05 *) thisx; - -// temp_v0 = this->dyna.actor.params; -// if ((temp_v0 == 2) || (temp_v0 == 0) || (temp_v0 == 1)) { -// DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); -// } -// } - -// s32 func_809EECBC(Actor *arg0, PlayState *arg1) { -// s32 var_v0; -// u8 temp_v0; -// void *var_v1; - -// var_v0 = 0; -// if (arg0->unk16C == 0) { -// var_v1 = arg0->unk1E4; -// loop_2: -// var_v0 += 0x40; -// if (var_v1->unk16 & 2) { -// temp_v0 = arg0->colChkInfo.damageEffect; -// switch (temp_v0) { /* irregular */ -// case 2: -// return 0xB; -// case 3: -// return 0x14; -// case 4: -// return 0x1E; -// default: -// return 0xA; -// } -// } else { -// var_v1 += 0x40; -// if (var_v0 == 0x80) { -// if (arg0->unk384->unk16 & 2) { -// arg0->colChkInfo.health -= arg0->colChkInfo.damage; -// if ((s8) arg0->colChkInfo.health <= 0) { -// Enemy_StartFinishingBlow(arg1, arg0); -// return 2; -// } -// Actor_PlaySfxAtPos(arg0, 0x3807U); -// arg0->unk16C = 0xF; -// arg0->unk15C = 0; -// arg0->unk162 = 0x1E; -// return 0; -// } -// goto block_16; -// } -// goto loop_2; -// } -// } else { -// block_16: -// return 0; -// } -// } - -// void func_809EEDD0(Boss05 *this, PlayState *play) { -// this->actionFunc = func_809EEDE8; -// } - -// void func_809EEDE8(Boss05 *this, PlayState *play) { -// Actor *sp108; -// u8 sp103; -// ? spD8; -// s32 spD4; -// s32 spD0; -// s32 spCC; -// s32 spC8; -// s32 spC4; -// s32 spC0; -// s32 spBC; -// s32 spB8; -// s32 spB4; -// f32 spA4; -// Vec3f sp94; -// f32 sp80; -// s32 sp74; -// f32 sp70; -// s16 *sp6C; -// s16 *sp60; -// s16 *sp5C; -// ? *temp_t5; -// ? *var_s1; -// ? temp_t2_2; -// ? temp_t4; -// ? temp_t5_4; -// Actor *temp_v0_6; -// Actor *temp_v0_7; -// Actor *temp_v1; -// ActorContext *temp_s0_2; -// CollisionCheckContext *temp_s0_3; -// CollisionCheckContext *temp_s0_4; -// SkelAnime *temp_s0; -// f32 *temp_s1; -// f32 temp_ft4; -// f32 var_fv1; -// s16 var_s4; -// s16 var_s5; -// s16 var_s6; -// s16 var_s7; -// s32 temp_lo; -// s32 temp_v0_5; -// s32 var_s0; -// s32 var_s0_2; -// s32 var_s0_3; -// s32 var_s3; -// s32 var_s3_2; -// s32 var_s4_2; -// s32 var_v1; -// u8 temp_v0; -// u8 temp_v0_2; -// void *temp_t1; -// void *temp_t1_2; -// void *temp_t2; -// void *temp_t2_3; -// void *temp_t2_4; -// void *temp_t3; -// void *temp_t3_2; -// void *temp_t5_2; -// void *temp_t5_3; -// void *temp_t6; -// void *temp_t6_2; -// void *temp_t7; -// void *temp_t8; -// void *temp_t8_2; -// void *temp_t9; -// void *temp_t9_2; -// void *temp_t9_3; -// void *temp_v0_3; -// void *temp_v0_4; - -// sp103 = 0; -// var_s3 = 0; -// sp108 = play->actorCtx.actorLists[2].first; -// temp_v0 = this->unk174; -// this->dyna.actor.hintId = 8; -// var_s0 = 0; -// var_s1 = &spD8; -// if (temp_v0 == 0) { -// spD4 = 0x3E8; -// spD0 = 0x3E80; -// spCC = 0x7D0; -// spC8 = 0x5DC; -// spC4 = 0x1770; -// spC0 = 0xBB8; -// spBC = 0x514; -// spB8 = 0x5208; -// spB4 = 0xDAC; -// var_s6 = 0xA; -// var_s7 = 0x300; -// if (this->unk16C != 0) { -// spD4 = 0x1B58; -// spCC = 0x1770; -// spC0 = 0x1770; -// spBC = 0x1C84; -// spB4 = 0x1964; -// var_s6 = 1; -// var_s7 = 0x1000; -// } -// } else { -// var_s7 = 0; -// if (temp_v0 == 3) { -// spD4 = 0x1B58; -// spD0 = 0x3E80; -// spCC = 0x1388; -// spC8 = 0x5DC; -// spC4 = 0x2328; -// spC0 = 0x1388; -// spBC = 0x1C84; -// spB8 = 0x5208; -// spB4 = 0x157C; -// var_s6 = 1; -// var_s7 = 0x1000; -// } else { -// var_s6 = 0; -// spB4 = 0; -// spB8 = 0; -// spBC = 0; -// spC0 = 0; -// spC4 = 0; -// spC8 = 0; -// spCC = 0; -// spD0 = 0; -// spD4 = 0; -// } -// } -// sp5C = &this->unk1A2; -// sp60 = &this->unk1A0; -// sp6C = &this->unk19E; -// do { -// temp_v0_2 = this->unk174; -// if ((temp_v0_2 == 0) || (temp_v0_2 == 3)) { -// temp_lo = var_s3 * spB8; -// var_s5 = var_s7; -// var_s4 = var_s6; -// sp70 = (f32) spB4; -// if (var_s3 < 3) { -// var_s1->unk2 = 0; -// sp74 = temp_lo; -// sp80 = (f32) spCC; -// var_s1->unk0 = (s16) (s32) (Math_SinS((s16) ((this->unk160 * spD4) + (var_s3 * spD0))) * sp80); -// } else { -// var_s1->unk0 = 0; -// sp74 = temp_lo; -// sp80 = (f32) spC0; -// var_s1->unk2 = (s16) (s32) (Math_SinS((s16) ((this->unk160 * spC8) + (var_s3 * spC4))) * sp80); -// } -// if ((var_s3 == 4) || (var_s3 == 6)) { -// var_s1->unk4 = (s16) (s32) (2.0f * (Math_SinS((s16) ((this->unk160 * spBC) + temp_lo)) * sp70)); -// } else { -// var_s1->unk4 = (s16) (s32) (Math_SinS((s16) ((this->unk160 * spBC) + temp_lo)) * sp70); -// } -// } else { -// if (temp_v0_2 == 1) { -// temp_v0_3 = var_s0 + &D_809F1C60; -// var_s6 = 5; -// var_s7 = 0x1000; -// var_s1->unk0 = (s16) temp_v0_3->unk0; -// var_s1->unk2 = (s16) temp_v0_3->unk2; -// var_s1->unk4 = (s16) temp_v0_3->unk4; -// } else if (temp_v0_2 == 2) { -// temp_v0_4 = var_s0 + &D_809F1C8C; -// var_s6 = 1; -// var_s7 = 0x2000; -// var_s1->unk0 = (s16) temp_v0_4->unk0; -// var_s1->unk2 = (s16) temp_v0_4->unk2; -// var_s1->unk4 = (s16) temp_v0_4->unk4; -// } -// var_s5 = var_s7; -// var_s4 = var_s6; -// } -// Math_ApproachS(sp6C, var_s1->unk0, var_s4, var_s5); -// Math_ApproachS(sp60, var_s1->unk2, var_s4, var_s5); -// Math_ApproachS(sp5C, var_s1->unk4, var_s4, var_s5); -// var_s3 += 1; -// sp5C += 6; -// sp60 += 6; -// sp6C += 6; -// var_s0 += 6; -// var_s1 += 6; -// } while (var_s3 < 7); -// temp_ft4 = (sp108->world.pos.y - this->dyna.actor.world.pos.y) + 10.0f; -// spA4 = temp_ft4; -// if (temp_ft4 < 0.0f) { -// Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, var_s4, var_s5); -// } -// temp_s0 = &this->unk3C8; -// SkelAnime_Update(temp_s0); -// temp_s1 = &this->unk35C; -// Math_ApproachF(temp_s1, 1.0f, 0.1f, 0.1f); -// if (this->unk15C != (u8) 0xA) { -// Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 0x14, 0x800); -// } -// switch (this->unk15C) { /* irregular */ -// case 0: -// this->unk174 = 0; -// this->unk3C8.playSpeed = 1.0f; -// if (spA4 < 0.0f) { -// if (sp108->speedXZ > 10.0f) { -// var_fv1 = 220.0f; -// } else { -// var_fv1 = 150.0f; -// } -// if ((this->unk162[0] == 0) && (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= var_fv1)) { -// this->unk15C = 1; -// this->unk162[0] = 0xA; -// } -// goto block_42; -// } -// sp103 = 1; -// if (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= 40.0f) { -// this->unk15E += 1; -// if (this->unk15E >= 0x1F) { -// this->unk15C = 0xA; -// this->unk162[0] = 0x1E; -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); -// } -// } else { -// block_42: -// this->unk15E = 0; -// } -// if (!(this->unk160 & 3) && (Rand_ZeroOne() < 0.5f)) { -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); -// } -// break; -// case 10: -// if (!(this->unk160 & 1)) { -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); -// } -// this->unk19C = (this->unk162[0] & 1) << 9; -// this->unk174 = 3; -// this->unk3C8.playSpeed = 4.0f; -// Math_ApproachS(&this->dyna.actor.shape.rot.x, -0x8000, 2, 0x2000); -// Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, 2, 0x2000); -// if (this->unk162[0] == 0) { -// this->unk162[0] = 0x64; -// this->unk15E = 0; -// this->unk15C = 0; -// } -// if (this->unk162[0] == 0x1B) { -// Math_Vec3f_Copy(&sp94, &this->dyna.actor.world.pos); -// sp94.y += 40.0f; -// EffectSsGSplash_Spawn(play, &sp94, NULL, NULL, (s16) 1, (s16) 0x7D0); -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x2808U); -// } -// break; -// case 1: -// if (Animation_OnFrame(temp_s0, this->unk4FC) != 0) { -// this->unk3C8.playSpeed = 0.0f; -// } -// this->unk174 = 1; -// if (this->unk162[0] == 0) { -// this->unk15C = 2; -// this->unk162[0] = 0x14; -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); -// } -// break; -// case 2: -// if (!(this->unk160 & 1)) { -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); -// } -// this->unk19C = (this->unk162[0] & 1) << 9; -// this->unk3C8.playSpeed = 4.0f; -// Math_ApproachF(temp_s1, 1.5f, 1.0f, 0.7f); -// this->unk174 = 2; -// if (this->unk162[0] == 0) { -// this->unk15C = 0; -// this->unk162[0] = 0x1E; -// } -// break; -// } -// temp_v0_5 = func_809EECBC(&this->dyna.actor, play); -// var_s4_2 = temp_v0_5; -// if ((temp_v0_5 != 0) || (this->unk168 == 1)) { -// this->dyna.actor.params = 2; -// this->actionFunc = func_809EF9BC; -// this->dyna.actor.flags &= ~1; -// temp_s0_2 = &play->actorCtx; -// func_800BC154(play, temp_s0_2, &this->dyna.actor, 1U); -// if (this->unk168 != 0) { -// var_s4_2 = 0xA; -// } -// if (var_s4_2 >= 0xA) { -// temp_v0_6 = Actor_SpawnAsChild(temp_s0_2, &this->dyna.actor, play, 0x12D, this->dyna.actor.world.pos.x, -// this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, (s16) (s32) this->dyna.actor.shape.rot.x, -// (s16) (s32) this->dyna.actor.shape.rot.y, (s16) (s32) this->dyna.actor.shape.rot.z, 3); if (temp_v0_6 != -// NULL) { -// var_s0_2 = 0; -// temp_v1 = play->actorCtx.actorLists[2].first; -// if (this == temp_v1->unk730) { -// temp_v1->unk730 = temp_v0_6; -// play->actorCtx.targetContext.arrowPointedActor = temp_v0_6; -// play->actorCtx.targetContext.targetedActor = temp_v0_6; -// } -// do { -// temp_t5 = this->unk268.jointTable + var_s0_2; -// temp_t4 = (unaligned s32) temp_t5->unk0; -// temp_t1 = temp_v0_6->unk288 + var_s0_2; -// var_s0_2 += 6; -// temp_t1->unk0 = (unaligned s32) temp_t4; -// temp_t1->unk4 = (u16) temp_t5->unk4; -// } while (var_s0_2 < 0x3C); -// var_s0_3 = 0; -// do { -// temp_t9 = this->unk3C8.jointTable + var_s0_3; -// temp_t7 = temp_v0_6->unk3E8 + var_s0_3; -// temp_t7->unk0 = (unaligned s32) temp_t9->unk0; -// temp_t7->unk4 = (u16) temp_t9->unk4; -// temp_t6 = this->unk3C8.jointTable + var_s0_3; -// temp_t3 = temp_v0_6->unk3E8 + var_s0_3; -// temp_t3->unk6 = (unaligned s32) temp_t6->unk6; -// temp_t3->unkA = (u16) temp_t6->unkA; -// temp_t5_2 = this->unk3C8.jointTable + var_s0_3; -// temp_t2 = temp_v0_6->unk3E8 + var_s0_3; -// temp_t2->unkC = (unaligned s32) temp_t5_2->unkC; -// temp_t2->unk10 = (u16) temp_t5_2->unk10; -// temp_t9_2 = this->unk3C8.jointTable + var_s0_3; -// temp_t2_2 = (unaligned s32) temp_t9_2->unk12; -// temp_t8 = temp_v0_6->unk3E8 + var_s0_3; -// var_s0_3 += 0x18; -// temp_t8->unk12 = (unaligned s32) temp_t2_2; -// temp_t8->unk16 = (u16) temp_t9_2->unk16; -// } while (var_s0_3 != 0x78); -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x381EU); -// if (var_s4_2 >= 0xB) { -// temp_v0_6->unk188 = (s8) (var_s4_2 - 0xA); -// } -// } -// } else { -// var_s3_2 = 0; -// if (var_s4_2 == 2) { -// do { -// temp_v0_7 = Actor_SpawnAsChild(temp_s0_2, &this->dyna.actor, play, 0x12D, this->unk324.x, -// this->unk324.y, this->unk324.z, (s16) (s32) this->unk330.x, (s16) (s32) this->unk330.y, (s16) -// (s32) this->unk330.z, var_s3_2 + 0xA); if (temp_v0_7 != NULL) { -// var_v1 = 0; -// do { -// temp_t2_3 = this->unk3C8.jointTable + var_v1; -// temp_t9_3 = temp_v0_7->unk3E8 + var_v1; -// temp_t9_3->unk0 = (unaligned s32) temp_t2_3->unk0; -// temp_t9_3->unk4 = (u16) temp_t2_3->unk4; -// temp_t8_2 = this->unk3C8.jointTable + var_v1; -// temp_t6_2 = temp_v0_7->unk3E8 + var_v1; -// temp_t6_2->unk6 = (unaligned s32) temp_t8_2->unk6; -// temp_t6_2->unkA = (u16) temp_t8_2->unkA; -// temp_t3_2 = this->unk3C8.jointTable + var_v1; -// temp_t5_3 = temp_v0_7->unk3E8 + var_v1; -// temp_t5_3->unkC = (unaligned s32) temp_t3_2->unkC; -// temp_t5_3->unk10 = (u16) temp_t3_2->unk10; -// temp_t2_4 = this->unk3C8.jointTable + var_v1; -// temp_t5_4 = (unaligned s32) temp_t2_4->unk12; -// temp_t1_2 = temp_v0_7->unk3E8 + var_v1; -// var_v1 += 0x18; -// temp_t1_2->unk12 = (unaligned s32) temp_t5_4; -// temp_t1_2->unk16 = (u16) temp_t2_4->unk16; -// } while (var_v1 != 0x78); -// temp_v0_7->unk162 = (s16) (s32) (Rand_ZeroFloat(20.0f) + 20.0f); -// } -// var_s3_2 += 1; -// } while (var_s3_2 != 2); -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x381FU); -// } -// } -// } -// if (sp103 == 0) { -// temp_s0_3 = &play->colChkCtx; -// CollisionCheck_SetAT(play, temp_s0_3, &this->unk1C8.base); -// CollisionCheck_SetAT(play, temp_s0_3, &this->unk368.base); -// } -// temp_s0_4 = &play->colChkCtx; -// CollisionCheck_SetAC(play, temp_s0_4, &this->unk1C8.base); -// CollisionCheck_SetAC(play, temp_s0_4, &this->unk368.base); -// } - -// void func_809EF9BC(Boss05 *this, PlayState *play) { -// f32 temp_fv0; -// s16 var_a1; -// s32 temp_ft3; - -// temp_fv0 = sqrtf(this->dyna.actor.xyzDistToPlayerSq); -// if ((temp_fv0 < 50.0f) && (play->actorCtx.actorLists[2].first->bgCheckFlags & 1)) { -// temp_ft3 = (s32) (temp_fv0 * 80.0f); -// var_a1 = (s16) temp_ft3; -// if ((s16) temp_ft3 >= 0x7D1) { -// var_a1 = 0x7D0; -// } -// Math_ApproachS(&this->unk178, var_a1, 0x14, 0x7D0); -// Math_ApproachS(&this->unk176, this->dyna.actor.yawTowardsPlayer, 0x14, 0xFA0); -// if (!(this->unk160 & 0xF)) { -// EffectSsGRipple_Spawn(play, &this->dyna.actor.world.pos, 0x1F4, 0x3E8, (s16) 0); -// } -// } else { -// Math_ApproachS(&this->unk178, 0, 0x14, 0x100); -// } -// } - -// void func_809EFAB4(Boss05 *this, PlayState *play) { -// Vec3f sp80; -// f32 sp7C; -// f32 sp78; -// f32 sp74; -// ? temp_t8; -// Actor *temp_v0; -// Actor *temp_v1; -// PosRot *temp_s1; -// s32 var_s1; -// s32 var_v1; -// void *temp_t1; -// void *temp_t3; -// void *temp_t3_2; -// void *temp_t5; -// void *temp_t6; -// void *temp_t7; -// void *temp_t7_2; -// void *temp_t9; - -// Actor_MoveWithGravity(&this->dyna.actor); -// this->dyna.actor.world.pos.y -= 85.0f; -// this->dyna.actor.prevPos.y -= 85.0f; -// Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x44U); -// this->dyna.actor.world.pos.y += 85.0f; -// this->dyna.actor.prevPos.y += 85.0f; -// if (this->dyna.actor.bgCheckFlags & 0x20) { -// this->dyna.actor.gravity = -0.3f; -// this->dyna.actor.terminalVelocity = -5.0f; -// } else { -// this->dyna.actor.gravity = -2.0f; -// this->dyna.actor.terminalVelocity = -20.0f; -// } -// temp_s1 = &this->dyna.actor.world; -// if (this->dyna.actor.bgCheckFlags & 0x40) { -// this->dyna.actor.velocity.y = -3.0f; -// this->dyna.actor.gravity = -0.3f; -// this->dyna.actor.terminalVelocity = -5.0f; -// Math_Vec3f_Copy(&sp80, &temp_s1->pos); -// sp80.y += 20.0f; -// EffectSsGSplash_Spawn(play, &temp_s1->pos, NULL, NULL, (s16) 1, (s16) 0x3E8); -// this->unk162[2] = 0x14; -// } -// var_s1 = 0; -// if (this->unk162[2] != 0) { -// do { -// sp74 = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.x; -// sp78 = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.y; -// sp7C = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.z; -// EffectSsBubble_Spawn(play, (Vec3f *) &sp74, 20.0f, 10.0f, 20.0f, 0.13f); -// var_s1 += 1; -// } while (var_s1 != 3); -// } -// if (this->dyna.actor.bgCheckFlags & 1) { -// if ((this->unk189 == 0xA) && (this->unk17A != 0)) { -// this->unk17A = 0; -// } -// Math_ApproachZeroF(&this->unk198, 1.0f, 0.05f); -// if (this->unk198 == 0.0f) { -// temp_v0 = Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, this->unk324.x, -// this->unk324.y, this->unk324.z, (s16) (s32) this->unk330.x, (s16) (s32) this->unk330.y, (s16) (s32) -// this->unk330.z, 4); if (temp_v0 != NULL) { -// temp_v1 = play->actorCtx.actorLists[2].first; -// if (this == temp_v1->unk730) { -// temp_v1->unk730 = temp_v0; -// play->actorCtx.targetContext.arrowPointedActor = temp_v0; -// play->actorCtx.targetContext.targetedActor = temp_v0; -// } -// var_v1 = 0; -// do { -// temp_t7 = this->unk3C8.jointTable + var_v1; -// temp_t5 = temp_v0->unk3E8 + var_v1; -// temp_t5->unk0 = (unaligned s32) temp_t7->unk0; -// temp_t5->unk4 = (u16) temp_t7->unk4; -// temp_t3 = this->unk3C8.jointTable + var_v1; -// temp_t1 = temp_v0->unk3E8 + var_v1; -// temp_t1->unk6 = (unaligned s32) temp_t3->unk6; -// temp_t1->unkA = (u16) temp_t3->unkA; -// temp_t9 = this->unk3C8.jointTable + var_v1; -// temp_t7_2 = temp_v0->unk3E8 + var_v1; -// temp_t7_2->unkC = (unaligned s32) temp_t9->unkC; -// temp_t7_2->unk10 = (u16) temp_t9->unk10; -// temp_t6 = this->unk3C8.jointTable + var_v1; -// temp_t8 = (unaligned s32) temp_t6->unk12; -// temp_t3_2 = temp_v0->unk3E8 + var_v1; -// var_v1 += 0x18; -// temp_t3_2->unk12 = (unaligned s32) temp_t8; -// temp_t3_2->unk16 = (u16) temp_t6->unk16; -// } while (var_v1 != 0x78); -// Actor_PlaySfxAtPos(temp_v0, 0x3825U); -// } -// Actor_MarkForDeath(&this->dyna.actor); -// } -// } -// } - -// void func_809EFE50(Actor *thisx, PlayState *play2) { -// u8 sp27; -// u8 temp_a0; -// u8 temp_v0; -// u8 var_a2; -// void *temp_v1; - -// if ((thisx->unk16A == 0) && (temp_v1 = thisx->unk384, temp_a0 = temp_v1->unk16, ((temp_a0 & 2) != 0))) { -// temp_v1->unk16 = (u8) (temp_a0 & 0xFFFD); -// if (*thisx->unk384->unk24 & 0x300000) { -// thisx->unk16A = 6; -// thisx->unk338 = -12.0f; -// thisx->unk348 = (s16) thisx->yawTowardsPlayer; -// return; -// } -// thisx->unk16A = 0xA; -// thisx->speedXZ = 0.0f; -// thisx->unk338 = -20.0f; -// thisx->unk348 = (s16) thisx->yawTowardsPlayer; -// sp27 = 0; -// Actor_PlaySfxAtPos(thisx, 0x3807U); -// temp_v0 = thisx->colChkInfo.damageEffect; -// switch (temp_v0) { /* irregular */ -// case 1: -// sp27 = 0; -// func_809F0A0C((Boss05 *) thisx, play2); -// var_a2 = 0; -// break; -// case 2: -// thisx->unk188 = 1; -// default: -// block_13: -// var_a2 = 1; -// break; -// case 3: -// sp27 = 0; -// func_809F0A64((Boss05 *) thisx, play2); -// var_a2 = 0; -// thisx->unk188 = 0xA; -// break; -// case 4: -// thisx->unk188 = 0x14; -// goto block_13; -// } -// if (var_a2 != 0) { -// if ((func_809F0ABC == thisx->unk170) && (thisx->unk189 == 0xA) && (thisx->unk17A != 0)) { -// func_809EE4E0((Boss05 *) thisx, play2); -// thisx->unk188 = 0; -// } -// thisx->colChkInfo.health -= thisx->colChkInfo.damage; -// if ((s8) thisx->colChkInfo.health <= 0) { -// Enemy_StartFinishingBlow(play2, thisx); -// } -// func_809F0708((Boss05 *) thisx, play2); -// thisx->unk16C = 0xF; -// } -// } -// } - -// s32 func_809F0014(Boss05 *this, PlayState *play) { -// s16 temp_v0; -// s16 var_v1; - -// temp_v0 = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y; -// var_v1 = temp_v0; -// if (temp_v0 < 0) { -// var_v1 = -temp_v0; -// } -// if (var_v1 < 0x3000) { -// return 1; -// } -// return 0; -// } - -// void func_809F0058(Boss05 *this, PlayState *play) { -// if ((func_809F0014(this, play) != 0) && (this->dyna.actor.xyzDistToPlayerSq <= 40000.0f) && -// (fabsf(this->dyna.actor.playerHeightRel) < 70.0f)) { -// func_809F0474(this, play); -// } -// } - -// void func_809F00CC(Boss05 *this, PlayState *play) { -// this->actionFunc = func_809F010C; -// Animation_MorphToPlayOnce(&this->unk3C8, &D_06006E50, -5.0f); -// } - -// void func_809F010C(Boss05 *this, PlayState *play) { -// SkelAnime_Update(&this->unk3C8); -// Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 2, 0x400); -// Math_ApproachS(&this->dyna.actor.shape.rot.z, 0, 2, 0x400); -// Math_ApproachF(&this->unk360, 1.0f, 1.0f, 0.5f); -// Math_ApproachF(&this->unk364, 1.0f, 1.0f, 0.14f); -// if (this->unk364 == 1.0f) { -// func_809F01CC(this, play); -// } -// } - -// void func_809F01CC(Boss05 *this, PlayState *play) { -// this->actionFunc = func_809F0244; -// Animation_MorphToLoop(&this->unk3C8, &D_06007488, -10.0f); -// this->unk162[0] = (s16) (s32) (Rand_ZeroFloat(25.0f) + 25.0f); -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); -// } - -// void func_809F0244(Boss05 *this, PlayState *play) { -// SkelAnime_Update(&this->unk3C8); -// Math_ApproachZeroF(&this->dyna.actor.speedXZ, 1.0f, 2.5f); -// Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 2, 0x400); -// Math_ApproachS(&this->dyna.actor.shape.rot.z, 0, 2, 0x400); -// if (this->unk162[0] == 0) { -// func_809F02D0(this, play); -// } -// func_809F0058(this, play); -// } - -// void func_809F02D0(Boss05 *this, PlayState *play) { -// f32 temp_ft0; - -// this->actionFunc = func_809F0374; -// Animation_MorphToLoop(&this->unk3C8, &D_06007908, 0.0f); -// this->unk162[0] = (s16) (s32) (Rand_ZeroFloat(80.0f) + 60.0f); -// this->unk34C = randPlusMinusPoint5Scaled(400.0f) + this->dyna.actor.world.pos.x; -// temp_ft0 = randPlusMinusPoint5Scaled(400.0f) + this->dyna.actor.world.pos.z; -// this->unk358 = 0.0f; -// this->unk354 = temp_ft0; -// } - -// void func_809F0374(Boss05 *this, PlayState *play) { -// f32 sp24; -// f32 sp20; -// f32 temp_fa0; -// f32 temp_fa1; - -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3027U); -// SkelAnime_Update(&this->unk3C8); -// Math_ApproachF(&this->dyna.actor.speedXZ, 5.0f, 1.0f, 2.0f); -// temp_fa0 = this->unk34C - this->dyna.actor.world.pos.x; -// temp_fa1 = this->unk354 - this->dyna.actor.world.pos.z; -// sp24 = temp_fa0; -// sp20 = temp_fa1; -// Math_ApproachS(&this->dyna.actor.world.rot.y, Math_Atan2S(temp_fa0, temp_fa1), 5, (s16) (s32) this->unk358); -// Math_ApproachF(&this->unk358, 2000.0f, 1.0f, 100.0f); -// if ((this->unk162[0] == 0) || (((sp24 * sp24) + (sp20 * sp20)) < 2500.0f)) { -// func_809F01CC(this, play); -// } -// func_809F0058(this, play); -// } - -// void func_809F0474(Boss05 *this, PlayState *play) { -// this->actionFunc = func_809F04C0; -// Animation_MorphToPlayOnce(&this->unk3C8, &D_06003448, 0.0f); -// this->unk162[0] = 0x14; -// } - -// void func_809F04C0(Boss05 *this, PlayState *play) { -// SkelAnime_Update(&this->unk3C8); -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3006U); -// Math_ApproachZeroF(&this->dyna.actor.speedXZ, 1.0f, 2.5f); -// Math_ApproachS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 5, 0x1000); -// if (this->unk162[0] == 0) { -// func_809F0538(this, play); -// } -// } - -// void func_809F0538(Boss05 *this, PlayState *arg1) { -// this->actionFunc = func_809F0590; -// Animation_MorphToLoop(&this->unk3C8, &D_06000A5C, 0.0f); -// this->unk162[0] = 0x3C; -// this->unk358 = 0.0f; -// } - -// void func_809F0590(Boss05 *this, PlayState *play) { -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3006U); -// SkelAnime_Update(&this->unk3C8); -// Math_ApproachF(&this->dyna.actor.speedXZ, 8.0f, 1.0f, 4.0f); -// Math_ApproachS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 5, (s16) (s32) this->unk358); -// Math_ApproachF(&this->unk358, 4000.0f, 1.0f, 400.0f); -// if ((this->unk162[0] == 0) || (this->dyna.actor.xyzDistToPlayerSq <= 22500.0f)) { -// func_809F0650(this, play); -// } -// } - -// void func_809F0650(Boss05 *this, PlayState *arg1) { -// this->actionFunc = func_809F06B8; -// Animation_MorphToPlayOnce(&this->unk3C8, &D_060006A4, 0.0f); -// this->unk4FC = (f32) Animation_GetLastFrame(&D_060006A4); -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3837U); -// } - -// void func_809F06B8(Boss05 *this, PlayState *play) { -// SkelAnime *sp1C; -// SkelAnime *temp_a0; - -// temp_a0 = &this->unk3C8; -// sp1C = temp_a0; -// SkelAnime_Update(temp_a0); -// if (Animation_OnFrame(temp_a0, this->unk4FC) != 0) { -// func_809F01CC(this, play); -// } -// } - -// void func_809F0708(Boss05 *this, PlayState *play) { -// this->actionFunc = func_809F0780; -// Animation_MorphToPlayOnce(&this->unk3C8, &D_06002F0C, 0.0f); -// this->unk4FC = (f32) Animation_GetLastFrame(&D_060006A4); -// Actor_SetColorFilter(&this->dyna.actor, 0x4000U, 0x78U, 0U, (u16) 0x1E); -// } - -// void func_809F0780(Boss05 *this, PlayState *play) { -// f32 sp84; -// f32 sp80; -// f32 sp7C; -// ? temp_t5; -// Actor *temp_v0; -// PosRot *temp_s1_2; -// SkelAnime *temp_s1; -// s32 var_s2; -// s32 var_s2_2; -// s32 var_v1; -// void *temp_t0; -// void *temp_t0_2; -// void *temp_t2; -// void *temp_t3; -// void *temp_t4; -// void *temp_t4_2; -// void *temp_t6; -// void *temp_t8; - -// temp_s1 = &this->unk3C8; -// SkelAnime_Update(temp_s1); -// if ((s8) this->dyna.actor.colChkInfo.health <= 0) { -// var_s2 = 0; -// if (Animation_OnFrame(temp_s1, 22.0f) != 0) { -// do { -// temp_v0 = Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, -// this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, (s16) (s32) -// this->dyna.actor.shape.rot.x, (s16) (s32) this->dyna.actor.shape.rot.y, (s16) (s32) -// this->dyna.actor.shape.rot.z, var_s2 + 0xA); var_s2 += 1; if (temp_v0 != NULL) { -// var_v1 = 0; -// do { -// temp_t4 = this->unk3C8.jointTable + var_v1; -// temp_t2 = temp_v0->unk3E8 + var_v1; -// temp_t2->unk0 = (unaligned s32) temp_t4->unk0; -// temp_t2->unk4 = (u16) temp_t4->unk4; -// temp_t0 = this->unk3C8.jointTable + var_v1; -// temp_t8 = temp_v0->unk3E8 + var_v1; -// temp_t8->unk6 = (unaligned s32) temp_t0->unk6; -// temp_t8->unkA = (u16) temp_t0->unkA; -// temp_t6 = this->unk3C8.jointTable + var_v1; -// temp_t4_2 = temp_v0->unk3E8 + var_v1; -// temp_t4_2->unkC = (unaligned s32) temp_t6->unkC; -// temp_t4_2->unk10 = (u16) temp_t6->unk10; -// temp_t3 = this->unk3C8.jointTable + var_v1; -// temp_t5 = (unaligned s32) temp_t3->unk12; -// temp_t0_2 = temp_v0->unk3E8 + var_v1; -// var_v1 += 0x18; -// temp_t0_2->unk12 = (unaligned s32) temp_t5; -// temp_t0_2->unk16 = (u16) temp_t3->unk16; -// } while (var_v1 != 0x78); -// } -// } while (var_s2 < 0xE); -// var_s2_2 = 0; -// do { -// sp7C = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.x; -// sp80 = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.y; -// sp84 = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.z; -// EffectSsBubble_Spawn(play, (Vec3f *) &sp7C, 20.0f, 10.0f, 20.0f, 0.13f); -// var_s2_2 += 1; -// } while (var_s2_2 != 0x14); -// temp_s1_2 = &this->dyna.actor.world; -// SoundSource_PlaySfxAtFixedWorldPos(play, &temp_s1_2->pos, 0x28U, 0x381FU); -// Actor_MarkForDeath(&this->dyna.actor); -// Item_DropCollectibleRandom(play, NULL, &temp_s1_2->pos, 0xE0); -// } -// } else if (Animation_OnFrame(temp_s1, this->unk4FC) != 0) { -// func_809F0474(this, play); -// } -// } - -// void func_809F0A0C(Boss05 *this, PlayState *play) { -// this->actionFunc = func_809F0ABC; -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3807U); -// this->unk162[0] = 0x28; -// Actor_SetColorFilter(&this->dyna.actor, 0U, 0x78U, 0U, (u16) 0x28); -// } - -// void func_809F0A64(Boss05 *this, PlayState *play) { -// this->actionFunc = func_809F0ABC; -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3807U); -// this->unk162[0] = 0x50; -// Actor_SetColorFilter(&this->dyna.actor, 0U, 0x78U, 0U, (u16) 0x50); -// } - -// void func_809F0ABC(Boss05 *this, PlayState *play) { -// Math_ApproachZeroF(&this->dyna.actor.speedXZ, 1.0f, 2.5f); -// if (this->unk162[0] == 0) { -// func_809F01CC(this, play); -// } -// } - -// void func_809F0B0C(Boss05 *this, PlayState *play) { -// s32 temp_t9; -// u8 var_v0; - -// Actor_MoveWithGravity(&this->dyna.actor); -// var_v0 = this->unk15C; -// if (var_v0 == 0) { -// Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x44U); -// var_v0 = 2U & 0xFF; -// if (this->dyna.actor.bgCheckFlags & 0x20) { -// this->unk15C = 1; -// var_v0 = 1U & 0xFF; -// } else { -// this->unk15C = 2; -// } -// } -// if (var_v0 == 1) { -// Math_ApproachF(&this->dyna.actor.velocity.y, 1.0f, 1.0f, 0.1f); -// Math_ApproachZeroF(&this->dyna.actor.speedXZ, 0.5f, 0.5f); -// this->dyna.actor.shape.rot.x += this->unk500; -// this->dyna.actor.shape.rot.y += this->unk502; -// if (this->unk162[0] == 0) { -// Actor_MarkForDeath(&this->dyna.actor); -// } -// } else { -// switch (var_v0) { /* irregular */ -// case 2: -// this->dyna.actor.velocity.y = Rand_ZeroFloat(3.0f) + 3.0f; -// this->dyna.actor.speedXZ = randPlusMinusPoint5Scaled(5.0f) + 5.0f; -// temp_t9 = (s32) Rand_ZeroFloat(65536.0f); -// this->unk15C = 3; -// this->dyna.actor.gravity = -1.0f; -// this->dyna.actor.world.rot.y = (s16) temp_t9; -// return; -// case 3: -// Actor_MoveWithGravity(&this->dyna.actor); -// if (this->unk324.y < (this->dyna.actor.floorHeight - 30.0f)) { -// Actor_MarkForDeath(&this->dyna.actor); -// } -// return; -// } -// } -// } - -// void Boss05_Update(Actor *thisx, PlayState *play) { -// CollisionCheckContext *sp30; -// ColliderJntSph *sp2C; -// ColliderJntSph *temp_a2; -// CollisionCheckContext *temp_a1; -// s16 temp_a0; -// s16 temp_v0; -// s16 temp_v0_2; -// s16 temp_v0_3; -// s16 temp_v0_4; -// s16 var_v0; -// u8 temp_v0_5; -// void *temp_v1; -// Boss05 *this = (Boss05 *) thisx; - -// var_v0 = 0; -// this->unk160 += 1; -// do { -// temp_v1 = this + (var_v0 * 2); -// temp_a0 = this->unk162[var_v0]; -// var_v0 += 1; -// if (temp_a0 != 0) { -// temp_v1->unk162 = (s16) (temp_a0 - 1); -// } -// } while (var_v0 < 3); -// temp_v0 = this->unk16A; -// if (temp_v0 != 0) { -// this->unk16A = temp_v0 - 1; -// } -// temp_v0_2 = this->unk16C; -// if (temp_v0_2 != 0) { -// this->unk16C = temp_v0_2 - 1; -// } -// temp_v0_3 = this->unk168; -// if (temp_v0_3 != 0) { -// this->unk168 = temp_v0_3 - 1; -// } -// temp_v0_4 = this->unk17A; -// if (temp_v0_4 != 0) { -// this->unk17A = temp_v0_4 - 1; -// } -// this->actionFunc(this, play); -// if (this->dyna.actor.params == 4) { -// Actor_MoveWithGravity(&this->dyna.actor); -// Matrix_RotateYS(this->unk348, MTXMODE_NEW); -// Matrix_MultVecZ(this->unk338, &this->unk33C); -// this->dyna.actor.world.pos.x += this->unk33C.x; -// this->dyna.actor.world.pos.z += this->unk33C.z; -// Math_ApproachZeroF(&this->unk338, 1.0f, 1.0f); -// Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x45U); -// func_809EFE50(&this->dyna.actor, play); -// temp_a2 = &this->unk368; -// temp_a1 = &play->colChkCtx; -// sp30 = temp_a1; -// sp2C = temp_a2; -// CollisionCheck_SetAT(play, temp_a1, &temp_a2->base); -// CollisionCheck_SetAC(play, temp_a1, &temp_a2->base); -// CollisionCheck_SetOC(play, temp_a1, &temp_a2->base); -// this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y; -// } -// temp_v0_5 = this->unk188; -// switch (temp_v0_5) { -// case 0: -// this->unk189 = 0; -// this->unk17A = 0; -// this->unk184 = 0.0f; -// return; -// case 1: -// this->unk189 = 0; -// this->unk17A = 0x50; -// this->unk184 = 1.0f; -// this->unk188 = temp_v0_5 + 1; -// this->unk17C = 0.0f; -// /* fallthrough */ -// case 2: -// if (this->unk17A == 0) { -// Math_ApproachZeroF(&this->unk184, 1.0f, 0.02f); -// if (this->unk184 == 0.0f) { -// this->unk188 = 0; -// return; -// } -// default: -// return; -// } -// Math_ApproachF(&this->unk17C, 1.0f, 0.1f, 0.5f); -// return; -// case 10: -// this->unk189 = 0xA; -// this->unk17A = 0x50; -// this->unk184 = 1.0f; -// this->unk188 = temp_v0_5 + 1; -// this->unk17C = 0.0f; -// this->unk180 = 2.0f; -// /* fallthrough */ -// case 11: -// if (this->unk17A == 0) { -// func_809EE4E0(this, play); -// this->unk188 = 0; -// return; -// } -// Math_ApproachF(&this->unk17C, 1.0f, 1.0f, 0.25f); -// Math_ApproachF(&this->unk180, 1.0f, 0.1f, 0.1f); -// return; -// case 20: -// this->unk189 = 0x14; -// this->unk17A = 0x50; -// this->unk184 = 1.0f; -// this->unk188 = temp_v0_5 + 1; -// this->unk17C = 0.0f; -// return; -// case 21: -// if (this->unk17A == 0) { -// Math_ApproachZeroF(&this->unk17C, 1.0f, 0.03f); -// if (this->unk17C == 0.0f) { -// this->unk188 = 0; -// this->unk184 = 0.0f; -// return; -// } -// } else { -// Math_ApproachF(&this->unk17C, 1.0f, 0.5f, 0.5f); -// } -// break; -// } -// } - -// s32 func_809F1050(PlayState *play, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { -// s8 temp_v1; -// void *temp_a1; - -// if (limbIndex == gGameInfo->data[0x500]) { -// if (!(thisx->unk160 & 3)) { -// *dList = NULL; -// } -// rot->x += gGameInfo->data[0x501] << 8; -// rot->y += gGameInfo->data[0x502] << 8; -// rot->z += gGameInfo->data[0x503] << 8; -// } -// if ((thisx->params == 1) && (limbIndex == 9)) { -// *dList = NULL; -// } -// if (limbIndex == 2) { -// rot->x += thisx->unk19C; -// } -// temp_v1 = *(&D_809F1CB8 + limbIndex); -// if (temp_v1 >= 0) { -// temp_a1 = thisx + (temp_v1 * 6); -// rot->x += temp_a1->unk19E; -// rot->y += temp_a1->unk1A0; -// rot->z += temp_a1->unk1A2; -// } -// return 0; -// } - -// void func_809F1170(PlayState *play, s32 limbIndex, Gfx **dList, Vec3s *rot, Actor *thisx) { -// MtxF sp3C; -// Vec3f sp30; -// Vec3f sp24; -// void *sp20; - -// if (limbIndex == 4) { -// Matrix_MultVec3f(&D_809F1CC4, thisx + 0x324); -// if (func_809EFAB4 == thisx->unk170) { -// Matrix_MultVec3f(&D_809F1CC4, &thisx->focus.pos); -// } -// Matrix_Get(&sp3C); -// Matrix_MtxFToYXZRot(&sp3C, thisx + 0x330, 0); -// thisx->unk330 = (s16) (thisx->unk330 + 0xF00); -// } -// if (limbIndex == 2) { -// Matrix_MultZero(&sp30); -// func_809EE668(0, thisx + 0x1C8, &sp30); -// } -// if (limbIndex == 3) { -// sp20 = thisx + 0x1C8; -// Matrix_MultVecY(-500.0f, &sp24); -// func_809EE668(1, sp20, &sp24); -// if (func_809EEDE8 == thisx->unk170) { -// Matrix_MultVecY(1500.0f, &thisx->focus.pos); -// } -// } -// } - -// s32 func_809F1284(PlayState *play, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { -// return 0; -// } - -// void func_809F12A0(PlayState *play, s32 limbIndex, Gfx **dList, Vec3s *rot, Actor *thisx) { -// if (limbIndex == 1) { -// Matrix_MultVec3f(&D_809F1CD0, &D_809F2110); -// func_809EE668(0, thisx + 0x368, &D_809F2110); -// if (thisx->params == 4) { -// Matrix_MultVec3f(D_809F1CDC, &thisx->focus.pos); -// } -// if (thisx->unk188 != 0) { -// Matrix_MultVec3f(D_809F1CDC, thisx + 0x18C); -// if (thisx->unk189 == 0) { -// thisx->unk190 = (f32) (thisx->unk190 - 15.0f); -// } -// } -// } -// } - -// void func_809F135C(PlayState *play, s32 limbIndex, Actor *thisx) { -// f32 temp_fa0; -// f32 temp_fa0_2; -// f32 temp_fa0_3; - -// if ((limbIndex == 2) || (limbIndex == 3)) { -// temp_fa0 = thisx->unk35C; -// Matrix_Scale(temp_fa0, 1.0f, temp_fa0, MTXMODE_APPLY); -// } -// if (limbIndex == 1) { -// temp_fa0_2 = thisx->unk360; -// Matrix_Scale(temp_fa0_2, temp_fa0_2, temp_fa0_2, MTXMODE_APPLY); -// } -// if ((limbIndex >= 4) && (limbIndex < 0x14)) { -// temp_fa0_3 = thisx->unk364; -// Matrix_Scale(temp_fa0_3, temp_fa0_3, temp_fa0_3, MTXMODE_APPLY); -// } -// } - -// s32 func_809F1404(PlayState *play, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { -// if ((limbIndex >= 3) && (limbIndex < 9)) { -// *dList = NULL; -// } -// return 0; -// } - -// s32 func_809F1430(PlayState *play, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { -// if ((limbIndex == 1) || (limbIndex == 2) || (limbIndex == 9)) { -// *dList = NULL; -// } -// return 0; -// } - -// void func_809F1464(PlayState *play, s32 limbIndex, Actor *thisx) { -// f32 temp_fa0; - -// if ((limbIndex >= 3) && (limbIndex < 9)) { -// temp_fa0 = thisx->unk198; -// Matrix_Scale(temp_fa0, temp_fa0, temp_fa0, MTXMODE_APPLY); -// } -// } - -// s32 func_809F14AC(PlayState *play, s32 limbIndex, Gfx **dList, Vec3f *pos, Vec3s *rot, Actor *thisx) { -// if (limbIndex != D_809F1CC0[thisx->params]) { -// *dList = NULL; -// } else if ((s32) thisx->unk15C >= 2) { -// rot->x += thisx->unk160 * 0x3000; -// rot->y += thisx->unk160 * 0x1A00; -// rot->z += thisx->unk160 << 0xD; -// } -// return 0; -// } - -// void func_809F1550(PlayState *play, s32 limbIndex, Gfx **dList, Vec3s *rot, Actor *thisx) { -// if (limbIndex != D_809F1CC0[thisx->params]) { -// Matrix_MultZero(thisx + 0x324); -// } -// } - -// void Boss05_Draw(Actor *thisx, PlayState *play) { -// GraphicsContext *sp34; -// GraphicsContext *temp_a0; -// s16 temp_v0; -// Boss05 *this = (Boss05 *) thisx; - -// temp_a0 = play->state.gfxCtx; -// sp34 = temp_a0; -// func_8012C28C(temp_a0); -// if (func_809EEDE8 == this->actionFunc) { -// SkelAnime_DrawFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, (s32) this->unk268.dListCount, -// func_809F1050, func_809F1170, &this->dyna.actor); if (this->unk16C & 1) { -// sp34->polyOpa.p = Gfx_SetFog(sp34->polyOpa.p, 0xFF, 0, 0, 0xFF, 0x384, 0x44B); -// } -// Matrix_Translate(this->unk324.x, this->unk324.y, this->unk324.z, MTXMODE_NEW); -// Matrix_RotateYS(this->unk330.y, MTXMODE_APPLY); -// Matrix_RotateXS(this->unk330.x, MTXMODE_APPLY); -// Matrix_RotateZS(this->unk330.z, MTXMODE_APPLY); -// Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY); -// AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); -// SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, (s32) -// this->unk3C8.dListCount, func_809F1284, func_809F12A0, func_809F135C, &this->dyna.actor); -// } else { -// temp_v0 = this->dyna.actor.params; -// if (temp_v0 == 2) { -// Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, -// this->dyna.actor.world.pos.z, MTXMODE_NEW); Matrix_RotateYS(this->unk176, MTXMODE_APPLY); -// Matrix_RotateXS(this->unk178, MTXMODE_APPLY); -// Matrix_RotateYS((s16) (this->unk176 * -1), MTXMODE_APPLY); -// Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_APPLY); -// Matrix_RotateXS(this->dyna.actor.shape.rot.x, MTXMODE_APPLY); -// Matrix_RotateZS(this->dyna.actor.shape.rot.z, MTXMODE_APPLY); -// Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, -// MTXMODE_APPLY); SkelAnime_DrawFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, (s32) -// this->unk268.dListCount, func_809F1404, NULL, &this->dyna.actor); -// } else if (temp_v0 == 3) { -// SkelAnime_DrawTransformFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, (s32) -// this->unk268.dListCount, func_809F1430, func_809F1170, func_809F1464, &this->dyna.actor); -// Matrix_Translate(this->unk324.x, this->unk324.y, this->unk324.z, MTXMODE_NEW); -// Matrix_RotateYS(this->unk330.y, MTXMODE_APPLY); -// Matrix_RotateXS(this->unk330.x, MTXMODE_APPLY); -// Matrix_RotateZS(this->unk330.z, MTXMODE_APPLY); -// Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, -// MTXMODE_APPLY); AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); -// SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, (s32) -// this->unk3C8.dListCount, func_809F1284, func_809F12A0, func_809F135C, &this->dyna.actor); -// Actor_DrawDamageEffects(play, &this->dyna.actor, &this->unk18C, 1, this->unk17C, this->unk180, -// this->unk184, (u8) (s32) this->unk189); -// } else if (temp_v0 == 4) { -// AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); -// if (this->unk16C & 1) { -// sp34->polyOpa.p = Gfx_SetFog(sp34->polyOpa.p, 0xFF, 0, 0, 0xFF, 0x384, 0x44B); -// } -// SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, (s32) -// this->unk3C8.dListCount, func_809F1284, func_809F12A0, func_809F135C, &this->dyna.actor); -// Actor_DrawDamageEffects(play, &this->dyna.actor, &this->unk18C, 1, this->unk17C, this->unk180, -// this->unk184, (u8) (s32) this->unk189); -// } else if (temp_v0 >= 0xA) { -// AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); -// SkelAnime_DrawFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, (s32) -// this->unk3C8.dListCount, func_809F14AC, func_809F1550, &this->dyna.actor); -// } -// } -// sp34->polyOpa.p = func_801660B8(play, sp34->polyOpa.p); -// } diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.h b/src/overlays/actors/ovl_Boss_05/z_boss_05.h index 36cfd9a7b..4881b702d 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.h +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.h @@ -17,7 +17,8 @@ typedef void (*Boss05ActionFunc)(struct Boss05*, PlayState*); typedef struct Boss05 { /* 0x000 */ DynaPolyActor dyna; /* 0x15C */ u8 unk15C; /* inferred */ - /* 0x15D */ char pad15D[3]; /* maybe part of unk15C[4]? */ + /* 0x15D */ char pad15D[1]; + /* 0x15E */ s16 unk15E; /* inferred */ /* 0x160 */ s16 unk160; /* inferred */ /* 0x162 */ s16 unk162[3]; /* 0x168 */ s16 unk168; /* inferred */ @@ -25,7 +26,9 @@ typedef struct Boss05 { /* 0x16C */ s16 unk16C; /* inferred */ /* 0x16E */ char pad16E[2]; /* 0x170 */ Boss05ActionFunc actionFunc; - /* 0x174 */ char pad174[2]; // possibly this is a Vec3s + /* 0x174 */ u8 unk174; /* inferred */ + /* 0x175 */ char pad175[1]; + // /* 0x174 */ char pad174[2]; // possibly this is a Vec3s /* 0x176 */ s16 unk176; /* 0x178 */ s16 unk178; /* 0x17A */ s16 unk17A; /* inferred */ From d2c48628444b32292804e5f88d31fcdc15f769de Mon Sep 17 00:00:00 2001 From: Elliptic Ellipsis Date: Tue, 20 Sep 2022 18:16:37 +0100 Subject: [PATCH 4/9] OK Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com> --- src/overlays/actors/ovl_Boss_05/z_boss_05.c | 800 ++++---------------- 1 file changed, 140 insertions(+), 660 deletions(-) diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.c b/src/overlays/actors/ovl_Boss_05/z_boss_05.c index 521149654..f4e4fc602 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.c +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.c @@ -379,7 +379,8 @@ void func_809EEDD0(Boss05* this, PlayState* play) { extern Vec3s D_809F1C60[]; extern Vec3s D_809F1C8C[]; -// Vec3s D_809F1C60[7] = { +// In-function static doesn't seem to help +// static Vec3s D_809F1C60[7] = { // { 0x3200, 0, 0 }, // { -0x1E00, 0, 0 }, // { -0x1400, 0, 0 }, @@ -388,8 +389,7 @@ extern Vec3s D_809F1C8C[]; // { 0, 0, 0 }, // { 0, 0, 0 }, // }; - -// Vec3s D_809F1C8C[7] = { +// static Vec3s D_809F1C8C[7] = { // { -0x3200, 0, 0 }, // { 0, 0, 0 }, // { 0x1E00, 0, 0 }, @@ -399,70 +399,11 @@ extern Vec3s D_809F1C8C[]; // { 0, 0, 0 }, // }; -// The big one -// #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809EEDE8.s") -// struct _m2c_stack_func_809EEDE8 { -// /* 0x000 */ char pad0[0x5C]; -// /* 0x05C */ s16 *sp5C; -// /* 0x060 */ s16 *sp60; -// /* 0x064 */ char pad64[8]; /* maybe part of sp60[3]? */ -// /* 0x06C */ Vec3s *sp6C; -// /* 0x070 */ f32 sp70; -// /* 0x074 */ s32 sp74; -// /* 0x078 */ char pad78[8]; /* maybe part of sp74[3]? */ -// /* 0x080 */ f32 sp80; -// /* 0x084 */ char pad84[0x10]; /* maybe part of sp80[5]? */ -// /* 0x094 */ Vec3f sp94; -// /* 0x0A0 */ char padA0[4]; -// /* 0x0A4 */ f32 spA4; -// /* 0x0A8 */ char padA8[0xC]; /* maybe part of spA4[4]? */ -// /* 0x0B4 */ s32 spB4; -// /* 0x0B8 */ s32 spB8; -// /* 0x0BC */ s32 spBC; -// /* 0x0C0 */ s32 spC0; -// /* 0x0C4 */ s32 spC4; -// /* 0x0C8 */ s32 spC8; -// /* 0x0CC */ s32 spCC; -// /* 0x0D0 */ s32 spD0; -// /* 0x0D4 */ s32 spD4; -// /* 0x0D8 */ Vec3s spD8; -// /* 0x0DE */ char padDE[0x25]; /* maybe part of spD8[7]? */ -// /* 0x103 */ u8 sp103; -// /* 0x104 */ char pad104[4]; /* maybe part of sp103[5]? */ -// /* 0x108 */ Player *sp108; -// /* 0x10C */ char pad10C[4]; -// }; /* size = 0x110 */ - -// Vec3s D_809F1C60[7] = { -// { 0x3200, 0, 0 }, -// { -0x1E00, 0, 0 }, -// { -0x1400, 0, 0 }, -// { 0, 0, 0 }, -// { 0, 0, 0 }, -// { 0, 0, 0 }, -// { 0, 0, 0 }, -// }; -// Vec3s D_809F1C8C[7] = { -// { -0x3200, 0, 0 }, -// { 0, 0, 0 }, -// { 0x1E00, 0, 0 }, -// { 0, 0, 0 }, -// { 0, 0, 0 }, -// { 0, 0, 0 }, -// { 0, 0, 0 }, -// }; - -extern Vec3s D_809F1C60[]; -extern Vec3s D_809F1C8C[]; - -void func_809EEDE8(Boss05 *this, PlayState *play) { - s32 pad; - - Player *sp108; - - s32 pad1; - - u8 sp103; +void func_809EEDE8(Boss05* this, PlayState* play) { + s32 var_s3; + Player* sp108 = GET_PLAYER(play); + s32 var_v1; + u8 sp103 = 0; Vec3s spD8[7]; s32 spD4; s32 spD0; @@ -473,76 +414,17 @@ void func_809EEDE8(Boss05 *this, PlayState *play) { s32 spBC; s32 spB8; s32 spB4; - - s32 pad2; - + s32 var_s6; + s32 var_s7; + s16 var_s5; + s16 var_s4; f32 spA4; - Vec3f sp94; - // f32 sp80; - // s32 sp74; - // f32 sp70; - // Vec3s *sp6C; - // s16 *sp60; - // s16 *sp5C; - // ? *temp_t5; - // ? temp_t2_2; - // ? temp_t4; - // ? temp_t5_4; - // Boss05 *temp_v0_6; - // Boss05 *temp_v0_7; - // Player *temp_v1; - // ActorContext *temp_s0_2; - // CollisionCheckContext *temp_s0_3; - // CollisionCheckContext *temp_s0_4; - // SkelAnime *temp_s0; - // Vec3s *var_s1; - // f32 *temp_s1; - // f32 temp_ft4; f32 var_fv1; - // s16 var_s4; - // s16 var_s5; - s16 var_s6; - s16 var_s7; - // s32 temp_lo; - // s32 temp_v0_5; - // s32 var_s0; - s32 var_s0_2; - s32 var_s0_3; - s32 var_s3; - // s32 var_s3_2; + Vec3f sp94; s32 var_s4_2; - s32 var_v1; - // u8 temp_v0; - // u8 temp_v0_2; - // void *temp_t1; - // void *temp_t1_2; - // void *temp_t2; - // void *temp_t2_3; - // void *temp_t2_4; - // void *temp_t3; - // void *temp_t3_2; - // void *temp_t5_2; - // void *temp_t5_3; - // void *temp_t6; - // void *temp_t6_2; - // void *temp_t7; - // void *temp_t8; - // void *temp_t8_2; - // void *temp_t9; - // void *temp_t9_2; - // void *temp_t9_3; - // Vec3s *temp_v0_3; - // Vec3s *temp_v0_4; - - - sp108 = GET_PLAYER(play); - sp103 = 0; - // var_s3 = 0; - // temp_v0 = this->unk174; this->dyna.actor.hintId = 8; - // var_s0 = 0; - // var_s1 = spD8; + if (this->unk174 == 0) { spD4 = 0x3E8; spD0 = 0x3E80; @@ -578,17 +460,8 @@ void func_809EEDE8(Boss05 *this, PlayState *play) { var_s6 = 1; var_s7 = 0x1000; } else { - var_s6 = 0; - var_s7 = 0; - spB4 = 0; - spB8 = 0; - spBC = 0; - spC0 = 0; - spC4 = 0; - spC8 = 0; - spCC = 0; - spD0 = 0; - spD4 = 0; + + spD4 = spD0 = spCC = spC8 = spC4 = spC0 = spBC = spB8 = spB4 = var_s6 = var_s7 = 0; } } @@ -596,40 +469,46 @@ void func_809EEDE8(Boss05 *this, PlayState *play) { if ((this->unk174 == 0) || (this->unk174 == 3)) { if (var_s3 < 3) { spD8[var_s3].y = 0; - spD8[var_s3].x = (s32) (Math_SinS((this->unk160 * spD4) + (var_s3 * spD0)) * spCC); + spD8[var_s3].x = (s32)(Math_SinS((this->unk160 * spD4) + (var_s3 * spD0)) * spCC); } else { spD8[var_s3].x = 0; - spD8[var_s3].y = (s32) (Math_SinS((this->unk160 * spC8) + (var_s3 * spC4)) * spC0); + spD8[var_s3].y = (s32)(Math_SinS((this->unk160 * spC8) + (var_s3 * spC4)) * spC0); } if ((var_s3 == 4) || (var_s3 == 6)) { - spD8[var_s3].z = (s32) (2.0f * (Math_SinS((this->unk160 * spBC) + var_s3 * spB8) * spB4)); + spD8[var_s3].z = (s32)(Math_SinS((this->unk160 * spBC) + (var_s3 * spB8)) * spB4 * 2.0f); } else { - spD8[var_s3].z = (s32) (Math_SinS((this->unk160 * spBC) + var_s3 * spB8) * spB4); + spD8[var_s3].z = (s32)(Math_SinS((this->unk160 * spBC) + (var_s3 * spB8)) * spB4); } - } else if (this->unk174 == 1) { - var_s6 = 5; - var_s7 = 0x1000; - spD8[var_s3].x = D_809F1C60[var_s3].x; - spD8[var_s3].y = D_809F1C60[var_s3].y; - spD8[var_s3].z = D_809F1C60[var_s3].z; - } else if (this->unk174 == 2) { - var_s6 = 1; - var_s7 = 0x2000; - spD8[var_s3].x = D_809F1C8C[var_s3].x; - spD8[var_s3].y = D_809F1C8C[var_s3].y; - spD8[var_s3].z = D_809F1C8C[var_s3].z; + var_s4 = var_s6; + var_s5 = var_s7; + } else { + if (this->unk174 == 1) { + var_s6 = 5; + var_s7 = 0x1000; + spD8[var_s3].x = D_809F1C60[var_s3].x; + spD8[var_s3].y = D_809F1C60[var_s3].y; + spD8[var_s3].z = D_809F1C60[var_s3].z; + } else if (this->unk174 == 2) { + var_s6 = 1; + var_s7 = 0x2000; + spD8[var_s3].x = D_809F1C8C[var_s3].x; + spD8[var_s3].y = D_809F1C8C[var_s3].y; + spD8[var_s3].z = D_809F1C8C[var_s3].z; + } + var_s4 = var_s6; + var_s5 = var_s7; } Math_ApproachS(&this->unk19E[var_s3].x, spD8[var_s3].x, var_s6, var_s7); Math_ApproachS(&this->unk19E[var_s3].y, spD8[var_s3].y, var_s6, var_s7); Math_ApproachS(&this->unk19E[var_s3].z, spD8[var_s3].z, var_s6, var_s7); - } + // There is some scope for which of var_s4,var_s5 and var_s6,var_s7 are used here spA4 = (sp108->actor.world.pos.y - this->dyna.actor.world.pos.y) + 10.0f; if (spA4 < 0.0f) { - Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, var_s6, var_s7); + Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, var_s4, var_s5); } SkelAnime_Update(&this->unk3C8); @@ -638,93 +517,95 @@ void func_809EEDE8(Boss05 *this, PlayState *play) { Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 0x14, 0x800); } - switch (this->unk15C) { /* irregular */ - case 0: - this->unk174 = 0; - this->unk3C8.playSpeed = 1.0f; - if (spA4 < 0.0f) { - if (sp108->actor.speedXZ > 10.0f) { - var_fv1 = 220.0f; - } else { - var_fv1 = 150.0f; - } - if ((this->unk162[0] == 0) && (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= var_fv1)) { - this->unk15C = 1; - this->unk162[0] = 0xA; - } - this->unk15E = 0; - // goto block_42; - } else { - - sp103 = 1; - if (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= 40.0f) { - this->unk15E++; - if (this->unk15E > 0x1E) { - this->unk15C = 0xA; - this->unk162[0] = 0x1E; - Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); + switch (this->unk15C) { /* irregular */ + case 0: + this->unk174 = 0; + this->unk3C8.playSpeed = 1.0f; + if (spA4 < 0.0f) { + if (sp108->actor.speedXZ > 10.0f) { + var_fv1 = 220.0f; + } else { + var_fv1 = 150.0f; + } + if ((this->unk162[0] == 0) && (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= var_fv1)) { + this->unk15C = 1; + this->unk162[0] = 0xA; } - } else { - // block_42: this->unk15E = 0; + // goto block_42; + } else { + + sp103 = 1; + if (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= 40.0f) { + this->unk15E++; + if (this->unk15E > 0x1E) { + this->unk15C = 0xA; + this->unk162[0] = 0x1E; + Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); + } + } else { + // block_42: + this->unk15E = 0; + } } - } - if (!(this->unk160 & 3) && (Rand_ZeroOne() < 0.5f)) { - Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); - } - break; + if (!(this->unk160 & 3) && (Rand_ZeroOne() < 0.5f)) { + Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); + } + break; - case 10: - if (!(this->unk160 & 1)) { - Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); - } - this->unk19C = (this->unk162[0] & 1) << 9; - this->unk174 = 3; - this->unk3C8.playSpeed = 4.0f; - Math_ApproachS(&this->dyna.actor.shape.rot.x, -0x8000, 2, 0x2000); - Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, 2, 0x2000); - if (this->unk162[0] == 0) { - this->unk15E = 0; - this->unk15C = 0; - this->unk162[0] = 0x64; - } - if (this->unk162[0] == 0x1B) { - Math_Vec3f_Copy(&sp94, &this->dyna.actor.world.pos); - sp94.y += 40.0f; - EffectSsGSplash_Spawn(play, &sp94, NULL, NULL, 1, 0x7D0); - Actor_PlaySfxAtPos(&this->dyna.actor, 0x2808U); - } - break; + case 10: + if (!(this->unk160 & 1)) { + Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); + } + this->unk19C = (this->unk162[0] & 1) << 9; + this->unk174 = 3; + this->unk3C8.playSpeed = 4.0f; + Math_ApproachS(&this->dyna.actor.shape.rot.x, -0x8000, 2, 0x2000); + Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, 2, 0x2000); + if (this->unk162[0] == 0) { + this->unk15E = 0; + this->unk15C = 0; + this->unk162[0] = 0x64; + } + if (this->unk162[0] == 0x1B) { + Math_Vec3f_Copy(&sp94, &this->dyna.actor.world.pos); + sp94.y += 40.0f; + EffectSsGSplash_Spawn(play, &sp94, NULL, NULL, 1, 0x7D0); + Actor_PlaySfxAtPos(&this->dyna.actor, 0x2808U); + } + break; - case 1: - if (Animation_OnFrame(&this->unk3C8, this->unk4FC)) { - this->unk3C8.playSpeed = 0.0f; - } - this->unk174 = 1; - if (this->unk162[0] == 0) { - this->unk15C = 2; - this->unk162[0] = 0x14; - Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); - } - break; + case 1: + if (Animation_OnFrame(&this->unk3C8, this->unk4FC)) { + this->unk3C8.playSpeed = 0.0f; + } + this->unk174 = 1; + if (this->unk162[0] == 0) { + this->unk15C = 2; + this->unk162[0] = 0x14; + Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); + } + break; - case 2: - if (!(this->unk160 & 1)) { - Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); - } - this->unk19C = (this->unk162[0] & 1) << 9; - this->unk3C8.playSpeed = 4.0f; - Math_ApproachF(&this->unk35C, 1.5f, 1.0f, 0.7f); - this->unk174 = 2; - if (this->unk162[0] == 0) { - this->unk15C = 0; - this->unk162[0] = 0x1E; - } - break; + case 2: + if (!(this->unk160 & 1)) { + Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); + } + this->unk19C = (this->unk162[0] & 1) << 9; + this->unk3C8.playSpeed = 4.0f; + Math_ApproachF(&this->unk35C, 1.5f, 1.0f, 0.7f); + this->unk174 = 2; + if (this->unk162[0] == 0) { + this->unk15C = 0; + this->unk162[0] = 0x1E; + } + break; } var_s4_2 = func_809EECBC(this, play); if ((var_s4_2 != 0) || (this->unk168 == 1)) { + Boss05* temp_v0_6; + this->dyna.actor.params = 2; this->actionFunc = func_809EF9BC; this->dyna.actor.flags &= ~1; @@ -733,43 +614,47 @@ void func_809EEDE8(Boss05 *this, PlayState *play) { var_s4_2 = 0xA; } if (var_s4_2 >= 0xA) { - Boss05 *temp_v0_6 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 3); + temp_v0_6 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, + this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, + this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, + this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 3); if (temp_v0_6 != NULL) { Player* temp_v1 = GET_PLAYER(play); - if (&this->dyna.actor == temp_v1->targetActor) { - temp_v1->targetActor = &temp_v0_6->dyna.actor; + if (temp_v1->unk_730 == &this->dyna.actor) { + temp_v1->unk_730 = &temp_v0_6->dyna.actor; play->actorCtx.targetContext.arrowPointedActor = &temp_v0_6->dyna.actor; play->actorCtx.targetContext.targetedActor = &temp_v0_6->dyna.actor; } - for (var_s0_2 = 0; var_s0_2 < 10; var_s0_2++) { - temp_v0_6->unk268.jointTable[var_s0_2] = this->unk268.jointTable[var_s0_2]; + for (var_s3 = 0; var_s3 < 10; var_s3++) { + temp_v0_6->unk268.jointTable[var_s3] = this->unk268.jointTable[var_s3]; } - for (var_s0_2 = 0; var_s0_2 < 20; var_s0_2++) { - temp_v0_6->unk3C8.jointTable[var_s0_2] = this->unk3C8.jointTable[var_s0_2]; + for (var_s3 = 0; var_s3 < 20; var_s3++) { + temp_v0_6->unk3C8.jointTable[var_s3] = this->unk3C8.jointTable[var_s3]; } - Actor_PlaySfxAtPos(&this->dyna.actor, 0x381EU); + Actor_PlaySfxAtPos(&this->dyna.actor, 0x381E); if (var_s4_2 >= 0xB) { temp_v0_6->unk188 = var_s4_2 - 0xA; } } } else if (var_s4_2 == 2) { for (var_s3 = 0; var_s3 < 2; var_s3++) { - Boss05 *temp_v0_6 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, this->unk324.x, this->unk324.y, this->unk324.z, this->unk330.x, this->unk330.y, this->unk330.z, var_s3 + 0xA); + temp_v0_6 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, this->unk324.x, + this->unk324.y, this->unk324.z, this->unk330.x, this->unk330.y, + this->unk330.z, var_s3 + 0xA); if (temp_v0_6 != NULL) { - + for (var_v1 = 0; var_v1 < 20; var_v1++) { temp_v0_6->unk3C8.jointTable[var_v1] = this->unk3C8.jointTable[var_v1]; } - temp_v0_6->unk162[0] = (s32) (Rand_ZeroFloat(20.0f) + 20.0f); + temp_v0_6->unk162[0] = (s32)(Rand_ZeroFloat(20.0f) + 20.0f); } } - Actor_PlaySfxAtPos(&this->dyna.actor, 0x381FU); + Actor_PlaySfxAtPos(&this->dyna.actor, 0x381F); } - } if (sp103 == 0) { @@ -780,411 +665,6 @@ void func_809EEDE8(Boss05 *this, PlayState *play) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk1C8.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk368.base); } -// void func_809EEDE8(Boss05 *this, PlayState *play) { -// Player *sp108; -// u8 sp103; -// Vec3s spD8; -// s32 spD4; -// s32 spD0; -// s32 spCC; -// s32 spC8; -// s32 spC4; -// s32 spC0; -// s32 spBC; -// s32 spB8; -// s32 spB4; -// f32 spA4; -// Vec3f sp94; -// f32 sp80; -// s32 sp74; -// f32 sp70; -// Vec3s *sp6C; -// s16 *sp60; -// s16 *sp5C; -// // ? *temp_t5; -// // ? temp_t2_2; -// // ? temp_t4; -// // ? temp_t5_4; -// Boss05 *temp_v0_6; -// Boss05 *temp_v0_7; -// Player *temp_v1; -// ActorContext *temp_s0_2; -// // CollisionCheckContext *temp_s0_3; -// // CollisionCheckContext *temp_s0_4; -// SkelAnime *temp_s0; -// Vec3s *var_s1; -// // f32 *temp_s1; -// f32 temp_ft4; -// f32 var_fv1; -// s16 var_s4; -// s16 var_s5; -// s16 var_s6; -// s16 var_s7; -// s32 temp_lo; -// s32 temp_v0_5; -// s32 var_s0; -// s32 var_s0_2; -// s32 var_s0_3; -// s32 var_s3; -// s32 var_s3_2; -// s32 var_s4_2; -// s32 var_v1; -// u8 temp_v0; -// u8 temp_v0_2; -// // void *temp_t1; -// // void *temp_t1_2; -// // void *temp_t2; -// // void *temp_t2_3; -// // void *temp_t2_4; -// // void *temp_t3; -// // void *temp_t3_2; -// // void *temp_t5_2; -// // void *temp_t5_3; -// // void *temp_t6; -// // void *temp_t6_2; -// // void *temp_t7; -// // void *temp_t8; -// // void *temp_t8_2; -// // void *temp_t9; -// // void *temp_t9_2; -// // void *temp_t9_3; -// Vec3s *temp_v0_3; -// Vec3s *temp_v0_4; - -// sp103 = 0; -// var_s3 = 0; -// sp108 = GET_PLAYER(play); -// temp_v0 = this->unk174; -// this->dyna.actor.hintId = 8; -// var_s0 = 0; -// var_s1 = &spD8; -// if (temp_v0 == 0) { -// spD4 = 0x3E8; -// spD0 = 0x3E80; -// spCC = 0x7D0; -// spC8 = 0x5DC; -// spC4 = 0x1770; -// spC0 = 0xBB8; -// spBC = 0x514; -// spB8 = 0x5208; -// spB4 = 0xDAC; -// var_s6 = 0xA; -// var_s7 = 0x300; -// if (this->unk16C != 0) { -// spD4 = 0x1B58; -// spCC = 0x1770; -// spC0 = 0x1770; -// spBC = 0x1C84; -// spB4 = 0x1964; -// var_s6 = 1; -// var_s7 = 0x1000; -// } -// } else { -// var_s7 = 0; -// if (temp_v0 == 3) { -// spD4 = 0x1B58; -// spD0 = 0x3E80; -// spCC = 0x1388; -// spC8 = 0x5DC; -// spC4 = 0x2328; -// spC0 = 0x1388; -// spBC = 0x1C84; -// spB8 = 0x5208; -// spB4 = 0x157C; -// var_s6 = 1; -// var_s7 = 0x1000; -// } else { -// var_s6 = 0; -// spB4 = 0; -// spB8 = 0; -// spBC = 0; -// spC0 = 0; -// spC4 = 0; -// spC8 = 0; -// spCC = 0; -// spD0 = 0; -// spD4 = 0; -// } -// } -// sp5C = &this->unk19E[0].z; -// sp60 = &this->unk19E[0].y; -// sp6C = this->unk19E; -// do { -// // temp_v0_2 = this->unk174; -// if ((this->unk174 == 0) || (this->unk174 == 3)) { -// temp_lo = var_s3 * spB8; -// var_s5 = var_s7; -// var_s4 = var_s6; -// sp70 = (f32) spB4; -// if (var_s3 < 3) { -// var_s1->y = 0; -// sp74 = temp_lo; -// sp80 = (f32) spCC; -// var_s1->x = (s32) (Math_SinS((this->unk160 * spD4) + (var_s3 * spD0)) * sp80); -// } else { -// var_s1->x = 0; -// sp74 = temp_lo; -// sp80 = (f32) spC0; -// var_s1->y = (s32) (Math_SinS((s16) ((this->unk160 * spC8) + (var_s3 * spC4))) * sp80); -// } -// if ((var_s3 == 4) || (var_s3 == 6)) { -// var_s1->z = (s32) (2.0f * (Math_SinS((this->unk160 * spBC) + temp_lo) * sp70)); -// } else { -// var_s1->z = (s32) (Math_SinS((this->unk160 * spBC) + temp_lo) * sp70); -// } -// } else { -// if (this->unk174 == 1) { -// temp_v0_3 = var_s0 + D_809F1C60; -// var_s6 = 5; -// var_s7 = 0x1000; -// var_s1->x = temp_v0_3->x; -// var_s1->y = temp_v0_3->y; -// var_s1->z = temp_v0_3->z; -// } else if (this->unk174 == 2) { -// temp_v0_4 = var_s0 + D_809F1C8C; -// var_s6 = 1; -// var_s7 = 0x2000; -// var_s1->x = temp_v0_4->x; -// var_s1->y = temp_v0_4->y; -// var_s1->z = temp_v0_4->z; -// } -// var_s5 = var_s7; -// var_s4 = var_s6; -// } -// Math_ApproachS(&sp6C->x, var_s1->x, var_s4, var_s5); -// Math_ApproachS(sp60, var_s1->y, var_s4, var_s5); -// Math_ApproachS(sp5C, var_s1->z, var_s4, var_s5); -// var_s3 += 1; -// sp5C += 6; -// sp60 += 6; -// sp6C += 6; -// var_s0 += 6; -// var_s1 += 6; -// } while (var_s3 < 7); - - -// temp_ft4 = (sp108->actor.world.pos.y - this->dyna.actor.world.pos.y) + 10.0f; -// spA4 = temp_ft4; -// if (temp_ft4 < 0.0f) { -// Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, var_s4, var_s5); -// } -// // temp_s0 = &this->unk3C8; -// SkelAnime_Update(&this->unk3C8); -// // temp_s1 = &this->unk35C; -// Math_ApproachF(&this->unk35C, 1.0f, 0.1f, 0.1f); -// if (this->unk15C != 0xA) { -// Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 0x14, 0x800); -// } - -// switch (this->unk15C) { /* irregular */ -// case 0: -// this->unk174 = 0; -// this->unk3C8.playSpeed = 1.0f; -// if (spA4 < 0.0f) { -// if (sp108->actor.speedXZ > 10.0f) { -// var_fv1 = 220.0f; -// } else { -// var_fv1 = 150.0f; -// } -// if ((this->unk162[0] == 0) && (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= var_fv1)) { -// this->unk15C = 1; -// this->unk162[0] = 0xA; -// } -// goto block_42; -// } -// sp103 = 1; -// if (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= 40.0f) { -// this->unk15E++; -// if (this->unk15E >= 0x1F) { -// this->unk15C = 0xA; -// this->unk162[0] = 0x1E; -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); -// } -// } else { -// block_42: -// this->unk15E = 0; -// } -// if (!(this->unk160 & 3) && (Rand_ZeroOne() < 0.5f)) { -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); -// } -// break; -// case 10: -// if (!(this->unk160 & 1)) { -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); -// } -// this->unk19C = (this->unk162[0] & 1) << 9; -// this->unk174 = 3; -// this->unk3C8.playSpeed = 4.0f; -// Math_ApproachS(&this->dyna.actor.shape.rot.x, -0x8000, 2, 0x2000); -// Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, 2, 0x2000); -// if (this->unk162[0] == 0) { -// this->unk162[0] = 0x64; -// this->unk15E = 0; -// this->unk15C = 0; -// } -// if (this->unk162[0] == 0x1B) { -// Math_Vec3f_Copy(&sp94, &this->dyna.actor.world.pos); -// sp94.y += 40.0f; -// EffectSsGSplash_Spawn(play, &sp94, NULL, NULL, (s16) 1, (s16) 0x7D0); -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x2808U); -// } -// break; -// case 1: -// if (Animation_OnFrame(temp_s0, this->unk4FC)) { -// this->unk3C8.playSpeed = 0.0f; -// } -// this->unk174 = 1; -// if (this->unk162[0] == 0) { -// this->unk15C = 2; -// this->unk162[0] = 0x14; -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); -// } -// break; -// case 2: -// if (!(this->unk160 & 1)) { -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); -// } -// this->unk19C = (this->unk162[0] & 1) << 9; -// this->unk3C8.playSpeed = 4.0f; -// Math_ApproachF(&this->unk35C, 1.5f, 1.0f, 0.7f); -// this->unk174 = 2; -// if (this->unk162[0] == 0) { -// this->unk15C = 0; -// this->unk162[0] = 0x1E; -// } -// break; -// } - -// temp_v0_5 = func_809EECBC(this, play); -// var_s4_2 = temp_v0_5; -// if ((temp_v0_5 != 0) || (this->unk168 == 1)) { -// this->dyna.actor.params = 2; -// this->actionFunc = func_809EF9BC; -// this->dyna.actor.flags &= ~1; -// temp_s0_2 = &play->actorCtx; -// func_800BC154(play, temp_s0_2, &this->dyna.actor, 1); -// if (this->unk168 != 0) { -// var_s4_2 = 0xA; -// } -// if (var_s4_2 >= 0xA) { -// temp_v0_6 = (Boss05*)Actor_SpawnAsChild(temp_s0_2, &this->dyna.actor, play, 0x12D, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 3); -// if (temp_v0_6 != NULL) { -// var_s0_2 = 0; -// temp_v1 = GET_PLAYER(play); -// if (&this->dyna.actor == temp_v1->targetActor) { -// temp_v1->targetActor = temp_v0_6; -// play->actorCtx.targetContext.arrowPointedActor = temp_v0_6; -// play->actorCtx.targetContext.targetedActor = temp_v0_6; -// } - -// // do { -// // temp_t5 = this->unk268.jointTable + var_s0_2; -// // temp_t4 = (unaligned s32) temp_t5->unk0; -// // temp_t1 = temp_v0_6->unk288 + var_s0_2; -// // var_s0_2 += 6; -// // temp_t1->unk0 = (unaligned s32) temp_t4; -// // temp_t1->unk4 = (u16) temp_t5->unk4; -// // } while (var_s0_2 < 0x3C); - -// for (var_s0_2 = 0; var_s0_2 < 10; var_s0_2++) { -// temp_v0_6->unk268.jointTable[var_s0_2] = this->unk268.jointTable[var_s0_2]; -// } - -// for (var_s0_3 = 0; var_s0_3 < 20; var_s0_3++) { -// temp_v0_6->unk3C8.jointTable[var_s0_3] = this->unk3C8.jointTable[var_s0_3]; -// } - -// // var_s0_3 = 0; -// // do { -// // temp_t9 = this->unk3C8.jointTable + var_s0_3; -// // temp_t7 = temp_v0_6->unk3E8 + var_s0_3; -// // temp_t7->unk0 = (unaligned s32) temp_t9->unk0; -// // temp_t7->unk4 = (u16) temp_t9->unk4; -// // temp_t6 = this->unk3C8.jointTable + var_s0_3; -// // temp_t3 = temp_v0_6->unk3E8 + var_s0_3; -// // temp_t3->unk6 = (unaligned s32) temp_t6->unk6; -// // temp_t3->unkA = (u16) temp_t6->unkA; -// // temp_t5_2 = this->unk3C8.jointTable + var_s0_3; -// // temp_t2 = temp_v0_6->unk3E8 + var_s0_3; -// // temp_t2->unkC = (unaligned s32) temp_t5_2->unkC; -// // temp_t2->unk10 = (u16) temp_t5_2->unk10; -// // temp_t9_2 = this->unk3C8.jointTable + var_s0_3; -// // temp_t2_2 = (unaligned s32) temp_t9_2->unk12; -// // temp_t8 = temp_v0_6->unk3E8 + var_s0_3; -// // var_s0_3 += 0x18; -// // temp_t8->unk12 = (unaligned s32) temp_t2_2; -// // temp_t8->unk16 = (u16) temp_t9_2->unk16; -// // } while (var_s0_3 != 0x78); - - -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x381EU); -// if (var_s4_2 >= 0xB) { -// temp_v0_6->unk188 = (s8) (var_s4_2 - 0xA); -// } -// } -// } else { -// var_s3_2 = 0; -// if (var_s4_2 == 2) { -// for (var_s3_2 = 0; var_s3_2 < 2; var_s3_2++) { -// temp_v0_7 = (Boss05*)Actor_SpawnAsChild(temp_s0_2, &this->dyna.actor, play, 0x12D, this->unk324.x, this->unk324.y, this->unk324.z, this->unk330.x, this->unk330.y, this->unk330.z, var_s3_2 + 0xA); -// if (temp_v0_7 != NULL) { - -// for (var_v1 = 0; var_v1 < 20; var_v1++) { -// temp_v0_6->unk3C8.jointTable[var_v1] = this->unk3C8.jointTable[var_v1]; -// } - -// temp_v0_7->unk162[0] = (s32) (Rand_ZeroFloat(20.0f) + 20.0f); -// } -// } -// // do { -// // temp_v0_7 = (Boss05*)Actor_SpawnAsChild(temp_s0_2, &this->dyna.actor, play, 0x12D, this->unk324.x, this->unk324.y, this->unk324.z, this->unk330.x, this->unk330.y, this->unk330.z, var_s3_2 + 0xA); -// // if (temp_v0_7 != NULL) { - -// // for (var_v1 = 0; var_v1 < 20; var_v1++) { -// // temp_v0_6->unk3C8.jointTable[var_v1] = this->unk3C8.jointTable[var_v1]; -// // } - -// // // var_v1 = 0; -// // // do { -// // // temp_t2_3 = this->unk3C8.jointTable + var_v1; -// // // temp_t9_3 = temp_v0_7->unk3E8 + var_v1; -// // // temp_t9_3->unk0 = (unaligned s32) temp_t2_3->unk0; -// // // temp_t9_3->unk4 = (u16) temp_t2_3->unk4; -// // // temp_t8_2 = this->unk3C8.jointTable + var_v1; -// // // temp_t6_2 = temp_v0_7->unk3E8 + var_v1; -// // // temp_t6_2->unk6 = (unaligned s32) temp_t8_2->unk6; -// // // temp_t6_2->unkA = (u16) temp_t8_2->unkA; -// // // temp_t3_2 = this->unk3C8.jointTable + var_v1; -// // // temp_t5_3 = temp_v0_7->unk3E8 + var_v1; -// // // temp_t5_3->unkC = (unaligned s32) temp_t3_2->unkC; -// // // temp_t5_3->unk10 = (u16) temp_t3_2->unk10; -// // // temp_t2_4 = this->unk3C8.jointTable + var_v1; -// // // temp_t5_4 = (unaligned s32) temp_t2_4->unk12; -// // // temp_t1_2 = temp_v0_7->unk3E8 + var_v1; -// // // var_v1 += 0x18; -// // // temp_t1_2->unk12 = (unaligned s32) temp_t5_4; -// // // temp_t1_2->unk16 = (u16) temp_t2_4->unk16; -// // // } while (var_v1 != 0x78); - -// // temp_v0_7->unk162[0] = (s32) (Rand_ZeroFloat(20.0f) + 20.0f); -// // } -// // var_s3_2 += 1; -// // } while (var_s3_2 != 2); - -// Actor_PlaySfxAtPos(&this->dyna.actor, 0x381FU); -// } -// } -// } - -// if (sp103 == 0) { -// CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk1C8.base); -// CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk368.base); -// } - -// CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk1C8.base); -// CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk368.base); -// } - void func_809EF9BC(Boss05* this, PlayState* play) { Player* player = GET_PLAYER(play); @@ -1262,10 +742,10 @@ void func_809EFAB4(Boss05* this, PlayState* play) { if (temp_v0 != NULL) { player = GET_PLAYER(play); - if (&this->dyna.actor == player->unk_730) { - player->unk_730 = temp_v0; - play->actorCtx.targetContext.arrowPointedActor = temp_v0; - play->actorCtx.targetContext.targetedActor = temp_v0; + if (player->unk_730 == &this->dyna.actor) { + player->unk_730 = &temp_v0->dyna.actor; + play->actorCtx.targetContext.arrowPointedActor = &temp_v0->dyna.actor; + play->actorCtx.targetContext.targetedActor = &temp_v0->dyna.actor; } for (i = 0; i < 20; i++) { From 41841abc9a3d676fac42bb2664457a2e82e406fa Mon Sep 17 00:00:00 2001 From: Elliptic Ellipsis Date: Tue, 20 Sep 2022 20:55:56 +0100 Subject: [PATCH 5/9] Data/bss in, extract colheader --- assets/xml/overlays/ovl_Boss_05.xml | 5 + spec | 2 - src/overlays/actors/ovl_Boss_05/z_boss_05.c | 381 ++++++-------------- 3 files changed, 121 insertions(+), 267 deletions(-) create mode 100644 assets/xml/overlays/ovl_Boss_05.xml diff --git a/assets/xml/overlays/ovl_Boss_05.xml b/assets/xml/overlays/ovl_Boss_05.xml new file mode 100644 index 000000000..8eef13a4e --- /dev/null +++ b/assets/xml/overlays/ovl_Boss_05.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/spec b/spec index cc7babd85..3dfcaf5c5 100644 --- a/spec +++ b/spec @@ -2399,8 +2399,6 @@ beginseg name "ovl_Boss_05" compress include "build/src/overlays/actors/ovl_Boss_05/z_boss_05.o" - include "build/data/ovl_Boss_05/ovl_Boss_05.data.o" - include "build/data/ovl_Boss_05/ovl_Boss_05.bss.o" include "build/data/ovl_Boss_05/ovl_Boss_05.reloc.o" endseg diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.c b/src/overlays/actors/ovl_Boss_05/z_boss_05.c index f4e4fc602..cd08e6b80 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.c +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.c @@ -38,55 +38,116 @@ void func_809F0A64(Boss05* this, PlayState* play); void func_809F0ABC(Boss05* this, PlayState* play); void func_809F0B0C(Boss05* this, PlayState* play); -#if 0 +#include "overlays/ovl_Boss_05/ovl_Boss_05.c" + +// #if 0 // static ColliderJntSphElementInit sJntSphElementsInit[2] = { -static ColliderJntSphElementInit D_809F1B2C[2] = { +ColliderJntSphElementInit D_809F1B2C[2] = { { - { ELEMTYPE_UNK3, { 0xF7CFFFFF, 0x00, 0x08 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_HARD, BUMP_ON, OCELEM_ON, }, + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x08 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 15 }, 100 }, }, { - { ELEMTYPE_UNK3, { 0xF7CFFFFF, 0x00, 0x08 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_HARD, BUMP_ON, OCELEM_ON, }, + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x08 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 15 }, 100 }, }, }; // static ColliderJntSphInit sJntSphInit = { -static ColliderJntSphInit D_809F1B74 = { - { COLTYPE_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, OC2_TYPE_1, COLSHAPE_JNTSPH, }, - ARRAY_COUNT(sJntSphElementsInit), D_809F1B2C, // sJntSphElementsInit, +ColliderJntSphInit D_809F1B74 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + ARRAY_COUNT(D_809F1B2C), + D_809F1B2C, // sJntSphElementsInit, }; // static ColliderJntSphElementInit sJntSphElementsInit[1] = { -static ColliderJntSphElementInit D_809F1B84[1] = { +ColliderJntSphElementInit D_809F1B84[1] = { { - { ELEMTYPE_UNK3, { 0xF7CFFFFF, 0x00, 0x08 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_HARD, BUMP_ON, OCELEM_ON, }, + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x08 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 20 }, 100 }, }, }; // static ColliderJntSphInit sJntSphInit = { -static ColliderJntSphInit D_809F1BA8 = { - { COLTYPE_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, OC2_TYPE_1, COLSHAPE_JNTSPH, }, - ARRAY_COUNT(sJntSphElementsInit), D_809F1B84, // sJntSphElementsInit, +ColliderJntSphInit D_809F1BA8 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + ARRAY_COUNT(D_809F1B84), + D_809F1B84, // sJntSphElementsInit, }; // static ColliderJntSphElementInit sJntSphElementsInit[1] = { -static ColliderJntSphElementInit D_809F1BB8[1] = { +ColliderJntSphElementInit D_809F1BB8[1] = { { - { ELEMTYPE_UNK3, { 0xF7CFFFFF, 0x00, 0x08 }, { 0xF7FFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_HARD, BUMP_ON, OCELEM_ON, }, + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x08 }, + { 0xF7FFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 15 }, 100 }, }, }; // static ColliderJntSphInit sJntSphInit = { -static ColliderJntSphInit D_809F1BDC = { - { COLTYPE_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, OC2_TYPE_1, COLSHAPE_JNTSPH, }, - ARRAY_COUNT(sJntSphElementsInit), D_809F1BB8, // sJntSphElementsInit, +ColliderJntSphInit D_809F1BDC = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + ARRAY_COUNT(D_809F1BB8), + D_809F1BB8, // sJntSphElementsInit, }; +// extern Color_RGBA8 D_809F1BEC; +// extern Color_RGBA8 D_809F1BF0; +// extern Vec3f D_809F1BF4; +Color_RGBA8 D_809F1BEC = { 170, 255, 255, 255 }; +Color_RGBA8 D_809F1BF0 = { 200, 200, 255, 255 }; +Vec3f D_809F1BF4 = { 0.0f, -1.0f, 0.0f }; + // static DamageTable sDamageTable = { -static DamageTable D_809F1C00 = { +DamageTable D_809F1C00 = { /* Deku Nut */ DMG_ENTRY(0, 0x0), /* Deku Stick */ DMG_ENTRY(1, 0xF), /* Horse trample */ DMG_ENTRY(0, 0x0), @@ -122,7 +183,7 @@ static DamageTable D_809F1C00 = { }; // static DamageTable sDamageTable = { -static DamageTable D_809F1C20 = { +DamageTable D_809F1C20 = { /* Deku Nut */ DMG_ENTRY(0, 0x1), /* Deku Stick */ DMG_ENTRY(3, 0xF), /* Horse trample */ DMG_ENTRY(0, 0x0), @@ -169,17 +230,17 @@ const ActorInit Boss_05_InitVars = { (ActorFunc)Boss05_Draw, }; -#endif +// #endif -extern CollisionHeader D_809F1B00; -extern ColliderJntSphElementInit D_809F1B2C[2]; -extern ColliderJntSphInit D_809F1B74; -extern ColliderJntSphElementInit D_809F1B84[1]; -extern ColliderJntSphInit D_809F1BA8; -extern ColliderJntSphElementInit D_809F1BB8[1]; -extern ColliderJntSphInit D_809F1BDC; -extern DamageTable D_809F1C00; -extern DamageTable D_809F1C20; +// extern CollisionHeader D_809F1B00; +// extern ColliderJntSphElementInit D_809F1B2C[2]; +// extern ColliderJntSphInit D_809F1B74; +// extern ColliderJntSphElementInit D_809F1B84[1]; +// extern ColliderJntSphInit D_809F1BA8; +// extern ColliderJntSphElementInit D_809F1BB8[1]; +// extern ColliderJntSphInit D_809F1BDC; +// extern DamageTable D_809F1C00; +// extern DamageTable D_809F1C20; extern AnimationHeader D_060006A4; extern AnimationHeader D_06000A5C; @@ -194,13 +255,6 @@ extern AnimationHeader D_06006E50; extern AnimationHeader D_06007488; extern AnimationHeader D_06007908; -extern Color_RGBA8 D_809F1BEC; -extern Color_RGBA8 D_809F1BF0; -extern Vec3f D_809F1BF4; -// static Color_RGBA8 D_809F1BEC = { 0xAA, 0xFF, 0xFF, 0xFF }; -// static Color_RGBA8 D_809F1BF0 = { 0xC8, 0xC8, 0xFF, 0xFF }; -// static Vec3f D_809F1BF4 = { 0.0f, -1.0f, 0.0f }; - void func_809EE4E0(Boss05* this, PlayState* play) { Vec3f sp8C; Vec3f sp80; @@ -252,7 +306,7 @@ void Boss05_Init(Actor* thisx, PlayState* play) { this->dyna.actor.colChkInfo.damageTable = &D_809F1C00; DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_809F1B00, &colHeader); + CollisionHeader_GetVirtual(&sBioBabaLilypadCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); func_809EEDD0(this, play); @@ -272,7 +326,7 @@ void Boss05_Init(Actor* thisx, PlayState* play) { } else if (this->dyna.actor.params == 2) { this->actionFunc = func_809EF9BC; - CollisionHeader_GetVirtual(&D_809F1B00, &colHeader); + CollisionHeader_GetVirtual(&sBioBabaLilypadCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 10); @@ -377,27 +431,14 @@ void func_809EEDD0(Boss05* this, PlayState* play) { this->actionFunc = func_809EEDE8; } -extern Vec3s D_809F1C60[]; -extern Vec3s D_809F1C8C[]; -// In-function static doesn't seem to help -// static Vec3s D_809F1C60[7] = { -// { 0x3200, 0, 0 }, -// { -0x1E00, 0, 0 }, -// { -0x1400, 0, 0 }, -// { 0, 0, 0 }, -// { 0, 0, 0 }, -// { 0, 0, 0 }, -// { 0, 0, 0 }, -// }; -// static Vec3s D_809F1C8C[7] = { -// { -0x3200, 0, 0 }, -// { 0, 0, 0 }, -// { 0x1E00, 0, 0 }, -// { 0, 0, 0 }, -// { 0, 0, 0 }, -// { 0, 0, 0 }, -// { 0, 0, 0 }, -// }; +// extern Vec3s D_809F1C60[]; +// extern Vec3s D_809F1C8C[]; +Vec3s D_809F1C60[7] = { + { 0x3200, 0, 0 }, { -0x1E00, 0, 0 }, { -0x1400, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, +}; +Vec3s D_809F1C8C[7] = { + { -0x3200, 0, 0 }, { 0, 0, 0 }, { 0x1E00, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, +}; void func_809EEDE8(Boss05* this, PlayState* play) { s32 var_s3; @@ -1178,7 +1219,10 @@ void Boss05_Update(Actor* thisx, PlayState* play) { } } -extern u8 D_809F1CB8[]; +// extern s8 D_809F1CB8[]; +s8 D_809F1CB8[] = { + -1, -1, 0, 1, 2, 3, 4, 5, 6, -1, -1, 0, +}; s32 func_809F1050(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { Boss05* this = THIS; @@ -1211,7 +1255,8 @@ s32 func_809F1050(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s return false; } -extern Vec3f D_809F1CC4; +// extern Vec3f D_809F1CC4; +Vec3f D_809F1CC4 = { 0.0f, -1400.0f, 600.0f }; void func_809F1170(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { Boss05* this = THIS; @@ -1250,9 +1295,12 @@ s32 func_809F1284(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s return false; } -extern Vec3f D_809F1CD0; -extern Vec3f D_809F1CDC; -extern Vec3f D_809F2110; // bss +// extern Vec3f D_809F1CD0; +Vec3f D_809F1CD0 = { 1600.0f, -300.0f, 0.0f }; +// extern Vec3f D_809F1CDC; +Vec3f D_809F1CDC = { 700.0f, 0.0f, 0.0f }; +// extern Vec3f D_809F2110; // bss +Vec3f D_809F2110; // bss void func_809F12A0(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { Boss05* this = THIS; @@ -1312,7 +1360,10 @@ void func_809F1464(PlayState* play, s32 limbIndex, Actor* thisx) { } } -extern s32 D_809F1CE8[]; +// extern s32 D_809F1CE8[]; +s32 D_809F1CE8[] = { + 2, 3, 1, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, +}; s32 func_809F14AC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { Boss05* this = THIS; @@ -1414,203 +1465,3 @@ void Boss05_Draw(Actor* thisx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx); } - -// typedef struct Boss05 { -// /* 0x000 */ DynaPolyActor dyna; -// /* 0x15C */ u8 unk15C; -// /* 0x15D */ char pad15D[1]; -// /* 0x15E */ s16 unk15E; /* inferred */ -// /* 0x160 */ s16 unk160; -// /* 0x162 */ s16 unk162[3]; -// /* 0x168 */ s16 unk168; -// /* 0x16A */ s16 unk16A; -// /* 0x16C */ s16 unk16C; -// /* 0x16E */ char pad16E[2]; -// /* 0x170 */ void (*actionFunc)(Boss05 *, PlayState *); -// /* 0x174 */ u8 unk174; /* inferred */ -// /* 0x175 */ char pad175[1]; -// /* 0x176 */ s16 unk176; -// /* 0x178 */ s16 unk178; -// /* 0x17A */ s16 unk17A; -// /* 0x17C */ f32 unk17C; -// /* 0x180 */ f32 unk180; -// /* 0x184 */ f32 unk184; -// /* 0x188 */ u8 unk188; -// /* 0x189 */ u8 unk189; -// /* 0x18A */ char pad18A[2]; /* maybe part of unk189[3]? */ -// /* 0x18C */ Vec3f unk18C; -// /* 0x198 */ f32 unk198; -// /* 0x19C */ s16 unk19C; /* inferred */ -// /* 0x19E */ s16 unk19E; /* inferred */ -// /* 0x1A0 */ s16 unk1A0; /* inferred */ -// /* 0x1A2 */ s16 unk1A2; /* inferred */ -// /* 0x1A4 */ char pad1A4[0x24]; /* maybe part of unk1A2[0x13]? */ -// /* 0x1C8 */ ColliderJntSph unk1C8; -// /* 0x1E8 */ ColliderJntSphElement unk1E8[2]; -// /* 0x268 */ SkelAnime unk268; -// /* 0x2AC */ Vec3s unk2AC[0xA]; -// /* 0x2E8 */ Vec3s unk2E8[0xA]; -// /* 0x324 */ Vec3f unk324; -// /* 0x330 */ Vec3s unk330; -// /* 0x336 */ s8 unk336[2]; -// /* 0x338 */ f32 unk338; -// /* 0x33C */ Vec3f unk33C; -// /* 0x348 */ s16 unk348; -// /* 0x34A */ s8 unk34A[2]; -// /* 0x34C */ f32 unk34C; -// /* 0x350 */ s8 unk350[4]; -// /* 0x354 */ f32 unk354; -// /* 0x358 */ f32 unk358; -// /* 0x35C */ f32 unk35C; -// /* 0x360 */ f32 unk360; -// /* 0x364 */ f32 unk364; -// /* 0x368 */ ColliderJntSph unk368; -// /* 0x388 */ ColliderJntSphElement unk388[1]; -// /* 0x3C8 */ SkelAnime unk3C8; -// /* 0x40C */ Vec3s unk40C[0x14]; -// /* 0x484 */ Vec3s unk484[0x14]; -// /* 0x4FC */ f32 unk4FC; -// /* 0x500 */ s16 unk500; -// /* 0x502 */ s16 unk502; -// /* 0x504 */ char pad504[4]; /* maybe part of unk502[3]? */ -// } Boss05; /* size = 0x508 */ - -// static BgCamInfo D_809F1A20 = { 0, 0, NULL }; -// static SurfaceType D_809F1A28 = { { 0x10000, 0x7C8 } }; -// static CollisionPoly D_809F1A30[0xA]; /* unable to generate initializer */ -// static Vec3s D_809F1AD0[8] = { -// { -0xDAC, 0, -0xDAC }, -// { -0xDAC, 0, 0xDAC }, -// { 0xDAC, 0, 0xDAC }, -// { 0xDAC, 0, -0xDAC }, -// { 0xDAC, -0xFA0, -0xDAC }, -// { -0xDAC, -0xFA0, -0xDAC }, -// { 0xDAC, -0xFA0, 0xDAC }, -// { -0xDAC, -0xFA0, 0xDAC }, -// }; -// static ? D_809F1C60; /* unable to generate initializer */ -// static ? D_809F1C8C; /* unable to generate initializer */ -// static ? D_809F1CB8; /* unable to generate initializer */ -// static s32 D_809F1CC0[1] = { 0x06FFFF00 }; -// static Vec3f D_809F1CC4 = { 0.0f, -1400.0f, 600.0f }; -// static Vec3f D_809F1CD0 = { 1600.0f, -300.0f, 0.0f }; -// static Vec3f D_809F1CDC[5] = { -// { 700.0f, 0.0f, 0.0f }, -// { 3e-45.0f, 4e-45.0f, 1e-45.0f }, -// { 6e-45.0f, 7e-45.0f, 1e-44.0f }, -// { 1.1e-44f, 1.4e-44f, 1.5e-44f }, -// { 1.8e-44f, 2e-44.0f, 2.2e-44f }, -// }; /* extra bytes: 8 */ -// static Vec3f D_809F2110; -// CollisionHeader D_809F1B00 = { -// { -0xDAC, -0xFA0, -0xDAC }, -// { 0xDAC, 0, 0xDAC }, -// 8, -// D_809F1AD0, -// 0xA, -// D_809F1A30, -// &D_809F1A28, -// &D_809F1A20, -// 0, -// NULL, -// }; -// ColliderJntSphElementInit D_809F1B2C[2] = { -// { -// { 3, { 0xF7CFFFFF, 0, 8 }, { 0xF7CFFFFF, 0, 0 }, 9, 1, 1 }, -// { 0, { { 0, 0, 0 }, 0xF }, 0x64 }, -// }, -// { -// { 3, { 0xF7CFFFFF, 0, 8 }, { 0xF7CFFFFF, 0, 0 }, 9, 1, 1 }, -// { 0, { { 0, 0, 0 }, 0xF }, 0x64 }, -// }, -// }; -// ColliderJntSphInit D_809F1B74 = { { 3, 0x11, 9, 9, 0x10, 0 }, 2, D_809F1B2C }; -// ColliderJntSphElementInit D_809F1B84[1] = { -// { -// { 3, { 0xF7CFFFFF, 0, 8 }, { 0xF7CFFFFF, 0, 0 }, 9, 1, 1 }, -// { 0, { { 0, 0, 0 }, 0x14 }, 0x64 }, -// }, -// }; -// ColliderJntSphInit D_809F1BA8 = { { 3, 0x11, 9, 9, 0x10, 0 }, 1, D_809F1B84 }; -// ColliderJntSphElementInit D_809F1BB8[1] = { -// { -// { 3, { 0xF7CFFFFF, 0, 8 }, { 0xF7FFFFFF, 0, 0 }, 9, 1, 1 }, -// { 0, { { 0, 0, 0 }, 0xF }, 0x64 }, -// }, -// }; -// ColliderJntSphInit D_809F1BDC = { { 3, 0x11, 9, 9, 0x10, 0 }, 1, D_809F1BB8 }; -// Color_RGBA8 D_809F1BEC = { 0xAA, 0xFF, 0xFF, 0xFF }; -// Color_RGBA8 D_809F1BF0 = { 0xC8, 0xC8, 0xFF, 0xFF }; -// Vec3f D_809F1BF4 = { 0.0f, -1.0f, 0.0f }; -// DamageTable D_809F1C00 = { -// { -// 0, -// 0xF1, -// 0, -// 0xF1, -// 0xF1, -// 0xF3, -// 0, -// 3, -// 0xF2, -// 0xE1, -// 0xF1, -// 0x21, -// 0x31, -// 0x43, -// 0xF1, -// 0xF1, -// 0xF3, -// 0xF2, -// 0, -// 0xF1, -// 0, -// 0, -// 0xF1, -// 0xF1, -// 0xF1, -// 0, -// 0, -// 0, -// 0, -// 0, -// 0, -// 0xF1, -// }, -// }; -// DamageTable D_809F1C20 = { -// { -// 0x10, -// 0xF3, -// 0, -// 0xF1, -// 0xF1, -// 0xF1, -// 0, -// 0x10, -// 0xF1, -// 0xF1, -// 0xF1, -// 0x22, -// 0x32, -// 0x42, -// 0xF1, -// 0x10, -// 0xF1, -// 0xF2, -// 0x10, -// 0xF1, -// 0, -// 0, -// 0xF1, -// 0xF1, -// 0xF1, -// 0, -// 0, -// 0x21, -// 0, -// 0, -// 0, -// 0xF1, -// }, -// }; From 03b849214c525e85a30296062cb6698fef31c93f Mon Sep 17 00:00:00 2001 From: Elliptic Ellipsis Date: Tue, 20 Sep 2022 21:17:35 +0100 Subject: [PATCH 6/9] Clean up externs --- src/overlays/actors/ovl_Boss_05/z_boss_05.c | 33 ++------------------- 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.c b/src/overlays/actors/ovl_Boss_05/z_boss_05.c index cd08e6b80..26b63a1b1 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.c +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.c @@ -40,7 +40,6 @@ void func_809F0B0C(Boss05* this, PlayState* play); #include "overlays/ovl_Boss_05/ovl_Boss_05.c" -// #if 0 // static ColliderJntSphElementInit sJntSphElementsInit[2] = { ColliderJntSphElementInit D_809F1B2C[2] = { { @@ -139,9 +138,6 @@ ColliderJntSphInit D_809F1BDC = { D_809F1BB8, // sJntSphElementsInit, }; -// extern Color_RGBA8 D_809F1BEC; -// extern Color_RGBA8 D_809F1BF0; -// extern Vec3f D_809F1BF4; Color_RGBA8 D_809F1BEC = { 170, 255, 255, 255 }; Color_RGBA8 D_809F1BF0 = { 200, 200, 255, 255 }; Vec3f D_809F1BF4 = { 0.0f, -1.0f, 0.0f }; @@ -230,18 +226,6 @@ const ActorInit Boss_05_InitVars = { (ActorFunc)Boss05_Draw, }; -// #endif - -// extern CollisionHeader D_809F1B00; -// extern ColliderJntSphElementInit D_809F1B2C[2]; -// extern ColliderJntSphInit D_809F1B74; -// extern ColliderJntSphElementInit D_809F1B84[1]; -// extern ColliderJntSphInit D_809F1BA8; -// extern ColliderJntSphElementInit D_809F1BB8[1]; -// extern ColliderJntSphInit D_809F1BDC; -// extern DamageTable D_809F1C00; -// extern DamageTable D_809F1C20; - extern AnimationHeader D_060006A4; extern AnimationHeader D_06000A5C; extern AnimationHeader D_06000ABC; @@ -431,8 +415,6 @@ void func_809EEDD0(Boss05* this, PlayState* play) { this->actionFunc = func_809EEDE8; } -// extern Vec3s D_809F1C60[]; -// extern Vec3s D_809F1C8C[]; Vec3s D_809F1C60[7] = { { 0x3200, 0, 0 }, { -0x1E00, 0, 0 }, { -0x1400, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, }; @@ -1219,10 +1201,7 @@ void Boss05_Update(Actor* thisx, PlayState* play) { } } -// extern s8 D_809F1CB8[]; -s8 D_809F1CB8[] = { - -1, -1, 0, 1, 2, 3, 4, 5, 6, -1, -1, 0, -}; +s8 D_809F1CB8[] = { -1, -1, 0, 1, 2, 3, 4, 5, 6, -1, -1, 0 }; s32 func_809F1050(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { Boss05* this = THIS; @@ -1255,7 +1234,6 @@ s32 func_809F1050(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s return false; } -// extern Vec3f D_809F1CC4; Vec3f D_809F1CC4 = { 0.0f, -1400.0f, 600.0f }; void func_809F1170(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { @@ -1295,11 +1273,9 @@ s32 func_809F1284(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s return false; } -// extern Vec3f D_809F1CD0; Vec3f D_809F1CD0 = { 1600.0f, -300.0f, 0.0f }; -// extern Vec3f D_809F1CDC; Vec3f D_809F1CDC = { 700.0f, 0.0f, 0.0f }; -// extern Vec3f D_809F2110; // bss + Vec3f D_809F2110; // bss void func_809F12A0(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { @@ -1360,10 +1336,7 @@ void func_809F1464(PlayState* play, s32 limbIndex, Actor* thisx) { } } -// extern s32 D_809F1CE8[]; -s32 D_809F1CE8[] = { - 2, 3, 1, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, -}; +s32 D_809F1CE8[] = { 2, 3, 1, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19 }; s32 func_809F14AC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { Boss05* this = THIS; From 592e8d4d6d62f6c875608489d552d7182815a3c3 Mon Sep 17 00:00:00 2001 From: Elliptic Ellipsis Date: Wed, 21 Sep 2022 05:03:28 +0100 Subject: [PATCH 7/9] Better match for func_809EECBC --- src/overlays/actors/ovl_Boss_05/z_boss_05.c | 213 ++++++++++---------- 1 file changed, 103 insertions(+), 110 deletions(-) diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.c b/src/overlays/actors/ovl_Boss_05/z_boss_05.c index 26b63a1b1..b3a30cd37 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.c +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.c @@ -144,38 +144,38 @@ Vec3f D_809F1BF4 = { 0.0f, -1.0f, 0.0f }; // static DamageTable sDamageTable = { DamageTable D_809F1C00 = { - /* Deku Nut */ DMG_ENTRY(0, 0x0), - /* Deku Stick */ DMG_ENTRY(1, 0xF), - /* Horse trample */ DMG_ENTRY(0, 0x0), - /* Explosives */ DMG_ENTRY(1, 0xF), - /* Zora boomerang */ DMG_ENTRY(1, 0xF), - /* Normal arrow */ DMG_ENTRY(3, 0xF), - /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), - /* Hookshot */ DMG_ENTRY(3, 0x0), - /* Goron punch */ DMG_ENTRY(2, 0xF), - /* Sword */ DMG_ENTRY(1, 0xE), - /* Goron pound */ DMG_ENTRY(1, 0xF), - /* Fire arrow */ DMG_ENTRY(1, 0x2), - /* Ice arrow */ DMG_ENTRY(1, 0x3), - /* Light arrow */ DMG_ENTRY(3, 0x4), - /* Goron spikes */ DMG_ENTRY(1, 0xF), - /* Deku spin */ DMG_ENTRY(1, 0xF), - /* Deku bubble */ DMG_ENTRY(3, 0xF), - /* Deku launch */ DMG_ENTRY(2, 0xF), - /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), - /* Zora barrier */ DMG_ENTRY(1, 0xF), - /* 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, 0xF), - /* Sword beam */ DMG_ENTRY(0, 0x0), - /* Normal Roll */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0), - /* Unblockable */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0), - /* Powder Keg */ DMG_ENTRY(1, 0xF), + /* Deku Nut */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x1), // + /* Deku Stick */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(3, 0xF), // + /* Horse trample */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), + /* Explosives */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), + /* Zora boomerang */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), + /* Normal arrow */ DMG_ENTRY(3, 0xF), // DMG_ENTRY(1, 0xF), // + /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(3, 0x0), // DMG_ENTRY(0, 0x1), // + /* Goron punch */ DMG_ENTRY(2, 0xF), // DMG_ENTRY(1, 0xF), // + /* Sword */ DMG_ENTRY(1, 0xE), // DMG_ENTRY(1, 0xF), // + /* Goron pound */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), + /* Fire arrow */ DMG_ENTRY(1, 0x2), // DMG_ENTRY(2, 0x2), // + /* Ice arrow */ DMG_ENTRY(1, 0x3), // DMG_ENTRY(2, 0x3), // + /* Light arrow */ DMG_ENTRY(3, 0x4), // DMG_ENTRY(2, 0x4), // + /* Goron spikes */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), + /* Deku spin */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(0, 0x1), + /* Deku bubble */ DMG_ENTRY(3, 0xF), // DMG_ENTRY(1, 0xF), // + /* Deku launch */ DMG_ENTRY(2, 0xF), // DMG_ENTRY(2, 0xF), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x1), // + /* Zora barrier */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), + /* Normal shield */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), + /* Light ray */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), + /* Thrown object */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), + /* Zora punch */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), + /* Spin attack */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), + /* Sword beam */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), + /* Normal Roll */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), + /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(1, 0x2), // + /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), + /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), + /* Powder Keg */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), }; // static DamageTable sDamageTable = { @@ -321,7 +321,7 @@ void Boss05_Init(Actor* thisx, PlayState* play) { this->unk198 = 1.0f; SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 10); - SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 0x14); + SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 20); this->unk4FC = Animation_GetLastFrame(&D_06006484); Collider_InitAndSetJntSph(play, &this->unk1C8, &this->dyna.actor, &D_809F1B74, this->unk1E8); @@ -367,13 +367,10 @@ void Boss05_Destroy(Actor* thisx, PlayState* play) { s32 func_809EECBC(Boss05* this, PlayState* play) { if (this->unk16C == 0) { - s32 var_v0 = 0; - ColliderJntSphElement* var_v1 = &this->unk1C8.elements[0]; + s32 i = 0; while (true) { - var_v0 += 0x40; - - if (var_v1->info.bumperFlags & BUMP_HIT) { + if (this->unk1C8.elements[i].info.bumperFlags & 2) { switch (this->dyna.actor.colChkInfo.damageEffect) { case 2: return 11; @@ -385,17 +382,17 @@ s32 func_809EECBC(Boss05* this, PlayState* play) { return 10; } } - var_v1++; - if (var_v0 == 0x80) { - if (this->unk368.elements[0].info.bumperFlags & BUMP_HIT) { + i++; + if (i == 2) { + if (this->unk368.elements[0].info.bumperFlags & 2) { u8 damage = this->dyna.actor.colChkInfo.damage; this->dyna.actor.colChkInfo.health -= damage; if ((s8)this->dyna.actor.colChkInfo.health <= 0) { Enemy_StartFinishingBlow(play, &this->dyna.actor); return 2; } else { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_DAMAGE); + Actor_PlaySfxAtPos(&this->dyna.actor, 0x3807U); this->unk16C = 15; this->unk15C = 0; this->unk162[0] = 30; @@ -423,9 +420,9 @@ Vec3s D_809F1C8C[7] = { }; void func_809EEDE8(Boss05* this, PlayState* play) { - s32 var_s3; + s32 i; Player* sp108 = GET_PLAYER(play); - s32 var_v1; + s32 j; u8 sp103 = 0; Vec3s spD8[7]; s32 spD4; @@ -446,7 +443,7 @@ void func_809EEDE8(Boss05* this, PlayState* play) { Vec3f sp94; s32 var_s4_2; - this->dyna.actor.hintId = 8; + this->dyna.actor.hintId = TATL_HINT_ID_BIO_DEKU_BABA; if (this->unk174 == 0) { spD4 = 0x3E8; @@ -460,6 +457,7 @@ void func_809EEDE8(Boss05* this, PlayState* play) { spB4 = 0xDAC; var_s6 = 0xA; var_s7 = 0x300; + if (this->unk16C != 0) { spD4 = 0x1B58; spCC = 0x1770; @@ -469,39 +467,36 @@ void func_809EEDE8(Boss05* this, PlayState* play) { var_s6 = 1; var_s7 = 0x1000; } + } else if (this->unk174 == 3) { + spD4 = 0x1B58; + spD0 = 0x3E80; + spCC = 0x1388; + spC8 = 0x5DC; + spC4 = 0x2328; + spC0 = 0x1388; + spBC = 0x1C84; + spB8 = 0x5208; + spB4 = 0x157C; + var_s6 = 1; + var_s7 = 0x1000; } else { - if (this->unk174 == 3) { - spD4 = 0x1B58; - spD0 = 0x3E80; - spCC = 0x1388; - spC8 = 0x5DC; - spC4 = 0x2328; - spC0 = 0x1388; - spBC = 0x1C84; - spB8 = 0x5208; - spB4 = 0x157C; - var_s6 = 1; - var_s7 = 0x1000; - } else { - - spD4 = spD0 = spCC = spC8 = spC4 = spC0 = spBC = spB8 = spB4 = var_s6 = var_s7 = 0; - } + spD4 = spD0 = spCC = spC8 = spC4 = spC0 = spBC = spB8 = spB4 = var_s6 = var_s7 = 0; } - for (var_s3 = 0; var_s3 < 7; var_s3++) { + for (i = 0; i < 7; i++) { if ((this->unk174 == 0) || (this->unk174 == 3)) { - if (var_s3 < 3) { - spD8[var_s3].y = 0; - spD8[var_s3].x = (s32)(Math_SinS((this->unk160 * spD4) + (var_s3 * spD0)) * spCC); + if (i < 3) { + spD8[i].y = 0; + spD8[i].x = (s32)(Math_SinS((this->unk160 * spD4) + (i * spD0)) * spCC); } else { - spD8[var_s3].x = 0; - spD8[var_s3].y = (s32)(Math_SinS((this->unk160 * spC8) + (var_s3 * spC4)) * spC0); + spD8[i].x = 0; + spD8[i].y = (s32)(Math_SinS((this->unk160 * spC8) + (i * spC4)) * spC0); } - if ((var_s3 == 4) || (var_s3 == 6)) { - spD8[var_s3].z = (s32)(Math_SinS((this->unk160 * spBC) + (var_s3 * spB8)) * spB4 * 2.0f); + if ((i == 4) || (i == 6)) { + spD8[i].z = (s32)(Math_SinS((this->unk160 * spBC) + (i * spB8)) * spB4 * 2.0f); } else { - spD8[var_s3].z = (s32)(Math_SinS((this->unk160 * spBC) + (var_s3 * spB8)) * spB4); + spD8[i].z = (s32)(Math_SinS((this->unk160 * spBC) + (i * spB8)) * spB4); } var_s4 = var_s6; var_s5 = var_s7; @@ -509,23 +504,23 @@ void func_809EEDE8(Boss05* this, PlayState* play) { if (this->unk174 == 1) { var_s6 = 5; var_s7 = 0x1000; - spD8[var_s3].x = D_809F1C60[var_s3].x; - spD8[var_s3].y = D_809F1C60[var_s3].y; - spD8[var_s3].z = D_809F1C60[var_s3].z; + spD8[i].x = D_809F1C60[i].x; + spD8[i].y = D_809F1C60[i].y; + spD8[i].z = D_809F1C60[i].z; } else if (this->unk174 == 2) { var_s6 = 1; var_s7 = 0x2000; - spD8[var_s3].x = D_809F1C8C[var_s3].x; - spD8[var_s3].y = D_809F1C8C[var_s3].y; - spD8[var_s3].z = D_809F1C8C[var_s3].z; + spD8[i].x = D_809F1C8C[i].x; + spD8[i].y = D_809F1C8C[i].y; + spD8[i].z = D_809F1C8C[i].z; } var_s4 = var_s6; var_s5 = var_s7; } - Math_ApproachS(&this->unk19E[var_s3].x, spD8[var_s3].x, var_s6, var_s7); - Math_ApproachS(&this->unk19E[var_s3].y, spD8[var_s3].y, var_s6, var_s7); - Math_ApproachS(&this->unk19E[var_s3].z, spD8[var_s3].z, var_s6, var_s7); + Math_ApproachS(&this->unk19E[i].x, spD8[i].x, var_s6, var_s7); + Math_ApproachS(&this->unk19E[i].y, spD8[i].y, var_s6, var_s7); + Math_ApproachS(&this->unk19E[i].z, spD8[i].z, var_s6, var_s7); } // There is some scope for which of var_s4,var_s5 and var_s6,var_s7 are used here @@ -552,22 +547,20 @@ void func_809EEDE8(Boss05* this, PlayState* play) { } if ((this->unk162[0] == 0) && (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= var_fv1)) { this->unk15C = 1; - this->unk162[0] = 0xA; + this->unk162[0] = 10; } this->unk15E = 0; - // goto block_42; } else { - sp103 = 1; + if (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= 40.0f) { this->unk15E++; - if (this->unk15E > 0x1E) { + if (this->unk15E > 30) { this->unk15C = 0xA; - this->unk162[0] = 0x1E; + this->unk162[0] = 30; Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); } } else { - // block_42: this->unk15E = 0; } } @@ -588,12 +581,12 @@ void func_809EEDE8(Boss05* this, PlayState* play) { if (this->unk162[0] == 0) { this->unk15E = 0; this->unk15C = 0; - this->unk162[0] = 0x64; + this->unk162[0] = 100; } - if (this->unk162[0] == 0x1B) { + if (this->unk162[0] == 27) { Math_Vec3f_Copy(&sp94, &this->dyna.actor.world.pos); sp94.y += 40.0f; - EffectSsGSplash_Spawn(play, &sp94, NULL, NULL, 1, 0x7D0); + EffectSsGSplash_Spawn(play, &sp94, NULL, NULL, 1, 2000); Actor_PlaySfxAtPos(&this->dyna.actor, 0x2808U); } break; @@ -620,7 +613,7 @@ void func_809EEDE8(Boss05* this, PlayState* play) { this->unk174 = 2; if (this->unk162[0] == 0) { this->unk15C = 0; - this->unk162[0] = 0x1E; + this->unk162[0] = 30; } break; } @@ -634,10 +627,10 @@ void func_809EEDE8(Boss05* this, PlayState* play) { this->dyna.actor.flags &= ~1; func_800BC154(play, &play->actorCtx, &this->dyna.actor, 1); if (this->unk168 != 0) { - var_s4_2 = 0xA; + var_s4_2 = 10; } - if (var_s4_2 >= 0xA) { - temp_v0_6 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, + if (var_s4_2 >= 10) { + temp_v0_6 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_BOSS_05, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 3); @@ -649,28 +642,28 @@ void func_809EEDE8(Boss05* this, PlayState* play) { play->actorCtx.targetContext.targetedActor = &temp_v0_6->dyna.actor; } - for (var_s3 = 0; var_s3 < 10; var_s3++) { - temp_v0_6->unk268.jointTable[var_s3] = this->unk268.jointTable[var_s3]; + for (i = 0; i < 10; i++) { + temp_v0_6->unk268.jointTable[i] = this->unk268.jointTable[i]; } - for (var_s3 = 0; var_s3 < 20; var_s3++) { - temp_v0_6->unk3C8.jointTable[var_s3] = this->unk3C8.jointTable[var_s3]; + for (i = 0; i < 20; i++) { + temp_v0_6->unk3C8.jointTable[i] = this->unk3C8.jointTable[i]; } Actor_PlaySfxAtPos(&this->dyna.actor, 0x381E); - if (var_s4_2 >= 0xB) { - temp_v0_6->unk188 = var_s4_2 - 0xA; + if (var_s4_2 > 10) { + temp_v0_6->unk188 = var_s4_2 - 10; } } } else if (var_s4_2 == 2) { - for (var_s3 = 0; var_s3 < 2; var_s3++) { - temp_v0_6 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, this->unk324.x, - this->unk324.y, this->unk324.z, this->unk330.x, this->unk330.y, - this->unk330.z, var_s3 + 0xA); + for (i = 0; i < 2; i++) { + temp_v0_6 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_BOSS_05, + this->unk324.x, this->unk324.y, this->unk324.z, this->unk330.x, + this->unk330.y, this->unk330.z, i + 10); if (temp_v0_6 != NULL) { - for (var_v1 = 0; var_v1 < 20; var_v1++) { - temp_v0_6->unk3C8.jointTable[var_v1] = this->unk3C8.jointTable[var_v1]; + for (j = 0; j < 20; j++) { + temp_v0_6->unk3C8.jointTable[j] = this->unk3C8.jointTable[j]; } temp_v0_6->unk162[0] = (s32)(Rand_ZeroFloat(20.0f) + 20.0f); @@ -759,9 +752,9 @@ void func_809EFAB4(Boss05* this, PlayState* play) { Math_ApproachZeroF(&this->unk198, 1.0f, 0.05f); if (this->unk198 == 0.0f) { - temp_v0 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, 0x12D, this->unk324.x, - this->unk324.y, this->unk324.z, this->unk330.x, this->unk330.y, - this->unk330.z, 4); + temp_v0 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_BOSS_05, + this->unk324.x, this->unk324.y, this->unk324.z, this->unk330.x, + this->unk330.y, this->unk330.z, 4); if (temp_v0 != NULL) { player = GET_PLAYER(play); @@ -997,9 +990,9 @@ void func_809F0780(Boss05* this, PlayState* play) { if (Animation_OnFrame(&this->unk3C8, 22.0f)) { for (i = 0; i < 14; i++) { temp_v0 = (Boss05*)Actor_SpawnAsChild( - &play->actorCtx, &this->dyna.actor, play, 0x12D, this->dyna.actor.world.pos.x, + &play->actorCtx, &this->dyna.actor, play, ACTOR_BOSS_05, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, - this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, i + 0xA); + this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, i + 10); if (temp_v0 != NULL) { for (j = 0; j < 20; j++) { @@ -1427,7 +1420,7 @@ void Boss05_Draw(Actor* thisx, PlayState* play) { Actor_DrawDamageEffects(play, &this->dyna.actor, &this->unk18C, 1, this->unk17C, this->unk180, this->unk184, this->unk189); - } else if (this->dyna.actor.params >= 0xA) { + } else if (this->dyna.actor.params >= 10) { AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); SkelAnime_DrawFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, this->unk3C8.dListCount, From 18021eef87ef1d94b9dd51268cf70537e516d499 Mon Sep 17 00:00:00 2001 From: Elliptic Ellipsis Date: Wed, 21 Sep 2022 05:17:30 +0100 Subject: [PATCH 8/9] Sfx --- src/overlays/actors/ovl_Boss_05/z_boss_05.c | 45 +++++++++++++-------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.c b/src/overlays/actors/ovl_Boss_05/z_boss_05.c index b3a30cd37..9c3138340 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.c +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.c @@ -392,7 +392,7 @@ s32 func_809EECBC(Boss05* this, PlayState* play) { Enemy_StartFinishingBlow(play, &this->dyna.actor); return 2; } else { - Actor_PlaySfxAtPos(&this->dyna.actor, 0x3807U); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_DAMAGE); this->unk16C = 15; this->unk15C = 0; this->unk162[0] = 30; @@ -449,21 +449,27 @@ void func_809EEDE8(Boss05* this, PlayState* play) { spD4 = 0x3E8; spD0 = 0x3E80; spCC = 0x7D0; + spC8 = 0x5DC; spC4 = 0x1770; spC0 = 0xBB8; + spBC = 0x514; spB8 = 0x5208; spB4 = 0xDAC; + var_s6 = 0xA; var_s7 = 0x300; if (this->unk16C != 0) { spD4 = 0x1B58; spCC = 0x1770; + spC0 = 0x1770; + spBC = 0x1C84; spB4 = 0x1964; + var_s6 = 1; var_s7 = 0x1000; } @@ -471,12 +477,15 @@ void func_809EEDE8(Boss05* this, PlayState* play) { spD4 = 0x1B58; spD0 = 0x3E80; spCC = 0x1388; + spC8 = 0x5DC; spC4 = 0x2328; spC0 = 0x1388; + spBC = 0x1C84; spB8 = 0x5208; spB4 = 0x157C; + var_s6 = 1; var_s7 = 0x1000; } else { @@ -498,18 +507,21 @@ void func_809EEDE8(Boss05* this, PlayState* play) { } else { spD8[i].z = (s32)(Math_SinS((this->unk160 * spBC) + (i * spB8)) * spB4); } + var_s4 = var_s6; var_s5 = var_s7; } else { if (this->unk174 == 1) { var_s6 = 5; var_s7 = 0x1000; + spD8[i].x = D_809F1C60[i].x; spD8[i].y = D_809F1C60[i].y; spD8[i].z = D_809F1C60[i].z; } else if (this->unk174 == 2) { var_s6 = 1; var_s7 = 0x2000; + spD8[i].x = D_809F1C8C[i].x; spD8[i].y = D_809F1C8C[i].y; spD8[i].z = D_809F1C8C[i].z; @@ -531,7 +543,8 @@ void func_809EEDE8(Boss05* this, PlayState* play) { SkelAnime_Update(&this->unk3C8); Math_ApproachF(&this->unk35C, 1.0f, 0.1f, 0.1f); - if (this->unk15C != 0xA) { + + if (this->unk15C != 10) { Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 0x14, 0x800); } @@ -556,24 +569,24 @@ void func_809EEDE8(Boss05* this, PlayState* play) { if (sqrtf(this->dyna.actor.xyzDistToPlayerSq) <= 40.0f) { this->unk15E++; if (this->unk15E > 30) { - this->unk15C = 0xA; + this->unk15C = 10; this->unk162[0] = 30; - Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA1_ATTACK); } } else { this->unk15E = 0; } } if (!(this->unk160 & 3) && (Rand_ZeroOne() < 0.5f)) { - Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA1_MOUTH); } break; case 10: if (!(this->unk160 & 1)) { - Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA1_MOUTH); } - this->unk19C = (this->unk162[0] & 1) << 9; + this->unk19C = (this->unk162[0] & 1) * 0x200; this->unk174 = 3; this->unk3C8.playSpeed = 4.0f; Math_ApproachS(&this->dyna.actor.shape.rot.x, -0x8000, 2, 0x2000); @@ -587,7 +600,7 @@ void func_809EEDE8(Boss05* this, PlayState* play) { Math_Vec3f_Copy(&sp94, &this->dyna.actor.world.pos); sp94.y += 40.0f; EffectSsGSplash_Spawn(play, &sp94, NULL, NULL, 1, 2000); - Actor_PlaySfxAtPos(&this->dyna.actor, 0x2808U); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_OUT_OF_WATER); } break; @@ -598,16 +611,16 @@ void func_809EEDE8(Boss05* this, PlayState* play) { this->unk174 = 1; if (this->unk162[0] == 0) { this->unk15C = 2; - this->unk162[0] = 0x14; - Actor_PlaySfxAtPos(&this->dyna.actor, 0x3861U); + this->unk162[0] = 20; + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA1_ATTACK); } break; case 2: if (!(this->unk160 & 1)) { - Actor_PlaySfxAtPos(&this->dyna.actor, 0x3860U); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA1_MOUTH); } - this->unk19C = (this->unk162[0] & 1) << 9; + this->unk19C = (this->unk162[0] & 1) * 0x200; this->unk3C8.playSpeed = 4.0f; Math_ApproachF(&this->unk35C, 1.5f, 1.0f, 0.7f); this->unk174 = 2; @@ -650,7 +663,7 @@ void func_809EEDE8(Boss05* this, PlayState* play) { temp_v0_6->unk3C8.jointTable[i] = this->unk3C8.jointTable[i]; } - Actor_PlaySfxAtPos(&this->dyna.actor, 0x381E); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA1_DAMAGE); if (var_s4_2 > 10) { temp_v0_6->unk188 = var_s4_2 - 10; } @@ -669,7 +682,7 @@ void func_809EEDE8(Boss05* this, PlayState* play) { temp_v0_6->unk162[0] = (s32)(Rand_ZeroFloat(20.0f) + 20.0f); } } - Actor_PlaySfxAtPos(&this->dyna.actor, 0x381F); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA_DEAD); } } @@ -713,7 +726,7 @@ void func_809EFAB4(Boss05* this, PlayState* play) { Actor_MoveWithGravity(&this->dyna.actor); this->dyna.actor.world.pos.y -= 85.0f; this->dyna.actor.prevPos.y -= 85.0f; - Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x44U); + Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x44); this->dyna.actor.world.pos.y += 85.0f; this->dyna.actor.prevPos.y += 85.0f; @@ -1008,7 +1021,7 @@ void func_809F0780(Boss05* this, PlayState* play) { EffectSsBubble_Spawn(play, &sp7C, 20.0f, 10.0f, 20.0f, 0.13f); } - SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, 0x381F); + SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EN_MIZUBABA_DEAD); Actor_MarkForDeath(&this->dyna.actor); Item_DropCollectibleRandom(play, NULL, &this->dyna.actor.world.pos, 0xE0); } From f4c9720601b71d1ebb2a8a0ec8c1c32f0616743b Mon Sep 17 00:00:00 2001 From: Elliptic Ellipsis Date: Sun, 25 Sep 2022 20:41:09 +0100 Subject: [PATCH 9/9] Lot of naming --- src/overlays/actors/ovl_Boss_05/z_boss_05.c | 499 ++++++++++---------- src/overlays/actors/ovl_Boss_05/z_boss_05.h | 86 ++-- 2 files changed, 297 insertions(+), 288 deletions(-) diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.c b/src/overlays/actors/ovl_Boss_05/z_boss_05.c index 9c3138340..3d9372552 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.c +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.c @@ -144,38 +144,38 @@ Vec3f D_809F1BF4 = { 0.0f, -1.0f, 0.0f }; // static DamageTable sDamageTable = { DamageTable D_809F1C00 = { - /* Deku Nut */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x1), // - /* Deku Stick */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(3, 0xF), // - /* Horse trample */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), - /* Explosives */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), - /* Zora boomerang */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), - /* Normal arrow */ DMG_ENTRY(3, 0xF), // DMG_ENTRY(1, 0xF), // - /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), - /* Hookshot */ DMG_ENTRY(3, 0x0), // DMG_ENTRY(0, 0x1), // - /* Goron punch */ DMG_ENTRY(2, 0xF), // DMG_ENTRY(1, 0xF), // - /* Sword */ DMG_ENTRY(1, 0xE), // DMG_ENTRY(1, 0xF), // - /* Goron pound */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), - /* Fire arrow */ DMG_ENTRY(1, 0x2), // DMG_ENTRY(2, 0x2), // - /* Ice arrow */ DMG_ENTRY(1, 0x3), // DMG_ENTRY(2, 0x3), // - /* Light arrow */ DMG_ENTRY(3, 0x4), // DMG_ENTRY(2, 0x4), // - /* Goron spikes */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), - /* Deku spin */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(0, 0x1), - /* Deku bubble */ DMG_ENTRY(3, 0xF), // DMG_ENTRY(1, 0xF), // - /* Deku launch */ DMG_ENTRY(2, 0xF), // DMG_ENTRY(2, 0xF), - /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x1), // - /* Zora barrier */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), - /* Normal shield */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), - /* Light ray */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), - /* Thrown object */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), - /* Zora punch */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), - /* Spin attack */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), - /* Sword beam */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), - /* Normal Roll */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(1, 0x2), // - /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), - /* Unblockable */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0), // DMG_ENTRY(0, 0x0), - /* Powder Keg */ DMG_ENTRY(1, 0xF), // DMG_ENTRY(1, 0xF), + /* Deku Nut */ DMG_ENTRY(0, 0x0), + /* Deku Stick */ DMG_ENTRY(1, 0xF), + /* Horse trample */ DMG_ENTRY(0, 0x0), + /* Explosives */ DMG_ENTRY(1, 0xF), + /* Zora boomerang */ DMG_ENTRY(1, 0xF), + /* Normal arrow */ DMG_ENTRY(3, 0xF), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(3, 0x0), + /* Goron punch */ DMG_ENTRY(2, 0xF), + /* Sword */ DMG_ENTRY(1, 0xE), + /* Goron pound */ DMG_ENTRY(1, 0xF), + /* Fire arrow */ DMG_ENTRY(1, 0x2), + /* Ice arrow */ DMG_ENTRY(1, 0x3), + /* Light arrow */ DMG_ENTRY(3, 0x4), + /* Goron spikes */ DMG_ENTRY(1, 0xF), + /* Deku spin */ DMG_ENTRY(1, 0xF), + /* Deku bubble */ DMG_ENTRY(3, 0xF), + /* Deku launch */ DMG_ENTRY(2, 0xF), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), + /* Zora barrier */ DMG_ENTRY(1, 0xF), + /* 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, 0xF), + /* Sword beam */ DMG_ENTRY(0, 0x0), + /* Normal Roll */ DMG_ENTRY(0, 0x0), + /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0), + /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0), + /* Powder Keg */ DMG_ENTRY(1, 0xF), }; // static DamageTable sDamageTable = { @@ -240,19 +240,20 @@ extern AnimationHeader D_06007488; extern AnimationHeader D_06007908; void func_809EE4E0(Boss05* this, PlayState* play) { - Vec3f sp8C; - Vec3f sp80; + Vec3f icePos; + Vec3f iceVelocity; s32 i; - SoundSource_PlaySfxAtFixedWorldPos(play, &this->unk18C, 30, NA_SE_EV_ICE_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(play, &this->limbPos[0], 30, NA_SE_EV_ICE_BROKEN); for (i = 0; i < 8; i++) { - sp80.x = randPlusMinusPoint5Scaled(7.0f); - sp80.z = randPlusMinusPoint5Scaled(7.0f); - sp80.y = Rand_ZeroFloat(6.0f) + 4.0f; - sp8C.x = this->unk18C.x + sp80.x; - sp8C.y = this->unk18C.y + sp80.y; - sp8C.z = this->unk18C.z + sp80.z; - EffectSsEnIce_Spawn(play, &sp8C, Rand_ZeroFloat(0.5f) + 0.7f, &sp80, &D_809F1BF4, &D_809F1BEC, &D_809F1BF0, 30); + iceVelocity.x = randPlusMinusPoint5Scaled(7.0f); + iceVelocity.z = randPlusMinusPoint5Scaled(7.0f); + iceVelocity.y = Rand_ZeroFloat(6.0f) + 4.0f; + icePos.x = this->limbPos[0].x + iceVelocity.x; + icePos.y = this->limbPos[0].y + iceVelocity.y; + icePos.z = this->limbPos[0].z + iceVelocity.z; + EffectSsEnIce_Spawn(play, &icePos, Rand_ZeroFloat(0.5f) + 0.7f, &iceVelocity, &D_809F1BF4, &D_809F1BEC, + &D_809F1BF0, 30); } } @@ -279,7 +280,7 @@ void Boss05_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->dyna.actor, 0.01f); - if ((this->dyna.actor.params == 0) || (this->dyna.actor.params == 1)) { + if ((this->dyna.actor.params == BIO_DEKU_BABA_TYPE_0) || (this->dyna.actor.params == BIO_DEKU_BABA_TYPE_1)) { if (this->dyna.actor.world.rot.z == 0) { this->dyna.actor.world.rot.z = 0; } @@ -294,62 +295,69 @@ void Boss05_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); func_809EEDD0(this, play); - SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 10); - SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 20); - this->unk4FC = Animation_GetLastFrame(&D_06006484); + SkelAnime_InitFlex(play, &this->skelAnime10, &D_060024E0, &D_06000ABC, this->jointTable10, this->morphTable10, + 10); + SkelAnime_InitFlex(play, &this->skelAnime20, &D_06006378, &D_06006484, this->jointTable20, this->morphTable20, + 20); + this->lastAnimFrame = Animation_GetLastFrame(&D_06006484); - Collider_InitAndSetJntSph(play, &this->unk1C8, &this->dyna.actor, &D_809F1B74, this->unk1E8); - Collider_InitAndSetJntSph(play, &this->unk368, &this->dyna.actor, &D_809F1BA8, this->unk388); + Collider_InitAndSetJntSph(play, &this->collider2, &this->dyna.actor, &D_809F1B74, this->colliderElements2); + Collider_InitAndSetJntSph(play, &this->collider1, &this->dyna.actor, &D_809F1BA8, this->colliderElements1); if (Flags_GetClear(play, play->roomCtx.currRoom.num)) { - this->dyna.actor.params = 2; + this->dyna.actor.params = BIO_DEKU_BABA_TYPE_2; this->actionFunc = func_809EF9BC; this->dyna.actor.flags &= ~ACTOR_FLAG_1; func_800BC154(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_BG); } - } else if (this->dyna.actor.params == 2) { + } else if (this->dyna.actor.params == BIO_DEKU_BABA_TYPE_2) { this->actionFunc = func_809EF9BC; CollisionHeader_GetVirtual(&sBioBabaLilypadCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 10); + SkelAnime_InitFlex(play, &this->skelAnime10, &D_060024E0, &D_06000ABC, this->jointTable10, this->morphTable10, + 10); this->dyna.actor.flags &= ~ACTOR_FLAG_1; func_800BC154(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_BG); - } else if (this->dyna.actor.params == 3) { + } else if (this->dyna.actor.params == BIO_DEKU_BABA_TYPE_3) { this->actionFunc = func_809EFAB4; this->unk198 = 1.0f; - SkelAnime_InitFlex(play, &this->unk268, &D_060024E0, &D_06000ABC, this->unk2AC, this->unk2E8, 10); - SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 20); - this->unk4FC = Animation_GetLastFrame(&D_06006484); + SkelAnime_InitFlex(play, &this->skelAnime10, &D_060024E0, &D_06000ABC, this->jointTable10, this->morphTable10, + 10); + SkelAnime_InitFlex(play, &this->skelAnime20, &D_06006378, &D_06006484, this->jointTable20, this->morphTable20, + 20); + this->lastAnimFrame = Animation_GetLastFrame(&D_06006484); - Collider_InitAndSetJntSph(play, &this->unk1C8, &this->dyna.actor, &D_809F1B74, this->unk1E8); - Collider_InitAndSetJntSph(play, &this->unk368, &this->dyna.actor, &D_809F1BA8, this->unk388); + Collider_InitAndSetJntSph(play, &this->collider2, &this->dyna.actor, &D_809F1B74, this->colliderElements2); + Collider_InitAndSetJntSph(play, &this->collider1, &this->dyna.actor, &D_809F1BA8, this->colliderElements1); ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->dyna.actor.colChkInfo.damageTable = &D_809F1C00; - } else if (this->dyna.actor.params == 4) { + } else if (this->dyna.actor.params == BIO_DEKU_BABA_TYPE_4) { func_809F00CC(this, play); this->dyna.actor.colChkInfo.mass = 90; - SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 20); + SkelAnime_InitFlex(play, &this->skelAnime20, &D_06006378, &D_06006484, this->jointTable20, this->morphTable20, + 20); - Collider_InitAndSetJntSph(play, &this->unk368, &this->dyna.actor, &D_809F1BDC, this->unk388); + Collider_InitAndSetJntSph(play, &this->collider1, &this->dyna.actor, &D_809F1BDC, this->colliderElements1); ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->dyna.actor.colChkInfo.damageTable = &D_809F1C20; this->dyna.actor.flags |= ACTOR_FLAG_10 | ACTOR_FLAG_20; - } else if (this->dyna.actor.params >= 10) { - SkelAnime_InitFlex(play, &this->unk3C8, &D_06006378, &D_06006484, this->unk40C, this->unk484, 20); + } else if (this->dyna.actor.params >= BIO_DEKU_BABA_TYPE_10) { + SkelAnime_InitFlex(play, &this->skelAnime20, &D_06006378, &D_06006484, this->jointTable20, this->morphTable20, + 20); this->dyna.actor.gravity = 0.0f; this->dyna.actor.world.rot.y = (s32)Rand_ZeroFloat(0x8000); this->dyna.actor.speedXZ = Rand_ZeroFloat(3.0f) + 3.0f; this->dyna.actor.velocity.y = Rand_ZeroFloat(1.5f) + 1.5f; - this->unk500 = (s32)randPlusMinusPoint5Scaled(700.0f); - this->unk502 = (s32)randPlusMinusPoint5Scaled(1500.0f); + this->unk500.x = (s32)randPlusMinusPoint5Scaled(700.0f); + this->unk500.y = (s32)randPlusMinusPoint5Scaled(1500.0f); this->unk162[0] = (s32)(Rand_ZeroFloat(30.0f) + 50.0f); this->dyna.actor.flags &= ~ACTOR_FLAG_1; @@ -360,7 +368,8 @@ void Boss05_Init(Actor* thisx, PlayState* play) { void Boss05_Destroy(Actor* thisx, PlayState* play) { Boss05* this = THIS; - if ((this->dyna.actor.params == 2) || (this->dyna.actor.params == 0) || (this->dyna.actor.params == 1)) { + if ((this->dyna.actor.params == BIO_DEKU_BABA_TYPE_2) || (this->dyna.actor.params == BIO_DEKU_BABA_TYPE_0) || + (this->dyna.actor.params == BIO_DEKU_BABA_TYPE_1)) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } } @@ -370,7 +379,7 @@ s32 func_809EECBC(Boss05* this, PlayState* play) { s32 i = 0; while (true) { - if (this->unk1C8.elements[i].info.bumperFlags & 2) { + if (this->collider2.elements[i].info.bumperFlags & BUMP_HIT) { switch (this->dyna.actor.colChkInfo.damageEffect) { case 2: return 11; @@ -385,7 +394,7 @@ s32 func_809EECBC(Boss05* this, PlayState* play) { i++; if (i == 2) { - if (this->unk368.elements[0].info.bumperFlags & 2) { + if (this->collider1.elements[0].info.bumperFlags & BUMP_HIT) { u8 damage = this->dyna.actor.colChkInfo.damage; this->dyna.actor.colChkInfo.health -= damage; if ((s8)this->dyna.actor.colChkInfo.health <= 0) { @@ -541,17 +550,17 @@ void func_809EEDE8(Boss05* this, PlayState* play) { Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, var_s4, var_s5); } - SkelAnime_Update(&this->unk3C8); + SkelAnime_Update(&this->skelAnime20); Math_ApproachF(&this->unk35C, 1.0f, 0.1f, 0.1f); if (this->unk15C != 10) { Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 0x14, 0x800); } - switch (this->unk15C) { /* irregular */ + switch (this->unk15C) { case 0: this->unk174 = 0; - this->unk3C8.playSpeed = 1.0f; + this->skelAnime20.playSpeed = 1.0f; if (spA4 < 0.0f) { if (sp108->actor.speedXZ > 10.0f) { var_fv1 = 220.0f; @@ -588,7 +597,7 @@ void func_809EEDE8(Boss05* this, PlayState* play) { } this->unk19C = (this->unk162[0] & 1) * 0x200; this->unk174 = 3; - this->unk3C8.playSpeed = 4.0f; + this->skelAnime20.playSpeed = 4.0f; Math_ApproachS(&this->dyna.actor.shape.rot.x, -0x8000, 2, 0x2000); Math_ApproachS(&this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer, 2, 0x2000); if (this->unk162[0] == 0) { @@ -605,8 +614,8 @@ void func_809EEDE8(Boss05* this, PlayState* play) { break; case 1: - if (Animation_OnFrame(&this->unk3C8, this->unk4FC)) { - this->unk3C8.playSpeed = 0.0f; + if (Animation_OnFrame(&this->skelAnime20, this->lastAnimFrame)) { + this->skelAnime20.playSpeed = 0.0f; } this->unk174 = 1; if (this->unk162[0] == 0) { @@ -621,7 +630,7 @@ void func_809EEDE8(Boss05* this, PlayState* play) { Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA1_MOUTH); } this->unk19C = (this->unk162[0] & 1) * 0x200; - this->unk3C8.playSpeed = 4.0f; + this->skelAnime20.playSpeed = 4.0f; Math_ApproachF(&this->unk35C, 1.5f, 1.0f, 0.7f); this->unk174 = 2; if (this->unk162[0] == 0) { @@ -635,18 +644,18 @@ void func_809EEDE8(Boss05* this, PlayState* play) { if ((var_s4_2 != 0) || (this->unk168 == 1)) { Boss05* temp_v0_6; - this->dyna.actor.params = 2; + this->dyna.actor.params = BIO_DEKU_BABA_TYPE_2; this->actionFunc = func_809EF9BC; - this->dyna.actor.flags &= ~1; - func_800BC154(play, &play->actorCtx, &this->dyna.actor, 1); + this->dyna.actor.flags &= ~ACTOR_FLAG_1; + func_800BC154(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_BG); if (this->unk168 != 0) { var_s4_2 = 10; } if (var_s4_2 >= 10) { - temp_v0_6 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_BOSS_05, - this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, - this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, - this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 3); + temp_v0_6 = (Boss05*)Actor_SpawnAsChild( + &play->actorCtx, &this->dyna.actor, play, ACTOR_BOSS_05, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, + this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, BIO_DEKU_BABA_TYPE_3); if (temp_v0_6 != NULL) { Player* temp_v1 = GET_PLAYER(play); if (temp_v1->unk_730 == &this->dyna.actor) { @@ -656,27 +665,27 @@ void func_809EEDE8(Boss05* this, PlayState* play) { } for (i = 0; i < 10; i++) { - temp_v0_6->unk268.jointTable[i] = this->unk268.jointTable[i]; + temp_v0_6->skelAnime10.jointTable[i] = this->skelAnime10.jointTable[i]; } for (i = 0; i < 20; i++) { - temp_v0_6->unk3C8.jointTable[i] = this->unk3C8.jointTable[i]; + temp_v0_6->skelAnime20.jointTable[i] = this->skelAnime20.jointTable[i]; } Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA1_DAMAGE); if (var_s4_2 > 10) { - temp_v0_6->unk188 = var_s4_2 - 10; + temp_v0_6->drawDmgEffState = var_s4_2 - 10; } } } else if (var_s4_2 == 2) { for (i = 0; i < 2; i++) { temp_v0_6 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_BOSS_05, this->unk324.x, this->unk324.y, this->unk324.z, this->unk330.x, - this->unk330.y, this->unk330.z, i + 10); + this->unk330.y, this->unk330.z, i + BIO_DEKU_BABA_TYPE_10); if (temp_v0_6 != NULL) { for (j = 0; j < 20; j++) { - temp_v0_6->unk3C8.jointTable[j] = this->unk3C8.jointTable[j]; + temp_v0_6->skelAnime20.jointTable[j] = this->skelAnime20.jointTable[j]; } temp_v0_6->unk162[0] = (s32)(Rand_ZeroFloat(20.0f) + 20.0f); @@ -687,29 +696,29 @@ void func_809EEDE8(Boss05* this, PlayState* play) { } if (sp103 == 0) { - CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk1C8.base); - CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk368.base); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider2.base); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider1.base); } - CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk1C8.base); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk368.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider2.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider1.base); } void func_809EF9BC(Boss05* this, PlayState* play) { Player* player = GET_PLAYER(play); - f32 temp_fv0 = sqrtf(this->dyna.actor.xyzDistToPlayerSq); + f32 distToPlayer = sqrtf(this->dyna.actor.xyzDistToPlayerSq); s16 var_a1; - if ((temp_fv0 < 50.0f) && (player->actor.bgCheckFlags & 1)) { - var_a1 = (s32)(temp_fv0 * 80.0f); + if ((distToPlayer < 50.0f) && (player->actor.bgCheckFlags & 1)) { + var_a1 = (s32)(distToPlayer * 80.0f); var_a1 = CLAMP_MAX(var_a1, 0x7D0); // if (var_a1 > 0x7D0) { // var_a1 = 0x7D0; // } Math_ApproachS(&this->unk178, var_a1, 0x14, 0x7D0); Math_ApproachS(&this->unk176, this->dyna.actor.yawTowardsPlayer, 0x14, 0xFA0); - if (!(this->unk160 & 0xF)) { - EffectSsGRipple_Spawn(play, &this->dyna.actor.world.pos, 0x1F4, 0x3E8, 0); + if ((this->unk160 % 16) == 0) { + EffectSsGRipple_Spawn(play, &this->dyna.actor.world.pos, 500, 1000, 0); } } else { Math_ApproachS(&this->unk178, 0, 0x14, 0x100); @@ -718,8 +727,8 @@ void func_809EF9BC(Boss05* this, PlayState* play) { void func_809EFAB4(Boss05* this, PlayState* play) { s32 i; - Vec3f sp80; - Vec3f sp74; + Vec3f unusedPos; + Vec3f bubblePos; Boss05* temp_v0; Player* player; @@ -742,23 +751,23 @@ void func_809EFAB4(Boss05* this, PlayState* play) { this->dyna.actor.velocity.y = -3.0f; this->dyna.actor.gravity = -0.3f; this->dyna.actor.terminalVelocity = -5.0f; - Math_Vec3f_Copy(&sp80, &this->dyna.actor.world.pos); - sp80.y += 20.0f; + Math_Vec3f_Copy(&unusedPos, &this->dyna.actor.world.pos); + unusedPos.y += 20.0f; EffectSsGSplash_Spawn(play, &this->dyna.actor.world.pos, NULL, NULL, 1, 1000); this->unk162[2] = 20; } if (this->unk162[2] != 0) { for (i = 0; i < 3; i++) { - sp74.x = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.x; - sp74.y = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.y; - sp74.z = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.z; - EffectSsBubble_Spawn(play, &sp74, 20.0f, 10.0f, 20.0f, 0.13f); + bubblePos.x = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.x; + bubblePos.y = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.y; + bubblePos.z = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.z; + EffectSsBubble_Spawn(play, &bubblePos, 20.0f, 10.0f, 20.0f, 0.13f); } } if (this->dyna.actor.bgCheckFlags & 1) { - if ((this->unk189 == 0xA) && (this->unk17A != 0)) { + if ((this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) && (this->unk17A != 0)) { this->unk17A = 0; } @@ -767,7 +776,7 @@ void func_809EFAB4(Boss05* this, PlayState* play) { if (this->unk198 == 0.0f) { temp_v0 = (Boss05*)Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_BOSS_05, this->unk324.x, this->unk324.y, this->unk324.z, this->unk330.x, - this->unk330.y, this->unk330.z, 4); + this->unk330.y, this->unk330.z, BIO_DEKU_BABA_TYPE_4); if (temp_v0 != NULL) { player = GET_PLAYER(play); @@ -778,7 +787,7 @@ void func_809EFAB4(Boss05* this, PlayState* play) { } for (i = 0; i < 20; i++) { - temp_v0->unk3C8.jointTable[i] = this->unk3C8.jointTable[i]; + temp_v0->skelAnime20.jointTable[i] = this->skelAnime20.jointTable[i]; } Actor_PlaySfxAtPos(&temp_v0->dyna.actor, NA_SE_EN_MIZUBABA_TRANSFORM); @@ -791,20 +800,20 @@ void func_809EFAB4(Boss05* this, PlayState* play) { void func_809EFE50(Actor* thisx, PlayState* play2) { PlayState* play = play2; Boss05* this = THIS; - u8 var_a2 = 0; - ColliderInfo* temp; + u8 takeDamage = false; + ColliderInfo* hitInfo; - if ((this->unk16A == 0) && (this->unk368.elements[0].info.bumperFlags & BUMP_HIT)) { - this->unk368.elements[0].info.bumperFlags &= ~BUMP_HIT; - temp = this->unk368.elements[0].info.acHitInfo; - if (temp->toucher.dmgFlags & 0x300000) { // (DMG_NORMAL_SHIELD | DMG_LIGHT_RAY) + if ((this->unk16A == 0) && (this->collider1.elements[0].info.bumperFlags & BUMP_HIT)) { + this->collider1.elements[0].info.bumperFlags &= ~BUMP_HIT; + hitInfo = this->collider1.elements[0].info.acHitInfo; + if (hitInfo->toucher.dmgFlags & 0x300000) { // (DMG_NORMAL_SHIELD | DMG_LIGHT_RAY) this->unk338 = -12.0f; this->unk348 = this->dyna.actor.yawTowardsPlayer; this->unk16A = 6; return; } - this->unk16A = 0xA; + this->unk16A = 10; this->dyna.actor.speedXZ = 0.0f; this->unk338 = -20.0f; this->unk348 = this->dyna.actor.yawTowardsPlayer; @@ -817,31 +826,32 @@ void func_809EFE50(Actor* thisx, PlayState* play2) { break; case 2: - this->unk188 = 1; - var_a2 = 1; + this->drawDmgEffState = 1; + takeDamage = true; break; case 3: func_809F0A64(this, play); - this->unk188 = 0xA; + this->drawDmgEffState = 10; break; case 4: - this->unk188 = 0x14; - var_a2 = 1; + this->drawDmgEffState = 20; + takeDamage = true; break; default: - var_a2 = 1; + takeDamage = true; break; } - if (var_a2 != 0) { + if (takeDamage) { u8 damage; // Probably fake? - if ((this->actionFunc == func_809F0ABC) && (this->unk189 == 0xA) && (this->unk17A != 0)) { + if ((this->actionFunc == func_809F0ABC) && (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) && + (this->unk17A != 0)) { func_809EE4E0(this, play); - this->unk188 = 0; + this->drawDmgEffState = 0; } damage = this->dyna.actor.colChkInfo.damage; @@ -849,16 +859,17 @@ void func_809EFE50(Actor* thisx, PlayState* play2) { if ((s8)this->dyna.actor.colChkInfo.health <= 0) { Enemy_StartFinishingBlow(play, &this->dyna.actor); } + func_809F0708(this, play); - this->unk16C = 0xF; + this->unk16C = 15; } } } s32 func_809F0014(Boss05* this, PlayState* play) { - s16 var_v1 = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y; + s16 yawDiff = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y; - if (ABS_ALT(var_v1) < 0x3000) { + if (ABS_ALT(yawDiff) < 0x3000) { return true; } else { return false; @@ -874,15 +885,16 @@ void func_809F0058(Boss05* this, PlayState* play) { void func_809F00CC(Boss05* this, PlayState* play) { this->actionFunc = func_809F010C; - Animation_MorphToPlayOnce(&this->unk3C8, &D_06006E50, -5.0f); + Animation_MorphToPlayOnce(&this->skelAnime20, &D_06006E50, -5.0f); } void func_809F010C(Boss05* this, PlayState* play) { - SkelAnime_Update(&this->unk3C8); + SkelAnime_Update(&this->skelAnime20); Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 2, 0x400); Math_ApproachS(&this->dyna.actor.shape.rot.z, 0, 2, 0x400); Math_ApproachF(&this->unk360, 1.0f, 1.0f, 0.5f); Math_ApproachF(&this->unk364, 1.0f, 1.0f, 0.14f); + if (this->unk364 == 1.0f) { func_809F01CC(this, play); } @@ -890,13 +902,13 @@ void func_809F010C(Boss05* this, PlayState* play) { void func_809F01CC(Boss05* this, PlayState* play) { this->actionFunc = func_809F0244; - Animation_MorphToLoop(&this->unk3C8, &D_06007488, -10.0f); + Animation_MorphToLoop(&this->skelAnime20, &D_06007488, -10.0f); this->unk162[0] = (s32)(Rand_ZeroFloat(25.0f) + 25.0f); Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA1_MOUTH); } void func_809F0244(Boss05* this, PlayState* play) { - SkelAnime_Update(&this->unk3C8); + SkelAnime_Update(&this->skelAnime20); Math_ApproachZeroF(&this->dyna.actor.speedXZ, 1.0f, 2.5f); Math_ApproachS(&this->dyna.actor.shape.rot.x, 0, 2, 0x400); Math_ApproachS(&this->dyna.actor.shape.rot.z, 0, 2, 0x400); @@ -910,26 +922,26 @@ void func_809F0244(Boss05* this, PlayState* play) { void func_809F02D0(Boss05* this, PlayState* play) { this->actionFunc = func_809F0374; - Animation_MorphToLoop(&this->unk3C8, &D_06007908, 0.0f); + Animation_MorphToLoop(&this->skelAnime20, &D_06007908, 0.0f); this->unk162[0] = (s32)(Rand_ZeroFloat(80.0f) + 60.0f); - this->unk34C = randPlusMinusPoint5Scaled(400.0f) + this->dyna.actor.world.pos.x; - this->unk354 = randPlusMinusPoint5Scaled(400.0f) + this->dyna.actor.world.pos.z; + this->unk34C.x = randPlusMinusPoint5Scaled(400.0f) + this->dyna.actor.world.pos.x; + this->unk34C.z = randPlusMinusPoint5Scaled(400.0f) + this->dyna.actor.world.pos.z; this->unk358 = 0.0f; } void func_809F0374(Boss05* this, PlayState* play) { - f32 sp24; - f32 sp20; + f32 deltaX; + f32 deltaZ; Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_WALK - SFX_FLAG); - SkelAnime_Update(&this->unk3C8); + SkelAnime_Update(&this->skelAnime20); Math_ApproachF(&this->dyna.actor.speedXZ, 5.0f, 1.0f, 2.0f); - sp24 = this->unk34C - this->dyna.actor.world.pos.x; - sp20 = this->unk354 - this->dyna.actor.world.pos.z; - Math_ApproachS(&this->dyna.actor.world.rot.y, Math_Atan2S(sp24, sp20), 5, (s32)this->unk358); + deltaX = this->unk34C.x - this->dyna.actor.world.pos.x; + deltaZ = this->unk34C.z - this->dyna.actor.world.pos.z; + Math_ApproachS(&this->dyna.actor.world.rot.y, Math_Atan2S(deltaX, deltaZ), 5, (s32)this->unk358); Math_ApproachF(&this->unk358, 2000.0f, 1.0f, 100.0f); - if ((this->unk162[0] == 0) || ((SQ(sp24) + SQ(sp20)) < 2500.0f)) { + if ((this->unk162[0] == 0) || ((SQ(deltaX) + SQ(deltaZ)) < 2500.0f)) { func_809F01CC(this, play); } @@ -938,12 +950,12 @@ void func_809F0374(Boss05* this, PlayState* play) { void func_809F0474(Boss05* this, PlayState* play) { this->actionFunc = func_809F04C0; - Animation_MorphToPlayOnce(&this->unk3C8, &D_06003448, 0.0f); + Animation_MorphToPlayOnce(&this->skelAnime20, &D_06003448, 0.0f); this->unk162[0] = 20; } void func_809F04C0(Boss05* this, PlayState* play) { - SkelAnime_Update(&this->unk3C8); + SkelAnime_Update(&this->skelAnime20); Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_VOICE - SFX_FLAG); Math_ApproachZeroF(&this->dyna.actor.speedXZ, 1.0f, 2.5f); Math_ApproachS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 5, 0x1000); @@ -954,78 +966,78 @@ void func_809F04C0(Boss05* this, PlayState* play) { void func_809F0538(Boss05* this, PlayState* arg1) { this->actionFunc = func_809F0590; - Animation_MorphToLoop(&this->unk3C8, &D_06000A5C, 0.0f); + Animation_MorphToLoop(&this->skelAnime20, &D_06000A5C, 0.0f); this->unk162[0] = 60; this->unk358 = 0.0f; } void func_809F0590(Boss05* this, PlayState* play) { Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_VOICE - SFX_FLAG); - SkelAnime_Update(&this->unk3C8); + SkelAnime_Update(&this->skelAnime20); Math_ApproachF(&this->dyna.actor.speedXZ, 8.0f, 1.0f, 4.0f); Math_ApproachS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 5, (s32)this->unk358); Math_ApproachF(&this->unk358, 4000.0f, 1.0f, 400.0f); - if ((this->unk162[0] == 0) || (this->dyna.actor.xyzDistToPlayerSq <= 22500.0f)) { + + if ((this->unk162[0] == 0) || (this->dyna.actor.xyzDistToPlayerSq <= SQ(150.0f))) { func_809F0650(this, play); } } void func_809F0650(Boss05* this, PlayState* arg1) { this->actionFunc = func_809F06B8; - Animation_MorphToPlayOnce(&this->unk3C8, &D_060006A4, 0.0f); - this->unk4FC = Animation_GetLastFrame(&D_060006A4); + Animation_MorphToPlayOnce(&this->skelAnime20, &D_060006A4, 0.0f); + this->lastAnimFrame = Animation_GetLastFrame(&D_060006A4); Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_MIZUBABA2_ATTACK); } void func_809F06B8(Boss05* this, PlayState* play) { - SkelAnime_Update(&this->unk3C8); - if (Animation_OnFrame(&this->unk3C8, this->unk4FC)) { + SkelAnime_Update(&this->skelAnime20); + if (Animation_OnFrame(&this->skelAnime20, this->lastAnimFrame)) { func_809F01CC(this, play); } } void func_809F0708(Boss05* this, PlayState* play) { this->actionFunc = func_809F0780; - Animation_MorphToPlayOnce(&this->unk3C8, &D_06002F0C, 0.0f); - this->unk4FC = Animation_GetLastFrame(&D_060006A4); - Actor_SetColorFilter(&this->dyna.actor, 0x4000U, 120, 0, 30); + Animation_MorphToPlayOnce(&this->skelAnime20, &D_06002F0C, 0.0f); + this->lastAnimFrame = Animation_GetLastFrame(&D_060006A4); + Actor_SetColorFilter(&this->dyna.actor, 0x4000, 120, 0, 30); } -// #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_05/func_809F0780.s") void func_809F0780(Boss05* this, PlayState* play) { s32 i; s32 j; - Vec3f sp7C; + Vec3f bubblePos; Boss05* temp_v0; - SkelAnime_Update(&this->unk3C8); + SkelAnime_Update(&this->skelAnime20); if ((s8)this->dyna.actor.colChkInfo.health <= 0) { - if (Animation_OnFrame(&this->unk3C8, 22.0f)) { + if (Animation_OnFrame(&this->skelAnime20, 22.0f)) { for (i = 0; i < 14; i++) { temp_v0 = (Boss05*)Actor_SpawnAsChild( &play->actorCtx, &this->dyna.actor, play, ACTOR_BOSS_05, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, - this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, i + 10); + this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, i + BIO_DEKU_BABA_TYPE_10); if (temp_v0 != NULL) { for (j = 0; j < 20; j++) { - temp_v0->unk3C8.jointTable[j] = this->unk3C8.jointTable[j]; + temp_v0->skelAnime20.jointTable[j] = this->skelAnime20.jointTable[j]; } } } for (i = 0; i < 20; i++) { - sp7C.x = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.x; - sp7C.y = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.y; - sp7C.z = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.z; - EffectSsBubble_Spawn(play, &sp7C, 20.0f, 10.0f, 20.0f, 0.13f); + bubblePos.x = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.x; + bubblePos.y = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.y; + bubblePos.z = randPlusMinusPoint5Scaled(40.0f) + this->dyna.actor.world.pos.z; + EffectSsBubble_Spawn(play, &bubblePos, 20.0f, 10.0f, 20.0f, 0.13f); } SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EN_MIZUBABA_DEAD); Actor_MarkForDeath(&this->dyna.actor); Item_DropCollectibleRandom(play, NULL, &this->dyna.actor.world.pos, 0xE0); } - } else if (Animation_OnFrame(&this->unk3C8, this->unk4FC)) { + } else if (Animation_OnFrame(&this->skelAnime20, this->lastAnimFrame)) { func_809F0474(this, play); } } @@ -1066,8 +1078,8 @@ void func_809F0B0C(Boss05* this, PlayState* play) { if (this->unk15C == 1) { Math_ApproachF(&this->dyna.actor.velocity.y, 1.0f, 1.0f, 0.1f); Math_ApproachZeroF(&this->dyna.actor.speedXZ, 0.5f, 0.5f); - this->dyna.actor.shape.rot.x += this->unk500; - this->dyna.actor.shape.rot.y += this->unk502; + this->dyna.actor.shape.rot.x += this->unk500.x; + this->dyna.actor.shape.rot.y += this->unk500.y; if (this->unk162[0] == 0) { Actor_MarkForDeath(&this->dyna.actor); @@ -1126,7 +1138,7 @@ void Boss05_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if (this->dyna.actor.params == 4) { + if (this->dyna.actor.params == BIO_DEKU_BABA_TYPE_4) { Actor_MoveWithGravity(&this->dyna.actor); Matrix_RotateYS(this->unk348, MTXMODE_NEW); Matrix_MultVecZ(this->unk338, &this->unk33C); @@ -1135,73 +1147,73 @@ void Boss05_Update(Actor* thisx, PlayState* play) { Math_ApproachZeroF(&this->unk338, 1.0f, 1.0f); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 50.0f, 40.0f, 0x45); func_809EFE50(&this->dyna.actor, play); - CollisionCheck_SetAT(play, &play->colChkCtx, &this->unk368.base); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk368.base); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->unk368.base); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider1.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider1.base); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider1.base); this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y; } - switch (this->unk188) { + switch (this->drawDmgEffState) { case 0: - this->unk189 = 0; + this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE; this->unk17A = 0; - this->unk184 = 0.0f; + this->drawDmgEffAlpha = 0.0f; break; case 1: - this->unk189 = 0; + this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE; this->unk17A = 80; - this->unk184 = 1.0f; - this->unk188++; - this->unk17C = 0.0f; + this->drawDmgEffAlpha = 1.0f; + this->drawDmgEffState++; + this->drawDmgEffScale = 0.0f; // fallthrough case 2: if (this->unk17A == 0) { - Math_ApproachZeroF(&this->unk184, 1.0f, 0.02f); - if (this->unk184 == 0.0f) { - this->unk188 = 0; + Math_ApproachZeroF(&this->drawDmgEffAlpha, 1.0f, 0.02f); + if (this->drawDmgEffAlpha == 0.0f) { + this->drawDmgEffState = 0; } } else { - Math_ApproachF(&this->unk17C, 1.0f, 0.1f, 0.5f); + Math_ApproachF(&this->drawDmgEffScale, 1.0f, 0.1f, 0.5f); } break; case 10: - this->unk189 = 0xA; + this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX; this->unk17A = 80; - this->unk184 = 1.0f; - this->unk188++; - this->unk17C = 0.0f; - this->unk180 = 2.0f; + this->drawDmgEffAlpha = 1.0f; + this->drawDmgEffState++; + this->drawDmgEffScale = 0.0f; + this->dmgEffFrozenSteamScale = 2.0f; // fallthrough case 11: if (this->unk17A == 0) { func_809EE4E0(this, play); - this->unk188 = 0; + this->drawDmgEffState = 0; } else { - Math_ApproachF(&this->unk17C, 1.0f, 1.0f, 0.25f); - Math_ApproachF(&this->unk180, 1.0f, 0.1f, 0.1f); + Math_ApproachF(&this->drawDmgEffScale, 1.0f, 1.0f, 0.25f); + Math_ApproachF(&this->dmgEffFrozenSteamScale, 1.0f, 0.1f, 0.1f); } break; case 20: - this->unk189 = 0x14; + this->drawDmgEffType = ACTOR_DRAW_DMGEFF_LIGHT_ORBS; this->unk17A = 80; - this->unk184 = 1.0f; - this->unk188++; - this->unk17C = 0.0f; + this->drawDmgEffAlpha = 1.0f; + this->drawDmgEffState++; + this->drawDmgEffScale = 0.0f; break; case 21: if (this->unk17A == 0) { - Math_ApproachZeroF(&this->unk17C, 1.0f, 0.03f); + Math_ApproachZeroF(&this->drawDmgEffScale, 1.0f, 0.03f); - if (this->unk17C == 0.0f) { - this->unk188 = 0; - this->unk184 = 0.0f; + if (this->drawDmgEffScale == 0.0f) { + this->drawDmgEffState = 0; + this->drawDmgEffAlpha = 0.0f; } } else { - Math_ApproachF(&this->unk17C, 1.0f, 0.5f, 0.5f); + Math_ApproachF(&this->drawDmgEffScale, 1.0f, 0.5f, 0.5f); } break; } @@ -1217,12 +1229,13 @@ s32 func_809F1050(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s if (!(this->unk160 & 3)) { *dList = NULL; } + rot->x += KREG(33) * 0x100; rot->y += KREG(34) * 0x100; rot->z += KREG(35) * 0x100; } - if ((thisx->params == 1) && (limbIndex == 9)) { + if ((this->dyna.actor.params == BIO_DEKU_BABA_TYPE_1) && (limbIndex == 9)) { *dList = NULL; } @@ -1244,9 +1257,9 @@ Vec3f D_809F1CC4 = { 0.0f, -1400.0f, 600.0f }; void func_809F1170(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { Boss05* this = THIS; - MtxF sp3C; - Vec3f sp30; - Vec3f sp24; + MtxF mf; + Vec3f spherePos0; + Vec3f spherePos1; if (limbIndex == 4) { Matrix_MultVec3f(&D_809F1CC4, &this->unk324); @@ -1255,22 +1268,22 @@ void func_809F1170(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto Matrix_MultVec3f(&D_809F1CC4, &this->dyna.actor.focus.pos); } - Matrix_Get(&sp3C); - Matrix_MtxFToYXZRot(&sp3C, &this->unk330, false); + Matrix_Get(&mf); + Matrix_MtxFToYXZRot(&mf, &this->unk330, false); this->unk330.x += 0xF00; } if (limbIndex == 2) { - Matrix_MultZero(&sp30); - func_809EE668(0, &this->unk1C8, &sp30); + Matrix_MultZero(&spherePos0); + func_809EE668(0, &this->collider2, &spherePos0); } if (limbIndex == 3) { - Matrix_MultVecY(-500.0f, &sp24); - func_809EE668(1, &this->unk1C8, &sp24); + Matrix_MultVecY(-500.0f, &spherePos1); + func_809EE668(1, &this->collider2, &spherePos1); if (this->actionFunc == func_809EEDE8) { - Matrix_MultVecY(1500.0f, &thisx->focus.pos); + Matrix_MultVecY(1500.0f, &this->dyna.actor.focus.pos); } } } @@ -1289,14 +1302,16 @@ void func_809F12A0(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto if (limbIndex == 1) { Matrix_MultVec3f(&D_809F1CD0, &D_809F2110); - func_809EE668(0, &this->unk368, &D_809F2110); - if (thisx->params == 4) { + func_809EE668(0, &this->collider1, &D_809F2110); + + if (this->dyna.actor.params == BIO_DEKU_BABA_TYPE_4) { Matrix_MultVec3f(&D_809F1CDC, &thisx->focus.pos); } - if (this->unk188 != 0) { - Matrix_MultVec3f(&D_809F1CDC, &this->unk18C); - if (this->unk189 == 0) { - this->unk18C.y -= 15.0f; + + if (this->drawDmgEffState != 0) { + Matrix_MultVec3f(&D_809F1CDC, &this->limbPos[0]); + if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FIRE) { + this->limbPos[0].y -= 15.0f; } } } @@ -1347,7 +1362,7 @@ s32 D_809F1CE8[] = { 2, 3, 1, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19 }; s32 func_809F14AC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { Boss05* this = THIS; - if (limbIndex != D_809F1CE8[thisx->params - 10]) { + if (limbIndex != D_809F1CE8[this->dyna.actor.params - BIO_DEKU_BABA_TYPE_10]) { *dList = NULL; } else if (this->unk15C >= 2) { rot->x += this->unk160 * 0x3000; @@ -1360,7 +1375,7 @@ s32 func_809F14AC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s void func_809F1550(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { Boss05* this = THIS; - if (limbIndex != D_809F1CE8[thisx->params - 10]) { + if (limbIndex != D_809F1CE8[this->dyna.actor.params - BIO_DEKU_BABA_TYPE_10]) { Matrix_MultZero(&this->unk324); } } @@ -1374,10 +1389,10 @@ void Boss05_Draw(Actor* thisx, PlayState* play) { func_8012C28C(play->state.gfxCtx); if (this->actionFunc == func_809EEDE8) { - SkelAnime_DrawFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, this->unk268.dListCount, - func_809F1050, func_809F1170, &this->dyna.actor); + SkelAnime_DrawFlexOpa(play, this->skelAnime10.skeleton, this->skelAnime10.jointTable, + this->skelAnime10.dListCount, func_809F1050, func_809F1170, &this->dyna.actor); - if (this->unk16C & 1) { + if ((this->unk16C % 2) != 0) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); } @@ -1389,9 +1404,10 @@ void Boss05_Draw(Actor* thisx, PlayState* play) { AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); - SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, this->unk3C8.dListCount, - func_809F1284, func_809F12A0, func_809F135C, &this->dyna.actor); - } else if (this->dyna.actor.params == 2) { + SkelAnime_DrawTransformFlexOpa(play, this->skelAnime20.skeleton, this->skelAnime20.jointTable, + this->skelAnime20.dListCount, func_809F1284, func_809F12A0, func_809F135C, + &this->dyna.actor); + } else if (this->dyna.actor.params == BIO_DEKU_BABA_TYPE_2) { Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, MTXMODE_NEW); Matrix_RotateYS(this->unk176, MTXMODE_APPLY); @@ -1402,11 +1418,12 @@ void Boss05_Draw(Actor* thisx, PlayState* play) { Matrix_RotateZS(this->dyna.actor.shape.rot.z, MTXMODE_APPLY); Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY); - SkelAnime_DrawFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, this->unk268.dListCount, - func_809F1404, NULL, &this->dyna.actor); - } else if (this->dyna.actor.params == 3) { - SkelAnime_DrawTransformFlexOpa(play, this->unk268.skeleton, this->unk268.jointTable, this->unk268.dListCount, - func_809F1430, func_809F1170, func_809F1464, &this->dyna.actor); + SkelAnime_DrawFlexOpa(play, this->skelAnime10.skeleton, this->skelAnime10.jointTable, + this->skelAnime10.dListCount, func_809F1404, NULL, &this->dyna.actor); + } else if (this->dyna.actor.params == BIO_DEKU_BABA_TYPE_3) { + SkelAnime_DrawTransformFlexOpa(play, this->skelAnime10.skeleton, this->skelAnime10.jointTable, + this->skelAnime10.dListCount, func_809F1430, func_809F1170, func_809F1464, + &this->dyna.actor); Matrix_Translate(this->unk324.x, this->unk324.y, this->unk324.z, MTXMODE_NEW); Matrix_RotateYS(this->unk330.y, MTXMODE_APPLY); @@ -1416,28 +1433,32 @@ void Boss05_Draw(Actor* thisx, PlayState* play) { AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); - SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, this->unk3C8.dListCount, - func_809F1284, func_809F12A0, func_809F135C, &this->dyna.actor); + SkelAnime_DrawTransformFlexOpa(play, this->skelAnime20.skeleton, this->skelAnime20.jointTable, + this->skelAnime20.dListCount, func_809F1284, func_809F12A0, func_809F135C, + &this->dyna.actor); - Actor_DrawDamageEffects(play, &this->dyna.actor, &this->unk18C, 1, this->unk17C, this->unk180, this->unk184, - this->unk189); - } else if (this->dyna.actor.params == 4) { + Actor_DrawDamageEffects(play, &this->dyna.actor, this->limbPos, ARRAY_COUNT(this->limbPos), + this->drawDmgEffScale, this->dmgEffFrozenSteamScale, this->drawDmgEffAlpha, + this->drawDmgEffType); + } else if (this->dyna.actor.params == BIO_DEKU_BABA_TYPE_4) { AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); - if (this->unk16C & 1) { + if ((this->unk16C % 2) != 0) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); } - SkelAnime_DrawTransformFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, this->unk3C8.dListCount, - func_809F1284, func_809F12A0, func_809F135C, &this->dyna.actor); + SkelAnime_DrawTransformFlexOpa(play, this->skelAnime20.skeleton, this->skelAnime20.jointTable, + this->skelAnime20.dListCount, func_809F1284, func_809F12A0, func_809F135C, + &this->dyna.actor); - Actor_DrawDamageEffects(play, &this->dyna.actor, &this->unk18C, 1, this->unk17C, this->unk180, this->unk184, - this->unk189); - } else if (this->dyna.actor.params >= 10) { + Actor_DrawDamageEffects(play, &this->dyna.actor, this->limbPos, ARRAY_COUNT(this->limbPos), + this->drawDmgEffScale, this->dmgEffFrozenSteamScale, this->drawDmgEffAlpha, + this->drawDmgEffType); + } else if (this->dyna.actor.params >= BIO_DEKU_BABA_TYPE_10) { AnimatedMat_Draw(play, Lib_SegmentedToVirtual(D_06006240)); - SkelAnime_DrawFlexOpa(play, this->unk3C8.skeleton, this->unk3C8.jointTable, this->unk3C8.dListCount, - func_809F14AC, func_809F1550, &this->dyna.actor); + SkelAnime_DrawFlexOpa(play, this->skelAnime20.skeleton, this->skelAnime20.jointTable, + this->skelAnime20.dListCount, func_809F14AC, func_809F1550, &this->dyna.actor); } POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP); diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.h b/src/overlays/actors/ovl_Boss_05/z_boss_05.h index 4881b702d..adf8339a5 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.h +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.h @@ -7,72 +7,60 @@ struct Boss05; typedef void (*Boss05ActionFunc)(struct Boss05*, PlayState*); -// typedef struct Boss05 { -// /* 0x000 */ DynaPolyActor dyna; -// /* 0x15C */ char unk_15C[0x14]; -// /* 0x170 */ Boss05ActionFunc actionFunc; -// /* 0x174 */ char unk_174[0x394]; -// } Boss05; // size = 0x508 +typedef enum { + /* 0 */ BIO_DEKU_BABA_TYPE_0, + /* 0 */ BIO_DEKU_BABA_TYPE_1, + /* 0 */ BIO_DEKU_BABA_TYPE_2, + /* 0 */ BIO_DEKU_BABA_TYPE_3, + /* 0 */ BIO_DEKU_BABA_TYPE_4, + /* 0 */ BIO_DEKU_BABA_TYPE_10 = 10, // Fragments? +} BioDekuBabaType; typedef struct Boss05 { /* 0x000 */ DynaPolyActor dyna; /* 0x15C */ u8 unk15C; /* inferred */ - /* 0x15D */ char pad15D[1]; /* 0x15E */ s16 unk15E; /* inferred */ /* 0x160 */ s16 unk160; /* inferred */ - /* 0x162 */ s16 unk162[3]; - /* 0x168 */ s16 unk168; /* inferred */ - /* 0x16A */ s16 unk16A; /* inferred */ - /* 0x16C */ s16 unk16C; /* inferred */ - /* 0x16E */ char pad16E[2]; + /* 0x162 */ s16 unk162[3]; // timers + /* 0x168 */ s16 unk168; // timer + /* 0x16A */ s16 unk16A; // timer + /* 0x16C */ s16 unk16C; // timer /* 0x170 */ Boss05ActionFunc actionFunc; - /* 0x174 */ u8 unk174; /* inferred */ - /* 0x175 */ char pad175[1]; - // /* 0x174 */ char pad174[2]; // possibly this is a Vec3s + /* 0x174 */ u8 unk174; /* 0x176 */ s16 unk176; /* 0x178 */ s16 unk178; - /* 0x17A */ s16 unk17A; /* inferred */ - /* 0x17C */ f32 unk17C; /* inferred */ - /* 0x180 */ f32 unk180; /* inferred */ - /* 0x184 */ f32 unk184; /* inferred */ - /* 0x188 */ u8 unk188; /* inferred */ - /* 0x189 */ u8 unk189; /* inferred */ - /* 0x18A */ char pad18A[2]; /* maybe part of unk189[3]? */ - /* 0x18C */ Vec3f unk18C; + /* 0x17A */ s16 unk17A; // timer + /* 0x17C */ f32 drawDmgEffScale; + /* 0x180 */ f32 dmgEffFrozenSteamScale; + /* 0x184 */ f32 drawDmgEffAlpha; + /* 0x188 */ u8 drawDmgEffState; // A bit more than just type, possibly we should name it as an internal type? + /* 0x189 */ u8 drawDmgEffType; + /* 0x18C */ Vec3f limbPos[1]; /* 0x198 */ f32 unk198; /* 0x19C */ s16 unk19C; - /* 0x19E */ Vec3s unk19E[1]; - // /* 0x1A0 */ s16 unk1A0; - // /* 0x1A2 */ s16 unk1A2; - /* 0x1A4 */ char pad1A4[0x24]; // Some number of other Vec3s in here - /* 0x1C8 */ ColliderJntSph unk1C8; /* inferred */ - /* 0x1E8 */ ColliderJntSphElement unk1E8[2]; - /* 0x268 */ SkelAnime unk268; - /* 0x2AC */ Vec3s unk2AC[10]; - /* 0x2E8 */ Vec3s unk2E8[10]; - /* 0x324 */ Vec3f unk324; - /* 0x330 */ Vec3s unk330; // ? - /* 0x330 */ char unk336[0x2]; - /* 0x330 */ f32 unk338; + /* 0x19E */ Vec3s unk19E[7]; + /* 0x1C8 */ ColliderJntSph collider2; + /* 0x1E8 */ ColliderJntSphElement colliderElements2[2]; + /* 0x268 */ SkelAnime skelAnime10; + /* 0x2AC */ Vec3s jointTable10[10]; + /* 0x2E8 */ Vec3s morphTable10[10]; + /* 0x324 */ Vec3f unk324; // pos used for spawning and drawing + /* 0x330 */ Vec3s unk330; // rotation used for spawning and drawing + /* 0x338 */ f32 unk338; /* 0x33C */ Vec3f unk33C; /* 0x348 */ s16 unk348; - /* 0x34A */ char unk34A[0x2]; - /* 0x34C */ f32 unk34C; - /* 0x350 */ char unk350[0x4]; - /* 0x35C */ f32 unk354; + /* 0x34C */ Vec3f unk34C; /* 0x35C */ f32 unk358; /* 0x35C */ f32 unk35C; /* 0x360 */ f32 unk360; /* 0x364 */ f32 unk364; - /* 0x368 */ ColliderJntSph unk368; - /* 0x388 */ ColliderJntSphElement unk388[1]; - /* 0x3C8 */ SkelAnime unk3C8; - /* 0x40C */ Vec3s unk40C[20]; - /* 0x484 */ Vec3s unk484[20]; - /* 0x4FC */ f32 unk4FC; /* inferred */ - /* 0x500 */ s16 unk500; /* inferred */ - /* 0x502 */ s16 unk502; /* inferred */ - /* 0x504 */ char pad504[4]; /* maybe part of unk502[3]? */ + /* 0x368 */ ColliderJntSph collider1; + /* 0x388 */ ColliderJntSphElement colliderElements1[1]; + /* 0x3C8 */ SkelAnime skelAnime20; + /* 0x40C */ Vec3s jointTable20[20]; + /* 0x484 */ Vec3s morphTable20[20]; + /* 0x4FC */ f32 lastAnimFrame; + /* 0x500 */ Vec3s unk500; } Boss05; // size = 0x508