From 8dd6f65756cca4882f5ccf695f122fd54fdc2f2e Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Sun, 18 Oct 2020 17:51:09 -0700 Subject: [PATCH] Work a bit on func_80A75C38 --- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 84 +++++++++++++++++++++++++ src/overlays/actors/ovl_En_Ik/z_en_ik.h | 2 +- 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 3c5a2e40dc..9484c0c87b 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -663,7 +663,91 @@ void func_80A75A38(EnIk* this, GlobalContext* globalCtx) { } } +#ifdef NON_EQUIVALENT +void func_80A75C38(EnIk* this, GlobalContext* globalCtx) { + Vec3f sp38; + f32 temp_f0; + s32 temp_v0_3; + u8 temp_t7; + u8 prevHealth; + + if ((this->unk_2F8 != 3) && (this->unk_2F8 != 2)) { + if (this->unk_3EC.base.acFlags & 0x80) { + temp_f0 = SkelAnime_GetFrameCount(&D_0600485C.genericHeader) - 2.0f; + if (this->skelAnime.animCurrentFrame < temp_f0) { + this->skelAnime.animCurrentFrame = temp_f0; + } + this->unk_3EC.base.acFlags &= ~0x80; + this->unk_320.base.acFlags &= ~0x2; + return; + } + if (this->unk_320.base.acFlags & 2) { + sp38 = this->actor.posRot.pos; + sp38.y += 50.0f; + func_80035650(&this->actor, &this->unk_320.body, 1); + temp_t7 = this->actor.colChkInfo.damageEffect; + temp_v0_3 = temp_t7 & 0xFF; + this->unk_320.base.acFlags &= ~0x2; + this->unk_2FD = temp_t7; + + if (((temp_v0_3 == 0) || (temp_v0_3 == 0xD)) || ((this->unk_2FB == 0) && (temp_v0_3 == 0xE))) { + if (temp_v0_3 != 0) { + func_80062D60(globalCtx, &sp38); + } + return; + } + func_8003426C(&this->actor, 0x4000, 0xFF, 0, 0xC); + prevHealth = this->actor.colChkInfo.health; + Actor_ApplyDamage(&this->actor); + if (this->actor.params != 0) { + if ((prevHealth >= 11) && (this->actor.colChkInfo.health < 11)) { + this->unk_2FB = 1; + func_80032E24(&this->unk_308, 3, globalCtx); + } + block_23: + if (this->actor.colChkInfo.health == 0) { + func_80A7598C(this); + func_80032C7C(globalCtx, &this->actor); + return; + } + Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 0x7D0, 0); + if ((this->actor.params == 0) && (Math_Rand_ZeroOne() < 0.5f)) { + if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) > 0x4000) { + func_80A754A0(this); + } + } + if ((this->actor.params != 0) && (this->unk_2FB != 0)) { + if ((prevHealth >= 11) && (this->actor.colChkInfo.health < 11)) { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO); + } else { + Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_DAMAGE); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_CUTBODY); + } + func_80A75790(this); + return; + } + Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_ARMOR_HIT); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_DAMAGE); + func_80062CD4(globalCtx, &sp38); + } else if (this->actor.colChkInfo.health < 11) { + Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_BOSS); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EN_LAST_DAMAGE); + if (this->switchFlags != 0xFF) { + Flags_SetSwitch(globalCtx, this->switchFlags); + return; + } + } else { + if (prevHealth == 50) { + Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, 5); + } + goto block_23; + } + } + } +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ik/func_80A75C38.s") +#endif #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ik/func_80A75FA0.s") diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.h b/src/overlays/actors/ovl_En_Ik/z_en_ik.h index 1da0a77b0d..696260e13e 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.h +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.h @@ -18,7 +18,7 @@ typedef struct EnIk { /* 0x02FA */ u8 unk_2FA; /* 0x02FB */ u8 unk_2FB; /* 0x02FC */ u8 unk_2FC; - /* 0x02FD */ char unk_2FD[0x01]; + /* 0x02FD */ u8 unk_2FD; /* 0x02FE */ s8 unk_2FE; /* 0x02FF */ s8 unk_2FF; /* 0x0300 */ s16 unk_300;