Hi, i am new are.
I am using the Yanfly Buff and states plugin and trying to recreates the effect of the mirror force card from yugioh.
For those don't know the Mirror Force is trap card that actives when the opponent declares attack, destroying all they monsters.
So i am trying to makes a damage version, dealing 500 damage to every opponent battler before they begin able to deal damage when they utilizes a physical attack against the battle whit the Mirror Force Status and potentially killing enemies before he could even do any damage making the ultimate Attack and defense status.
But even after i creates the bellow code and run it, it comes whit some problems. The one that take the damage is the owner of the status, making the exact opposite from the desired effect
.
below the code
<Custom React Effect>
if (this.isPhysical())
{
var damage = 500;
var enemies = user.opponentsUnit().aliveMembers();
for (var i = 0; i < enemies.length; ++i)
{
var enemy = enemies;
enemy.startAnimation(107);
enemy.gainHp(-damage);
enemy.startDamagePopup();
enemy.clearResult();
if (enemy.isDead())
{
enemy.performCollapse();
}
}
}
</Custom React Effect>
I will be grateful if some one helps, i am a breaking my mind to makes it works