From a99d41bf35d560996e252dd7db18bd488e98f70c Mon Sep 17 00:00:00 2001 From: Tom Overton Date: Thu, 6 Oct 2022 19:10:49 -0700 Subject: [PATCH] Document object_bw (Torch Slug) (#1390) * Document object_bw (Torch Slug) * Get rid of "Wrapper" terminology --- assets/xml/objects/object_bw.xml | 61 +++++++++++-------- src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 11 ++-- src/overlays/actors/ovl_En_Bw/z_en_bw.c | 16 ++--- src/overlays/actors/ovl_En_Bw/z_en_bw.h | 20 +++++- 4 files changed, 68 insertions(+), 40 deletions(-) diff --git a/assets/xml/objects/object_bw.xml b/assets/xml/objects/object_bw.xml index f7d5ecead7..c2b76fd91e 100644 --- a/assets/xml/objects/object_bw.xml +++ b/assets/xml/objects/object_bw.xml @@ -1,29 +1,40 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 76e6d39204..80ca1c97ed 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -436,11 +436,12 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) { Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150); Audio_PlayActorSfx2(&sFloor->dyna.actor, NA_SE_EN_SHADEST_TAIKO_HIGH); } else if (GET_EVENTCHKINF(EVENTCHKINF_77)) { - //! @bug This condition assumes that the second bounce on the ground will occur before frame 545 on the timer. - //! However, it is possible to delay Player's descent to the ground by, for example, jumpslashing on the last possible - //! frame before the cutscene takes control. This delays Player's fall to the ground by enough time such that - //! the second bounce will occur after the timer has decremented past 546. - //! The end result is that the cutscene will not be shortened like it should even though the flag is set. + //! @bug This condition assumes that the second bounce on the ground will occur before frame 545 on the + //! timer. However, it is possible to delay Player's descent to the ground by, for example, jumpslashing + //! on the last possible frame before the cutscene takes control. This delays Player's fall to the + //! ground by enough time such that the second bounce will occur after the timer has decremented past + //! 546. The end result is that the cutscene will not be shortened like it should even though the flag + //! is set. sHands[RIGHT]->actor.draw = BossSst_DrawHand; sHands[LEFT]->actor.draw = BossSst_DrawHand; this->actor.draw = BossSst_DrawHead; diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index dd40911c48..7ecebbc52e 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -132,8 +132,8 @@ void EnBw_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.012999999f); this->actor.naviEnemyId = NAVI_ENEMY_TORCH_SLUG; this->actor.gravity = -2.0f; - SkelAnime_Init(play, &this->skelAnime, &object_bw_Skel_0020F0, &object_bw_Anim_000228, this->jointTable, - this->morphTable, 12); + SkelAnime_Init(play, &this->skelAnime, &gTorchSlugSkel, &gTorchSlugEyestalkWaveAnim, this->jointTable, + this->morphTable, TORCH_SLUG_LIMB_MAX); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = 6; @@ -174,7 +174,7 @@ void func_809CE884(EnBw* this, PlayState* play) { } void func_809CE9A8(EnBw* this) { - Animation_MorphToLoop(&this->skelAnime, &object_bw_Anim_000228, -2.0f); + Animation_MorphToLoop(&this->skelAnime, &gTorchSlugEyestalkWaveAnim, -2.0f); this->unk_220 = 2; this->unk_222 = Rand_ZeroOne() * 200.0f + 200.0f; this->unk_232 = 0; @@ -393,7 +393,7 @@ void func_809CEA24(EnBw* this, PlayState* play) { } void func_809CF72C(EnBw* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &object_bw_Anim_0021A0, -2.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &gTorchSlugEyestalkRaiseAnim, -2.0f); this->unk_220 = 3; this->unk_221 = 0; this->unk_250 = 0.6f; @@ -425,7 +425,7 @@ void func_809CF7AC(EnBw* this, PlayState* play) { } void func_809CF8F0(EnBw* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &object_bw_Anim_002250, -1.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &gTorchSlugEyestalkFlailAnim, -1.0f); this->actor.speedXZ = 7.0f; this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->unk_220 = 4; @@ -470,7 +470,7 @@ void func_809CF984(EnBw* this, PlayState* play) { } void func_809CFBA8(EnBw* this) { - Animation_MorphToLoop(&this->skelAnime, &object_bw_Anim_002250, -1.0f); + Animation_MorphToLoop(&this->skelAnime, &gTorchSlugEyestalkFlailAnim, -1.0f); this->unk_220 = 5; this->unk_222 = 1000; this->unk_260 = 0.0f; @@ -528,7 +528,7 @@ void func_809CFC4C(EnBw* this, PlayState* play) { } void func_809CFF10(EnBw* this) { - Animation_MorphToLoop(&this->skelAnime, &object_bw_Anim_002250, -1.0f); + Animation_MorphToLoop(&this->skelAnime, &gTorchSlugEyestalkFlailAnim, -1.0f); this->unk_220 = 6; this->unk_222 = 1000; this->unk_221 = 3; @@ -814,7 +814,7 @@ void EnBw_Update(Actor* thisx, PlayState* play2) { s32 EnBw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx, Gfx** gfx) { EnBw* this = (EnBw*)thisx; - if (limbIndex == 1) { + if (limbIndex == TORCH_SLUG_LIMB_BODY) { gSPSegment( (*gfx)++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x20, 1, 0, this->unk_23A, 0x20, 0x20)); diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.h b/src/overlays/actors/ovl_En_Bw/z_en_bw.h index ffdc3bba4e..dfd70e440a 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.h +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.h @@ -7,11 +7,27 @@ struct EnBw; typedef void (*EnBwActionFunc)(struct EnBw*, PlayState*); +typedef enum { + /* 0 */ TORCH_SLUG_LIMB_NONE, + /* 1 */ TORCH_SLUG_LIMB_BODY, + /* 2 */ TORCH_SLUG_LIMB_LEFT_EYESTALK_ROOT_ROOT, + /* 3 */ TORCH_SLUG_LIMB_LEFT_EYESTALK_ROOT, + /* 4 */ TORCH_SLUG_LIMB_LEFT_UPPER_EYESTALK_ROOT, + /* 5 */ TORCH_SLUG_LIMB_LEFT_UPPER_EYESTALK, + /* 6 */ TORCH_SLUG_LIMB_LEFT_LOWER_EYESTALK, + /* 7 */ TORCH_SLUG_LIMB_RIGHT_EYESTALK_ROOT_ROOT, + /* 8 */ TORCH_SLUG_LIMB_RIGHT_EYESTALK_ROOT, + /* 9 */ TORCH_SLUG_LIMB_RIGHT_UPPER_EYESTALK_ROOT, + /* 10 */ TORCH_SLUG_LIMB_RIGHT_UPPER_EYESTALK, + /* 11 */ TORCH_SLUG_LIMB_RIGHT_LOWER_EYESTALK, + /* 12 */ TORCH_SLUG_LIMB_MAX +} TorchSlugLimb; + typedef struct EnBw { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; - /* 0x0190 */ Vec3s jointTable[12]; - /* 0x01D8 */ Vec3s morphTable[12]; + /* 0x0190 */ Vec3s jointTable[TORCH_SLUG_LIMB_MAX]; + /* 0x01D8 */ Vec3s morphTable[TORCH_SLUG_LIMB_MAX]; /* 0x0220 */ u8 unk_220; /* 0x0221 */ u8 unk_221; /* 0x0222 */ s16 unk_222;