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: Theshadowsizeis set to 5.0 if the animstate is 115MimicSpider: TheOutOfBattleanimation parameter is set depending onbattle. Theshadowsizeis set to 3.0 unless the animstate isIdleandWalkin which case, the value is set to 1.75 insteadBee: if the animstate isBattleIdle,animspecificis initialised with one element being aPrefabs/AnimSpecific/BeeBIdlefrom the root of the asset tree. This is her Beemerang animation when idling during battle.Watcher: The same than Moth, but before, the secondextrasis destroyed if present (unless he was underground during the battle) with thebobspeedandbobrangeset to their start field counterpart.Moth: if the animstate isBattleIdleorPickAction,animspecificis initialised with one element being aPrefabs/AnimSpecific/mothbattlesphere. Either of the 2 animstate determines how it will be positioned (fixed ifBattleIdleor with a SpinAround forPickAction)Eremi: If the animstate isHappy, thewalkstatebecomesChaseand thebasestatebecomesHappyTanjerin: Thewalkstateis overriden to 101 if the animstate wasAngryorSurprisedand toWalkif it wasIdleorSadJumpingSpider: Same than Spuder, but before, the bubble's sprite is enabled or disabled depending on the battle'senemydatainbattleid'sholditemis higher than -1. This just manage if the item sprite of the bubble should be enabled or not.Ruffian: This only applies if theextrashave 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 considershologramfor the materials.Strider: Initialises theextraanimsif they weren't already to 4 new elements and theextrasto 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 onlyextrasgets its scale adjusted on the Z axis to 1.0 unless the animstate isWalkorChasein which case, the value is 0.5. This creates a constricting effects on his legs when neededDeadLanderC:extraanimsis 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, thebasestateandwalkstateare 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,overridejumpis set to false all the time andextraanimsis initialised with the legs's animators. This also manages special animation clips to play on the legs.Venus: Setup 6extraanimsbeing all the children of the second child of themodelwith 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 theicecubeisn't present or disabled if it is with fixed angles.MotherChomper:extrasis initialised if it wasn't already to 1 element containing the second child of the second child of themodelwhich is the ground spriteVenusGuardian: This is where the arms information are initialised ifextraanimswasn't initialised yet. Theextraanimsare both arm's animator. It also initializes 4extraswith 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 herheightand animstate. Finally, this also plays the proper animations on theextraanimsdepending on herheight, animstate and other conditions.AngryPlant: The onlyspinextrais initialised to zero or (0.0, -20.0, 0.0) if theheightis higher than 0.1. This also sets the onlyextrasscale depending on theheight.Seedling: If the animstate isHurtwhen it had a copter with theheightabove 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:extraspritesis ensured to have one SpriteRender and it is enabled depending on the value of flags 404 (Chompy has a ribbon on her). Then,ChompyRibbonis 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, thewalktypeis set to Jump and to Normal otherwiseSeedlingKing: Unless thesubentityweren't inialised yet, override each's animstate toHurtif the entity's animstate isHurtor toChaseotherwise.Watcher:overrideshadowis set todiggingand 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 thespritetransformlocal position, the animstate and ifdiggingwas 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 isdeador in the process of dying (iskillordeatcoroutinenot being null). When it does, the animationIdle2orHurt2is played depending on the current form of the entity which is determined either by the current battle data if it's abattleentity or the animstate if it's not.KrawlerandCursedSkull: Only applies wheninicehas changed (tracked bylastice) and thenpcdataif present doesn't have an enableddisguiseobj. This will play theIceShatterparticle and also control whether the first extras's ParticleSystem should play wheniniceis true or stop otherwise.MotherChomper: the firstextrasif it exist has its angle set to zero which is the ground objectVenusGuardian: Only applies whenextrashas 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 theheightis higher than 0.1 and there's noicecube.Scarlet: Theshadowsizeis set to 2.5 unless the animstate is among specific values which will cause the value to be set to 1.25 instead.Zasp: Theshadowsizeis 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: Theshadowsizeis set to 1.0 unless the animstate isKOwhich causes the value to be set to 2.0 instead.Seedling: This manages thecoptersprite if applicable which is where theheightis above 0.1 among other conditions. It initialises theextrasif it wasn't already with one element being that sprite and it also initialisesspinextrato 20.0 units on the z axis. This finally adjusts thebobspeedandbobrangeto 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 onlyextrasis activated ifflyinganimand the animstate is a animstate > Extra animations, it is disabled otherwiseUltimaxTank: Theextrasinitialised 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 whenmodelis 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 theextraspritesweren't initialised, this method will initialise them,extralinesandspinextra. This essentially manages the balloons and the lines connecting them by setting various properties about them (also considershologramandcotunknown).KeyRandKeyL: 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, thestartscaleis set to Vector3.one * 0.75PitcherandPitcherSummon: This only applies if theextraswere 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 theextraswere initialised. It manages the position and angles of the wings inextrasdepending 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.