else
return this;
}
private Screen newGame(Factory factory, Item item1, Item item2){
World world = new Worldgen(80 / 3, 24 / 3).build();
Creature player = factory.player(world);
player.swapLeftHand(world, item1);
player.swapRightHand(world, item2);
for (int i = 0; i < 80; i++)
factory.zora(world);
for (int i = 0; i < 100; i++)
factory.goblin(world);
for (int i = 0; i < 4; i++)
factory.rival(world);
for (Tile biome : new Tile[]{
Tile.GREEN_TREE1, Tile.GREEN_TREE1, Tile.GREEN_TREE1,
Tile.BROWN_TREE1, Tile.BROWN_TREE1, Tile.BROWN_TREE1,
Tile.WHITE_TREE1,
Tile.GREEN_ROCK, Tile.GREEN_ROCK, Tile.GREEN_ROCK,
Tile.BROWN_ROCK, Tile.BROWN_ROCK, Tile.BROWN_ROCK,
Tile.WHITE_ROCK,
Tile.GREEN_TREE1, Tile.GREEN_TREE1, Tile.GREEN_TREE1,
Tile.BROWN_TREE1, Tile.BROWN_TREE1, Tile.BROWN_TREE1,
Tile.WHITE_TREE1,
Tile.GREEN_ROCK, Tile.GREEN_ROCK, Tile.GREEN_ROCK,
Tile.BROWN_ROCK, Tile.BROWN_ROCK, Tile.BROWN_ROCK,
Tile.WHITE_ROCK,
Tile.DESERT_SAND1, Tile.WATER1 }){
for (int i = 0; i < 10; i++)
factory.monster(world, biome);
}
for (Point screen : world.map().getDeadEnds()){
if (world.map().screen(screen.x, screen.y).defaultWall == Tile.WHITE_WALL){
factory.miniboss(world, screen.x, screen.y);
world.add(factory.lostArtifact(), screen.x * 19 + 19 / 2, screen.y * 9 + 9 / 2);
} else {
switch ((int)(Math.random() * 5)){
case 0: world.addToScreen(factory.evasionPotion(), screen.x, screen.y); break;
case 1: world.addToScreen(factory.heartContainer(), screen.x, screen.y); break;
default: factory.miniboss(world, screen.x, screen.y); break;
}
}
}
world.update();
MessageBus.publish(new WorldCreated(world, player, "The world has been created."));
return new PlayScreen(world, factory, player);
}