From af3ae7c35d41986820156e630a205e918ba243ab Mon Sep 17 00:00:00 2001 From: inspectredc Date: Thu, 2 Nov 2023 18:41:53 +0000 Subject: [PATCH] func_80A7A360 --- src/overlays/actors/ovl_En_Jso2/z_en_jso2.c | 81 ++++++++++++++++++++- src/overlays/actors/ovl_En_Jso2/z_en_jso2.h | 4 +- 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c index e3558377c..4505142b4 100644 --- a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c +++ b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c @@ -684,7 +684,86 @@ void func_80A7A2EC(EnJso2* this, PlayState* play) { } } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jso2/func_80A7A360.s") +void func_80A7A360(EnJso2* this, PlayState* play) { + s32 var_a3 = false; + + if ((this->unk284 != 0xB) && (this->unk284 != 0xC) && (this->unk284 != 0xD) && (this->unk284 != 0xE) && this->unkEF4.base.acFlags & 2) { + this->unkEF4.base.acFlags &= 0xFFFD; + if ((this->actor.colChkInfo.damageEffect == 1) || (this->actor.colChkInfo.damageEffect == 5)) { + this->actor.world.rot.x = this->actor.shape.rot.x = 0; + if (((this->unk2A2 != 0xB) && (this->unk2A2 != 0xA)) || (this->unk2A0 == 0)) { + Actor_PlaySfx(&this->actor, 0x389E); + if (this->actor.colChkInfo.damageEffect == 5) { + this->unk2A0 = 0x28; + this->unk2A2 = 0x20; + } + Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x28); + func_80A79524(this); + } + } else { + switch (this->unk284) { + case 2: + case 3: + case 4: + this->actor.speed = 0.0f; + func_80A78A70(this); + break; + case 7: + case 9: + case 10: + switch (this->actor.colChkInfo.damageEffect) { + case 15: + var_a3 = true; + break; + case 2: + this->unk2A0 = 0x28; + this->unk2A2 = 0; + var_a3 = true; + break; + + case 4: + if (((this->unk2A2 != 0xB) && (this->unk2A2 != 0xA)) || (this->unk2A0 == 0)) { + Actor_Spawn(&play->actorCtx, play, 0xA2, this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 0, 4); + this->unk2A0 = 0x14; + this->unk2A2 = 0x14; + var_a3 = true; + } + break; + + case 3: + if (((this->unk2A2 != 0xB) && (this->unk2A2 != 0xA)) || (this->unk2A0 == 0)) { + Actor_ApplyDamage(&this->actor); + this->unk2A0 = 0x50; + this->unk2A2 = 0xB; + this->unk2A4 = 0.0f; + this->unk2A8 = 1.5f; + } + if (this->actor.colChkInfo.health <= 0) { + func_80A7998C(this, play); + } else { + func_80A79524(this); + } + break; + + + default: + break; + + } + default: + break; + } + if (var_a3) { + Actor_ApplyDamage(&this->actor); + if (this->actor.colChkInfo.health > 0) { + func_80A796BC(this, play); + } else { + func_80A7998C(this, play); + } + } + } + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jso2/EnJso2_Update.s") diff --git a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.h b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.h index 91f960eb9..4e2e699a3 100644 --- a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.h +++ b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.h @@ -26,7 +26,9 @@ typedef struct EnJso2 { /* 0x029C */ s32 unk29C; /* 0x02A0 */ s16 unk2A0; /* 0x02A2 */ s16 unk2A2; - /* 0x02A4 */ char unk_2A4[0x10]; + /* 0x02A4 */ f32 unk2A4; + /* 0x02A8 */ f32 unk2A8; + /* 0x02AC */ char pad2AC[0x8]; /* 0x02B4 */ s32 unk2B4; /* 0x02B6 */ char unk_2B8[0xC]; /* 0x02C4 */ Vec3f unk2C4;