Hey there, anyone happen to know the JS code to reduce the duration of a specific state?
For example, I have a code that runs to see if an ally is affected by X state. If the ally IS affected by X state, the the ally is healed for triple the amount. At this point, I want the duration of the state to be reduced by 1 turn.
Thank you for your time.
Here's the current code I'm working with so you have a better idea:
For example, I have a code that runs to see if an ally is affected by X state. If the ally IS affected by X state, the the ally is healed for triple the amount. At this point, I want the duration of the state to be reduced by 1 turn.
Thank you for your time.
Here's the current code I'm working with so you have a better idea:
Code:
<Post-Damage Eval>
// Check if the current effect dealt HP damage and is magical.
if (this.isHpEffect() && value > 0) {
// Set the ID of the atonement state.
var atonement = 176;
// Get current alive members.
var group = user.friendsUnit().aliveMembers();
// Calculate the amount of HP healed.
var hpHealed = Math.floor(value * 0.25);
// Go through all of the party members.
for (var i = 0; i < group.length; ++i) {
// Get the currently looped ally.
var ally = group[i];
// Check if the ally exists, is affected by atonement, and the original caster of the state is the current user.
if (ally && ally.isStateAffected(atonement) && ally.stateOrigin(atonement) === user) {
I WANT THE CODE HERE TO REDUCE THE DURATION OF STATE 176 BY 1 EXTRA TURN
ally.startAnimation(41);
BattleManager.actionWaitForAnimation();
// If it matches, heal the ally.
ally.gainHp(Math.ceil((hpHealed*3)*(1+(ally.def/375))));
// Start the damage popup.
ally.startDamagePopup();
// Clear the results.
ally.clearResult();
}
else
{
//Add echo of life to allies
ally.addState(176);
ally.startAnimation(41);
BattleManager.actionWaitForAnimation();
// If it matches, heal the ally.
ally.gainHp(Math.ceil((hpHealed)*(1+(ally.def/375))));
// Start the damage popup.
ally.startDamagePopup();
// Clear the results.
ally.clearResult();
}
}
}
</Post-Damage Eval>