v1.4.0: fixed aqua blast death counting as death by geyser trap

This commit is contained in:
Evan Debenham
2022-08-21 13:38:41 -04:00
parent de369be7ca
commit d7871caa30
3 changed files with 6 additions and 3 deletions
@@ -40,6 +40,7 @@ public class AquaBlast extends TargetedSpell {
GeyserTrap geyser = new GeyserTrap(); GeyserTrap geyser = new GeyserTrap();
geyser.pos = cell; geyser.pos = cell;
geyser.source = getClass();
if (bolt.path.size() > bolt.dist+1) { if (bolt.path.size() > bolt.dist+1) {
geyser.centerKnockBackDirection = bolt.path.get(bolt.dist + 1); geyser.centerKnockBackDirection = bolt.path.get(bolt.dist + 1);
} }
@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
import com.shatteredpixel.shatteredpixeldungeon.effects.Effects; import com.shatteredpixel.shatteredpixeldungeon.effects.Effects;
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
import com.shatteredpixel.shatteredpixeldungeon.items.spells.AquaBlast;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Elastic; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Elastic;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
@@ -160,7 +161,7 @@ public class WandOfBlastWave extends DamageWand {
ch.damage(Random.NormalIntRange(finalDist, 2*finalDist), this); ch.damage(Random.NormalIntRange(finalDist, 2*finalDist), this);
Paralysis.prolong(ch, Paralysis.class, 1 + finalDist/2f); Paralysis.prolong(ch, Paralysis.class, 1 + finalDist/2f);
if (ch == Dungeon.hero && !ch.isAlive()){ if (ch == Dungeon.hero && !ch.isAlive()){
if ( cause == WandOfBlastWave.class){ if (cause == WandOfBlastWave.class || cause == AquaBlast.class){
Badges.validateDeathFromFriendlyMagic(); Badges.validateDeathFromFriendlyMagic();
} }
Dungeon.fail(cause); Dungeon.fail(cause);
@@ -46,6 +46,7 @@ public class GeyserTrap extends Trap {
} }
public int centerKnockBackDirection = -1; public int centerKnockBackDirection = -1;
public Class source = getClass();
@Override @Override
public void activate() { public void activate() {
@@ -76,7 +77,7 @@ public class GeyserTrap extends Trap {
//trim it to just be the part that goes past them //trim it to just be the part that goes past them
trajectory = new Ballistica(trajectory.collisionPos, trajectory.path.get(trajectory.path.size()-1), Ballistica.PROJECTILE); trajectory = new Ballistica(trajectory.collisionPos, trajectory.path.get(trajectory.path.size()-1), Ballistica.PROJECTILE);
//knock them back along that ballistica //knock them back along that ballistica
WandOfBlastWave.throwChar(ch, trajectory, 2, true, true, getClass()); WandOfBlastWave.throwChar(ch, trajectory, 2, true, true, source);
} }
} }
@@ -105,7 +106,7 @@ public class GeyserTrap extends Trap {
//trace a ballistica in the direction of our target //trace a ballistica in the direction of our target
Ballistica trajectory = new Ballistica(pos, targetpos, Ballistica.MAGIC_BOLT); Ballistica trajectory = new Ballistica(pos, targetpos, Ballistica.MAGIC_BOLT);
//knock them back along that ballistica //knock them back along that ballistica
WandOfBlastWave.throwChar(ch, trajectory, 2, true, true, getClass()); WandOfBlastWave.throwChar(ch, trajectory, 2, true, true, source);
} }
} }
} }