diff options
| author | Tom Overton <tom-overton@users.noreply.github.com> | 2022-01-30 12:07:22 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-30 17:07:22 -0300 |
| commit | 5f425bf73c8b6fef9b2ba321afc82b2d9975ffb5 (patch) | |
| tree | ca095a5781add3043a1432c48f1018c63ba35f92 | |
| parent | 06a14e73ea2f472708b73d88d444e5c97cf837d4 (diff) | |
Document object_boss03 (#559)
* Document object_boss03
* Actually run ./format.sh
* Preserve ordering
* Move Tanron3 limb enum to object
* Don't name the limb enum after the actor
| -rw-r--r-- | assets/xml/objects/object_boss03.xml | 223 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c | 55 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h | 14 |
3 files changed, 172 insertions, 120 deletions
diff --git a/assets/xml/objects/object_boss03.xml b/assets/xml/objects/object_boss03.xml index 14d7d3498..5cf4ad2b8 100644 --- a/assets/xml/objects/object_boss03.xml +++ b/assets/xml/objects/object_boss03.xml @@ -1,93 +1,138 @@ <Root> + <!-- + Gyorg, his title card, the small fishes he summons, the seaweed in his boss arena, + and the bubbles in his intro cutscene. Also contains an unused copy of Majora's Wrath's + whip assets, along with an unused duplicate of the small fishes. + --> <File Name="object_boss03" Segment="6"> - <Animation Name="object_boss03_Anim_000088" Offset="0x88" /> - <Texture Name="object_boss03_Tex_0000A0" OutName="tex_0000A0" Format="rgba16" Width="8" Height="16" Offset="0xA0" /> - <DList Name="object_boss03_DL_000200" Offset="0x200" /> - <DList Name="object_boss03_DL_000278" Offset="0x278" /> - <DList Name="object_boss03_DL_0002A8" Offset="0x2A8" /> - <DList Name="object_boss03_DL_003398" Offset="0x3398" /> - <DList Name="object_boss03_DL_003A78" Offset="0x3A78" /> - <DList Name="object_boss03_DL_003E38" Offset="0x3E38" /> - <DList Name="object_boss03_DL_003FB8" Offset="0x3FB8" /> - <DList Name="object_boss03_DL_0042D0" Offset="0x42D0" /> - <DList Name="object_boss03_DL_004450" Offset="0x4450" /> - <DList Name="object_boss03_DL_004768" Offset="0x4768" /> - <DList Name="object_boss03_DL_004AC0" Offset="0x4AC0" /> - <DList Name="object_boss03_DL_005010" Offset="0x5010" /> - <!-- <Blob Name="object_boss03_Blob_005388" Size="0x8" Offset="0x5388" /> --> - <Texture Name="object_boss03_TLUT_005390" OutName="tlut_005390" Format="rgba16" Width="4" Height="4" Offset="0x5390" /> - <Texture Name="object_boss03_TLUT_0053B0" OutName="tlut_0053B0" Format="rgba16" Width="4" Height="4" Offset="0x53B0" /> - <Texture Name="object_boss03_TLUT_0053D0" OutName="tlut_0053D0" Format="rgba16" Width="4" Height="4" Offset="0x53D0" /> - <Texture Name="object_boss03_TLUT_0053F0" OutName="tlut_0053F0" Format="rgba16" Width="4" Height="4" Offset="0x53F0" /> - <Texture Name="object_boss03_Tex_005410" OutName="tex_005410" Format="rgba16" Width="32" Height="32" Offset="0x5410" /> - <Texture Name="object_boss03_Tex_005C10" OutName="tex_005C10" Format="ci4" Width="64" Height="64" Offset="0x5C10" /> - <Texture Name="object_boss03_Tex_006410" OutName="tex_006410" Format="ci4" Width="64" Height="64" Offset="0x6410" /> - <Texture Name="object_boss03_Tex_006C10" OutName="tex_006C10" Format="ci4" Width="64" Height="64" Offset="0x6C10" /> - <Texture Name="object_boss03_Tex_007410" OutName="tex_007410" Format="ci4" Width="64" Height="64" Offset="0x7410" /> - <Texture Name="object_boss03_Tex_007C10" OutName="tex_007C10" Format="rgba16" Width="16" Height="16" Offset="0x7C10" /> - <DList Name="object_boss03_DL_007E50" Offset="0x7E50" /> - <DList Name="object_boss03_DL_007EB0" Offset="0x7EB0" /> - <!-- <Blob Name="object_boss03_Blob_007EC8" Size="0x1400" Offset="0x7EC8" /> --> - <Limb Name="object_boss03_Standardlimb_0092C8" Type="Standard" Offset="0x92C8" /> - <Limb Name="object_boss03_Standardlimb_0092D4" Type="Standard" Offset="0x92D4" /> - <Limb Name="object_boss03_Standardlimb_0092E0" Type="Standard" Offset="0x92E0" /> - <Limb Name="object_boss03_Standardlimb_0092EC" Type="Standard" Offset="0x92EC" /> - <Limb Name="object_boss03_Standardlimb_0092F8" Type="Standard" Offset="0x92F8" /> - <Limb Name="object_boss03_Standardlimb_009304" Type="Standard" Offset="0x9304" /> - <Limb Name="object_boss03_Standardlimb_009310" Type="Standard" Offset="0x9310" /> - <Limb Name="object_boss03_Standardlimb_00931C" Type="Standard" Offset="0x931C" /> - <Limb Name="object_boss03_Standardlimb_009328" Type="Standard" Offset="0x9328" /> - <Limb Name="object_boss03_Standardlimb_009334" Type="Standard" Offset="0x9334" /> - <Limb Name="object_boss03_Standardlimb_009340" Type="Standard" Offset="0x9340" /> - <Limb Name="object_boss03_Standardlimb_00934C" Type="Standard" Offset="0x934C" /> - <Limb Name="object_boss03_Standardlimb_009358" Type="Standard" Offset="0x9358" /> - <Limb Name="object_boss03_Standardlimb_009364" Type="Standard" Offset="0x9364" /> - <Skeleton Name="object_boss03_Skel_0093A8" Type="Flex" LimbType="Standard" Offset="0x93A8" /> - <Animation Name="object_boss03_Anim_009554" Offset="0x9554" /> - <Animation Name="object_boss03_Anim_0098F0" Offset="0x98F0" /> - <Animation Name="object_boss03_Anim_0099D0" Offset="0x99D0" /> - <Animation Name="object_boss03_Anim_009C14" Offset="0x9C14" /> - <Animation Name="object_boss03_Anim_009CF8" Offset="0x9CF8" /> - <Animation Name="object_boss03_Anim_00A020" Offset="0xA020" /> - <Animation Name="object_boss03_Anim_00A134" Offset="0xA134" /> - <Animation Name="object_boss03_Anim_00A6C8" Offset="0xA6C8" /> - <DList Name="object_boss03_DL_00A8B0" Offset="0xA8B0" /> - <DList Name="object_boss03_DL_00A948" Offset="0xA948" /> - <DList Name="object_boss03_DL_00A978" Offset="0xA978" /> - <DList Name="object_boss03_DL_00A9A8" Offset="0xA9A8" /> - <DList Name="object_boss03_DL_00A9D8" Offset="0xA9D8" /> - <DList Name="object_boss03_DL_00AA08" Offset="0xAA08" /> - <Texture Name="object_boss03_TLUT_00AAC0" OutName="tlut_00AAC0" Format="rgba16" Width="4" Height="4" Offset="0xAAC0" /> - <Texture Name="object_boss03_TLUT_00AAE0" OutName="tlut_00AAE0" Format="rgba16" Width="4" Height="4" Offset="0xAAE0" /> - <Texture Name="object_boss03_Tex_00AB00" OutName="tex_00AB00" Format="ci4" Width="64" Height="64" Offset="0xAB00" /> - <Texture Name="object_boss03_Tex_00B300" OutName="tex_00B300" Format="ci4" Width="64" Height="64" Offset="0xB300" /> - <!-- <Blob Name="object_boss03_Blob_00BB00" Size="0x10" Offset="0xBB00" /> --> - <DList Name="object_boss03_DL_00BD80" Offset="0xBD80" /> - <DList Name="object_boss03_DL_00BE40" Offset="0xBE40" /> - <DList Name="object_boss03_DL_00BF20" Offset="0xBF20" /> - <DList Name="object_boss03_DL_00BFD8" Offset="0xBFD8" /> - <DList Name="object_boss03_DL_00C0A8" Offset="0xC0A8" /> - <DList Name="object_boss03_DL_00C160" Offset="0xC160" /> - <Texture Name="object_boss03_TLUT_00C230" OutName="tlut_00C230" Format="rgba16" Width="4" Height="4" Offset="0xC230" /> - <Texture Name="object_boss03_Tex_00C250" OutName="tex_00C250" Format="ci4" Width="64" Height="64" Offset="0xC250" /> - <DList Name="object_boss03_DL_00CCC0" Offset="0xCCC0" /> - <DList Name="object_boss03_DL_00CD80" Offset="0xCD80" /> - <DList Name="object_boss03_DL_00CE60" Offset="0xCE60" /> - <DList Name="object_boss03_DL_00CF18" Offset="0xCF18" /> - <DList Name="object_boss03_DL_00CFE8" Offset="0xCFE8" /> - <DList Name="object_boss03_DL_00D0A0" Offset="0xD0A0" /> - <Texture Name="object_boss03_TLUT_00D170" OutName="tlut_00D170" Format="rgba16" Width="4" Height="4" Offset="0xD170" /> - <Texture Name="object_boss03_Tex_00D190" OutName="tex_00D190" Format="ci4" Width="64" Height="64" Offset="0xD190" /> - <Limb Name="object_boss03_Standardlimb_00D990" Type="Standard" Offset="0xD990" /> - <Limb Name="object_boss03_Standardlimb_00D99C" Type="Standard" Offset="0xD99C" /> - <Limb Name="object_boss03_Standardlimb_00D9A8" Type="Standard" Offset="0xD9A8" /> - <Limb Name="object_boss03_Standardlimb_00D9B4" Type="Standard" Offset="0xD9B4" /> - <Limb Name="object_boss03_Standardlimb_00D9C0" Type="Standard" Offset="0xD9C0" /> - <Limb Name="object_boss03_Standardlimb_00D9CC" Type="Standard" Offset="0xD9CC" /> - <Limb Name="object_boss03_Standardlimb_00D9D8" Type="Standard" Offset="0xD9D8" /> - <Limb Name="object_boss03_Standardlimb_00D9E4" Type="Standard" Offset="0xD9E4" /> - <Limb Name="object_boss03_Standardlimb_00D9F0" Type="Standard" Offset="0xD9F0" /> - <Skeleton Name="object_boss03_Skel_00DA20" Type="Flex" LimbType="Standard" Offset="0xDA20" /> - <Animation Name="object_boss03_Anim_00DAAC" Offset="0xDAAC" /> + <Animation Name="gGyorgIdleAnim" Offset="0x88" /> <!-- Original name is "bus_base". Maybe unused? --> + + <!-- Unused Majora's Wrath Whip Texture --> + <Texture Name="gGyorgUnusedMajorasWrathWhipTex" OutName="unused_majoras_wrath_whip" Format="rgba16" Width="8" Height="16" Offset="0xA0" /> + + <!-- Unused Majora's Wrath Whip DisplayLists --> + <DList Name="gGyorgUnusedMajorasWrathWhipDL1" Offset="0x200" /> + <DList Name="gGyorgUnusedMajorasWrathWhipDL2" Offset="0x278" /> + <DList Name="gGyorgUnusedMajorasWrathWhipDL3" Offset="0x2A8" /> + + <!--Gyorg Limb DisplayLists --> + <DList Name="gGyorgHeadDL" Offset="0x3398" /> + <DList Name="gGyorgJawDL" Offset="0x3A78" /> + <DList Name="gGyorgUpperLeftFinDL" Offset="0x3E38" /> + <DList Name="gGyorgLowerLeftFinDL" Offset="0x3FB8" /> + <DList Name="gGyorgUpperRightFinDL" Offset="0x42D0" /> + <DList Name="gGyorgLowerRightFinDL" Offset="0x4450" /> + <DList Name="gGyorgUpperTrunkDL" Offset="0x4768" /> + <DList Name="gGyorgLowerTrunkDL" Offset="0x4AC0" /> + <DList Name="gGyorgTailDL" Offset="0x5010" /> + + <!-- Unused Empty Texture Animation --> + <TextureAnimation Name="gGyorgUnused5388TexAnim" Offset="0x5388" /> + + <!-- Gyorg Textures --> + <Texture Name="gGyorgFinsSpikesAndJawTLUT" OutName="gyorg_fins_spikes_and_jaw_tlut" Format="rgba16" Width="4" Height="4" Offset="0x5390" /> + <Texture Name="gGyorgSidesTLUT" OutName="gyorg_sides_tlut" Format="rgba16" Width="4" Height="4" Offset="0x53B0" /> + <Texture Name="gGyorgMouthAndSpikeBacksideTLUT" OutName="gyorg_mouth_and_spike_backside_tlut" Format="rgba16" Width="4" Height="4" Offset="0x53D0" /> + <Texture Name="gGyorgBellyAndFinFleshTLUT" OutName="gyorg_belly_and_fin_flesh_tlut" Format="rgba16" Width="4" Height="4" Offset="0x53F0" /> + <Texture Name="gGyorgEyeTex" OutName="gyorg_eye" Format="rgba16" Width="32" Height="32" Offset="0x5410" /> + <Texture Name="gGyorgFinsSpikesAndJawTex" OutName="gyorg_fins_spikes_and_jaw" Format="ci4" Width="64" Height="64" Offset="0x5C10" /> + <Texture Name="gGyorgSidesTex" OutName="gyorg_sides" Format="ci4" Width="64" Height="64" Offset="0x6410" /> + <Texture Name="gGyorgMouthAndSpikeBacksideTex" OutName="gyorg_mouth_and_spike_backside" Format="ci4" Width="64" Height="64" Offset="0x6C10" /> + <Texture Name="gGyorgBellyAndFinFleshTex" OutName="gyorg_belly_and_fin_flesh" Format="ci4" Width="64" Height="64" Offset="0x7410" /> + <Texture Name="gGyorgHornsTeethAndClawsTex" OutName="gyorg_horns_teeth_claws" Format="rgba16" Width="16" Height="16" Offset="0x7C10" /> + + <!-- Bubble DisplayLists (texture comes from gameplay_keep) --> + <DList Name="gGyorgBubbleMaterialDL" Offset="0x7E50" /> + <DList Name="gGyorgBubbleModelDL" Offset="0x7EB0" /> + + <!-- Gyorg Title Card --> + <Texture Name="gGyorgTitleCardTex" OutName="gyorg_title_card" Format="i8" Width="128" Height="40" Offset="0x7EC8" /> + + <!-- Gyorg Limbs --> + <Limb Name="gGyorgRootLimb" Type="Standard" Offset="0x92C8" /> + <Limb Name="gGyorgHeadLimb" Type="Standard" Offset="0x92D4" /> + <Limb Name="gGyorgBodyRootLimb" Type="Standard" Offset="0x92E0" /> + <Limb Name="gGyorgUpperTrunkLimb" Type="Standard" Offset="0x92EC" /> + <Limb Name="gGyorgLowerTrunkLimb" Type="Standard" Offset="0x92F8" /> + <Limb Name="gGyorgTailLimb" Type="Standard" Offset="0x9304" /> + <Limb Name="gGyorgRightFinRootLimb" Type="Standard" Offset="0x9310" /> + <Limb Name="gGyorgUpperRightFinLimb" Type="Standard" Offset="0x931C" /> + <Limb Name="gGyorgLowerRightFinLimb" Type="Standard" Offset="0x9328" /> + <Limb Name="gGyorgLeftFinRootLimb" Type="Standard" Offset="0x9334" /> + <Limb Name="gGyorgUpperLeftFinLimb" Type="Standard" Offset="0x9340" /> + <Limb Name="gGyorgLowerLeftFinLimb" Type="Standard" Offset="0x934C" /> + <Limb Name="gGyorgJawRootLimb" Type="Standard" Offset="0x9358" /> + <Limb Name="gGyorgJawLimb" Type="Standard" Offset="0x9364" /> + + <!-- Gyorg Skeleton--> + <Skeleton Name="gGyorgSkel" Type="Flex" LimbType="Standard" Offset="0x93A8" /> + + <!-- Gyorg Animations --> + <Animation Name="gGyorgFloppingAnim" Offset="0x9554" /> <!-- Original name is "bus_dead" --> + <Animation Name="gGyorgJumpingAnim" Offset="0x98F0" /> <!-- Original name is "bus_jump". Maybe unused? --> + <Animation Name="gGyorgStunnedAnim" Offset="0x99D0" /> <!-- Original name is "bus_sibire" ("paralyzed") --> + <Animation Name="gGyorgBackingUpAnim" Offset="0x9C14" /> <!-- Original name is "bus_stop" --> + <Animation Name="gGyorgFastSwimmingAnim" Offset="0x9CF8" /> <!-- Original name is "bus_swim" --> + <Animation Name="gGyorgGentleSwimmingAnim" Offset="0xA020" /> <!-- Maybe unused? --> + <Animation Name="gGyorgTailSweepAnim" Offset="0xA134" /> <!-- Maybe unused? --> + <Animation Name="gGyorgCrawlingAnim" Offset="0xA6C8" /> + + <!-- Seaweed DisplayLists --> + <DList Name="gGyorgSeaweedPiece1DL" Offset="0xA8B0" /> + <DList Name="gGyorgSeaweedPiece2DL" Offset="0xA948" /> + <DList Name="gGyorgSeaweedPiece3DL" Offset="0xA978" /> + <DList Name="gGyorgSeaweedPiece4DL" Offset="0xA9A8" /> + <DList Name="gGyorgSeaweedPiece5DL" Offset="0xA9D8" /> + <DList Name="gGyorgSeaweedTopDL" Offset="0xAA08" /> + + <!-- Seaweed Textures --> + <Texture Name="gGyorgSeaweedTopTLUT" OutName="gyorg_seaweed_top_tlut" Format="rgba16" Width="4" Height="4" Offset="0xAAC0" /> + <Texture Name="gGyorgSeaweedTLUT" OutName="gyord_seaweed_tlut" Format="rgba16" Width="4" Height="4" Offset="0xAAE0" /> + <Texture Name="gGyorgSeaweedTopTex" OutName="gyorg_seaweed_top" Format="ci4" Width="64" Height="64" Offset="0xAB00" /> + <Texture Name="gGyorgSeaweedTex" OutName="gyorg_seaweed" Format="ci4" Width="64" Height="64" Offset="0xB300" /> + + <!-- Unused Empty Texture Animation --> + <TextureAnimation Name="gGyorgUnusedBB00TexAnim" Offset="0xBB00" /> + + <!-- Unused Duplicate of Small Fish Limb DisplayLists --> + <DList Name="gUnusedGyorgSmallFishHeadDL" Offset="0xBD80" /> + <DList Name="gUnusedGyorgSmallFishTrunkDL" Offset="0xBE40" /> + <DList Name="gUnusedGyorgSmallFishRightFinDL" Offset="0xBF20" /> + <DList Name="gUnusedGyorgSmallFishDorsalFinDL" Offset="0xBFD8" /> + <DList Name="gUnusedGyorgSmallFishLeftFinDL" Offset="0xC0A8" /> + <DList Name="gUnusedGyorgSmallFishTailFinDL" Offset="0xC160" /> + + <!-- Unused Duplicate of Small Fish Textures --> + <Texture Name="gUnusedGyorgSmallFishTLUT" OutName="unused_small_fish_tlut" Format="rgba16" Width="4" Height="4" Offset="0xC230" /> + <Texture Name="gUnusedGyorgSmallFishTex" OutName="unused_small_fish" Format="ci4" Width="64" Height="64" Offset="0xC250" /> + + <!-- Small Fishes Limb DisplayLists --> + <DList Name="gGyorgSmallFishHeadDL" Offset="0xCCC0" /> + <DList Name="gGyorgSmallFishTrunkDL" Offset="0xCD80" /> + <DList Name="gGyorgSmallFishRightFinDL" Offset="0xCE60" /> + <DList Name="gGyorgSmallFishDorsalFinDL" Offset="0xCF18" /> + <DList Name="gGyorgSmallFishLeftFinDL" Offset="0xCFE8" /> + <DList Name="gGyorgSmallFishTailFinDL" Offset="0xD0A0" /> + + <!-- Small Fishes Textures --> + <Texture Name="gGyorgSmallFishTLUT" OutName="small_fish_tlut" Format="rgba16" Width="4" Height="4" Offset="0xD170" /> + <Texture Name="gGyorgSmallFishTex" OutName="small_fish" Format="ci4" Width="64" Height="64" Offset="0xD190" /> + + <!-- Small Fishes Limbs --> + <Limb Name="gGyorgSmallFishRootLimb" Type="Standard" EnumName="GYORG_SMALL_FISH_LIMB_ROOT" Offset="0xD990" /> + <Limb Name="gGyorgSmallFishBodyRootLimb" Type="Standard" EnumName="GYORG_SMALL_FISH_LIMB_BODY_ROOT" Offset="0xD99C" /> + <Limb Name="gGyorgSmallFishTrunkRootLimb" Type="Standard" EnumName="GYORG_SMALL_FISH_LIMB_TRUNK_ROOT" Offset="0xD9A8" /> + <Limb Name="gGyorgSmallFishTailFinLimb" Type="Standard" EnumName="GYORG_SMALL_FISH_LIMB_TAIL_FIN" Offset="0xD9B4" /> + <Limb Name="gGyorgSmallFishTrunkLimb" Type="Standard" EnumName="GYORG_SMALL_FISH_LIMB_TRUNK" Offset="0xD9C0" /> + <Limb Name="gGyorgSmallFishLeftFinLimb" Type="Standard" EnumName="GYORG_SMALL_FISH_LIMB_LEFT_FIN" Offset="0xD9CC" /> + <Limb Name="gGyorgSmallFishDorsalFinLimb" Type="Standard" EnumName="GYORG_SMALL_FISH_LIMB_DORSAL_FIN" Offset="0xD9D8" /> + <Limb Name="gGyorgSmallFishRightFinLimb" Type="Standard" EnumName="GYORG_SMALL_FISH_LIMB_RIGHT_FIN" Offset="0xD9E4" /> + <Limb Name="gGyorgSmallFishHeadLimb" Type="Standard" EnumName="GYORG_SMALL_FISH_LIMB_HEAD" Offset="0xD9F0" /> + + <!-- Small Fishes Skeleton --> + <Skeleton Name="gGyorgSmallFishSkel" Type="Flex" LimbType="Standard" LimbNone="GYORG_SMALL_FISH_LIMB_NONE" LimbMax="GYORG_SMALL_FISH_LIMB_MAX" EnumName="GyorgSmallFishLimbs" Offset="0xDA20" /> + + <!-- Small Fishes Animation --> + <Animation Name="gGyorgSmallFishSwimAnim" Offset="0xDAAC" /> <!-- Original name is "minibus_b_swim" --> </File> </Root> diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c index 86bc7d6a8..ba49ab93e 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c @@ -12,6 +12,12 @@ #define THIS ((EnTanron3*)thisx) +#define WORK_TIMER_PICK_NEW_DEVIATION 0 +#define WORK_TIMER_DIE 0 +#define WORK_TIMER_OUT_OF_WATER 1 +#define WORK_TIMER_ATTACK 2 +#define WORK_TIMER_WAIT 2 + void EnTanron3_Init(Actor* thisx, GlobalContext* globalCtx); void EnTanron3_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnTanron3_Update(Actor* thisx, GlobalContext* globalCtx); @@ -107,8 +113,8 @@ void EnTanron3_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -1.0f; Collider_InitAndSetCylinder(globalCtx, &this->atCollider, &this->actor, &sCylinderInit); Collider_InitAndSetCylinder(globalCtx, &this->acCollider, &this->actor, &sCylinderInit); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_boss03_Skel_00DA20, &object_boss03_Anim_00DAAC, - this->jointTable, this->morphTable, 10); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gGyorgSmallFishSkel, &gGyorgSmallFishSwimAnim, this->jointTable, + this->morphTable, GYORG_SMALL_FISH_LIMB_MAX); Actor_SetScale(&this->actor, 0.02f); EnTanron3_SetupLive(this, globalCtx); this->actor.flags &= ~1; @@ -142,10 +148,10 @@ void EnTanron3_SpawnBubbles(EnTanron3* this, GlobalContext* globalCtx) { void EnTanron3_SetupLive(EnTanron3* this, GlobalContext* globalCtx) { this->actionFunc = EnTanron3_Live; - Animation_MorphToLoop(&this->skelAnime, &object_boss03_Anim_00DAAC, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &gGyorgSmallFishSwimAnim, -10.0f); this->rotationStep = 0; this->rotationScale = 5; - this->workTimer[TANRON3_WORK_TIMER_PICK_NEW_DEVIATION] = 50; + this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] = 50; this->actor.speedXZ = 5.0f; this->speedMaxStep = 0.5f; this->deviation.x = randPlusMinusPoint5Scaled(500.0f); @@ -176,13 +182,13 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { if ((player->actor.bgCheckFlags & 1) && player->actor.shape.feetPos[0].y >= 438.0f) { // Player is standing on the central platform, so stop chasing them this->isNonHostile = true; - } else if (this->isNonHostile && this->workTimer[TANRON3_WORK_TIMER_WAIT] == 0 && !(this->timer & 0x1F)) { + } else if (this->isNonHostile && this->workTimer[WORK_TIMER_WAIT] == 0 && !(this->timer & 0x1F)) { xDistance = this->targetPos.x - player->actor.world.pos.x; zDistance = this->targetPos.z - player->actor.world.pos.z; if (sqrtf(SQ(xDistance) + SQ(zDistance)) < 500.0f) { // Player is in the water and close enough, so start chasing them this->isNonHostile = false; - this->workTimer[TANRON3_WORK_TIMER_ATTACK] = 150; + this->workTimer[WORK_TIMER_ATTACK] = 150; } } @@ -204,8 +210,8 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { // If the player gets eaten by Gyorg, or if the attack timer ran out, // stop chasing the player for a little bit. - if (this->workTimer[TANRON3_WORK_TIMER_ATTACK] == 0 || (player->stateFlags2 & 0x80)) { - this->workTimer[TANRON3_WORK_TIMER_WAIT] = 150; + if (this->workTimer[WORK_TIMER_ATTACK] == 0 || (player->stateFlags2 & 0x80)) { + this->workTimer[WORK_TIMER_WAIT] = 150; this->isNonHostile = true; } break; @@ -234,9 +240,9 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { break; } - if (this->workTimer[TANRON3_WORK_TIMER_OUT_OF_WATER] == 0) { - if (this->workTimer[TANRON3_WORK_TIMER_PICK_NEW_DEVIATION] == 0 && this->actor.speedXZ > 1.0f) { - this->workTimer[TANRON3_WORK_TIMER_PICK_NEW_DEVIATION] = Rand_ZeroFloat(20.0f); + if (this->workTimer[WORK_TIMER_OUT_OF_WATER] == 0) { + if (this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] == 0 && this->actor.speedXZ > 1.0f) { + this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] = Rand_ZeroFloat(20.0f); this->deviation.x = randPlusMinusPoint5Scaled(100.0f); this->deviation.y = randPlusMinusPoint5Scaled(50.0f + extraScaleY); this->deviation.z = randPlusMinusPoint5Scaled(100.0f); @@ -266,7 +272,7 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { // Fish is above water but hasn't touched land before this->actor.gravity = -1.0f; this->targetPosWithDeviation.y = this->waterSurfaceYPos - 50.0f; - this->workTimer[TANRON3_WORK_TIMER_OUT_OF_WATER] = 25; + this->workTimer[WORK_TIMER_OUT_OF_WATER] = 25; Math_ApproachS(&this->actor.world.rot.x, 0x3000, 5, 0xBD0); if (this->actor.bgCheckFlags & 8) { this->actor.speedXZ = 0.0f; @@ -318,9 +324,9 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { } this->currentRotationAngle += this->nextRotationAngle; - this->trunkRotation = Math_SinS(this->currentRotationAngle) * 5000.0f; - this->bodyRotation = Math_SinS(this->currentRotationAngle + 0x6978) * 5000.0f; this->tailRotation = Math_SinS(this->currentRotationAngle) * 5000.0f; + this->bodyRotation = Math_SinS(this->currentRotationAngle + 0x6978) * 5000.0f; + this->trunkRotation = Math_SinS(this->currentRotationAngle) * 5000.0f; if (!this->isBeached) { this->actor.shape.rot = this->actor.world.rot; } @@ -338,14 +344,14 @@ void EnTanron3_SetupDie(EnTanron3* this, GlobalContext* globalCtx) { zDistance = this->actor.world.pos.z - player->actor.world.pos.z; this->actor.world.rot.x = Math_FAtan2F(sqrtf(SQ(xDistance) + SQ(zDistance)), -yDistance); this->actor.world.rot.y = Math_FAtan2F(zDistance, xDistance); - this->workTimer[TANRON3_WORK_TIMER_DIE] = 6; + this->workTimer[WORK_TIMER_DIE] = 6; this->actor.speedXZ = 10.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_MINI_DEAD); } void EnTanron3_Die(EnTanron3* this, GlobalContext* globalCtx) { Actor_MoveWithoutGravityReverse(&this->actor); - if (this->workTimer[TANRON3_WORK_TIMER_DIE] == 0) { + if (this->workTimer[WORK_TIMER_DIE] == 0) { EnTanron3_SpawnBubbles(this, globalCtx); Actor_MarkForDeath(&this->actor); if (Rand_ZeroOne() < 0.3f) { @@ -418,7 +424,7 @@ void EnTanron3_Update(Actor* thisx, GlobalContext* globalCtx) { if ((s8)sGyorg->actor.colChkInfo.health <= 0 && this->actionFunc != EnTanron3_Die) { EnTanron3_SetupDie(this, globalCtx); - this->workTimer[TANRON3_WORK_TIMER_DIE] = 0; + this->workTimer[WORK_TIMER_DIE] = 0; } } @@ -426,15 +432,18 @@ s32 EnTanron3_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL Actor* thisx) { EnTanron3* this = THIS; - if (limbIndex == 1) { + if (limbIndex == GYORG_SMALL_FISH_LIMB_ROOT) { rot->y += this->bodyRotation; } - if (limbIndex == 3) { - rot->y += this->tailRotation; - } - if (limbIndex == 4) { + + if (limbIndex == GYORG_SMALL_FISH_LIMB_TRUNK_ROOT) { rot->y += this->trunkRotation; } + + if (limbIndex == GYORG_SMALL_FISH_LIMB_TAIL_FIN) { + rot->y += this->tailRotation; + } + return false; } @@ -442,6 +451,7 @@ void EnTanron3_Draw(Actor* thisx, GlobalContext* globalCtx) { EnTanron3* this = THIS; OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); if ((this->fogTimer % 2) != 0) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); @@ -449,5 +459,6 @@ void EnTanron3_Draw(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnTanron3_OverrideLimbDraw, NULL, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); + CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h index 9a2cb25da..9d67154df 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h @@ -2,16 +2,12 @@ #define Z_EN_TANRON3_H #include "global.h" +#include "objects/object_boss03/object_boss03.h" struct EnTanron3; typedef void (*EnTanron3ActionFunc)(struct EnTanron3*, GlobalContext*); -#define TANRON3_WORK_TIMER_PICK_NEW_DEVIATION 0 -#define TANRON3_WORK_TIMER_DIE 0 -#define TANRON3_WORK_TIMER_OUT_OF_WATER 1 -#define TANRON3_WORK_TIMER_ATTACK 2 -#define TANRON3_WORK_TIMER_WAIT 2 #define TANRON3_WORK_TIMER_MAX 3 typedef struct { @@ -28,8 +24,8 @@ typedef struct { typedef struct EnTanron3 { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; - /* 0x188 */ Vec3s jointTable[10]; - /* 0x1C4 */ Vec3s morphTable[10]; + /* 0x188 */ Vec3s jointTable[GYORG_SMALL_FISH_LIMB_MAX]; + /* 0x1C4 */ Vec3s morphTable[GYORG_SMALL_FISH_LIMB_MAX]; /* 0x200 */ s16 timer; /* 0x202 */ u8 isNonHostile; // If true, the fish will not move towards the player to attack them /* 0x203 */ u8 isBeached; // If true, the fish is on the central platform flopping around @@ -48,8 +44,8 @@ typedef struct EnTanron3 { /* 0x248 */ Vec3s targetShapeRotation; /* 0x250 */ s32 currentRotationAngle; /* 0x254 */ s32 nextRotationAngle; - /* 0x258 */ s16 tailRotation; - /* 0x25A */ s16 trunkRotation; + /* 0x258 */ s16 trunkRotation; + /* 0x25A */ s16 tailRotation; /* 0x25C */ s16 bodyRotation; /* 0x260 */ ColliderCylinder atCollider; /* 0x2AC */ ColliderCylinder acCollider; |
