I've created a Doom-like state. I'm using the VisuStella Skills & State plugin to play an animation when the state expires, then set the target's health to 0. It works... but not visually in the way I want.
The problem is, the target dies before the animation plays. I tried adding a timeout, but that causes other problems; the current target in the battle command queue can be deemed to be the one afflicted, or no-one dies at all.
I tried using target.SetHp(0) but the problem remains.
I want this fix to be embedded in the state, not in Troop commands.
The state should work whether applied to one or many targets.
The state should work whether applied to enemies or allies.
Any suggestions?
Code:
<JS On Erase State>
if (target.stateTurns(stateId) <= 0) {
$gameTemp.requestAnimation([target], 136); //Doom
target.addState(1);
}
</JS On Erase State>
The problem is, the target dies before the animation plays. I tried adding a timeout, but that causes other problems; the current target in the battle command queue can be deemed to be the one afflicted, or no-one dies at all.
Code:
<JS On Erase State>
if (target.stateTurns(stateId) <= 0) {
$gameTemp.requestAnimation([target], 136); //Doom
setTimeout(() => {
target.addState(1);
target.refresh();
}, 1200);
}
</JS On Erase State>
I tried using target.SetHp(0) but the problem remains.
I want this fix to be embedded in the state, not in Troop commands.
The state should work whether applied to one or many targets.
The state should work whether applied to enemies or allies.
Any suggestions?