From e9f28a1f756eb8ea67f87c116af86d2a6a34e317 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 25 Feb 2015 15:23:24 -0500 Subject: [PATCH] v0.2.4a: corrected bomb/key logic. Keys can no longer be destroyed, bombs no longer destroy items as they are dropped. --- .../shatteredpixeldungeon/items/Bomb.java | 10 +++++----- .../shatteredpixeldungeon/items/keys/Key.java | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java index a6d52e064..31dd11ec4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java @@ -127,6 +127,11 @@ public class Bomb extends Item { terrainAffected = true; } + //destroys items / triggers bombs caught in the blast. + Heap heap = Dungeon.level.heaps.get( c ); + if(heap != null) + heap.explode(); + Char ch = Actor.findChar( c ); if (ch != null) { //those not at the center of the blast take damage less consistently. @@ -142,11 +147,6 @@ public class Bomb extends Item { //constant is used here in the rare instance a player is killed by a double bomb. Dungeon.fail(Utils.format(ResultDescriptions.ITEM, "bomb")); } - - //destroys items / triggers bombs caught in the blast. - Heap heap = Dungeon.level.heaps.get( c ); - if(heap != null) - heap.explode(); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java index f8609572d..f2a39aba5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java @@ -27,6 +27,7 @@ public class Key extends Item { { stackable = true; + unique = true; } public int depth;