I'm using yanfly plugins, and I would like some help with this formula, I wanted that every time my actor missed the attack or the enemy evaded, it would increase the variable number 19 by 1 point, with a maximum of 3 points.
I was currently trying this way, but without success.
<Custom Deselect Effect>
if (target.result().missed || target.result().evaded) {
user.addStateCounter(stateId, 1);
user.clampStateCounter(stateId, 0, 3);
var newVal = $gameVariables.value(19) + 1;
if (newVal > 3) newVal = 3;
$gameVariables.setValue(19, newVal);
}
</Custom Deselect Effect>
I was currently trying this way, but without success.
<Custom Deselect Effect>
if (target.result().missed || target.result().evaded) {
user.addStateCounter(stateId, 1);
user.clampStateCounter(stateId, 0, 3);
var newVal = $gameVariables.value(19) + 1;
if (newVal > 3) newVal = 3;
$gameVariables.setValue(19, newVal);
}
</Custom Deselect Effect>