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 to 0 (one action available) unlessenemy
is true (we are in the enemy phase or later) where it's set to 1 instead (one actor turn is needed for an action to be available) - 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