Removed "custom" shimmer generation because I genuinely have no clue what it's trying to accomplish
This commit is contained in:
1 parent
030f97e981
commit
cd604d330c
2 files changed
-84
No files matched your search
@@ -45,17 +45,6 @@ namespace CalamityMod.Systems
|
||||
});
|
||||
}
|
||||
|
||||
// Replace the shimmer gen to make it place sanely
|
||||
int shimmerIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shimmer"));
|
||||
if (shimmerIndex != -1)
|
||||
{
|
||||
tasks[shimmerIndex] = new PassLegacy("Shimmer", (progress, config) =>
|
||||
{
|
||||
progress.Message = Language.GetOrRegister("Mods.CalamityMod.UI.BetterShimmer").Value;
|
||||
CustomShimmer.NewShimmer();
|
||||
});
|
||||
}
|
||||
|
||||
// Better Underworld structures after the world has been smoothed
|
||||
int underworldStructuresIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Smooth World"));
|
||||
if (underworldStructuresIndex != -1)
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using ReLogic.Utilities;
|
||||
using Terraria;
|
||||
using Terraria.WorldBuilding;
|
||||
|
||||
namespace CalamityMod.World
|
||||
{
|
||||
public class CustomShimmer
|
||||
{
|
||||
public static void NewShimmer()
|
||||
{
|
||||
// Large = 4, Medium = 3, Small = 2
|
||||
int worldSize = (int)(Main.maxTilesX / 4200f * 2f);
|
||||
int minOffsetX = 240;
|
||||
int maxOffsetX;
|
||||
switch (worldSize)
|
||||
{
|
||||
default:
|
||||
case 2:
|
||||
maxOffsetX = 300;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
maxOffsetX = 360;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
maxOffsetX = 420;
|
||||
break;
|
||||
}
|
||||
|
||||
int offset = 50;
|
||||
int shimmerMinDepth = (int)((Main.worldSurface + Main.rockLayer) * 0.5) + offset;
|
||||
int shimmerMaxDepth = (int)(((double)((Main.maxTilesY - 250) * 2) + Main.rockLayer) * 0.33);
|
||||
shimmerMaxDepth = (int)MathHelper.Clamp(shimmerMaxDepth, shimmerMinDepth + 50, Main.maxTilesY - 460);
|
||||
|
||||
int shimmerPositionY = WorldGen.genRand.Next(shimmerMinDepth, shimmerMaxDepth);
|
||||
int shimmerPositionX = ((GenVars.dungeonSide < 0) ? WorldGen.genRand.Next(Main.maxTilesX - maxOffsetX, Main.maxTilesX - minOffsetX) : WorldGen.genRand.Next(minOffsetX, maxOffsetX));
|
||||
int remixSeedShimmerMinDepth = (int)Main.worldSurface + 150;
|
||||
int remixSeedShimmerMaxDepth = (int)((Main.rockLayer + Main.worldSurface + 200D) * 0.5);
|
||||
if (remixSeedShimmerMaxDepth <= remixSeedShimmerMinDepth)
|
||||
remixSeedShimmerMaxDepth = remixSeedShimmerMinDepth + 50;
|
||||
|
||||
if (WorldGen.tenthAnniversaryWorldGen)
|
||||
shimmerPositionY = WorldGen.genRand.Next(remixSeedShimmerMinDepth, remixSeedShimmerMaxDepth);
|
||||
|
||||
int attempts = 0;
|
||||
while (!WorldGen.ShimmerMakeBiome(shimmerPositionX, shimmerPositionY))
|
||||
{
|
||||
attempts++;
|
||||
if (WorldGen.tenthAnniversaryWorldGen && attempts < 10000)
|
||||
{
|
||||
shimmerPositionY = WorldGen.genRand.Next(remixSeedShimmerMinDepth, remixSeedShimmerMaxDepth);
|
||||
shimmerPositionX = ((GenVars.dungeonSide < 0) ? WorldGen.genRand.Next(Main.maxTilesX - maxOffsetX, Main.maxTilesX - minOffsetX) : WorldGen.genRand.Next(minOffsetX, maxOffsetX));
|
||||
}
|
||||
else if (attempts > 20000)
|
||||
{
|
||||
shimmerPositionY = WorldGen.genRand.Next((int)Main.worldSurface + 120, shimmerMaxDepth);
|
||||
shimmerPositionX = ((GenVars.dungeonSide < 0) ? WorldGen.genRand.Next(Main.maxTilesX - maxOffsetX * 2, Main.maxTilesX - minOffsetX) : WorldGen.genRand.Next(minOffsetX, maxOffsetX * 2));
|
||||
}
|
||||
else
|
||||
{
|
||||
shimmerPositionY = WorldGen.genRand.Next((int)((Main.worldSurface + Main.rockLayer) * 0.5) + 20, shimmerMaxDepth);
|
||||
shimmerPositionX = ((GenVars.dungeonSide < 0) ? WorldGen.genRand.Next(Main.maxTilesX - maxOffsetX, Main.maxTilesX - minOffsetX) : WorldGen.genRand.Next(minOffsetX, maxOffsetX));
|
||||
}
|
||||
}
|
||||
|
||||
GenVars.shimmerPosition = new Vector2D(shimmerPositionX, shimmerPositionY);
|
||||
int genArea = 200;
|
||||
GenVars.structures.AddProtectedStructure(new Rectangle(shimmerPositionX - (int)(genArea * 0.5f), shimmerPositionY - (int)(genArea * 0.5f), genArea, genArea));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user