From 235ae9b11d9cb07162dd708438535892331d6d6d Mon Sep 17 00:00:00 2001 From: Isghj <42048411+isghj5@users.noreply.github.com> Date: Sat, 23 Jul 2022 11:36:08 -0700 Subject: [PATCH] `EnNnh` (Butler's Son) Documentation and one Kakasi thing I missed (#957) * EnNnh: Docs * EnKakasi: added targetmode params macro * EnNnh: requested move of object description --- assets/xml/objects/object_nnh.xml | 17 ++++++---- .../actors/ovl_En_Kakasi/z_en_kakasi.c | 2 +- .../actors/ovl_En_Kakasi/z_en_kakasi.h | 1 + src/overlays/actors/ovl_En_Nnh/z_en_nnh.c | 32 +++++++++---------- tools/disasm/functions.txt | 8 ++--- 5 files changed, 33 insertions(+), 27 deletions(-) diff --git a/assets/xml/objects/object_nnh.xml b/assets/xml/objects/object_nnh.xml index 1bb833cf07..f7f546e256 100644 --- a/assets/xml/objects/object_nnh.xml +++ b/assets/xml/objects/object_nnh.xml @@ -1,10 +1,15 @@  + + - - - - - - + + + + + + + + + diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index befd3aa615..31fe293694 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -158,7 +158,7 @@ void EnKakasi_Init(Actor* thisx, PlayState* play) { this->actor.world.rot.z = 0; this->actor.targetMode = 0; if (this->actor.world.rot.x > 0 && this->actor.world.rot.x < 8) { - this->actor.targetMode = this->actor.world.rot.x - 1; + this->actor.targetMode = GET_KAKASI_TARGETMODE(thisx); } this->actor.shape.rot.y = this->actor.world.rot.y; diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h index 45d7a274b0..c1a788d466 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h @@ -47,5 +47,6 @@ extern const ActorInit En_Kakasi_InitVars; #define GET_KAKASI_SUMMON_DISTANCE(thisx) (((thisx)->params >> 0x8) & 0xFF) #define GET_KAKASI_ABOVE_GROUND(thisx) ((thisx)->params & 0x1) +#define GET_KAKASI_TARGETMODE(thisx) ((thisx)->world.rot.x - 1) #endif // Z_EN_KAKASI_H diff --git a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c index 41ae5d99c6..5597bf9f60 100644 --- a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c +++ b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c @@ -16,10 +16,10 @@ void EnNnh_Destroy(Actor* thisx, PlayState* play); void EnNnh_Update(Actor* thisx, PlayState* play); void EnNnh_Draw(Actor* thisx, PlayState* play); -void func_80C08828(EnNnh* this); -void func_80C0883C(EnNnh* this, PlayState* play); -void func_80C088A4(EnNnh* this); -void func_80C088B8(EnNnh* this, PlayState* play); +void EnNnh_SetupWaitForDialogue(EnNnh* this); +void EnNnh_WaitForDialogue(EnNnh* this, PlayState* play); +void EnNnh_SetupDialogue(EnNnh* this); +void EnNnh_Dialogue(EnNnh* this, PlayState* play); const ActorInit En_Nnh_InitVars = { ACTOR_EN_NNH, @@ -62,7 +62,7 @@ void EnNnh_Init(Actor* thisx, PlayState* play) { this->actor.targetMode = 1; this->actor.focus.pos = this->actor.world.pos; this->actor.focus.pos.y += 30.0f; - func_80C08828(this); + EnNnh_SetupWaitForDialogue(this); } void EnNnh_Destroy(Actor* thisx, PlayState* play) { @@ -71,26 +71,26 @@ void EnNnh_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -void func_80C08828(EnNnh* this) { - this->actionFunc = func_80C0883C; +void EnNnh_SetupWaitForDialogue(EnNnh* this) { + this->actionFunc = EnNnh_WaitForDialogue; } -void func_80C0883C(EnNnh* this, PlayState* play) { +void EnNnh_WaitForDialogue(EnNnh* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { Message_StartTextbox(play, 0x228, &this->actor); - func_80C088A4(this); - return; + EnNnh_SetupDialogue(this); + } else { + func_800B8614(&this->actor, play, 100.0f); } - func_800B8614(&this->actor, play, 100.0f); } -void func_80C088A4(EnNnh* this) { - this->actionFunc = func_80C088B8; +void EnNnh_SetupDialogue(EnNnh* this) { + this->actionFunc = EnNnh_Dialogue; } -void func_80C088B8(EnNnh* this, PlayState* play) { +void EnNnh_Dialogue(EnNnh* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { - func_80C08828(this); + EnNnh_SetupWaitForDialogue(this); } } @@ -109,5 +109,5 @@ void EnNnh_Draw(Actor* thisx, PlayState* play) { func_8012C28C(gfxCtx); gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, object_nnh_DL_001510); + gSPDisplayList(gfxCtx->polyOpa.p++, gButlerSonMainBodyDL); } diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 7ca90a3336..7acb491bb9 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -16610,10 +16610,10 @@ 0x80C08480:("ObjUsiyane_Draw",), 0x80C08760:("EnNnh_Init",), 0x80C087FC:("EnNnh_Destroy",), - 0x80C08828:("func_80C08828",), - 0x80C0883C:("func_80C0883C",), - 0x80C088A4:("func_80C088A4",), - 0x80C088B8:("func_80C088B8",), + 0x80C08828:("EnNnh_SetupWaitForDialogue",), + 0x80C0883C:("EnNnh_WaitForDialogue",), + 0x80C088A4:("EnNnh_SetupDialogue",), + 0x80C088B8:("EnNnh_Dialogue",), 0x80C088EC:("EnNnh_Update",), 0x80C08950:("EnNnh_Draw",), 0x80C08A80:("ObjKzsaku_Init",),