v3.0.1: fixed shocking enchant missing valid targets in some cases
This commit is contained in:
+9
-2
@@ -89,15 +89,22 @@ public class Shocking extends Weapon.Enchantment {
|
|||||||
defender.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3);
|
defender.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3);
|
||||||
defender.sprite.flash();
|
defender.sprite.flash();
|
||||||
|
|
||||||
|
ArrayList<Char> hitThisArc = new ArrayList<>();
|
||||||
PathFinder.buildDistanceMap( defender.pos, BArray.not( Dungeon.level.solid, null ), dist );
|
PathFinder.buildDistanceMap( defender.pos, BArray.not( Dungeon.level.solid, null ), dist );
|
||||||
for (int i = 0; i < PathFinder.distance.length; i++) {
|
for (int i = 0; i < PathFinder.distance.length; i++) {
|
||||||
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
|
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
|
||||||
Char n = Actor.findChar(i);
|
Char n = Actor.findChar(i);
|
||||||
if (n != null && n != attacker && !affected.contains(n)) {
|
if (n != null && n != attacker && !affected.contains(n)) {
|
||||||
arcs.add(new Lightning.Arc(defender.sprite.center(), n.sprite.center()));
|
hitThisArc.add(n);
|
||||||
arc(attacker, n, (Dungeon.level.water[n.pos] && !n.flying) ? 2 : 1, affected, arcs);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
affected.addAll(hitThisArc);
|
||||||
|
for (Char hit : hitThisArc){
|
||||||
|
arcs.add(new Lightning.Arc(defender.sprite.center(), hit.sprite.center()));
|
||||||
|
arc(attacker, hit, (Dungeon.level.water[hit.pos] && !hit.flying) ? 2 : 1, affected, arcs);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user