v2.1.0: flying enemies no longer resist WoL's spread effect

This commit is contained in:
Evan Debenham
2023-05-06 13:48:20 -04:00
committed by Evan Debenham
parent 506b6ee4d3
commit b908dfc003
@@ -69,9 +69,9 @@ public class WandOfLightning extends DamageWand {
public void onZap(Ballistica bolt) { public void onZap(Ballistica bolt) {
//lightning deals less damage per-target, the more targets that are hit. //lightning deals less damage per-target, the more targets that are hit.
float multipler = 0.4f + (0.6f/affected.size()); float multiplier = 0.4f + (0.6f/affected.size());
//if the main target is in water, all affected take full damage //if the main target is in water, all affected take full damage
if (Dungeon.level.water[bolt.collisionPos]) multipler = 1f; if (Dungeon.level.water[bolt.collisionPos]) multiplier = 1f;
for (Char ch : affected){ for (Char ch : affected){
if (ch == Dungeon.hero) Camera.main.shake( 2, 0.3f ); if (ch == Dungeon.hero) Camera.main.shake( 2, 0.3f );
@@ -83,14 +83,14 @@ public class WandOfLightning extends DamageWand {
} }
wandProc(ch, chargesPerCast()); wandProc(ch, chargesPerCast());
if (ch == curUser && ch.isAlive()) { if (ch == curUser && ch.isAlive()) {
ch.damage(Math.round(damageRoll() * multipler * 0.5f), this); ch.damage(Math.round(damageRoll() * multiplier * 0.5f), this);
if (!curUser.isAlive()) { if (!curUser.isAlive()) {
Badges.validateDeathFromFriendlyMagic(); Badges.validateDeathFromFriendlyMagic();
Dungeon.fail( getClass() ); Dungeon.fail( getClass() );
GLog.n(Messages.get(this, "ondeath")); GLog.n(Messages.get(this, "ondeath"));
} }
} else { } else {
ch.damage(Math.round(damageRoll() * multipler), this); ch.damage(Math.round(damageRoll() * multiplier), this);
} }
} }
} }
@@ -110,7 +110,7 @@ public class WandOfLightning extends DamageWand {
private void arc( Char ch ) { private void arc( Char ch ) {
int dist = (Dungeon.level.water[ch.pos] && !ch.flying) ? 2 : 1; int dist = Dungeon.level.water[ch.pos] ? 2 : 1;
ArrayList<Char> hitThisArc = new ArrayList<>(); ArrayList<Char> hitThisArc = new ArrayList<>();
PathFinder.buildDistanceMap( ch.pos, BArray.not( Dungeon.level.solid, null ), dist ); PathFinder.buildDistanceMap( ch.pos, BArray.not( Dungeon.level.solid, null ), dist );