mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-27 06:50:14 -05:00
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:
+1
-1
@@ -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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user