diff --git a/assets/xml/objects/object_boj.xml b/assets/xml/objects/object_boj.xml index cfb10e97aa..20c661bb59 100644 --- a/assets/xml/objects/object_boj.xml +++ b/assets/xml/objects/object_boj.xml @@ -87,8 +87,8 @@ - - - + + + diff --git a/spec b/spec index 813e821ceb..c894dabefc 100644 --- a/spec +++ b/spec @@ -4567,8 +4567,7 @@ beginseg name "ovl_En_Nimotsu" compress include "build/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.o" - include "build/data/ovl_En_Nimotsu/ovl_En_Nimotsu.data.o" - include "build/data/ovl_En_Nimotsu/ovl_En_Nimotsu.reloc.o" + include "build/src/overlays/actors/ovl_En_Nimotsu/ovl_En_Nimotsu_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c index 966f3671bc..11872a0a17 100644 --- a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c +++ b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c @@ -5,6 +5,7 @@ */ #include "z_en_nimotsu.h" +#include "assets/objects/object_boj/object_boj.h" #define FLAGS (ACTOR_FLAG_10) @@ -15,7 +16,8 @@ void EnNimotsu_Destroy(Actor* thisx, PlayState* play); void EnNimotsu_Update(Actor* thisx, PlayState* play); void EnNimotsu_Draw(Actor* thisx, PlayState* play); -#if 0 +void EnNimotsu_UpdateCollision(EnNimotsu* this, PlayState* play); + const ActorInit En_Nimotsu_InitVars = { ACTOR_EN_NIMOTSU, ACTORCAT_PROP, @@ -28,25 +30,93 @@ const ActorInit En_Nimotsu_InitVars = { (ActorFunc)EnNimotsu_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80BE1FB0 = { - { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK4, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 10, 30, 0, { 0, 0, 0 } }, }; -#endif +void EnNimotsu_UpdateCollision(EnNimotsu* this, PlayState* play) { + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); + Actor_UpdateBgCheckInfo(play, &this->actor, 32.0f, 30.0f, 0.0f, 4); +} -extern ColliderCylinderInit D_80BE1FB0; +void EnNimotsu_Init(Actor* thisx, PlayState* play) { + EnNimotsu* this = THIS; -extern UNK_TYPE D_06013380; + Collider_InitCylinder(play, &this->collider); + Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nimotsu/func_80BE1C80.s") + this->timer = 10; + this->actor.gravity = -0.5f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nimotsu/EnNimotsu_Init.s") + Actor_SetScale(&this->actor, 0.01f); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nimotsu/EnNimotsu_Destroy.s") +void EnNimotsu_Destroy(Actor* thisx, PlayState* play) { + EnNimotsu* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nimotsu/EnNimotsu_Update.s") + Collider_DestroyCylinder(play, &this->collider); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nimotsu/EnNimotsu_Draw.s") +void EnNimotsu_Update(Actor* thisx, PlayState* play) { + s32 pad; + EnNimotsu* this = THIS; + Vec3f dustPosition; + + Actor_MoveWithGravity(&this->actor); + + if (!(this->dustDone & 1) && (this->actor.bgCheckFlags & 1)) { + if (DECR(this->timer) == 0) { + this->dustDone |= 1; + } + + if ((play->state.frames % 3) == 0) { + dustPosition.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(15.0f); + dustPosition.y = this->actor.world.pos.y; + dustPosition.z = this->actor.world.pos.z + randPlusMinusPoint5Scaled(15.0f); + Actor_SpawnFloorDustRing(play, &this->actor, &dustPosition, 20.0f, 0, 2.0f, 0, 0, 0); + } + } + + EnNimotsu_UpdateCollision(this, play); +} + +void EnNimotsu_Draw(Actor* thisx, PlayState* play) { + s32 pad; + EnNimotsu* this = THIS; + Vec3f position; + Vec3f scale; + + OPEN_DISPS(play->state.gfxCtx); + func_8012C28C(play->state.gfxCtx); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, &gBombShopBagDL); + func_8012C2DC(play->state.gfxCtx); + + position.x = this->actor.world.pos.x + 7.0f; + position.y = this->actor.world.pos.y; + position.z = this->actor.world.pos.z + 2.0f; + + scale.x = 0.2f; + scale.y = 0.2f; + scale.z = 0.2f; + + func_800BC620(&position, &scale, 255, play); + CLOSE_DISPS(play->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.h b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.h index 634697736f..e839c9393f 100644 --- a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.h +++ b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.h @@ -7,7 +7,10 @@ struct EnNimotsu; typedef struct EnNimotsu { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x98]; + /* 0x144 */ UNK_TYPE1 unk_144[0x48]; + /* 0x18C */ ColliderCylinder collider; + /* 0x1D8 */ u16 dustDone; + /* 0x1DA */ s16 timer; } EnNimotsu; // size = 0x1DC extern const ActorInit En_Nimotsu_InitVars; diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index 10cdec0791..fbacce266f 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -1542,7 +1542,7 @@ void EnSuttari_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* } else { func_8012C28C(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, object_boj_DL_013380); + gSPDisplayList(POLY_OPA_DISP++, gBombShopBagDL); CLOSE_DISPS(play->state.gfxCtx); } } diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index aa494f5947..a83588b667 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -16061,7 +16061,7 @@ 0x80BE16B4:("EnTab_PostLimbDraw",), 0x80BE1704:("EnTab_TransformLimbDraw",), 0x80BE1810:("EnTab_Draw",), - 0x80BE1C80:("func_80BE1C80",), + 0x80BE1C80:("EnNimotsu_UpdateCollision",), 0x80BE1CEC:("EnNimotsu_Init",), 0x80BE1D5C:("EnNimotsu_Destroy",), 0x80BE1D88:("EnNimotsu_Update",), diff --git a/undefined_syms.txt b/undefined_syms.txt index 658dd5f055..aae06790f4 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -1223,10 +1223,6 @@ D_06008C40 = 0x06008C40; D_060001E4 = 0x060001E4; D_06001EE8 = 0x06001EE8; -// ovl_En_Nimotsu - -D_06013380 = 0x06013380; - // ovl_En_Nwc D_060000E8 = 0x060000E8;