public Point random() { return random( 1 ); }
public Point random() { return random( 1 ); }
@Override public int randomRespawnCell() { int pos; do { pos = pointToCell(roomEntrance.random()); } while (pos == entrance || solid[pos]); return pos; }
@Override public int randomRespawnCell() { int pos; do { pos = pointToCell(roomEntrance.random()); } while (pos == entrance || solid[pos]); return pos; }
@Override public int randomRespawnCell() { return pointToCell( roomEntrance.random() ); }
@Override public int randomRespawnCell() { return pointToCell( roomEntrance.random() ); }
@Override protected void createMobs() { Goo boss = new Goo(); Room room; do { room = randomRoom(StandardRoom.class); } while (room == roomEntrance); boss.pos = pointToCell(room.random()); mobs.add( boss ); }
@Override protected void createMobs() { Goo boss = new Goo(); Room room; do { room = randomRoom(StandardRoom.class); } while (room == roomEntrance); boss.pos = pointToCell(room.random()); mobs.add( boss ); }
@Override public int randomDestination() { int count = 0; int cell = -1; while (true) { if (++count > 30) { return -1; } Room room = Random.element( rooms ); if (room == null) { continue; } cell = pointToCell(room.random()); if (passable[cell]) { return cell; } } }
@Override public int randomDestination() { int count = 0; int cell = -1; while (true) { if (++count > 30) { return -1; } Room room = Random.element( rooms ); if (room == null) { continue; } cell = pointToCell(room.random()); if (passable[cell]) { return cell; } } }
@Override public boolean act(boolean enemyInFOV, boolean justAlerted) { boolean result = super.act(enemyInFOV, justAlerted); //this causes piranha to move away when a door is closed on them in a pool room. if (state == WANDERING && Dungeon.level instanceof RegularLevel){ Room curRoom = ((RegularLevel)Dungeon.level).room(pos); if (curRoom instanceof PoolRoom) { target = Dungeon.level.pointToCell(curRoom.random(1)); } } return result; } }
@Override public boolean act(boolean enemyInFOV, boolean justAlerted) { boolean result = super.act(enemyInFOV, justAlerted); //this causes piranha to move away when a door is closed on them in a pool room. if (state == WANDERING && Dungeon.level instanceof RegularLevel){ Room curRoom = ((RegularLevel)Dungeon.level).room(pos); if (curRoom instanceof PoolRoom) { target = Dungeon.level.pointToCell(curRoom.random(1)); } } return result; } }
public static void spawnWandmaker( Level level, Room room ) { if (questRoomSpawned) { questRoomSpawned = false; Wandmaker npc = new Wandmaker(); do { npc.pos = level.pointToCell(room.random()); } while (npc.pos == level.entrance); level.mobs.add( npc ); spawned = true; given = false; wand1 = (Wand) Generator.random(Generator.Category.WAND); wand1.cursed = false; wand1.upgrade(); do { wand2 = (Wand) Generator.random(Generator.Category.WAND); } while (wand2.getClass().equals(wand1.getClass())); wand2.cursed = false; wand2.upgrade(); } }
@Override protected void createItems() { Item item = Bones.get(); if (item != null) { int pos; do { pos = pointToCell(roomEntrance.random()); } while (pos == entrance); drop( item, pos ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; } }
@Override protected void createItems() { Item item = Bones.get(); if (item != null) { int pos; do { pos = pointToCell(roomEntrance.random()); } while (pos == entrance || solid[pos]); drop( item, pos ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; } }
@Override protected void createItems() { Item item = Bones.get(); if (item != null) { int pos; do { pos = pointToCell(roomEntrance.random()); } while (pos == entrance); drop( item, pos ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; } }
@Override protected void createItems() { Item item = Bones.get(); if (item != null) { int pos; do { pos = pointToCell(roomEntrance.random()); } while (pos == entrance || solid[pos]); drop( item, pos ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; } }
protected int randomDropCell() { while (true) { Room room = randomRoom( StandardRoom.class ); if (room != null && room != roomEntrance) { int pos = pointToCell(room.random()); if (passable[pos] && pos != exit && heaps.get(pos) == null) { Trap t = traps.get(pos); //items cannot spawn on traps which destroy items if (t == null || ! (t instanceof BurningTrap || t instanceof BlazingTrap || t instanceof ChillingTrap || t instanceof FrostTrap || t instanceof ExplosiveTrap || t instanceof DisintegrationTrap)) { return pos; } } } } }
@Override public int fallCell( boolean fallIntoPit ) { if (fallIntoPit) { for (Room room : rooms) { if (room instanceof PitRoom) { int result; do { result = pointToCell(room.random()); } while (traps.get(result) != null || findMob(result) != null || heaps.get(result) != null); return result; } } } return super.fallCell( false ); }
@Override public int fallCell( boolean fallIntoPit ) { if (fallIntoPit) { for (Room room : rooms) { if (room instanceof PitRoom) { int result; do { result = pointToCell(room.random()); } while (traps.get(result) != null || findMob(result) != null || heaps.get(result) != null); return result; } } } return super.fallCell( false ); }