Esempio n. 1
0
        public static void MakeMineshaft(BetaWorld world, BlockManager bm, Buildings.structPoint spMineshaftEntrance, frmMace frmLogForm)
        {
            _intBlockStartBuildings = City.EdgeLength + 13;
            int intMineshaftSize = (1 + City.MapLength) - (_intBlockStartBuildings * 2);

            if (intMineshaftSize % 5 > 0)
            {
                intMineshaftSize += 5 - (intMineshaftSize % 5);
            }
            _intBlockStartBuildings -= 2;
            for (int intLevel = 1; intLevel <= 7; intLevel++)
            {
                if (Utils.ValueFromXMLElement(Path.Combine("Resources", "Mineshaft.xml"), "active", "level" + intLevel.ToString()).IsAffirmative())
                {
                    MakeLevel(world, bm, intLevel, intMineshaftSize, spMineshaftEntrance, frmLogForm);
                }
            }
            int intBlockToReplace = bm.GetID(spMineshaftEntrance.x, 63, spMineshaftEntrance.z + 1);

            BlockShapes.MakeSolidBox(spMineshaftEntrance.x, spMineshaftEntrance.x,
                                     3, 63, spMineshaftEntrance.z + 1, spMineshaftEntrance.z + 1, BlockInfo.Wood.ID, 0);
            BlockHelper.MakeLadder(spMineshaftEntrance.x, 4, 63, spMineshaftEntrance.z, 0, BlockInfo.Wood.ID);
            BlockShapes.MakeSolidBox(spMineshaftEntrance.x, spMineshaftEntrance.x, 3, 63, spMineshaftEntrance.z + 1,
                                     spMineshaftEntrance.z + 1, BlockInfo.Stone.ID, 0);
            bm.SetID(spMineshaftEntrance.x, 63, spMineshaftEntrance.z + 1, intBlockToReplace);
        }
Esempio n. 2
0
        private static void MakeSewerEntrance(BlockManager bm, int x, int z, int intPlotSize)
        {
            // path
            BlockShapes.MakeHollowLayers(x, x + 8, 63, 63, z, z + intPlotSize, (int)BlockType.DOUBLE_SLAB);
            // building
            BlockShapes.MakeHollowBox(x + 2, x + 6, 63, 67, z + 2, z + 6, (int)BlockType.STONE);
            // doorway
            BlockShapes.MakeSolidBox(x + 4, x + 4, 64, 65, z + 2, z + 2, (int)BlockType.AIR);
            // tunnel down
            BlockShapes.MakeSolidBox(x + 4, x + 4, 55, 63, z + 4, z + 4, (int)BlockType.AIR);
            // ladder back
            BlockShapes.MakeSolidBox(x + 4, x + 4, 52, 55, z + 5, z + 5, (int)BlockType.STONE);
            // ladder rungs
            BlockHelper.MakeLadder(x + 4, 52, 63, z + 4);
            // hatch
            bm.SetID(x + 4, 64, z + 4, (int)BlockType.TRAPDOOR);
            bm.SetData(x + 4, 64, z + 4, 2);
            // chest with torches
            bm.SetID(x + 5, 64, z + 5, (int)BlockType.CHEST);
            TileEntityChest tec = new TileEntityChest();

            tec.Items[0] = BlockHelper.MakeItem((int)BlockType.REDSTONE_TORCH_ON, 64);
            tec.Items[1] = BlockHelper.MakeItem((int)BlockType.TORCH, 32);
            bm.SetTileEntity(x + 5, 64, z + 5, tec);
            // sign
            BlockHelper.MakeSign(x + 4, 66, z + 1, "Sewers||Currently|empty!", (int)BlockType.STONE);
        }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
0
 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);
     }
 }
Esempio n. 5
0
        public static void MakeMineshaft(BetaWorld world, BlockManager bm, int intFarmSize, int intMapSize)
        {
            intBlockStart = intFarmSize + 13;
            int intMineshaftSize = (1 + intMapSize) - (intBlockStart * 2);

            intBlockStart -= 2;
            for (int intLevel = 1; intLevel <= 7; intLevel++)
            {
                MakeLevel(world, bm, intLevel, intMineshaftSize);
            }
            BlockShapes.MakeSolidBox(intMapSize / 2, intMapSize / 2, 3, 64, (intMapSize / 2) + 1, (intMapSize / 2) + 1, (int)BlockType.WOOD, 0);
            BlockHelper.MakeLadder(intMapSize / 2, 4, 63, intMapSize / 2, 0, (int)BlockType.WOOD);
            //BlockShapes.MakeSolidBox(intMapSize / 2, intMapSize / 2, 4, 63, intMapSize / 2, intMapSize / 2, (int)BlockType.AIR, 0);
            bm.SetID(intMapSize / 2, 64, intMapSize / 2, (int)BlockType.TRAPDOOR);
        }
Esempio n. 6
0
        public static void MakeMineshaft(BetaWorld world, BlockManager bm, int intFarmLength, int intMapLength, Buildings.structPoint spMineshaftEntrance)
        {
            _intBlockStartBuildings = intFarmLength + 13;
            int intMineshaftSize = (1 + intMapLength) - (_intBlockStartBuildings * 2);

            if (intMineshaftSize % 5 > 0)
            {
                intMineshaftSize += 5 - (intMineshaftSize % 5);
            }
            _intBlockStartBuildings -= 2;
            for (int intLevel = 1; intLevel <= 7; intLevel++)
            {
                MakeLevel(world, bm, intLevel, intMineshaftSize, spMineshaftEntrance);
            }
            int intBlockToReplace = bm.GetID(spMineshaftEntrance.x, 63, spMineshaftEntrance.z + 1);

            BlockShapes.MakeSolidBox(spMineshaftEntrance.x, spMineshaftEntrance.x,
                                     3, 63, spMineshaftEntrance.z + 1, spMineshaftEntrance.z + 1, BlockType.WOOD, 0);
            BlockHelper.MakeLadder(spMineshaftEntrance.x, 4, 63, spMineshaftEntrance.z, 0, BlockType.WOOD);
            BlockShapes.MakeSolidBox(spMineshaftEntrance.x, spMineshaftEntrance.x, 3, 63, spMineshaftEntrance.z + 1,
                                     spMineshaftEntrance.z + 1, BlockType.STONE, 0);
            bm.SetID(spMineshaftEntrance.x, 63, spMineshaftEntrance.z + 1, intBlockToReplace);
        }
Esempio n. 7
0
        public static void MakeMineshaft(BetaWorld world, BlockManager bm, Buildings.structPoint spMineshaftEntrance, frmMace frmLogForm)
        {
            _intBlockStartBuildings = City.FarmLength + 13;
            int intMineshaftSize = (1 + City.MapLength) - (_intBlockStartBuildings * 2);

            if (intMineshaftSize % 5 > 0)
            {
                intMineshaftSize += 5 - (intMineshaftSize % 5);
            }
            _intBlockStartBuildings -= 2;
            for (int intLevel = 1; intLevel <= 7; intLevel++)
            {
                MakeLevel(world, bm, intLevel, intMineshaftSize, spMineshaftEntrance, frmLogForm);
            }
            int intBlockToReplace = bm.GetID(spMineshaftEntrance.x, 63, spMineshaftEntrance.z + 1);

            BlockShapes.MakeSolidBox(spMineshaftEntrance.x, spMineshaftEntrance.x,
                                     3, 63, spMineshaftEntrance.z + 1, spMineshaftEntrance.z + 1, BlockInfo.Wood.ID, 0);
            BlockHelper.MakeLadder(spMineshaftEntrance.x, 4, 63, spMineshaftEntrance.z, 0, BlockInfo.Wood.ID);
            BlockShapes.MakeSolidBox(spMineshaftEntrance.x, spMineshaftEntrance.x, 3, 63, spMineshaftEntrance.z + 1,
                                     spMineshaftEntrance.z + 1, BlockInfo.Stone.ID, 0);
            bm.SetID(spMineshaftEntrance.x, 63, spMineshaftEntrance.z + 1, intBlockToReplace);
        }
Esempio n. 8
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);
 }
