|
|
@ -26,7 +26,7 @@ public class WorldCreator { |
|
|
|
public static World createWorld(long seed) |
|
|
|
public static World createWorld(long seed) |
|
|
|
{ |
|
|
|
{ |
|
|
|
synchronized (rand) { |
|
|
|
synchronized (rand) { |
|
|
|
|
|
|
|
|
|
|
|
Log.f2("Generating a new world..."); |
|
|
|
Log.f2("Generating a new world..."); |
|
|
|
|
|
|
|
|
|
|
|
rand.setSeed(seed); |
|
|
|
rand.setSeed(seed); |
|
|
@ -39,7 +39,7 @@ public class WorldCreator { |
|
|
|
|
|
|
|
|
|
|
|
// build the level rooms
|
|
|
|
// build the level rooms
|
|
|
|
for (int floor = 1; floor <= 7; floor++) { |
|
|
|
for (int floor = 1; floor <= 7; floor++) { |
|
|
|
|
|
|
|
|
|
|
|
Log.f3("Placing rooms for level: " + floor); |
|
|
|
Log.f3("Placing rooms for level: " + floor); |
|
|
|
|
|
|
|
|
|
|
|
final LevelBuilder lb = prepareFloor(rand.nextLong(), floor, theme, floor == 7); |
|
|
|
final LevelBuilder lb = prepareFloor(rand.nextLong(), floor, theme, floor == 7); |
|
|
@ -91,7 +91,7 @@ public class WorldCreator { |
|
|
|
randomFood.add(Items.CHEESE); |
|
|
|
randomFood.add(Items.CHEESE); |
|
|
|
randomFood.add(Items.MEAT); |
|
|
|
randomFood.add(Items.MEAT); |
|
|
|
|
|
|
|
|
|
|
|
for (int level = 1; level <= 7; level++) { |
|
|
|
for (int level = 1; level <= 7; level++) { |
|
|
|
final LevelBuilder lb = levelBuilders[level - 1]; |
|
|
|
final LevelBuilder lb = levelBuilders[level - 1]; |
|
|
|
final Range amount = Range.make(1, level); |
|
|
|
final Range amount = Range.make(1, level); |
|
|
|
|
|
|
|
|
|
|
@ -102,7 +102,7 @@ public class WorldCreator { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// place monsters
|
|
|
|
// place monsters
|
|
|
|
|
|
|
|
|
|
|
|
Log.f3("Placing monsters..."); |
|
|
|
Log.f3("Placing monsters..."); |
|
|
|
for (int level = 1; level <= 7; level++) { |
|
|
|
for (int level = 1; level <= 7; level++) { |
|
|
|
|
|
|
|
|
|
|
@ -126,12 +126,12 @@ public class WorldCreator { |
|
|
|
|
|
|
|
|
|
|
|
// compile levels
|
|
|
|
// compile levels
|
|
|
|
Log.f3("Building levels..."); |
|
|
|
Log.f3("Building levels..."); |
|
|
|
int i=1; |
|
|
|
int i = 1; |
|
|
|
for (final LevelBuilder lb : levelBuilders) { |
|
|
|
for (final LevelBuilder lb : levelBuilders) { |
|
|
|
Log.f3("Building level "+i); |
|
|
|
Log.f3("Building level " + i); |
|
|
|
w.addLevel(lb.build(w)); |
|
|
|
w.addLevel(lb.build(w)); |
|
|
|
i++; |
|
|
|
i++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
w.createPlayer(); |
|
|
|
w.createPlayer(); |
|
|
|
|
|
|
|
|
|
|
@ -143,7 +143,7 @@ public class WorldCreator { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static LevelBuilder prepareFloor(long seed, int floor, MapTheme theme, boolean lastLevel) throws WorldGenError |
|
|
|
public static LevelBuilder prepareFloor(long seed, int floor, MapTheme theme, boolean lastLevel) throws WorldGenError |
|
|
|
{ |
|
|
|
{ |
|
|
|
final LevelBuilder lb = new LevelBuilder(128, theme, seed); |
|
|
|
final LevelBuilder lb = new LevelBuilder(128, theme, seed); |
|
|
|
|
|
|
|
|
|
|
|
lb.addRoom(Rooms.ENTRANCE, BuildOrder.FIRST, true); |
|
|
|
lb.addRoom(Rooms.ENTRANCE, BuildOrder.FIRST, true); |
|
|
|