v1.1.0: traps that teleport now only move plain item heaps
This commit is contained in:
parent
9d3cf8744c
commit
c7eb588e95
|
@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user