Esempio n. 9
0
        public static bool[,] MakeSewers(int intFarmSize, int intMapSize, int intPlotSize)
        {
            int intPlots = 1 + ((intMapSize - ((intFarmSize + 16) * 2)) / intPlotSize);

            bool[,] booNewSewerEntrances = MakeSewerEntrances(intPlots, false);

            Maze maze = new Maze();

            // 51, 43, 35, 27, 19, 11, 3
            for (int y = 3; y <= 51; y += 8)
            {
                bool[,] booOldSewerEntrances = booNewSewerEntrances;
                booNewSewerEntrances         = MakeSewerEntrances(intPlots, y == 51);
                bool[,] booMaze = maze.GenerateMaze((intPlots * 2) + 1, (intPlots * 2) + 1);
                booMaze         = maze.CreateLoops(booMaze, booMaze.GetLength(0) / 4);
                if (y == 3)
                {
                    booMaze = maze.DeleteDeadEnds(booMaze, booNewSewerEntrances);
                }
                else
                {
                    booMaze = maze.DeleteDeadEnds(booMaze,
                                                  MergeBooleanArrays(booNewSewerEntrances, booOldSewerEntrances));
                }
                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, intPlotSize);
                        }
                    }
                }
                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);
                                BlockHelper.MakeLadder(intFarmSize + 18 + (x * intPlotSize / 2), y - 7, y + 1,
                                                       intFarmSize + 18 + (z * intPlotSize / 2));
                            }
                        }
                    }
                }
            }
            return(booNewSewerEntrances);
        }
Esempio n. 10
0
        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);
            }
        }
Esempio n. 11
0
 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);
     }
 }
Esempio n. 12
0
        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);
        }
Esempio n. 13
0
        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();
        }
