I have a skill which applies damage to the target and splash damage to all other enemies. That part works fine.
The problem only arises if the splash damage is enough to defeat one of these other enemies. Then we see the down sprite of the enemy and it never goes away, just clutters up the battle field until the battle ends. It looks ridiculous.
My thought was that perhaps applying damage in this way bypasses the usual way the engine calls for the collapse effect.
At the moment I have this code which applies the damage:
I tried putting it in <JS Pre-Apply> </JS Pre-Apply> in case that was when the collapse effect is called, but then it did no damage.
Does anyone have any idea of what I could do?
The problem only arises if the splash damage is enough to defeat one of these other enemies. Then we see the down sprite of the enemy and it never goes away, just clutters up the battle field until the battle ends. It looks ridiculous.
My thought was that perhaps applying damage in this way bypasses the usual way the engine calls for the collapse effect.
At the moment I have this code which applies the damage:
Code:
<JS Post-Damage>
for (let i=0; i<target.friendsUnit().aliveMembers().length; i++)
{
if (target.friendsUnit().aliveMembers()[i]!=target)
{
target.friendsUnit().aliveMembers()[i].gainHp(0-Math.round(value/10));
target.friendsUnit().aliveMembers()[i].startDamagePopup();
}
}
</JS Post-Damage>
I tried putting it in <JS Pre-Apply> </JS Pre-Apply> in case that was when the collapse effect is called, but then it did no damage.
Does anyone have any idea of what I could do?