|
|
|
@@ -1,4 +1,11 @@
|
|
|
|
|
/*
|
|
|
|
|
* File: z_en_daiku2.c
|
|
|
|
|
* Overlay: ovl_En_Daiku2
|
|
|
|
|
* Description: Milk Road Carpenter
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "z_en_daiku2.h"
|
|
|
|
|
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
|
|
|
|
|
|
|
|
|
|
#define FLAGS 0x00000009
|
|
|
|
|
|
|
|
|
@@ -9,13 +16,36 @@ void EnDaiku2_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
|
void EnDaiku2_Update(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
|
void EnDaiku2_Draw(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
|
|
|
|
|
|
void func_80BE65B4(EnDaiku2* this, GlobalContext* globalCtx);
|
|
|
|
|
void func_80BE66E4(EnDaiku2* this, GlobalContext* globalCtx);
|
|
|
|
|
void func_80BE6B40(EnDaiku2* this, GlobalContext* globalCtx);
|
|
|
|
|
void func_80BE6BC0(EnDaiku2* this, GlobalContext* globalCtx);
|
|
|
|
|
void func_80BE6CFC(EnDaiku2* this);
|
|
|
|
|
void func_80BE6D40(EnDaiku2* this, GlobalContext* globalCtx);
|
|
|
|
|
void func_80BE6EB0(EnDaiku2* this);
|
|
|
|
|
void func_80BE6EF0(EnDaiku2* this, GlobalContext* globalCtx);
|
|
|
|
|
void func_80BE7600(EnDaiku2* this, GlobalContext* globalCtx);
|
|
|
|
|
void func_80BE71A0(EnDaiku2* this);
|
|
|
|
|
void func_80BE71D8(EnDaiku2* this, GlobalContext* globalCtx);
|
|
|
|
|
void func_80BE7504(EnDaiku2* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4, s16 arg5);
|
|
|
|
|
void func_80BE7718(EnDaiku2* this, GlobalContext* globalCtx);
|
|
|
|
|
|
|
|
|
|
extern AnimationHeader D_06002134;
|
|
|
|
|
extern AnimationHeader D_06002FA0;
|
|
|
|
|
extern AnimationHeader D_0600ACD0;
|
|
|
|
|
extern AnimationHeader D_0600C92C;
|
|
|
|
|
extern AnimationHeader D_06000C44;
|
|
|
|
|
extern AnimationHeader D_0600C234;
|
|
|
|
|
extern AnimationHeader D_06000600;
|
|
|
|
|
extern AnimationHeader D_06001114;
|
|
|
|
|
extern AnimationHeader D_0600B690;
|
|
|
|
|
extern AnimationHeader D_06001A24;
|
|
|
|
|
extern AnimationHeader D_0600D328;
|
|
|
|
|
extern FlexSkeletonHeader D_0600A850;
|
|
|
|
|
extern Gfx D_06009638[];
|
|
|
|
|
extern Gfx D_0600A390[];
|
|
|
|
|
extern Gfx D_060009E0[];
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
const ActorInit En_Daiku2_InitVars = {
|
|
|
|
|
ACTOR_EN_DAIKU2,
|
|
|
|
|
ACTORCAT_NPC,
|
|
|
|
@@ -28,60 +58,523 @@ const ActorInit En_Daiku2_InitVars = {
|
|
|
|
|
(ActorFunc)EnDaiku2_Draw,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// static ColliderCylinderInit sCylinderInit = {
|
|
|
|
|
static ColliderCylinderInit D_80BE7900 = {
|
|
|
|
|
{ COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
|
|
|
|
|
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
|
|
|
|
|
static u16 sTextIds[] = {
|
|
|
|
|
0x32CB, 0x32CC, 0x32CD, 0x32CE, 0x32CF, 0x32D0, 0x32D1, 0x32D2,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static ColliderCylinderInit sCylinderInit = {
|
|
|
|
|
{
|
|
|
|
|
COLTYPE_NONE,
|
|
|
|
|
AT_NONE,
|
|
|
|
|
AC_NONE,
|
|
|
|
|
OC1_ON | OC1_TYPE_ALL,
|
|
|
|
|
OC2_TYPE_2,
|
|
|
|
|
COLSHAPE_CYLINDER,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
ELEMTYPE_UNK0,
|
|
|
|
|
{ 0x00000000, 0x00, 0x00 },
|
|
|
|
|
{ 0xF7CFFFFF, 0x00, 0x00 },
|
|
|
|
|
TOUCH_NONE | TOUCH_SFX_NORMAL,
|
|
|
|
|
BUMP_NONE,
|
|
|
|
|
OCELEM_ON,
|
|
|
|
|
},
|
|
|
|
|
{ 20, 60, 0, { 0, 0, 0 } },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
void func_80BE61D0(EnDaiku2* this) {
|
|
|
|
|
if ((this->unk_27A != -1) && (this->unk_258 != 0)) {
|
|
|
|
|
if (func_8013D68C(this->unk_258, this->unk_25C, &this->unk_268) == 0) {
|
|
|
|
|
Actor_MarkForDeath(&this->actor);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern ColliderCylinderInit D_80BE7900;
|
|
|
|
|
void EnDaiku2_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|
|
|
|
EnDaiku2* this = THIS;
|
|
|
|
|
s32 day = gSaveContext.day;
|
|
|
|
|
|
|
|
|
|
extern UNK_TYPE D_060009E0;
|
|
|
|
|
extern UNK_TYPE D_06002134;
|
|
|
|
|
extern UNK_TYPE D_06002FA0;
|
|
|
|
|
extern UNK_TYPE D_06009638;
|
|
|
|
|
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
|
|
|
|
|
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 40.0f);
|
|
|
|
|
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable, this->morphTable, 17);
|
|
|
|
|
this->actor.targetMode = 0;
|
|
|
|
|
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
|
|
|
|
this->unk_278 = ENDAIKU2_GET_7F(&this->actor);
|
|
|
|
|
this->unk_27A = ENDAIKU2_GET_1F80(&this->actor);
|
|
|
|
|
this->unk_258 = func_8013D648(globalCtx, this->unk_27A, 0x3F);
|
|
|
|
|
this->unk_280 = ENDAIKU2_GET_8000(&this->actor);
|
|
|
|
|
Actor_SetScale(&this->actor, 0.01f);
|
|
|
|
|
if (!this->unk_280) {
|
|
|
|
|
if (day == 3) {
|
|
|
|
|
Actor_MarkForDeath(&this->actor);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE61D0.s")
|
|
|
|
|
if (this->unk_278 == ENDAIKU2_GET_7F_127) {
|
|
|
|
|
this->unk_278 = ENDAIKU2_GET_7F_MINUS1;
|
|
|
|
|
} else if (Flags_GetSwitch(globalCtx, this->unk_278)) {
|
|
|
|
|
this->unk_25C = this->unk_258->count - 1;
|
|
|
|
|
func_80BE61D0(this);
|
|
|
|
|
Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_268);
|
|
|
|
|
}
|
|
|
|
|
} else if (day != 3) {
|
|
|
|
|
Actor_MarkForDeath(&this->actor);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/EnDaiku2_Init.s")
|
|
|
|
|
this->actor.gravity = -3.0f;
|
|
|
|
|
Math_Vec3f_Copy(&this->unk_268, &this->actor.world.pos);
|
|
|
|
|
func_80BE65B4(this, globalCtx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/EnDaiku2_Destroy.s")
|
|
|
|
|
void EnDaiku2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|
|
|
|
EnDaiku2* this = THIS;
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE6408.s")
|
|
|
|
|
Collider_DestroyCylinder(globalCtx, &this->collider);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE64C0.s")
|
|
|
|
|
void func_80BE6408(EnDaiku2* this, s32 arg1) {
|
|
|
|
|
static AnimationHeader* sAnimations[] = {
|
|
|
|
|
&D_06002FA0, &D_0600ACD0, &D_0600C92C, &D_06000C44, &D_0600C234, &D_06000600,
|
|
|
|
|
&D_06001114, &D_0600B690, &D_06001A24, &D_06002134, &D_0600D328,
|
|
|
|
|
};
|
|
|
|
|
static u8 D_80BE7958[] = {
|
|
|
|
|
0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0,
|
|
|
|
|
};
|
|
|
|
|
f32 sp34 = 1.0f;
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE65B4.s")
|
|
|
|
|
this->unk_276 = arg1;
|
|
|
|
|
this->unk_284 = SkelAnime_GetFrameCount(&sAnimations[this->unk_276]->common);
|
|
|
|
|
if (this->unk_276 == 3) {
|
|
|
|
|
sp34 = 2.0f;
|
|
|
|
|
}
|
|
|
|
|
SkelAnime_ChangeAnim(&this->skelAnime, sAnimations[this->unk_276], sp34, 0.0f, this->unk_284,
|
|
|
|
|
D_80BE7958[this->unk_276], -4.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE66E4.s")
|
|
|
|
|
s32 func_80BE64C0(EnDaiku2* this, GlobalContext* globalCtx) {
|
|
|
|
|
EnBom* bomb;
|
|
|
|
|
Vec3f sp30;
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE6B40.s")
|
|
|
|
|
Math_Vec3f_Copy(&sp30, &this->actor.world.pos);
|
|
|
|
|
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos);
|
|
|
|
|
bomb = (EnBom*)func_800BE0B8(globalCtx, &this->actor, -1, ACTORCAT_EXPLOSIVES, BREG(7) + 240.0f);
|
|
|
|
|
Math_Vec3f_Copy(&this->actor.world.pos, &sp30);
|
|
|
|
|
if ((this->unk_278 >= ENDAIKU2_GET_7F_0) && !Flags_GetSwitch(globalCtx, this->unk_278) && (bomb != NULL) &&
|
|
|
|
|
(bomb->actor.id == ACTOR_EN_BOM)) {
|
|
|
|
|
if (bomb->unk_1F9 == 0) {
|
|
|
|
|
this->actor.textId = 0x32D3;
|
|
|
|
|
} else {
|
|
|
|
|
this->actor.textId = 0x32D4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE6BC0.s")
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE6CFC.s")
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE6D40.s")
|
|
|
|
|
void func_80BE65B4(EnDaiku2* this, GlobalContext* globalCtx) {
|
|
|
|
|
switch (gSaveContext.day - 1) {
|
|
|
|
|
case 0:
|
|
|
|
|
this->unk_28A = 0;
|
|
|
|
|
if (gSaveContext.weekEventReg[64] & 2) {
|
|
|
|
|
this->unk_28A = 6;
|
|
|
|
|
}
|
|
|
|
|
func_80BE6408(this, 8);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE6EB0.s")
|
|
|
|
|
case 1:
|
|
|
|
|
this->unk_28A = 2;
|
|
|
|
|
if (gSaveContext.weekEventReg[64] & 4) {
|
|
|
|
|
this->unk_28A = 7;
|
|
|
|
|
}
|
|
|
|
|
func_80BE6408(this, 8);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE6EF0.s")
|
|
|
|
|
case 2:
|
|
|
|
|
this->unk_28A = 4;
|
|
|
|
|
this->unk_264 = 1.0f;
|
|
|
|
|
func_80BE6408(this, 10);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE71A0.s")
|
|
|
|
|
this->unk_264 = 1.0f;
|
|
|
|
|
if ((this->unk_278 >= ENDAIKU2_GET_7F_0) && Flags_GetSwitch(globalCtx, this->unk_278)) {
|
|
|
|
|
this->unk_28A = 5;
|
|
|
|
|
if (this->unk_276 != 10) {
|
|
|
|
|
func_80BE6408(this, 10);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE71D8.s")
|
|
|
|
|
this->unk_288 = 0;
|
|
|
|
|
this->actionFunc = func_80BE66E4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/EnDaiku2_Update.s")
|
|
|
|
|
void func_80BE66E4(EnDaiku2* this, GlobalContext* globalCtx) {
|
|
|
|
|
f32 sp9C = this->skelAnime.animCurrentFrame;
|
|
|
|
|
s32 sp98 = gSaveContext.day - 1;
|
|
|
|
|
s32 i;
|
|
|
|
|
Vec3f sp88;
|
|
|
|
|
Vec3f sp7C;
|
|
|
|
|
Vec3f sp70;
|
|
|
|
|
s32 pad[2];
|
|
|
|
|
s16 temp_v0;
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE738C.s")
|
|
|
|
|
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.home.rot.y, 1, 0xBB8, 0x0);
|
|
|
|
|
if (sp98 != 2) {
|
|
|
|
|
if ((this->unk_278 >= ENDAIKU2_GET_7F_0) && Flags_GetSwitch(globalCtx, this->unk_278)) {
|
|
|
|
|
this->unk_28A = 5;
|
|
|
|
|
if (this->unk_276 != 10) {
|
|
|
|
|
func_80BE6408(this, 10);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/EnDaiku2_Draw.s")
|
|
|
|
|
this->actor.textId = sTextIds[this->unk_28A];
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE7504.s")
|
|
|
|
|
if (func_800B84D0(&this->actor, globalCtx)) {
|
|
|
|
|
func_80BE6B40(this, globalCtx);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE7600.s")
|
|
|
|
|
if ((this->unk_28A != 5) && (sp98 != 2) && func_80BE64C0(this, globalCtx)) {
|
|
|
|
|
func_80BE6CFC(this);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Daiku2/func_80BE7718.s")
|
|
|
|
|
func_800B8614(&this->actor, globalCtx, 80.0f);
|
|
|
|
|
if ((this->unk_276 == 8) && func_801378B8(&this->skelAnime, 6.0f)) {
|
|
|
|
|
Audio_PlayActorSound2(&this->actor, NA_SE_EV_ROCK_BROKEN);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 10; i++) {
|
|
|
|
|
Math_Vec3f_Copy(&sp70, &this->actor.world.pos);
|
|
|
|
|
|
|
|
|
|
sp70.x += Math_SinS(this->actor.world.rot.y) * 70.0f;
|
|
|
|
|
sp70.y += 40.0f;
|
|
|
|
|
sp70.z += Math_CosS(this->actor.world.rot.y) * 70.0f;
|
|
|
|
|
|
|
|
|
|
sp70.x += randPlusMinusPoint5Scaled(5.0f);
|
|
|
|
|
sp70.y += randPlusMinusPoint5Scaled(5.0f);
|
|
|
|
|
sp70.z += randPlusMinusPoint5Scaled(5.0f);
|
|
|
|
|
|
|
|
|
|
sp88.y = -1.0f;
|
|
|
|
|
|
|
|
|
|
sp7C.x = (Rand_ZeroOne() - 0.5f) * 4.0f;
|
|
|
|
|
sp7C.y = (Rand_ZeroOne() * 10.0f) + 4.0f;
|
|
|
|
|
sp7C.z = (Rand_ZeroOne() - 0.5f) * 4.0f;
|
|
|
|
|
|
|
|
|
|
func_80BE7504(this, &sp70, &sp7C, &sp88, 0.01f - (Rand_ZeroFloat(1.0f) * 0.005f), 40);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
temp_v0 = ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.home.rot.y));
|
|
|
|
|
if (temp_v0 > 0x2890) {
|
|
|
|
|
if (sp98 != 2) {
|
|
|
|
|
if ((this->unk_276 == 5) || (this->unk_276 == 9)) {
|
|
|
|
|
func_80BE6408(this, 10);
|
|
|
|
|
} else if ((this->unk_276 == 10) && (this->unk_284 <= sp9C)) {
|
|
|
|
|
this->unk_284 = SkelAnime_GetFrameCount(&D_06002134.common);
|
|
|
|
|
SkelAnime_ChangeAnim(&this->skelAnime, &D_06002134, -1.0f, this->unk_284, 0.0f, 2, -4.0f);
|
|
|
|
|
this->unk_276 = 11;
|
|
|
|
|
} else if ((this->unk_276 == 11) && (sp9C <= 0.0f)) {
|
|
|
|
|
func_80BE6408(this, 8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (sp98 != 2) {
|
|
|
|
|
if ((this->unk_276 != 9) && (this->unk_276 != 10)) {
|
|
|
|
|
func_80BE6408(this, 9);
|
|
|
|
|
} else if ((this->unk_276 == 9) && (this->unk_284 <= sp9C)) {
|
|
|
|
|
func_80BE6408(this, 10);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void func_80BE6B40(EnDaiku2* this, GlobalContext* globalCtx) {
|
|
|
|
|
s32 day = gSaveContext.day;
|
|
|
|
|
|
|
|
|
|
this->unk_288 = 1;
|
|
|
|
|
if ((day != 3) && Flags_GetSwitch(globalCtx, this->unk_278)) {
|
|
|
|
|
this->actionFunc = func_80BE6BC0;
|
|
|
|
|
} else {
|
|
|
|
|
func_80BE6408(this, 5);
|
|
|
|
|
this->actionFunc = func_80BE6BC0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void func_80BE6BC0(EnDaiku2* this, GlobalContext* globalCtx) {
|
|
|
|
|
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 0x0);
|
|
|
|
|
if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
|
|
|
|
|
s32 day = gSaveContext.day - 1;
|
|
|
|
|
|
|
|
|
|
func_801477B4(globalCtx);
|
|
|
|
|
|
|
|
|
|
if (this->unk_288 == 2) {
|
|
|
|
|
this->actionFunc = func_80BE6D40;
|
|
|
|
|
} else if (this->unk_288 == 3) {
|
|
|
|
|
this->actionFunc = func_80BE6EF0;
|
|
|
|
|
} else if ((this->unk_28A == 0) || (this->unk_28A == 2)) {
|
|
|
|
|
this->unk_28A++;
|
|
|
|
|
func_80151938(globalCtx, sTextIds[this->unk_28A]);
|
|
|
|
|
} else {
|
|
|
|
|
switch (day) {
|
|
|
|
|
case 0:
|
|
|
|
|
gSaveContext.weekEventReg[64] |= 2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
gSaveContext.weekEventReg[64] |= 4;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
func_80BE65B4(this, globalCtx);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void func_80BE6CFC(EnDaiku2* this) {
|
|
|
|
|
func_80BE6408(this, 3);
|
|
|
|
|
this->unk_288 = 2;
|
|
|
|
|
this->actionFunc = func_80BE6D40;
|
|
|
|
|
this->unk_264 = 0.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void func_80BE6D40(EnDaiku2* this, GlobalContext* globalCtx) {
|
|
|
|
|
s32 pad[3];
|
|
|
|
|
s16 sp3A = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_268);
|
|
|
|
|
|
|
|
|
|
if (func_800B84D0(&this->actor, globalCtx)) {
|
|
|
|
|
this->actionFunc = func_80BE6BC0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Math_SmoothStepToS(&this->actor.world.rot.y, sp3A, 1, 0x7D0, 0xA);
|
|
|
|
|
Math_ApproachF(&this->actor.world.pos.x, this->unk_268.x, 0.5f, fabsf(Math_SinS(this->actor.world.rot.y) * 6.0f));
|
|
|
|
|
Math_ApproachF(&this->actor.world.pos.z, this->unk_268.z, 0.5f, fabsf(Math_CosS(this->actor.world.rot.y) * 6.0f));
|
|
|
|
|
|
|
|
|
|
if ((sqrtf(SQ(this->actor.world.pos.x - this->unk_268.x) + SQ(this->actor.world.pos.z - this->unk_268.z)) < 4.0f) &&
|
|
|
|
|
(this->unk_258 != 0)) {
|
|
|
|
|
this->unk_25C++;
|
|
|
|
|
if (this->unk_25C >= this->unk_258->count) {
|
|
|
|
|
func_80BE6EB0(this);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
func_80BE61D0(this);
|
|
|
|
|
}
|
|
|
|
|
func_800B8614(&this->actor, globalCtx, 80.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void func_80BE6EB0(EnDaiku2* this) {
|
|
|
|
|
func_80BE6408(this, 2);
|
|
|
|
|
this->unk_274 = 0;
|
|
|
|
|
this->unk_288 = 3;
|
|
|
|
|
this->actionFunc = func_80BE6EF0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void func_80BE6EF0(EnDaiku2* this, GlobalContext* globalCtx) {
|
|
|
|
|
f32 sp5C = this->skelAnime.animCurrentFrame;
|
|
|
|
|
s32 pad[4];
|
|
|
|
|
Vec3f sp40;
|
|
|
|
|
s16 var;
|
|
|
|
|
|
|
|
|
|
if (func_800B84D0(&this->actor, globalCtx)) {
|
|
|
|
|
this->actionFunc = func_80BE6BC0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.home.rot.y, 1, 0xBB8, 0x0);
|
|
|
|
|
if (this->unk_284 <= sp5C) {
|
|
|
|
|
this->unk_274 = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this->unk_274 != 0) {
|
|
|
|
|
Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_268), 1, 0x7D0,
|
|
|
|
|
0xA);
|
|
|
|
|
Math_ApproachF(&this->actor.world.pos.x, this->unk_268.x, 0.5f,
|
|
|
|
|
fabsf(Math_SinS(this->actor.world.rot.y) * 4.0f));
|
|
|
|
|
Math_ApproachF(&this->actor.world.pos.z, this->unk_268.z, 0.5f,
|
|
|
|
|
fabsf(Math_CosS(this->actor.world.rot.y) * 4.0f));
|
|
|
|
|
if ((sqrtf(SQ(this->actor.world.pos.x - this->unk_268.x) + SQ(this->actor.world.pos.z - this->unk_268.z)) <
|
|
|
|
|
4.0f) &&
|
|
|
|
|
(this->unk_258 != 0)) {
|
|
|
|
|
if (!func_80BE64C0(this, globalCtx)) {
|
|
|
|
|
if (this->unk_276 != 3) {
|
|
|
|
|
func_80BE6408(this, 3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((this->unk_278 >= ENDAIKU2_GET_7F_0) && Flags_GetSwitch(globalCtx, this->unk_278)) {
|
|
|
|
|
this->unk_28A = 5;
|
|
|
|
|
if (this->unk_276 != 10) {
|
|
|
|
|
func_80BE6408(this, 10);
|
|
|
|
|
}
|
|
|
|
|
func_80BE65B4(this, globalCtx);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this->unk_25C--;
|
|
|
|
|
if (this->unk_25C < 0) {
|
|
|
|
|
this->unk_25C = 0;
|
|
|
|
|
func_80BE71A0(this);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
func_80BE61D0(this);
|
|
|
|
|
}
|
|
|
|
|
} else if (func_80BE64C0(this, globalCtx)) {
|
|
|
|
|
Math_Vec3f_Copy(&sp40, &this->unk_268);
|
|
|
|
|
var = this->unk_25C;
|
|
|
|
|
this->unk_25C++;
|
|
|
|
|
if (this->unk_25C < this->unk_258->count) {
|
|
|
|
|
func_80BE61D0(this);
|
|
|
|
|
func_80BE6CFC(this);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this->unk_25C = var;
|
|
|
|
|
Math_Vec3f_Copy(&this->unk_268, &sp40);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
func_800B8614(&this->actor, globalCtx, 80.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void func_80BE71A0(EnDaiku2* this) {
|
|
|
|
|
func_80BE6408(this, 9);
|
|
|
|
|
this->actionFunc = func_80BE71D8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void func_80BE71D8(EnDaiku2* this, GlobalContext* globalCtx) {
|
|
|
|
|
f32 currentFrame = this->skelAnime.animCurrentFrame;
|
|
|
|
|
|
|
|
|
|
if (func_80BE64C0(this, globalCtx)) {
|
|
|
|
|
func_80BE6CFC(this);
|
|
|
|
|
} else if ((this->unk_276 == 9) && (this->unk_284 <= currentFrame)) {
|
|
|
|
|
func_80BE6408(this, 0);
|
|
|
|
|
} else if ((this->unk_276 == 0) && (this->unk_284 <= currentFrame)) {
|
|
|
|
|
func_80BE6408(this, 5);
|
|
|
|
|
} else if ((this->unk_276 == 5) && (this->unk_284 <= currentFrame)) {
|
|
|
|
|
func_80BE65B4(this, globalCtx);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EnDaiku2_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|
|
|
|
EnDaiku2* this = THIS;
|
|
|
|
|
s32 pad;
|
|
|
|
|
|
|
|
|
|
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
|
|
|
|
this->actionFunc(this, globalCtx);
|
|
|
|
|
this->actor.shape.rot.y = this->actor.world.rot.y;
|
|
|
|
|
Actor_SetHeight(&this->actor, 65.0f);
|
|
|
|
|
Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor);
|
|
|
|
|
Math_ApproachF(&this->unk_260, this->unk_264, 0.3f, 2.0f);
|
|
|
|
|
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D);
|
|
|
|
|
Collider_UpdateCylinder(&this->actor, &this->collider);
|
|
|
|
|
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
|
|
|
|
func_80BE7600(this, globalCtx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EnDaiku2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
|
|
|
|
EnDaiku2* this = THIS;
|
|
|
|
|
|
|
|
|
|
OPEN_DISPS(globalCtx->state.gfxCtx);
|
|
|
|
|
|
|
|
|
|
func_8012C28C(globalCtx->state.gfxCtx);
|
|
|
|
|
|
|
|
|
|
if (limbIndex == 14) {
|
|
|
|
|
Matrix_Scale(this->unk_260, this->unk_260, this->unk_260, MTXMODE_APPLY);
|
|
|
|
|
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
|
|
|
|
gSPDisplayList(POLY_OPA_DISP++, D_06009638);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (limbIndex == 15) {
|
|
|
|
|
gSPDisplayList(POLY_OPA_DISP++, D_0600A390);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EnDaiku2_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|
|
|
|
EnDaiku2* this = THIS;
|
|
|
|
|
|
|
|
|
|
OPEN_DISPS(globalCtx->state.gfxCtx);
|
|
|
|
|
|
|
|
|
|
func_8012C28C(globalCtx->state.gfxCtx);
|
|
|
|
|
gDPSetEnvColor(POLY_OPA_DISP++, 245, 155, 0, 255);
|
|
|
|
|
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, NULL,
|
|
|
|
|
EnDaiku2_PostLimbDraw, &this->actor);
|
|
|
|
|
func_80BE7718(this, globalCtx);
|
|
|
|
|
|
|
|
|
|
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void func_80BE7504(EnDaiku2* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4, s16 arg5) {
|
|
|
|
|
s16 i;
|
|
|
|
|
EnDaiku2Particle* particle = &this->particles[0];
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(this->particles); i++, particle++) {
|
|
|
|
|
if (!particle->isEnabled) {
|
|
|
|
|
particle->isEnabled = true;
|
|
|
|
|
particle->unk_04 = *arg1;
|
|
|
|
|
particle->unk_10 = *arg2;
|
|
|
|
|
particle->unk_1C = *arg3;
|
|
|
|
|
particle->unk_30 = arg4;
|
|
|
|
|
particle->unk_34 = arg5;
|
|
|
|
|
particle->unk_28.x = randPlusMinusPoint5Scaled(30000.0f);
|
|
|
|
|
particle->unk_28.y = randPlusMinusPoint5Scaled(30000.0f);
|
|
|
|
|
particle->unk_28.z = randPlusMinusPoint5Scaled(30000.0f);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void func_80BE7600(EnDaiku2* this, GlobalContext* globalCtx) {
|
|
|
|
|
s32 i;
|
|
|
|
|
EnDaiku2Particle* particle = &this->particles[0];
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(this->particles); i++, particle++) {
|
|
|
|
|
if (particle->isEnabled) {
|
|
|
|
|
particle->unk_04.x += particle->unk_10.x;
|
|
|
|
|
particle->unk_28.x += 0x100;
|
|
|
|
|
particle->unk_28.z += 0x130;
|
|
|
|
|
particle->unk_04.y += particle->unk_10.y;
|
|
|
|
|
particle->unk_04.z += particle->unk_10.z;
|
|
|
|
|
particle->unk_10.y += particle->unk_1C.y;
|
|
|
|
|
if (particle->unk_34 != 0) {
|
|
|
|
|
particle->unk_34 -= 1;
|
|
|
|
|
} else {
|
|
|
|
|
particle->isEnabled = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void func_80BE7718(EnDaiku2* this, GlobalContext* globalCtx) {
|
|
|
|
|
s32 i;
|
|
|
|
|
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
|
|
|
|
EnDaiku2Particle* particle = &this->particles[0];
|
|
|
|
|
s32 objectIdx;
|
|
|
|
|
|
|
|
|
|
OPEN_DISPS(globalCtx->state.gfxCtx);
|
|
|
|
|
|
|
|
|
|
func_8012C28C(globalCtx->state.gfxCtx);
|
|
|
|
|
|
|
|
|
|
objectIdx = Object_GetIndex(&globalCtx->objectCtx, OBJECT_BOMBIWA);
|
|
|
|
|
if ((objectIdx >= 0) && Object_IsLoaded(&globalCtx->objectCtx, objectIdx)) {
|
|
|
|
|
gDPPipeSync(POLY_OPA_DISP++);
|
|
|
|
|
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[objectIdx].segment);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(this->particles); i++, particle++) {
|
|
|
|
|
if (particle->isEnabled) {
|
|
|
|
|
SysMatrix_StatePush();
|
|
|
|
|
SysMatrix_InsertTranslation(particle->unk_04.x, particle->unk_04.y, particle->unk_04.z, MTXMODE_NEW);
|
|
|
|
|
SysMatrix_InsertXRotation_s(particle->unk_28.x, MTXMODE_APPLY);
|
|
|
|
|
Matrix_RotateY(particle->unk_28.y, MTXMODE_APPLY);
|
|
|
|
|
SysMatrix_InsertZRotation_s(particle->unk_28.z, MTXMODE_APPLY);
|
|
|
|
|
Matrix_Scale(particle->unk_30, particle->unk_30, particle->unk_30, MTXMODE_APPLY);
|
|
|
|
|
|
|
|
|
|
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
|
|
|
|
gSPDisplayList(POLY_OPA_DISP++, D_060009E0);
|
|
|
|
|
|
|
|
|
|
SysMatrix_StatePop();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
|
|
|
|
}
|
|
|
|
|