public static void MakeGuardTowers() { Console.WriteLine("Making guard towers"); // remove wall BlockShapes.MakeSolidBox(intFarmSize + 5, intFarmSize + 11, 64, 79, intFarmSize + 5, intFarmSize + 11, (int)BlockType.AIR, 1); // add tower BlockShapes.MakeHollowBox(intFarmSize + 4, intFarmSize + 12, 63, 80, intFarmSize + 4, intFarmSize + 12, (int)BlockType.STONE, 1); // divide into two rooms BlockShapes.MakeSolidBox(intFarmSize + 4, intFarmSize + 12, 71, 71, intFarmSize + 4, intFarmSize + 12, (int)BlockType.STONE, 1); // add openings to the walls for (int y = 72; y <= 74; y++) { for (int x = intFarmSize + 7; x <= intFarmSize + 9; x++) { BlockShapes.MakeBlock(x, y, intFarmSize + 12, (int)BlockType.AIR, 2); } } // add blocks on top of the towers BlockShapes.MakeHollowLayers(intFarmSize + 4, intFarmSize + 12, 81, 81, intFarmSize + 4, intFarmSize + 12, (int)BlockType.STONE, 1); // alternating top blocks for (int x = intFarmSize + 4; x <= intFarmSize + 12; x += 2) { for (int z = intFarmSize + 4; z <= intFarmSize + 12; z += 2) { if (x == intFarmSize + 4 || x == intFarmSize + 12 || z == intFarmSize + 4 || z == intFarmSize + 12) { BlockShapes.MakeBlock(x, 82, z, (int)BlockType.STONE, 1); } } } // add central columns BlockShapes.MakeSolidBox(intFarmSize + 8, intFarmSize + 8, 72, 81, intFarmSize + 8, intFarmSize + 8, (int)BlockType.STONE, 1); BlockShapes.MakeLadder(intFarmSize + 7, 72, 81, intFarmSize + 8, 0, 1); BlockShapes.MakeLadder(intFarmSize + 9, 72, 81, intFarmSize + 8, 0, 1); BlockShapes.MakeLadder(intFarmSize + 8, 72, 81, intFarmSize + 7, 0, 1); BlockShapes.MakeLadder(intFarmSize + 8, 72, 81, intFarmSize + 9, 0, 1); // add cobwebs BlockShapes.MakeBlock(intFarmSize + 5, 79, intFarmSize + 5, 30, 1, 30); BlockShapes.MakeBlock(intFarmSize + 5, 79, intFarmSize + 11, 30, 1, 30); BlockShapes.MakeBlock(intFarmSize + 11, 79, intFarmSize + 5, 30, 1, 30); BlockShapes.MakeBlock(intFarmSize + 11, 79, intFarmSize + 11, 30, 1, 30); // add chests MakeGuardChest(intFarmSize + 5, 72, intFarmSize + 5); MakeGuardChest(intMapSize - (intFarmSize + 5), 72, intFarmSize + 5); MakeGuardChest(intFarmSize + 5, 72, intMapSize - (intFarmSize + 5)); MakeGuardChest(intMapSize - (intFarmSize + 5), 72, intMapSize - (intFarmSize + 5)); }
public static void MakeDrawbridges() { Console.WriteLine("Making drawbridges"); // drawbridge BlockShapes.MakeSolidBox((intMapSize / 2) - 2, intMapSize / 2, 63, 63, intFarmSize - 2, intFarmSize + 11, (int)BlockType.STONE, 2); // carve out the entrance/exit BlockShapes.MakeSolidBox((intMapSize / 2) - 2, intMapSize / 2, 64, 67, intFarmSize + 6, intFarmSize + 10, (int)BlockType.AIR, 2); // add the bottom of a portcullis BlockShapes.MakeSolidBox((intMapSize / 2) - 2, intMapSize / 2, 67, 67, intFarmSize + 6, intFarmSize + 6, (int)BlockType.FENCE, 2); // ladder BlockShapes.MakeLadder((intMapSize / 2) - 4, 64, 72, intFarmSize + 11); BlockShapes.MakeLadder((intMapSize / 2) + 4, 64, 72, intFarmSize + 11); BlockShapes.MakeLadder((intMapSize / 2) - 4, 64, 72, intMapSize - (intFarmSize + 11)); BlockShapes.MakeLadder((intMapSize / 2) + 4, 64, 72, intMapSize - (intFarmSize + 11)); BlockShapes.MakeLadder(intFarmSize + 11, 64, 72, (intMapSize / 2) - 4); BlockShapes.MakeLadder(intFarmSize + 11, 64, 72, (intMapSize / 2) + 4); BlockShapes.MakeLadder(intMapSize - (intFarmSize + 11), 64, 72, (intMapSize / 2) - 4); BlockShapes.MakeLadder(intMapSize - (intFarmSize + 11), 64, 72, (intMapSize / 2) + 4); }
public static bool[,] MakeSewers() { Console.WriteLine("Making sewers"); int intPlots = 1 + (((intMapSize - (intFarmSize + 20)) - (intFarmSize + 18)) / intPlotSize); bool[,] booNewSewerEntrances = MakeSewerEntrances(intPlots); bool[,] booOldSewerEntrances = booNewSewerEntrances; Maze maze = new Maze(); // 51, 43, 35, 27, 19, 11, 3 for (int y = 3; y <= 51; y += 8) { booOldSewerEntrances = booNewSewerEntrances; booNewSewerEntrances = MakeSewerEntrances(intPlots); bool[,] booMaze = maze.GenerateMaze((intPlots * 2) + 1, (intPlots * 2) + 1); //booMaze = maze.CreateLoops(booMaze, booMaze.GetLength(0) / 2); if (y == 3) { booMaze = maze.DeleteDeadEnds(booMaze, booNewSewerEntrances, booNewSewerEntrances); } else { booMaze = maze.DeleteDeadEnds(booMaze, booOldSewerEntrances, booNewSewerEntrances); } for (int x = 0; x < booMaze.GetUpperBound(0); x++) { for (int z = 0; z < booMaze.GetUpperBound(1); z++) { if (booMaze[x, z]) { MakeSewerSection(booMaze, x, z, intFarmSize + 18 + (x * intPlotSize / 2), intFarmSize + 18 + (z * intPlotSize / 2), y); } } } for (int x = 0; x < booMaze.GetUpperBound(0); x++) { for (int z = 0; z < booMaze.GetUpperBound(1); z++) { if (booMaze[x, z]) { if (y > 3 && x % 2 == 1 && z % 2 == 1 && booOldSewerEntrances[(x - 1) / 2, (z - 1) / 2]) { BlockShapes.MakeSolidBox(intFarmSize + 18 + (x * intPlotSize / 2) - 1, intFarmSize + 18 + (x * intPlotSize / 2) + 1, y - 7, y + 1, intFarmSize + 18 + (z * intPlotSize / 2) - 1, intFarmSize + 18 + (z * intPlotSize / 2) + 1, (int)BlockType.AIR); BlockShapes.MakeHollowLayers(intFarmSize + 18 + (x * intPlotSize / 2) - 1, intFarmSize + 18 + (x * intPlotSize / 2) + 1, y, y, intFarmSize + 18 + (z * intPlotSize / 2) - 1, intFarmSize + 18 + (z * intPlotSize / 2) + 1, (int)BlockType.STONE); BlockShapes.MakeSolidBox(intFarmSize + 18 + (x * intPlotSize / 2), intFarmSize + 18 + (x * intPlotSize / 2), y - 7, y + 1, intFarmSize + 18 + (z * intPlotSize / 2) + 1, intFarmSize + 18 + (z * intPlotSize / 2) + 1, (int)BlockType.STONE); BlockShapes.MakeLadder(intFarmSize + 18 + (x * intPlotSize / 2), y - 7, y + 1, intFarmSize + 18 + (z * intPlotSize / 2), 2); } } } } } return(booNewSewerEntrances); }
public static void MakePlots(bool[,] booSewerEntrances) { Console.WriteLine("Making plots"); int intPlots = 1 + (((intMapSize - (intFarmSize + 20)) - (intFarmSize + 18)) / intPlotSize); for (int x = intFarmSize + 18; x < intMapSize - (intFarmSize + 20); x += intPlotSize) { for (int z = intFarmSize + 18; z < intMapSize - (intFarmSize + 20); z += intPlotSize) { if (booSewerEntrances[(x - (intFarmSize + 18)) / intPlotSize, (z - (intFarmSize + 18)) / intPlotSize]) { BlockShapes.MakeHollowBox(x + (intPlotSize / 2) - 2, x + (intPlotSize / 2) + 2, 63, 67, z + (intPlotSize / 2) - 2, z + (intPlotSize / 2) + 2, (int)BlockType.STONE); BlockShapes.MakeSolidBox(x + (intPlotSize / 2), x + (intPlotSize / 2), 64, 65, z + (intPlotSize / 2) - 2, z + (intPlotSize / 2) - 2, (int)BlockType.AIR); BlockShapes.MakeSolidBox(x + (intPlotSize / 2), x + (intPlotSize / 2), 55, 63, z + (intPlotSize / 2), z + (intPlotSize / 2), (int)BlockType.AIR); BlockShapes.MakeSolidBox(x + (intPlotSize / 2), x + (intPlotSize / 2), 52, 55, z + (intPlotSize / 2) + 1, z + (intPlotSize / 2) + 1, (int)BlockType.STONE); BlockShapes.MakeLadder(x + (intPlotSize / 2), 52, 63, z + (intPlotSize / 2), 2); bm.SetID(x + (intPlotSize / 2), 64, z + (intPlotSize / 2), 96); // hatch bm.SetData(x + (intPlotSize / 2), 64, z + (intPlotSize / 2), 2); bm.SetID(x + (intPlotSize / 2) + 1, 64, z + (intPlotSize / 2) + 1, (int)BlockType.CHEST); TileEntityChest tec = new TileEntityChest(); tec.Items[0] = MakeItem((int)BlockType.REDSTONE_TORCH_ON, 32); tec.Items[1] = MakeItem((int)BlockType.TORCH, 8); bm.SetTileEntity(x + (intPlotSize / 2) + 1, 64, z + (intPlotSize / 2) + 1, tec); MakeSign(x + (intPlotSize / 2), 66, z + (intPlotSize / 2) - 3, "Sewers||Currently|empty!", (int)BlockType.STONE); } else { int intRandBuilding = rand.Next(100); if (intRandBuilding >= 90) { BlockShapes.MakeHollowLayers(x + 3, x + 9, 63, 63, z + 3, z + 9, (int)BlockType.DOUBLE_SLAB); for (int a = 0; a <= 3; a++) { bm.SetID(x + 6, 63, z + a, (int)BlockType.DOUBLE_SLAB); } int x1 = x + rand.Next(5, 7); int z1 = z + rand.Next(5, 7); BlockShapes.MakeSolidBox(x1, x1 + 1, 63, 63, z1, z1 + 1, (int)BlockType.STATIONARY_WATER); int intFail = 0, intTrees = 10; bool blnValid = true; do { x1 = x + 1 + rand.Next(0, intPlotSize - 2); z1 = z + 1 + rand.Next(0, intPlotSize - 2); if (bm.GetID(x1, 63, z1) != (int)BlockType.DOUBLE_SLAB && bm.GetID(x1, 63, z1) != (int)BlockType.STATIONARY_WATER) { blnValid = true; for (int a = x1 - 4; a <= x1 + 4 && blnValid; a++) { for (int b = z1 - 4; b <= z1 + 4 && blnValid; b++) { if (bm.GetID(a, 64, b) == (int)BlockType.SAPLING) { blnValid = false; } } } if (blnValid) { bm.SetID(x1, 64, z1, (int)BlockType.SAPLING); bm.SetData(x1, 64, z1, 15); intTrees--; intFail = 0; } else { intFail++; } } } while (intTrees > 0 && intFail < 200); for (x1 = x + 1; x1 < x + intPlotSize - 1; x1++) { for (z1 = z + 1; z1 < z + intPlotSize - 1; z1++) { if (bm.GetID(x1, 63, z1) != (int)BlockType.STATIONARY_WATER && bm.GetID(x1, 64, z1) != (int)BlockType.SAPLING && bm.GetID(x1, 63, z1) != (int)BlockType.DOUBLE_SLAB) { int intRand = rand.Next(100); if (intRand > 66) { bm.SetID(x1, 64, z1, (int)BlockType.YELLOW_FLOWER); } else if (intRand > 33) { bm.SetID(x1, 64, z1, (int)BlockType.RED_ROSE); } } } } } else { BlockShapes.MakeHollowBox(x + 2, x + 10, 63, 67, z + 2, z + 10, (int)BlockType.WOOD_PLANK); for (int a = 0; a <= 4; a++) { BlockShapes.MakeSolidBox(x + 2, x + 10, 67 + a, 67 + a, z + 2 + a, z + 10 - a, (int)BlockType.WOOD); } BlockShapes.MakeSolidBox(x + 10, x + 10, 65, 65, z + 6, z + 8, (int)BlockType.GLASS); BlockShapes.MakeSolidBox(x + 2, x + 2, 65, 65, z + 4, z + 8, (int)BlockType.GLASS); BlockShapes.MakeSolidBox(x + 4, x + 8, 65, 65, z + 2, z + 2, (int)BlockType.GLASS); BlockShapes.MakeSolidBox(x + 4, x + 8, 65, 65, z + 10, z + 10, (int)BlockType.GLASS); bm.SetID(x + 10, 64, z + 4, (int)BlockType.WOOD_DOOR); bm.SetData(x + 10, 64, z + 4, 5); bm.SetID(x + 10, 65, z + 4, (int)BlockType.WOOD_DOOR); bm.SetData(x + 10, 65, z + 4, 13); } } BlockShapes.MakeHollowLayers(x, x + intPlotSize, 63, 63, z, z + intPlotSize, (int)BlockType.DOUBLE_SLAB); } } }