|
|
|
@@ -5,6 +5,7 @@
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "z_bg_haka_bombwall.h"
|
|
|
|
|
#include "objects/object_haka_obj/object_haka_obj.h"
|
|
|
|
|
|
|
|
|
|
#define FLAGS 0x00000000
|
|
|
|
|
|
|
|
|
@@ -15,7 +16,14 @@ void BgHakaBombwall_Destroy(Actor* thisx, PlayState* play);
|
|
|
|
|
void BgHakaBombwall_Update(Actor* thisx, PlayState* play);
|
|
|
|
|
void BgHakaBombwall_Draw(Actor* thisx, PlayState* play);
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
void func_80BD5E6C(BgHakaBombwall* this, PlayState* play);
|
|
|
|
|
void func_80BD6260(BgHakaBombwall* this);
|
|
|
|
|
void func_80BD6274(BgHakaBombwall* this, PlayState* play);
|
|
|
|
|
void BgHakaBombwall_SetupPlayCutscene(BgHakaBombwall* this);
|
|
|
|
|
void BgHakaBombwall_PlayCutscene(BgHakaBombwall* this, PlayState* play);
|
|
|
|
|
void BgHakaBombwall_SetupEndCutscene(BgHakaBombwall* this);
|
|
|
|
|
void BgHakaBombwall_EndCutscene(BgHakaBombwall* this, PlayState* play);
|
|
|
|
|
|
|
|
|
|
const ActorInit Bg_Haka_Bombwall_InitVars = {
|
|
|
|
|
ACTOR_BG_HAKA_BOMBWALL,
|
|
|
|
|
ACTORCAT_BG,
|
|
|
|
@@ -28,50 +36,191 @@ const ActorInit Bg_Haka_Bombwall_InitVars = {
|
|
|
|
|
(ActorFunc)BgHakaBombwall_Draw,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// static ColliderCylinderInit sCylinderInit = {
|
|
|
|
|
static ColliderCylinderInit D_80BD64A0 = {
|
|
|
|
|
{ COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_NONE, COLSHAPE_CYLINDER, },
|
|
|
|
|
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
|
|
|
|
|
static ColliderCylinderInit sCylinderInit = {
|
|
|
|
|
{
|
|
|
|
|
COLTYPE_NONE,
|
|
|
|
|
AT_NONE,
|
|
|
|
|
AC_ON | AC_TYPE_PLAYER,
|
|
|
|
|
OC1_NONE,
|
|
|
|
|
OC2_NONE,
|
|
|
|
|
COLSHAPE_CYLINDER,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
ELEMTYPE_UNK0,
|
|
|
|
|
{ 0x00000000, 0x00, 0x00 },
|
|
|
|
|
{ 0x00000008, 0x00, 0x00 },
|
|
|
|
|
TOUCH_NONE | TOUCH_SFX_NORMAL,
|
|
|
|
|
BUMP_ON,
|
|
|
|
|
OCELEM_NONE,
|
|
|
|
|
},
|
|
|
|
|
{ 80, 80, 0, { 0, 0, 0 } },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// static InitChainEntry sInitChain[] = {
|
|
|
|
|
static InitChainEntry D_80BD64D4[] = {
|
|
|
|
|
static s16 D_80BD64CC[4] = { 24, 15, 10, 5 };
|
|
|
|
|
|
|
|
|
|
static InitChainEntry sInitChain[] = {
|
|
|
|
|
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
|
|
|
|
|
ICHAIN_F32(uncullZoneScale, 500, ICHAIN_CONTINUE),
|
|
|
|
|
ICHAIN_F32(uncullZoneDownward, 500, ICHAIN_CONTINUE),
|
|
|
|
|
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
s32 func_80BD5E00(BgHakaBombwall* this) {
|
|
|
|
|
if (this->collider.base.acFlags & AC_HIT) {
|
|
|
|
|
if ((this->collider.base.ac != NULL) &&
|
|
|
|
|
(Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &this->collider.base.ac->world.pos) < SQ(80.0f))) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef NON_MATCHING
|
|
|
|
|
void func_80BD5E6C(BgHakaBombwall* this, PlayState* play) {
|
|
|
|
|
s32 i;
|
|
|
|
|
Vec3f spE0;
|
|
|
|
|
Vec3f spD4;
|
|
|
|
|
Vec3f spC8;
|
|
|
|
|
Vec3f spBC;
|
|
|
|
|
f32 temp_fs0;
|
|
|
|
|
f32 phi_fs1;
|
|
|
|
|
s16 phi_s0;
|
|
|
|
|
s16 gravity;
|
|
|
|
|
s16 phi_t0;
|
|
|
|
|
|
|
|
|
|
Matrix_Push();
|
|
|
|
|
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
|
|
|
|
temp_fs0 = 0.0f;
|
|
|
|
|
phi_fs1 = 0.0f;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 30; i++) {
|
|
|
|
|
temp_fs0 += 60.0f + (Rand_ZeroOne() * 20.0f);
|
|
|
|
|
if (temp_fs0 > 75.0f) {
|
|
|
|
|
temp_fs0 -= 150.0f;
|
|
|
|
|
}
|
|
|
|
|
spC8.x = temp_fs0;
|
|
|
|
|
|
|
|
|
|
phi_fs1 += 5;
|
|
|
|
|
spC8.y = phi_fs1;
|
|
|
|
|
|
|
|
|
|
spC8.z = (Rand_ZeroOne() * 20.0f) - 10.0f;
|
|
|
|
|
|
|
|
|
|
spBC.x = ((Rand_ZeroOne() - 0.5f) * 5.0f) + (temp_fs0 * (4.0f / 75.0f));
|
|
|
|
|
spBC.y = (Rand_ZeroOne() * 7.0f) - 2.0f;
|
|
|
|
|
spBC.z = (Rand_ZeroOne() * 4.0f) - 2.0f;
|
|
|
|
|
|
|
|
|
|
Matrix_MultVec3f(&spC8, &spE0);
|
|
|
|
|
Matrix_MultVec3f(&spBC, &spD4);
|
|
|
|
|
|
|
|
|
|
spE0.x += this->dyna.actor.world.pos.x;
|
|
|
|
|
spE0.y += this->dyna.actor.world.pos.y;
|
|
|
|
|
spE0.z += this->dyna.actor.world.pos.z;
|
|
|
|
|
|
|
|
|
|
if ((i & 3) == 0) {
|
|
|
|
|
phi_s0 = 32;
|
|
|
|
|
func_800BBFB0(play, &spE0, 60.0f, 2, 100, 120, 1);
|
|
|
|
|
} else {
|
|
|
|
|
phi_s0 = 64;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i % 2 != 0) {
|
|
|
|
|
phi_s0 |= 1;
|
|
|
|
|
phi_t0 = 1;
|
|
|
|
|
} else {
|
|
|
|
|
phi_t0 = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (D_80BD64CC[i & 3] >= 16) {
|
|
|
|
|
gravity = -550;
|
|
|
|
|
} else {
|
|
|
|
|
gravity = -450;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EffectSsKakera_Spawn(play, &spE0, &spD4, &spE0, gravity, phi_s0, 30, 0, 0, D_80BD64CC[i & 3], phi_t0, 0, 50, -1,
|
|
|
|
|
OBJECT_IKANA_OBJ, object_haka_obj_DL_001680);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Matrix_Pop();
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/func_80BD5E6C.s")
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
extern ColliderCylinderInit D_80BD64A0;
|
|
|
|
|
extern InitChainEntry D_80BD64D4[];
|
|
|
|
|
void BgHakaBombwall_Init(Actor* thisx, PlayState* play) {
|
|
|
|
|
s32 pad;
|
|
|
|
|
BgHakaBombwall* this = THIS;
|
|
|
|
|
|
|
|
|
|
extern UNK_TYPE D_06000040;
|
|
|
|
|
extern UNK_TYPE D_06000148;
|
|
|
|
|
extern UNK_TYPE D_06001680;
|
|
|
|
|
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
|
|
|
|
DynaPolyActor_Init(&this->dyna, 0);
|
|
|
|
|
Collider_InitCylinder(play, &this->collider);
|
|
|
|
|
if (Flags_GetSwitch(play, BGHAKABOMBWALL_GET_7F(thisx))) {
|
|
|
|
|
Actor_MarkForDeath(&this->dyna.actor);
|
|
|
|
|
} else {
|
|
|
|
|
DynaPolyActor_LoadMesh(play, &this->dyna, &object_haka_obj_Colheader_000148);
|
|
|
|
|
Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit);
|
|
|
|
|
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
|
|
|
|
|
func_80BD6260(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/func_80BD5E00.s")
|
|
|
|
|
void BgHakaBombwall_Destroy(Actor* thisx, PlayState* play) {
|
|
|
|
|
BgHakaBombwall* this = THIS;
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/func_80BD5E6C.s")
|
|
|
|
|
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
|
|
|
|
|
Collider_DestroyCylinder(play, &this->collider);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/BgHakaBombwall_Init.s")
|
|
|
|
|
void func_80BD6260(BgHakaBombwall* this) {
|
|
|
|
|
this->actionFunc = func_80BD6274;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/BgHakaBombwall_Destroy.s")
|
|
|
|
|
void func_80BD6274(BgHakaBombwall* this, PlayState* play) {
|
|
|
|
|
if (func_80BD5E00(this)) {
|
|
|
|
|
BgHakaBombwall_SetupPlayCutscene(this);
|
|
|
|
|
} else {
|
|
|
|
|
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/func_80BD6260.s")
|
|
|
|
|
void BgHakaBombwall_SetupPlayCutscene(BgHakaBombwall* this) {
|
|
|
|
|
this->dyna.actor.flags |= ACTOR_FLAG_10;
|
|
|
|
|
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
|
|
|
|
|
this->actionFunc = BgHakaBombwall_PlayCutscene;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/func_80BD6274.s")
|
|
|
|
|
void BgHakaBombwall_PlayCutscene(BgHakaBombwall* this, PlayState* play) {
|
|
|
|
|
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
|
|
|
|
|
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
|
|
|
|
|
func_80BD5E6C(this, play);
|
|
|
|
|
this->dyna.actor.draw = NULL;
|
|
|
|
|
Flags_SetSwitch(play, BGHAKABOMBWALL_GET_7F(&this->dyna.actor));
|
|
|
|
|
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 0x3C, NA_SE_EV_WALL_BROKEN);
|
|
|
|
|
func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId);
|
|
|
|
|
BgHakaBombwall_SetupEndCutscene(this);
|
|
|
|
|
} else {
|
|
|
|
|
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/func_80BD62D0.s")
|
|
|
|
|
void BgHakaBombwall_SetupEndCutscene(BgHakaBombwall* this) {
|
|
|
|
|
this->csTimer = 30;
|
|
|
|
|
this->actionFunc = BgHakaBombwall_EndCutscene;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/func_80BD6314.s")
|
|
|
|
|
void BgHakaBombwall_EndCutscene(BgHakaBombwall* this, PlayState* play) {
|
|
|
|
|
this->csTimer--;
|
|
|
|
|
if (this->csTimer <= 0) {
|
|
|
|
|
ActorCutscene_Stop(this->dyna.actor.cutscene);
|
|
|
|
|
Actor_MarkForDeath(&this->dyna.actor);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/func_80BD63B4.s")
|
|
|
|
|
void BgHakaBombwall_Update(Actor* thisx, PlayState* play) {
|
|
|
|
|
BgHakaBombwall* this = THIS;
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/func_80BD63D0.s")
|
|
|
|
|
this->actionFunc(this, play);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/BgHakaBombwall_Update.s")
|
|
|
|
|
|
|
|
|
|
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Haka_Bombwall/BgHakaBombwall_Draw.s")
|
|
|
|
|
void BgHakaBombwall_Draw(Actor* thisx, PlayState* play) {
|
|
|
|
|
Gfx_DrawDListOpa(play, object_haka_obj_DL_000040);
|
|
|
|
|
}
|
|
|
|
|