RevivePlayer¶
This method properly revive a player party member.
private void RevivePlayer(int id, int hp, bool showcounter)
Parameters¶
id: Theplayerdataindex to revivehp: Thehpto set the player party member. If it's negative, thehpwill 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 thehpleft dangling at 0 while the actor isn't fully deadshowcounter: Whether to call Heal or not as part of thehpincrease
Procedure¶
- battleentity.
deadis set to false - battleentity.
iskillis set to false - battleentity has LockRigid(false) called on it which unlocks its
rigid - battleentity.
shadowis enabled - battleentity.
noconditionis set to false - The
playerdata'sturnssincedeathis set to 0 - If the player party member is included in
deadmembers:- The
playerdata'scantmoveis set depending on on conditions:- If
enemyis 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
LastWindmedal equipped while theirhpis 4 or lower, the value is set to -1 meaning 2 actor turns become available - Otheriwse (we are in the player phase, but the
LastWindmedal 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'smoreturnnextturnis set to 0 - The
playerdata'stiredis 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
hpis 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.
deathcoroutineis in progress, it is stopped - battleentity.
deathcoroutineis set to null - A ReviveFix coroutine is started with the id sent which will do the following:
- 0.5 seconds are yielded
- If battleentity.
deathcoroutineis in progress, it is stopped - battleentity.
deathcoroutineis set to null - battleentity.
deadis set to false - battleentity.
iskillis set to false - battleentity has LockRigid(false) called on it which unlocks its
rigid - battleentity.
shadowis enabled
- UpdateAnim is called