Merge z_bg_kin2 bombwall (#840)

* test commit

* undoing test commit

* making sure this is the right repo

* removing test file

* init for OSH bombable wall started. put back Actor* in function declarations.

* BgKin2Bombwall_Init is matching.

* started z_bg_kin2_bombwall destroy function. One mismatch right now.

* BgKin2Bombwall_Destroy matches.

* BgKin2Bombwall_Draw matches.

* Fixed BgKin2Bombwall_Init

* BgKin2Bombwall_Init and BgKin2Bombwall_Destroy both match. Fixed s32 array in struct.

* BgKin2Bombwall_Draw and BgKin2Bombwall_Update match.

* Only func_80B6E020 and func_80B6E090 left to match in ovl_Bg_Kin2_Bombwall.

* func_80B6E020 from ovl_Bg_Kin2_Bombwall matches.

* Went from 8925 to about 5-6k diff score for func_80B6E090 in ovl_Bg_Kin2_Bombwall

* Took func_80B6E090 from about 5300 diff score to about 4300 diff score in ovl_Bg_Kin2_Bombwall.

* Diff score for ovl_Bg_Kin2_Bombwall func_80B6E090 went from 4k ish to 3277

* Diff score for ovl_Bg_Kin2_Bombwall func_80B6E090 went from 3277 to 2262.

* Diff score for ovl_Bg_Kin2_Bombwall func_80B6E090 went from 2262 to 1589.

* only slight progress on ovl_Bg_Kinw_Bombwall's func_80B6E090

* Got to 1473 diff score on ovl_Bg_Kinw_Bombwall's func_80B6E090

* Put in the changes made by EllipticEllipsis and hensldm for ovl_Bg_Kin2_Bombwall's func_8066E090.

* renamed some symbols. Fake symbol removal makes nonzero diff, but rom OK's after make.

* moving declarations around, ordering.

* One.word.away. from importing data in ovl_Bg_Kin2_Bombwall.

* ovl_Bg_Kin2_Bombwall data imported. Matching.

* Edited spec for reloc of ovl_Bg_Kin2_Bombwall.

* Removed extra comments for ovl_Bg_Kin2_Bombwall.

* unpushed stuff. dunno.

* forgot to save z_bg_kin2_bombwall.c

* need to commit before make-ing in master.

* Ported z_bg_kin2_bombwall's code. Data next.

* Imported data for merging z_bg_kin2_bombwall. Yes, I yelled when it OK'd.

* Added comments to remember what does what in z_bg_kin2_bombwall.

* Some comments in z_bg_kin2_bombwall.c and function names ideas.

* Added comments for function name ideas. Cleaned up temps in z_bg_kin2_bombwall except in func_80B6E090.

* Renamed most functions and some variables in z_bg_kin2_bombwall.

* Made a name suggestion for func_80B6E020 after testing in game.

* Ran format.sh.

* Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c

1 and 0 replaced by true and false in func_80B6E020.

Co-authored-by: Isghj <42048411+isghj5@users.noreply.github.com>

* Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c

Bending to the x-- supremacy.

Co-authored-by: Isghj <42048411+isghj5@users.noreply.github.com>

* PR fixes (not done yet) including more consistent use of THIS, removing arg0 and arg1 variable names, standardizing params for z_bg_kin2_bombwall, turning some if-return to if-else, removing unnecessary casts.

* Applied isghj5's and EllipticEllipsis' suggestions except for the object file in z_bg_kin2_bombwall. Object file next.

* Screwd up formatting.

* Thinking of playing with object_kin2_obj.

* Documented most of object_kin2_obj based on bombwall, fence and shelf actors.

* Had forgotten an arg1 in z_bg_kin2_bombwall.c

* Replaced a float by its fractional representation. I need to learn float magic.

* Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

* Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.h

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

* Applied more formatting and naming remarks from PR about the C file. Assets and object stuff next.

* Display lists and collision header in z_bg_kin2_bombwall.c renamed after their descriptive names in the object's XML file. Name for Ocean Spider House drawers chests left to change.

* Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* One extra line in an if, collision naming convention applied and renamed Ocean Spider House nightstands to drawers chests.

* Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Changed drawers chest to chest of drawers in object_kin2_obj and z_bg_kin2_shelf.

* Removed some unnecessary comment.

* Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

* Fixed BgKin2Bombwall_SpawnEffects after the Rand_Next() type update.

* Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c

Rand_Next() update.

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

* Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c

Rand_Next() update.

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

* Adding Co-authors
Co-authored-by EllipticEllipsis 73679967+EllipticEllipsis@users.noreply.github.com
Co-authored-by Derek-Hensley hensley.derek58@gmail.com
Co-authored-by Maide eeeedddccc@hotmail.co.uk
Co-authored-by Tom-Overton tom.overton@outlook.com
Co-authored-by Fig02 fig02srl@gmail.com
Co-authored-by Parker-Burnett burnettparker@gmail.com
Co-authored-by isghj5 isghj5@gmail.com

* Adding Co-authors
Co-authored-by EllipticEllipsis 73679967+EllipticEllipsis@users.noreply.github.com
Co-authored-by Derek-Hensley hensley.derek58@gmail.com
Co-authored-by Maide eeeedddccc@hotmail.co.uk
Co-authored-by Tom-Overton tom.overton@outlook.com
Co-authored-by Fig02 fig02srl@gmail.com
Co-authored-by Parker-Burnett burnettparker@gmail.com
Co-authored-by isghj5 isghj5@gmail.com

* Adding Co-authors
Co-authored-by EllipticEllipsis 73679967+EllipticEllipsis@users.noreply.github.com
Co-authored-by Derek-Hensley hensley.derek58@gmail.com
Co-authored-by Maide eeeedddccc@hotmail.co.uk
Co-authored-by Tom-Overton tom.overton@outlook.com
Co-authored-by Fig02 fig02srl@gmail.com
Co-authored-by Parker-Burnett burnettparker@gmail.com
Co-authored-by isghj5 isghj5@gmail.com

* Adding Co-authors
Co-authored-by EllipticEllipsis 73679967+EllipticEllipsis@users.noreply.github.com
Co-authored-by Derek-Hensley hensley.derek58@gmail.com
Co-authored-by Maide eeeedddccc@hotmail.co.uk
Co-authored-by Tom-Overton tom.overton@outlook.com
Co-authored-by Fig02 fig02srl@gmail.com
Co-authored-by Parker-Burnett burnettparker@gmail.com
Co-authored-by isghj5 isghj5@gmail.com

* Adding Co-authors

Co-authored-by EllipticEllipsis 73679967+EllipticEllipsis@users.noreply.github.com
Co-authored-by Derek-Hensley hensley.derek58@gmail.com
Co-authored-by Maide eeeedddccc@hotmail.co.uk
Co-authored-by Tom-Overton tom.overton@outlook.com
Co-authored-by Fig02 fig02srl@gmail.com
Co-authored-by Parker-Burnett burnettparker@gmail.com
Co-authored-by isghj5 isghj5@gmail.com

* Adding Co-authors

Co-authored-by: EllipticEllipsis 73679967+EllipticEllipsis@users.noreply.github.com
Co-authored-by: Derek-Hensley hensley.derek58@gmail.com
Co-authored-by: Maide eeeedddccc@hotmail.co.uk
Co-authored-by: Tom-Overton tom.overton@outlook.com
Co-authored-by: Fig02 fig02srl@gmail.com
Co-authored-by: Parker-Burnett burnettparker@gmail.com
Co-authored-by: isghj5 isghj5@gmail.com

* Adding Co-authors

Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
Co-authored-by: Derek-Hensley <hensley.derek58@gmail.com>
Co-authored-by: Maide <eeeedddccc@hotmail.co.uk>
Co-authored-by: Tom-Overton <tom.overton@outlook.com>
Co-authored-by: Fig02 <fig02srl@gmail.com>
Co-authored-by: Parker-Burnett <burnettparker@gmail.com>
Co-authored-by: isghj5 <isghj5@gmail.com>

* Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c

Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>

Co-authored-by: Isghj <42048411+isghj5@users.noreply.github.com>
Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
Co-authored-by: Maide <eeeedddccc@hotmail.co.uk>
Co-authored-by: Tom-Overton <tom.overton@outlook.com>
Co-authored-by: Fig02 <fig02srl@gmail.com>
Co-authored-by: Parker-Burnett <burnettparker@gmail.com>
Co-authored-by: isghj5 <isghj5@gmail.com>
This commit is contained in:
TrulyNaN 2022-06-20 15:57:09 -04:00 committed by GitHub
parent 361d8573e9
commit 53fc438d81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 212 additions and 66 deletions

View File

@ -1,34 +1,34 @@
<Root>
<File Name="object_kin2_obj" Segment="6">
<DList Name="object_kin2_obj_DL_000120" Offset="0x120" />
<DList Name="object_kin2_obj_DL_000128" Offset="0x128" />
<DList Name="object_kin2_obj_DL_0002C0" Offset="0x2C0" />
<DList Name="object_kin2_obj_DL_000360" Offset="0x360" />
<Collision Name="object_kin2_obj_Colheader_000490" Offset="0x490" />
<DList Name="gOceanSpiderHouseBombableWallDebrisDL" Offset="0x128" />
<DList Name="gOceanSpiderHouseBombableWallCrackDL" Offset="0x2C0" />
<DList Name="gOceanSpiderHouseBombableWallDL" Offset="0x360" />
<Collision Name="gOceanSpiderHouseBombableWallCol" Offset="0x490" />
<DList Name="object_kin2_obj_DL_000650" Offset="0x650" />
<DList Name="object_kin2_obj_DL_000658" Offset="0x658" />
<Collision Name="object_kin2_obj_Colheader_000798" Offset="0x798" />
<DList Name="object_kin2_obj_DL_000820" Offset="0x820" />
<DList Name="object_kin2_obj_DL_000828" Offset="0x828" />
<DList Name="gOceanSpiderHouseFireplaceGrateDL" Offset="0x828" />
<Collision Name="object_kin2_obj_Colheader_000908" Offset="0x908" />
<DList Name="object_kin2_obj_DL_000CA0" Offset="0xCA0" />
<DList Name="object_kin2_obj_DL_000CA8" Offset="0xCA8" />
<Collision Name="object_kin2_obj_Colheader_000F80" Offset="0xF80" />
<DList Name="gOceanSpiderHouseBookshelfDL" Offset="0xCA8" />
<Collision Name="gOceanSpiderHouseBookshelfCol" Offset="0xF80" />
<DList Name="object_kin2_obj_DL_0010F0" Offset="0x10F0" />
<DList Name="object_kin2_obj_DL_0010F8" Offset="0x10F8" />
<Collision Name="object_kin2_obj_Colheader_001328" Offset="0x1328" />
<DList Name="gOceanSpiderHouseChestOfDrawersDL" Offset="0x10F8" />
<Collision Name="gOceanSpiderHouseChestOfDrawersCol" Offset="0x1328" />
<!-- <Blob Name="object_kin2_obj_Blob_001354" Size="0x2C" Offset="0x1354" /> -->
<Texture Name="object_kin2_obj_TLUT_001380" OutName="tlut_001380" Format="rgba16" Width="4" Height="4" Offset="0x1380" />
<Texture Name="gOceanSpiderHouseTLUT" OutName="ocean_spider_house_tlut" Format="rgba16" Width="4" Height="4" Offset="0x1380" />
<!-- <Blob Name="object_kin2_obj_Blob_0013A0" Size="0x20" Offset="0x13A0" /> -->
<Texture Name="object_kin2_obj_Tex_0013C0" OutName="tex_0013C0" Format="ia8" Width="64" Height="64" Offset="0x13C0" />
<Texture Name="object_kin2_obj_Tex_0023C0" OutName="tex_0023C0" Format="rgba16" Width="32" Height="32" Offset="0x23C0" />
<Texture Name="object_kin2_obj_Tex_002BC0" OutName="tex_002BC0" Format="rgba16" Width="32" Height="32" Offset="0x2BC0" />
<Texture Name="object_kin2_obj_Tex_0033C0" OutName="tex_0033C0" Format="ci4" Width="64" Height="64" Offset="0x33C0" />
<Texture Name="object_kin2_obj_Tex_003BC0" OutName="tex_003BC0" Format="rgba16" Width="32" Height="64" Offset="0x3BC0" />
<Texture Name="object_kin2_obj_Tex_004BC0" OutName="tex_004BC0" Format="rgba16" Width="32" Height="64" Offset="0x4BC0" />
<Texture Name="object_kin2_obj_Tex_005BC0" OutName="tex_005BC0" Format="rgba16" Width="32" Height="32" Offset="0x5BC0" />
<Texture Name="object_kin2_obj_Tex_0063C0" OutName="tex_0063C0" Format="rgba16" Width="32" Height="64" Offset="0x63C0" />
<Texture Name="object_kin2_obj_Tex_0073C0" OutName="tex_0073C0" Format="rgba16" Width="32" Height="32" Offset="0x73C0" />
<Texture Name="object_kin2_obj_Tex_007BC0" OutName="tex_007BC0" Format="i4" Width="64" Height="64" Offset="0x7BC0" />
<Texture Name="gOceanSpiderHouseBombableWallCrackTex" OutName="ocean_spider_house_bombable_wall_crack" Format="ia8" Width="64" Height="64" Offset="0x13C0" />
<Texture Name="gOceanSpiderHouseBookshelfWoodTex" OutName="ocean_spider_house_bookshelf_wood" Format="rgba16" Width="32" Height="32" Offset="0x23C0" />
<Texture Name="gOceanSpiderHouseFireplaceGrateTex" OutName="ocean_spider_house_fireplace_grate" Format="rgba16" Width="32" Height="32" Offset="0x2BC0" />
<Texture Name="gOceanSpiderHouseSkullkidPaintingTex" OutName="ocean_spider_house_skullkid_painting" Format="ci4" Width="64" Height="64" Offset="0x33C0" />
<Texture Name="gOceanSpiderHouseChestOfDrawersFrontTex" OutName="ocean_spider_house_chest_of_drawers_front" Format="rgba16" Width="32" Height="64" Offset="0x3BC0" />
<Texture Name="gOceanSpiderHouseChestOfDrawersBackTex" OutName="ocean_spider_house_chest_of_drawers_back" Format="rgba16" Width="32" Height="64" Offset="0x4BC0" />
<Texture Name="gOceanSpiderHouseChestOfDrawersTopTex" OutName="ocean_spider_house_chest_of_drawers_top" Format="rgba16" Width="32" Height="32" Offset="0x5BC0" />
<Texture Name="gOceanSpiderHouseBookshelfBooksTex" OutName="ocean_spider_house_bookshelf_books" Format="rgba16" Width="32" Height="64" Offset="0x63C0" />
<Texture Name="gOceanSpiderHouseBombableWallDebrisTex1" OutName="ocean_spider_house_debris_1" Format="rgba16" Width="32" Height="32" Offset="0x73C0" />
<Texture Name="gOceanSpiderHouseBombableWallDebrisTex2" OutName="ocean_spider_house_debris_2" Format="i4" Width="64" Height="64" Offset="0x7BC0" />
</File>
</Root>

3
spec
View File

@ -4059,8 +4059,7 @@ beginseg
name "ovl_Bg_Kin2_Bombwall"
compress
include "build/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.o"
include "build/data/ovl_Bg_Kin2_Bombwall/ovl_Bg_Kin2_Bombwall.data.o"
include "build/data/ovl_Bg_Kin2_Bombwall/ovl_Bg_Kin2_Bombwall.reloc.o"
include "build/src/overlays/actors/ovl_Bg_Kin2_Bombwall/ovl_Bg_Kin2_Bombwall_reloc.o"
endseg
beginseg

View File

@ -3,8 +3,8 @@
* Overlay: ovl_Bg_Kin2_Bombwall
* Description: Ocean Spider House - Bombable Wall
*/
#include "z_bg_kin2_bombwall.h"
#include "objects/object_kin2_obj/object_kin2_obj.h"
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_10000000)
@ -15,8 +15,14 @@ void BgKin2Bombwall_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgKin2Bombwall_Update(Actor* thisx, GlobalContext* globalCtx);
void BgKin2Bombwall_Draw(Actor* thisx, GlobalContext* globalCtx);
#if 0
const ActorInit Bg_Kin2_Bombwall_InitVars = {
void BgKin2Bombwall_SetupWait(BgKin2Bombwall* this);
void BgKin2Bombwall_Wait(BgKin2Bombwall* this, GlobalContext* globalCtx);
void BgKin2Bombwall_SetupPlayCutscene(BgKin2Bombwall* this);
void BgKin2Bombwall_PlayCutscene(BgKin2Bombwall* this, GlobalContext* globalCtx);
void BgKin2Bombwall_SetupEndCutscene(BgKin2Bombwall* this);
void BgKin2Bombwall_EndCutscene(BgKin2Bombwall* this, GlobalContext* globalCtx);
ActorInit Bg_Kin2_Bombwall_InitVars = {
ACTOR_BG_KIN2_BOMBWALL,
ACTORCAT_BG,
FLAGS,
@ -28,50 +34,191 @@ const ActorInit Bg_Kin2_Bombwall_InitVars = {
(ActorFunc)BgKin2Bombwall_Draw,
};
// static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit D_80B6E6F0 = {
{ 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,
},
{ 60, 60, 0, { 0, 0, 0 } },
};
// static InitChainEntry sInitChain[] = {
static InitChainEntry D_80B6E748[] = {
s32 BgKin2Bombwall_IsHitFromNearby(BgKin2Bombwall* this, GlobalContext* globalCtx) {
Actor* bombwallCollider;
if (this->collider.base.acFlags & AC_HIT) {
bombwallCollider = this->collider.base.ac;
// Distance check required to only react to sufficiently close explosions.
if ((bombwallCollider != NULL) &&
(Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &bombwallCollider->world.pos) < 6400.0f)) {
return true;
}
}
return false;
}
static Color_RGBA8 sPrimColor = { 210, 210, 210, 255 };
static Color_RGBA8 sEnvColor = { 140, 140, 140, 255 };
static Vec3f sDustAccel = { 0.0f, 0.33f, 0.0f };
static s8 sRandomYOffsets[] = { -60, -34, -8, 18, 44 };
static s16 sScales[] = { 25, 23, 21, 19, 17, 15, 13, 10 }; // Scales for random explosion debris.
void BgKin2Bombwall_SpawnEffects(BgKin2Bombwall* this, GlobalContext* globalCtx) {
s32 i;
Vec3f pos;
Vec3f velocity;
Vec3f spD8;
Vec3f spCC;
s32 j;
s32 k;
f32 temp_a0;
s32 pad;
s16 phi_s0;
s16 phi_s1;
Matrix_RotateYS(this->dyna.actor.shape.rot.y, 0);
for (i = 0, k = 0; i < 6; i++) {
temp_a0 = (i + 1) * 15.f;
for (j = 0; j < ARRAY_COUNT(sRandomYOffsets); j++) {
k++;
k &= 7;
spD8.x = sRandomYOffsets[j] + (s32)(Rand_Next() >> 0x1C);
spD8.y = ((Rand_ZeroOne() - 0.5f) * 15.0f) + temp_a0;
spD8.z = (Rand_ZeroOne() * 20.0f) - 10.0f;
spCC.x = (2.0f * (Rand_ZeroOne() - 0.5f)) + (spD8.x * (6.0f / 325.0f));
spCC.y = (Rand_ZeroOne() * 7.0f) + 4.0f;
spCC.z = spD8.z * 0.3f;
Matrix_MultVec3f(&spD8, &pos);
Matrix_MultVec3f(&spCC, &velocity);
pos.x += this->dyna.actor.world.pos.x;
pos.y += this->dyna.actor.world.pos.y;
pos.z += this->dyna.actor.world.pos.z;
if (Rand_Next() % 4 == 0) {
phi_s0 = 0x20;
} else {
phi_s0 = 0x40;
}
if (k < 2 || (s32)Rand_Next() > 0) {
phi_s0 |= 1;
phi_s1 = 1;
func_800B0E48(globalCtx, &pos, &gZeroVec3f, &sDustAccel, &sPrimColor, &sEnvColor,
(Rand_Next() >> 0x1B) + 70,
(Rand_Next() >> 0x1A) + 60); // for dust spawn
} else {
phi_s1 = 0;
}
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -550, phi_s0, 30, 0, 0, sScales[k], phi_s1, 0, 50,
-1, OBJECT_KIN2_OBJ, gOceanSpiderHouseBombableWallDebrisDL);
}
}
}
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 200, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 300, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP),
};
#endif
void BgKin2Bombwall_Init(Actor* thisx, GlobalContext* globalCtx) {
BgKin2Bombwall* this = THIS;
ColliderCylinder* bombwallCollider;
extern ColliderCylinderInit D_80B6E6F0;
extern InitChainEntry D_80B6E748[];
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 0);
bombwallCollider = &this->collider;
Collider_InitCylinder(globalCtx, bombwallCollider);
if (Flags_GetSwitch(globalCtx, BG_KIN2_BOMBWALL_SWITCH_FLAG(this))) {
Actor_MarkForDeath(&this->dyna.actor);
} else {
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gOceanSpiderHouseBombableWallCol);
Collider_SetCylinder(globalCtx, bombwallCollider, &this->dyna.actor, &sCylinderInit);
Collider_UpdateCylinder(&this->dyna.actor, bombwallCollider);
Actor_SetFocus(&this->dyna.actor, 60.0f);
BgKin2Bombwall_SetupWait(this);
}
}
extern UNK_TYPE D_06000128;
extern UNK_TYPE D_06000360;
extern UNK_TYPE D_06000490;
void BgKin2Bombwall_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgKin2Bombwall* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E020.s")
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
Collider_DestroyCylinder(globalCtx, &this->collider);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E090.s")
void BgKin2Bombwall_SetupWait(BgKin2Bombwall* this) {
this->actionFunc = BgKin2Bombwall_Wait;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/BgKin2Bombwall_Init.s")
void BgKin2Bombwall_Wait(BgKin2Bombwall* this, GlobalContext* globalCtx) {
if (BgKin2Bombwall_IsHitFromNearby(this, globalCtx)) {
this->collider.base.acFlags &= ~AC_HIT;
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
BgKin2Bombwall_SetupPlayCutscene(this);
} else {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/BgKin2Bombwall_Destroy.s")
void BgKin2Bombwall_SetupPlayCutscene(BgKin2Bombwall* this) {
this->actionFunc = BgKin2Bombwall_PlayCutscene;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E4B8.s")
void BgKin2Bombwall_PlayCutscene(BgKin2Bombwall* this, GlobalContext* globalCtx) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
Flags_SetSwitch(globalCtx, BG_KIN2_BOMBWALL_SWITCH_FLAG(this));
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 60, NA_SE_EV_WALL_BROKEN);
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
this->dyna.actor.draw = NULL;
BgKin2Bombwall_SpawnEffects(this, globalCtx);
BgKin2Bombwall_SetupEndCutscene(this);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E4CC.s")
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E544.s")
void BgKin2Bombwall_SetupEndCutscene(BgKin2Bombwall* this) {
this->timer = 40;
this->actionFunc = BgKin2Bombwall_EndCutscene;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E558.s")
void BgKin2Bombwall_EndCutscene(BgKin2Bombwall* this, GlobalContext* globalCtx) {
this->timer--;
if (this->timer <= 0) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
Actor_MarkForDeath(&this->dyna.actor);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E5F8.s")
void BgKin2Bombwall_Update(Actor* thisx, GlobalContext* globalCtx) {
BgKin2Bombwall* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E614.s")
this->actionFunc(this, globalCtx);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/BgKin2Bombwall_Update.s")
void BgKin2Bombwall_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgKin2Bombwall* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/BgKin2Bombwall_Draw.s")
Gfx_DrawDListOpa(globalCtx, gOceanSpiderHouseBombableWallDL);
Gfx_DrawDListXlu(globalCtx, gOceanSpiderHouseBombableWallCrackDL);
}

View File

@ -1,6 +1,8 @@
#ifndef Z_BG_KIN2_BOMBWALL_H
#define Z_BG_KIN2_BOMBWALL_H
#define BG_KIN2_BOMBWALL_SWITCH_FLAG(thisx) (thisx->dyna.actor.params & 0x7F)
#include "global.h"
struct BgKin2Bombwall;
@ -8,12 +10,10 @@ struct BgKin2Bombwall;
typedef void (*BgKin2BombwallActionFunc)(struct BgKin2Bombwall*, GlobalContext*);
typedef struct BgKin2Bombwall {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x64];
/* 0x01A8 */ BgKin2BombwallActionFunc actionFunc;
/* 0x01AC */ char unk_1AC[0x4];
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ ColliderCylinder collider;
/* 0x1A8 */ BgKin2BombwallActionFunc actionFunc;
/* 0x1AC */ s8 timer;
} BgKin2Bombwall; // size = 0x1B0
extern const ActorInit Bg_Kin2_Bombwall_InitVars;
#endif // Z_BG_KIN2_BOMBWALL_H

View File

@ -270,5 +270,5 @@ void BgKin2Fence_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgKin2Fence_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, object_kin2_obj_DL_000828);
Gfx_DrawDListOpa(globalCtx, gOceanSpiderHouseFireplaceGrateDL);
}

View File

@ -51,9 +51,9 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_STOP),
};
CollisionHeader* D_80B70780[] = { &object_kin2_obj_Colheader_001328, &object_kin2_obj_Colheader_000F80 };
CollisionHeader* D_80B70780[] = { &gOceanSpiderHouseChestOfDrawersCol, &gOceanSpiderHouseBookshelfCol };
Gfx* D_80B70788[] = { object_kin2_obj_DL_0010F8, object_kin2_obj_DL_000CA8 };
Gfx* D_80B70788[] = { gOceanSpiderHouseChestOfDrawersDL, gOceanSpiderHouseBookshelfDL };
s32 func_80B6FB30(BgKin2Shelf* this, GlobalContext* globalCtx) {
s32 temp_v1 = BGKIN2SHELF_GET_1(&this->dyna.actor);

View File

@ -14294,16 +14294,16 @@
0x80B6DEA8:("func_80B6DEA8",),
0x80B6DEB8:("BgHakaCurtain_Update",),
0x80B6DF44:("BgHakaCurtain_Draw",),
0x80B6E020:("func_80B6E020",),
0x80B6E090:("func_80B6E090",),
0x80B6E020:("BgKin2Bombwall_IsHitFromNearby",),
0x80B6E090:("BgKin2Bombwall_SpawnEffects",),
0x80B6E3AC:("BgKin2Bombwall_Init",),
0x80B6E470:("BgKin2Bombwall_Destroy",),
0x80B6E4B8:("func_80B6E4B8",),
0x80B6E4CC:("func_80B6E4CC",),
0x80B6E544:("func_80B6E544",),
0x80B6E558:("func_80B6E558",),
0x80B6E5F8:("func_80B6E5F8",),
0x80B6E614:("func_80B6E614",),
0x80B6E4B8:("BgKin2Bombwall_SetupWait",),
0x80B6E4CC:("BgKin2Bombwall_Wait",),
0x80B6E544:("BgKin2Bombwall_SetupPlayCutscene",),
0x80B6E558:("BgKin2Bombwall_PlayCutscene",),
0x80B6E5F8:("BgKin2Bombwall_SetupEndCutscene",),
0x80B6E614:("BgKin2Bombwall_EndCutscene",),
0x80B6E664:("BgKin2Bombwall_Update",),
0x80B6E688:("BgKin2Bombwall_Draw",),
0x80B6E820:("BgKin2Fence_CheckHitMask",),