示例#1
0
        private static void MakeGuardChest(BlockManager bm, int x, int y, int z)
        {
            TileEntityChest tec = new TileEntityChest();

            if (City.hasItemsInChests)
            {
                for (int a = 0; a < 5; a++)
                {
                    tec.Items[a] = BlockHelper.MakeItem(RNG.RandomItem(ItemInfo.IronSword.ID,
                                                                       ItemInfo.WoodenSword.ID,
                                                                       ItemInfo.StoneSword.ID), 1);
                }
                tec.Items[6] = BlockHelper.MakeItem(ItemInfo.Bow.ID, 1);
                tec.Items[7] = BlockHelper.MakeItem(ItemInfo.Arrow.ID, 64);
                int intArmourStartID = RNG.RandomItem(ItemInfo.LeatherCap.ID,
                                                      ItemInfo.ChainHelmet.ID,
                                                      ItemInfo.IronHelmet.ID);
                for (int a = 9; a < 18; a++)
                {
                    // random armour
                    tec.Items[a] = BlockHelper.MakeItem(intArmourStartID + RNG.Next(4), 1);
                }
            }
            //BlockHelper.MakeChest(x, y, z, City.wallMaterialID, tec, 0);
            BlockHelper.MakeChest(x, y, z, City.wallMaterialID, tec, 0);
            //bm.SetID(x, y, z, BlockInfo.Chest.ID);
            //bm.SetTileEntity(x, y, z, tec);
        }
示例#2
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);
     }
 }
示例#3
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);
     }
 }
示例#4
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);
     }
 }