Esempio n. 14
0
        public static void MakeGuardTowers(BlockManager bm, int intFarmLength, int intMapLength, bool booIncludeWalls,
                                           string strOutsideLights, string strTowerAddition,
                                           bool booIncludeItemsInChests, int intWallMaterial)
        {
            // remove wall
            BlockShapes.MakeSolidBox(intFarmLength + 5, intFarmLength + 11, 64, 79,
                                     intFarmLength + 5, intFarmLength + 11, BlockType.AIR, 1);
            // add tower
            BlockShapes.MakeHollowBox(intFarmLength + 4, intFarmLength + 12, 63, 80,
                                      intFarmLength + 4, intFarmLength + 12, intWallMaterial, 1, -1);
            // divide into two rooms
            BlockShapes.MakeSolidBox(intFarmLength + 4, intFarmLength + 12, 2, 72,
                                     intFarmLength + 4, intFarmLength + 12, intWallMaterial, 1);
            BlockShapes.MakeSolidBox(intFarmLength + 5, intFarmLength + 11, 64, 67,
                                     intFarmLength + 5, intFarmLength + 11, BlockType.AIR, 1);
            switch (strOutsideLights)
            {
            case "Fire":
                BlockShapes.MakeBlock(intFarmLength + 5, 76, intFarmLength + 3, BlockType.NETHERRACK, 2, 100, -1);
                BlockShapes.MakeBlock(intFarmLength + 5, 77, intFarmLength + 3, BlockType.FIRE, 2, 100, -1);
                BlockShapes.MakeBlock(intFarmLength + 11, 76, intFarmLength + 3, BlockType.NETHERRACK, 2, 100, -1);
                BlockShapes.MakeBlock(intFarmLength + 11, 77, intFarmLength + 3, BlockType.FIRE, 2, 100, -1);
                break;

            case "Torches":
                for (int y = 73; y <= 80; y += 7)
                {
                    BlockHelper.MakeTorch(intFarmLength + 6, y, intFarmLength + 3, intWallMaterial, 2);
                    BlockHelper.MakeTorch(intFarmLength + 10, y, intFarmLength + 3, intWallMaterial, 2);
                }
                break;

            case "None":
                break;

            default:
                Debug.Fail("Invalid switch result");
                break;
            }
            // add torches
            BlockHelper.MakeTorch(intFarmLength + 6, 79, intFarmLength + 13, intWallMaterial, 2);
            BlockHelper.MakeTorch(intFarmLength + 10, 79, intFarmLength + 13, intWallMaterial, 2);
            // add torches inside
            BlockHelper.MakeTorch(intFarmLength + 6, 77, intFarmLength + 11, intWallMaterial, 2);
            BlockHelper.MakeTorch(intFarmLength + 10, 77, intFarmLength + 11, intWallMaterial, 2);
            BlockHelper.MakeTorch(intFarmLength + 5, 77, intFarmLength + 6, intWallMaterial, 2);
            BlockHelper.MakeTorch(intFarmLength + 5, 77, intFarmLength + 10, intWallMaterial, 2);
            // add openings to the walls
            BlockShapes.MakeBlock(intFarmLength + 7, 73, intFarmLength + 12, BlockType.AIR, 2, 100, -1);
            BlockShapes.MakeBlock(intFarmLength + 9, 73, intFarmLength + 12, BlockType.AIR, 2, 100, -1);
            BlockShapes.MakeBlock(intFarmLength + 7, 74, intFarmLength + 12, BlockType.AIR, 2, 100, -1);
            BlockShapes.MakeBlock(intFarmLength + 9, 74, intFarmLength + 12, BlockType.AIR, 2, 100, -1);
            // add blocks on top of the towers
            BlockShapes.MakeHollowLayers(intFarmLength + 4, intFarmLength + 12, 81, 81,
                                         intFarmLength + 4, intFarmLength + 12, intWallMaterial, 1, -1);
            // alternating top blocks
            for (int x = intFarmLength + 4; x <= intFarmLength + 12; x += 2)
            {
                for (int z = intFarmLength + 4; z <= intFarmLength + 12; z += 2)
                {
                    if (x == intFarmLength + 4 || x == intFarmLength + 12 || z == intFarmLength + 4 || z == intFarmLength + 12)
                    {
                        BlockShapes.MakeBlock(x, 82, z, intWallMaterial, 1, 100, -1);
                    }
                }
            }
            // add central columns
            BlockShapes.MakeSolidBox(intFarmLength + 8, intFarmLength + 8, 73, 82,
                                     intFarmLength + 8, intFarmLength + 8, intWallMaterial, 1);
            BlockHelper.MakeLadder(intFarmLength + 7, 73, 82, intFarmLength + 8, 2, intWallMaterial);
            BlockHelper.MakeLadder(intFarmLength + 9, 73, 82, intFarmLength + 8, 2, intWallMaterial);
            // add torches on the roof
            BlockShapes.MakeBlock(intFarmLength + 6, 81, intFarmLength + 6, BlockType.TORCH, 1, 100, -1);
            BlockShapes.MakeBlock(intFarmLength + 6, 81, intFarmLength + 10, BlockType.TORCH, 2, 100, -1);
            BlockShapes.MakeBlock(intFarmLength + 10, 81, intFarmLength + 10, BlockType.TORCH, 1, 100, -1);
            // add cobwebs
            BlockShapes.MakeBlock(intFarmLength + 5, 79, intFarmLength + 5, BlockType.COBWEB, 1, 30, -1);
            BlockShapes.MakeBlock(intFarmLength + 5, 79, intFarmLength + 11, BlockType.COBWEB, 1, 30, -1);
            BlockShapes.MakeBlock(intFarmLength + 11, 79, intFarmLength + 5, BlockType.COBWEB, 1, 30, -1);
            BlockShapes.MakeBlock(intFarmLength + 11, 79, intFarmLength + 11, BlockType.COBWEB, 1, 30, -1);
            // add chests
            MakeGuardChest(bm, intFarmLength + 11, 73, intFarmLength + 11, booIncludeItemsInChests);
            MakeGuardChest(bm, intMapLength - (intFarmLength + 11), 73, intFarmLength + 11, booIncludeItemsInChests);
            MakeGuardChest(bm, intFarmLength + 11, 73, intMapLength - (intFarmLength + 11), booIncludeItemsInChests);
            MakeGuardChest(bm, intMapLength - (intFarmLength + 11), 73, intMapLength - (intFarmLength + 11),
                           booIncludeItemsInChests);
            // add archery slots
            BlockShapes.MakeSolidBox(intFarmLength + 4, intFarmLength + 4, 74, 77,
                                     intFarmLength + 8, intFarmLength + 8, BlockType.AIR, 2);
            BlockShapes.MakeSolidBox(intFarmLength + 4, intFarmLength + 4, 76, 76,
                                     intFarmLength + 7, intFarmLength + 9, BlockType.AIR, 2);
            if (!booIncludeWalls)
            {
                BlockHelper.MakeLadder(intFarmLength + 13, 64, 72, intFarmLength + 8, 2, intWallMaterial);
            }
            // include beds
            BlockHelper.MakeBed(intFarmLength + 5, intFarmLength + 6, 64, intFarmLength + 8, intFarmLength + 8, 2);
            BlockHelper.MakeBed(intFarmLength + 5, intFarmLength + 6, 64, intFarmLength + 10, intFarmLength + 10, 2);
            BlockHelper.MakeBed(intFarmLength + 11, intFarmLength + 10, 64, intFarmLength + 8, intFarmLength + 8, 2);
            // make columns to orientate torches
            BlockShapes.MakeSolidBox(intFarmLength + 5, intFarmLength + 5, 64, 73, intFarmLength + 5, intFarmLength + 5,
                                     BlockType.WOOD, 2);
            BlockShapes.MakeSolidBox(intFarmLength + 11, intFarmLength + 11, 64, 71, intFarmLength + 5, intFarmLength + 5,
                                     BlockType.WOOD, 2);
            BlockShapes.MakeSolidBox(intFarmLength + 5, intFarmLength + 5, 64, 71, intFarmLength + 11, intFarmLength + 11,
                                     BlockType.WOOD, 2);
            BlockShapes.MakeSolidBox(intFarmLength + 11, intFarmLength + 11, 64, 71, intFarmLength + 11, intFarmLength + 11,
                                     BlockType.WOOD, 2);
            // add ladders
            BlockHelper.MakeLadder(intFarmLength + 5, 64, 73, intFarmLength + 6, 2, BlockType.WOOD);
            // make torches
            BlockHelper.MakeTorch(intFarmLength + 10, 66, intFarmLength + 5, BlockType.WOOD, 2);
            BlockHelper.MakeTorch(intFarmLength + 6, 66, intFarmLength + 11, BlockType.WOOD, 2);
            BlockHelper.MakeTorch(intFarmLength + 10, 66, intFarmLength + 11, BlockType.WOOD, 2);
            // make columns for real
            BlockShapes.MakeSolidBox(intFarmLength + 5, intFarmLength + 5, 64, 73, intFarmLength + 5, intFarmLength + 5,
                                     intWallMaterial, 2);
            BlockShapes.MakeSolidBox(intFarmLength + 11, intFarmLength + 11, 64, 71, intFarmLength + 5, intFarmLength + 5,
                                     intWallMaterial, 2);
            BlockShapes.MakeSolidBox(intFarmLength + 5, intFarmLength + 5, 64, 71, intFarmLength + 11, intFarmLength + 11,
                                     intWallMaterial, 2);
            BlockShapes.MakeSolidBox(intFarmLength + 11, intFarmLength + 11, 64, 71, intFarmLength + 11, intFarmLength + 11,
                                     intWallMaterial, 2);
            // make cobwebs
            BlockShapes.MakeBlock(intFarmLength + 11, 67, intFarmLength + 8, BlockType.COBWEB, 2, 75, -1);
            // make doors from the city to the guard tower
            BlockShapes.MakeBlock(intFarmLength + 11, 65, intFarmLength + 11, BlockType.GOLD_BLOCK, 1, 100, -1);
            BlockShapes.MakeBlock(intFarmLength + 11, 64, intFarmLength + 11, BlockType.GOLD_BLOCK, 1, 100, -1);
            BlockHelper.MakeDoor(intFarmLength + 11, 64, intFarmLength + 12, BlockType.GOLD_BLOCK, true, 2);
            BlockShapes.MakeBlock(intFarmLength + 11, 65, intFarmLength + 11, BlockType.AIR, 1, 100, -1);
            BlockShapes.MakeBlock(intFarmLength + 11, 64, intFarmLength + 11, BlockType.AIR, 1, 100, -1);
            BlockShapes.MakeBlock(intFarmLength + 11, 64, intFarmLength + 11, BlockType.STONE_PLATE, 1, 100, -1);
            BlockShapes.MakeBlock(intFarmLength + 11, 64, intFarmLength + 13, BlockType.STONE_PLATE, 2, 100, -1);
            //BlockShapes.MakeBlock(intFarmLength + 13, 64, intFarmLength + 11, BlockType.STONE_PLATE, 1, 100, -1);
            // add guard tower sign
            BlockHelper.MakeSign(intFarmLength + 12, 65, intFarmLength + 13, "~Guard Tower~~", intWallMaterial, 1);
            BlockHelper.MakeSign(intFarmLength + 8, 74, intFarmLength + 13, "~Guard Tower~~", intWallMaterial, 2);
            // make beacon
            switch (strTowerAddition)
            {
            case "Fire beacon":
                BlockShapes.MakeSolidBox(intFarmLength + 8, intFarmLength + 8, 83, 84,
                                         intFarmLength + 8, intFarmLength + 8, intWallMaterial, 1);
                BlockShapes.MakeSolidBox(intFarmLength + 6, intFarmLength + 10, 85, 85,
                                         intFarmLength + 6, intFarmLength + 10, intWallMaterial, 1);
                BlockShapes.MakeSolidBox(intFarmLength + 6, intFarmLength + 10, 86, 86,
                                         intFarmLength + 6, intFarmLength + 10, BlockType.NETHERRACK, 1);
                BlockShapes.MakeSolidBox(intFarmLength + 6, intFarmLength + 10, 87, 87,
                                         intFarmLength + 6, intFarmLength + 10, BlockType.FIRE, 1);
                break;

            case "Flag":
                BlockShapes.MakeSolidBox(intFarmLength + 4, intFarmLength + 4, 83, 91,
                                         intFarmLength + 12, intFarmLength + 12, BlockType.FENCE, 2);
                BlockShapes.MakeBlock(intFarmLength + 4, 84, intFarmLength + 13, BlockType.FENCE, 2, 100, 0);
                BlockShapes.MakeBlock(intFarmLength + 4, 91, intFarmLength + 13, BlockType.FENCE, 2, 100, 0);
                int[] intColours = Utils.ShuffleArray(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 });
                switch (RandomHelper.Next(7))
                {
                case 0:         //2vert
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 90,
                                                     intFarmLength + 13, intFarmLength + 17, BlockType.WOOL, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 90,
                                                     intFarmLength + 18, intFarmLength + 22, BlockType.WOOL, 2, intColours[1]);
                    break;

                case 1:         //3vert
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 90,
                                                     intFarmLength + 13, intFarmLength + 15, BlockType.WOOL, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 90,
                                                     intFarmLength + 16, intFarmLength + 18, BlockType.WOOL, 2, intColours[1]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 90,
                                                     intFarmLength + 19, intFarmLength + 21, BlockType.WOOL, 2, intColours[2]);
                    break;

                case 2:         //4vert
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 90,
                                                     intFarmLength + 13, intFarmLength + 14, BlockType.WOOL, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 90,
                                                     intFarmLength + 15, intFarmLength + 16, BlockType.WOOL, 2, intColours[1]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 90,
                                                     intFarmLength + 17, intFarmLength + 18, BlockType.WOOL, 2, intColours[2]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 90,
                                                     intFarmLength + 19, intFarmLength + 20, BlockType.WOOL, 2, intColours[3]);
                    break;

                case 3:         //2horiz
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 87,
                                                     intFarmLength + 13, intFarmLength + 22, BlockType.WOOL, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 88, 90,
                                                     intFarmLength + 13, intFarmLength + 22, BlockType.WOOL, 2, intColours[1]);
                    break;

                case 4:         //3horiz
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 86,
                                                     intFarmLength + 13, intFarmLength + 22, BlockType.WOOL, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 87, 88,
                                                     intFarmLength + 13, intFarmLength + 22, BlockType.WOOL, 2, intColours[1]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 89, 90,
                                                     intFarmLength + 13, intFarmLength + 22, BlockType.WOOL, 2, intColours[2]);
                    break;

                case 5:         //quarters
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 87,
                                                     intFarmLength + 13, intFarmLength + 17, BlockType.WOOL, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 87,
                                                     intFarmLength + 18, intFarmLength + 22, BlockType.WOOL, 2, intColours[1]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 88, 90,
                                                     intFarmLength + 13, intFarmLength + 17, BlockType.WOOL, 2, intColours[2]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 88, 90,
                                                     intFarmLength + 18, intFarmLength + 22, BlockType.WOOL, 2, intColours[3]);
                    break;

                case 6:         //cross
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 90,
                                                     intFarmLength + 13, intFarmLength + 22, BlockType.WOOL, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 87, 88,
                                                     intFarmLength + 13, intFarmLength + 22, BlockType.WOOL, 2, intColours[1]);
                    BlockShapes.MakeSolidBoxWithData(intFarmLength + 4, intFarmLength + 4, 85, 90,
                                                     intFarmLength + 17, intFarmLength + 18, BlockType.WOOL, 2, intColours[1]);
                    break;

                default:
                    Debug.Fail("Invalid switch result");
                    break;
                }
                break;
            }
        }
