Move avoidance check so that blast doesn't trigger it regardless of range (#144)

Prior to this fix, mobs with Avoidance would trigger their avoid even if they were outside of the range of the blast.
This commit is contained in:
FreezePhoenix
2024-08-13 17:14:02 +02:00
committed by GitHub
parent 28bba1ce52
commit 972805b653
+1 -1
View File
@@ -3308,6 +3308,7 @@ function complete_attack(attacker, target, info) {
if (attacker.is_player) { if (attacker.is_player) {
for (var id in instances[target.in].monsters) { for (var id in instances[target.in].monsters) {
var target = instances[target.in].monsters[id]; var target = instances[target.in].monsters[id];
if (target.id != otarget.id && distance(target, otarget) < radius) {
if (target.avoidance && Math.random() * 100 < target.avoidance) { if (target.avoidance && Math.random() * 100 < target.avoidance) {
xy_emit( xy_emit(
info.action, info.action,
@@ -3317,7 +3318,6 @@ function complete_attack(attacker, target, info) {
); );
continue; continue;
} }
if (target.id != otarget.id && distance(target, otarget) < radius) {
targets.push([target, "splash", (damage_multiplier(target[defense] || 0) * intensity) / 100.0]); targets.push([target, "splash", (damage_multiplier(target[defense] || 0) * intensity) / 100.0]);
} }
} }