I'm using Yanfly's Damage Core
http://yanfly.moe/2015/11/07/yep-25-damage-core/
I wrote the following code that allows me target an enemy to do damage, but then does random damage to 2 other enemies. The problem I am having is that if the enemy is killed by the damage to random enemy, they don't despawn. They will die as usual, and the battle will end if all die. But, the drawing is still there. Is there a line of code I should be adding here to say if the enemy dies, then despawn the drawing?
<damage formula>
value = 500
var blue = this.opponentsUnit().randomTarget();
blue.gainHp(-500);
blue.startDamagePopup();
var blue1 = this.opponentsUnit().randomTarget();
blue1.gainHp(-500);
blue1.startDamagePopup();
</damage formula>
Thanks in advance for any help.
http://yanfly.moe/2015/11/07/yep-25-damage-core/
I wrote the following code that allows me target an enemy to do damage, but then does random damage to 2 other enemies. The problem I am having is that if the enemy is killed by the damage to random enemy, they don't despawn. They will die as usual, and the battle will end if all die. But, the drawing is still there. Is there a line of code I should be adding here to say if the enemy dies, then despawn the drawing?
<damage formula>
value = 500
var blue = this.opponentsUnit().randomTarget();
blue.gainHp(-500);
blue.startDamagePopup();
var blue1 = this.opponentsUnit().randomTarget();
blue1.gainHp(-500);
blue1.startDamagePopup();
</damage formula>
Thanks in advance for any help.