So i have a TNT Actor that is supposed to do what the title says but instead it deals damage to all enemies which is not what i want.
I made it so the TNT has a state which has the tag <Category: Bypass Death Removal> so that it's not removed on death.
So how can i make this to work like i want?
I made it so the TNT has a state which has the tag <Category: Bypass Death Removal> so that it's not removed on death.
So how can i make this to work like i want?
JavaScript:
<Custom Apply Effect>
if (target.isDead() && target.isStateAffected(26)) {
var foes = target.opponentsUnit().aliveMembers();
for (var i = 0; i < foes.length; ++i) {
var foe = foes[i];
if (foe && foe.enemyId() !== 3) {
foe.gainHp(-target.mat);
foe.startDamagePopup();
target.removeState(26);
if (foe.isDead()) {
foe.performCollapse();
}
foe.clearResult();
}
}
}
</Custom Apply Effect>