public void AddAncientForges()
{
Main.statusText = "Building ancient forges...";
int HX = Main.maxTilesX - 1200;
int LX = 1200;
int HY = Main.maxTilesY - 200; //This is the bounds of where it can be placed
int LY = Main.maxTilesY - 700;
x = WorldGen.genRand.Next(LX, HX + 1); //this is the actual position
y = WorldGen.genRand.Next(LY, HY + 1);
if (!WorldGen.EmptyTileCheck(x, x, y, y) && !WorldGen.EmptyTileCheck(x + 7, x + 7, y, y) && !WorldGen.EmptyTileCheck(x, x, y - 6, y - 6 ) && !WorldGen.EmptyTileCheck(x + 7, x + 7, y - 6, y - 6)) //this checks if the for coners of the structure are blocks, you can get rid of this honestly
{
//Kill all the tiles
for (int i = 0; i < 8; i++)
{
WorldGen.KillTile(x + i, y, false, false, true);
WorldGen.KillTile(x + i, y - 1, false, false, true);
WorldGen.KillTile(x + i, y - 2, false, false, true);
WorldGen.KillTile(x + i, y - 3, false, false, true);
WorldGen.KillTile(x + i, y - 4, false, false, true);
WorldGen.KillTile(x + i, y - 5, false, false, true);
WorldGen.KillTile(x + i, y - 6, false, false, true);
}
//Kill all the walls
for (int q = 0; q < 8; q++)
{
WorldGen.KillWall(x + q, y);
WorldGen.KillWall(x + q, y - 1);
WorldGen.KillWall(x + q, y - 2);
WorldGen.KillWall(x + q, y - 3);
WorldGen.KillWall(x + q, y - 4);
WorldGen.KillWall(x + q, y - 5);
WorldGen.KillWall(x + q, y - 6);
}
//Generate tiles surrounding the sword forge
//FLOOR
for (int i = 0; i < 8; i++) WorldGen.PlaceTile(x + i, y, TileDef.byName["Gretarria:GretarrianBrick"], true, true); //My bricks name
//LEFT AND RIGHT WALLS
WorldGen.PlaceTile(x, y - 4, TileDef.byName["Gretarria:GretarrianBrick"], true, true);
WorldGen.PlaceTile(x, y - 5, TileDef.byName["Gretarria:GretarrianBrick"], true, true);
WorldGen.PlaceTile(x + 7, y - 4, TileDef.byName["Gretarria:GretarrianBrick"], true, true);
WorldGen.PlaceTile(x + 7, y - 5, TileDef.byName["Gretarria:GretarrianBrick"], true, true);
//CEILING
for (int i = 0; i < 8; i++) WorldGen.PlaceTile(x + i, y - 6, TileDef.byName["Gretarria:GretarrianBrick"], true, true);
//WALLS
int x1 = x + 1;
for (int i = 0; i < 6; i++) WorldGen.PlaceWall(x1 + i, y - 1, TileDef.wallByName["Gretarria:GretarrianBrickWall"], true); //The wall
for (int i = 0; i < 6; i++) WorldGen.PlaceWall(x1 + i, y - 2, TileDef.wallByName["Gretarria:GretarrianBrickWall"], true);
for (int i = 0; i < 6; i++) WorldGen.PlaceWall(x1 + i, y - 3, TileDef.wallByName["Gretarria:GretarrianBrickWall"], true);
for (int i = 0; i < 6; i++) WorldGen.PlaceWall(x1 + i, y - 4, TileDef.wallByName["Gretarria:GretarrianBrickWall"], true);
for (int i = 0; i < 6; i++) WorldGen.PlaceWall(x1 + i, y - 5, TileDef.wallByName["Gretarria:GretarrianBrickWall"], true);
//SWORD FORGE
WorldGen.PlaceTile(x + 3, y - 1, TileDef.byName["Gretarria:AncientForge"], true, true); //The actual thing (this regards it's placed position, which is bottom left for my tile
}
else
{
AddAncientForges();
}
}