1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-27 11:34:29 +00:00

Work a bit on func_80A75C38

This commit is contained in:
Sirius902 2020-10-18 17:51:09 -07:00
parent 2bc429161c
commit 8dd6f65756
2 changed files with 85 additions and 1 deletions

View file

@ -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")

View file

@ -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;