v1.1.0: traps that teleport now only move plain item heaps

This commit is contained in:
Evan Debenham 2021-09-20 23:56:08 -04:00
parent 9d3cf8744c
commit c7eb588e95
2 changed files with 4 additions and 11 deletions

View File

@ -42,18 +42,14 @@ public class GatewayTrap extends Trap {
} }
} }
Heap heap = Dungeon.level.heaps.get(pos + i); Heap heap = Dungeon.level.heaps.get(pos + i);
if (heap != null){ if (heap != null && heap.type == Heap.Type.HEAP){
int cell = Dungeon.level.randomRespawnCell( null ); int cell = Dungeon.level.randomRespawnCell( null );
Item item = heap.pickUp(); Item item = heap.pickUp();
if (cell != -1) { if (cell != -1) {
Heap dropped = Dungeon.level.drop( item, cell ); Dungeon.level.drop( item, cell );
dropped.type = heap.type;
dropped.sprite.view( dropped );
telePos = cell;
break; break;
} }
} }
} }

View File

@ -57,16 +57,13 @@ public class TeleportationTrap extends Trap {
} }
} }
Heap heap = Dungeon.level.heaps.get(pos + i); Heap heap = Dungeon.level.heaps.get(pos + i);
if (heap != null){ if (heap != null && heap.type == Heap.Type.HEAP){
int cell = Dungeon.level.randomRespawnCell( null ); int cell = Dungeon.level.randomRespawnCell( null );
Item item = heap.pickUp(); Item item = heap.pickUp();
if (cell != -1) { if (cell != -1) {
Heap dropped = Dungeon.level.drop( item, cell ); Dungeon.level.drop( item, cell );
dropped.type = heap.type;
dropped.sprite.view( dropped );
} }
} }
} }