public static void set( Level level, Point p, int value ) { set( level, p.x, p.y, value ); }
public static void set( Level level, Point p, int value ) { set( level, p.x, p.y, value ); }
private static void placePlant(Level level, int pos, Mob plant){ plant.pos = pos; level.mobs.add( plant ); for(int i : PathFinder.NEIGHBOURS8) { if (level.map[pos + i] == Terrain.GRASS){ Painter.set(level, pos + i, Terrain.HIGH_GRASS); } } } }
private static void placePlant(Level level, int pos, Mob plant){ plant.pos = pos; level.mobs.add( plant ); for(int i : PathFinder.NEIGHBOURS8) { if (level.map[pos + i] == Terrain.GRASS){ Painter.set(level, pos + i, Terrain.HIGH_GRASS); } } } }
public static void drawLine( Level level, Point from, Point to, int value){ float x = from.x; float y = from.y; float dx = to.x - from.x; float dy = to.y - from.y; boolean movingbyX = Math.abs(dx) >= Math.abs(dy); //normalize if (movingbyX){ dy /= Math.abs(dx); dx /= Math.abs(dx); } else { dx /= Math.abs(dy); dy /= Math.abs(dy); } set(level, Math.round(x), Math.round(y), value); while((movingbyX && to.x != x) || (!movingbyX && to.y != y)){ x += dx; y += dy; set(level, Math.round(x), Math.round(y), value); } }
public static void set( Level level, int x, int y, int value ) { set( level, x + y * level.width(), value ); }
public static void set( Level level, int x, int y, int value ) { set( level, x + y * level.width(), value ); }
public static void set( int cell, int terrain, Level level ) { Painter.set( level, cell, terrain ); if (terrain != Terrain.TRAP && terrain != Terrain.SECRET_TRAP && terrain != Terrain.INACTIVE_TRAP){ level.traps.remove( cell ); } int flags = Terrain.flags[terrain]; level.passable[cell] = (flags & Terrain.PASSABLE) != 0; level.losBlocking[cell] = (flags & Terrain.LOS_BLOCKING) != 0; level.flamable[cell] = (flags & Terrain.FLAMABLE) != 0; level.secret[cell] = (flags & Terrain.SECRET) != 0; level.solid[cell] = (flags & Terrain.SOLID) != 0; level.avoid[cell] = (flags & Terrain.AVOID) != 0; level.pit[cell] = (flags & Terrain.PIT) != 0; level.water[cell] = terrain == Terrain.WATER; SmokeScreen s = (SmokeScreen)level.blobs.get(SmokeScreen.class); if (s != null && s.volume > 0){ level.losBlocking[cell] = level.losBlocking[cell] || s.cur[cell] > 0; } }
public static void set( int cell, int terrain, Level level ) { Painter.set( level, cell, terrain ); if (terrain != Terrain.TRAP && terrain != Terrain.SECRET_TRAP && terrain != Terrain.INACTIVE_TRAP){ level.traps.remove( cell ); } int flags = Terrain.flags[terrain]; level.passable[cell] = (flags & Terrain.PASSABLE) != 0; level.losBlocking[cell] = (flags & Terrain.LOS_BLOCKING) != 0; level.flamable[cell] = (flags & Terrain.FLAMABLE) != 0; level.secret[cell] = (flags & Terrain.SECRET) != 0; level.solid[cell] = (flags & Terrain.SOLID) != 0; level.avoid[cell] = (flags & Terrain.AVOID) != 0; level.pit[cell] = (flags & Terrain.PIT) != 0; level.water[cell] = terrain == Terrain.WATER; SmokeScreen s = (SmokeScreen)level.blobs.get(SmokeScreen.class); if (s != null && s.volume > 0){ level.losBlocking[cell] = level.losBlocking[cell] || s.cur[cell] > 0; } }
@Override public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1 , Terrain.EMPTY ); for (Door door : connected.values()) { door.set( Door.Type.REGULAR ); //set door areas to be empty to help with create walls logic Painter.set(level, door, Terrain.EMPTY); } createWalls( level, new Rect(left+1, top+1, right-1, bottom-1)); }
public void paint(Level level) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY ); for (Room.Door door : connected.values()) { door.set( Room.Door.Type.REGULAR ); } level.exit = level.pointToCell(random( 2 )); Painter.set( level, level.exit, Terrain.EXIT ); }
@Override public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1 , Terrain.EMPTY ); for (Door door : connected.values()) { door.set( Door.Type.REGULAR ); //set door areas to be empty to help with create walls logic Painter.set(level, door, Terrain.EMPTY); } createWalls( level, new Rect(left+1, top+1, right-1, bottom-1)); }
public void paint(Level level) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY ); for (Room.Door door : connected.values()) { door.set( Room.Door.Type.REGULAR ); } level.exit = level.pointToCell(random( 2 )); Painter.set( level, level.exit, Terrain.EXIT ); }
public void paint(Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY ); Painter.fill( level, left+1, top+1, width()-2, 1, Terrain.WALL_DECO); Painter.fill( level, left+1, top+2, width()-2, 1, Terrain.WATER); Painter.set( level, left+width()/2, top+1, Terrain.LOCKED_EXIT); level.exit = level.pointToCell(new Point(left+width()/2, top+1)); do { level.entrance = level.pointToCell(random(3)); } while (level.findMob(level.entrance) != null); Painter.set( level, level.entrance, Terrain.ENTRANCE ); for (Room.Door door : connected.values()) { door.set( Room.Door.Type.REGULAR ); if (door.y == top){ Painter.set( level, door.x, door.y+1, Terrain.WATER); } } }
public void paint(Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY ); Painter.fill( level, left+1, top+1, width()-2, 1, Terrain.WALL_DECO); Painter.fill( level, left+1, top+2, width()-2, 1, Terrain.WATER); Painter.set( level, left+width()/2, top+1, Terrain.LOCKED_EXIT); level.exit = level.pointToCell(new Point(left+width()/2, top+1)); do { level.entrance = level.pointToCell(random(3)); } while (level.findMob(level.entrance) != null); Painter.set( level, level.entrance, Terrain.ENTRANCE ); for (Room.Door door : connected.values()) { door.set( Room.Door.Type.REGULAR ); if (door.y == top){ Painter.set( level, door.x, door.y+1, Terrain.WATER); } } }
public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY ); Point c = center(); Painter.set( level, c.x, c.y, Terrain.WELL ); @SuppressWarnings("unchecked") Class<? extends WellWater> waterClass = overrideWater != null ? overrideWater : (Class<? extends WellWater>)Random.element( WATERS ); WellWater.seed(c.x + level.width() * c.y, 1, waterClass, level); entrance().set( Door.Type.REGULAR ); } }
Painter.set( level, pot, Terrain.ALCHEMY );
public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY ); Point c = center(); Painter.set( level, c.x, c.y, Terrain.WELL ); @SuppressWarnings("unchecked") Class<? extends WellWater> waterClass = overrideWater != null ? overrideWater : (Class<? extends WellWater>)Random.element( WATERS ); WellWater.seed(c.x + level.width() * c.y, 1, waterClass, level); entrance().set( Door.Type.REGULAR ); } }
@Override public void paint(Level level) { super.paint(level); Item i = level.findPrizeItem(); if ( i == null ){ i = new Gold().random(); } int center = level.pointToCell(center()); Painter.set(level, center, Terrain.PEDESTAL); if (Random.Int(3) == 0) { level.drop(i, center).type = Heap.Type.MIMIC; } else { level.drop(i, center).type = Heap.Type.CHEST; } } }
@Override public void paint(Level level) { super.paint(level); Item i = level.findPrizeItem(); if ( i == null ){ i = new Gold().random(); } int center = level.pointToCell(center()); Painter.set(level, center, Terrain.PEDESTAL); if (Random.Int(3) == 0) { level.drop(i, center).type = Heap.Type.MIMIC; } else { level.drop(i, center).type = Heap.Type.CHEST; } } }