Obj_Hakaisi (#655)

* Obj_Hakaisi

* Fix

* PR
This commit is contained in:
Maide 2022-03-05 14:10:55 +00:00 committed by GitHub
parent f4a9d117b1
commit 888448decf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 418 additions and 60 deletions

View File

@ -10,6 +10,6 @@
<DList Name="object_hakaisi_DL_002650" Offset="0x2650" />
<DList Name="object_hakaisi_DL_0029C0" Offset="0x29C0" />
<DList Name="object_hakaisi_DL_002CC0" Offset="0x2CC0" />
<!-- <Blob Name="object_hakaisi_Blob_002DD8" Size="0x218" Offset="0x2DD8" /> -->
<Collision Name="object_hakaisi_Colheader_002FC4" Offset="0x2FC4" />
</File>
</Root>

3
spec
View File

@ -3879,8 +3879,7 @@ beginseg
name "ovl_Obj_Hakaisi"
compress
include "build/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.o"
include "build/data/ovl_Obj_Hakaisi/ovl_Obj_Hakaisi.data.o"
include "build/data/ovl_Obj_Hakaisi/ovl_Obj_Hakaisi.reloc.o"
include "build/src/overlays/actors/ovl_Obj_Hakaisi/ovl_Obj_Hakaisi_reloc.o"
endseg
beginseg

View File

@ -564,8 +564,8 @@ void func_80B71910(EnRailSkb* this) {
}
void func_80B71954(EnRailSkb* this, GlobalContext* globalCtx) {
s16 sp36 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C->actor.world.pos);
f32 sp30 = Math_Vec3f_DistXZ(&this->actor.world.pos, &this->unk_22C->actor.world.pos);
s16 sp36 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C->dyna.actor.world.pos);
f32 sp30 = Math_Vec3f_DistXZ(&this->actor.world.pos, &this->unk_22C->dyna.actor.world.pos);
Math_SmoothStepToS(&this->actor.shape.rot.y, sp36, 1, 0x71C, 0xB6);
this->actor.world.rot = this->actor.shape.rot;
@ -582,24 +582,24 @@ void func_80B71A08(EnRailSkb* this) {
}
void func_80B71A58(EnRailSkb* this, GlobalContext* globalCtx) {
s16 sp36 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C->actor.world.pos);
s16 sp36 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C->dyna.actor.world.pos);
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
if (this->unk_2E8 < this->unk_22C->actor.colChkInfo.health) {
this->unk_22C->actor.colChkInfo.health--;
if (this->unk_2E8 < this->unk_22C->dyna.actor.colChkInfo.health) {
this->unk_22C->dyna.actor.colChkInfo.health--;
} else {
this->unk_22C->actor.colChkInfo.health--;
this->unk_22C->dyna.actor.colChkInfo.health--;
func_80B71B6C(this);
}
}
if (Animation_OnFrame(&this->skelAnime, 3.0f)) {
if (this->unk_2E8 < this->unk_22C->actor.colChkInfo.health) {
this->unk_22C->actor.colChkInfo.health--;
if (this->unk_2E8 < this->unk_22C->dyna.actor.colChkInfo.health) {
this->unk_22C->dyna.actor.colChkInfo.health--;
} else {
this->unk_22C->actor.colChkInfo.health--;
this->unk_22C->dyna.actor.colChkInfo.health--;
func_80B71B6C(this);
}
}
@ -616,7 +616,7 @@ void func_80B71B6C(EnRailSkb* this) {
void func_80B71BB8(EnRailSkb* this, GlobalContext* globalCtx) {
s32 pad;
s32 i;
f32 sp34 = Math_Vec3f_DistXZ(&this->actor.world.pos, &this->unk_22C->actor.world.pos);
f32 sp34 = Math_Vec3f_DistXZ(&this->actor.world.pos, &this->unk_22C->dyna.actor.world.pos);
if (this->unk_3F2 > 0) {
this->unk_3F2--;
@ -624,15 +624,15 @@ void func_80B71BB8(EnRailSkb* this, GlobalContext* globalCtx) {
}
Math_SmoothStepToS(&this->actor.shape.rot.y,
Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C->actor.world.pos), 1, 0x71C, 0xB6);
Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C->dyna.actor.world.pos), 1, 0x71C, 0xB6);
if ((this->actor.bgCheckFlags & 1) && (this->unk_22C->actor.colChkInfo.health == 0)) {
if ((this->actor.bgCheckFlags & 1) && (this->unk_22C->dyna.actor.colChkInfo.health == 0)) {
Actor_MoveWithGravity(&this->actor);
} else {
this->actor.velocity.y += this->actor.gravity;
this->actor.world.pos.y += this->actor.velocity.y;
Math_SmoothStepToF(&this->actor.world.pos.x, this->unk_22C->actor.world.pos.x, 0.6f, 1.6f, 0.1f);
Math_SmoothStepToF(&this->actor.world.pos.z, this->unk_22C->actor.world.pos.z, 0.6f, 1.6f, 0.1f);
Math_SmoothStepToF(&this->actor.world.pos.x, this->unk_22C->dyna.actor.world.pos.x, 0.6f, 1.6f, 0.1f);
Math_SmoothStepToF(&this->actor.world.pos.z, this->unk_22C->dyna.actor.world.pos.z, 0.6f, 1.6f, 0.1f);
}
if (this->actor.bgCheckFlags & 2) {

View File

@ -5,6 +5,7 @@
*/
#include "z_obj_hakaisi.h"
#include "objects/object_hakaisi/object_hakaisi.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_20)
@ -15,7 +16,27 @@ void ObjHakaisi_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjHakaisi_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjHakaisi_Draw(Actor* thisx, GlobalContext* globalCtx);
#if 0
void func_80B1444C(ObjHakaisi* this);
void func_80B14460(ObjHakaisi* this, GlobalContext* globalCtx);
void func_80B14510(ObjHakaisi* this);
void func_80B14524(ObjHakaisi* this, GlobalContext* globalCtx);
void func_80B14558(ObjHakaisi* this);
void func_80B1456C(ObjHakaisi* this, GlobalContext* globalCtx);
void func_80B145F4(ObjHakaisi* this);
void func_80B14648(ObjHakaisi* this, GlobalContext* globalCtx);
void func_80B149A8(ObjHakaisi* this);
void func_80B149C0(ObjHakaisi* this, GlobalContext* globalCtx);
void func_80B14A24(ObjHakaisi* this, GlobalContext* globalCtx, Vec3f vec);
void func_80B14B6C(ObjHakaisi* this, GlobalContext* globalCtx, Vec3f vec, s16 arg3);
void func_80B14CF8(GlobalContext* globalCtx, Vec3f vec, s16 arg2, s16 arg3, s32 arg4);
void func_80B14F4C(ObjHakaisi* this, GlobalContext* globalCtx, s32 arg2);
void func_80B151E0(ObjHakaisi* this, GlobalContext* globalCtx);
void func_80B15254(Actor* thisx, GlobalContext* globalCtx);
void func_80B15264(ObjHakaisi* this);
void func_80B15330(ObjHakaisi* this, GlobalContext* globalCtx);
void func_80B1544C(Actor* thisx, GlobalContext* globalCtx);
void func_80B154A0(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Obj_Hakaisi_InitVars = {
ACTOR_OBJ_HAKAISI,
ACTORCAT_PROP,
@ -28,57 +49,395 @@ const ActorInit Obj_Hakaisi_InitVars = {
(ActorFunc)ObjHakaisi_Draw,
};
#endif
Vec3f D_80B155B0 = { 0.0f, 25.0f, 30.0f };
extern UNK_TYPE D_06001F10;
extern UNK_TYPE D_060021B0;
extern UNK_TYPE D_06002650;
extern UNK_TYPE D_06002FC4;
Vec3f D_80B155BC[] = { { 0.0f, 65.0f, 8.0f }, { 0.0f, 35.0f, 8.0f }, { 0.0f, 15.0f, 8.0f } };
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/ObjHakaisi_Init.s")
Vec3f D_80B155E0 = { 0.0f, 0.0f, 0.0f };
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/ObjHakaisi_Destroy.s")
Vec3f D_80B155EC = { 0.0f, 0.0f, 0.0f };
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B1444C.s")
Color_RGBA8 D_80B155F8 = { 170, 130, 90, 255 };
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B14460.s")
Color_RGBA8 D_80B155FC = { 100, 60, 20, 0 };
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B14510.s")
Vec3f D_80B15600 = { 1.0f, 0.0f, 0.0f };
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B14524.s")
void ObjHakaisi_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
ObjHakaisi* this = THIS;
CollisionHeader* sp7C = NULL;
MtxF sp3C;
s32 i;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B14558.s")
switch (OBJHAKAISI_GET_FF(&this->dyna.actor)) {
case 0:
this->dyna.actor.textId = 0x13F9;
break;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B1456C.s")
case 1:
this->dyna.actor.textId = 0x13FA;
break;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B145F4.s")
case 2:
this->dyna.actor.textId = 0x13FB;
break;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B14648.s")
case 3:
this->dyna.actor.textId = 0x13FC;
break;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B149A8.s")
case 4:
case 5:
func_80B151E0(this, globalCtx);
return;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B149C0.s")
default:
this->dyna.actor.textId = 0x1412;
break;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B14A24.s")
Actor_SetScale(&this->dyna.actor, 1.0f);
this->dyna.actor.targetMode = 0;
this->dyna.actor.colChkInfo.health = 30;
if (OBJHAKAISI_GET_FF(&this->dyna.actor) == 3) {
this->dyna.actor.draw = NULL;
func_80B1444C(this);
return;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B14B6C.s")
DynaPolyActor_Init(&this->dyna, 1);
CollisionHeader_GetVirtual(&object_hakaisi_Colheader_002FC4, &sp7C);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B14CF8.s")
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, sp7C);
this->unk_19A = 0;
this->unk_198 = 0;
this->switchFlag = OBJHAKAISI_GET_SWITCHFLAG(thisx);
this->unk_196 = this->dyna.actor.cutscene;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B14F4C.s")
if (this->switchFlag == 0xFF) {
this->switchFlag = -1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/ObjHakaisi_Update.s")
if ((this->switchFlag != -1) && Flags_GetSwitch(globalCtx, this->switchFlag)) {
Actor_MarkForDeath(&this->dyna.actor);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/ObjHakaisi_Draw.s")
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B151E0.s")
if (this->dyna.actor.floorPoly == NULL) {
Actor_MarkForDeath(&this->dyna.actor);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B15254.s")
func_800C0094(this->dyna.actor.floorPoly, this->dyna.actor.world.pos.x, this->dyna.actor.floorHeight,
this->dyna.actor.world.pos.z, &sp3C);
Matrix_SetCurrentState(&sp3C);
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY);
Matrix_CopyCurrentState(&sp3C);
func_8018219C(&sp3C, &this->dyna.actor.shape.rot, 1);
this->dyna.actor.world.rot = this->dyna.actor.shape.rot;
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY);
Matrix_MultiplyVector3fByState(&D_80B155B0, &this->dyna.actor.focus.pos);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B15264.s")
for (i = 0; i < ARRAY_COUNT(D_80B155BC); i++) {
Matrix_MultiplyVector3fByState(&D_80B155BC[i], &this->unk_160[i]);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B15330.s")
func_80B1444C(this);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B1544C.s")
void ObjHakaisi_Destroy(Actor* thisx, GlobalContext* globalCtx) {
ObjHakaisi* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hakaisi/func_80B154A0.s")
if (OBJHAKAISI_GET_FF(&this->dyna.actor) != 3) {
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
}
}
void func_80B1444C(ObjHakaisi* this) {
this->actionFunc = func_80B14460;
}
void func_80B14460(ObjHakaisi* this, GlobalContext* globalCtx) {
s16 sp26 = BINANG_SUB(this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer);
if (Actor_ProcessTalkRequest(&this->dyna.actor, &globalCtx->state)) {
func_80B14510(this);
} else if (this->dyna.actor.textId != 0) {
if (ABS_ALT(sp26) < 0x2000) {
func_800B8614(&this->dyna.actor, globalCtx, 100.0f);
}
}
if (this->unk_198 == 1) {
func_80B14558(this);
}
}
void func_80B14510(ObjHakaisi* this) {
this->actionFunc = func_80B14524;
}
void func_80B14524(ObjHakaisi* this, GlobalContext* globalCtx) {
if (Actor_TextboxIsClosing(&this->dyna.actor, globalCtx)) {
func_80B1444C(this);
}
}
void func_80B14558(ObjHakaisi* this) {
this->actionFunc = func_80B1456C;
}
void func_80B1456C(ObjHakaisi* this, GlobalContext* globalCtx) {
if (this->unk_196 != -1) {
if (ActorCutscene_GetCanPlayNext(this->unk_196)) {
ActorCutscene_StartAndSetUnkLinkFields(this->unk_196, &this->dyna.actor);
} else {
ActorCutscene_SetIntentToPlay(this->unk_196);
}
}
if (this->dyna.actor.colChkInfo.health < 30) {
func_80B145F4(this);
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
}
}
void func_80B145F4(ObjHakaisi* this) {
this->unk_19A = 0;
this->dyna.actor.flags |= ACTOR_FLAG_8000000;
this->dyna.actor.flags &= ~ACTOR_FLAG_1;
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WALL_BROKEN);
this->actionFunc = func_80B14648;
}
void func_80B14648(ObjHakaisi* this, GlobalContext* globalCtx) {
if (this->unk_19A < 2) {
func_80B14CF8(globalCtx, this->unk_160[this->unk_194], 100, 30, 5);
}
this->unk_19A++;
if (this->dyna.actor.colChkInfo.health == 0) {
func_80B14A24(this, globalCtx, this->unk_160[this->unk_194]);
func_80B14A24(this, globalCtx, this->unk_160[this->unk_194]);
func_80B14B6C(this, globalCtx, this->unk_160[this->unk_194], 70);
Flags_SetSwitch(globalCtx, this->switchFlag);
this->dyna.actor.draw = NULL;
func_80B149A8(this);
}
if (this->unk_19E != this->dyna.actor.colChkInfo.health) {
if ((this->unk_19E > 20) && (this->dyna.actor.colChkInfo.health <= 20)) {
func_80B14A24(this, globalCtx, this->unk_160[this->unk_194]);
func_80B14A24(this, globalCtx, this->unk_160[this->unk_194]);
func_80B14F4C(this, globalCtx, 0);
func_80B14B6C(this, globalCtx, this->unk_160[this->unk_194], 40);
this->unk_194 = 1;
} else if ((this->unk_19E > 10) && (this->dyna.actor.colChkInfo.health <= 10)) {
func_80B14A24(this, globalCtx, this->unk_160[this->unk_194]);
func_80B14A24(this, globalCtx, this->unk_160[this->unk_194]);
func_80B14B6C(this, globalCtx, this->unk_160[this->unk_194], 60);
this->unk_194 = 2;
}
this->unk_19A = 0;
this->dyna.actor.shape.yOffset -= 3.0f;
}
Math_ApproachZeroF(&this->dyna.actor.shape.yOffset, 0.8f, 100.0f);
this->unk_19E = this->dyna.actor.colChkInfo.health;
}
void func_80B149A8(ObjHakaisi* this) {
this->unk_19A = 0;
this->actionFunc = func_80B149C0;
}
void func_80B149C0(ObjHakaisi* this, GlobalContext* globalCtx) {
if (this->unk_19A < 60) {
this->unk_19A++;
} else if ((this->unk_196 != -1) && !ActorCutscene_GetCanPlayNext(this->unk_196)) {
ActorCutscene_Stop(this->unk_196);
}
}
void func_80B14A24(ObjHakaisi* this, GlobalContext* globalCtx, Vec3f vec) {
s32 i;
func_80B14CF8(globalCtx, vec, 100, 30, 5);
for (i = 0; i < 5; i++) {
vec.x += Rand_Centered() * 20.0f;
vec.y += Rand_ZeroOne() * 5.0f;
vec.z += Rand_Centered() * 20.0f;
EffectSsHahen_SpawnBurst(globalCtx, &vec, 5.0f, 0, 20, 15, 3, OBJECT_HAKAISI, 10, object_hakaisi_DL_0021B0);
}
}
void func_80B14B6C(ObjHakaisi* this, GlobalContext* globalCtx, Vec3f vec, s16 arg3) {
s32 i;
s16 temp_s1;
Vec3f sp6C;
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WALL_BROKEN);
for (i = 0; i < 5; i++) {
temp_s1 = Rand_Next();
sp6C.x = (Math_SinS(temp_s1) * 15.0f) + vec.x;
sp6C.y = (Rand_ZeroOne() * 3.0f) + vec.y;
sp6C.z = (Math_CosS(temp_s1) * 15.0f) + vec.z;
EffectSsHahen_SpawnBurst(globalCtx, &sp6C, 10.0f, 0, arg3, 30, 2, OBJECT_HAKAISI, 15, object_hakaisi_DL_0021B0);
}
func_80B14CF8(globalCtx, vec, 100, 50, 20);
}
void func_80B14CF8(GlobalContext* globalCtx, Vec3f vec, s16 arg2, s16 arg3, s32 arg4) {
s32 i;
s16 temp_s0;
Vec3f spAC;
Vec3f spA0 = D_80B155E0;
Vec3f sp94 = D_80B155EC;
f32 temp_f20;
f32 temp_f22;
for (i = 0; i < arg4; i++) {
temp_f20 = Rand_ZeroOne() * 30.0f;
temp_f22 = Rand_ZeroOne() * 1.5f;
temp_s0 = Rand_Next();
spAC.x = (Math_SinS(temp_s0) * temp_f20) + vec.x;
spAC.y = (Rand_Centered() * 4.0f) + vec.y;
spAC.z = (Math_CosS(temp_s0) * temp_f20) + vec.z;
spA0.x += temp_f22 * Math_SinS(temp_s0);
spA0.y += Rand_Centered() + 0.5f;
spA0.z += temp_f22 * Math_CosS(temp_s0);
sp94.x = -0.1f * spA0.x;
sp94.y = -0.1f * spA0.y;
sp94.z = -0.1f * spA0.z;
func_800B0EB0(globalCtx, &spAC, &spA0, &sp94, &D_80B155F8, &D_80B155FC, arg2, arg3, 10);
}
}
void func_80B14F4C(ObjHakaisi* this, GlobalContext* globalCtx, s32 arg2) {
if (arg2 == 0) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OBJ_HAKAISI, this->dyna.actor.world.pos.x,
this->dyna.actor.world.pos.y + 55.0f, this->dyna.actor.world.pos.z - 10.0f,
this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 4);
} else {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OBJ_HAKAISI, this->dyna.actor.world.pos.x + 20.0f,
this->dyna.actor.world.pos.y + 30.0f, this->dyna.actor.world.pos.z - 10.0f,
this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 5);
}
}
void ObjHakaisi_Update(Actor* thisx, GlobalContext* globalCtx) {
ObjHakaisi* this = THIS;
this->actionFunc(this, globalCtx);
}
void ObjHakaisi_Draw(Actor* thisx, GlobalContext* globalCtx) {
ObjHakaisi* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
if (this->unk_194 == 0) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, object_hakaisi_DL_002650);
} else if (this->unk_194 == 1) {
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, object_hakaisi_DL_0029C0);
} else {
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, object_hakaisi_DL_002CC0);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
void func_80B151E0(ObjHakaisi* this, GlobalContext* globalCtx) {
this->dyna.actor.update = func_80B1544C;
this->dyna.actor.draw = func_80B154A0;
this->dyna.actor.destroy = func_80B15254;
Actor_SetScale(&this->dyna.actor, 0.1f);
this->dyna.actor.shape.yOffset = 100.0f;
this->dyna.actor.flags &= ~ACTOR_FLAG_1;
func_80B15264(this);
}
void func_80B15254(Actor* thisx, GlobalContext* globalCtx) {
}
void func_80B15264(ObjHakaisi* this) {
s32 pad;
s16 sp32 = Rand_Next();
Matrix_InsertRotation(Rand_Next(), Rand_Next(), Rand_Next(), MTXMODE_NEW);
Matrix_MultiplyVector3fByState(&D_80B15600, &this->unk_184);
this->dyna.actor.gravity = -1.0f;
this->unk_19C = Rand_Next() >> 0x12;
this->dyna.actor.velocity.x = Math_SinS(sp32) * 4.0f;
this->dyna.actor.velocity.z = Math_CosS(sp32) * 4.0f;
this->dyna.actor.velocity.y = 7.0f;
this->actionFunc = func_80B15330;
}
void func_80B15330(ObjHakaisi* this, GlobalContext* globalCtx) {
s32 pad;
MtxF sp34;
this->dyna.actor.velocity.y += this->dyna.actor.gravity;
Actor_UpdatePos(&this->dyna.actor);
if (this->dyna.actor.bgCheckFlags & 2) {
func_80B14B6C(this, globalCtx, this->dyna.actor.world.pos, 40);
func_80B14CF8(globalCtx, this->dyna.actor.world.pos, 100, 30, 10);
Actor_MarkForDeath(&this->dyna.actor);
}
Matrix_InsertRotationAroundUnitVector_s(this->unk_19C, &this->unk_184, MTXMODE_NEW);
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
Matrix_InsertXRotation_s(this->dyna.actor.shape.rot.x, MTXMODE_APPLY);
Matrix_InsertZRotation_s(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
Matrix_CopyCurrentState(&sp34);
func_8018219C(&sp34, &this->dyna.actor.shape.rot, 0);
}
void func_80B1544C(Actor* thisx, GlobalContext* globalCtx) {
ObjHakaisi* this = THIS;
this->actionFunc(this, globalCtx);
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4);
}
void func_80B154A0(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
if (OBJHAKAISI_GET_FF(thisx) == 4) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, object_hakaisi_DL_001F10);
} else {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, object_hakaisi_DL_0021B0);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}

