Hello. I'm having a problem with a script call i'm making.
This one is supposed to be executed at the start of a battle (Turn 0)
Basically, this script checks which enemies are afflicted by x State Effect, and the game will force those enemies to use x attack. The way it's written here does not work, however, and instead only forces the last enemy in the troop to use the called attack. Am i missing something?
This one is supposed to be executed at the start of a battle (Turn 0)
JavaScript:
for(var i = 0; i < $gameTroop._enemies.length; i++)
{
var enemy = $gameTroop._enemies[i];
if(enemy.isStateAffected(115))
{
enemy.forceAction(113, -1);
BattleManager.forceAction(enemy);
this.setWaitMode('action');
}
}
Basically, this script checks which enemies are afflicted by x State Effect, and the game will force those enemies to use x attack. The way it's written here does not work, however, and instead only forces the last enemy in the troop to use the called attack. Am i missing something?