Esempio n. 15
0
        public static void MakeGuardTowers(BlockManager bm, frmMace frmLogForm)
        {
            // remove wall
            BlockShapes.MakeSolidBox(City.FarmLength + 5, City.FarmLength + 11, 64, 79,
                                     City.FarmLength + 5, City.FarmLength + 11, BlockInfo.Air.ID, 1);
            // add tower
            BlockShapes.MakeHollowBox(City.FarmLength + 4, City.FarmLength + 12, 63, 80,
                                      City.FarmLength + 4, City.FarmLength + 12, City.WallMaterialID, 1, City.WallMaterialData);
            // divide into two rooms
            BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 12, 2, 72,
                                             City.FarmLength + 4, City.FarmLength + 12,
                                             City.WallMaterialID, 1, City.WallMaterialData);
            BlockShapes.MakeSolidBox(City.FarmLength + 5, City.FarmLength + 11, 64, 67,
                                     City.FarmLength + 5, City.FarmLength + 11, BlockInfo.Air.ID, 1);

            switch (City.OutsideLightType)
            {
            case "Fire":
                BlockShapes.MakeBlock(City.FarmLength + 5, 76, City.FarmLength + 3, BlockInfo.Netherrack.ID, 2, 100, -1);
                BlockShapes.MakeBlock(City.FarmLength + 5, 77, City.FarmLength + 3, BlockInfo.Fire.ID, 2, 100, -1);
                BlockShapes.MakeBlock(City.FarmLength + 11, 76, City.FarmLength + 3, BlockInfo.Netherrack.ID, 2, 100, -1);
                BlockShapes.MakeBlock(City.FarmLength + 11, 77, City.FarmLength + 3, BlockInfo.Fire.ID, 2, 100, -1);
                break;

            case "Torches":
                for (int y = 73; y <= 80; y += 7)
                {
                    BlockHelper.MakeTorch(City.FarmLength + 6, y, City.FarmLength + 3, City.WallMaterialID, 2);
                    BlockHelper.MakeTorch(City.FarmLength + 10, y, City.FarmLength + 3, City.WallMaterialID, 2);
                }
                break;

            case "None":
                break;

            default:
                Debug.Fail("Invalid switch result");
                break;
            }
            // add torches
            BlockHelper.MakeTorch(City.FarmLength + 6, 79, City.FarmLength + 13, City.WallMaterialID, 2);
            BlockHelper.MakeTorch(City.FarmLength + 10, 79, City.FarmLength + 13, City.WallMaterialID, 2);
            // add torches inside
            BlockHelper.MakeTorch(City.FarmLength + 6, 77, City.FarmLength + 11, City.WallMaterialID, 2);
            BlockHelper.MakeTorch(City.FarmLength + 10, 77, City.FarmLength + 11, City.WallMaterialID, 2);
            BlockHelper.MakeTorch(City.FarmLength + 5, 77, City.FarmLength + 6, City.WallMaterialID, 2);
            BlockHelper.MakeTorch(City.FarmLength + 5, 77, City.FarmLength + 10, City.WallMaterialID, 2);
            // add openings to the walls
            BlockShapes.MakeBlock(City.FarmLength + 7, 73, City.FarmLength + 12, BlockInfo.Air.ID, 2, 100, -1);
            BlockShapes.MakeBlock(City.FarmLength + 9, 73, City.FarmLength + 12, BlockInfo.Air.ID, 2, 100, -1);
            BlockShapes.MakeBlock(City.FarmLength + 7, 74, City.FarmLength + 12, BlockInfo.Air.ID, 2, 100, -1);
            BlockShapes.MakeBlock(City.FarmLength + 9, 74, City.FarmLength + 12, BlockInfo.Air.ID, 2, 100, -1);
            // add blocks on top of the towers
            BlockShapes.MakeHollowLayers(City.FarmLength + 4, City.FarmLength + 12, 81, 81,
                                         City.FarmLength + 4, City.FarmLength + 12,
                                         City.WallMaterialID, 1, City.WallMaterialData);

            // alternating top blocks
            for (int x = City.FarmLength + 4; x <= City.FarmLength + 12; x += 2)
            {
                for (int z = City.FarmLength + 4; z <= City.FarmLength + 12; z += 2)
                {
                    if (x == City.FarmLength + 4 ||
                        x == City.FarmLength + 12 ||
                        z == City.FarmLength + 4 ||
                        z == City.FarmLength + 12)
                    {
                        BlockShapes.MakeBlock(x, 82, z, City.WallMaterialID, 1, 100, City.WallMaterialData);
                    }
                }
            }
            // add central columns
            BlockShapes.MakeSolidBoxWithData(City.FarmLength + 8, City.FarmLength + 8, 73, 82,
                                             City.FarmLength + 8, City.FarmLength + 8, City.WallMaterialID, 1,
                                             City.WallMaterialData);
            BlockHelper.MakeLadder(City.FarmLength + 7, 73, 82, City.FarmLength + 8, 2, City.WallMaterialID);
            BlockHelper.MakeLadder(City.FarmLength + 9, 73, 82, City.FarmLength + 8, 2, City.WallMaterialID);
            // add torches on the roof
            BlockShapes.MakeBlock(City.FarmLength + 6, 81, City.FarmLength + 6, BlockInfo.Torch.ID, 1, 100, -1);
            BlockShapes.MakeBlock(City.FarmLength + 6, 81, City.FarmLength + 10, BlockInfo.Torch.ID, 2, 100, -1);
            BlockShapes.MakeBlock(City.FarmLength + 10, 81, City.FarmLength + 10, BlockInfo.Torch.ID, 1, 100, -1);
            // add cobwebs
            BlockShapes.MakeBlock(City.FarmLength + 5, 79, City.FarmLength + 5, BlockInfo.Cobweb.ID, 1, 30, -1);
            BlockShapes.MakeBlock(City.FarmLength + 5, 79, City.FarmLength + 11, BlockInfo.Cobweb.ID, 1, 30, -1);
            BlockShapes.MakeBlock(City.FarmLength + 11, 79, City.FarmLength + 5, BlockInfo.Cobweb.ID, 1, 30, -1);
            BlockShapes.MakeBlock(City.FarmLength + 11, 79, City.FarmLength + 11, BlockInfo.Cobweb.ID, 1, 30, -1);

            // add chests
            MakeGuardChest(bm, City.FarmLength + 11, 73, City.FarmLength + 11);
            MakeGuardChest(bm, City.MapLength - (City.FarmLength + 11), 73, City.FarmLength + 11);
            MakeGuardChest(bm, City.FarmLength + 11, 73, City.MapLength - (City.FarmLength + 11));
            MakeGuardChest(bm, City.MapLength - (City.FarmLength + 11), 73, City.MapLength - (City.FarmLength + 11));

            // add archery slots
            BlockShapes.MakeSolidBox(City.FarmLength + 4, City.FarmLength + 4, 74, 77,
                                     City.FarmLength + 8, City.FarmLength + 8, BlockInfo.Air.ID, 2);
            BlockShapes.MakeSolidBox(City.FarmLength + 4, City.FarmLength + 4, 76, 76,
                                     City.FarmLength + 7, City.FarmLength + 9, BlockInfo.Air.ID, 2);
            if (!City.HasWalls)
            {
                BlockHelper.MakeLadder(City.FarmLength + 13, 64, 72, City.FarmLength + 8, 2, City.WallMaterialID);
            }
            // include beds
            BlockHelper.MakeBed(City.FarmLength + 5, City.FarmLength + 6, 64, City.FarmLength + 8, City.FarmLength + 8, 2);
            BlockHelper.MakeBed(City.FarmLength + 5, City.FarmLength + 6, 64, City.FarmLength + 10, City.FarmLength + 10, 2);
            BlockHelper.MakeBed(City.FarmLength + 11, City.FarmLength + 10, 64, City.FarmLength + 8, City.FarmLength + 8, 2);
            // make columns to orientate torches
            BlockShapes.MakeSolidBox(City.FarmLength + 5, City.FarmLength + 5, 64, 73,
                                     City.FarmLength + 5, City.FarmLength + 5, BlockInfo.Wood.ID, 2);
            BlockShapes.MakeSolidBox(City.FarmLength + 11, City.FarmLength + 11, 64, 71,
                                     City.FarmLength + 5, City.FarmLength + 5, BlockInfo.Wood.ID, 2);
            BlockShapes.MakeSolidBox(City.FarmLength + 5, City.FarmLength + 5, 64, 71,
                                     City.FarmLength + 11, City.FarmLength + 11, BlockInfo.Wood.ID, 2);
            BlockShapes.MakeSolidBox(City.FarmLength + 11, City.FarmLength + 11, 64, 71,
                                     City.FarmLength + 11, City.FarmLength + 11, BlockInfo.Wood.ID, 2);
            // add ladders
            BlockHelper.MakeLadder(City.FarmLength + 5, 64, 73, City.FarmLength + 6, 2, BlockInfo.Wood.ID);
            // make torches
            BlockHelper.MakeTorch(City.FarmLength + 10, 66, City.FarmLength + 5, BlockInfo.Wood.ID, 2);
            BlockHelper.MakeTorch(City.FarmLength + 6, 66, City.FarmLength + 11, BlockInfo.Wood.ID, 2);
            BlockHelper.MakeTorch(City.FarmLength + 10, 66, City.FarmLength + 11, BlockInfo.Wood.ID, 2);
            // make columns for real
            BlockShapes.MakeSolidBoxWithData(City.FarmLength + 5, City.FarmLength + 5, 64, 73, City.FarmLength + 5,
                                             City.FarmLength + 5, City.WallMaterialID, 2, City.WallMaterialData);
            BlockShapes.MakeSolidBoxWithData(City.FarmLength + 11, City.FarmLength + 11, 64, 71, City.FarmLength + 5,
                                             City.FarmLength + 5, City.WallMaterialID, 2, City.WallMaterialData);
            BlockShapes.MakeSolidBoxWithData(City.FarmLength + 5, City.FarmLength + 5, 64, 71, City.FarmLength + 11,
                                             City.FarmLength + 11, City.WallMaterialID, 2, City.WallMaterialData);
            BlockShapes.MakeSolidBoxWithData(City.FarmLength + 11, City.FarmLength + 11, 64, 71, City.FarmLength + 11,
                                             City.FarmLength + 11, City.WallMaterialID, 2, City.WallMaterialData);
            // make cobwebs
            BlockShapes.MakeBlock(City.FarmLength + 11, 67, City.FarmLength + 8, BlockInfo.Cobweb.ID, 2, 75, -1);
            // make doors from the city to the guard tower
            BlockShapes.MakeBlock(City.FarmLength + 11, 65, City.FarmLength + 11, BlockInfo.GoldBlock.ID, 1, 100, -1);
            BlockShapes.MakeBlock(City.FarmLength + 11, 64, City.FarmLength + 11, BlockInfo.GoldBlock.ID, 1, 100, -1);
            BlockHelper.MakeDoor(City.FarmLength + 11, 64, City.FarmLength + 12, BlockInfo.GoldBlock.ID, true, 2);
            BlockShapes.MakeBlock(City.FarmLength + 11, 65, City.FarmLength + 11, BlockInfo.Air.ID, 1, 100, -1);
            BlockShapes.MakeBlock(City.FarmLength + 11, 64, City.FarmLength + 11, BlockInfo.Air.ID, 1, 100, -1);
            BlockShapes.MakeBlock(City.FarmLength + 11, 64, City.FarmLength + 11, BlockInfo.StonePlate.ID, 1, 100, -1);
            BlockShapes.MakeBlock(City.FarmLength + 11, 64, City.FarmLength + 13, BlockInfo.StonePlate.ID, 2, 100, -1);
            //BlockShapes.MakeBlock(City.intFarmSize + 13, 64, City.intFarmSize + 11, BlockInfo.Stone.ID_PLATE, 1, 100, -1);
            // add guard tower sign
            BlockHelper.MakeSign(City.FarmLength + 12, 65, City.FarmLength + 13, "~Guard Tower~~", City.WallMaterialID, 1);
            BlockHelper.MakeSign(City.FarmLength + 8, 74, City.FarmLength + 13, "~Guard Tower~~", City.WallMaterialID, 2);
            // make beacon
            frmLogForm.UpdateLog("Creating tower addition: " + City.TowersAdditionType, true, true);
            switch (City.TowersAdditionType)
            {
            case "Fire beacon":
                BlockShapes.MakeSolidBoxWithData(City.FarmLength + 8, City.FarmLength + 8, 83, 84,
                                                 City.FarmLength + 8, City.FarmLength + 8,
                                                 City.WallMaterialID, 1, City.WallMaterialData);
                BlockShapes.MakeSolidBoxWithData(City.FarmLength + 6, City.FarmLength + 10, 85, 85,
                                                 City.FarmLength + 6, City.FarmLength + 10,
                                                 City.WallMaterialID, 1, City.WallMaterialData);
                BlockShapes.MakeSolidBox(City.FarmLength + 6, City.FarmLength + 10, 86, 86,
                                         City.FarmLength + 6, City.FarmLength + 10, BlockInfo.Netherrack.ID, 1);
                BlockShapes.MakeSolidBox(City.FarmLength + 6, City.FarmLength + 10, 87, 87,
                                         City.FarmLength + 6, City.FarmLength + 10, BlockInfo.Fire.ID, 1);
                break;

            case "Flag":
                BlockShapes.MakeSolidBox(City.FarmLength + 4, City.FarmLength + 4, 83, 91,
                                         City.FarmLength + 12, City.FarmLength + 12, BlockInfo.Fence.ID, 2);
                BlockShapes.MakeBlock(City.FarmLength + 4, 84, City.FarmLength + 13, BlockInfo.Fence.ID, 2, 100, 0);
                BlockShapes.MakeBlock(City.FarmLength + 4, 91, City.FarmLength + 13, BlockInfo.Fence.ID, 2, 100, 0);
                int[] intColours = RandomHelper.ShuffleArray(Enumerable.Range(0, 15).ToArray());
                switch (RandomHelper.Next(8))
                {
                case 0:         //2vert
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 90,
                                                     City.FarmLength + 13, City.FarmLength + 17, BlockInfo.Wool.ID, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 90,
                                                     City.FarmLength + 18, City.FarmLength + 22, BlockInfo.Wool.ID, 2, intColours[1]);
                    break;

                case 1:         //3vert
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 90,
                                                     City.FarmLength + 13, City.FarmLength + 15, BlockInfo.Wool.ID, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 90,
                                                     City.FarmLength + 16, City.FarmLength + 18, BlockInfo.Wool.ID, 2, intColours[1]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 90,
                                                     City.FarmLength + 19, City.FarmLength + 21, BlockInfo.Wool.ID, 2, intColours[2]);
                    break;

                case 2:         //4vert
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 90,
                                                     City.FarmLength + 13, City.FarmLength + 14, BlockInfo.Wool.ID, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 90,
                                                     City.FarmLength + 15, City.FarmLength + 16, BlockInfo.Wool.ID, 2, intColours[1]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 90,
                                                     City.FarmLength + 17, City.FarmLength + 18, BlockInfo.Wool.ID, 2, intColours[2]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 90,
                                                     City.FarmLength + 19, City.FarmLength + 20, BlockInfo.Wool.ID, 2, intColours[3]);
                    break;

                case 3:         //2horiz
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 87,
                                                     City.FarmLength + 13, City.FarmLength + 22, BlockInfo.Wool.ID, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 88, 90,
                                                     City.FarmLength + 13, City.FarmLength + 22, BlockInfo.Wool.ID, 2, intColours[1]);
                    break;

                case 4:         //3horiz
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 86,
                                                     City.FarmLength + 13, City.FarmLength + 22, BlockInfo.Wool.ID, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 87, 88,
                                                     City.FarmLength + 13, City.FarmLength + 22, BlockInfo.Wool.ID, 2, intColours[1]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 89, 90,
                                                     City.FarmLength + 13, City.FarmLength + 22, BlockInfo.Wool.ID, 2, intColours[2]);
                    break;

                case 5:         //quarters
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 87,
                                                     City.FarmLength + 13, City.FarmLength + 17, BlockInfo.Wool.ID, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 87,
                                                     City.FarmLength + 18, City.FarmLength + 22, BlockInfo.Wool.ID, 2, intColours[1]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 88, 90,
                                                     City.FarmLength + 13, City.FarmLength + 17, BlockInfo.Wool.ID, 2, intColours[2]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 88, 90,
                                                     City.FarmLength + 18, City.FarmLength + 22, BlockInfo.Wool.ID, 2, intColours[3]);
                    break;

                case 6:         //cross
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 90,
                                                     City.FarmLength + 13, City.FarmLength + 22, BlockInfo.Wool.ID, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 87, 88,
                                                     City.FarmLength + 13, City.FarmLength + 22, BlockInfo.Wool.ID, 2, intColours[1]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 90,
                                                     City.FarmLength + 17, City.FarmLength + 18, BlockInfo.Wool.ID, 2, intColours[1]);
                    break;

                default:         // inside "circle"
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 85, 90,
                                                     City.FarmLength + 13, City.FarmLength + 22, BlockInfo.Wool.ID, 2, intColours[0]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 86, 89,
                                                     City.FarmLength + 17, City.FarmLength + 18, BlockInfo.Wool.ID, 2, intColours[1]);
                    BlockShapes.MakeSolidBoxWithData(City.FarmLength + 4, City.FarmLength + 4, 87, 88,
                                                     City.FarmLength + 16, City.FarmLength + 19, BlockInfo.Wool.ID, 2, intColours[1]);
                    break;
                }
                break;
            }
        }
