RevivePlayer¶
This method properly revive a player party member.
private void RevivePlayer(int id, int hp, bool showcounter)
Parameters¶
id
: Theplayerdata
index to revivehp
: Thehp
to set the player party member. If it's negative, thehp
will not be changed. NOTE: this should only be done when something else is guaranteed to heal the player party member as failure to do so will lead thehp
left dangling at 0 while the actor isn't fully deadshowcounter
: Whether to call Heal or not as part of thehp
increase
Procedure¶
- battleentity.
dead
is set to false - battleentity.
iskill
is set to false - battleentity has LockRigid(false) called on it which unlocks its
rigid
- battleentity.
shadow
is enabled - battleentity.
nocondition
is set to false - The
playerdata
'sturnssincedeath
is set to 0 - If the player party member is included in
deadmembers
:- The
playerdata
'scantmove
is set depending on on conditions:- If
enemy
is true (we are in the enemy phase or later), the value is set to 1 meaning one actor turn is needed for an action to be available - Otherwise (we are in the player phase) if the player party member has the
LastWind
medal equipped while theirhp
is 4 or lower, the value is set to -1 meaning 2 actor turns become available - Otheriwse (we are in the player phase, but the
LastWind
medal doesn't apply), the value is set to 0 meaning 1 actor turn becomes available
- If
- ClearStatus is called on the player party member
- The
playerdata
'smoreturnnextturn
is set to 0 - The
playerdata
'stired
is set to 0 - battleentity.animstate is set to 13 (
BattleIdle
)
- The
- If the sent hp isn't negative:
- If showcounter is false, the player party member's
hp
is increased by the sent hp clamped from 0 to itsmaxhp
- Otherwise, Heal is called on the player party member with the sent hp amount to heal
- If showcounter is false, the player party member's
- If battleentity.
deathcoroutine
is in progress, it is stopped - battleentity.
deathcoroutine
is set to null - A ReviveFix coroutine is started with the id sent which will do the following:
- 0.5 seconds are yielded
- If battleentity.
deathcoroutine
is in progress, it is stopped - battleentity.
deathcoroutine
is set to null - battleentity.
dead
is set to false - battleentity.
iskill
is set to false - battleentity has LockRigid(false) called on it which unlocks its
rigid
- battleentity.
shadow
is enabled
- UpdateAnim is called