UpdateAnim¶
This method updates the battle entities's animstate considering various conditions.
private void UpdateAnim(bool onlyplayer)
Parameters¶
onlyplayer: Tells if only the player party members should be updated. There is an overload without this parameter that sends false
Procedure¶
There are 2 parts to this: the player party members one and the enemy party members one. The latter is only done if onlyplayer is false.
Players¶
This applies to each element of playerdata.
The enablement of the corresponding tiredpart has its enablement changed to be enabled only when the player party member's cantmove is 0 or below (they have at least 1 actor turns available), the player hp is above 0 and its tired is above 0. It is disabled otherwise.
The rest of the logic isn't done if the player's battleentity.overrideanim is true.
- If the
hpis 0 or below, battleentity.animstateis set to 18 (KO) - Otherwise, if the player has the EventStop, Freeze or Numb condition, battleentity.
animstateis set to 11 (Hurt) - Otherwise, if the
currentturnis the player index (it's the one being selected for taking action) and currentaction isBaseAction(the main vine action menu): - Otherwise, battleentity.
animstateis only changed ifblockcooldownexpired:- If the player has the Sturdy condition, battleentity.
animstateis set to 24 (Block) - If the player has the Sleep condition, battleentity.
animstateis set to 14 (Sleep) - If the
hpis above 4 and the player doesn't have the Poison or Fire condition (it also implies it's not the currently selected player as it was ruled out above):- If the player has the Taunted condition or it has the
Berserkermedal equipped, battleentity.animstateis set to the return of AngryAnim which is a value that depends on the player animid: 10 (Flustered) forBee, 5 (Angry) forBeetleand 102 forMoth - Otherwise, battleentity.
animstateis set to 13 (BattleIdle)
- If the player has the Taunted condition or it has the
- Otherwise, battleentity.
animstateis set to 17 (WeakBattleIdle)
- If the player has the Sturdy condition, battleentity.
Enemies¶
This applies to each element of enemydata if onlyplayer is false.
battleentity.animstate is only set if the hp is above 0 and the entity.droproutine is not in progress.
- If the enemy has the Flipped condition:
- If the enemy also has the Sleep condition, battleentity.
animstateis set to 25 (SleepFallen) - If it doesn't have it, battleentity.
animstateis set to 15 (Fallen)
- If the enemy also has the Sleep condition, battleentity.
- Otherwise, if the enemy has the Freeze or Numb condition, battleentity.
animstateis set to 11 (Hurt) - Otherwise, if the enemy has the Sleep condition, battleentity.
animstateis set to 14 (Sleep) - Otherwise, if the enemy holditem isn't -1 (the enemy is holding an item), battleentity.
animstateis set to 4 (ItemGet) - Otherwise, if the enemy isdefending, battleentity.
animstateis set to 24 (Block) - Otherwise, battleentity.
animstateis set to battleentity.basestate