AnimSpecific¶
AnimSpecific is a system that allows the game to go beyond its standard conventions of the animstate and to perform more complex animation setup. The system is made of multiple methods that are called at specific points:
- UpdateAnimSpecific
- AnimSpecificQuirks
UpdateAnimSpecific¶
This is a void returning parameterless method on EntityControl that is ran at specific points involving the animstate updating. It can contain logic specific to the entity's AnimIDs which allows to use non standard animations and setup. This method doesn't apply to item entities.
It's a more frequently called method because not only it gets called everytime the animid
, the animstate changes or during a Freeze handling event, it can be called externally if needed.
First, all objects in animspecific
are destroyed if any were present. Then, the AnimIDs specific part occurs (only high level details are provided as most of these involve detailed rendering):
EverlastingKing
: Theshadowsize
is set to 5.0 if the animstate is 115MimicSpider
: TheOutOfBattle
animation parameter is set depending onbattle
. Theshadowsize
is set to 3.0 unless the animstate isIdle
andWalk
in which case, the value is set to 1.75 insteadBee
: if the animstate isBattleIdle
,animspecific
is initialised with one element being aPrefabs/AnimSpecific/BeeBIdle
from the root of the asset tree. This is her Beemerang animation when idling during battle.Watcher
: The same than Moth, but before, the secondextras
is destroyed if present (unless he was underground during the battle) with thebobspeed
andbobrange
set to their start field counterpart.Moth
: if the animstate isBattleIdle
orPickAction
,animspecific
is initialised with one element being aPrefabs/AnimSpecific/mothbattlesphere
. Either of the 2 animstate determines how it will be positioned (fixed ifBattleIdle
or with a SpinAround forPickAction
)Eremi
: If the animstate isHappy
, thewalkstate
becomesChase
and thebasestate
becomesHappy
Tanjerin
: Thewalkstate
is overriden to 101 if the animstate wasAngry
orSurprised
and toWalk
if it wasIdle
orSad
JumpingSpider
: Same than Spuder, but before, the bubble's sprite is enabled or disabled depending on the battle'senemydata
inbattleid
'sholditem
is higher than -1. This just manage if the item sprite of the bubble should be enabled or not.Ruffian
: This only applies if theextras
have not been initialised. This initialises 4 of them which is his chains (the first 3) and ball (the 4th one). It will then setup them in a specific way such that the first 3 are linked together to the ball. The ball gets a FollowerLite and a ShadowLite. It also considershologram
for the materials.Strider
: Initialises theextraanims
if they weren't already to 4 new elements and theextras
to being the second child of the model and have all the children of that be theextraanims
. This simply setups the legs and their animator. Finally the onlyextras
gets its scale adjusted on the Z axis to 1.0 unless the animstate isWalk
orChase
in which case, the value is 0.5. This creates a constricting effects on his legs when neededDeadLanderC
:extraanims
is initialised to 4 new elements being the second, third, fourth and fifth child of themodel
. Then, specific animations are played on them depending of the animstate. This essentially manages the legs.Scorpion
: Same then Spuder, but before, thebasestate
andwalkstate
are overridden to 150 and 151 respectively if the current Area is Giant's Lair. This is what makes them look different in that area.Spuder
, DivingSpider and PeacockSpider: This is a very complex management of the legs. Notably,overridejump
is set to false all the time andextraanims
is initialised with the legs's animators. This also manages special animation clips to play on the legs.Venus
: Setup 6extraanims
being all the children of the second child of themodel
with their speed being set to 1 unless the animstate is 100 or 101 in which case, the value is 0. This simply manages her legs animationsBeeBot
: Ensure its wings's StaticModelAnim are enabled when theicecube
isn't present or disabled if it is with fixed angles.MotherChomper
:extras
is initialised if it wasn't already to 1 element containing the second child of the second child of themodel
which is the ground spriteVenusGuardian
: This is where the arms information are initialised ifextraanims
wasn't initialised yet. Theextraanims
are both arm's animator. It also initializes 4extras
with the first 2 being her leaf wings, the third being the ground and the 4th being the flower canon on her left arm. The ground and flower canon will be enabled or disabled depending on herheight
and animstate. Finally, this also plays the proper animations on theextraanims
depending on herheight
, animstate and other conditions.AngryPlant
: The onlyspinextra
is initialised to zero or (0.0, -20.0, 0.0) if theheight
is higher than 0.1. This also sets the onlyextras
scale depending on theheight
.Seedling
: If the animstate isHurt
when it had a copter with theheight
above 0.1, it will be deparented while the object will fly offscreen at the top using a LerpObject coroutine
AnimSpecificQuirks¶
This is a void returning parameterless method on EntityControl that is ran on LateUpdate before UpdateSprite and on UpdateSprite itself if the animstate or the inice
changed. This is more a way to adjust the animation for a specific AnimIDs so it can have custom logic to it. It can be seen as an update method because it handles the adjustements of the extra fields such as extras
, spinextra
, extralines
and extrasprites
, but it also allows specific AnimIDs to have their own update logic. Unlike the other anim specific update method, this is only called internally during the normal update cycle.
Here are all the specific update logic defined (only described at a high level since most of it is rendering specific):
ChompyChan
:extrasprites
is ensured to have one SpriteRender and it is enabled depending on the value of flags 404 (Chompy has a ribbon on her). Then,ChompyRibbon
is called which only sets the proper color of the sprite depending on which ribbon is in flagvar 56 (The Items id of the ribbon equipped on her).JumpingSpider
: If the animstate isChase
, thewalktype
is set to Jump and to Normal otherwiseSeedlingKing
: Unless thesubentity
weren't inialised yet, override each's animstate toHurt
if the entity's animstate isHurt
or toChase
otherwise.Watcher
:overrideshadow
is set todigging
and theshadow
's enabled to the inverse ofdigging
. Then, nothing happens if theextras
(containing his book) weren't initialized yet, but if they are, the local position of the only one is updated on the y with a Lerp between the current y and a vector determined by thespritetransform
local position, the animstate and ifdigging
was true or not. This lerp is done with a factor of 0.1. The whole thing essentially just renders the book with a floating effect unless he isdigging
.BeeBot
: This only applies if the entity isdead
or in the process of dying (iskill
ordeatcoroutine
not being null). When it does, the animationIdle2
orHurt2
is played depending on the current form of the entity which is determined either by the current battle data if it's abattle
entity or the animstate if it's not.Krawler
andCursedSkull
: Only applies wheninice
has changed (tracked bylastice
) and thenpcdata
if present doesn't have an enableddisguiseobj
. This will play theIceShatter
particle and also control whether the first extras's ParticleSystem should play wheninice
is true or stop otherwise.MotherChomper
: the firstextras
if it exist has its angle set to zero which is the ground objectVenusGuardian
: Only applies whenextras
has been initialised. If it was, the thirdextras
's angles (which is the ground object) is set to zero and the first 2 (her leaf wings) have their angles adjusted to a sin curve on the x axis if theheight
is higher than 0.1 and there's noicecube
.Scarlet
: Theshadowsize
is set to 2.5 unless the animstate is among specific values which will cause the value to be set to 1.25 instead.Zasp
: Theshadowsize
is set to 1.0 unless the animstate is among specific values which will cause the value to be set to 1.5 or 1.75 instead depending on the animstateShielderAnt
: Theshadowsize
is set to 1.0 unless the animstate isKO
which causes the value to be set to 2.0 instead.Seedling
: This manages thecopter
sprite if applicable which is where theheight
is above 0.1 among other conditions. It initialises theextras
if it wasn't already with one element being that sprite and it also initialisesspinextra
to 20.0 units on the z axis. This finally adjusts thebobspeed
andbobrange
to 2.0 and 4.0 respectively if they were lower than 0.1 (this also assign the start field counterpart to the new value)Flowering
: Same then Seedling, but before, the onlyextras
is activated ifflyinganim
and the animstate is a animstate > Extra animations, it is disabled otherwiseUltimaxTank
: Theextras
initialised first if they weren't already. The first 3 extras are the wheels, the 4th is the body object (the one above the wheels) and the 5th is the missile launchers. Then, their position and angles are adjusted depending on the animstateMidgeBroodmother
: This only applies whenmodel
is not null. Theextras
(the wings) are initialised if they weren't already to the children of the first child of themodel
. From there, their angles are adjusted.DeadLanderB
: If theextrasprites
weren't initialised, this method will initialise them,extralines
andspinextra
. This essentially manages the balloons and the lines connecting them by setting various properties about them (also considershologram
andcotunknown
).KeyR
andKeyL
: The angles are adjusted on the Z axis depending on the animstate andinice
.Tablet
: In battle, the sprite is set depending on if the HP. If the HP is below 3, thestartscale
is set to Vector3.one * 0.75Pitcher
andPitcherSummon
: This only applies if theextras
were intialised. It adjusts the secondextras
's position (the end of the next) to the first's position (the head) + the firstspinextra
.Midge
: Only applies if theextras
were initialised. It manages the position and angles of the wings inextras
depending on the specific animstate.
For all entity except DeadLanderB
, Pitcher
or PitcherSummon
, every extras
's angles gets incremented by the spinextra
of the corresponding index if it exist.