From d99e42eec5c34adaae745785804793f9ecb8d32c Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 6 Dec 2021 14:55:23 -0500 Subject: [PATCH] v1.1.0: telekinetic grab now work on throned DK, and Dk leaves his throne more consistently --- .../items/spells/TelekineticGrab.java | 9 +++++++++ .../shatteredpixeldungeon/levels/CityBossLevel.java | 1 + 2 files changed, 10 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/TelekineticGrab.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/TelekineticGrab.java index 7eacbe4c8..f5a78734e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/TelekineticGrab.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/TelekineticGrab.java @@ -6,6 +6,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DwarfKing; import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; @@ -37,6 +38,14 @@ public class TelekineticGrab extends TargetedSpell { protected void affectTarget(Ballistica bolt, Hero hero) { Char ch = Actor.findChar(bolt.collisionPos); + //special logic for DK when he is on his throne + if (ch == null && bolt.path.size() > bolt.dist+1){ + ch = Actor.findChar(bolt.path.get(bolt.dist+1)); + if (!(ch instanceof DwarfKing && Dungeon.level.solid[ch.pos])){ + ch = null; + } + } + if (ch != null && ch.buff(PinCushion.class) != null){ Item item = ch.buff(PinCushion.class).grabOne(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java index d9f79c86c..d851038b9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java @@ -279,6 +279,7 @@ public class CityBossLevel extends Level { boss.state = boss.WANDERING; boss.pos = pointToCell(arena.center()); GameScene.add( boss ); + boss.beckon(Dungeon.hero.pos); if (heroFOV[boss.pos]) { boss.notice();