From f4c9720601b71d1ebb2a8a0ec8c1c32f0616743b Mon Sep 17 00:00:00 2001 From: Elliptic Ellipsis Date: Sun, 25 Sep 2022 20:41:09 +0100 Subject: [PATCH] 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