public static void MakeBed(int x1, int x2, int y, int z1, int z2, int intMirror) { int intBedOrientation; if (x1 == x2 - 1) { intBedOrientation = (int)BedOrientation.NORTH; } else if (x1 == x2 + 1) { intBedOrientation = (int)BedOrientation.SOUTH; } else if (z1 == z2 - 1) { intBedOrientation = (int)BedOrientation.EAST; } else { intBedOrientation = (int)BedOrientation.WEST; } BlockShapes.MakeBlock(x1, y, z1, BlockType.BED, (int)BedState.HEAD + intBedOrientation); BlockShapes.MakeBlock(x2, y, z2, BlockType.BED, intBedOrientation); if (intMirror > 0) { MakeBed(_intMapSize - x1, _intMapSize - x2, y, z1, z2, 0); MakeBed(x1, x2, y, _intMapSize - z1, _intMapSize - z2, 0); MakeBed(_intMapSize - x1, _intMapSize - x2, y, _intMapSize - z1, _intMapSize - z2, 0); if (intMirror == 2) { MakeBed(z1, z2, y, x1, x2, 1); } } }
public static void MakeBed(int x1, int x2, int y, int z1, int z2, int intMirror) { int intBedOrientation; if (x1 == x2 - 1) { intBedOrientation = (int)BedOrientation.NORTH; } else if (x1 == x2 + 1) { intBedOrientation = (int)BedOrientation.SOUTH; } else if (z1 == z2 - 1) { intBedOrientation = (int)BedOrientation.EAST; } else { intBedOrientation = (int)BedOrientation.WEST; } BlockShapes.MakeBlock(x1, y, z1, BlockInfo.Bed.ID, (int)BedState.HEAD + intBedOrientation); BlockShapes.MakeBlock(x2, y, z2, BlockInfo.Bed.ID, intBedOrientation); if (intMirror > 0) { MakeBed(City.MapLength - x1, City.MapLength - x2, y, z1, z2, 0); MakeBed(x1, x2, y, City.MapLength - z1, City.MapLength - z2, 0); MakeBed(City.MapLength - x1, City.MapLength - x2, y, City.MapLength - z1, City.MapLength - z2, 0); if (intMirror == 2) { MakeBed(z1, z2, y, x1, x2, 1); } } }
public static void MakeGuardTowers(BlockManager bm, int intFarmSize, int intMapSize, bool booIncludeWalls) { // 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, 59, 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); BlockHelper.MakeLadder(intFarmSize + 7, 72, 81, intFarmSize + 8, 2); BlockHelper.MakeLadder(intFarmSize + 9, 72, 81, intFarmSize + 8, 2); // add cobwebs // todo: could probably use double-mirroring here BlockShapes.MakeBlock(intFarmSize + 5, 79, intFarmSize + 5, (int)BlockType.COBWEB, 1, 30); BlockShapes.MakeBlock(intFarmSize + 5, 79, intFarmSize + 11, (int)BlockType.COBWEB, 1, 30); BlockShapes.MakeBlock(intFarmSize + 11, 79, intFarmSize + 5, (int)BlockType.COBWEB, 1, 30); BlockShapes.MakeBlock(intFarmSize + 11, 79, intFarmSize + 11, (int)BlockType.COBWEB, 1, 30); // add chests MakeGuardChest(bm, intFarmSize + 11, 72, intFarmSize + 11); MakeGuardChest(bm, intMapSize - (intFarmSize + 11), 72, intFarmSize + 11); MakeGuardChest(bm, intFarmSize + 11, 72, intMapSize - (intFarmSize + 11)); MakeGuardChest(bm, intMapSize - (intFarmSize + 11), 72, intMapSize - (intFarmSize + 11)); // add archery slots BlockShapes.MakeSolidBox(intFarmSize + 4, intFarmSize + 4, 73, 76, intFarmSize + 8, intFarmSize + 8, (int)BlockType.AIR, 2); BlockShapes.MakeSolidBox(intFarmSize + 4, intFarmSize + 4, 75, 75, intFarmSize + 7, intFarmSize + 9, (int)BlockType.AIR, 2); if (!booIncludeWalls) { BlockHelper.MakeLadder(intFarmSize + 13, 64, 71, intFarmSize + 8, 2); } }
public static void MakeDrawbridges(BlockManager bm, int intFarmSize, int intMapSize, bool booIncludeMoat, bool booIncludeWalls) { if (booIncludeWalls) { // drawbridge int intBridgeEnd = booIncludeMoat ? -2 : 5; BlockShapes.MakeSolidBox((intMapSize / 2) - 2, intMapSize / 2, 63, 63, intFarmSize + intBridgeEnd, intFarmSize + 13, (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); // add room for murder holes BlockShapes.MakeSolidBox((intMapSize / 2) - 2, (intMapSize / 2) + 2, 69, 71, intFarmSize + 8, intFarmSize + 9, (int)BlockType.AIR, 2); BlockShapes.MakeSolidBox(intMapSize / 2, intMapSize / 2, 69, 72, intFarmSize + 8, intFarmSize + 9, (int)BlockType.AIR, 2); BlockHelper.MakeLadder(intMapSize / 2, 69, 72, intFarmSize + 9, 2, (int)BlockType.STONE); BlockShapes.MakeSolidBox(intMapSize / 2, intMapSize / 2, 72, 72, intFarmSize + 8, intFarmSize + 8, (int)BlockType.STONE, 2); // murder holes BlockShapes.MakeSolidBox((intMapSize / 2) - 2, (intMapSize / 2) - 2, 68, 68, intFarmSize + 8, intFarmSize + 8, (int)BlockType.AIR, 2); BlockShapes.MakeSolidBox(intMapSize / 2, intMapSize / 2, 68, 68, intFarmSize + 8, intFarmSize + 8, (int)BlockType.AIR, 2); BlockShapes.MakeSolidBox((intMapSize / 2) + 2, (intMapSize / 2) + 2, 68, 68, intFarmSize + 8, intFarmSize + 8, (int)BlockType.AIR, 2); // chests BlockShapes.MakeBlock((intMapSize / 2) - 4, 69, intFarmSize + 9, (int)BlockType.GRAVEL, 2, 100, -1); BlockShapes.MakeBlock((intMapSize / 2) + 4, 69, intFarmSize + 9, (int)BlockType.GRAVEL, 2, 100, -1); BlockShapes.MakeBlock((intMapSize / 2) - 3, 70, intFarmSize + 9, (int)BlockType.AIR, 2, 100, -1); BlockShapes.MakeBlock((intMapSize / 2) + 3, 70, intFarmSize + 9, (int)BlockType.AIR, 2, 100, -1); TileEntityChest tec = new TileEntityChest(); tec.Items[0] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1); tec.Items[1] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1); tec.Items[2] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1); BlockHelper.MakeChest((intMapSize / 2) - 3, 69, intFarmSize + 9, (int)BlockType.GRAVEL, tec, 2); // add torches BlockHelper.MakeTorch((intMapSize / 2) - 1, 70, intFarmSize + 9, (int)BlockType.STONE, 2); BlockHelper.MakeTorch((intMapSize / 2) + 1, 70, intFarmSize + 9, (int)BlockType.STONE, 2); // link to main roads //BlockShapes.MakeSolidBox((intMapSize / 2) - 1, (intMapSize / 2) + 1, 63, 63, // intFarmSize + 11, intFarmSize + 13, (int)BlockType.DOUBLE_SLAB, 0); } else if (booIncludeMoat) { BlockShapes.MakeSolidBox((intMapSize / 2) - 2, intMapSize / 2, 63, 63, intFarmSize - 2, intFarmSize + 6, (int)BlockType.STONE, 2); } }
private static void MakeStreetLights(BlockManager bm, int intMapSize, int intFarmSize) { for (int a = intMapSize / 2; a >= intFarmSize + 16; a -= 8) { BlockShapes.MakeSolidBox(a, a, 64, 66, intMapSize / 2, intMapSize / 2, (int)BlockType.FENCE, 2); BlockShapes.MakeBlock(a, 67, intMapSize / 2, (int)BlockType.WOOD_PLANK, 2); BlockHelper.MakeTorch(a - 1, 67, intMapSize / 2, (int)BlockType.WOOD_PLANK, 2); BlockHelper.MakeTorch(a + 1, 67, intMapSize / 2, (int)BlockType.WOOD_PLANK, 2); BlockHelper.MakeTorch(a, 67, (intMapSize / 2) - 1, (int)BlockType.WOOD_PLANK, 2); BlockHelper.MakeTorch(a, 67, (intMapSize / 2) + 1, (int)BlockType.WOOD_PLANK, 2); } }
public static void ReplaceValuableBlocks(BetaWorld worldDest, BlockManager bm) { int intReplaced = 0; for (int x = 0; x < City.MapLength; x++) { for (int z = 0; z < City.MapLength; z++) { for (int y = 32; y < 128; y++) { if (bm.GetID(x, y, z) != City.WallMaterialID || bm.GetData(x, y, z) != City.WallMaterialData) { #pragma warning disable switch ((int)bm.GetID(x, y, z)) { case BlockType.GOLD_BLOCK: BlockShapes.MakeBlock(x, y, z, BlockInfo.Wool.ID, (int)WoolColor.YELLOW); intReplaced++; break; case BlockType.IRON_BLOCK: BlockShapes.MakeBlock(x, y, z, BlockInfo.Wool.ID, (int)WoolColor.LIGHT_GRAY); intReplaced++; break; case BlockType.OBSIDIAN: BlockShapes.MakeBlock(x, y, z, BlockInfo.Wool.ID, (int)WoolColor.BLACK); intReplaced++; break; case BlockType.DIAMOND_BLOCK: BlockShapes.MakeBlock(x, y, z, BlockInfo.Wool.ID, (int)WoolColor.LIGHT_BLUE); intReplaced++; break; case BlockType.LAPIS_BLOCK: BlockShapes.MakeBlock(x, y, z, BlockInfo.Wool.ID, (int)WoolColor.BLUE); intReplaced++; break; // no need for a default, because we purposefully want to skip all the other blocks } #pragma warning restore if (intReplaced > 25) { worldDest.Save(); intReplaced = 0; } } } } } }
private static void RemovePaths(BlockManager bm, int[,] intArea, int intBlockStart) { for (int x = 0; x < intArea.GetLength(0); x++) { for (int z = 0; z < intArea.GetLength(1); z++) { if (intArea[x, z] == 1) { BlockShapes.MakeBlock(intBlockStart + x, 63, intBlockStart + z, City.GroundBlockID, City.GroundBlockData); } } } }
public static void ReplaceValuableBlocks(BetaWorld worldDest, BlockManager bm, int intCitySize, int intWallMaterial) { int intReplaced = 0; for (int x = 0; x < intCitySize; x++) { for (int z = 0; z < intCitySize; z++) { for (int y = 32; y < 128; y++) { if ((int)bm.GetID(x, y, z) != intWallMaterial) { switch ((int)bm.GetID(x, y, z)) { case BlockType.GOLD_BLOCK: BlockShapes.MakeBlock(x, y, z, BlockType.WOOL, (int)WoolColor.YELLOW); intReplaced++; break; case BlockType.IRON_BLOCK: BlockShapes.MakeBlock(x, y, z, BlockType.WOOL, (int)WoolColor.LIGHT_GRAY); intReplaced++; break; case BlockType.OBSIDIAN: BlockShapes.MakeBlock(x, y, z, BlockType.WOOL, (int)WoolColor.BLACK); intReplaced++; break; case BlockType.DIAMOND_BLOCK: BlockShapes.MakeBlock(x, y, z, BlockType.WOOL, (int)WoolColor.LIGHT_BLUE); intReplaced++; break; case BlockType.LAPIS_BLOCK: BlockShapes.MakeBlock(x, y, z, BlockType.WOOL, (int)WoolColor.BLUE); intReplaced++; break; // no need for a default, because we purposefully want to skip all the other blocks } if (intReplaced > 25) { worldDest.Save(); intReplaced = 0; } } } } } }
public static void MakeLever(int x, int y, int z, int intBlockAgainst, int intMirror) { BlockShapes.MakeBlock(x, y, z, BlockInfo.Lever.ID, BlockDirection(x, y, z, intBlockAgainst)); if (intMirror > 0) { MakeLever(City.MapLength - x, y, z, intBlockAgainst, 0); MakeLever(x, y, City.MapLength - z, intBlockAgainst, 0); MakeLever(City.MapLength - x, y, City.MapLength - z, intBlockAgainst, 0); if (intMirror == 2) { MakeLever(z, y, x, intBlockAgainst, 1); } } }
public static void MakeLever(int x, int y, int z, int intBlockAgainst, int intMirror) { BlockShapes.MakeBlock(x, y, z, BlockType.LEVER, BlockDirection(x, y, z, intBlockAgainst)); if (intMirror > 0) { MakeLever(_intMapSize - x, y, z, intBlockAgainst, 0); MakeLever(x, y, _intMapSize - z, intBlockAgainst, 0); MakeLever(_intMapSize - x, y, _intMapSize - z, intBlockAgainst, 0); if (intMirror == 2) { MakeLever(z, y, x, intBlockAgainst, 1); } } }
private static void AddFlowersToBlock(BlockManager bm, int x, int z, int intFreeNeighbours, string strFlower) { int intBlock = Convert.ToInt32(strFlower.Split('_')[0]); int intID = 0; if (strFlower.Contains("_")) { intID = City.groundBlockData = Convert.ToInt32(strFlower.Split('_')[1]); } if (intBlock != BlockInfo.Cactus.ID || intFreeNeighbours == 9) { BlockShapes.MakeBlock(x, 64, z, intBlock, intID); } }
public static void MakeChest(int x, int y, int z, int intBlockAgainst, TileEntityChest tec, int intMirror) { BlockShapes.MakeBlock(x, y, z, BlockType.CHEST, BlockHelper.BlockDirection(x, y, z, intBlockAgainst)); _bmDest.SetTileEntity(x, y, z, tec); if (intMirror > 0) { MakeChest(_intMapSize - x, y, z, intBlockAgainst, tec, 0); MakeChest(x, y, _intMapSize - z, intBlockAgainst, tec, 0); MakeChest(_intMapSize - x, y, _intMapSize - z, intBlockAgainst, tec, 0); if (intMirror == 2) { MakeChest(z, y, x, intBlockAgainst, tec, 1); } } }
public static void MakeChest(int x, int y, int z, int intBlockAgainst, TileEntityChest tec, int intMirror) { BlockShapes.MakeBlock(x, y, z, BlockInfo.Chest.ID, BlockHelper.BlockDirection(x, y, z, intBlockAgainst)); _bmDest.SetTileEntity(x, y, z, tec); if (intMirror > 0) { MakeChest(City.MapLength - x, y, z, intBlockAgainst, tec, 0); MakeChest(x, y, City.MapLength - z, intBlockAgainst, tec, 0); MakeChest(City.MapLength - x, y, City.MapLength - z, intBlockAgainst, tec, 0); if (intMirror == 2) { MakeChest(z, y, x, intBlockAgainst, tec, 1); } } }
private static void AddFlowersToBlock(BlockManager bm, int x, int z, int intFreeNeighbours) { string strFlower = Utils.RandomValueFromXMLElement(Path.Combine("Resources", "Themes", City.ThemeName + ".xml"), "options", "flowers"); int intBlock = Convert.ToInt32(strFlower.Split('_')[0]); int intID = 0; if (strFlower.Contains("_")) { intID = City.GroundBlockData = Convert.ToInt32(strFlower.Split('_')[1]); } if (intBlock != BlockInfo.Cactus.ID || intFreeNeighbours == 9) { BlockShapes.MakeBlock(x, 64, z, intBlock, intID); } }
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)); }
private static void MakeEmblem(int intFarmLength, int intMapLength, string strCityEmblem) { if (strCityEmblem.ToLower() != "none") { int intBlockyBlock = RandomHelper.RandomNumber(BlockType.IRON_BLOCK, BlockType.GOLD_BLOCK, BlockType.DIAMOND_BLOCK); string[] strEmblem; if (strCityEmblem == "Random") { string[] strFiles = Directory.GetFiles("Resources", "Emblem*.txt"); strCityEmblem = RandomHelper.RandomItemFromArray(strFiles); strEmblem = File.ReadAllLines(strCityEmblem); } else { strEmblem = File.ReadAllLines(Path.Combine("Resources", "Emblem " + strCityEmblem + ".txt")); } for (int y = 0; y < strEmblem.GetLength(0); y++) { strEmblem[y] = strEmblem[y].Replace(" ", " "); strEmblem[y] = strEmblem[y].Replace((char)9, ' '); //tab string[] strLine = strEmblem[y].Split(' '); for (int x = 0; x < strLine.GetLength(0); x++) { string[] strSplit = strLine[x].Split(':'); if (strSplit.GetLength(0) == 1) { Array.Resize(ref strSplit, 2); } if (strSplit[0] == "-1") { strSplit[0] = intBlockyBlock.ToString(); } BlockShapes.MakeBlock(((intMapLength / 2) - (strLine.GetLength(0) + 5)) + x, 71 - y, intFarmLength + 5, Convert.ToInt32(strSplit[0]), 2, 100, Convert.ToInt32(strSplit[1])); } for (int x = strLine.GetLength(0) + 1; x < strLine.GetLength(0) + 5; x++) { BlockShapes.MakeBlock((intMapLength / 2) - (5 + x), 69, intFarmLength + 5, BlockType.AIR, 2, 100, 0); BlockShapes.MakeBlock((intMapLength / 2) - (5 + x), 70, intFarmLength + 5, BlockType.AIR, 2, 100, 0); } } } }
public static void MakeLadder(int x, int y1, int y2, int z, int intMirror, int intBlockAgainst) { int intDirection = BlockDirectionLadderSign(x, y1, z, intBlockAgainst); for (int y = y1; y <= y2; y++) { BlockShapes.MakeBlock(x, y, z, BlockType.LADDER, intDirection); } if (intMirror > 0) { MakeLadder(_intMapSize - x, y1, y2, z, 0, intBlockAgainst); MakeLadder(x, y1, y2, _intMapSize - z, 0, intBlockAgainst); MakeLadder(_intMapSize - x, y1, y2, _intMapSize - z, 0, intBlockAgainst); if (intMirror == 2) { MakeLadder(z, y1, y2, x, 1, intBlockAgainst); } } }
public static void MakeLadder(int x, int y1, int y2, int z, int intMirror, int intBlockAgainst) { int intDirection = BlockDirectionLadderSign(x, y1, z, intBlockAgainst); for (int y = y1; y <= y2; y++) { BlockShapes.MakeBlock(x, y, z, BlockInfo.Ladder.ID, intDirection); } if (intMirror > 0) { MakeLadder(City.MapLength - x, y1, y2, z, 0, intBlockAgainst); MakeLadder(x, y1, y2, City.MapLength - z, 0, intBlockAgainst); MakeLadder(City.MapLength - x, y1, y2, City.MapLength - z, 0, intBlockAgainst); if (intMirror == 2) { MakeLadder(z, y1, y2, x, 1, intBlockAgainst); } } }
public static void MakeWall() { Console.WriteLine("Making walls"); // walls for (int a = intFarmSize + 6; a <= intFarmSize + 10; a++) { BlockShapes.MakeHollowLayers(a, intMapSize - a, 58, 71, a, intMapSize - a, (int)BlockType.STONE); } // outside and inside edges at the top BlockShapes.MakeHollowLayers(intFarmSize + 6, intMapSize - (intFarmSize + 6), 72, 72, intFarmSize + 6, intMapSize - (intFarmSize + 6), (int)BlockType.STONE); BlockShapes.MakeHollowLayers(intFarmSize + 10, intMapSize - (intFarmSize + 10), 72, 72, intFarmSize + 10, intMapSize - (intFarmSize + 10), (int)BlockType.STONE); // alternating blocks on top of the edges for (int a = intFarmSize + 7; a <= intMapSize - (intFarmSize + 7); a += 2) { BlockShapes.MakeBlock(a, 73, intFarmSize + 6, (int)BlockType.STONE, 2); } for (int a = intFarmSize + 11; a <= intMapSize - (intFarmSize + 11); a += 2) { BlockShapes.MakeBlock(a, 73, intFarmSize + 10, (int)BlockType.STONE, 2); } }
private static void AddFlowersToBlock(BlockManager bmDest, int x, int z) { switch (RandomHelper.Next(4)) { case 0: bmDest.SetID(x, 64, z, BlockType.RED_ROSE); break; case 1: bmDest.SetID(x, 64, z, BlockType.YELLOW_FLOWER); break; case 2: case 3: BlockShapes.MakeBlock(x, 64, z, BlockType.TALL_GRASS, RandomHelper.Next(1, 3)); break; default: Debug.Fail("Invalid switch result"); break; } }
public static void MakeDoor(int x, int y, int z, int intBlockAgainst, bool booIronDoor, int intMirror) { int intDirection = BlockHelper.DoorDirection(x, y + 1, z, intBlockAgainst); int intBlockType = BlockInfo.WoodDoor.ID; if (booIronDoor) { intBlockType = BlockInfo.IronDoor.ID; } BlockShapes.MakeBlock(x, y + 1, z, intBlockType, (int)DoorState.TOPHALF + intDirection); BlockShapes.MakeBlock(x, y, z, intBlockType, intDirection); if (intMirror > 0) { MakeDoor(City.MapLength - x, y, z, intBlockAgainst, booIronDoor, 0); MakeDoor(x, y, City.MapLength - z, intBlockAgainst, booIronDoor, 0); MakeDoor(City.MapLength - x, y, City.MapLength - z, intBlockAgainst, booIronDoor, 0); if (intMirror == 2) { MakeDoor(z, y, x, intBlockAgainst, booIronDoor, 1); } } }
public static void MakeDoor(int x, int y, int z, int intBlockAgainst, bool booIronDoor, int intMirror) { int intDirection = BlockHelper.DoorDirection(x, y + 1, z, intBlockAgainst); int intBlockType = BlockType.WOOD_DOOR; if (booIronDoor) { intBlockType = BlockType.IRON_DOOR; } BlockShapes.MakeBlock(x, y + 1, z, intBlockType, (int)DoorState.TOPHALF + intDirection); BlockShapes.MakeBlock(x, y, z, intBlockType, intDirection); if (intMirror > 0) { MakeDoor(_intMapSize - x, y, z, intBlockAgainst, booIronDoor, 0); MakeDoor(x, y, _intMapSize - z, intBlockAgainst, booIronDoor, 0); MakeDoor(_intMapSize - x, y, _intMapSize - z, intBlockAgainst, booIronDoor, 0); if (intMirror == 2) { MakeDoor(z, y, x, intBlockAgainst, booIronDoor, 1); } } }
private static void MakeEmblem() { if (City.cityEmblemType.ToLower() != "none") { int intBlockyBlock = RNG.RandomItem(BlockInfo.GoldBlock.ID, BlockInfo.IronBlock.ID, BlockInfo.DiamondBlock.ID); string[] strEmblem; strEmblem = File.ReadAllLines(Path.Combine("Resources", "Emblem " + City.cityEmblemType + ".txt")); for (int y = 0; y < strEmblem.GetLength(0); y++) { strEmblem[y] = strEmblem[y].Replace(" ", " "); strEmblem[y] = strEmblem[y].Replace("\t", " "); //tab string[] strLine = strEmblem[y].Split(' '); for (int x = 0; x < strLine.GetLength(0); x++) { string[] strSplit = strLine[x].Split(':'); if (strSplit.GetLength(0) == 1) { Array.Resize(ref strSplit, 2); } if (strSplit[0] == "-1") { strSplit[0] = intBlockyBlock.ToString(); } BlockShapes.MakeBlock(((City.mapLength / 2) - (strLine.GetLength(0) + 6)) + x, 71 - y, City.edgeLength + 5, Convert.ToInt32(strSplit[0]), 2, 100, Convert.ToInt32(strSplit[1])); } for (int x = strLine.GetLength(0) + 1; x < strLine.GetLength(0) + 5; x++) { BlockShapes.MakeBlock((City.mapLength / 2) - (6 + x), 69, City.edgeLength + 5, BlockInfo.Air.ID, 2, 100, 0); BlockShapes.MakeBlock((City.mapLength / 2) - (6 + x), 70, City.edgeLength + 5, BlockInfo.Air.ID, 2, 100, 0); } } } }
public static void MakeWalls(int intFarmSize, int intMapSize) { // walls for (int a = intFarmSize + 6; a <= intFarmSize + 10; a++) { BlockShapes.MakeHollowLayers(a, intMapSize - a, 58, 71, a, intMapSize - a, (int)BlockType.STONE); } // outside and inside edges at the top BlockShapes.MakeHollowLayers(intFarmSize + 6, intMapSize - (intFarmSize + 6), 72, 72, intFarmSize + 6, intMapSize - (intFarmSize + 6), (int)BlockType.STONE); BlockShapes.MakeHollowLayers(intFarmSize + 10, intMapSize - (intFarmSize + 10), 72, 72, intFarmSize + 10, intMapSize - (intFarmSize + 10), (int)BlockType.STONE); // alternating blocks on top of the edges for (int a = intFarmSize + 6; a <= intMapSize - (intFarmSize + 6); a += 2) { BlockShapes.MakeBlock(a, 73, intFarmSize + 6, (int)BlockType.STONE, 2); } for (int a = intFarmSize + 10; a <= intMapSize - (intFarmSize + 10); a += 2) { BlockShapes.MakeBlock(a, 73, intFarmSize + 10, (int)BlockType.STONE, 2); } // ladder BlockHelper.MakeLadder((intMapSize / 2) - 5, 64, 72, intFarmSize + 11, 2); }
public static void MakeGuardTowers(BlockManager bm, int intFarmSize, int intMapSize, bool booIncludeWalls, string strOutsideLights, string strFireBeacons) { // 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, 2, 72, intFarmSize + 4, intFarmSize + 12, (int)BlockType.STONE, 1); BlockShapes.MakeSolidBox(intFarmSize + 5, intFarmSize + 11, 64, 67, intFarmSize + 5, intFarmSize + 11, (int)BlockType.AIR, 1); switch (strOutsideLights) { case "Fire": for (int y = 72; y <= 79; y += 7) { BlockShapes.MakeBlock(intFarmSize + 6, y, intFarmSize + 3, (int)BlockType.NETHERRACK, 2); BlockShapes.MakeBlock(intFarmSize + 6, y + 1, intFarmSize + 3, (int)BlockType.FIRE, 2); BlockShapes.MakeBlock(intFarmSize + 10, y, intFarmSize + 3, (int)BlockType.NETHERRACK, 2); BlockShapes.MakeBlock(intFarmSize + 10, y + 1, intFarmSize + 3, (int)BlockType.FIRE, 2); } break; case "Torches": for (int y = 73; y <= 80; y += 7) { BlockHelper.MakeTorch(intFarmSize + 6, y, intFarmSize + 3, (int)BlockType.STONE, 2); BlockHelper.MakeTorch(intFarmSize + 10, y, intFarmSize + 3, (int)BlockType.STONE, 2); } break; } // add torches BlockHelper.MakeTorch(intFarmSize + 6, 79, intFarmSize + 13, (int)BlockType.STONE, 2); BlockHelper.MakeTorch(intFarmSize + 10, 79, intFarmSize + 13, (int)BlockType.STONE, 2); // add torches inside BlockHelper.MakeTorch(intFarmSize + 6, 77, intFarmSize + 11, (int)BlockType.STONE, 2); BlockHelper.MakeTorch(intFarmSize + 10, 77, intFarmSize + 11, (int)BlockType.STONE, 2); BlockHelper.MakeTorch(intFarmSize + 5, 77, intFarmSize + 6, (int)BlockType.STONE, 2); BlockHelper.MakeTorch(intFarmSize + 5, 77, intFarmSize + 10, (int)BlockType.STONE, 2); // add openings to the walls BlockShapes.MakeBlock(intFarmSize + 7, 73, intFarmSize + 12, (int)BlockType.AIR, 2); BlockShapes.MakeBlock(intFarmSize + 9, 73, intFarmSize + 12, (int)BlockType.AIR, 2); BlockShapes.MakeBlock(intFarmSize + 7, 74, intFarmSize + 12, (int)BlockType.AIR, 2); BlockShapes.MakeBlock(intFarmSize + 9, 74, 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, 73, 82, intFarmSize + 8, intFarmSize + 8, (int)BlockType.STONE, 1); BlockHelper.MakeLadder(intFarmSize + 7, 73, 82, intFarmSize + 8, 2); BlockHelper.MakeLadder(intFarmSize + 9, 73, 82, intFarmSize + 8, 2); // add torches on the roof BlockShapes.MakeBlock(intFarmSize + 6, 81, intFarmSize + 6, (int)BlockType.TORCH, 1); BlockShapes.MakeBlock(intFarmSize + 6, 81, intFarmSize + 10, (int)BlockType.TORCH, 2); BlockShapes.MakeBlock(intFarmSize + 10, 81, intFarmSize + 10, (int)BlockType.TORCH, 1); // add cobwebs BlockShapes.MakeBlock(intFarmSize + 5, 79, intFarmSize + 5, (int)BlockType.COBWEB, 1, 30); BlockShapes.MakeBlock(intFarmSize + 5, 79, intFarmSize + 11, (int)BlockType.COBWEB, 1, 30); BlockShapes.MakeBlock(intFarmSize + 11, 79, intFarmSize + 5, (int)BlockType.COBWEB, 1, 30); BlockShapes.MakeBlock(intFarmSize + 11, 79, intFarmSize + 11, (int)BlockType.COBWEB, 1, 30); // add chests MakeGuardChest(bm, intFarmSize + 11, 73, intFarmSize + 11); MakeGuardChest(bm, intMapSize - (intFarmSize + 11), 73, intFarmSize + 11); MakeGuardChest(bm, intFarmSize + 11, 73, intMapSize - (intFarmSize + 11)); MakeGuardChest(bm, intMapSize - (intFarmSize + 11), 73, intMapSize - (intFarmSize + 11)); // add archery slots BlockShapes.MakeSolidBox(intFarmSize + 4, intFarmSize + 4, 74, 77, intFarmSize + 8, intFarmSize + 8, (int)BlockType.AIR, 2); BlockShapes.MakeSolidBox(intFarmSize + 4, intFarmSize + 4, 76, 76, intFarmSize + 7, intFarmSize + 9, (int)BlockType.AIR, 2); if (!booIncludeWalls) { BlockHelper.MakeLadder(intFarmSize + 13, 64, 72, intFarmSize + 8, 2); } // include beds BlockHelper.MakeBed(intFarmSize + 5, intFarmSize + 6, 64, intFarmSize + 8, intFarmSize + 8, 2); BlockHelper.MakeBed(intFarmSize + 5, intFarmSize + 6, 64, intFarmSize + 10, intFarmSize + 10, 2); BlockHelper.MakeBed(intFarmSize + 11, intFarmSize + 10, 64, intFarmSize + 8, intFarmSize + 8, 2); // make columns to orientate torches BlockShapes.MakeSolidBox(intFarmSize + 5, intFarmSize + 5, 64, 73, intFarmSize + 5, intFarmSize + 5, (int)BlockType.WOOD, 2); BlockShapes.MakeSolidBox(intFarmSize + 11, intFarmSize + 11, 64, 71, intFarmSize + 5, intFarmSize + 5, (int)BlockType.WOOD, 2); BlockShapes.MakeSolidBox(intFarmSize + 5, intFarmSize + 5, 64, 71, intFarmSize + 11, intFarmSize + 11, (int)BlockType.WOOD, 2); BlockShapes.MakeSolidBox(intFarmSize + 11, intFarmSize + 11, 64, 71, intFarmSize + 11, intFarmSize + 11, (int)BlockType.WOOD, 2); // add ladders BlockHelper.MakeLadder(intFarmSize + 5, 64, 73, intFarmSize + 6, 2, (int)BlockType.WOOD); // make torches BlockHelper.MakeTorch(intFarmSize + 10, 66, intFarmSize + 5, (int)BlockType.WOOD, 2); BlockHelper.MakeTorch(intFarmSize + 6, 66, intFarmSize + 11, (int)BlockType.WOOD, 2); BlockHelper.MakeTorch(intFarmSize + 10, 66, intFarmSize + 11, (int)BlockType.WOOD, 2); // make columns for real BlockShapes.MakeSolidBox(intFarmSize + 5, intFarmSize + 5, 64, 73, intFarmSize + 5, intFarmSize + 5, (int)BlockType.STONE, 2); BlockShapes.MakeSolidBox(intFarmSize + 11, intFarmSize + 11, 64, 71, intFarmSize + 5, intFarmSize + 5, (int)BlockType.STONE, 2); BlockShapes.MakeSolidBox(intFarmSize + 5, intFarmSize + 5, 64, 71, intFarmSize + 11, intFarmSize + 11, (int)BlockType.STONE, 2); BlockShapes.MakeSolidBox(intFarmSize + 11, intFarmSize + 11, 64, 71, intFarmSize + 11, intFarmSize + 11, (int)BlockType.STONE, 2); // make cobwebs BlockShapes.MakeBlock(intFarmSize + 11, 67, intFarmSize + 8, (int)BlockType.COBWEB, 2, 75); // make doors from the city to the guard tower BlockShapes.MakeBlock(intFarmSize + 11, 65, intFarmSize + 11, (int)BlockType.GOLD_BLOCK, 1); BlockShapes.MakeBlock(intFarmSize + 11, 64, intFarmSize + 11, (int)BlockType.GOLD_BLOCK, 1); BlockHelper.MakeDoor(intFarmSize + 11, 64, intFarmSize + 12, (int)BlockType.GOLD_BLOCK, true, 2); BlockShapes.MakeBlock(intFarmSize + 11, 65, intFarmSize + 11, (int)BlockType.AIR, 1); BlockShapes.MakeBlock(intFarmSize + 11, 64, intFarmSize + 11, (int)BlockType.AIR, 1); BlockShapes.MakeBlock(intFarmSize + 11, 64, intFarmSize + 11, (int)BlockType.STONE_PLATE, 1); BlockShapes.MakeBlock(intFarmSize + 11, 64, intFarmSize + 13, (int)BlockType.STONE_PLATE, 2); // make beacon if (strFireBeacons == "Yes") { BlockShapes.MakeSolidBox(intFarmSize + 8, intFarmSize + 8, 83, 84, intFarmSize + 8, intFarmSize + 8, (int)BlockType.STONE, 1); BlockShapes.MakeSolidBox(intFarmSize + 6, intFarmSize + 10, 85, 85, intFarmSize + 6, intFarmSize + 10, (int)BlockType.STONE, 1); BlockShapes.MakeSolidBox(intFarmSize + 6, intFarmSize + 10, 86, 86, intFarmSize + 6, intFarmSize + 10, (int)BlockType.NETHERRACK, 1); BlockShapes.MakeSolidBox(intFarmSize + 6, intFarmSize + 10, 87, 87, intFarmSize + 6, intFarmSize + 10, (int)BlockType.FIRE, 1); } }
public static void MakeMoat(frmMace frmLogForm, BlockManager bm) { frmLogForm.UpdateLog("Moat type: " + City.MoatType, true, true); switch (City.MoatType) { case "Drop to Bedrock": for (int a = City.EdgeLength - 1; a <= City.EdgeLength + 5; a++) { BlockShapes.MakeHollowLayers(a, City.MapLength - a, 2, 63, a, City.MapLength - a, BlockInfo.Air.ID, 0, -1); } BlockShapes.MakeHollowLayers(City.EdgeLength - 2, City.MapLength - (City.EdgeLength - 2), 64, 64, City.EdgeLength - 2, City.MapLength - (City.EdgeLength - 2), BlockInfo.Fence.ID, 0, -1); break; case "Cactus": for (int a = City.EdgeLength - 1; a <= City.EdgeLength + 5; a++) { BlockShapes.MakeHollowLayers(a, City.MapLength - a, 63, 63, a, City.MapLength - a, BlockInfo.Sand.ID, 0, -1); } for (int a = City.EdgeLength + 1; a <= City.MapLength / 2; a += 2) { if (RNG.NextDouble() > 0.5) { BlockShapes.MakeBlock(a, 64, City.EdgeLength + 1, BlockInfo.Cactus.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 65, City.EdgeLength + 1, BlockInfo.Cactus.ID, 2, 50, -1); } if (RNG.NextDouble() > 0.5) { BlockShapes.MakeBlock(a, 64, City.EdgeLength + 3, BlockInfo.Cactus.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 65, City.EdgeLength + 3, BlockInfo.Cactus.ID, 2, 50, -1); } } for (int a = City.EdgeLength; a <= City.MapLength / 2; a += 2) { if (RNG.NextDouble() > 0.5) { BlockShapes.MakeBlock(a, 64, City.EdgeLength, BlockInfo.Cactus.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 65, City.EdgeLength, BlockInfo.Cactus.ID, 2, 50, -1); } if (RNG.NextDouble() > 0.5) { BlockShapes.MakeBlock(a, 64, City.EdgeLength + 2, BlockInfo.Cactus.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 65, City.EdgeLength + 2, BlockInfo.Cactus.ID, 2, 50, -1); } if (RNG.NextDouble() > 0.5) { BlockShapes.MakeBlock(a, 64, City.EdgeLength + 4, BlockInfo.Cactus.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 65, City.EdgeLength + 4, BlockInfo.Cactus.ID, 2, 50, -1); } } if (City.HasGuardTowers) { for (int a = City.EdgeLength + 3; a <= City.EdgeLength + 13; a += 2) { BlockShapes.MakeBlock(a, 64, City.EdgeLength + 3, BlockInfo.Air.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 65, City.EdgeLength + 3, BlockInfo.Air.ID, 2, 100, -1); } } break; case "Cactus Low": for (int a = City.EdgeLength - 1; a <= City.EdgeLength + 5; a++) { BlockShapes.MakeHollowLayers(a, City.MapLength - a, 59, 63, a, City.MapLength - a, BlockInfo.Air.ID, 0, -1); BlockShapes.MakeHollowLayers(a, City.MapLength - a, 58, 58, a, City.MapLength - a, BlockInfo.Sand.ID, 0, -1); } for (int a = City.EdgeLength + 1; a <= City.MapLength / 2; a += 2) { if (RNG.NextDouble() > 0.5) { BlockShapes.MakeBlock(a, 59, City.EdgeLength + 1, BlockInfo.Cactus.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 60, City.EdgeLength + 1, BlockInfo.Cactus.ID, 2, 50, -1); } if (RNG.NextDouble() > 0.5) { BlockShapes.MakeBlock(a, 59, City.EdgeLength + 3, BlockInfo.Cactus.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 60, City.EdgeLength + 3, BlockInfo.Cactus.ID, 2, 50, -1); } } for (int a = City.EdgeLength; a <= City.MapLength / 2; a += 2) { if (RNG.NextDouble() > 0.5) { BlockShapes.MakeBlock(a, 59, City.EdgeLength, BlockInfo.Cactus.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 60, City.EdgeLength, BlockInfo.Cactus.ID, 2, 50, -1); } if (RNG.NextDouble() > 0.5) { BlockShapes.MakeBlock(a, 59, City.EdgeLength + 2, BlockInfo.Cactus.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 60, City.EdgeLength + 2, BlockInfo.Cactus.ID, 2, 50, -1); } if (RNG.NextDouble() > 0.5) { BlockShapes.MakeBlock(a, 59, City.EdgeLength + 4, BlockInfo.Cactus.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 60, City.EdgeLength + 4, BlockInfo.Cactus.ID, 2, 50, -1); } } if (City.HasGuardTowers) { for (int a = City.EdgeLength + 3; a <= City.EdgeLength + 13; a += 2) { BlockShapes.MakeBlock(a, 59, City.EdgeLength + 3, BlockInfo.Air.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 60, City.EdgeLength + 3, BlockInfo.Air.ID, 2, 100, -1); } } break; case "Lava": for (int a = City.EdgeLength - 1; a <= City.EdgeLength + 5; a++) { BlockShapes.MakeHollowLayers(a, City.MapLength - a, 55, 56, a, City.MapLength - a, BlockInfo.Lava.ID, 0, -1); BlockShapes.MakeHollowLayers(a, City.MapLength - a, 57, 63, a, City.MapLength - a, BlockInfo.Air.ID, 0, -1); } break; case "Fire": for (int a = City.EdgeLength - 1; a <= City.EdgeLength + 5; a++) { BlockShapes.MakeHollowLayers(a, City.MapLength - a, 56, 56, a, City.MapLength - a, BlockInfo.Netherrack.ID, 0, -1); BlockShapes.MakeHollowLayers(a, City.MapLength - a, 57, 57, a, City.MapLength - a, BlockInfo.Fire.ID, 0, -1); BlockShapes.MakeHollowLayers(a, City.MapLength - a, 58, 63, a, City.MapLength - a, BlockInfo.Air.ID, 0, -1); } break; case "Water": for (int a = City.EdgeLength - 1; a <= City.EdgeLength + 5; a++) { BlockShapes.MakeHollowLayers(a, City.MapLength - a, 59, 63, a, City.MapLength - a, BlockInfo.Water.ID, 0, -1); } break; default: Debug.Fail("Invalid switch result"); break; } // drawbridge int intBridgeEnd = City.HasMoat ? -2 : 5; if (City.MoatType == "Lava" || City.MoatType == "Fire") { BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 63, 63, City.EdgeLength + intBridgeEnd, City.EdgeLength + 13, BlockInfo.StoneBrick.ID, 2); } else { BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 63, 63, City.EdgeLength + intBridgeEnd, City.EdgeLength + 13, BlockInfo.WoodPlank.ID, 2); } BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 64, 65, City.EdgeLength + intBridgeEnd, City.EdgeLength + 13, BlockInfo.Air.ID, 2); }
public static void MakeDrawbridges(BlockManager bm) { if (City.HasWalls) { // drawbridge int intBridgeEnd = City.HasMoat ? -2 : 5; if (City.MoatType == "Lava" || City.MoatType == "Fire") { BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 63, 63, City.FarmLength + intBridgeEnd, City.FarmLength + 13, BlockInfo.Stone.ID, 2); } else { BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 63, 63, City.FarmLength + intBridgeEnd, City.FarmLength + 13, BlockInfo.WoodPlank.ID, 2); } BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 64, 64, City.FarmLength + intBridgeEnd, City.FarmLength + 13, BlockInfo.Air.ID, 2); // carve out the entrance/exit BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 64, 67, City.FarmLength + intBridgeEnd, City.FarmLength + 10, BlockInfo.Air.ID, 2); if (Utils.IsValidSign(City.Name)) { BlockHelper.MakeSign((City.MapLength / 2) - 3, 65, City.FarmLength + 5, Utils.ConvertStringToSignText(City.Name.Replace("City of ", "City of~")), City.WallMaterialID, 2); } // add the bottom of a portcullis BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 67, 67, City.FarmLength + 6, City.FarmLength + 6, BlockInfo.Fence.ID, 2); // add room for murder holes BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, (City.MapLength / 2) + 2, 69, 71, City.FarmLength + 8, City.FarmLength + 9, BlockInfo.Air.ID, 2); BlockShapes.MakeSolidBox(City.MapLength / 2, City.MapLength / 2, 69, 72, City.FarmLength + 8, City.FarmLength + 9, BlockInfo.Air.ID, 2); BlockHelper.MakeLadder(City.MapLength / 2, 69, 72, City.FarmLength + 9, 2, City.WallMaterialID); BlockShapes.MakeSolidBoxWithData(City.MapLength / 2, City.MapLength / 2, 72, 72, City.FarmLength + 8, City.FarmLength + 8, City.WallMaterialID, 2, City.WallMaterialData); // murder holes BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, (City.MapLength / 2) - 2, 68, 68, City.FarmLength + 8, City.FarmLength + 8, BlockInfo.Air.ID, 2); BlockShapes.MakeSolidBox(City.MapLength / 2, City.MapLength / 2, 68, 68, City.FarmLength + 8, City.FarmLength + 8, BlockInfo.Air.ID, 2); BlockShapes.MakeSolidBox((City.MapLength / 2) + 2, (City.MapLength / 2) + 2, 68, 68, City.FarmLength + 8, City.FarmLength + 8, BlockInfo.Air.ID, 2); // chests BlockShapes.MakeBlock((City.MapLength / 2) - 4, 69, City.FarmLength + 9, BlockInfo.Gravel.ID, 2, 100, -1); BlockShapes.MakeBlock((City.MapLength / 2) + 4, 69, City.FarmLength + 9, BlockInfo.Gravel.ID, 2, 100, -1); BlockShapes.MakeBlock((City.MapLength / 2) - 3, 70, City.FarmLength + 9, BlockInfo.Air.ID, 2, 100, -1); BlockShapes.MakeBlock((City.MapLength / 2) + 3, 70, City.FarmLength + 9, BlockInfo.Air.ID, 2, 100, -1); TileEntityChest tec = new TileEntityChest(); if (City.HasItemsInChests) { tec.Items[0] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1); tec.Items[1] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1); tec.Items[2] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1); } BlockHelper.MakeChest((City.MapLength / 2) - 3, 69, City.FarmLength + 9, BlockInfo.Gravel.ID, tec, 2); // add torches BlockHelper.MakeTorch((City.MapLength / 2) - 1, 70, City.FarmLength + 9, City.WallMaterialID, 2); BlockHelper.MakeTorch((City.MapLength / 2) + 1, 70, City.FarmLength + 9, City.WallMaterialID, 2); // link to main roads //BlockShapes.MakeSolidBox((City.intMapLength / 2) - 1, (City.intMapLength / 2) + 1, 63, 63, // City.intFarmSize + 11, City.intFarmSize + 13, BlockType.DOUBLE_SLAB, 0); } else if (City.HasMoat) { BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 63, 63, City.FarmLength - 2, City.FarmLength + 6, BlockInfo.Stone.ID, 2); } }
public static void MakeWalls(BetaWorld world, int intFarmSize, int intMapSize, string strCityEmblem, string strOutsideLights, int intWallMaterial) { // walls for (int a = intFarmSize + 6; a <= intFarmSize + 10; a++) { BlockShapes.MakeHollowLayers(a, intMapSize - a, 58, 72, a, intMapSize - a, intWallMaterial, 0, -1); world.Save(); } // outside and inside edges at the top BlockShapes.MakeHollowLayers(intFarmSize + 5, intMapSize - (intFarmSize + 5), 72, 73, intFarmSize + 5, intMapSize - (intFarmSize + 5), intWallMaterial, 0, -1); BlockShapes.MakeHollowLayers(intFarmSize + 11, intMapSize - (intFarmSize + 11), 72, 73, intFarmSize + 11, intMapSize - (intFarmSize + 11), intWallMaterial, 0, -1); // alternating blocks on top of the edges for (int a = intFarmSize + 6; a <= intMapSize - (intFarmSize + 6); a += 2) { BlockShapes.MakeBlock(a, 74, intFarmSize + 5, intWallMaterial, 2, 100, -1); } for (int a = intFarmSize + 10; a <= intMapSize - (intFarmSize + 10); a += 2) { BlockShapes.MakeBlock(a, 74, intFarmSize + 11, intWallMaterial, 2, 100, -1); } // ladder BlockHelper.MakeLadder((intMapSize / 2) - 5, 64, 72, intFarmSize + 11, 2, intWallMaterial); BlockShapes.MakeBlock((intMapSize / 2) - 5, 73, intFarmSize + 11, (int)BlockType.AIR, 2, 100, -1); // decorations at the gates switch (strOutsideLights) { case "Fire": // fire above the entrances BlockShapes.MakeBlock((intMapSize / 2) - 1, 69, intFarmSize + 5, (int)BlockType.NETHERRACK, 2, 100, -1); BlockShapes.MakeBlock((intMapSize / 2), 69, intFarmSize + 5, (int)BlockType.NETHERRACK, 2, 100, -1); BlockShapes.MakeBlock((intMapSize / 2) - 1, 70, intFarmSize + 5, (int)BlockType.FIRE, 2, 100, -1); BlockShapes.MakeBlock((intMapSize / 2), 70, intFarmSize + 5, (int)BlockType.FIRE, 2, 100, -1); // fire on the outside walls for (int a = intFarmSize + 8; a < (intMapSize / 2) - 9; a += 4) { BlockShapes.MakeBlock(a, 69, intFarmSize + 5, (int)BlockType.NETHERRACK, 2, 100, -1); BlockShapes.MakeBlock(a, 70, intFarmSize + 5, (int)BlockType.FIRE, 2, 100, -1); } break; case "Torches": // torches above the entrances BlockHelper.MakeTorch((intMapSize / 2), 70, intFarmSize + 5, intWallMaterial, 2); BlockHelper.MakeTorch((intMapSize / 2) - 1, 70, intFarmSize + 5, intWallMaterial, 2); // torches on the outside walls for (int a = intFarmSize + 8; a < (intMapSize / 2) - 9; a += 4) { BlockHelper.MakeTorch(a, 70, intFarmSize + 5, intWallMaterial, 2); } break; } // torches on the inside walls for (int a = intFarmSize + 16; a < (intMapSize / 2); a += 4) { BlockHelper.MakeTorch(a, 69, intFarmSize + 11, intWallMaterial, 2); } // torches on the wall roofs for (int a = intFarmSize + 16; a < (intMapSize / 2); a += 4) { BlockShapes.MakeBlock(a, 73, intFarmSize + 8, (int)BlockType.TORCH, 2, 100, -1); } MakeEmblem(intFarmSize, intMapSize, strCityEmblem); }
public static void MakeWalls(AnvilWorld world, frmMace frmLogForm) { // walls for (int a = City.edgeLength + 6; a <= City.edgeLength + 10; a++) { BlockShapes.MakeHollowLayers(a, City.mapLength - a, 1, 72, a, City.mapLength - a, City.wallMaterialID, 0, City.wallMaterialData); world.Save(); } // outside and inside edges at the top BlockShapes.MakeHollowLayers(City.edgeLength + 5, City.mapLength - (City.edgeLength + 5), 72, 73, City.edgeLength + 5, City.mapLength - (City.edgeLength + 5), City.wallMaterialID, 0, City.wallMaterialData); BlockShapes.MakeHollowLayers(City.edgeLength + 11, City.mapLength - (City.edgeLength + 11), 72, 73, City.edgeLength + 11, City.mapLength - (City.edgeLength + 11), City.wallMaterialID, 0, City.wallMaterialData); // alternating blocks on top of the edges for (int a = City.edgeLength + 6; a <= City.mapLength - (City.edgeLength + 6); a += 2) { BlockShapes.MakeBlock(a, 74, City.edgeLength + 5, City.wallMaterialID, 2, 100, City.wallMaterialData); } for (int a = City.edgeLength + 12; a <= City.mapLength - (City.edgeLength + 12); a += 2) { BlockShapes.MakeBlock(a, 74, City.edgeLength + 11, City.wallMaterialID, 2, 100, City.wallMaterialData); } // ladder BlockHelper.MakeLadder((City.mapLength / 2) - 5, 64, 72, City.edgeLength + 11, 2, City.wallMaterialID); BlockShapes.MakeSolidBox((City.mapLength / 2) - 5, (City.mapLength / 2) + 5, 65, 74, City.edgeLength + 11, City.edgeLength + 11, BlockInfo.Air.ID, 2); // decorations at the gates frmLogForm.UpdateLog("Creating wall lights: " + City.outsideLightType, true, true); switch (City.outsideLightType) { case "Fire": // fire above the entrances BlockShapes.MakeBlock((City.mapLength / 2) - 1, 69, City.edgeLength + 5, BlockInfo.Netherrack.ID, 2, 100, -1); BlockShapes.MakeBlock((City.mapLength / 2), 69, City.edgeLength + 5, BlockInfo.Netherrack.ID, 2, 100, -1); BlockShapes.MakeBlock((City.mapLength / 2) - 1, 70, City.edgeLength + 5, BlockInfo.Fire.ID, 2, 100, -1); BlockShapes.MakeBlock((City.mapLength / 2), 70, City.edgeLength + 5, BlockInfo.Fire.ID, 2, 100, -1); // fire on the outside walls for (int a = City.edgeLength + 8; a < (City.mapLength / 2) - 9; a += 4) { BlockShapes.MakeBlock(a, 69, City.edgeLength + 5, BlockInfo.Netherrack.ID, 2, 100, -1); BlockShapes.MakeBlock(a, 70, City.edgeLength + 5, BlockInfo.Fire.ID, 2, 100, -1); } break; case "Torches": // torches above the entrances BlockHelper.MakeTorch((City.mapLength / 2), 70, City.edgeLength + 5, City.wallMaterialID, 2); BlockHelper.MakeTorch((City.mapLength / 2) - 1, 70, City.edgeLength + 5, City.wallMaterialID, 2); // torches on the outside walls for (int a = City.edgeLength + 8; a < (City.mapLength / 2) - 9; a += 4) { BlockHelper.MakeTorch(a, 70, City.edgeLength + 5, City.wallMaterialID, 2); } break; case "None": case "": break; default: Debug.Fail("Invalid switch result"); break; } if (City.hasTorchesOnWalkways) { // torches on the inside walls for (int a = City.edgeLength + 16; a < (City.mapLength / 2); a += 4) { BlockHelper.MakeTorch(a, 69, City.edgeLength + 11, City.wallMaterialID, 2); } // torches on the wall roofs for (int a = City.edgeLength + 16; a < (City.mapLength / 2); a += 4) { BlockShapes.MakeBlock(a, 73, City.edgeLength + 8, BlockInfo.Torch.ID, 2, 100, -1); } } for (int a = City.edgeLength + 16; a < (City.mapLength / 2); a += 24) { switch (City.npcs) { case "Ghostdancer's NPCs": EntityVillager eVillager; eVillager = new EntityVillager(new TypedEntity("GKnight")); eVillager.Health = 20; BlockShapes.MakeEntity(a, 73, City.edgeLength + 8, eVillager, 2); break; case "Minecraft Villagers": EntityMob eMob; eMob = new EntityMob(new TypedEntity("VillagerGolem")); eMob.Health = 100; BlockShapes.MakeEntity(a, 73, City.edgeLength + 8, eMob, 2); break; } } frmLogForm.UpdateLog("Creating wall emblems: " + City.cityEmblemType, true, true); MakeEmblem(); }
public static void MakeMoat(int intFarmLength, int intMapLength, string strMoatType, bool booIncludeGuardTowers) { switch (strMoatType) { case "Drop to Bedrock": for (int a = intFarmLength - 1; a <= intFarmLength + 5; a++) { BlockShapes.MakeHollowLayers(a, intMapLength - a, 2, 63, a, intMapLength - a, BlockType.AIR, 0, -1); } break; case "Cactus": for (int a = intFarmLength - 1; a <= intFarmLength + 5; a++) { BlockShapes.MakeHollowLayers(a, intMapLength - a, 59, 63, a, intMapLength - a, BlockType.AIR, 0, -1); BlockShapes.MakeHollowLayers(a, intMapLength - a, 58, 58, a, intMapLength - a, BlockType.SAND, 0, -1); } for (int a = intFarmLength + 1; a <= intMapLength / 2; a += 2) { BlockShapes.MakeBlock(a, 59, intFarmLength + 1, BlockType.CACTUS, 2, 100, -1); BlockShapes.MakeBlock(a, 59, intFarmLength + 3, BlockType.CACTUS, 2, 100, -1); BlockShapes.MakeBlock(a, 60, intFarmLength + 1, BlockType.CACTUS, 2, 50, -1); BlockShapes.MakeBlock(a, 60, intFarmLength + 3, BlockType.CACTUS, 2, 50, -1); } for (int a = intFarmLength; a <= intMapLength / 2; a += 2) { BlockShapes.MakeBlock(a, 59, intFarmLength, BlockType.CACTUS, 2, 100, -1); BlockShapes.MakeBlock(a, 59, intFarmLength + 2, BlockType.CACTUS, 2, 100, -1); BlockShapes.MakeBlock(a, 59, intFarmLength + 4, BlockType.CACTUS, 2, 100, -1); BlockShapes.MakeBlock(a, 60, intFarmLength, BlockType.CACTUS, 2, 50, -1); BlockShapes.MakeBlock(a, 60, intFarmLength + 2, BlockType.CACTUS, 2, 50, -1); BlockShapes.MakeBlock(a, 60, intFarmLength + 4, BlockType.CACTUS, 2, 50, -1); } if (booIncludeGuardTowers) { for (int a = intFarmLength + 3; a <= intFarmLength + 13; a += 2) { BlockShapes.MakeBlock(a, 59, intFarmLength + 3, BlockType.AIR, 2, 100, -1); BlockShapes.MakeBlock(a, 60, intFarmLength + 3, BlockType.AIR, 2, 100, -1); } } break; case "Lava": for (int a = intFarmLength - 1; a <= intFarmLength + 5; a++) { BlockShapes.MakeHollowLayers(a, intMapLength - a, 59, 61, a, intMapLength - a, BlockType.LAVA, 0, -1); BlockShapes.MakeHollowLayers(a, intMapLength - a, 62, 63, a, intMapLength - a, BlockType.AIR, 0, -1); } break; case "Fire": for (int a = intFarmLength - 1; a <= intFarmLength + 5; a++) { BlockShapes.MakeHollowLayers(a, intMapLength - a, 59, 59, a, intMapLength - a, BlockType.NETHERRACK, 0, -1); BlockShapes.MakeHollowLayers(a, intMapLength - a, 60, 60, a, intMapLength - a, BlockType.FIRE, 0, -1); BlockShapes.MakeHollowLayers(a, intMapLength - a, 61, 63, a, intMapLength - a, BlockType.AIR, 0, -1); } break; case "Water": for (int a = intFarmLength - 1; a <= intFarmLength + 5; a++) { BlockShapes.MakeHollowLayers(a, intMapLength - a, 59, 63, a, intMapLength - a, BlockType.WATER, 0, -1); } break; default: Debug.Fail("Invalid switch result"); break; } }