Esempio n. 16
0
        public static void MakeWalls(BetaWorld 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.MakeBlock((City.MapLength / 2) - 5, 73, City.EdgeLength + 11, BlockInfo.Air.ID, 2, 100, -1);
            // 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);
                }
            }
            frmLogForm.UpdateLog("Creating wall emblems: " + City.CityEmblemType, true, true);
            MakeEmblem();
        }
Esempio n. 17
0
        public static void MakeGuardTowers(BlockManager bm, frmMace frmLogForm)
        {
            // remove wall
            BlockShapes.MakeSolidBox(City.EdgeLength + 5, City.EdgeLength + 11, 64, 79,
                                     City.EdgeLength + 5, City.EdgeLength + 11, BlockInfo.Air.ID, 1);
            // add tower
            BlockShapes.MakeHollowBox(City.EdgeLength + 4, City.EdgeLength + 12, 63, 80,
                                      City.EdgeLength + 4, City.EdgeLength + 12, City.WallMaterialID, 1, City.WallMaterialData);
            // divide into two rooms
            BlockShapes.MakeSolidBoxWithData(City.EdgeLength + 4, City.EdgeLength + 12, 2, 72,
                                             City.EdgeLength + 4, City.EdgeLength + 12,
                                             City.WallMaterialID, 1, City.WallMaterialData);
            BlockShapes.MakeSolidBox(City.EdgeLength + 5, City.EdgeLength + 11, 64, 67,
                                     City.EdgeLength + 5, City.EdgeLength + 11, BlockInfo.Air.ID, 1);

            switch (City.OutsideLightType)
            {
            case "Fire":
                BlockShapes.MakeBlock(City.EdgeLength + 5, 76, City.EdgeLength + 3, BlockInfo.Netherrack.ID, 2, 100, -1);
                BlockShapes.MakeBlock(City.EdgeLength + 5, 77, City.EdgeLength + 3, BlockInfo.Fire.ID, 2, 100, -1);
                BlockShapes.MakeBlock(City.EdgeLength + 11, 76, City.EdgeLength + 3, BlockInfo.Netherrack.ID, 2, 100, -1);
                BlockShapes.MakeBlock(City.EdgeLength + 11, 77, City.EdgeLength + 3, BlockInfo.Fire.ID, 2, 100, -1);
                break;

            case "Torches":
                for (int y = 73; y <= 80; y += 7)
                {
                    BlockHelper.MakeTorch(City.EdgeLength + 6, y, City.EdgeLength + 3, City.WallMaterialID, 2);
                    BlockHelper.MakeTorch(City.EdgeLength + 10, y, City.EdgeLength + 3, City.WallMaterialID, 2);
                }
                break;

            case "None":
            case "":
                break;

            default:
                Debug.Fail("Invalid switch result");
                break;
            }
            if (City.HasTorchesOnWalkways)
            {
                // add torches
                BlockHelper.MakeTorch(City.EdgeLength + 6, 79, City.EdgeLength + 13, City.WallMaterialID, 2);
                BlockHelper.MakeTorch(City.EdgeLength + 10, 79, City.EdgeLength + 13, City.WallMaterialID, 2);
                // add torches inside
                BlockHelper.MakeTorch(City.EdgeLength + 6, 77, City.EdgeLength + 11, City.WallMaterialID, 2);
                BlockHelper.MakeTorch(City.EdgeLength + 10, 77, City.EdgeLength + 11, City.WallMaterialID, 2);
                BlockHelper.MakeTorch(City.EdgeLength + 5, 77, City.EdgeLength + 6, City.WallMaterialID, 2);
                BlockHelper.MakeTorch(City.EdgeLength + 5, 77, City.EdgeLength + 10, City.WallMaterialID, 2);
            }
            // add openings to the walls
            BlockShapes.MakeBlock(City.EdgeLength + 7, 73, City.EdgeLength + 12, BlockInfo.Air.ID, 2, 100, -1);
            BlockShapes.MakeBlock(City.EdgeLength + 9, 73, City.EdgeLength + 12, BlockInfo.Air.ID, 2, 100, -1);
            BlockShapes.MakeBlock(City.EdgeLength + 7, 74, City.EdgeLength + 12, BlockInfo.Air.ID, 2, 100, -1);
            BlockShapes.MakeBlock(City.EdgeLength + 9, 74, City.EdgeLength + 12, BlockInfo.Air.ID, 2, 100, -1);
            // add blocks on top of the towers
            BlockShapes.MakeHollowLayers(City.EdgeLength + 4, City.EdgeLength + 12, 81, 81,
                                         City.EdgeLength + 4, City.EdgeLength + 12,
                                         City.WallMaterialID, 1, City.WallMaterialData);

            // alternating top blocks
            for (int x = City.EdgeLength + 4; x <= City.EdgeLength + 12; x += 2)
            {
                for (int z = City.EdgeLength + 4; z <= City.EdgeLength + 12; z += 2)
                {
                    if (x == City.EdgeLength + 4 ||
                        x == City.EdgeLength + 12 ||
                        z == City.EdgeLength + 4 ||
                        z == City.EdgeLength + 12)
                    {
                        BlockShapes.MakeBlock(x, 82, z, City.WallMaterialID, 1, 100, City.WallMaterialData);
                    }
                }
            }
            // add central columns
            BlockShapes.MakeSolidBoxWithData(City.EdgeLength + 8, City.EdgeLength + 8, 73, 82,
                                             City.EdgeLength + 8, City.EdgeLength + 8, City.WallMaterialID, 1,
                                             City.WallMaterialData);
            BlockHelper.MakeLadder(City.EdgeLength + 7, 73, 82, City.EdgeLength + 8, 2, City.WallMaterialID);
            BlockHelper.MakeLadder(City.EdgeLength + 9, 73, 82, City.EdgeLength + 8, 2, City.WallMaterialID);
            // add torches on the roof
            if (City.HasTorchesOnWalkways)
            {
                BlockShapes.MakeBlock(City.EdgeLength + 6, 81, City.EdgeLength + 6, BlockInfo.Torch.ID, 1, 100, -1);
                BlockShapes.MakeBlock(City.EdgeLength + 6, 81, City.EdgeLength + 10, BlockInfo.Torch.ID, 2, 100, -1);
                BlockShapes.MakeBlock(City.EdgeLength + 10, 81, City.EdgeLength + 10, BlockInfo.Torch.ID, 1, 100, -1);
            }
            // add cobwebs
            BlockShapes.MakeBlock(City.EdgeLength + 5, 79, City.EdgeLength + 5, BlockInfo.Cobweb.ID, 1, 30, -1);
            BlockShapes.MakeBlock(City.EdgeLength + 5, 79, City.EdgeLength + 11, BlockInfo.Cobweb.ID, 1, 30, -1);
            BlockShapes.MakeBlock(City.EdgeLength + 11, 79, City.EdgeLength + 5, BlockInfo.Cobweb.ID, 1, 30, -1);
            BlockShapes.MakeBlock(City.EdgeLength + 11, 79, City.EdgeLength + 11, BlockInfo.Cobweb.ID, 1, 30, -1);

            // add chests
            MakeGuardChest(bm, City.EdgeLength + 11, 73, City.EdgeLength + 11);
            MakeGuardChest(bm, City.MapLength - (City.EdgeLength + 11), 73, City.EdgeLength + 11);
            MakeGuardChest(bm, City.EdgeLength + 11, 73, City.MapLength - (City.EdgeLength + 11));
            MakeGuardChest(bm, City.MapLength - (City.EdgeLength + 11), 73, City.MapLength - (City.EdgeLength + 11));

            // add archery slots
            BlockShapes.MakeSolidBox(City.EdgeLength + 4, City.EdgeLength + 4, 74, 77,
                                     City.EdgeLength + 8, City.EdgeLength + 8, BlockInfo.Air.ID, 2);
            BlockShapes.MakeSolidBox(City.EdgeLength + 4, City.EdgeLength + 4, 76, 76,
                                     City.EdgeLength + 7, City.EdgeLength + 9, BlockInfo.Air.ID, 2);
            if (!City.HasWalls)
            {
                BlockHelper.MakeLadder(City.EdgeLength + 13, 64, 72, City.EdgeLength + 8, 2, City.WallMaterialID);
            }
            // include beds
            BlockHelper.MakeBed(City.EdgeLength + 5, City.EdgeLength + 6, 64, City.EdgeLength + 8, City.EdgeLength + 8, 2);
            BlockHelper.MakeBed(City.EdgeLength + 5, City.EdgeLength + 6, 64, City.EdgeLength + 10, City.EdgeLength + 10, 2);
            BlockHelper.MakeBed(City.EdgeLength + 11, City.EdgeLength + 10, 64, City.EdgeLength + 8, City.EdgeLength + 8, 2);
            // make columns to orientate torches
            BlockShapes.MakeSolidBox(City.EdgeLength + 5, City.EdgeLength + 5, 64, 73,
                                     City.EdgeLength + 5, City.EdgeLength + 5, BlockInfo.Wood.ID, 2);
            BlockShapes.MakeSolidBox(City.EdgeLength + 11, City.EdgeLength + 11, 64, 71,
                                     City.EdgeLength + 5, City.EdgeLength + 5, BlockInfo.Wood.ID, 2);
            BlockShapes.MakeSolidBox(City.EdgeLength + 5, City.EdgeLength + 5, 64, 71,
                                     City.EdgeLength + 11, City.EdgeLength + 11, BlockInfo.Wood.ID, 2);
            BlockShapes.MakeSolidBox(City.EdgeLength + 11, City.EdgeLength + 11, 64, 71,
                                     City.EdgeLength + 11, City.EdgeLength + 11, BlockInfo.Wood.ID, 2);
            // add ladders
            BlockHelper.MakeLadder(City.EdgeLength + 5, 64, 73, City.EdgeLength + 6, 2, BlockInfo.Wood.ID);
            // make torches
            if (City.HasTorchesOnWalkways)
            {
                BlockHelper.MakeTorch(City.EdgeLength + 10, 66, City.EdgeLength + 5, BlockInfo.Wood.ID, 2);
                BlockHelper.MakeTorch(City.EdgeLength + 6, 66, City.EdgeLength + 11, BlockInfo.Wood.ID, 2);
                BlockHelper.MakeTorch(City.EdgeLength + 10, 66, City.EdgeLength + 11, BlockInfo.Wood.ID, 2);
            }
            // make columns for real
            BlockShapes.MakeSolidBoxWithData(City.EdgeLength + 5, City.EdgeLength + 5, 64, 73, City.EdgeLength + 5,
                                             City.EdgeLength + 5, City.WallMaterialID, 2, City.WallMaterialData);
            BlockShapes.MakeSolidBoxWithData(City.EdgeLength + 11, City.EdgeLength + 11, 64, 71, City.EdgeLength + 5,
                                             City.EdgeLength + 5, City.WallMaterialID, 2, City.WallMaterialData);
            BlockShapes.MakeSolidBoxWithData(City.EdgeLength + 5, City.EdgeLength + 5, 64, 71, City.EdgeLength + 11,
                                             City.EdgeLength + 11, City.WallMaterialID, 2, City.WallMaterialData);
            BlockShapes.MakeSolidBoxWithData(City.EdgeLength + 11, City.EdgeLength + 11, 64, 71, City.EdgeLength + 11,
                                             City.EdgeLength + 11, City.WallMaterialID, 2, City.WallMaterialData);
            // make cobwebs
            BlockShapes.MakeBlock(City.EdgeLength + 11, 67, City.EdgeLength + 8, BlockInfo.Cobweb.ID, 2, 75, -1);
            // make doors from the city to the guard tower
            BlockShapes.MakeBlock(City.EdgeLength + 11, 65, City.EdgeLength + 11, BlockInfo.GoldBlock.ID, 1, 100, -1);
            BlockShapes.MakeBlock(City.EdgeLength + 11, 64, City.EdgeLength + 11, BlockInfo.GoldBlock.ID, 1, 100, -1);
            BlockHelper.MakeDoor(City.EdgeLength + 11, 64, City.EdgeLength + 12, BlockInfo.GoldBlock.ID, true, 2);
            BlockShapes.MakeBlock(City.EdgeLength + 11, 65, City.EdgeLength + 11, BlockInfo.Air.ID, 1, 100, -1);
            BlockShapes.MakeBlock(City.EdgeLength + 11, 64, City.EdgeLength + 11, BlockInfo.Air.ID, 1, 100, -1);
            BlockShapes.MakeBlock(City.EdgeLength + 11, 64, City.EdgeLength + 11, BlockInfo.StonePlate.ID, 1, 100, -1);
            BlockShapes.MakeBlock(City.EdgeLength + 11, 64, City.EdgeLength + 13, BlockInfo.StonePlate.ID, 2, 100, -1);
            //BlockShapes.MakeBlock(City.intFarmSize + 13, 64, City.intFarmSize + 11, BlockInfo.Stone.ID_PLATE, 1, 100, -1);
            // add guard tower sign
            BlockHelper.MakeSign(City.EdgeLength + 12, 65, City.EdgeLength + 13, "~Guard Tower~~", City.WallMaterialID, 1);
            BlockHelper.MakeSign(City.EdgeLength + 8, 74, City.EdgeLength + 13, "~Guard Tower~~", City.WallMaterialID, 2);
            // make beacon
            frmLogForm.UpdateLog("Creating tower addition: " + City.TowersAdditionType, true, true);
            switch (City.TowersAdditionType)
            {
            case "Fire beacon":
                BlockShapes.MakeSolidBoxWithData(City.EdgeLength + 8, City.EdgeLength + 8, 83, 84,
                                                 City.EdgeLength + 8, City.EdgeLength + 8,
                                                 City.WallMaterialID, 1, City.WallMaterialData);
                BlockShapes.MakeSolidBoxWithData(City.EdgeLength + 6, City.EdgeLength + 10, 85, 85,
                                                 City.EdgeLength + 6, City.EdgeLength + 10,
                                                 City.WallMaterialID, 1, City.WallMaterialData);
                BlockShapes.MakeSolidBox(City.EdgeLength + 6, City.EdgeLength + 10, 86, 86,
                                         City.EdgeLength + 6, City.EdgeLength + 10, BlockInfo.Netherrack.ID, 1);
                BlockShapes.MakeSolidBox(City.EdgeLength + 6, City.EdgeLength + 10, 87, 87,
                                         City.EdgeLength + 6, City.EdgeLength + 10, BlockInfo.Fire.ID, 1);
                break;

            case "Flag":
                BlockShapes.MakeSolidBox(City.EdgeLength + 4, City.EdgeLength + 4, 83, 91,
                                         City.EdgeLength + 12, City.EdgeLength + 12, BlockInfo.Fence.ID, 2);
                BlockShapes.MakeBlock(City.EdgeLength + 4, 84, City.EdgeLength + 13, BlockInfo.Fence.ID, 2, 100, 0);
                BlockShapes.MakeBlock(City.EdgeLength + 4, 91, City.EdgeLength + 13, BlockInfo.Fence.ID, 2, 100, 0);
                int[] intColours = RNG.ShuffleArray(Enumerable.Range(0, 15).ToArray());
                // select a random flag file and turn it into an array
                string[] strFlagLines = File.ReadAllLines(RNG.RandomItemFromArray(Directory.GetFiles("Resources", "Flag_*.txt")));
                for (int x = 0; x < strFlagLines[0].Length; x++)
                {
                    for (int y = 0; y < strFlagLines.GetLength(0); y++)
                    {
                        int WoolColourID = Convert.ToInt32(strFlagLines[y].Substring(x, 1));
                        BlockShapes.MakeSolidBoxWithData(City.EdgeLength + 4, City.EdgeLength + 4,
                                                         90 - y, 90 - y,
                                                         City.EdgeLength + 13 + x, City.EdgeLength + 13 + x,
                                                         BlockInfo.Wool.ID, 2, intColours[WoolColourID]);
                    }
                }
                break;
            }
        }
