protected Room randomRoom( Class<?extends Room> type ) { Random.shuffle( rooms ); for (Room r : rooms) { if (type.isInstance(r)) { return r; } } return null; }
public static void initForRun() { runSpecials = (ArrayList<Class<?extends Room>>)ALL_SPEC.clone(); pitNeededDepth = -1; Random.shuffle(runSpecials); }
protected Room randomRoom( Class<?extends Room> type ) { Random.shuffle( rooms ); for (Room r : rooms) { if (type.isInstance(r)) { return r; } } return null; }
public static void initForRun() { runSpecials = (ArrayList<Class<?extends Room>>)ALL_SPEC.clone(); pitNeededDepth = -1; Random.shuffle(runSpecials); }
public static void initForRun(){ float[] regionChances = baseRegionSecrets.clone(); if (GamesInProgress.selectedClass == HeroClass.ROGUE){ for (int i = 0; i < regionChances.length; i++){ regionChances[i] += 0.6f; } } for (int i = 0; i < regionSecretsThisRun.length; i++){ regionSecretsThisRun[i] = (int)regionChances[i]; if (Random.Float() < regionChances[i] % 1f){ regionSecretsThisRun[i]++; } } runSecrets = new ArrayList<>(ALL_SECRETS); Random.shuffle(runSecrets); }
public static void initForRun(){ float[] regionChances = baseRegionSecrets.clone(); if (GamesInProgress.selectedClass == HeroClass.ROGUE){ for (int i = 0; i < regionChances.length; i++){ regionChances[i] += 0.6f; } } for (int i = 0; i < regionSecretsThisRun.length; i++){ regionSecretsThisRun[i] = (int)regionChances[i]; if (Random.Float() < regionChances[i] % 1f){ regionSecretsThisRun[i]++; } } runSecrets = new ArrayList<>(ALL_SECRETS); Random.shuffle(runSecrets); }
@Override protected boolean build() { builder = builder(); ArrayList<Room> initRooms = initRooms(); Random.shuffle(initRooms); do { for (Room r : initRooms){ r.neigbours.clear(); r.connected.clear(); } rooms = builder.build((ArrayList<Room>)initRooms.clone()); } while (rooms == null); return painter().paint(this, rooms); }
protected void setupRooms(ArrayList<Room> rooms){ for(Room r : rooms){ r.setEmpty(); } entrance = exit = shop = null; singleConnections.clear(); multiConnections.clear(); for (Room r : rooms){ if (r instanceof EntranceRoom){ entrance = r; } else if (r instanceof ExitRoom) { exit = r; } else if (r instanceof ShopRoom && r.maxConnections(Room.ALL) == 1){ shop = r; } else if (r.maxConnections(Room.ALL) > 1){ multiConnections.add(r); } else if (r.maxConnections(Room.ALL) == 1){ singleConnections.add(r); } } //this weights larger rooms to be much more likely to appear in the main loop, by placing them earlier in the multiconnections list weightRooms(multiConnections); Random.shuffle(multiConnections); multiConnections = new ArrayList<>(new LinkedHashSet<>(multiConnections)); }
public static ArrayList<Class<? extends Mob>> getMobRotation(int depth ){ ArrayList<Class<? extends Mob>> mobs = standardMobRotation( depth ); addRareMobs(depth, mobs); swapMobAlts(mobs); Random.shuffle(mobs); return mobs; }
@Override protected boolean build() { builder = builder(); ArrayList<Room> initRooms = initRooms(); Random.shuffle(initRooms); do { for (Room r : initRooms){ r.neigbours.clear(); r.connected.clear(); } rooms = builder.build((ArrayList<Room>)initRooms.clone()); } while (rooms == null); return painter().paint(this, rooms); }
public static ArrayList<Class<? extends Mob>> getMobRotation( int depth ){ ArrayList<Class<? extends Mob>> mobs = standardMobRotation( depth ); addRareMobs(depth, mobs); swapMobAlts(mobs); Random.shuffle(mobs); return mobs; }
protected void setupRooms(ArrayList<Room> rooms){ for(Room r : rooms){ r.setEmpty(); } entrance = exit = shop = null; singleConnections.clear(); multiConnections.clear(); for (Room r : rooms){ if (r instanceof EntranceRoom){ entrance = r; } else if (r instanceof ExitRoom) { exit = r; } else if (r instanceof ShopRoom && r.maxConnections(Room.ALL) == 1){ shop = r; } else if (r.maxConnections(Room.ALL) > 1){ multiConnections.add(r); } else if (r.maxConnections(Room.ALL) == 1){ singleConnections.add(r); } } //this weights larger rooms to be much more likely to appear in the main loop, by placing them earlier in the multiconnections list weightRooms(multiConnections); Random.shuffle(multiConnections); multiConnections = new ArrayList<>(new LinkedHashSet<>(multiConnections)); }
Random.shuffle(stdRooms); Iterator<Room> stdRoomIter = stdRooms.iterator();
Random.shuffle(stdRooms); Iterator<Room> stdRoomIter = stdRooms.iterator();
Random.shuffle(rooms);
Random.shuffle(rooms);
throw new RuntimeException("Shop attempted to carry more than 63 items!"); Random.shuffle(itemsToSpawn); return itemsToSpawn;
throw new RuntimeException("Shop attempted to carry more than 63 items!"); Random.shuffle(itemsToSpawn); return itemsToSpawn;
public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY_SP ); Painter.fill( level, this, 2, Terrain.EMPTY ); int cx = (left + right) / 2; int cy = (top + bottom) / 2; int c = cx + cy * level.width(); Random.shuffle(prizeClasses); Item i1, i2; i1 = prize( level ); i2 = prize( level ); level.drop( i1, c ).type = Heap.Type.CRYSTAL_CHEST; level.drop( i2, c + PathFinder.NEIGHBOURS8[Random.Int( 8 )]).type = Heap.Type.CRYSTAL_CHEST; level.addItemToSpawn( new CrystalKey( Dungeon.depth ) ); entrance().set( Door.Type.LOCKED ); level.addItemToSpawn( new IronKey( Dungeon.depth ) ); }
public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY_SP ); Painter.fill( level, this, 2, Terrain.EMPTY ); int cx = (left + right) / 2; int cy = (top + bottom) / 2; int c = cx + cy * level.width(); Random.shuffle(prizeClasses); Item i1, i2; i1 = prize( level ); i2 = prize( level ); level.drop( i1, c ).type = Heap.Type.CRYSTAL_CHEST; level.drop( i2, c + PathFinder.NEIGHBOURS8[Random.Int( 8 )]).type = Heap.Type.CRYSTAL_CHEST; level.addItemToSpawn( new CrystalKey( Dungeon.depth ) ); entrance().set( Door.Type.LOCKED ); level.addItemToSpawn( new IronKey( Dungeon.depth ) ); }