- public static void AddHellCastle()
- {
- byte brimStone = (byte)Config.tileDefs.ID["Brimstone Block"];
- byte brickI = (byte)Config.tileDefs.ID["Impervious Brick"];
- byte caesiumOre = (byte)Config.tileDefs.ID["Caesium Ore"];
- byte resWood = (byte)Config.tileDefs.ID["Resistant Wood"];
- int xoff = WorldGen.genRand.Next(150, (int)(Main.maxTilesX / 3));
- int yoff = Main.maxTilesY - 150;
- Main.statusText = "Generating Hellcastle: 5%";
- for (int x = xoff - 50; x <= xoff + 50; x++)
- {
- for (int y = yoff - 37; y <= yoff + 37; y++)
- {
- Main.tile[x, y].active = false;
- if (x <= xoff - 45 || x >= xoff + 45 || y <= yoff - 32 || y >= yoff + 32) Main.tile[x, y].active = true;
- Main.tile[x, y].liquid = 0;
- Main.tile[x, y].lava = false;
- Main.tile[x, y].wall = 0;
- Main.tile[x, y].type = brickI;
- if (((x <= xoff - 45 && x >= xoff - 50) || (x <= xoff + 50 && x >= xoff + 45)) && (y <= yoff - 26 && y >= yoff - 31))
- {
- Main.tile[x, y].type = resWood;
- }
- }
- }
- bool hasMadeOpening = false;
- bool hasMadeOpeningLeftSide = false;
- for(int y = 0; y < 73; y++)
- {
- if (!(Main.tile[xoff + 51, yoff - y].active) && !hasMadeOpening)
- {
- Main.tile[xoff + 50, yoff - y].type = resWood;
- Main.tile[xoff + 50, yoff - y - 1].type = resWood;
- Main.tile[xoff + 50, yoff - y + 1].type = resWood;
- for (int opening = 49; opening >= 45; opening--)
- {
- Main.tile[xoff + opening, yoff - y].active = false;
- Main.tile[xoff + opening, yoff - y - 1].active = false;
- Main.tile[xoff + opening, yoff - y + 1].active = false;
- hasMadeOpening = true;
- }
- }
- if (!(Main.tile[xoff + 51, yoff + y].active) && !hasMadeOpening)
- {
- Main.tile[xoff + 50, yoff - y].type = resWood;
- Main.tile[xoff + 50, yoff - y - 1].type = resWood;
- Main.tile[xoff + 50, yoff - y + 1].type = resWood;
- for (int opening = 49; opening >= 45; opening--)
- {
- Main.tile[xoff + opening, yoff - y].active = false;
- Main.tile[xoff + opening, yoff - y - 1].active = false;
- Main.tile[xoff + opening, yoff - y + 1].active = false;
- hasMadeOpening = true;
- }
- }
- if (!(Main.tile[xoff - 51, yoff - y].active) && !hasMadeOpeningLeftSide)
- {
- Main.tile[xoff - 50, yoff - y].type = resWood;
- Main.tile[xoff - 50, yoff - y - 1].type = resWood;
- Main.tile[xoff - 50, yoff - y + 1].type = resWood;
- for (int opening = 49; opening >= 45; opening--)
- {
- Main.tile[xoff - opening, yoff - y].active = false;
- Main.tile[xoff - opening, yoff - y - 1].active = false;
- Main.tile[xoff - opening, yoff - y + 1].active = false;
- hasMadeOpeningLeftSide = true;
- }
- }
- if (!(Main.tile[xoff - 51, yoff + y].active) && !hasMadeOpeningLeftSide)
- {
- Main.tile[xoff - 50, yoff - y].type = resWood;
- Main.tile[xoff - 50, yoff - y - 1].type = resWood;
- Main.tile[xoff - 50, yoff - y + 1].type = resWood;
- for (int opening = 49; opening >= 45; opening--)
- {
- Main.tile[xoff - opening, yoff - y].active = false;
- Main.tile[xoff - opening, yoff - y - 1].active = false;
- Main.tile[xoff - opening, yoff - y + 1].active = false;
- hasMadeOpeningLeftSide = true;
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 15%";
- if (!hasMadeOpening)
- {
- Main.tile[xoff + 50, yoff].type = resWood;
- Main.tile[xoff + 50, yoff - 1].type = resWood;
- Main.tile[xoff + 50, yoff + 1].type = resWood;
- for (int opening = 49; opening >= 45; opening--)
- {
- Main.tile[xoff + opening, yoff].active = false;
- Main.tile[xoff + opening, yoff - 1].active = false;
- Main.tile[xoff + opening, yoff + 1].active = false;
- }
- }
- if (!hasMadeOpeningLeftSide)
- {
- Main.tile[xoff - 50, yoff].type = resWood;
- Main.tile[xoff - 50, yoff - 1].type = resWood;
- Main.tile[xoff - 50, yoff + 1].type = resWood;
- for (int opening = 49; opening >= 45; opening--)
- {
- Main.tile[xoff - opening, yoff].active = false;
- Main.tile[xoff - opening, yoff - 1].active = false;
- Main.tile[xoff - opening, yoff + 1].active = false;
- }
- }
- Main.statusText = "Generating Hellcastle: 20%";
- for (int x2 = xoff - 45; x2 <= xoff + 45; x2++)
- {
- for (int y2 = yoff - 25; y2 <= yoff - 20; y2++)
- {
- Main.tile[x2, y2].active = true;
- Main.tile[x2, y2].wall = 0;
- Main.tile[x2, y2].liquid = 0;
- Main.tile[x2, y2].type = brickI;
- if ((x2 <= xoff - 25 && x2 >= xoff - 30) || (x2 <= xoff + 30 && x2 >= xoff + 25))
- {
- if (y2 == yoff - 25 || y2 == yoff - 20)
- {
- Main.tile[x2, y2].type = 19;
- }
- else Main.tile[x2, y2].active = false;
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 25%";
- for (int x4 = xoff - 45; x4 <= xoff + 45; x4++)
- {
- for (int y4 = yoff + 2; y4 <= yoff + 7; y4++)
- {
- Main.tile[x4, y4].active = true;
- Main.tile[x4, y4].wall = 0;
- Main.tile[x4, y4].liquid = 0;
- Main.tile[x4, y4].type = brickI;
- if ((x4 <= xoff - 25 && x4 >= xoff - 30) || (x4 <= xoff + 30 && x4 >= xoff + 25))
- {
- if (y4 == yoff + 2 || y4 == yoff + 7)
- {
- Main.tile[x4, y4].type = 19;
- }
- else Main.tile[x4, y4].active = false;
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 30%";
- for (int x5 = xoff - 45; x5 <= xoff + 45; x5++)
- {
- for (int y5 = yoff + 15; y5 <= yoff + 20; y5++)
- {
- Main.tile[x5, y5].active = true;
- Main.tile[x5, y5].wall = 0;
- Main.tile[x5, y5].liquid = 0;
- Main.tile[x5, y5].type = brickI;
- if ((x5 <= xoff - 25 && x5 >= xoff - 30) || (x5 <= xoff + 30 && x5 >= xoff + 25))
- {
- if (y5 == yoff + 15 || y5 == yoff + 20)
- {
- Main.tile[x5, y5].type = 19;
- }
- else if (y5 >= yoff + 16 && y5 <= yoff + 19)
- {
- Main.tile[x5, y5].active = false;
- }
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 35%";
- for (int brimstoneX = xoff - 45; brimstoneX <= xoff + 45; brimstoneX++)
- {
- for (int brimstoneY = yoff + 21; brimstoneY <= yoff + 31; brimstoneY++)
- {
- Main.tile[brimstoneX, brimstoneY].liquid = 0;
- Main.tile[brimstoneX, brimstoneY].wall = 0;
- Main.tile[brimstoneX, brimstoneY].active = true;
- Main.tile[brimstoneX, brimstoneY].type = brimStone;
- if (WorldGen.genRand.Next(5) == 0)
- {
- Main.tile[brimstoneX, brimstoneY].type = caesiumOre;
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 40%";
- for (int lanternX = xoff - 45; lanternX <= xoff + 45; lanternX++)
- {
- for (int lanternY = yoff - 32; lanternY <= yoff + 14; lanternY++)
- {
- if (((lanternX == xoff - 40 || lanternX == xoff - 28 || lanternX == xoff - 15 || lanternX == xoff || lanternX == xoff + 15 || lanternX == xoff + 28 || lanternX == xoff + 40) && lanternY == yoff - 31))
- {
- WorldGen.Place1x2Top(lanternX, lanternY, 42);
- }
- if (((lanternX == xoff - 40 || lanternX == xoff - 15 || lanternX == xoff || lanternX == xoff + 15 || lanternX == xoff + 40) && lanternY == yoff - 19))
- {
- WorldGen.Place1x2Top(lanternX, lanternY, 42);
- }
- if (((lanternX == xoff - 40 || lanternX == xoff - 15 || lanternX == xoff || lanternX == xoff + 15 || lanternX == xoff + 40) && lanternY == yoff + 8))
- {
- WorldGen.Place1x2Top(lanternX, lanternY, 42);
- }
- if (((lanternX == xoff - 40 || lanternX == xoff - 15 || lanternX == xoff || lanternX == xoff + 15 || lanternX == xoff + 40) && lanternY == yoff + 1))
- {
- WorldGen.PlaceTile(lanternX, lanternY, 4, true, true, -1, 8);
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 45%";
- for (int torchX = xoff - 45; torchX <= xoff + 45; torchX++)
- {
- for (int torchY = yoff - 32; torchY <= yoff + 20; torchY++)
- {
- if ((torchX == xoff - 30 || torchX == xoff - 25 || torchX == xoff + 25 || torchX == xoff + 30) && torchY == yoff - 23)
- {
- WorldGen.PlaceTile(torchX, torchY, 4, true, true, -1, 8);
- }
- if ((torchX == xoff - 30 || torchX == xoff - 25 || torchX == xoff + 25 || torchX == xoff + 30) && torchY == yoff + 4)
- {
- WorldGen.PlaceTile(torchX, torchY, 4, true, true, -1, 8);
- }
- if ((torchX == xoff - 30 || torchX == xoff - 25 || torchX == xoff + 25 || torchX == xoff + 30) && torchY == yoff + 17)
- {
- WorldGen.PlaceTile(torchX, torchY, 4, true, true, -1, 8);
- }
- }
- }
- //Main.statusText = "Generating Hellcastle: 50%";
- Main.statusText = "Generating Hellcastle: 60%";
- for (int platx = xoff - 2; platx <= xoff + 2; platx++)
- {
- for (int platy = yoff + 32; platy <= yoff + 37; platy++)
- {
- Main.tile[platx, platy].active = false;
- if (platy == yoff + 32 || platy == yoff + 37)
- {
- Main.tile[platx, platy].active = true;
- Main.tile[platx, platy].type = 19;
- }
- if ((platx == xoff + 2 || platx == xoff - 2) && platy == yoff + 34)
- {
- WorldGen.PlaceTile(platx, platy, 4, true, true, -1, 8);
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 65%";
- for (int chestBoxX = xoff - 17; chestBoxX <= xoff + 16; chestBoxX++)
- {
- for (int chestBoxY = yoff + 38; chestBoxY <= yoff + 55; chestBoxY++)
- {
- if (((chestBoxX <= xoff - 12 && chestBoxX >= xoff - 17) || (chestBoxX <= xoff + 16 && chestBoxX >= xoff + 11)) && (chestBoxY <= yoff + 55 && chestBoxY >= yoff + 38))
- {
- Main.tile[chestBoxX, chestBoxY].active = true;
- Main.tile[chestBoxX, chestBoxY].wall = 0;
- Main.tile[chestBoxX, chestBoxY].liquid = 0;
- Main.tile[chestBoxX, chestBoxY].lava = false;
- Main.tile[chestBoxX, chestBoxY].type = brickI;
- }
- if ((chestBoxX >= xoff - 11 && chestBoxX <= xoff + 10) && (chestBoxY >= yoff + 38 && chestBoxY <= yoff + 50))
- {
- Main.tile[chestBoxX, chestBoxY].active = false;
- Main.tile[chestBoxX, chestBoxY].wall = 0;
- Main.tile[chestBoxX, chestBoxY].liquid = 0;
- Main.tile[chestBoxX, chestBoxY].lava = false;
- }
- if ((chestBoxX <= xoff + 10 && chestBoxX >= xoff - 11) && (chestBoxY >= yoff + 51 && chestBoxY <= yoff + 55))
- {
- Main.tile[chestBoxX, chestBoxY].active = true;
- Main.tile[chestBoxX, chestBoxY].liquid = 0;
- Main.tile[chestBoxX, chestBoxY].lava = false;
- Main.tile[chestBoxX, chestBoxY].wall = 0;
- Main.tile[chestBoxX, chestBoxY].type = brickI;
- }
- //if ((chestBoxX == xoff - 7 || chestBoxX == xoff + 6) && chestBoxY == yoff + 38)
- //{
- //Main.tile[chestBoxX, chestBoxY].type = 42;
- //Main.tile[chestBoxX, chestBoxY].active = true;
- //Main.tile[chestBoxX, chestBoxY].frameX = (short)1;
- //Main.tile[chestBoxX, chestBoxY].frameY = (short)1;
- //Main.tile[chestBoxX, chestBoxY + 1].frameX = (short)1;
- //Main.tile[chestBoxX, chestBoxY + 1].frameY = (short)19;
- //WorldGen.Place1x2Top(chestBoxX, chestBoxY, 42);
- //}
- if ((chestBoxX >= xoff - 2 && chestBoxX <= xoff + 1) && (chestBoxY >= yoff + 47 && chestBoxY <= yoff + 50))
- {
- Main.tile[chestBoxX, chestBoxY].active = true;
- Main.tile[chestBoxX, chestBoxY].type = resWood;
- if ((chestBoxX == xoff - 1 || chestBoxX == xoff) && (chestBoxY == yoff + 48 || chestBoxY == yoff + 49))
- {
- Main.tile[chestBoxX, chestBoxY].active = false;
- }
- }
- if (AddHellfireChest(xoff, yoff + 49, Config.itemDefs.byName["Autonomic Drill"].type, false, 1))
- {
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 70%";
- for (int leftSideX = xoff - 65; leftSideX <= xoff - 51; leftSideX++)
- {
- for (int leftSideY = yoff - 37; leftSideY <= yoff + 37; leftSideY++)
- {
- if ((leftSideX <= xoff - 51 && leftSideX >= xoff - 65) && (leftSideY <= yoff + 37 && leftSideY >= yoff - 37))
- {
- Main.tile[leftSideX, leftSideY].active = true;
- Main.tile[leftSideX, leftSideY].liquid = 0;
- Main.tile[leftSideX, leftSideY].wall = 0;
- Main.tile[leftSideX, leftSideY].lava = false;
- Main.tile[leftSideX, leftSideY].type = brickI;
- }
- if ((leftSideX >= xoff - 60 && leftSideX <= xoff - 51) && ((leftSideY <= yoff - 26 && leftSideY >= yoff - 31) || (leftSideY <= yoff + 31 && leftSideY >= yoff + 26)))
- {
- Main.tile[leftSideX, leftSideY].active = false;
- }
- if (leftSideX == xoff - 65 && (leftSideY == yoff - 1 || leftSideY == yoff || leftSideY == yoff + 1))
- {
- Main.tile[leftSideX, leftSideY].type = resWood;
- }
- if ((leftSideX >= xoff - 64 && leftSideX <= xoff - 51) && (leftSideY == yoff - 1 || leftSideY == yoff || leftSideY == yoff + 1))
- {
- Main.tile[leftSideX, leftSideY].active = false;
- }
- if ((leftSideX >= xoff - 60 && leftSideX <= xoff - 55) && ((leftSideY <= yoff + 26 && leftSideY >= yoff + 5) || (leftSideY <= yoff - 5 && leftSideY >= yoff - 26)))
- {
- Main.tile[leftSideX, leftSideY].active = false;
- if (leftSideX == xoff - 60 && (leftSideY == yoff + 18 || leftSideY == yoff - 18))
- {
- //WorldGen.KillTile(leftSideX, leftSideY, false, false, false);
- //Main.tile[leftSideX, leftSideY].active = true;
- WorldGen.PlaceTile(leftSideX, leftSideY, 4, true, true, -1, 8);
- }
- }
- if ((leftSideX <= xoff - 54 && leftSideX >= xoff - 59) && (leftSideY == yoff + 5 || leftSideY == yoff - 5))
- {
- Main.tile[leftSideX, leftSideY].active = false;
- }
- if ((leftSideX <= xoff - 53 && leftSideX >= xoff - 58) && (leftSideY == yoff + 4 || leftSideY == yoff - 4))
- {
- Main.tile[leftSideX, leftSideY].active = false;
- }
- if ((leftSideX <= xoff - 52 && leftSideX >= xoff - 57) && (leftSideY == yoff + 3 || leftSideY == yoff - 3))
- {
- Main.tile[leftSideX, leftSideY].active = false;
- }
- if ((leftSideX <= xoff - 51 && leftSideX >= xoff - 56) && (leftSideY == yoff + 2 || leftSideY == yoff - 2))
- {
- Main.tile[leftSideX, leftSideY].active = true;
- Main.tile[leftSideX, leftSideY].type = 19;
- }
- if (leftSideX == xoff - 60 && (leftSideY == yoff - 5 || leftSideY == yoff + 5))
- {
- Main.tile[leftSideX, leftSideY].active = true;
- }
- if (leftSideX == xoff - 55 && leftSideY == yoff + 31)
- {
- Main.tile[leftSideX, leftSideY].active = true;
- Main.tile[leftSideX, leftSideY].type = 4;
- Main.tile[leftSideX, leftSideY].frameX = (short)0;
- Main.tile[leftSideX, leftSideY].frameY = (short)176;
- //WorldGen.PlaceTile(leftSideX, leftSideY, 4, true, true, -1, 8);
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 85%";
- for (int rightSideX = xoff + 51; rightSideX <= xoff + 65; rightSideX++)
- {
- for (int rightSideY = yoff - 37; rightSideY <= yoff + 37; rightSideY++)
- {
- if ((rightSideX >= xoff + 51 && rightSideX <= xoff + 65) && (rightSideY <= yoff + 37 && rightSideY >= yoff - 37))
- {
- Main.tile[rightSideX, rightSideY].active = true;
- Main.tile[rightSideX, rightSideY].liquid = 0;
- Main.tile[rightSideX, rightSideY].wall = 0;
- Main.tile[rightSideX, rightSideY].lava = false;
- Main.tile[rightSideX, rightSideY].type = brickI;
- }
- if ((rightSideX <= xoff + 60 && rightSideX >= xoff + 51) && ((rightSideY <= yoff - 26 && rightSideY >= yoff - 31) || (rightSideY <= yoff + 31 && rightSideY >= yoff + 26)))
- {
- Main.tile[rightSideX, rightSideY].active = false;
- }
- if (rightSideX == xoff + 65 && (rightSideY == yoff - 1 || rightSideY == yoff || rightSideY == yoff + 1))
- {
- Main.tile[rightSideX, rightSideY].type = resWood;
- }
- if ((rightSideX <= xoff + 64 && rightSideX >= xoff + 51) && (rightSideY == yoff - 1 || rightSideY == yoff || rightSideY == yoff + 1))
- {
- Main.tile[rightSideX, rightSideY].active = false;
- }
- if ((rightSideX <= xoff + 60 && rightSideX >= xoff + 55) && ((rightSideY <= yoff + 26 && rightSideY >= yoff + 5) || (rightSideY <= yoff - 5 && rightSideY >= yoff - 26)))
- {
- Main.tile[rightSideX, rightSideY].active = false;
- if (rightSideX == xoff + 60 && (rightSideY == yoff + 18 || rightSideY == yoff - 18))
- {
- Main.tile[rightSideX, rightSideY].active = true;
- Main.tile[rightSideX, rightSideY].type = 4;
- Main.tile[rightSideX, rightSideY].frameX = (short)44;
- Main.tile[rightSideX, rightSideY].frameY = (short)176;
- }
- }
- if ((rightSideX >= xoff + 54 && rightSideX <= xoff + 59) && (rightSideY == yoff + 5 || rightSideY == yoff - 5))
- {
- Main.tile[rightSideX, rightSideY].active = false;
- }
- if ((rightSideX >= xoff + 53 && rightSideX <= xoff + 58) && (rightSideY == yoff + 4 || rightSideY == yoff - 4))
- {
- Main.tile[rightSideX, rightSideY].active = false;
- }
- if ((rightSideX >= xoff + 52 && rightSideX <= xoff + 57) && (rightSideY == yoff + 3 || rightSideY == yoff - 3))
- {
- Main.tile[rightSideX, rightSideY].active = false;
- }
- if ((rightSideX >= xoff + 51 && rightSideX <= xoff + 56) && (rightSideY == yoff + 2 || rightSideY == yoff - 2))
- {
- Main.tile[rightSideX, rightSideY].active = true;
- Main.tile[rightSideX, rightSideY].type = 19;
- }
- if (rightSideX == xoff + 60 && (rightSideY == yoff - 5 || rightSideY == yoff + 5))
- {
- Main.tile[rightSideX, rightSideY].active = true;
- }
- if (rightSideX == xoff + 55 && rightSideY == yoff + 31)
- {
- Main.tile[rightSideX, rightSideY].active = true;
- Main.tile[rightSideX, rightSideY].type = 4;
- Main.tile[rightSideX, rightSideY].frameX = (short)0;
- Main.tile[rightSideX, rightSideY].frameY = (short)176;
- //WorldGen.PlaceTile(rightSideX, rightSideY, 4, true, true, -1, 8);
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 90%";
- for (int shelfX = xoff - 65; shelfX <= xoff + 65; shelfX++)
- {
- for (int shelfY = yoff - 37; shelfY <= yoff + 55; shelfY++)
- {
- if (((shelfX == xoff - 59 || shelfX == xoff - 60) || (shelfX == xoff + 60 || shelfX == xoff + 59)) && (shelfY == yoff - 10 || shelfY == yoff + 10))
- {
- Main.tile[shelfX, shelfY].active = true;
- Main.tile[shelfX, shelfY].type = 19;
- Main.tile[shelfX, shelfY - 1].active = true;
- Main.tile[shelfX, shelfY - 1].type = 50;
- int randomBook = WorldGen.genRand.Next(5);
- if (randomBook == 0)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)0;
- }
- else if (randomBook == 1)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)18;
- }
- else if (randomBook == 2)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)36;
- }
- else if (randomBook == 3)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)54;
- }
- else if (randomBook == 4)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)72;
- }
- }
- if (((shelfX == xoff - 55 || shelfX == xoff - 56) || (shelfX == xoff + 56 || shelfX == xoff + 55)) && (shelfY == yoff - 20 || shelfY == yoff + 20))
- {
- Main.tile[shelfX, shelfY].active = true;
- Main.tile[shelfX, shelfY].type = 19;
- Main.tile[shelfX, shelfY - 1].active = true;
- Main.tile[shelfX, shelfY - 1].type = 50;
- int randomBook2 = WorldGen.genRand.Next(5);
- if (randomBook2 == 0)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)0;
- }
- else if (randomBook2 == 1)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)18;
- }
- else if (randomBook2 == 2)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)36;
- }
- else if (randomBook2 == 3)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)54;
- }
- else if (randomBook2 == 4)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)72;
- }
- }
- Main.tile[xoff - 44, yoff + 11].active = true;
- Main.tile[xoff - 44, yoff + 11].type = 19;
- Main.tile[xoff + 44, yoff + 11].active = true;
- Main.tile[xoff + 44, yoff + 11].type = 19;
- if (((shelfX >= xoff - 43 && shelfX <= xoff - 41) || (shelfX >= xoff + 41 && shelfX <= xoff + 43)) && shelfY == yoff + 11)
- {
- Main.tile[shelfX, shelfY].active = true;
- Main.tile[shelfX, shelfY].type = 19;
- Main.tile[shelfX, shelfY - 1].active = true;
- Main.tile[shelfX, shelfY - 1].type = 50;
- int randomBook3 = WorldGen.genRand.Next(5);
- if (randomBook3 == 0)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)0;
- }
- else if (randomBook3 == 1)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)18;
- }
- else if (randomBook3 == 2)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)36;
- }
- else if (randomBook3 == 3)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)54;
- }
- else if (randomBook3 == 4)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)72;
- }
- }
- if (((shelfX >= xoff - 11 && shelfX <= xoff - 10) || (shelfX >= xoff + 9 && shelfX <= xoff + 10)) && shelfY == yoff + 43)
- {
- Main.tile[shelfX, shelfY].active = true;
- Main.tile[shelfX, shelfY].type = 19;
- Main.tile[shelfX, shelfY - 1].active = true;
- Main.tile[shelfX, shelfY - 1].type = 50;
- int randomBook4 = WorldGen.genRand.Next(5);
- if (randomBook4 == 0)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)0;
- }
- else if (randomBook4 == 1)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)18;
- }
- else if (randomBook4 == 2)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)36;
- }
- else if (randomBook4 == 3)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)54;
- }
- else if (randomBook4 == 4)
- {
- Main.tile[shelfX, shelfY - 1].frameX = (short)72;
- }
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 95%";
- for (int trapX = xoff - 50; trapX <= xoff + 50; trapX++)
- {
- for (int trapY = yoff - 37; trapY <= yoff + 37; trapY++)
- {
- if ((trapX == xoff - 45 || trapX == xoff + 45) && trapY == yoff - 8)
- {
- Main.tile[trapX, trapY].active = true;
- if (trapX == xoff - 45)
- {
- WorldGen.PlaceTile(trapX, trapY, 137, true, true, -1, 1);
- }
- else WorldGen.PlaceTile(trapX, trapY, 137, true, true, -1, -1);
- }
- if (((trapX >= xoff - 44 && trapX <= xoff - 30) || (trapX <= xoff + 44 && trapX >= xoff + 30) || (trapX >= xoff - 12 && trapX <= xoff + 12)) && (trapY == yoff - 7 || trapY == yoff - 6))
- {
- Main.tile[trapX, trapY].active = true;
- Main.tile[trapX, trapY].type = brickI;
- if ((trapX == xoff - 8 || trapX == xoff + 8) && trapY == yoff - 7)
- {
- WorldGen.PlaceTile(trapX, trapY, 4, true, true, -1, 8);
- }
- }
- if (trapX == xoff && trapY == yoff - 8)
- {
- Main.tile[trapX, trapY].active = true;
- Main.tile[trapX, trapY].type = 135;
- Main.tile[trapX, trapY].frameX = (short)0;
- Main.tile[trapX, trapY].frameY = (short)36;
- //Main.tile[trapX, trapY + 1].type = 56;
- }
- if ((trapX >= xoff - 45 && trapX <= xoff + 45) && trapY == yoff - 8)
- {
- Main.tile[trapX, trapY].wire = true;
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 96%";
- for (int lanternX2 = xoff - 65; lanternX2 <= xoff + 65; lanternX2++)
- {
- for (int lanternY2 = yoff - 32; lanternY2 <= yoff + 55; lanternY2++)
- {
- if ((lanternX2 == xoff - 55 || lanternX2 == xoff + 55) && lanternY2 == yoff - 31)
- {
- WorldGen.Place1x2Top(lanternX2, lanternY2, 42);
- }
- if ((lanternX2 == xoff - 7 || lanternX2 == xoff + 7) && lanternY2 == yoff + 38)
- {
- WorldGen.Place1x2Top(lanternX2, lanternY2, 42);
- }
- if ((lanternX2 == xoff - 7 || lanternX2 == xoff + 7) && lanternY2 == yoff + 50)
- {
- Main.tile[lanternX2, lanternY2].active = true;
- Main.tile[lanternX2, lanternY2].type = 4;
- Main.tile[lanternX2, lanternY2].frameX = (short)0;
- Main.tile[lanternX2, lanternY2].frameY = (short)176;
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 97%";
- for (int trap2X = xoff - 17; trap2X <= xoff + 16; trap2X++)
- {
- for (int trap2Y = yoff + 38; trap2Y <= yoff + 55; trap2Y++)
- {
- if ((trap2X == xoff || trap2X == xoff - 1) && trap2Y == yoff + 46)
- {
- Main.tile[trap2X, trap2Y].active = true;
- Main.tile[trap2X, trap2Y].type = 135;
- Main.tile[trap2X, trap2Y].frameX = (short)0;
- Main.tile[trap2X, trap2Y].frameY = (short)36;
- //Main.tile[trap2X, trap2Y + 1].type = 56;
- }
- if ((trap2X == xoff - 12 || trap2X == xoff + 11) && trap2Y == yoff + 46)
- {
- if (trap2X == xoff - 12)
- {
- WorldGen.PlaceTile(trap2X, trap2Y, 137, true, true, -1, 1);
- }
- else WorldGen.PlaceTile(trap2X, trap2Y, 137, true, true, -1, -1);
- }
- if ((trap2X >= xoff - 12 && trap2X <= xoff + 11) && trap2Y == yoff + 46)
- {
- Main.tile[trap2X, trap2Y].wire = true;
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 98%";
- for (int statueX = xoff - 65; statueX <= xoff + 65; statueX++)
- {
- for (int statueY = yoff - 37; statueY <= yoff + 55; statueY++)
- {
- if ((statueX == xoff - 9 || statueX == xoff + 8) && statueY == yoff + 50)
- {
- WorldGen.PlaceTile(statueX, statueY, 105, true, true, -1, 13);
- }
- if ((statueX == xoff - 52 || statueX == xoff + 51) && statueY == yoff - 26)
- {
- WorldGen.PlaceTile(statueX, statueY, 105, true, true, -1, 14);
- }
- if ((statueX == xoff - 52 || statueX == xoff + 51) && statueY == yoff + 31)
- {
- WorldGen.PlaceTile(statueX, statueY, 105, true, true, -1, 36);
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 99%";
- for (int trap3X = xoff - 65; trap3X <= xoff + 65; trap3X++)
- {
- for (int trap3Y = yoff - 37; trap3Y <= yoff - 10; trap3Y++)
- {
- if ((trap3X == xoff - 54 || trap3X == xoff + 54) && trap3Y == yoff - 26)
- {
- Main.tile[trap3X, trap3Y].active = true;
- Main.tile[trap3X, trap3Y].type = 135;
- Main.tile[trap3X, trap3Y].frameX = (short)0;
- Main.tile[trap3X, trap3Y].frameY = (short)36;
- //Main.tile[trap3X, trap3Y + 1].type = 56;
- }
- if ((trap3X == xoff - 60 || trap3X == xoff + 60) && trap3Y == yoff - 26)
- {
- if (trap3X == xoff - 60)
- {
- WorldGen.PlaceTile(trap3X, trap3Y, 137, true, true, -1, 1);
- }
- else WorldGen.PlaceTile(trap3X, trap3Y, 137, true, true, -1, -1);
- }
- if (((trap3X >= xoff - 60 && trap3X <= xoff - 54) || (trap3X >= xoff + 54 && trap3X <= xoff + 60)) && trap3Y == yoff - 26)
- {
- Main.tile[trap3X, trap3Y].wire = true;
- }
- }
- }
- Main.statusText = "Generating Hellcastle: 100%";
- Main.tile[xoff - 44, yoff - 12].active = true;
- Main.tile[xoff - 44, yoff - 12].type = 4;
- Main.tile[xoff - 44, yoff - 12].frameX = (short)24;
- Main.tile[xoff - 44, yoff - 12].frameY = (short)176;
- Main.tile[xoff + 44, yoff - 12].active = true;
- Main.tile[xoff + 44, yoff - 12].type = 4;
- Main.tile[xoff + 44, yoff - 12].frameX = (short)44;
- Main.tile[xoff + 44, yoff - 12].frameY = (short)176;
- Main.tile[xoff - 62, yoff + 1].active = true;
- Main.tile[xoff - 62, yoff + 1].type = 4;
- Main.tile[xoff - 62, yoff + 1].frameX = (short)0;
- Main.tile[xoff - 62, yoff + 1].frameY = (short)176;
- Main.tile[xoff + 62, yoff + 1].active = true;
- Main.tile[xoff + 62, yoff + 1].type = 4;
- Main.tile[xoff + 62, yoff + 1].frameX = (short)0;
- Main.tile[xoff + 62, yoff + 1].frameY = (short)176;
- }