Esempio n. 18
0
 public static void MakeDrawbridges(BlockManager bm, int intFarmLength, int intMapLength,
                                    bool booIncludeMoat, bool booIncludeWalls, bool booIncludeItemsInChests,
                                    int intWallMaterial, string strMoatType, string strCityName)
 {
     if (booIncludeWalls)
     {
         // drawbridge
         int intBridgeEnd = booIncludeMoat ? -2 : 5;
         if (strMoatType == "Lava" || strMoatType == "Fire")
         {
             BlockShapes.MakeSolidBox((intMapLength / 2) - 2, intMapLength / 2, 63, 63,
                                      intFarmLength + intBridgeEnd, intFarmLength + 13, BlockType.STONE, 2);
         }
         else
         {
             BlockShapes.MakeSolidBox((intMapLength / 2) - 2, intMapLength / 2, 63, 63,
                                      intFarmLength + intBridgeEnd, intFarmLength + 13, BlockType.WOOD_PLANK, 2);
         }
         BlockShapes.MakeSolidBox((intMapLength / 2) - 2, intMapLength / 2, 64, 64,
                                  intFarmLength + intBridgeEnd, intFarmLength + 13, BlockType.AIR, 2);
         // carve out the entrance/exit
         BlockShapes.MakeSolidBox((intMapLength / 2) - 2, intMapLength / 2, 64, 67,
                                  intFarmLength + 6, intFarmLength + 10, BlockType.AIR, 2);
         if (Utils.IsValidSign(strCityName))
         {
             BlockHelper.MakeSign((intMapLength / 2) - 3, 65, intFarmLength + 5, Utils.ConvertStringToSignText(strCityName.Replace("City of ", "City of~")), intWallMaterial, 2);
         }
         // add the bottom of a portcullis
         BlockShapes.MakeSolidBox((intMapLength / 2) - 2, intMapLength / 2, 67, 67,
                                  intFarmLength + 6, intFarmLength + 6, BlockType.FENCE, 2);
         // add room for murder holes
         BlockShapes.MakeSolidBox((intMapLength / 2) - 2, (intMapLength / 2) + 2, 69, 71,
                                  intFarmLength + 8, intFarmLength + 9, BlockType.AIR, 2);
         BlockShapes.MakeSolidBox(intMapLength / 2, intMapLength / 2, 69, 72,
                                  intFarmLength + 8, intFarmLength + 9, BlockType.AIR, 2);
         BlockHelper.MakeLadder(intMapLength / 2, 69, 72, intFarmLength + 9, 2, intWallMaterial);
         BlockShapes.MakeSolidBox(intMapLength / 2, intMapLength / 2, 72, 72,
                                  intFarmLength + 8, intFarmLength + 8, intWallMaterial, 2);
         // murder holes
         BlockShapes.MakeSolidBox((intMapLength / 2) - 2, (intMapLength / 2) - 2, 68, 68,
                                  intFarmLength + 8, intFarmLength + 8, BlockType.AIR, 2);
         BlockShapes.MakeSolidBox(intMapLength / 2, intMapLength / 2, 68, 68,
                                  intFarmLength + 8, intFarmLength + 8, BlockType.AIR, 2);
         BlockShapes.MakeSolidBox((intMapLength / 2) + 2, (intMapLength / 2) + 2, 68, 68,
                                  intFarmLength + 8, intFarmLength + 8, BlockType.AIR, 2);
         // chests
         BlockShapes.MakeBlock((intMapLength / 2) - 4, 69, intFarmLength + 9, BlockType.GRAVEL, 2, 100, -1);
         BlockShapes.MakeBlock((intMapLength / 2) + 4, 69, intFarmLength + 9, BlockType.GRAVEL, 2, 100, -1);
         BlockShapes.MakeBlock((intMapLength / 2) - 3, 70, intFarmLength + 9, BlockType.AIR, 2, 100, -1);
         BlockShapes.MakeBlock((intMapLength / 2) + 3, 70, intFarmLength + 9, BlockType.AIR, 2, 100, -1);
         TileEntityChest tec = new TileEntityChest();
         if (booIncludeItemsInChests)
         {
             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((intMapLength / 2) - 3, 69, intFarmLength + 9, BlockType.GRAVEL, tec, 2);
         // add torches
         BlockHelper.MakeTorch((intMapLength / 2) - 1, 70, intFarmLength + 9, intWallMaterial, 2);
         BlockHelper.MakeTorch((intMapLength / 2) + 1, 70, intFarmLength + 9, intWallMaterial, 2);
         // link to main roads
         //BlockShapes.MakeSolidBox((intMapLength / 2) - 1, (intMapLength / 2) + 1, 63, 63,
         //                         intFarmLength + 11, intFarmLength + 13, BlockType.DOUBLE_SLAB, 0);
     }
     else if (booIncludeMoat)
     {
         BlockShapes.MakeSolidBox((intMapLength / 2) - 2, intMapLength / 2, 63, 63,
                                  intFarmLength - 2, intFarmLength + 6, BlockType.STONE, 2);
     }
 }