Removed unnecessary tile position variables

This commit is contained in:
Dominic committed 2022-05-20 18:22:31 -05:00
1 parent f78a985883
commit 9fa4732dd8
5 files changed
+29 -46

No files matched your search

+1 -2
View File
@@ -50,8 +50,7 @@ namespace CalamityMod
BossRushEvent.BossRushActive = false;
BossRushEvent.BossRushSpawnCountdown = 180;
BossRushEvent.HostileProjectileKillCounter = 0;
newAltarX = 0;
newAltarY = 0;
CustomTemple.NewAlterPosition = Point.Zero;
Abyss.AbyssChasmBottom = 0;
Abyss.AtLeftSideOfWorld = false;
+11 -14
View File
@@ -105,30 +105,27 @@ namespace CalamityMod.Systems
int xUnderworldGen = WorldGen.genRand.Next((int)((double)x * 0.1), (int)((double)x * 0.15));
int yUnderworldGen = Main.maxTilesY - 100;
fuhX = xUnderworldGen;
fuhY = yUnderworldGen;
MiscWorldgenRoutines.UnderworldIsland(xUnderworldGen, yUnderworldGen, 180, 201, 120, 136);
MiscWorldgenRoutines.UnderworldIsland(xUnderworldGen - 50, yUnderworldGen - 30, 100, 111, 60, 71);
MiscWorldgenRoutines.UnderworldIsland(xUnderworldGen + 50, yUnderworldGen - 30, 100, 111, 60, 71);
MiscWorldgenRoutines.ChasmGenerator(fuhX - 110, fuhY - 10, WorldGen.genRand.Next(150) + 150);
MiscWorldgenRoutines.ChasmGenerator(fuhX + 110, fuhY - 10, WorldGen.genRand.Next(150) + 150);
MiscWorldgenRoutines.ChasmGenerator(xUnderworldGen - 110, yUnderworldGen - 10, WorldGen.genRand.Next(150) + 150);
MiscWorldgenRoutines.ChasmGenerator(xUnderworldGen + 110, yUnderworldGen - 10, WorldGen.genRand.Next(150) + 150);
MiscWorldgenRoutines.UnderworldIsland(xUnderworldGen - 150, yUnderworldGen - 30, 60, 66, 35, 41);
MiscWorldgenRoutines.UnderworldIsland(xUnderworldGen + 150, yUnderworldGen - 30, 60, 66, 35, 41);
MiscWorldgenRoutines.UnderworldIsland(xUnderworldGen - 180, yUnderworldGen - 20, 60, 66, 35, 41);
MiscWorldgenRoutines.UnderworldIsland(xUnderworldGen + 180, yUnderworldGen - 20, 60, 66, 35, 41);
MiscWorldgenRoutines.UnderworldIslandHouse(fuhX, fuhY + 30, 1323);
MiscWorldgenRoutines.UnderworldIslandHouse(fuhX - 22, fuhY + 15, 1322);
MiscWorldgenRoutines.UnderworldIslandHouse(fuhX + 22, fuhY + 15, 535);
MiscWorldgenRoutines.UnderworldIslandHouse(fuhX - 50, fuhY - 30, 112);
MiscWorldgenRoutines.UnderworldIslandHouse(fuhX + 50, fuhY - 30, 906);
MiscWorldgenRoutines.UnderworldIslandHouse(fuhX - 150, fuhY - 30, 218);
MiscWorldgenRoutines.UnderworldIslandHouse(fuhX + 150, fuhY - 30, 3019);
MiscWorldgenRoutines.UnderworldIslandHouse(fuhX - 180, fuhY - 20, 274);
MiscWorldgenRoutines.UnderworldIslandHouse(fuhX + 180, fuhY - 20, 220);
MiscWorldgenRoutines.UnderworldIslandHouse(xUnderworldGen, yUnderworldGen + 30, 1323);
MiscWorldgenRoutines.UnderworldIslandHouse(xUnderworldGen - 22, yUnderworldGen + 15, 1322);
MiscWorldgenRoutines.UnderworldIslandHouse(xUnderworldGen + 22, yUnderworldGen + 15, 535);
MiscWorldgenRoutines.UnderworldIslandHouse(xUnderworldGen - 50, yUnderworldGen - 30, 112);
MiscWorldgenRoutines.UnderworldIslandHouse(xUnderworldGen + 50, yUnderworldGen - 30, 906);
MiscWorldgenRoutines.UnderworldIslandHouse(xUnderworldGen - 150, yUnderworldGen - 30, 218);
MiscWorldgenRoutines.UnderworldIslandHouse(xUnderworldGen + 150, yUnderworldGen - 30, 3019);
MiscWorldgenRoutines.UnderworldIslandHouse(xUnderworldGen - 180, yUnderworldGen - 20, 274);
MiscWorldgenRoutines.UnderworldIslandHouse(xUnderworldGen + 180, yUnderworldGen - 20, 220);
}));
#endregion
-12
View File
@@ -30,18 +30,6 @@ namespace CalamityMod.World
public static bool armageddon = false; // Armageddon Mode
public static bool malice = false; // Malice Mode
// New Temple Altar
public static int newAltarX = 0;
public static int newAltarY = 0;
// Evil Islands
public static int fehX = 0;
public static int fehY = 0;
// Brimstone Crag
public static int fuhX = 0;
public static int fuhY = 0;
// Abyss & Sulphur
public static bool rainingAcid;
public static int acidRainPoints = 0;
+16 -15
View File
@@ -7,6 +7,10 @@ namespace CalamityMod.World
{
public class CustomTemple
{
public static Point NewAlterPosition = Point.Zero;
public static Vector2 FinalRoomSize = new(105f, 95f);
public static void NewJungleTemple()
{
bool success = false;
@@ -66,8 +70,8 @@ namespace CalamityMod.World
// Final temple room size.
if (i == totalRooms - 1)
{
width = WorldGen.genRand.Next(105, 116);
height = WorldGen.genRand.Next(90, 106);
width = (int)FinalRoomSize.X;
height = (int)FinalRoomSize.Y;
roomPositionY += WorldGen.genRand.Next(6, 9);
}
@@ -90,7 +94,7 @@ namespace CalamityMod.World
{
if (rectangle.Intersects(roomBounds[j]))
isValidRoom = false;
if (WorldGen.genRand.Next(100) == 0)
if (WorldGen.genRand.NextBool(100))
{
xOffset++;
}
@@ -217,7 +221,7 @@ namespace CalamityMod.World
if (i < totalRooms - 1)
{
reachedDestination = false;
if (WorldGen.genRand.Next(3) != 0)
if (!WorldGen.genRand.NextBool(3))
{
Rectangle nextRoom = roomBounds[i + 1];
if (nextRoom.Y >= roomBounds[i].Y + roomBounds[i].Height)
@@ -461,7 +465,7 @@ namespace CalamityMod.World
if (Main.tile[randomPointInRoomX, randomPointInRoomY].WallType == 87 && !Main.tile[randomPointInRoomX, randomPointInRoomY].HasTile)
{
bool successPlacingSpikes = false;
if (WorldGen.genRand.Next(2) == 0)
if (WorldGen.genRand.NextBool(2))
{
int xMoveDirection = WorldGen.genRand.NextBool(2).ToDirectionInt();
while (!Main.tile[randomPointInRoomX, randomPointInRoomY].HasTile)
@@ -718,8 +722,7 @@ namespace CalamityMod.World
}
// And place the shrine.
CalamityWorld.newAltarX = roomCenterX - 1;
CalamityWorld.newAltarY = roomBottom - calculateHeightFromOutwardness(0) - 2;
NewAlterPosition = new(roomCenterX - 1, roomBottom - calculateHeightFromOutwardness(0) - 2);
// Place some lanterns on the top of the room.
for (int dx = 6; dx < roomBounds.Width - 6; dx += 10)
@@ -896,14 +899,12 @@ namespace CalamityMod.World
public static void NewJungleTempleLihzahrdAltar()
{
int alterPositionX = CalamityWorld.newAltarX;
int alterPositionY = CalamityWorld.newAltarY;
for (int i = 0; i <= 2; i++)
{
for (int j = 0; j < 2; j++)
{
int framedAlterPositionX = alterPositionX + i;
int framedAlterPositionY = alterPositionY + j;
int framedAlterPositionX = NewAlterPosition.X + i;
int framedAlterPositionY = NewAlterPosition.Y + j;
Main.tile[framedAlterPositionX, framedAlterPositionY].Get<TileWallWireStateData>().HasTile = true;
Main.tile[framedAlterPositionX, framedAlterPositionY].TileType = TileID.LihzahrdAltar;
Main.tile[framedAlterPositionX, framedAlterPositionY].TileFrameX = (short)(i * 18);
@@ -911,10 +912,10 @@ namespace CalamityMod.World
}
// Ensure that the tiles below the altar are active and valid.
Main.tile[i, alterPositionY + 2].Get<TileWallWireStateData>().HasTile = true;
Main.tile[i, alterPositionY + 2].Get<TileWallWireStateData>().Slope = SlopeType.Solid;
Main.tile[i, alterPositionY + 2].Get<TileWallWireStateData>().IsHalfBlock = false;
Main.tile[i, alterPositionY + 2].TileType = TileID.LihzahrdBrick;
Main.tile[i, NewAlterPosition.Y + 2].Get<TileWallWireStateData>().HasTile = true;
Main.tile[i, NewAlterPosition.Y + 2].Get<TileWallWireStateData>().Slope = SlopeType.Solid;
Main.tile[i, NewAlterPosition.Y + 2].Get<TileWallWireStateData>().IsHalfBlock = false;
Main.tile[i, NewAlterPosition.Y + 2].TileType = TileID.LihzahrdBrick;
}
}
}
+1 -3
View File
@@ -45,10 +45,8 @@ namespace CalamityMod.World
}
xIslandGen = tileXLookup;
CalamityWorld.fehX = xIslandGen;
CalamityWorld.fehY = yIslandGen;
EvilIsland(xIslandGen, yIslandGen);
EvilIslandHouse(CalamityWorld.fehX, CalamityWorld.fehY);
EvilIslandHouse(xIslandGen, yIslandGen);
}
public static void EvilIsland(int i, int j)