From 8753a1649327f183f15dfe373b25197b26a21397 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 3 Oct 2022 14:10:08 -0400 Subject: [PATCH] v1.4.0: DM-300 rockfall now knocks back hero if they are 1 tile away --- .../shatteredpixeldungeon/actors/mobs/DM300.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java index 47108bd9f..206103935 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java @@ -403,6 +403,7 @@ public class DM300 extends Mob { Dungeon.hero.interrupt(); final int rockCenter; + //knock back 2 tiles if adjacent if (Dungeon.level.adjacent(pos, target.pos)){ int oppositeAdjacent = target.pos + (target.pos - pos); Ballistica trajectory = new Ballistica(target.pos, oppositeAdjacent, Ballistica.MAGIC_BOLT); @@ -411,6 +412,18 @@ public class DM300 extends Mob { Dungeon.hero.interrupt(); } rockCenter = trajectory.path.get(Math.min(trajectory.dist, 2)); + + //knock back 1 tile if there's 1 tile of space + } else if (fieldOfView[target.pos] && Dungeon.level.distance(pos, target.pos) == 2) { + int oppositeAdjacent = target.pos + (target.pos - pos); + Ballistica trajectory = new Ballistica(target.pos, oppositeAdjacent, Ballistica.MAGIC_BOLT); + WandOfBlastWave.throwChar(target, trajectory, 1, false, false, getClass()); + if (target == Dungeon.hero){ + Dungeon.hero.interrupt(); + } + rockCenter = trajectory.path.get(Math.min(trajectory.dist, 1)); + + //otherwise no knockback } else { rockCenter = target.pos; }