Skip to content

Commit

Permalink
theme tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Greymerk committed Jun 30, 2014
1 parent 82da3da commit 5e049ec
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 113 deletions.
2 changes: 1 addition & 1 deletion src/main/java/greymerk/roguelike/Roguelike.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid="Roguelike", name="Roguelike Dungeons", version="1.3.3")
@Mod(modid="Roguelike", name="Roguelike Dungeons", version="1.3.4")

public class Roguelike {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,10 @@ private static void southWest(World world, Random rand, ITheme theme, int x, int
WorldGenPrimitive.fillRectSolid(world, rand, x, y, z + 1, x, y, z + 4, stair, true, true);

if(RogueConfig.getBoolean(RogueConfig.GENEROUS)){
WorldGenPrimitive.setBlock(world, x, y + 1, z + 1, Blocks.brewing_stand);
WorldGenPrimitive.setBlock(world, x + 1, y + 1, z + 5, Blocks.brewing_stand);
}

TreasureChest.generate(world, rand, x, y + 1, z + 4, TreasureChest.POTIONS);
TreasureChest.generate(world, rand, x + 4, y + 1, z + 5, TreasureChest.POTIONS);


}
Expand All @@ -132,14 +130,14 @@ private static void southEast(World world, Random rand, ITheme theme, int x, int

WorldGenPrimitive.fillRectSolid(world, rand, x + 1, y, z + 5, x + 4, y, z + 5, new MetaBlock(Blocks.stonebrick, 0, 2), true, true);
WorldGenPrimitive.setBlock(world, x + 1, y + 1, z + 5, WorldGenPrimitive.blockOrientation(stair, Cardinal.WEST, false));
WorldGenPrimitive.setBlock(world, x + 2, y + 1, z + 5, Blocks.water);
WorldGenPrimitive.setBlock(world, x + 2, y + 1, z + 5, Blocks.flowing_water);
world.markBlockForUpdate(x + 2, y + 1, z + 5);
WorldGenPrimitive.setBlock(world, x + 2, y + 2, z + 5, slab);
WorldGenPrimitive.setBlock(world, x + 3, y + 1, z + 5, WorldGenPrimitive.blockOrientation(stair, Cardinal.EAST, false));

WorldGenPrimitive.fillRectSolid(world, rand, x + 5, y, z + 1, x + 5, y, z + 4, stone);
WorldGenPrimitive.setBlock(world, x + 5, y + 1, z + 1, WorldGenPrimitive.blockOrientation(stair, Cardinal.NORTH, false));
WorldGenPrimitive.setBlock(world, x + 5, y + 1, z + 2, Blocks.water);
WorldGenPrimitive.setBlock(world, x + 5, y + 1, z + 2, Blocks.flowing_water);
world.markBlockForUpdate(x + 5, y + 1, z + 2);
WorldGenPrimitive.setBlock(world, x + 5, y + 2, z + 2, slab);
WorldGenPrimitive.setBlock(world, x + 5, y + 1, z + 3, WorldGenPrimitive.blockOrientation(stair, Cardinal.SOUTH, false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ private void storage(World world, Random rand, int x, int y, int z){
WorldGenPrimitive.setBlock(world, rand, x - 1, y, z + 2, WorldGenPrimitive.blockOrientation(stairSpruce, Cardinal.EAST, true), true, true);
WorldGenPrimitive.setBlock(world, rand, x, y, z + 2, WorldGenPrimitive.blockOrientation(stairSpruce, Cardinal.NORTH, true), true, true);
WorldGenPrimitive.setBlock(world, rand, x + 1, y, z + 2, WorldGenPrimitive.blockOrientation(stairSpruce, Cardinal.WEST, true), true, true);
new TreasureChestFoodStore().generate(world, rand, x, y + 1, z + 2, 1, false);
}

private void northTable(World world, Random rand, int x, int y, int z){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import greymerk.roguelike.treasure.TreasureChest;
import greymerk.roguelike.worldgen.Cardinal;
import greymerk.roguelike.worldgen.Coord;
import greymerk.roguelike.worldgen.IBlockFactory;
import greymerk.roguelike.worldgen.MetaBlock;
import greymerk.roguelike.worldgen.Spawner;
import greymerk.roguelike.worldgen.WorldGenPrimitive;
Expand All @@ -24,23 +25,24 @@ public boolean generate(World world, Random rand, ITheme theme, int x, int y, in

HashSet<Coord> spawners = new HashSet<Coord>();
MetaBlock air = new MetaBlock(Blocks.air);
MetaBlock obsidian = new MetaBlock(Blocks.obsidian);
MetaBlock brick = new MetaBlock(Blocks.nether_brick);
IBlockFactory primaryWall = theme.getPrimaryWall();
IBlockFactory secondaryWall = theme.getSecondaryWall();

// space
WorldGenPrimitive.fillRectSolid(world, rand, x - 10, y - 3, z - 10, x + 10, y + 3, z + 10, air);


// roof
WorldGenPrimitive.fillRectSolid(world, rand, x - 7, y + 6, z - 7, x + 7, y + 6, z + 7, obsidian);
WorldGenPrimitive.fillRectSolid(world, rand, x - 8, y + 5, z - 8, x + 8, y + 5, z + 8, obsidian);
WorldGenPrimitive.fillRectSolid(world, rand, x - 9, y + 4, z - 9, x + 9, y + 4, z + 9, obsidian);
WorldGenPrimitive.fillRectSolid(world, rand, x - 7, y + 6, z - 7, x + 7, y + 6, z + 7, secondaryWall);
WorldGenPrimitive.fillRectSolid(world, rand, x - 8, y + 5, z - 8, x + 8, y + 5, z + 8, secondaryWall);
WorldGenPrimitive.fillRectSolid(world, rand, x - 9, y + 4, z - 9, x + 9, y + 4, z + 9, secondaryWall);
WorldGenPrimitive.fillRectSolid(world, rand, x - 1, y + 3, z - 1, x + 1, y + 5, z + 1, air);
WorldGenPrimitive.setBlock(world, x, y + 5, z, obsidian);
WorldGenPrimitive.setBlock(world, rand, x, y + 5, z, secondaryWall, true, true);
spawners.add(new Coord(x, y + 4, z));


// foundation
WorldGenPrimitive.fillRectSolid(world, rand, x - 10, y - 4, z - 10, x + 10, y - 4, z + 10, obsidian);
WorldGenPrimitive.fillRectSolid(world, rand, x - 10, y - 4, z - 10, x + 10, y - 4, z + 10, secondaryWall);

// ceiling holes
for(Cardinal dir : Cardinal.directions){
Expand Down Expand Up @@ -74,9 +76,9 @@ public boolean generate(World world, Random rand, ITheme theme, int x, int y, in
cursor = new Coord(x, y, z);
cursor.add(Cardinal.UP, 5);
cursor.add(dir, 4);
WorldGenPrimitive.setBlock(world, rand, cursor, obsidian, true, true);
WorldGenPrimitive.setBlock(world, rand, cursor, secondaryWall, true, true);
cursor.add(orth, 4);
WorldGenPrimitive.setBlock(world, rand, cursor, obsidian, true, true);
WorldGenPrimitive.setBlock(world, rand, cursor, secondaryWall, true, true);
}
}

Expand All @@ -94,11 +96,11 @@ public boolean generate(World world, Random rand, ITheme theme, int x, int y, in

start.add(Cardinal.DOWN, 4);
end.add(Cardinal.DOWN, 1);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, obsidian, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, secondaryWall, true, true);

start.add(Cardinal.UP, 4 + 3);
end.add(Cardinal.UP, 1 + 3);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, obsidian, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, secondaryWall, true, true);

// mid
start = new Coord(x, y, z);
Expand All @@ -107,7 +109,7 @@ public boolean generate(World world, Random rand, ITheme theme, int x, int y, in
end = new Coord(start);
start.add(orth[0], 9);
end.add(orth[1], 9);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, obsidian, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, secondaryWall, true, true);

// inner
start = new Coord(x, y, z);
Expand All @@ -116,7 +118,7 @@ public boolean generate(World world, Random rand, ITheme theme, int x, int y, in
end = new Coord(start);
start.add(orth[0], 9);
end.add(orth[1], 9);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, obsidian, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, secondaryWall, true, true);

// outer shell
start = new Coord(x, y, z);
Expand All @@ -126,10 +128,10 @@ public boolean generate(World world, Random rand, ITheme theme, int x, int y, in
end.add(Cardinal.UP, 3);
start.add(orth[0], 11);
end.add(orth[1], 11);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, obsidian, false, true);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, secondaryWall, false, true);
}

outerPillars(world, rand, x, y, z);
outerPillars(world, rand, theme, x, y, z);

// upper mid floor
for(Cardinal dir : Cardinal.directions){
Expand All @@ -141,7 +143,7 @@ public boolean generate(World world, Random rand, ITheme theme, int x, int y, in
start.add(dir, 9);
start.add(orth[0], 1);
end.add(orth[1], 1);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, brick, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, primaryWall, true, true);
}

// mid outer floors
Expand All @@ -156,7 +158,7 @@ public boolean generate(World world, Random rand, ITheme theme, int x, int y, in
end.add(orth, 9);
end.add(Cardinal.DOWN, 2);

WorldGenPrimitive.fillRectSolid(world, rand, start, end, brick, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, primaryWall, true, true);
MetaBlock step = new MetaBlock(Blocks.nether_brick_stairs);
Coord stepSpot = new Coord(x, y, z);
stepSpot.add(dir, 8);
Expand All @@ -181,17 +183,17 @@ public boolean generate(World world, Random rand, ITheme theme, int x, int y, in
stepSpot.add(Cardinal.reverse(orth), 1);
WorldGenPrimitive.setBlock(world, rand, stepSpot, step, true, true);
stepSpot.add(dir, 1);
WorldGenPrimitive.setBlock(world, rand, stepSpot, brick, true, true);
WorldGenPrimitive.setBlock(world, rand, stepSpot, primaryWall, true, true);
stepSpot.add(orth, 1);
WorldGenPrimitive.setBlock(world, rand, stepSpot, brick, true, true);
WorldGenPrimitive.setBlock(world, rand, stepSpot, primaryWall, true, true);

Coord corner = new Coord(x, y, z);
corner.add(dir, 7);
corner.add(orth, 7);
corner.add(Cardinal.DOWN, 2);
WorldGenPrimitive.setBlock(world, rand, corner, brick, true, true);
WorldGenPrimitive.setBlock(world, rand, corner, primaryWall, true, true);
corner.add(Cardinal.DOWN, 1);
WorldGenPrimitive.setBlock(world, rand, corner, brick, true, true);
WorldGenPrimitive.setBlock(world, rand, corner, primaryWall, true, true);

corner = new Coord(x, y, z);
corner.add(dir, 6);
Expand Down Expand Up @@ -220,7 +222,7 @@ public boolean generate(World world, Random rand, ITheme theme, int x, int y, in
}
}

innerPillars(world, rand, x, y, z);
innerPillars(world, rand, theme, x, y, z);

for(Coord space : spawners){
Spawner.generate(world, rand, space.getX(), space.getY(), space.getZ());
Expand All @@ -234,79 +236,79 @@ public int getSize() {
return 10;
}

private static void outerPillars(World world, Random rand, int x, int y, int z){
private static void outerPillars(World world, Random rand, ITheme theme, int x, int y, int z){
for(Cardinal dir : Cardinal.directions){
for (Cardinal orth : Cardinal.getOrthogonal(dir)){
Coord pillarLocation = new Coord(x, y, z);
pillarLocation.add(dir, 10);

pillarLocation.add(orth, 2);
outerPillar(world, rand, pillarLocation, dir);
outerPillar(world, rand, theme, pillarLocation, dir);

pillarLocation.add(orth, 3);
outerPillar(world, rand, pillarLocation, dir);
outerPillar(world, rand, theme, pillarLocation, dir);

pillarLocation.add(orth, 3);
outerPillar(world, rand, pillarLocation, dir);
outerPillar(world, rand, theme, pillarLocation, dir);
}
}
}

private static void outerPillar(World world, Random rand, Coord pillarLocation, Cardinal dir){
private static void outerPillar(World world, Random rand, ITheme theme, Coord pillarLocation, Cardinal dir){

MetaBlock obsidian = new MetaBlock(Blocks.obsidian);
IBlockFactory secondaryWall = theme.getSecondaryPillar();

int x = pillarLocation.getX();
int y = pillarLocation.getY();
int z = pillarLocation.getZ();

WorldGenPrimitive.fillRectSolid(world, rand, x, y - 2, z, x, y + 3, z, obsidian);
WorldGenPrimitive.fillRectSolid(world, rand, x, y - 2, z, x, y + 3, z, secondaryWall);
Coord blockLocation = new Coord(x, y + 3, z);

blockLocation.add(dir, 1);
WorldGenPrimitive.setBlock(world, rand, blockLocation, obsidian, true, true);
WorldGenPrimitive.setBlock(world, rand, blockLocation, secondaryWall, true, true);

for(int i = 0; i < 3; ++i){
blockLocation.add(Cardinal.reverse(dir), 1);
blockLocation.add(Cardinal.UP, 1);
WorldGenPrimitive.setBlock(world, rand, blockLocation, obsidian, true, true);
WorldGenPrimitive.setBlock(world, rand, blockLocation, secondaryWall, true, true);
}
}

private static void innerPillars(World world, Random rand, int x, int y, int z){
private static void innerPillars(World world, Random rand, ITheme theme, int x, int y, int z){

MetaBlock obsidian = new MetaBlock(Blocks.obsidian);
IBlockFactory secondaryWall = theme.getSecondaryPillar();

for(Cardinal dir : Cardinal.directions){
for (Cardinal orth : Cardinal.getOrthogonal(dir)){
Coord pillar = new Coord(x, y, z);
pillar.add(dir, 2);
pillar.add(orth, 2);
WorldGenPrimitive.fillRectSolid(world, rand, pillar.getX(), y - 4, pillar.getZ(), pillar.getX(), y + 4, pillar.getZ(), obsidian, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, pillar.getX(), y - 4, pillar.getZ(), pillar.getX(), y + 4, pillar.getZ(), secondaryWall, true, true);
pillar.add(dir, 4);
WorldGenPrimitive.fillRectSolid(world, rand, pillar.getX(), y - 4, pillar.getZ(), pillar.getX(), y + 4, pillar.getZ(), obsidian, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, pillar.getX(), y - 4, pillar.getZ(), pillar.getX(), y + 4, pillar.getZ(), secondaryWall, true, true);
pillar.add(orth, 3);
WorldGenPrimitive.fillRectSolid(world, rand, pillar.getX(), y - 4, pillar.getZ(), pillar.getX(), y + 4, pillar.getZ(), obsidian, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, pillar.getX(), y - 4, pillar.getZ(), pillar.getX(), y + 4, pillar.getZ(), secondaryWall, true, true);

Coord start = new Coord(x, y, z);
start.add(Cardinal.DOWN, 1);
start.add(orth, 2);
start.add(dir, 2);
Coord end = new Coord(start);
end.add(dir, 5);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, obsidian, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, secondaryWall, true, true);

start = new Coord(x, y, z);
start.add(Cardinal.DOWN, 1);
start.add(dir, 7);
start.add(orth, 5);
WorldGenPrimitive.setBlock(world, rand, start, obsidian, true, true);
WorldGenPrimitive.setBlock(world, rand, start, secondaryWall, true, true);
start.add(Cardinal.DOWN, 1);
end = new Coord(start);
end.add(Cardinal.reverse(dir), 1);
end.add(orth, 1);
end.add(Cardinal.DOWN, 1);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, obsidian, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, start, end, secondaryWall, true, true);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,58 +17,51 @@

public class DungeonsWood implements IDungeon{

private static final int HEIGHT = 3;
private static final int WIDTH = 2;
private static final int LENGTH = 3;


private int originX;
private int originY;
private int originZ;

private int woodType;

public DungeonsWood() {
}

@Override
public boolean generate(World inWorld, Random inRandom, ITheme theme, int inOriginX, int inOriginY, int inOriginZ) {
public boolean generate(World world, Random rand, ITheme theme, int x, int y, int z) {

final int HEIGHT = 3;
final int WIDTH = rand.nextInt(2) + 2;
final int LENGTH = rand.nextInt(2) + 3;

int woodType = rand.nextInt(Log.values().length);
Log type = Log.values()[woodType];

originX = inOriginX;
originY = inOriginY;
originZ = inOriginZ;
woodType = inRandom.nextInt(6);
Log type = Log.values()[inRandom.nextInt(Log.values().length)];
MetaBlock pillar = Log.getLog(type);
MetaBlock planks = new MetaBlock(Blocks.planks, woodType);

MetaBlock glowstone = new MetaBlock(Blocks.glowstone);
MetaBlock air = new MetaBlock(Blocks.air);
MetaBlock planks = new MetaBlock(Blocks.planks, woodType);

WorldGenPrimitive.fillRectSolid(inWorld, inRandom, originX - WIDTH, originY, originZ - LENGTH, originX + WIDTH, originY + HEIGHT, originZ + LENGTH, air);
WorldGenPrimitive.fillRectHollow(inWorld, inRandom, originX - WIDTH - 1, originY - 1, originZ - LENGTH - 1, originX + WIDTH + 1, originY + HEIGHT + 1, originZ + LENGTH + 1, planks, false, true);

WorldGenPrimitive.fillRectSolid(world, rand, x - WIDTH, y, z - LENGTH, x + WIDTH, y + HEIGHT, z + LENGTH, air);
WorldGenPrimitive.fillRectHollow(world, rand, x - WIDTH - 1, y - 1, z - LENGTH - 1, x + WIDTH + 1, y + HEIGHT + 1, z + LENGTH + 1, planks, false, true);

// log beams
WorldGenPrimitive.fillRectSolid(inWorld, inRandom, originX - WIDTH, originY, originZ - LENGTH, originX - WIDTH, originY + HEIGHT, originZ - LENGTH, pillar, true, true);
WorldGenPrimitive.fillRectSolid(inWorld, inRandom, originX - WIDTH, originY, originZ + LENGTH, originX - WIDTH, originY + HEIGHT, originZ + LENGTH, pillar, true, true);
WorldGenPrimitive.fillRectSolid(inWorld, inRandom, originX + WIDTH, originY, originZ - LENGTH, originX + WIDTH, originY + HEIGHT, originZ - LENGTH, pillar, true, true);
WorldGenPrimitive.fillRectSolid(inWorld, inRandom, originX + WIDTH, originY, originZ + LENGTH, originX + WIDTH, originY + HEIGHT, originZ + LENGTH, pillar, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, x - WIDTH, y, z - LENGTH, x - WIDTH, y + HEIGHT, z - LENGTH, pillar, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, x - WIDTH, y, z + LENGTH, x - WIDTH, y + HEIGHT, z + LENGTH, pillar, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, x + WIDTH, y, z - LENGTH, x + WIDTH, y + HEIGHT, z - LENGTH, pillar, true, true);
WorldGenPrimitive.fillRectSolid(world, rand, x + WIDTH, y, z + LENGTH, x + WIDTH, y + HEIGHT, z + LENGTH, pillar, true, true);

// glowstone
WorldGenPrimitive.setBlock(inWorld, originX - WIDTH + 1, originY - 1, originZ - LENGTH + 1, glowstone);
WorldGenPrimitive.setBlock(inWorld, originX - WIDTH + 1, originY - 1, originZ + LENGTH - 1, glowstone);
WorldGenPrimitive.setBlock(inWorld, originX + WIDTH - 1, originY - 1, originZ - LENGTH + 1, glowstone);
WorldGenPrimitive.setBlock(inWorld, originX + WIDTH - 1, originY - 1, originZ + LENGTH - 1, glowstone);
WorldGenPrimitive.setBlock(world, x - WIDTH + 1, y - 1, z - LENGTH + 1, glowstone);
WorldGenPrimitive.setBlock(world, x - WIDTH + 1, y - 1, z + LENGTH - 1, glowstone);
WorldGenPrimitive.setBlock(world, x + WIDTH - 1, y - 1, z - LENGTH + 1, glowstone);
WorldGenPrimitive.setBlock(world, x + WIDTH - 1, y - 1, z + LENGTH - 1, glowstone);

WorldGenPrimitive.setBlock(inWorld, inRandom, originX, originY, originZ, planks, true, true);
WorldGenPrimitive.setBlock(inWorld, originX, originY + 1, originZ, Blocks.cake);
WorldGenPrimitive.setBlock(world, rand, x, y, z, planks, true, true);
WorldGenPrimitive.setBlock(world, x, y + 1, z, Blocks.cake);

List<Coord> space = new ArrayList<Coord>();
space.add(new Coord(originX - WIDTH, originY, originZ - LENGTH + 1));
space.add(new Coord(originX - WIDTH, originY, originZ + LENGTH - 1));
space.add(new Coord(originX + WIDTH, originY, originZ - LENGTH + 1));
space.add(new Coord(originX + WIDTH, originY, originZ + LENGTH - 1));
space.add(new Coord(x - WIDTH, y, z - LENGTH + 1));
space.add(new Coord(x - WIDTH, y, z + LENGTH - 1));
space.add(new Coord(x + WIDTH, y, z - LENGTH + 1));
space.add(new Coord(x + WIDTH, y, z + LENGTH - 1));

TreasureChest.generate(inWorld, inRandom, space, TreasureChest.FOOD);
TreasureChest.generate(world, rand, space, TreasureChest.FOOD);

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/greymerk/roguelike/catacomb/theme/Theme.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public static ITheme create(JsonObject json) throws Exception{

public static ITheme getByLevel(BiomeGenBase biome, int level){

boolean hot = biome.temperature >= 1.0F;
boolean hot = biome.temperature >= 0.91F;
boolean cold = biome.temperature <= 0.1F;
boolean wet = biome.rainfall >= 0.85F;
boolean wet = biome.rainfall >= 0.8F;
boolean dry = biome.rainfall <= 0.1;

switch(level){
Expand Down
Loading

0 comments on commit 5e049ec

Please sign in to comment.