mirror of
https://github.com/zeldaret/mm.git
synced 2024-11-27 06:40:36 +00:00
parent
429a5ee9ff
commit
22a759a923
3
spec
3
spec
@ -877,8 +877,7 @@ beginseg
|
||||
name "ovl_En_Peehat"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_En_Peehat/z_en_peehat.o"
|
||||
include "build/data/ovl_En_Peehat/ovl_En_Peehat.data.o"
|
||||
include "build/data/ovl_En_Peehat/ovl_En_Peehat.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_En_Peehat/ovl_En_Peehat_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
@ -5,6 +5,8 @@
|
||||
*/
|
||||
|
||||
#include "z_en_peehat.h"
|
||||
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
|
||||
#include "objects/object_ph/object_ph.h"
|
||||
|
||||
#define FLAGS 0x00000015
|
||||
|
||||
@ -15,7 +17,26 @@ void EnPeehat_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnPeehat_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnPeehat_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
#if 0
|
||||
void func_80897498(EnPeehat* this);
|
||||
void func_80897520(EnPeehat* this, GlobalContext* globalCtx);
|
||||
void func_80897648(EnPeehat* this);
|
||||
void func_808976DC(EnPeehat* this, GlobalContext* globalCtx);
|
||||
void func_80897910(EnPeehat* this, GlobalContext* globalCtx);
|
||||
void func_80897A34(EnPeehat* this);
|
||||
void func_80897A94(EnPeehat* this, GlobalContext* globalCtx);
|
||||
void func_80897D48(EnPeehat* this, GlobalContext* globalCtx);
|
||||
void func_80897EAC(EnPeehat* this);
|
||||
void func_80897F44(EnPeehat* this, GlobalContext* globalCtx);
|
||||
void func_80898124(EnPeehat* this);
|
||||
void func_80898144(EnPeehat* this, GlobalContext* globalCtx);
|
||||
void func_808982E0(EnPeehat* this);
|
||||
void func_80898338(EnPeehat* this, GlobalContext* globalCtx);
|
||||
void func_80898454(EnPeehat* this, GlobalContext* globalCtx);
|
||||
void func_808984E0(EnPeehat* this);
|
||||
void func_80898594(EnPeehat* this, GlobalContext* globalCtx);
|
||||
void func_80898654(EnPeehat* this);
|
||||
void func_808986A4(EnPeehat* this, GlobalContext* globalCtx);
|
||||
|
||||
const ActorInit En_Peehat_InitVars = {
|
||||
ACTOR_EN_PEEHAT,
|
||||
ACTORCAT_ENEMY,
|
||||
@ -28,40 +49,85 @@ const ActorInit En_Peehat_InitVars = {
|
||||
(ActorFunc)EnPeehat_Draw,
|
||||
};
|
||||
|
||||
// static ColliderCylinderInit sCylinderInit = {
|
||||
static ColliderCylinderInit D_80899430 = {
|
||||
{ COLTYPE_WOOD, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
|
||||
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON, },
|
||||
static ColliderCylinderInit sCylinderInit = {
|
||||
{
|
||||
COLTYPE_WOOD,
|
||||
AT_NONE,
|
||||
AC_ON | AC_TYPE_PLAYER,
|
||||
OC1_ON | OC1_TYPE_ALL,
|
||||
OC2_TYPE_1,
|
||||
COLSHAPE_CYLINDER,
|
||||
},
|
||||
{
|
||||
ELEMTYPE_UNK0,
|
||||
{ 0x00000000, 0x00, 0x00 },
|
||||
{ 0xF7CFFFFF, 0x00, 0x00 },
|
||||
TOUCH_NONE | TOUCH_SFX_NORMAL,
|
||||
BUMP_ON | BUMP_HOOKABLE,
|
||||
OCELEM_ON,
|
||||
},
|
||||
{ 50, 120, -20, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
// static ColliderSphereInit sSphereInit = {
|
||||
static ColliderSphereInit D_8089945C = {
|
||||
{ COLTYPE_HIT6, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_SPHERE, },
|
||||
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
|
||||
static ColliderSphereInit sSphereInit = {
|
||||
{
|
||||
COLTYPE_HIT6,
|
||||
AT_NONE,
|
||||
AC_ON | AC_TYPE_PLAYER,
|
||||
OC1_ON | OC1_TYPE_ALL,
|
||||
OC2_TYPE_1,
|
||||
COLSHAPE_SPHERE,
|
||||
},
|
||||
{
|
||||
ELEMTYPE_UNK0,
|
||||
{ 0x00000000, 0x00, 0x00 },
|
||||
{ 0xF7CFFFFF, 0x00, 0x00 },
|
||||
TOUCH_NONE | TOUCH_SFX_NORMAL,
|
||||
BUMP_ON,
|
||||
OCELEM_ON,
|
||||
},
|
||||
{ 0, { { 0, 0, 0 }, 40 }, 100 },
|
||||
};
|
||||
|
||||
// static ColliderTrisElementInit sTrisElementsInit[2] = {
|
||||
static ColliderTrisElementInit D_80899488[2] = {
|
||||
static ColliderTrisElementInit sTrisElementsInit[2] = {
|
||||
{
|
||||
{ ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x10 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
|
||||
{
|
||||
ELEMTYPE_UNK0,
|
||||
{ 0xF7CFFFFF, 0x00, 0x10 },
|
||||
{ 0xF7CFFFFF, 0x00, 0x00 },
|
||||
TOUCH_ON | TOUCH_SFX_NORMAL,
|
||||
BUMP_ON,
|
||||
OCELEM_NONE,
|
||||
},
|
||||
{ { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } },
|
||||
},
|
||||
{
|
||||
{ ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x10 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
|
||||
{
|
||||
ELEMTYPE_UNK0,
|
||||
{ 0xF7CFFFFF, 0x00, 0x10 },
|
||||
{ 0xF7CFFFFF, 0x00, 0x00 },
|
||||
TOUCH_ON | TOUCH_SFX_NORMAL,
|
||||
BUMP_ON,
|
||||
OCELEM_NONE,
|
||||
},
|
||||
{ { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } },
|
||||
},
|
||||
};
|
||||
|
||||
// static ColliderTrisInit sTrisInit = {
|
||||
static ColliderTrisInit D_80899500 = {
|
||||
{ COLTYPE_METAL, AT_NONE | AT_TYPE_ENEMY, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, OC2_TYPE_1, COLSHAPE_TRIS, },
|
||||
2, D_80899488, // sTrisElementsInit,
|
||||
static ColliderTrisInit sTrisInit = {
|
||||
{
|
||||
COLTYPE_METAL,
|
||||
AT_NONE | AT_TYPE_ENEMY,
|
||||
AC_ON | AC_HARD | AC_TYPE_PLAYER,
|
||||
OC1_NONE,
|
||||
OC2_TYPE_1,
|
||||
COLSHAPE_TRIS,
|
||||
},
|
||||
2,
|
||||
sTrisElementsInit,
|
||||
};
|
||||
|
||||
// static DamageTable sDamageTable = {
|
||||
static DamageTable D_80899510 = {
|
||||
static DamageTable sDamageTable = {
|
||||
/* Deku Nut */ DMG_ENTRY(0, 0x0),
|
||||
/* Deku Stick */ DMG_ENTRY(1, 0x0),
|
||||
/* Horse trample */ DMG_ENTRY(1, 0x0),
|
||||
@ -96,98 +162,787 @@ static DamageTable D_80899510 = {
|
||||
/* Powder Keg */ DMG_ENTRY(1, 0x0),
|
||||
};
|
||||
|
||||
// sColChkInfoInit
|
||||
static CollisionCheckInfoInit2 D_80899530 = { 15, 50, 120, -20, MASS_HEAVY };
|
||||
static CollisionCheckInfoInit2 sColChkInfoInit1 = { 15, 50, 120, -20, MASS_HEAVY };
|
||||
|
||||
// sColChkInfoInit
|
||||
static CollisionCheckInfoInit2 D_8089953C = { 1, 20, 15, -5, 30 };
|
||||
static CollisionCheckInfoInit2 sColChkInfoInit2 = { 1, 20, 15, -5, 30 };
|
||||
|
||||
// static InitChainEntry sInitChain[] = {
|
||||
static InitChainEntry D_80899548[] = {
|
||||
static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_F32(uncullZoneForward, 4200, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32(uncullZoneScale, 800, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32(uncullZoneDownward, 1800, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32(targetArrowOffset, 700, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
#endif
|
||||
void EnPeehat_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnPeehat* this = THIS;
|
||||
|
||||
extern ColliderCylinderInit D_80899430;
|
||||
extern ColliderSphereInit D_8089945C;
|
||||
extern ColliderTrisElementInit D_80899488[2];
|
||||
extern ColliderTrisInit D_80899500;
|
||||
extern DamageTable D_80899510;
|
||||
extern CollisionCheckInfoInit2 D_80899530;
|
||||
extern CollisionCheckInfoInit2 D_8089953C;
|
||||
extern InitChainEntry D_80899548[];
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &object_ph_Skel_001C80, &object_ph_Anim_0009C4, this->jointTable,
|
||||
this->morphTable, 24);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 27.0f);
|
||||
this->unk_2B0 = 0;
|
||||
Math_Vec3f_Copy(&this->actor.focus.pos, &this->actor.world.pos);
|
||||
this->actor.floorHeight = this->actor.world.pos.y;
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit);
|
||||
Collider_InitAndSetSphere(globalCtx, &this->colliderSphere, &this->actor, &sSphereInit);
|
||||
Collider_InitAndSetTris(globalCtx, &this->colliderTris, &this->actor, &sTrisInit, this->colliderTriElements);
|
||||
|
||||
extern UNK_TYPE D_06000350;
|
||||
extern UNK_TYPE D_060005C4;
|
||||
extern UNK_TYPE D_06000844;
|
||||
extern UNK_TYPE D_060009C4;
|
||||
if (this->actor.params == 0) {
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit1);
|
||||
if (gSaveContext.isNight) {
|
||||
this->actor.shape.yOffset = -1000.0f;
|
||||
}
|
||||
Actor_SetScale(&this->actor, 0.036f);
|
||||
this->actor.hintId = 0x48;
|
||||
func_80897498(this);
|
||||
} else {
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2);
|
||||
this->actor.scale.z = this->actor.scale.x = 0.006f;
|
||||
this->actor.scale.y = 0.003f;
|
||||
this->actor.velocity.y = 6.0f;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/EnPeehat_Init.s")
|
||||
this->colliderCylinder.dim.radius = 20;
|
||||
this->colliderCylinder.dim.height = 15;
|
||||
this->colliderCylinder.dim.yShift = -5;
|
||||
this->actor.hintId = 0x49;
|
||||
this->colliderCylinder.base.ocFlags1 &= ~OC1_ON;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/EnPeehat_Destroy.s")
|
||||
func_80897A34(this);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897170.s")
|
||||
void EnPeehat_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnPeehat* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_808971DC.s")
|
||||
Collider_DestroyCylinder(globalCtx, &this->colliderCylinder);
|
||||
Collider_DestroySphere(globalCtx, &this->colliderSphere);
|
||||
Collider_DestroyTris(globalCtx, &this->colliderTris);
|
||||
if (this->actor.params != 0) {
|
||||
EnPeehat* parent = (EnPeehat*)this->actor.parent;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897258.s")
|
||||
if ((parent != NULL) && (parent->actor.update != NULL)) {
|
||||
parent->unk_2AC--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897390.s")
|
||||
void func_80897170(EnPeehat* this) {
|
||||
this->unk_2AE = 10;
|
||||
this->unk_2CC = 1.1f;
|
||||
this->unk_2D0 = 1.6500001f;
|
||||
this->unk_2C8 = 1.0f;
|
||||
this->colliderSphere.base.colType = COLTYPE_HIT3;
|
||||
this->unk_2B0 = 80;
|
||||
func_800BCB70(&this->actor, 0x4000, 255, 0, 80);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897498.s")
|
||||
void func_808971DC(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_2AE == 10) {
|
||||
this->unk_2AE = 0;
|
||||
this->colliderSphere.base.colType = COLTYPE_HIT6;
|
||||
this->unk_2C8 = 0.0f;
|
||||
func_800BF7CC(globalCtx, &this->actor, this->unk_2EC, ARRAY_COUNT(this->unk_2EC), 2, 0.5f, 0.35f);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897520.s")
|
||||
void func_80897258(GlobalContext* globalCtx, EnPeehat* this, Vec3f* arg2, f32 arg3, f32 arg4) {
|
||||
static Vec3f D_80899558 = { 0.0f, 8.0f, 0.0f };
|
||||
static Vec3f D_80899564 = { 0.0f, -1.5f, 0.0f };
|
||||
Vec3f sp44;
|
||||
s16 sp42 = Rand_Next() >> 0x10;
|
||||
s32 temp_v1;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897648.s")
|
||||
sp44.y = this->actor.floorHeight;
|
||||
sp44.x = (Math_SinS(sp42) * arg3) + arg2->x;
|
||||
sp44.z = (Math_CosS(sp42) * arg3) + arg2->z;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_808976DC.s")
|
||||
D_80899564.x = randPlusMinusPoint5Scaled(1.05f);
|
||||
D_80899564.z = randPlusMinusPoint5Scaled(1.05f);
|
||||
D_80899558.y = randPlusMinusPoint5Scaled(4.0f) + 8.0f;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897864.s")
|
||||
EffectSsHahen_Spawn(globalCtx, &sp44, &D_80899558, &D_80899564, 0, (Rand_ZeroFloat(5.0f) + 12.0f) * arg4, -1, 10,
|
||||
NULL);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897910.s")
|
||||
void func_80897390(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
s16 phi_s2 = BINANG_ROT180(this->actor.yawTowardsPlayer);
|
||||
Actor* actor;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897A34.s")
|
||||
this->colliderCylinder.base.acFlags &= ~AC_HIT;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897A94.s")
|
||||
for (i = 3 - this->unk_2AC; i > 0; i--) {
|
||||
actor =
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_PEEHAT, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y + 50.0f, this->actor.world.pos.z, 0, phi_s2, 0, 1);
|
||||
phi_s2 += 0x5555;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897D00.s")
|
||||
if (actor != NULL) {
|
||||
this->unk_2AC++;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897D48.s")
|
||||
this->unk_2B0 = 8;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PIHAT_DAMAGE);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897EAC.s")
|
||||
void func_80897498(EnPeehat* this) {
|
||||
Animation_Change(&this->skelAnime, &object_ph_Anim_0009C4, 0.0f, 3.0f,
|
||||
Animation_GetLastFrame(&object_ph_Anim_0009C4), 2, 0.0f);
|
||||
this->unk_2B0 = 0;
|
||||
this->unk_2AD = 1;
|
||||
this->colliderCylinder.base.acFlags &= ~AC_HIT;
|
||||
this->actionFunc = func_80897520;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80897F44.s")
|
||||
void func_80897520(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
if (!gSaveContext.isNight) {
|
||||
this->actor.flags |= 1;
|
||||
this->colliderSphere.base.acFlags |= AC_ON;
|
||||
if (this->actor.xzDistToPlayer < 740.0f) {
|
||||
func_80897648(this);
|
||||
} else {
|
||||
Math_StepToF(&this->actor.shape.yOffset, -1000.0f, 10.0f);
|
||||
}
|
||||
} else {
|
||||
this->actor.flags &= ~1;
|
||||
this->colliderSphere.base.acFlags &= ~AC_ON;
|
||||
Math_StepToF(&this->actor.shape.yOffset, -1000.0f, 50.0f);
|
||||
if (this->unk_2B0 != 0) {
|
||||
this->unk_2B0--;
|
||||
if (this->unk_2B0 & 4) {
|
||||
Math_StepToF(&this->unk_2C4, 0.205f, 0.235f);
|
||||
} else {
|
||||
Math_StepToF(&this->unk_2C4, 0.0f, 0.005f);
|
||||
}
|
||||
} else if (this->colliderCylinder.base.acFlags & AC_HIT) {
|
||||
func_80897390(this, globalCtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80898124.s")
|
||||
void func_80897648(EnPeehat* this) {
|
||||
if (this->actionFunc != func_80898454) {
|
||||
Animation_Change(&this->skelAnime, &object_ph_Anim_0009C4, 0.0f, 3.0f,
|
||||
Animation_GetLastFrame(&object_ph_Anim_0009C4), 2, 0.0f);
|
||||
}
|
||||
this->unk_2B0 = 16;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PIHAT_UP);
|
||||
this->actionFunc = func_808976DC;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80898144.s")
|
||||
void func_808976DC(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
Vec3f sp34;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_808982E0.s")
|
||||
Math_StepToF(&this->actor.shape.yOffset, 0.0f, 50.0f);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80898338.s")
|
||||
if (Math_ScaledStepToS(&this->unk_2B2, 4000, 800)) {
|
||||
if (this->unk_2B0 != 0) {
|
||||
this->unk_2B0--;
|
||||
if ((this->unk_2B0 == 0) && (this->skelAnime.playSpeed < 0.5f)) {
|
||||
this->unk_2B0 = -1;
|
||||
this->skelAnime.playSpeed = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80898414.s")
|
||||
if (SkelAnime_Update(&this->skelAnime) || (this->unk_2B0 == 0)) {
|
||||
func_80897EAC(this);
|
||||
} else {
|
||||
this->actor.world.pos.y += 6.5f;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80898454.s")
|
||||
if ((this->actor.world.pos.y - this->actor.floorHeight) < 80.0f) {
|
||||
Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
|
||||
sp34.y = this->actor.floorHeight;
|
||||
func_800BBFB0(globalCtx, &sp34, 90.0f, 1, 150, 100, 1);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_808984E0.s")
|
||||
func_80897258(globalCtx, this, &this->actor.world.pos, 75.0f, 2.0f);
|
||||
Math_StepToF(&this->unk_2C4, 0.075f, 0.005f);
|
||||
this->unk_2B4 += this->unk_2B2;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80898594.s")
|
||||
void func_80897864(EnPeehat* this) {
|
||||
Animation_PlayLoop(&this->skelAnime, &object_ph_Anim_0005C4);
|
||||
this->unk_2B8 = 0.0f;
|
||||
if (this->actionFunc == func_80898338) {
|
||||
this->unk_2AD = -this->unk_2AD;
|
||||
} else {
|
||||
this->unk_2AD = (Rand_ZeroOne() < 0.5f) ? 1 : -1;
|
||||
}
|
||||
this->colliderTris.base.atFlags |= AT_ON;
|
||||
this->actionFunc = func_80897910;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80898654.s")
|
||||
void func_80897910(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_808986A4.s")
|
||||
Math_StepToF(&this->actor.speedXZ, 3.0f, 0.25f);
|
||||
Math_StepToF(&this->actor.world.pos.y, this->actor.floorHeight + 80.0f, 3.0f);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (!gSaveContext.isNight && (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 1200.0f)) {
|
||||
Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1000);
|
||||
this->actor.shape.rot.y += (s16)(this->unk_2AD * 450);
|
||||
} else {
|
||||
func_80898124(this);
|
||||
}
|
||||
Math_ScaledStepToS(&this->unk_2B2, 4000, 500);
|
||||
this->unk_2B4 += this->unk_2B2;
|
||||
Math_StepToF(&this->unk_2C4, 0.075f, 0.005f);
|
||||
func_800B9010(&this->actor, NA_SE_EN_PIHAT_FLY - SFX_FLAG);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_8089874C.s")
|
||||
void func_80897A34(EnPeehat* this) {
|
||||
Animation_PlayLoop(&this->skelAnime, &object_ph_Anim_0005C4);
|
||||
this->unk_2B0 = 30;
|
||||
this->actor.speedXZ = 5.3f;
|
||||
this->colliderTris.base.atFlags |= AT_ON;
|
||||
this->actionFunc = func_80897A94;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/EnPeehat_Update.s")
|
||||
void func_80897A94(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80898E74.s")
|
||||
if ((this->actor.parent != NULL) && (this->actor.parent->update == NULL)) {
|
||||
this->actor.parent = NULL;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/func_80899024.s")
|
||||
if ((this->actor.world.pos.y - this->actor.floorHeight) >= 70.0f) {
|
||||
Math_StepToF(&this->actor.velocity.y, -1.3f, 0.5f);
|
||||
} else {
|
||||
Math_StepToF(&this->actor.velocity.y, -0.135f, 0.05f);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Peehat/EnPeehat_Draw.s")
|
||||
if (this->unk_2B0 > 0) {
|
||||
this->unk_2B0--;
|
||||
} else {
|
||||
Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x33E);
|
||||
this->colliderCylinder.base.ocFlags1 |= OC1_ON;
|
||||
}
|
||||
|
||||
this->actor.shape.rot.y += 0x15E;
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
Math_ScaledStepToS(&this->unk_2B2, 4000, 500);
|
||||
this->unk_2B4 += this->unk_2B2;
|
||||
Math_StepToF(&this->unk_2C4, 0.075f, 0.005f);
|
||||
func_800B9010(&this->actor, NA_SE_EN_PIHAT_SM_FLY - SFX_FLAG);
|
||||
|
||||
if (this->colliderTris.base.atFlags & AT_BOUNCED) {
|
||||
this->colliderTris.base.atFlags &= ~(AT_BOUNCED | AT_ON);
|
||||
this->actor.colChkInfo.health = 0;
|
||||
func_808982E0(this);
|
||||
} else if ((this->colliderCylinder.base.acFlags & AC_HIT) || (this->actor.bgCheckFlags & 1)) {
|
||||
func_800B3030(globalCtx, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 40, 7, 0);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 11, NA_SE_EN_EXTINCT);
|
||||
if (!(this->actor.bgCheckFlags & 1)) {
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_PIHAT_SM_DEAD);
|
||||
}
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
} else if (this->colliderTris.base.atFlags & AT_HIT) {
|
||||
this->colliderTris.base.atFlags &= ~AT_HIT;
|
||||
if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.world.rot.y) > 0) {
|
||||
this->actor.world.rot.y -= 0x2000;
|
||||
} else {
|
||||
this->actor.world.rot.y += 0x2000;
|
||||
}
|
||||
this->unk_2B0 = 40;
|
||||
} else if (this->colliderCylinder.base.ocFlags1 & OC1_HIT) {
|
||||
this->colliderCylinder.base.ocFlags1 &= ~OC1_HIT;
|
||||
if ((BINANG_SUB(Actor_YawBetweenActors(&this->actor, this->colliderCylinder.base.oc),
|
||||
this->actor.world.rot.y)) > 0) {
|
||||
this->actor.world.rot.y -= 0x2000;
|
||||
} else {
|
||||
this->actor.world.rot.y += 0x2000;
|
||||
}
|
||||
this->unk_2B0 = 10;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80897D00(EnPeehat* this) {
|
||||
Animation_PlayOnce(&this->skelAnime, &object_ph_Anim_000350);
|
||||
this->colliderTris.base.atFlags &= ~AT_ON;
|
||||
this->actionFunc = func_80897D48;
|
||||
}
|
||||
|
||||
void func_80897D48(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
Vec3f sp34;
|
||||
|
||||
Math_StepToF(&this->actor.shape.yOffset, -1000.0f, 50.0f);
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f);
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 50);
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
func_80897498(this);
|
||||
this->actor.world.pos.y = this->actor.floorHeight;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PIHAT_LAND);
|
||||
} else if (this->actor.floorHeight < this->actor.world.pos.y) {
|
||||
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight, 0.3f, 3.5f, 0.25f);
|
||||
if ((this->actor.world.pos.y - this->actor.floorHeight) < 60.0f) {
|
||||
Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
|
||||
sp34.y = this->actor.floorHeight;
|
||||
func_800BBFB0(globalCtx, &sp34, 80.0f, 1, 150, 100, 1);
|
||||
func_80897258(globalCtx, this, &sp34, 75.0f, 2.0f);
|
||||
}
|
||||
}
|
||||
Math_ScaledStepToS(&this->unk_2B2, 0, 100);
|
||||
this->unk_2B4 += this->unk_2B2;
|
||||
}
|
||||
|
||||
void func_80897EAC(EnPeehat* this) {
|
||||
Animation_PlayLoop(&this->skelAnime, &object_ph_Anim_0005C4);
|
||||
this->actor.speedXZ = Rand_ZeroFloat(0.5f) + 2.5f;
|
||||
this->unk_2B0 = Rand_ZeroFloat(10.0f) + 10.0f;
|
||||
this->colliderTris.base.atFlags |= AT_ON;
|
||||
this->colliderSphere.base.acFlags |= AC_ON;
|
||||
this->actionFunc = func_80897F44;
|
||||
}
|
||||
|
||||
void func_80897F44(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
f32 cos;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((this->actor.world.pos.y - this->actor.floorHeight) > 75.0f) {
|
||||
this->actor.world.pos.y -= 1.0f;
|
||||
}
|
||||
|
||||
cos = cos_rad(this->unk_2B8);
|
||||
this->actor.world.pos.y += cos * 1.4f;
|
||||
this->unk_2B8 += fabsf(cos * 0.18f) + 0.07f;
|
||||
this->unk_2B0--;
|
||||
|
||||
if (this->unk_2B0 <= 0) {
|
||||
this->actor.speedXZ = Rand_ZeroFloat(0.5f) + 2.5f;
|
||||
this->unk_2B0 = Rand_ZeroFloat(10.0f) + 10.0f;
|
||||
this->unk_2B6 = randPlusMinusPoint5Scaled(1000.0f);
|
||||
}
|
||||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
this->actor.world.rot.y += this->unk_2B6;
|
||||
this->actor.shape.rot.y += 0x15E;
|
||||
|
||||
if (!gSaveContext.isNight && (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 1200.0f)) {
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
func_80897864(this);
|
||||
} else {
|
||||
func_80898124(this);
|
||||
}
|
||||
|
||||
Math_ScaledStepToS(&this->unk_2B2, 4000, 500);
|
||||
this->unk_2B4 += this->unk_2B2;
|
||||
Math_StepToF(&this->unk_2C4, 0.075f, 0.005f);
|
||||
func_800B9010(&this->actor, NA_SE_EN_PIHAT_FLY - SFX_FLAG);
|
||||
}
|
||||
|
||||
void func_80898124(EnPeehat* this) {
|
||||
this->actionFunc = func_80898144;
|
||||
this->actor.speedXZ = 2.5f;
|
||||
}
|
||||
|
||||
void func_80898144(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
s32 step;
|
||||
f32 cos;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((this->actor.world.pos.y - this->actor.floorHeight) > 75.0f) {
|
||||
this->actor.world.pos.y -= 1.0f;
|
||||
} else {
|
||||
this->actor.world.pos.y += 1.0f;
|
||||
}
|
||||
cos = cos_rad(this->unk_2B8);
|
||||
this->actor.world.pos.y += cos * 1.4f;
|
||||
|
||||
cos = cos_rad(this->unk_2B8);
|
||||
this->unk_2B8 += fabsf(cos * 0.18f) + 0.07f;
|
||||
|
||||
step = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
|
||||
Math_ScaledStepToS(&this->actor.world.rot.y, step, 0x258);
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1194, 0x258);
|
||||
|
||||
this->actor.shape.rot.y += 0x15E;
|
||||
this->unk_2B4 += this->unk_2B2;
|
||||
|
||||
if (Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) < 2.0f) {
|
||||
func_80897D00(this);
|
||||
}
|
||||
|
||||
if (!gSaveContext.isNight && (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 1200.0f)) {
|
||||
func_80897864(this);
|
||||
}
|
||||
func_800B9010(&this->actor, NA_SE_EN_PIHAT_FLY - SFX_FLAG);
|
||||
}
|
||||
|
||||
void func_808982E0(EnPeehat* this) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &object_ph_Anim_000844, -4.0f);
|
||||
this->actor.speedXZ = -9.0f;
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
this->actionFunc = func_80898338;
|
||||
}
|
||||
|
||||
void func_80898338(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
this->unk_2B4 += this->unk_2B2;
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f)) {
|
||||
if (this->actor.params != 0) {
|
||||
func_800B3030(globalCtx, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 40, 7, 0);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_EXTINCT);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_PIHAT_SM_DEAD);
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
} else {
|
||||
func_80897864(this);
|
||||
}
|
||||
}
|
||||
func_800B9010(&this->actor, NA_SE_EN_PIHAT_FLY - SFX_FLAG);
|
||||
}
|
||||
|
||||
void func_80898414(EnPeehat* this) {
|
||||
func_800BE568(&this->actor, &this->colliderSphere);
|
||||
this->unk_2B2 = 0;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actionFunc = func_80898454;
|
||||
}
|
||||
|
||||
void func_80898454(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_2B0 != 0) {
|
||||
this->unk_2B0--;
|
||||
}
|
||||
|
||||
Math_StepToF(&this->actor.world.pos.y, this->actor.floorHeight, 8.0f);
|
||||
|
||||
if (this->unk_2B0 == 0) {
|
||||
func_808971DC(this, globalCtx);
|
||||
if (this->actor.colChkInfo.health == 0) {
|
||||
func_808984E0(this);
|
||||
} else {
|
||||
func_80897648(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_808984E0(EnPeehat* this) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &object_ph_Anim_000844, -4.0f);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PIHAT_DAMAGE);
|
||||
this->unk_2B2 = 4000;
|
||||
this->unk_2B0 = 14;
|
||||
this->actor.speedXZ = 10.0f;
|
||||
func_800BCB70(&this->actor, 0x4000, 255, 0, 14);
|
||||
this->colliderSphere.base.acFlags &= ~AC_ON;
|
||||
this->unk_2C4 = 0.0f;
|
||||
if (this->actor.colChkInfo.health == 0) {
|
||||
this->actor.velocity.y = 6.0f;
|
||||
}
|
||||
this->actionFunc = func_80898594;
|
||||
}
|
||||
|
||||
void func_80898594(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
this->unk_2B4 += this->unk_2B2;
|
||||
Math_ScaledStepToS(&this->unk_2B2, 4000, 250);
|
||||
Math_StepToF(&this->actor.world.pos.y, this->actor.floorHeight + 88.5f, 3.0f);
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
|
||||
this->unk_2B0--;
|
||||
if (this->unk_2B0 <= 0) {
|
||||
if (this->actor.colChkInfo.health == 0) {
|
||||
func_80898654(this);
|
||||
} else {
|
||||
func_80897EAC(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80898654(EnPeehat* this) {
|
||||
Animation_PlayLoop(&this->skelAnime, &object_ph_Anim_0005C4);
|
||||
this->unk_2B0 = 5;
|
||||
this->unk_2B8 = 0.0f;
|
||||
this->actionFunc = func_808986A4;
|
||||
}
|
||||
|
||||
void func_808986A4(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_2B0 == 5) {
|
||||
EnBom* bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0x602, 0);
|
||||
|
||||
if (bomb != NULL) {
|
||||
bomb->timer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
this->unk_2B0--;
|
||||
|
||||
if (this->unk_2B0 == 0) {
|
||||
Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xE0);
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8089874C(EnPeehat* this, GlobalContext* globalCtx) {
|
||||
if (this->colliderTris.base.acFlags & AC_BOUNCED) {
|
||||
this->colliderTris.base.acFlags &= ~AC_BOUNCED;
|
||||
this->colliderSphere.base.acFlags &= ~AC_HIT;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->colliderSphere.base.acFlags & AC_HIT) {
|
||||
this->colliderSphere.base.acFlags &= ~AC_HIT;
|
||||
if ((this->unk_2AE != 10) || !(this->colliderSphere.info.acHitInfo->toucher.dmgFlags & 0xDB0B3)) {
|
||||
if (!Actor_ApplyDamage(&this->actor)) {
|
||||
Enemy_StartFinishingBlow(globalCtx, &this->actor);
|
||||
}
|
||||
|
||||
this->colliderTris.base.atFlags &= ~(AT_HIT | AT_ON);
|
||||
func_800BE258(&this->actor, &this->colliderSphere.info);
|
||||
func_808971DC(this, globalCtx);
|
||||
|
||||
if (this->actor.colChkInfo.damageEffect == 5) {
|
||||
this->unk_2B0 = 40;
|
||||
func_800BCB70(&this->actor, 0, 255, 0, 40);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE);
|
||||
this->unk_2CC = 1.1f;
|
||||
this->unk_2C8 = 2.0f;
|
||||
this->unk_2AE = 32;
|
||||
func_80898414(this);
|
||||
} else if (this->actor.colChkInfo.damageEffect == 1) {
|
||||
this->unk_2B0 = 40;
|
||||
func_800BCB70(&this->actor, 0, 200, 0, 40);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE);
|
||||
func_80898414(this);
|
||||
} else if (this->actor.colChkInfo.damageEffect == 3) {
|
||||
func_80897170(this);
|
||||
if (this->actor.colChkInfo.health == 0) {
|
||||
this->unk_2B0 = 3;
|
||||
this->colliderSphere.base.acFlags &= ~AC_ON;
|
||||
}
|
||||
func_80898414(this);
|
||||
} else {
|
||||
if (this->actor.colChkInfo.damageEffect == 2) {
|
||||
this->unk_2C8 = 4.0f;
|
||||
this->unk_2CC = 2.1f;
|
||||
this->unk_2AE = 0;
|
||||
} else if (this->actor.colChkInfo.damageEffect == 4) {
|
||||
this->unk_2C8 = 4.0f;
|
||||
this->unk_2CC = 1.1f;
|
||||
this->unk_2AE = 20;
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG,
|
||||
this->colliderSphere.info.bumper.hitPos.x, this->colliderSphere.info.bumper.hitPos.y,
|
||||
this->colliderSphere.info.bumper.hitPos.z, 0, 0, 0, CLEAR_TAG_LARGE_LIGHT_RAYS);
|
||||
}
|
||||
func_800BE568(&this->actor, &this->colliderSphere);
|
||||
func_808984E0(this);
|
||||
}
|
||||
}
|
||||
} else if ((this->unk_2AE == 10) && (this->colliderCylinder.base.acFlags & AC_HIT) &&
|
||||
((this->unk_2AE != 10) || !(this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & 0xDB0B3))) {
|
||||
func_808971DC(this, globalCtx);
|
||||
this->actor.colorFilterTimer = 0;
|
||||
func_80897648(this);
|
||||
}
|
||||
}
|
||||
|
||||
void EnPeehat_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
GlobalContext* globalCtx = globalCtx2;
|
||||
EnPeehat* this = THIS;
|
||||
|
||||
if (thisx->params == 0) {
|
||||
func_8089874C(this, globalCtx);
|
||||
}
|
||||
Actor_SetVelocityAndMoveYRotationAndGravity(thisx);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, thisx, 25.0f, 30.0f, 30.0f, 5);
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
|
||||
if ((globalCtx->gameplayFrames % 128) == 0) {
|
||||
this->unk_2C0 = Rand_ZeroFloat(0.25f) + 0.5f;
|
||||
}
|
||||
|
||||
this->unk_2BC += this->unk_2C0;
|
||||
if (thisx->params == 0) {
|
||||
if (this->actionFunc == func_80897910) {
|
||||
Math_ScaledStepToS(&thisx->shape.rot.x, 6000, 300);
|
||||
} else {
|
||||
Math_ScaledStepToS(&thisx->shape.rot.x, 0, 300);
|
||||
}
|
||||
} else {
|
||||
Actor_SetHeight(thisx, 0.0f);
|
||||
}
|
||||
|
||||
Collider_UpdateCylinder(thisx, &this->colliderCylinder);
|
||||
this->colliderCylinder.dim.pos.y += (s16)(thisx->shape.yOffset * thisx->scale.y);
|
||||
if (this->colliderCylinder.base.ocFlags1 & OC1_ON) {
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base);
|
||||
}
|
||||
|
||||
if (thisx->params == 0) {
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base);
|
||||
if (this->colliderSphere.base.acFlags & AC_ON) {
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->colliderTris.base.atFlags & AT_HIT) {
|
||||
this->colliderTris.base.atFlags &= ~AT_HIT;
|
||||
func_808982E0(this);
|
||||
}
|
||||
|
||||
if (this->colliderTris.base.atFlags & AT_ON) {
|
||||
thisx->flags |= 0x1000000;
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderTris.base);
|
||||
if (thisx->params == 0) {
|
||||
Vec3f sp74;
|
||||
CollisionPoly* sp70;
|
||||
s32 sp6C;
|
||||
s32 i;
|
||||
|
||||
sp70 = NULL;
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderTris.base);
|
||||
|
||||
for (i = 1; i >= 0; i--) {
|
||||
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &thisx->world.pos, &this->unk_2D4[i], &sp74, &sp70, 1,
|
||||
1, 0, 1, &sp6C)) {
|
||||
func_800BBFB0(globalCtx, &sp74, 0.0f, 1, 300, 150, 1);
|
||||
func_80897258(globalCtx, this, &sp74, 0.0f, 1.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base);
|
||||
|
||||
if (this->actionFunc != func_80898454) {
|
||||
Math_StepToF(&this->unk_2C4, 0.0f, 0.001f);
|
||||
}
|
||||
|
||||
if (this->unk_2C8 > 0.0f) {
|
||||
if (this->unk_2AE != 10) {
|
||||
Math_StepToF(&this->unk_2C8, 0.0f, 0.05f);
|
||||
if (this->unk_2AE == 0) {
|
||||
this->unk_2CC = (this->unk_2C8 + 1.0f) * 1.05f;
|
||||
this->unk_2CC = CLAMP_MAX(this->unk_2CC, 2.1f);
|
||||
} else {
|
||||
this->unk_2CC = (this->unk_2C8 + 1.0f) * 0.55f;
|
||||
this->unk_2CC = CLAMP_MAX(this->unk_2CC, 1.1f);
|
||||
}
|
||||
} else if (!Math_StepToF(&this->unk_2D0, 1.1f, 0.0275f)) {
|
||||
func_800B9010(thisx, NA_SE_EV_ICE_FREEZE - SFX_FLAG);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 EnPeehat_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
Actor* thisx) {
|
||||
EnPeehat* this = THIS;
|
||||
s32 pad;
|
||||
|
||||
if (limbIndex == 4) {
|
||||
rot->x = -this->unk_2B4;
|
||||
} else if ((limbIndex == 3) ||
|
||||
((limbIndex == 23) && ((this->actionFunc == func_80898594) || (this->actionFunc == func_80897520)))) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
Gfx* gfx = POLY_OPA_DISP;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateStateAroundXAxis(this->unk_2BC * 0.115f);
|
||||
Matrix_InsertYRotation_f(this->unk_2BC * 0.13f, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_f(this->unk_2BC * 0.1f, MTXMODE_APPLY);
|
||||
Matrix_Scale(1.0f - this->unk_2C4, this->unk_2C4 + 1.0f, 1.0f - this->unk_2C4, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_f(-(this->unk_2BC * 0.1f), MTXMODE_APPLY);
|
||||
Matrix_InsertYRotation_f(-(this->unk_2BC * 0.13f), MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(-(this->unk_2BC * 0.115f));
|
||||
|
||||
gSPMatrix(&gfx[0], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(&gfx[1], *dList);
|
||||
|
||||
Matrix_StatePop();
|
||||
|
||||
POLY_OPA_DISP = &gfx[2];
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void EnPeehat_PostLimbDraw(GlobalContext* globalCtx2, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
||||
static Vec3f D_80899570[] = {
|
||||
{ 1300.0f, 1200.0f, 0.0f },
|
||||
{ 1300.0f, -1200.0f, 0.0f },
|
||||
{ 1300.0f, 0.0f, 1200.0f },
|
||||
{ 1300.0f, 0.0f, -1200.0f },
|
||||
};
|
||||
static s8 D_808995A0[] = {
|
||||
-1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 2, -1, -1, 4, -1, -1, 6, -1, -1, 8, -1, -1, 10, -1,
|
||||
};
|
||||
GlobalContext* globalCtx = globalCtx2;
|
||||
EnPeehat* this = THIS;
|
||||
s32 i;
|
||||
s32 index = D_808995A0[limbIndex];
|
||||
Gfx* gfx;
|
||||
|
||||
if (index != -1) {
|
||||
Matrix_GetStateTranslationAndScaledX(2000.0f, &this->unk_2EC[index]);
|
||||
Matrix_GetStateTranslationAndScaledX(4000.0f, &this->unk_2EC[index + 1]);
|
||||
}
|
||||
|
||||
if (limbIndex == 4) {
|
||||
Matrix_GetStateTranslationAndScaledZ(5500.0f, &this->unk_2D4[0]);
|
||||
Matrix_GetStateTranslationAndScaledZ(-5500.0f, &this->unk_2D4[1]);
|
||||
} else if ((limbIndex == 3) && (thisx->params == 0)) {
|
||||
Vec3f* vec = &D_80899570[0];
|
||||
Vec3f* vec2 = &this->unk_2EC[12];
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_80899570); i++, vec++, vec2++) {
|
||||
Matrix_MultiplyVector3fByState(vec, vec2);
|
||||
}
|
||||
|
||||
Matrix_GetStateTranslationAndScaledX(3000.0f, vec2++);
|
||||
Matrix_GetStateTranslationAndScaledX(-400.0f, vec2);
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
gfx = POLY_OPA_DISP;
|
||||
|
||||
Matrix_InsertTranslation(-1000.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Collider_UpdateSphere(0, &this->colliderSphere);
|
||||
Matrix_InsertTranslation(500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertYRotation_f(3.2f, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.3f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(&gfx[0], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(&gfx[1], *dList);
|
||||
|
||||
POLY_OPA_DISP = &gfx[2];
|
||||
Math_Vec3s_ToVec3f(&this->actor.focus.pos, &this->colliderSphere.dim.worldSphere.center);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
}
|
||||
|
||||
void EnPeehat_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnPeehat* this = THIS;
|
||||
Vec3f sp58;
|
||||
Vec3f sp4C;
|
||||
Vec3f sp40;
|
||||
s32 i;
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnPeehat_OverrideLimbDraw,
|
||||
(this->actor.params == 0) ? EnPeehat_PostLimbDraw : NULL, &this->actor);
|
||||
|
||||
if ((this->actor.speedXZ != 0.0f) || (this->actor.velocity.y != 0.0f)) {
|
||||
Matrix_GetStateTranslationAndScaledZ(4500.0f, &sp40);
|
||||
Matrix_GetStateTranslationAndScaledZ(-4500.0f, &sp4C);
|
||||
Matrix_GetStateTranslationAndScaledX(4500.0f, &sp58);
|
||||
Collider_SetTrisVertices(&this->colliderTris, 0, &sp40, &sp4C, &sp58);
|
||||
Matrix_GetStateTranslationAndScaledX(-4500.0f, &sp58);
|
||||
Collider_SetTrisVertices(&this->colliderTris, 1, &sp40, &sp58, &sp4C);
|
||||
}
|
||||
|
||||
if (this->unk_2AE == 0) {
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_2EC); i++) {
|
||||
this->unk_2EC[i].y -= 50.0f;
|
||||
}
|
||||
}
|
||||
|
||||
func_800BE680(globalCtx, &this->actor, this->unk_2EC, ARRAY_COUNT(this->unk_2EC), this->unk_2CC, this->unk_2D0,
|
||||
this->unk_2C8, this->unk_2AE);
|
||||
}
|
||||
|
@ -8,10 +8,31 @@ struct EnPeehat;
|
||||
typedef void (*EnPeehatActionFunc)(struct EnPeehat*, GlobalContext*);
|
||||
|
||||
typedef struct EnPeehat {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x0144 */ char unk_144[0x164];
|
||||
/* 0x02A8 */ EnPeehatActionFunc actionFunc;
|
||||
/* 0x02AC */ char unk_2AC[0x294];
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ Vec3s jointTable[24];
|
||||
/* 0x188 */ Vec3s morphTable[24];
|
||||
/* 0x2A8 */ EnPeehatActionFunc actionFunc;
|
||||
/* 0x2AC */ u8 unk_2AC;
|
||||
/* 0x2AD */ s8 unk_2AD;
|
||||
/* 0x2AE */ u8 unk_2AE;
|
||||
/* 0x2B0 */ s16 unk_2B0;
|
||||
/* 0x2B2 */ s16 unk_2B2;
|
||||
/* 0x2B4 */ s16 unk_2B4;
|
||||
/* 0x2B6 */ s16 unk_2B6;
|
||||
/* 0x2B8 */ f32 unk_2B8;
|
||||
/* 0x2BC */ f32 unk_2BC;
|
||||
/* 0x2C0 */ f32 unk_2C0;
|
||||
/* 0x2C4 */ f32 unk_2C4;
|
||||
/* 0x2C8 */ f32 unk_2C8;
|
||||
/* 0x2CC */ f32 unk_2CC;
|
||||
/* 0x2D0 */ f32 unk_2D0;
|
||||
/* 0x2D4 */ Vec3f unk_2D4[2];
|
||||
/* 0x2EC */ Vec3f unk_2EC[18];
|
||||
/* 0x3C4 */ ColliderCylinder colliderCylinder;
|
||||
/* 0x410 */ ColliderSphere colliderSphere;
|
||||
/* 0x468 */ ColliderTris colliderTris;
|
||||
/* 0x488 */ ColliderTrisElement colliderTriElements[2];
|
||||
} EnPeehat; // size = 0x540
|
||||
|
||||
extern const ActorInit En_Peehat_InitVars;
|
||||
|
@ -5527,8 +5527,8 @@
|
||||
0x808986A4:("func_808986A4",),
|
||||
0x8089874C:("func_8089874C",),
|
||||
0x80898A28:("EnPeehat_Update",),
|
||||
0x80898E74:("func_80898E74",),
|
||||
0x80899024:("func_80899024",),
|
||||
0x80898E74:("EnPeehat_OverrideLimbDraw",),
|
||||
0x80899024:("EnPeehat_PostLimbDraw",),
|
||||
0x80899218:("EnPeehat_Draw",),
|
||||
0x80899960:("EnHoll_SetupAction",),
|
||||
0x808999B0:("EnHoll_SetPlayerSide",),
|
||||
|
@ -3124,14 +3124,6 @@ D_060073E8 = 0x060073E8;
|
||||
|
||||
D_0600D5A0 = 0x0600D5A0;
|
||||
|
||||
// ovl_En_Peehat
|
||||
|
||||
D_06000350 = 0x06000350;
|
||||
D_060005C4 = 0x060005C4;
|
||||
D_06000844 = 0x06000844;
|
||||
D_060009C4 = 0x060009C4;
|
||||
D_06001C80 = 0x06001C80;
|
||||
|
||||
// ovl_En_Pm
|
||||
|
||||
D_06008348 = 0x06008348;
|
||||
|
Loading…
Reference in New Issue
Block a user