public static void StructureGen(int xPosO, int yPosO, bool mirrored) { /** * 0 = Do Nothing * 1 = Locker * 2 = Platinum Brick - 177 * 3 = Smooth Marble - 357 * 4 = * 5 = * 6 = Platinum brick wall - 47 * 7 = Martian conduit wall - 176 * 8 = Luminite Wall - 224 * 9 = Kill tile **/ for (int i = 0; i < StructureArray.GetLength(1); i++) { for (int j = 0; j < StructureArray.GetLength(0); j++) { if (mirrored) { if (TileCheckSafe((int)(xPosO + StructureArray.GetLength(1) - i), (int)(yPosO + j))) { if (StructureArray[j, i] == 1) // Locker { MyWorld.PlaceLabLocker(xPosO + StructureArray.GetLength(1) - i - 1, yPosO + j, 177); WorldGen.KillWall(xPosO + StructureArray.GetLength(1) - i, yPosO + j); WorldGen.PlaceWall(xPosO + StructureArray.GetLength(1) - i, yPosO + j, WallID.PlatinumBrick, true); } if (StructureArray[j, i] == 2) // Platinum Brick { WorldGen.KillTile(xPosO + StructureArray.GetLength(1) - i, yPosO + j); WorldGen.PlaceTile(xPosO + StructureArray.GetLength(1) - i, yPosO + j, TileID.PlatinumBrick, true, true); } if (StructureArray[j, i] == 3) // Marble Block { WorldGen.KillTile(xPosO + StructureArray.GetLength(1) - i, yPosO + j); WorldGen.PlaceTile(xPosO + StructureArray.GetLength(1) - i, yPosO + j, TileID.MarbleBlock, true, true, -1, 13); } if (StructureArray[j, i] == 4) // platform { } if (StructureArray[j, i] == 5) // Drive { } if (StructureArray[j, i] == 6) // Platinum Brick Wall { WorldGen.KillTile(xPosO + StructureArray.GetLength(1) - i, yPosO + j); Main.tile[xPosO + StructureArray.GetLength(1) - i, yPosO + j].liquid = 0; WorldGen.KillWall(xPosO + StructureArray.GetLength(1) - i, yPosO + j); WorldGen.PlaceWall(xPosO + StructureArray.GetLength(1) - i, yPosO + j, WallID.PlatinumBrick, true); } if (StructureArray[j, i] == 7) // martian wall { WorldGen.KillTile(xPosO + StructureArray.GetLength(1) - i, yPosO + j); Main.tile[xPosO + StructureArray.GetLength(1) - i, yPosO + j].liquid = 0; WorldGen.KillWall(xPosO + StructureArray.GetLength(1) - i, yPosO + j); WorldGen.PlaceWall(xPosO + StructureArray.GetLength(1) - i, yPosO + j, WallID.MartianConduit, true); } if (StructureArray[j, i] == 8) // luminite wall { WorldGen.KillTile(xPosO + StructureArray.GetLength(1) - i, yPosO + j); Main.tile[xPosO + StructureArray.GetLength(1) - i, yPosO + j].liquid = 0; WorldGen.KillWall(xPosO + StructureArray.GetLength(1) - i, yPosO + j); WorldGen.PlaceWall(xPosO + StructureArray.GetLength(1) - i, yPosO + j, WallID.LunarBrickWall, true); } if (StructureArray[j, i] == 9) // destroy everything >:) { Main.tile[xPosO + StructureArray.GetLength(1) - i, yPosO + j].liquid = 0; WorldGen.KillTile(xPosO + StructureArray.GetLength(1) - i, yPosO + j); } } } else { if (TileCheckSafe((int)(xPosO + i), (int)(yPosO + j))) { if (StructureArray[j, i] == 1) { MyWorld.PlaceLabLocker(xPosO + i, yPosO + j, 177); WorldGen.KillWall(xPosO + i, yPosO + j); WorldGen.PlaceWall(xPosO + i, yPosO + j, WallID.PlatinumBrick, true); } if (StructureArray[j, i] == 2) { WorldGen.KillTile(xPosO + i, yPosO + j); WorldGen.PlaceTile(xPosO + i, yPosO + j, TileID.PlatinumBrick, true, true); } if (StructureArray[j, i] == 3) { WorldGen.KillTile(xPosO + i, yPosO + j); WorldGen.PlaceTile(xPosO + i, yPosO + j, TileID.MarbleBlock, true, true); } if (StructureArray[j, i] == 4) { } if (StructureArray[j, i] == 5) { } if (StructureArray[j, i] == 6) { WorldGen.KillTile(xPosO + i, yPosO + j); Main.tile[xPosO + i, yPosO + j].liquid = 0; WorldGen.KillWall(xPosO + i, yPosO + j); WorldGen.PlaceWall(xPosO + i, yPosO + j, WallID.PlatinumBrick, true); } if (StructureArray[j, i] == 7) { WorldGen.KillTile(xPosO + i, yPosO + j); Main.tile[xPosO + i, yPosO + j].liquid = 0; WorldGen.KillWall(xPosO + i, yPosO + j); WorldGen.PlaceWall(xPosO + i, yPosO + j, WallID.MartianConduit, true); } if (StructureArray[j, i] == 8) { WorldGen.KillTile(xPosO + i, yPosO + j); Main.tile[xPosO + i, yPosO + j].liquid = 0; WorldGen.KillWall(xPosO + i, yPosO + j); WorldGen.PlaceWall(xPosO + i, yPosO + j, WallID.LunarBrickWall, true); } if (StructureArray[j, i] == 9) { Main.tile[xPosO + i, yPosO + j].liquid = 0; WorldGen.KillTile(xPosO + i, yPosO + j); } } } } } }
public static void FurnitureGen(int xPosO, int yPosO, bool mirrored) { /** * 0 = Do Nothing * 1 = Desk, Drive & Computer * 2 = Office Chair * 3 = Lab Light * 4 = Door * 5 = Locker * 6 = Bench & Crystal * 7 = Dead Scientist * 9 = Kill Tile **/ for (int i = 0; i < FurnitureArray.GetLength(1); i++) { for (int j = 0; j < FurnitureArray.GetLength(0); j++) { if (mirrored) { if (TileCheckSafe((int)(xPosO + FurnitureArray.GetLength(1) - i), (int)(yPosO + j))) { if (FurnitureArray[j, i] == 1) // Desk { // origin in bottom middle WorldGen.Place3x2(xPosO + FurnitureArray.GetLength(1) - i, yPosO + j, (ushort)ElementsAwoken.instance.TileType("Desk"), 1); WorldGen.PlaceObject(xPosO + FurnitureArray.GetLength(1) - i + 1, yPosO + j - 2, (ushort)ElementsAwoken.instance.TileType("Computer"), false, 0, 1, -1, 0); WorldGen.PlaceObject(xPosO + FurnitureArray.GetLength(1) - i - 1, yPosO + j - 2, ElementsAwoken.instance.TileType("AncientsDrive"), false, 0); } if (FurnitureArray[j, i] == 2) // Chair { // origin in bottom right WorldGen.PlaceObject(xPosO + FurnitureArray.GetLength(1) - i + 1, yPosO + j, (ushort)ElementsAwoken.instance.TileType("OfficeChair"), false, 0, 1, -1, 1); } if (FurnitureArray[j, i] == 3) // Lab Light { WorldGen.PlaceObject(xPosO + FurnitureArray.GetLength(1) - i, yPosO + j, ElementsAwoken.instance.TileType("LabLight"), false, 0); } if (FurnitureArray[j, i] == 4) // Door { WorldGen.PlaceDoor(xPosO + FurnitureArray.GetLength(1) - i, yPosO + j, 10, 20); } if (FurnitureArray[j, i] == 5) // Locker { MyWorld.PlaceLabLocker(xPosO + FurnitureArray.GetLength(1) - i - 1, yPosO + j, 177); } if (FurnitureArray[j, i] == 6) // Desk { // origin in bottom middle WorldGen.Place4x2(xPosO + FurnitureArray.GetLength(1) - i - 1, yPosO + j, (ushort)ElementsAwoken.instance.TileType("LabBench")); WorldGen.PlaceObject(xPosO + FurnitureArray.GetLength(1) - i, yPosO + j - 2, (ushort)ElementsAwoken.instance.TileType("CrystalContainer"), false, 0, 1, -1, 0); } if (FurnitureArray[j, i] == 7) // Scientist { // origin on left WorldGen.PlaceObject(xPosO + FurnitureArray.GetLength(1) - i - 2, yPosO + j, ElementsAwoken.instance.TileType("DeadScientist"), false, 0, 1, -1, 1); } if (FurnitureArray[j, i] == 9) // destroy everything >:) { Main.tile[xPosO + FurnitureArray.GetLength(1) - i, yPosO + j].liquid = 0; WorldGen.KillTile(xPosO + FurnitureArray.GetLength(1) - i, yPosO + j); } } } else { if (TileCheckSafe((int)(xPosO + i), (int)(yPosO + j))) { if (FurnitureArray[j, i] == 1) // Desk { WorldGen.Place3x2(xPosO + i, yPosO + j, (ushort)ElementsAwoken.instance.TileType("Desk"), 0); WorldGen.PlaceObject(xPosO + i, yPosO + j - 2, (ushort)ElementsAwoken.instance.TileType("Computer"), false, 0, 1, -1, 1); WorldGen.PlaceObject(xPosO + i + 1, yPosO + j - 2, ElementsAwoken.instance.TileType("AncientsDrive"), false, 0); } if (FurnitureArray[j, i] == 2) // Chair { WorldGen.PlaceObject(xPosO + i, yPosO + j, (ushort)ElementsAwoken.instance.TileType("OfficeChair"), false, 0, 1, -1, 0); } if (FurnitureArray[j, i] == 3) // Lab Light { WorldGen.PlaceObject(xPosO + i, yPosO + j, ElementsAwoken.instance.TileType("LabLight"), false, 0); } if (FurnitureArray[j, i] == 4) // Door { WorldGen.PlaceDoor(xPosO + i, yPosO + j, 10, 20); } if (FurnitureArray[j, i] == 5) // Locker { MyWorld.PlaceLabLocker(xPosO + i, yPosO + j, 177); } if (FurnitureArray[j, i] == 6) // Desk { WorldGen.Place4x2(xPosO + i, yPosO + j, (ushort)ElementsAwoken.instance.TileType("LabBench")); WorldGen.PlaceObject(xPosO + i + 1, yPosO + j - 2, (ushort)ElementsAwoken.instance.TileType("CrystalContainer"), false, 0, 1, -1, 0); } if (FurnitureArray[j, i] == 7) // Scientist { WorldGen.PlaceObject(xPosO + i, yPosO + j, ElementsAwoken.instance.TileType("DeadScientist"), false, 0, 1, -1, 0); } if (FurnitureArray[j, i] == 9) { Main.tile[xPosO + i, yPosO + j].liquid = 0; WorldGen.KillTile(xPosO + i, yPosO + j); } } } } } }