View File

@ -7,13 +7,21 @@ struct ObjHakaisi;
typedef void (*ObjHakaisiActionFunc)(struct ObjHakaisi*, GlobalContext*);
#define OBJHAKAISI_GET_FF(thisx) ((thisx)->params & 0xFF)
#define OBJHAKAISI_GET_SWITCHFLAG(thisx) (((thisx)->params & 0xFF00) >> 8)
typedef struct ObjHakaisi {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x18];
/* 0x0000 */ DynaPolyActor dyna;
/* 0x015C */ ObjHakaisiActionFunc actionFunc;
/* 0x0160 */ char unk_160[0x38];
/* 0x0160 */ Vec3f unk_160[3];
/* 0x0184 */ Vec3f unk_184;
/* 0x0190 */ s32 switchFlag;
/* 0x0194 */ s16 unk_194;
/* 0x0196 */ s16 unk_196;
/* 0x0198 */ s16 unk_198;
/* 0x019A */ char unk_19A[0x6];
/* 0x019A */ s16 unk_19A;
/* 0x019C */ s16 unk_19C;
/* 0x019E */ u8 unk_19E;
} ObjHakaisi; // size = 0x1A0
extern const ActorInit Obj_Hakaisi_InitVars;

View File

@ -1323,6 +1323,7 @@ D_06003DC8 = 0x06003DC8;
// ovl_En_Fishing
D_060029C0 = 0x060029C0;
D_0600007C = 0x0600007C;
D_0600CFE0 = 0x0600CFE0;
D_06011058 = 0x06011058;
@ -1991,15 +1992,6 @@ D_06001AA8 = 0x06001AA8;
D_06000158 = 0x06000158;
D_06001C00 = 0x06001C00;
// ovl_Obj_Hakaisi
D_06001F10 = 0x06001F10;
D_060021B0 = 0x060021B0;
D_06002650 = 0x06002650;
D_060029C0 = 0x060029C0;
D_06002CC0 = 0x06002CC0;
D_06002FC4 = 0x06002FC4;
// ovl_Obj_Hariko
D_06000080 = 0x06000080;