From 082c2393cb0a633d07cba2f9019bf5a8c5e422e8 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 11 Jun 2021 21:05:13 -0400 Subject: [PATCH] v0.9.3a: runestones now press cells when thrown --- .../items/stones/Runestone.java | 1 + .../items/stones/StoneOfDisarming.java | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/Runestone.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/Runestone.java index a03dca043..ec68fef92 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/Runestone.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/Runestone.java @@ -38,6 +38,7 @@ public abstract class Runestone extends Item { if (Dungeon.level.pit[cell] || !defaultAction.equals(AC_THROW)){ super.onThrow( cell ); } else { + Dungeon.level.pressCell( cell ); activate(cell); Invisibility.dispel(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfDisarming.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfDisarming.java index 10ab8b147..4c88e2891 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfDisarming.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfDisarming.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.stones; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap; @@ -43,7 +44,19 @@ public class StoneOfDisarming extends Runestone { { image = ItemSpriteSheet.STONE_DISARM; } - + + @Override + protected void onThrow(int cell) { + //This runestone uniquely presses cells after its effect resolves, instead of before + if (Dungeon.level.pit[cell] || !defaultAction.equals(AC_THROW)){ + super.onThrow( cell ); + } else { + activate(cell); + Invisibility.dispel(); + Dungeon.level.pressCell( cell ); + } + } + @Override protected void activate(final int cell) { boolean[] FOV = new boolean[Dungeon.level.length()];