v0.2.4a: corrected bomb/key logic. Keys can no longer be destroyed, bombs no longer destroy items as they are dropped.

This commit is contained in:
Evan Debenham 2015-02-25 15:23:24 -05:00
parent 45d4297177
commit e9f28a1f75
2 changed files with 6 additions and 5 deletions

View File

@ -127,6 +127,11 @@ public class Bomb extends Item {
terrainAffected = true; 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 ); Char ch = Actor.findChar( c );
if (ch != null) { if (ch != null) {
//those not at the center of the blast take damage less consistently. //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. //constant is used here in the rare instance a player is killed by a double bomb.
Dungeon.fail(Utils.format(ResultDescriptions.ITEM, "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();
} }
} }

View File

@ -27,6 +27,7 @@ public class Key extends Item {
{ {
stackable = true; stackable = true;
unique = true;
} }
public int depth; public int depth;