Second Chance

My apologies for posting this late, I lost track of what day it was, and had to work, so I didn’t have time to post this until now.

This week’s state is a little favorite of mine, Second Chance, which allows a fallen actor to be resurrected at 50% HP, but only once per battle. This effect will trigger even if the actor who is affected by it is the only actor left alive in the battle, no instant game overs here.

What do we need?

  • The usual plugins
  • The action sequence plugins
  • YEP_X_StateCategories
  • Two passive states, one for the effect and one for the cooldown
  • A skill that will be used on the affected actor when he dies.
  • An animation for the skill to use

We also need to modify your death state to accommodate the second chance ability. You will need a way to apply the passive state to the affected actor as well. You could alternatively not use a passive state, and instead make this effect an active buff with a turn duration.

First, let’s change our death state. We will need to add the following notetags to the death state to make it check for the presence of the second chance state:

<Custom Apply Effect>
if (target.isStateAffected(186)) {
BattleManager.queueForceAction(target, 210, 0);
}
</Custom Apply Effect>

The actor is checked for state 186 when he dies, if found, an action is forced to use skill 210 on that same actor. Skill 210 will be our second chance effect.

resurrectionNote that this skill needs to have its scope set to affect a dead ally, otherwise it will have no effect on the actor. The effects of this skill remove the death trait, and restore a flat 50% HP to the affected actor, as well as add our second state. Here is the action sequence code for this skill:

<setup action>
camera clamp on
display action
zoom: 300%
camera focus: user
wait for zoom
</setup action>
<target action>
camera focus: user
zoom: 250%
wait for camera
action animation: user
animation wait: 20
motion dying: user
wait for animation
action effect: target
motion standby: user
wait: 20
motion spell: user
wait: 25
</target action>
<finish action>
perform finish
clear battle log
reset camera
reset zoom
wait for camera
camera clamp on
</finish action>

Next we will cover the two states we need. The first is the enabler state, which causes the affected actor to resurrect after being afflicted with the death state. There is nothing too special on this state, only the following note tags:

<Category: Bypass Death Removal>
<Custom Passive Condition>
if (user.isStateAffected(187)) {
condition = false;
} else {
condition = true;
}
</Custom Passive Condition>

The above code prevents this passive state from becoming active if state 187 is detected. State 187 is the cooldown state, applied when the resurrection happens to the battler. This prevents the effect from happening more than once during a battle. The bypass death removal tag makes it so that this state is not removed upon death, without this tag, or some other way to make states remain on a battle even through death, the state has no effect.

The second state is the cooldown state, which is applied after an actor is resurrected. This state needs to be removed at battle end, but you could also modify it to last a number of turns as well, if you’d like your auto-resurrection to happen more than once. Without this cooldown state, the effect will happen every time the actor dies, making him functionally immortal. The only note tag for this state is below:

<Category: Bypass Death Removal>

This prevents the state from being removed if the actor dies, which prevents the auto-resurrection from happening every time the actor dies as well.

As said above, this works best as a passive ability, but can be easily modified to be a temporary buff spell as well. That’s all for this update, thanks.

 

~Ramza

 

Leave a comment