public void Convert(int i, int j, int size = 4) { for (int k = i - size; k <= i + size; k++) { for (int l = j - size; l <= j + size; l++) { if (!WorldGen.InWorld(k, l, 1) || !(Math.Abs(k - i) + Math.Abs(l - j) < Math.Sqrt(size * size + size * size))) { continue; } int type = Main.tile[k, l].type; int wall = Main.tile[k, l].wall; if (WallID.Sets.Conversion.Grass[wall]) { Main.tile[k, l].wall = (ushort)ModContent.WallType <ReachWallNatural>(); WorldGen.SquareWallFrame(k, l); NetMessage.SendTileSquare(-1, k, l, 1); } if (!TileID.Sets.Conversion.Grass[type]) { continue; } Main.tile[k, l].type = (ushort)ModContent.TileType <BriarGrass>(); WorldGen.SquareTileFrame(k, l); NetMessage.SendTileSquare(-1, k, l, 1); } } }
public static void HeartGen(int xPosO, int yPosO) { //Obsidium Heart /** * 0 = Do Nothing * 1 = obsidium rock * 2 = obsidium ore * 3 = hellstone ore * 4 = hellstone wall * 5 = lava fall wall * 6 = chest * 7 = Obsidium Core * 9 = kill tile * */ for (int i = 0; i < _heartStructure.GetLength(1); i++) { for (int j = 0; j < _heartStructure.GetLength(0); j++) { if (TileCheckSafe((int)(xPosO + i), (int)(yPosO + j))) { if (_heartStructure[j, i] == 1) { WorldGen.KillTile(xPosO + i, yPosO + j); WorldGen.PlaceTile(xPosO + i, yPosO + j, ModContent.TileType <Tiles.ObsidiumRock>(), true, true); } if (_heartStructure[j, i] == 2) { WorldGen.KillTile(xPosO + i, yPosO + j); WorldGen.PlaceTile(xPosO + i, yPosO + j, ModContent.TileType <Tiles.ObsidiumCore>(), true, true); } if (_heartStructure[j, i] == 3) { WorldGen.KillTile(xPosO + i, yPosO + j); WorldGen.PlaceTile(xPosO + i, yPosO + j, ModContent.TileType <Tiles.Radiata>(), true, true); } if (_heartStructure[j, i] == 4) { WorldGen.KillTile(xPosO + i, yPosO + j); WorldGen.KillWall(xPosO + i, yPosO + j); WorldGen.PlaceWall(xPosO + i, yPosO + j, 177, true); //Hellstone Brick Wall } if (_heartStructure[j, i] == 5) { WorldGen.KillTile(xPosO + i, yPosO + j); WorldGen.KillWall(xPosO + i, yPosO + j); WorldGen.PlaceWall(xPosO + i, yPosO + j, 137, true); //Lavafall Wall } if (_heartStructure[j, i] == 9) { WorldGen.KillTile(xPosO + i, yPosO + j); WorldGen.KillWall(xPosO + i, yPosO + j); WorldGen.PlaceWall(xPosO + i, yPosO + j, ModContent.WallType <ObsidiumRockWall>(), true); } } } } }
public static void DefiledCave(float i, float j, float sizeMult = 1f) { ushort stoneID = (ushort)ModContent.TileType <Defiled_Stone>(); ushort stoneWallID = (ushort)ModContent.WallType <Defiled_Stone_Wall>(); for (int x = (int)Math.Floor(i - (28 * sizeMult + 5)); x < (int)Math.Ceiling(i + (28 * sizeMult + 5)); x++) { for (int y = (int)Math.Ceiling(j + (28 * sizeMult + 4)); y >= (int)Math.Floor(j - (28 * sizeMult + 4)); y--) { float diff = (float)Math.Sqrt((((y - j) * (y - j)) + (x - i) * (x - i)) * (GenRunners.GetWallDistOffset((float)Math.Atan2(y - j, x - i) * 4 + x + y) * 0.0316076058772687986171132238548f + 1)); if (diff > 35 * sizeMult) { continue; } if (Main.tile[x, y].wall != stoneWallID) { Main.tile[x, y].ResetToType(stoneID); } Main.tile[x, y].wall = stoneWallID; if (diff < 35 * sizeMult - 5) { Main.tile[x, y].active(false); } } } }
public override void SetDefaults() { base.SetDefaults(); item.CloneDefaults(ItemID.DirtWall); item.createWall = ModContent.WallType <T>(); }
public override bool Place(Point origin, StructureMap structures) { Mod mod = CSkies.inst; Dictionary <Color, int> colorToTile = new Dictionary <Color, int> { [new Color(0, 0, 255)] = ModContent.TileType <AbyssBricks>(), [new Color(0, 255, 0)] = ModContent.TileType <AbyssDoor>(), [new Color(255, 0, 0)] = ModContent.TileType <AbyssStone>(), [new Color(255, 0, 255)] = ModContent.TileType <AbyssGrass>(), [new Color(255, 255, 255)] = -2, [Color.Black] = -1 }; Dictionary <Color, int> colorToWall = new Dictionary <Color, int> { [new Color(0, 0, 255)] = ModContent.WallType <AbyssWall>(), [Color.Black] = -1 }; TexGen gen = BaseWorldGenTex.GetTexGenerator(mod.GetTexture("Worldgen/AbyssVaultPlanet"), colorToTile, mod.GetTexture("Worldgen/AbyssVaultPlanetWall"), colorToWall, null, mod.GetTexture("Worldgen/AbyssVaultPlanetSlopes")); gen.Generate(origin.X, origin.Y, true, true); CUtils.ObectPlace(origin.X + 32, origin.Y + 34, mod.TileType("HeartAltar1")); return(true); }
public void Convert(int i, int j, int size = 4) { for (int k = i - size; k <= i + size; k++) { for (int l = j - size; l <= j + size; l++) { if (WorldGen.InWorld(k, l, 1) && Math.Abs(k - i) + Math.Abs(l - j) < Math.Sqrt(size * size + size * size)) { int type = (int)Main.tile[k, l].type; int wall = (int)Main.tile[k, l].wall; if (wall != 0) { if (wall >= 63 && wall <= 70 || wall == 81) { Main.tile[k, l].wall = (ushort)ModContent.WallType <ReachWallNatural>(); WorldGen.SquareWallFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } } else if (type == 2 || type == 23 || type == 109 || type == 199) { Main.tile[k, l].type = (ushort)ModContent.TileType <BriarGrass>(); WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } } } } }
public override bool Place(Point origin, StructureMap structures) { Mod mod = CSkies.inst; Dictionary <Color, int> colorToTile = new Dictionary <Color, int> { [new Color(255, 0, 0)] = ModContent.TileType <HeatEngineBrickUnsafe>(), [new Color(255, 255, 0)] = ModContent.TileType <HeatGlass>(), [new Color(255, 0, 255)] = ModContent.TileType <CoreValve>(), [new Color(0, 0, 255)] = ModContent.TileType <ScrapHeap>(), [new Color(255, 255, 255)] = -1, [Color.Black] = -2 }; Dictionary <Color, int> colorToWall = new Dictionary <Color, int> { [new Color(0, 255, 0)] = ModContent.WallType <HeatEngineWallUnsafe>(), [new Color(255, 0, 0)] = ModContent.WallType <HeatCircuitWall>(), [Color.Black] = -1 }; TexGen gen = BaseWorldGenTex.GetTexGenerator(mod.GetTexture("Worldgen/MagmaCore"), colorToTile, mod.GetTexture("Worldgen/MagmaCoreWalls"), colorToWall, mod.GetTexture("Worldgen/MagmaCore_Lava"), mod.GetTexture("Worldgen/MagmaCore_Slope")); gen.Generate(origin.X, origin.Y, true, true); return(true); }
public void ConnectTo(LostBuilding other) { int bridgeHeight = ConfigReader.Get <int>("worldgen.lost city.house bridge height"); int right = Math.Max(Area.Left, other.Area.Left); int left = Math.Min(Area.Right, other.Area.Right); int floorShared = Math.Max(Area.Bottom, other.Area.Bottom); int roofShared = Math.Min(Area.Top, other.Area.Top); int bridgeFloor = WorldGen.genRand.Next(roofShared + bridgeHeight, floorShared); for (int i = left; i <= right; i++) { WorldGen.PlaceTile(i, bridgeFloor, ModContent.TileType <Tiles.LostCity.LostBrickUnsafe>(), forced: true); WorldGen.PlaceTile(i, bridgeFloor - bridgeHeight, ModContent.TileType <Tiles.LostCity.LostBrickUnsafe>(), forced: true); for (int j = bridgeFloor - bridgeHeight + 1; j < bridgeFloor; j++) { WorldGen.KillTile(i, j); WorldGen.KillWall(i, j); WorldGen.PlaceWall(i, j, ModContent.WallType <Walls.LostCity.LostBrickWall>()); } } }
public override void SetDefaults() { item.useStyle = 1; item.useTime = 2; item.useAnimation = 2; item.createWall = ModContent.WallType <BrickWall>(); item.autoReuse = true; }
public void Convert(int i, int j, int size = 4) { for (int k = i - size; k <= i + size; k++) { for (int l = j - size; l <= j + size; l++) { if (!WorldGen.InWorld(k, l, 1) || !(Math.Abs(k - i) + Math.Abs(l - j) < Math.Sqrt(size * size + size * size))) { continue; } int type = Main.tile[k, l].type; int wall = Main.tile[k, l].wall; if (WallID.Sets.Conversion.Grass[wall]) { Main.tile[k, l].wall = (ushort)ModContent.WallType <SpiritWall>(); WorldGen.SquareWallFrame(k, l); NetMessage.SendTileSquare(-1, k, l, 1); } if (TileID.Sets.Conversion.Stone[type] || TileID.Sets.Conversion.Moss[type]) { Main.tile[k, l].type = (ushort)ModContent.TileType <SpiritStone>(); WorldGen.SquareTileFrame(k, l); NetMessage.SendTileSquare(-1, k, l, 1); } if (type == TileID.Dirt) { Main.tile[k, l].type = (ushort)ModContent.TileType <SpiritDirt>(); WorldGen.SquareTileFrame(k, l); NetMessage.SendTileSquare(-1, k, l, 1); } else if (TileID.Sets.Conversion.Grass[type]) { Main.tile[k, l].type = (ushort)ModContent.TileType <SpiritGrass>(); WorldGen.SquareTileFrame(k, l); NetMessage.SendTileSquare(-1, k, l, 1); } else if (TileID.Sets.Conversion.Sand[type]) { Main.tile[k, l].type = (ushort)ModContent.TileType <Spiritsand>(); WorldGen.SquareTileFrame(k, l); NetMessage.SendTileSquare(-1, k, l, 1); } else if (TileID.Sets.Conversion.Ice[type]) { Main.tile[k, l].type = (ushort)ModContent.TileType <SpiritIce>(); WorldGen.SquareTileFrame(k, l); NetMessage.SendTileSquare(-1, k, l, 1); } } } }
public static void VoidAltarGen(GenerationProgress progress) { progress.Message = "Opening the Gates..."; Texture2D Courtyard = ModContent.GetTexture("StarlightRiver/Structures/VoidAltar"); Vector2 spawn = new Vector2(Main.maxTilesX / 4, Main.maxTilesY - 100); LegendWorld.RiftLocation = (spawn + new Vector2(25.5f, 3.5f)) * 16; for (int y = 0; y < Courtyard.Height; y++) // for every row { Color[] rawData = new Color[Courtyard.Width]; //array of colors Rectangle row = new Rectangle(0, y, Courtyard.Width, 1); //one row of the image Courtyard.GetData <Color>(0, row, rawData, 0, Courtyard.Width); //put the color data from the image into the array for (int x = 0; x < Courtyard.Width; x++) //every entry in the row { Main.tile[(int)spawn.X + x, (int)spawn.Y + y].ClearEverything(); //clear the tile out Main.tile[(int)spawn.X + x, (int)spawn.Y + y].liquidType(0); // clear liquids ushort placeType = 0; ushort wallType = 0; switch (rawData[x].R) //select block { case 10: placeType = TileID.Ash; break; case 20: placeType = (ushort)ModContent.TileType <Tiles.Void.Void1>(); break; case 30: placeType = (ushort)ModContent.TileType <Tiles.Void.Void2>(); break; case 40: placeType = TileID.Platforms; break; case 50: placeType = (ushort)ModContent.TileType <Tiles.Rift.MainRift>(); break; } switch (rawData[x].B) //select wall { case 10: wallType = (ushort)ModContent.WallType <Tiles.Void.VoidWall>(); break; case 20: wallType = (ushort)ModContent.WallType <Tiles.Void.VoidWallPillar>(); break; case 30: wallType = (ushort)ModContent.WallType <Tiles.Void.VoidWallPillarS>(); break; } if (placeType != 0) { WorldGen.PlaceTile((int)spawn.X + x, (int)spawn.Y + y, placeType, true, true); } //place block if (wallType != 0) { WorldGen.PlaceWall((int)spawn.X + x, (int)spawn.Y + y, wallType, true); } //place wall } } }
private void VoidAltarGen(GenerationProgress progress) { progress.Message = "Opening the Gates..."; // Top-Left Position Vector2 PureAltarSP = new Vector2(Main.spawnTileX - 50, Main.maxTilesY - 101); PureSpawnPoint = PureAltarSP + new Vector2(202, 57); Texture2D Courtyard = ModContent.GetTexture("StarlightRiver/Structures/VoidAltar"); for (int y = 0; y < Courtyard.Height; y++) // for every row { Color[] rawData = new Color[Courtyard.Width]; //array of colors Rectangle row = new Rectangle(0, y, Courtyard.Width, 1); //one row of the image Courtyard.GetData <Color>(0, row, rawData, 0, Courtyard.Width); //put the color data from the image into the array for (int x = 0; x < Courtyard.Width; x++) //every entry in the row { Main.tile[(int)PureAltarSP.X + x, (int)PureAltarSP.Y + y].ClearEverything(); //clear the tile out Main.tile[(int)PureAltarSP.X + x, (int)PureAltarSP.Y + y].liquidType(0); // clear liquids ushort placeType = 0; ushort wallType = 0; switch (rawData[x].R) //select block { case 10: placeType = TileID.Ash; break; case 20: placeType = (ushort)ModContent.TileType <Tiles.Void1>(); break; case 30: placeType = (ushort)ModContent.TileType <Tiles.Void2>(); break; case 40: placeType = (ushort)ModContent.TileType <Tiles.VoidDoorOn>(); break; } switch (rawData[x].B) //select wall { case 10: wallType = (ushort)ModContent.WallType <Tiles.VoidWall>(); break; case 20: wallType = (ushort)ModContent.WallType <Tiles.VoidWallPillar>(); break; case 30: wallType = (ushort)ModContent.WallType <Tiles.VoidWallPillarS>(); break; } if (placeType != 0) { WorldGen.PlaceTile((int)PureAltarSP.X + x, (int)PureAltarSP.Y + y, placeType, true, true); } //place block if (wallType != 0) { WorldGen.PlaceWall((int)PureAltarSP.X + x, (int)PureAltarSP.Y + y, wallType, true); } //place wall } } }
public void Convert(int i, int j, int size = 4) { for (int k = i - size; k <= i + size; k++) { for (int l = j - size; l <= j + size; l++) { if (WorldGen.InWorld(k, l, 1) && Math.Abs(k - i) + Math.Abs(l - j) < Math.Sqrt(size * size + size * size)) { int type = Main.tile[k, l].type; int wall = Main.tile[k, l].wall; //Convert all walls to ExampleWall if (wall != 0) { Main.tile[k, l].wall = (ushort)ModContent.WallType <ExampleWall>(); WorldGen.SquareWallFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } //If the tile is stone, convert to ExampleBlock if (TileID.Sets.Conversion.Stone[type]) { Main.tile[k, l].type = (ushort)ModContent.TileType <ExampleBlock>(); WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } //If the tile is sand, convert to ExampleSand else if (TileID.Sets.Conversion.Sand[type]) { Main.tile[k, l].type = (ushort)ModContent.TileType <ExampleSand>(); WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } //If the tile is a chair, convert to ExampleChair else if (type == TileID.Chairs && Main.tile[k, l - 1].type == TileID.Chairs) { Main.tile[k, l].type = (ushort)ModContent.TileType <ExampleChair>(); Main.tile[k, l - 1].type = (ushort)ModContent.TileType <ExampleChair>(); WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } //If the tile is a workbench, convert to ExampleWorkBench else if (type == TileID.WorkBenches && Main.tile[k - 1, l].type == TileID.WorkBenches) { Main.tile[k, l].type = (ushort)ModContent.TileType <ExampleWorkbench>(); Main.tile[k - 1, l].type = (ushort)ModContent.TileType <ExampleWorkbench>(); WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } } } } }
public void Convert(int i, int j, int size = 4) { for (int k = i - size; k <= i + size; k++) { for (int l = j - size; l <= j + size; l++) { if (WorldGen.InWorld(k, l, 1) && Math.Abs(k - i) + Math.Abs(l - j) < Math.Sqrt(size * size + size * size)) { int type = (int)Main.tile[k, l].type; int wall = (int)Main.tile[k, l].wall; if (wall != 0) { if (wall >= 63 && wall <= 70 || wall == 81) { Main.tile[k, l].wall = (ushort)ModContent.WallType <SpiritWall>(); WorldGen.SquareWallFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } } if (TileID.Sets.Conversion.Stone[type] || type == 179 || type == 180 || type == 181 || type == 182 || type == 183) { Main.tile[k, l].type = (ushort)ModContent.TileType <SpiritStone>(); WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } else if (type == 0) { Main.tile[k, l].type = (ushort)ModContent.TileType <SpiritDirt>(); WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } else if (type == 2 || type == 23 || type == 109 || type == 199) { Main.tile[k, l].type = (ushort)ModContent.TileType <SpiritGrass>(); WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } else if (type == 53) { Main.tile[k, l].type = (ushort)ModContent.TileType <Spiritsand>(); WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } else if (type == 161 || type == 200 || type == 163 || type == 164) { Main.tile[k, l].type = (ushort)ModContent.TileType <SpiritIce>(); WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } } } } }
public override void SetDefaults() { item.width = 12; item.height = 12; item.maxStack = 999; item.useTurn = true; item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType <Tiles.DankWoodFurniture.BrokenDankWoodFence>(); }
public override void SetDefaults() { Item.width = 12; Item.height = 12; Item.maxStack = 999; Item.useTurn = true; Item.autoReuse = true; Item.useAnimation = 15; Item.useTime = 7; Item.useStyle = ItemUseStyleID.Swing; Item.consumable = true; Item.createWall = ModContent.WallType <Walls.ExampleWall>(); // The ID of the wall that this item should place when used. ModContent.WallType<T>() method returns an integer ID of the wall provided to it through its generic type argument (the type in angle brackets). }
public override void SetDefaults() { item.width = 12; item.height = 12; item.maxStack = 999; item.useTurn = true; item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType <Walls.ExampleWall>(); }
public override void SetDefaults() { item.width = 16; item.height = 16; item.maxStack = 999; item.useTurn = true; item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; item.useStyle = 1; item.consumable = true; item.createWall = ModContent.WallType <Tiles.WallJungleCorrupt>(); }
public override void SetDefaults() { item.width = 16; item.height = 16; item.maxStack = 999; item.useTurn = true; item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType <GloomWoodWallTile>(); //put your CustomBlock Tile name }
public override void SetDefaults() { Item.width = 16; Item.height = 16; Item.maxStack = 1; Item.useTurn = true; Item.autoReuse = true; Item.useAnimation = 2; Item.useTime = 2; Item.useStyle = 1; Item.rare = 8; Item.createWall = ModContent.WallType <NullWall>(); }
public void Convert(int i, int j, int size = 4) { for (int k = i - size; k <= i + size; k++) { for (int l = j - size; l <= j + size; l++) { if (WorldGen.InWorld(k, l, 1) && Math.Abs(k - i) + Math.Abs(l - j) < Math.Sqrt(size * size + size * size)) { int type = (int)Main.tile[k, l].type; int wall = (int)Main.tile[k, l].wall; if (type == (int)ModContent.WallType <SpiritWall>() || type == (int)ModContent.WallType <ReachWallNatural>()) { Main.tile[k, l].wall = (ushort)2; WorldGen.SquareWallFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } if (type == ModContent.TileType <SpiritStone>()) { Main.tile[k, l].type = (ushort)1; WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } else if (type == ModContent.TileType <SpiritDirt>()) { Main.tile[k, l].type = 0; WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } else if (type == ModContent.TileType <SpiritGrass>() || type == ModContent.TileType <BriarGrass>()) { Main.tile[k, l].type = (ushort)2; WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } else if (type == ModContent.TileType <Spiritsand>()) { Main.tile[k, l].type = (ushort)53; WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } else if (type == ModContent.TileType <SpiritIce>()) { Main.tile[k, l].type = (ushort)161; WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } } } } }
public override void SetDefaults() { item.width = 16; item.height = 16; item.maxStack = 999; item.useTurn = true; item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createWall = ModContent.WallType <SeafoamBrickWall>(); }
public override void SetDefaults() { item.width = 12; item.height = 12; item.maxStack = 999; item.useTurn = true; item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; item.useStyle = 1; item.consumable = true; item.value = 50; item.createWall = ModContent.WallType <Walls.RoyalWallpaper>(); }
public override void SetDefaults() { item.width = 12; item.height = 12; item.maxStack = 999; item.rare = 0; item.useTurn = true; item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType <AstralHardenedSandWallSafePlaced>(); }
private void PlacementRestriction(On.Terraria.Player.orig_PlaceThing orig, Terraria.Player self) { Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; if (tile.wall == ModContent.WallType <BrickWall>() && !Main.projectile.Any(n => n.active && n.timeLeft > 10 && n.modProjectile is InteractiveProjectile && (n.modProjectile as InteractiveProjectile).ValidPoints.Contains(new Point16(Player.tileTargetX, Player.tileTargetY)))) { return; } else { orig(self); } }
public override void SetDefaults() { item.width = 16; item.height = 16; item.maxStack = 999; item.useTurn = true; item.autoReuse = true; item.useAnimation = 2; item.useTime = 1; item.useStyle = 1; //item.consumable = true; item.autoReuse = true; item.createWall = ModContent.WallType <Tiles.Overgrow.WallOvergrowBrick>(); }
public void ClearInside() { for (int j = Area.Top + 1; j < Area.Bottom; j++) { // Clear out the inside for (int i = Area.Left + 1; i <= Area.Right - 1; i++) { WorldGen.KillTile(i, j); WorldGen.KillWall(i, j); WorldGen.PlaceWall(i, j, ModContent.WallType <Walls.LostCity.LostBrickWall>()); } } }
private static void MakeRoom(Rectangle target) { rooms.Add(target); for (int x = target.X; x <= target.X + target.Width; x++) { for (int y = target.Y; y <= target.Y + target.Height; y++) { Tile tile = Framing.GetTileSafely(x, y); tile.ClearEverything(); tile.wall = (ushort)ModContent.WallType <Tiles.Overgrow.WallOvergrowBrick>(); tile.type = (ushort)ModContent.TileType <Tiles.Overgrow.BrickOvergrow>(); tile.active(true); } } }
private static void MakeHallTall(Rectangle target) { for (int x = target.X; x <= target.X + target.Width; x++) { for (int y = target.Y; y <= target.Y + target.Height; y++) { Tile tile = Framing.GetTileSafely(x, y); tile.ClearEverything(); tile.wall = (ushort)ModContent.WallType <Tiles.Overgrow.WallOvergrowBrick>(); if (x - target.X <= HallThickness || x - target.X >= HallWidth - HallThickness) { tile.type = (ushort)ModContent.TileType <Tiles.Overgrow.BrickOvergrow>(); tile.active(true); } } } }
public void Convert(int i, int j, int size = 4) { for (int k = i - size; k <= i + size; k++) { for (int l = j - size; l <= j + size; l++) { if (WorldGen.InWorld(k, l, 1) && Math.Abs(k - i) + Math.Abs(l - j) < Math.Sqrt(size * size + size * size)) { int type = Main.tile[k, l].type; int wall = Main.tile[k, l].wall; if (wall == WallID.Mushroom) { Main.tile[k, l].wall = WallID.Jungle; WorldGen.SquareWallFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } else if (wall == WallID.MushroomUnsafe) { Main.tile[k, l].wall = WallID.JungleUnsafe; WorldGen.SquareWallFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } else if (wall == (ushort)ModContent.WallType <Mushwall>()) { Main.tile[k, l].wall = WallID.Grass; WorldGen.SquareWallFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } else if (type == ModContent.TileType <Mycelium>()) { Main.tile[k, l].type = TileID.Grass; WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } else if (type == TileID.MushroomGrass) { Main.tile[k, l].type = TileID.JungleGrass; WorldGen.SquareTileFrame(k, l, true); NetMessage.SendTileSquare(-1, k, l, 1); } } } } }