I´m using the codes to display the enemy and player damage from status ailments, this being the enemies one:
Enemy damage from status ailments code
for (var i = 0; i < $gameMap.allEnemiesOnMap().length; i++) {
char = $gameMap.allEnemiesOnMap();
battler = $gameMap.allEnemiesOnMap().battler();
if(battler.isStateAffected(15)){battler.gainHp(-Math.floor(battler.mhp*0.003 + 12));}
if(battler.isDead() && battler.isEnemy()){char.setDeadEnemy(char, battler);
$gameParty.gainGold(battler.gold());
var oldLevel = $gameParty.leader()._level; $gameParty.leader().gainExpCN(battler.exp());
$gamePlayer.requestAnimation(Number(Moghunter.ras_levelAnimationID))}
battler.startDamagePopup(); battler.updateStateTurns(); battler.updateBuffTurns();
battler.removeStatesAuto(1); battler.removeStatesAuto(2);}
char = $gameMap.allEnemiesOnMap();
battler = $gameMap.allEnemiesOnMap().battler();
if(battler.isStateAffected(15)){battler.gainHp(-Math.floor(battler.mhp*0.003 + 12));}
if(battler.isDead() && battler.isEnemy()){char.setDeadEnemy(char, battler);
$gameParty.gainGold(battler.gold());
var oldLevel = $gameParty.leader()._level; $gameParty.leader().gainExpCN(battler.exp());
$gamePlayer.requestAnimation(Number(Moghunter.ras_levelAnimationID))}
battler.startDamagePopup(); battler.updateStateTurns(); battler.updateBuffTurns();
battler.removeStatesAuto(1); battler.removeStatesAuto(2);}
And this one the code for the player:
Player damage from status ailments code
player = $gameMap.players()[0].battler();
if(player.isStateAffected(15)){player.gainHp(-Math.floor(battler.mhp*0.003 + 12));}
player.startDamagePopup();
player.updateStateTurns(); player.updateBuffTurns();
player.removeStatesAuto(1); player.removeStatesAuto(2);
if(player.isStateAffected(15)){player.gainHp(-Math.floor(battler.mhp*0.003 + 12));}
player.startDamagePopup();
player.updateStateTurns(); player.updateBuffTurns();
player.removeStatesAuto(1); player.removeStatesAuto(2);
The first issue is that in the enemies one, the state 15 is poison, and i have poison to last 30 turns, which means deal damage 30 times. When the player is poisoned, the state works well and suffers the damage 30 times, but then is the enemies, for some reason they only take damage 8 times. And i don´t know why that happen.
And the second issue is that when the player is poisoned, the damage number only display if the player is not moving. If the player moves not only the number don´t display, also the poison runs out faster, dealing less damage. I don´t know why this also happens.
How could i fix this two issues? I did something wrong with the codes?