1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 09:45:02 +00:00

Document object_bw (Torch Slug) (#1390)

* Document object_bw (Torch Slug)

* Get rid of "Wrapper" terminology
This commit is contained in:
Tom Overton 2022-10-06 19:10:49 -07:00 committed by GitHub
parent 8c17339e06
commit a99d41bf35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 40 deletions

View file

@ -1,29 +1,40 @@
<Root>
<File Name="object_bw" Segment="6">
<Animation Name="object_bw_Anim_000228" Offset="0x228"/>
<DList Name="object_bw_DL_0002C0" Offset="0x2C0"/>
<DList Name="object_bw_DL_0003E8" Offset="0x3E8"/>
<DList Name="object_bw_DL_000558" Offset="0x558"/>
<DList Name="object_bw_DL_000680" Offset="0x680"/>
<DList Name="object_bw_DL_001050" Offset="0x1050"/>
<Texture Name="object_bw_Tex_001240" OutName="tex_00001240" Format="rgba16" Width="16" Height="16" Offset="0x1240"/>
<Texture Name="object_bw_Tex_001440" OutName="tex_00001440" Format="rgba16" Width="16" Height="16" Offset="0x1440"/>
<Texture Name="object_bw_TLUT_001640" OutName="tlut_00001640" Format="rgba16" Width="16" Height="16" Offset="0x1640"/>
<Texture Name="object_bw_Tex_001840" OutName="tex_00001840" Format="ci8" Width="32" Height="32" Offset="0x1840" TlutOffset="0x1640"/>
<Texture Name="object_bw_Tex_001C40" OutName="tex_00001C40" Format="ci8" Width="32" Height="32" Offset="0x1C40" TlutOffset="0x1640"/>
<Limb Name="object_bw_Limb_002040" LimbType="Standard" Offset="0x2040"/>
<Limb Name="object_bw_Limb_00204C" LimbType="Standard" Offset="0x204C"/>
<Limb Name="object_bw_Limb_002058" LimbType="Standard" Offset="0x2058"/>
<Limb Name="object_bw_Limb_002064" LimbType="Standard" Offset="0x2064"/>
<Limb Name="object_bw_Limb_002070" LimbType="Standard" Offset="0x2070"/>
<Limb Name="object_bw_Limb_00207C" LimbType="Standard" Offset="0x207C"/>
<Limb Name="object_bw_Limb_002088" LimbType="Standard" Offset="0x2088"/>
<Limb Name="object_bw_Limb_002094" LimbType="Standard" Offset="0x2094"/>
<Limb Name="object_bw_Limb_0020A0" LimbType="Standard" Offset="0x20A0"/>
<Limb Name="object_bw_Limb_0020AC" LimbType="Standard" Offset="0x20AC"/>
<Limb Name="object_bw_Limb_0020B8" LimbType="Standard" Offset="0x20B8"/>
<Skeleton Name="object_bw_Skel_0020F0" Type="Normal" LimbType="Standard" Offset="0x20F0"/>
<Animation Name="object_bw_Anim_0021A0" Offset="0x21A0"/>
<Animation Name="object_bw_Anim_002250" Offset="0x2250"/>
<!-- Torch Slug Animation -->
<Animation Name="gTorchSlugEyestalkWaveAnim" Offset="0x228"/> <!-- Original name is "bw_aruku" ("to walk"). Used for when the Torch Slug moves around. -->
<!-- Torch Slug Limb DisplayLists -->
<DList Name="gTorchSlugLeftLowerEyestalkDL" Offset="0x2C0"/>
<DList Name="gTorchSlugLeftUpperEyestalkDL" Offset="0x3E8"/>
<DList Name="gTorchSlugRightLowerEyestalkDL" Offset="0x558"/>
<DList Name="gTorchSlugRightUpperEyestalkDL" Offset="0x680"/>
<DList Name="gTorchSlugBodyDL" Offset="0x1050"/>
<!-- Torch Slug Textures -->
<Texture Name="gTorchSlugEyestalkTex" OutName="torch_slug_eyestalk" Format="rgba16" Width="16" Height="16" Offset="0x1240"/>
<Texture Name="gTorchSlugEyeTex" OutName="torch_slug_eye" Format="rgba16" Width="16" Height="16" Offset="0x1440"/>
<Texture Name="gTorchSlugBodyTLUT" OutName="torch_slug_body_tlut" Format="rgba16" Width="16" Height="16" Offset="0x1640"/>
<Texture Name="gTorchSlugBody1Tex" OutName="torch_slug_body_1" Format="ci8" Width="32" Height="32" Offset="0x1840" TlutOffset="0x1640"/>
<Texture Name="gTorchSlugBody2Tex" OutName="torch_slug_body_2" Format="ci8" Width="32" Height="32" Offset="0x1C40" TlutOffset="0x1640"/>
<!-- Torch Slug Limbs -->
<Limb Name="gTorchSlugBodyLimb" LimbType="Standard" Offset="0x2040"/>
<Limb Name="gTorchSlugLeftEyestalkRootRootLimb" LimbType="Standard" Offset="0x204C"/>
<Limb Name="gTorchSlugLeftEyestalkRootLimb" LimbType="Standard" Offset="0x2058"/>
<Limb Name="gTorchSlugLeftUpperEyestalkRootLimb" LimbType="Standard" Offset="0x2064"/>
<Limb Name="gTorchSlugLeftUpperEyestalkLimb" LimbType="Standard" Offset="0x2070"/>
<Limb Name="gTorchSlugLeftLowerEyestalkLimb" LimbType="Standard" Offset="0x207C"/>
<Limb Name="gTorchSlugRightEyestalkRootRootLimb" LimbType="Standard" Offset="0x2088"/>
<Limb Name="gTorchSlugRightEyestalkRootLimb" LimbType="Standard" Offset="0x2094"/>
<Limb Name="gTorchSlugRightUpperEyestalkRootLimb" LimbType="Standard" Offset="0x20A0"/>
<Limb Name="gTorchSlugRightUpperEyestalkLimb" LimbType="Standard" Offset="0x20AC"/>
<Limb Name="gTorchSlugRightLowerEyestalkLimb" LimbType="Standard" Offset="0x20B8"/>
<!-- Torch Slug Skeleton -->
<Skeleton Name="gTorchSlugSkel" Type="Normal" LimbType="Standard" Offset="0x20F0"/>
<!-- Torch Slug Animations -->
<Animation Name="gTorchSlugEyestalkRaiseAnim" Offset="0x21A0"/> <!-- Original name is "bw_hakken" ("discovery; detection"). Used for when the Torch Slug spots the player. -->
<Animation Name="gTorchSlugEyestalkFlailAnim" Offset="0x2250"/> <!-- Original name is "bw_kogeki" ("attack; offensive"). Used for when the Torch Slug jumps at the player or is flipped over. -->
</File>
</Root>

View file

@ -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;

View file

@ -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));

View file

@ -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;