diff --git a/Systems/World/WorldgenManagementSystem.cs b/Systems/World/WorldgenManagementSystem.cs index 58ff723779..5ba9c9c0fe 100644 --- a/Systems/World/WorldgenManagementSystem.cs +++ b/Systems/World/WorldgenManagementSystem.cs @@ -173,14 +173,14 @@ namespace CalamityMod.Systems }; // place each piece of the sunken sea based on the above positons - SunkenSea.PlaceRadiantReefs(sunkenSeaX - 100, sunkenSeaY + 75, true); - SunkenSea.PlaceRadiantReefs(sunkenSeaX + 100, sunkenSeaY + 75, false); - SunkenSea.PlacePolypForest(sunkenSeaX, sunkenSeaY + 500); SunkenSea.PlaceBasaltGully(sunkenSeaX, sunkenSeaY + (Main.maxTilesY / 4)); + SunkenSea.PlaceRadiantReefs(sunkenSeaX, sunkenSeaY + 110); + SunkenSea.PlacePolypForest(sunkenSeaX, sunkenSeaY + 500); SunkenSea.PlaceGleamingBurrows(sunkenSeaX, sunkenSeaY + (Main.maxTilesY / 4) - 50); - SunkenSea.PlaceSunkenSeaAmbience(); - SunkenSea.BasaltGullyLavaCleanup(sunkenSeaX, sunkenSeaY + (Main.maxTilesY / 4)); + SunkenSea.PlaceClamDen(sunkenSeaX, sunkenSeaY + 615); SunkenSea.PlaceTimelessShores(sunkenSeaX, sunkenSeaY); + SunkenSea.BasaltGullyLavaCleanup(sunkenSeaX, sunkenSeaY + (Main.maxTilesY / 4)); + SunkenSea.PlaceSunkenSeaAmbience(); })); } diff --git a/Tiles/Abyss/AbyssGravel.cs b/Tiles/Abyss/AbyssGravel.cs index 061e29abef..dd8637b770 100644 --- a/Tiles/Abyss/AbyssGravel.cs +++ b/Tiles/Abyss/AbyssGravel.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Tiles.Abyss CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithAbyss(Type); - AddMapEntry(new Color(25, 28, 54)); + AddMapEntry(new Color(30, 37, 56)); MineResist = 5f; MinPick = 65; HitSound = MineSound; diff --git a/Tiles/Abyss/PyreMantle.cs b/Tiles/Abyss/PyreMantle.cs index 698c1b4422..dd28414b3d 100644 --- a/Tiles/Abyss/PyreMantle.cs +++ b/Tiles/Abyss/PyreMantle.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Tiles.Abyss HitSound = MineSound; MineResist = 10f; MinPick = 180; - AddMapEntry(new Color(43, 40, 40)); + AddMapEntry(new Color(31, 31, 37)); this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); diff --git a/Tiles/Abyss/SulphurousVines.cs b/Tiles/Abyss/SulphurousVines.cs index 58306e6d98..4fafd704ff 100644 --- a/Tiles/Abyss/SulphurousVines.cs +++ b/Tiles/Abyss/SulphurousVines.cs @@ -17,11 +17,11 @@ namespace CalamityMod.Tiles.Abyss { Main.tileLighted[Type] = true; Main.tileCut[Type] = true; - Main.tileBlockLight[Type] = true; + Main.tileBlockLight[Type] = false; Main.tileLavaDeath[Type] = true; Main.tileNoFail[Type] = true; Main.tileNoSunLight[Type] = false; - AddMapEntry(new Color(0, 50, 0)); + AddMapEntry(new Color(54, 99, 100)); HitSound = SoundID.Grass; DustType = 2; TileID.Sets.IsVine[Type] = true; @@ -88,7 +88,7 @@ namespace CalamityMod.Tiles.Abyss } // Ozzatron 01JUL2022: heavily refactored this code to not suck. also, sulphurous vines won't grow in honey anymore. - private const int MaxVineHeight = 10; + private const int MaxVineHeight = 15; public override void RandomUpdate(int i, int j) { diff --git a/Tiles/Abyss/ViperVines.cs b/Tiles/Abyss/ViperVines.cs index 232125a4e6..3ae814aa03 100644 --- a/Tiles/Abyss/ViperVines.cs +++ b/Tiles/Abyss/ViperVines.cs @@ -17,6 +17,10 @@ namespace CalamityMod.Tiles.Abyss Main.tileBlockLight[Type] = true; Main.tileLavaDeath[Type] = true; Main.tileNoFail[Type] = true; + TileID.Sets.IsVine[Type] = true; + TileID.Sets.ReplaceTileBreakDown[Type] = true; + TileID.Sets.VineThreads[Type] = true; + TileID.Sets.DrawFlipMode[Type] = 1; TileMaterials.SetForTileId(Type, TileMaterials._materialsByName["Plant"]); AddMapEntry(new Color(0, 50, 0)); HitSound = SoundID.Grass; @@ -36,15 +40,14 @@ namespace CalamityMod.Tiles.Abyss public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - if (WorldGen.loadSuccess) + Tile tileAbove = Framing.GetTileSafely(i, j - 1); + + if (!tileAbove.HasTile) { - Tile tileAbove = Framing.GetTileSafely(i, j - 1); - if (!tileAbove.HasTile) - { - WorldGen.KillTile(i, j); - return true; - } + WorldGen.KillTile(i, j); + return true; } + return true; } @@ -67,7 +70,7 @@ namespace CalamityMod.Tiles.Abyss } } } - + private const int MaxVineHeight = 20; public override void RandomUpdate(int i, int j) { Tile tileBelow = Framing.GetTileSafely(i, j + 1); diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 366e7f1672..a52b059417 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -26,6 +26,8 @@ namespace CalamityMod.Tiles public static List GrowthTiles = new List() { ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), ModContent.TileType(), ModContent.TileType(), ModContent.TileType(), diff --git a/Tiles/Ores/ScoriaOre.cs b/Tiles/Ores/ScoriaOre.cs index d29d32726f..66f4d09ea4 100644 --- a/Tiles/Ores/ScoriaOre.cs +++ b/Tiles/Ores/ScoriaOre.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Tiles.Ores TileID.Sets.Ore[Type] = true; DustType = 105; - AddMapEntry(new Color(210, 101, 28), CreateMapEntryName()); + AddMapEntry(new Color(167, 80, 22), CreateMapEntryName()); MineResist = 3f; MinPick = 210; HitSound = SoundID.Tink; diff --git a/Tiles/SunkenSea/Ambient/RefractiveHangingCoral.cs b/Tiles/SunkenSea/Ambient/RefractiveHangingCoral.cs index ff066253d7..11c643f6f0 100644 --- a/Tiles/SunkenSea/Ambient/RefractiveHangingCoral.cs +++ b/Tiles/SunkenSea/Ambient/RefractiveHangingCoral.cs @@ -3,6 +3,7 @@ using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; namespace CalamityMod.Tiles.SunkenSea.Ambient @@ -15,7 +16,8 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient Main.tileSolid[Type] = false; Main.tileNoFail[Type] = true; Main.tileNoAttach[Type] = true; - TileID.Sets.IsVine[Type] = true; + Main.tileNoSunLight[Type] = false; + TileID.Sets.IsVine[Type] = true; TileID.Sets.VineThreads[Type] = true; AddMapEntry(new Color(48, 98, 192)); DustType = DustID.Grass; @@ -50,17 +52,8 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient } public override void NearbyEffects(int i, int j, bool closer) { - // Baby blue - if (closer && Main.rand.NextBool(1200)) - { - Dust dust; - dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, DustID.Firefly, 0.23255825f, 10f, 0, new Color(106, 154, 238), 1.5f)]; - dust.noGravity = true; - dust.noLight = true; - dust.fadeIn = 2.5813954f; - } // Light Cyan - if (closer && Main.rand.NextBool(1200)) + if (closer && Main.rand.NextBool(600)) { Dust dust; dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, DustID.Firefly, 0.23255825f, 10f, 0, new Color(136, 206, 215), 1.7f)]; @@ -68,17 +61,8 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient dust.noLight = true; dust.fadeIn = 2.5813954f; } - //Mint Green - if (closer && Main.rand.NextBool(1200)) - { - Dust dust; - dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, DustID.Firefly, 0.23255825f, 10f, 0, new Color(163, 252, 195), 1.4f)]; - dust.noGravity = true; - dust.noLight = true; - dust.fadeIn = 2.5813954f; - } //Lilac - if (closer && Main.rand.NextBool(1200)) + if (closer && Main.rand.NextBool(600)) { Dust dust; dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, DustID.Firefly, 0.23255825f, 10f, 0, new Color(236, 194, 252), 1.6f)]; @@ -86,15 +70,23 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient dust.noLight = true; dust.fadeIn = 2.5813954f; } - //Dim Lilac - if (closer && Main.rand.NextBool(1200)) - { - Dust dust; - dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, DustID.Firefly, 0.23255825f, 10f, 0, new Color(192, 170, 233), 1.3f)]; - dust.noGravity = true; - dust.noLight = true; - dust.fadeIn = 2.5813954f; - } + } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + float brightness = 0.9f; + brightness += 0.6f; + brightness = MathHelper.Clamp(brightness, 0.5f, 0.9f); + brightness *= (float)MathF.Sin(-j / 40f + Main.GameUpdateCount * 0.01f + i); + Color lilac = new Color(236, 194, 252); + Color mint = new Color(163, 252, 195); + Color value = Color.Lerp(lilac, mint, (MathF.Sin(j / 30f + Main.GameUpdateCount * 0.017f + -i / 40f) + 1f) / 2f); + Color value1 = Color.Lerp(lilac, mint, (MathF.Sin((-j - 100) / 40f + Main.GameUpdateCount * 0.014f + i / 20f) + 1f) / 2f); + r = (value.R + value1.R) / 300f; + g = (value.G + value1.G) / 300f; + b = (value.B + value1.B) / 300f; + r *= brightness; + g *= brightness; + b *= brightness; } public override void RandomUpdate(int i, int j) diff --git a/Walls/AbyssGravelWall.cs b/Walls/AbyssGravelWall.cs index 44e781e3a0..8e1f72b956 100644 --- a/Walls/AbyssGravelWall.cs +++ b/Walls/AbyssGravelWall.cs @@ -5,12 +5,14 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class AbyssGravelWall : ModWall + public class AbyssGravelWall : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } public override void SetStaticDefaults() { DustType = 33; AddMapEntry(new Color(6, 10, 54)); + this.AddMapEntryWithWaterVisibility(new Color(21, 47, 111)); } public override void RandomUpdate(int i, int j) diff --git a/Walls/AbyssGravelWallSafe.cs b/Walls/AbyssGravelWallSafe.cs index 47910b7661..bf7d3415d2 100644 --- a/Walls/AbyssGravelWallSafe.cs +++ b/Walls/AbyssGravelWallSafe.cs @@ -4,13 +4,15 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class AbyssGravelWallSafe : ModWall + public class AbyssGravelWallSafe : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } public override string Texture => "CalamityMod/Walls/AbyssGravelWall"; public override void SetStaticDefaults() { Main.wallHouse[Type] = true; AddMapEntry(new Color(6, 10, 54)); + this.AddMapEntryWithWaterVisibility(new Color(21, 47, 111)); DustType = 33; } diff --git a/Walls/HardenedSulphurousSandstoneWall.cs b/Walls/HardenedSulphurousSandstoneWall.cs index 78794f7b6e..7fe58c245e 100644 --- a/Walls/HardenedSulphurousSandstoneWall.cs +++ b/Walls/HardenedSulphurousSandstoneWall.cs @@ -4,13 +4,15 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class HardenedSulphurousSandstoneWall : ModWall + public class HardenedSulphurousSandstoneWall : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } public override void SetStaticDefaults() { Main.wallHouse[Type] = true; DustType = 32; AddMapEntry(new Color(62, 50, 39)); + this.AddMapEntryWithWaterVisibility(new Color(49, 66, 133)); } public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; diff --git a/Walls/PlantyMushWall.cs b/Walls/PlantyMushWall.cs index 9fb3f4b25d..6cefea3d62 100644 --- a/Walls/PlantyMushWall.cs +++ b/Walls/PlantyMushWall.cs @@ -8,8 +8,9 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class PlantyMushWall : ModWall + public class PlantyMushWall : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } public static Asset leafTexture = null; public static Vector2 TileAdj => (Lighting.Mode == Terraria.Graphics.Light.LightMode.Retro || Lighting.Mode == Terraria.Graphics.Light.LightMode.Trippy) ? Vector2.Zero : Vector2.One * 12; @@ -22,6 +23,7 @@ namespace CalamityMod.Walls { DustType = DustID.Grass; AddMapEntry(new Color(54, 72, 9)); + this.AddMapEntryWithWaterVisibility(new Color(37, 59, 69)); if (!Main.dedServ) { leafTexture = ModContent.Request("CalamityMod/Walls/PlantyMushWallLeaves"); diff --git a/Walls/PyreMantleWall.cs b/Walls/PyreMantleWall.cs index 444c1ce81d..627fa50e57 100644 --- a/Walls/PyreMantleWall.cs +++ b/Walls/PyreMantleWall.cs @@ -5,12 +5,14 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class PyreMantleWall : ModWall + public class PyreMantleWall : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } public override void SetStaticDefaults() { DustType = 33; AddMapEntry(new Color(33, 30, 30)); + this.AddMapEntryWithWaterVisibility(new Color(16, 35, 82)); } public override void RandomUpdate(int i, int j) diff --git a/Walls/PyreMantleWallSafe.cs b/Walls/PyreMantleWallSafe.cs index 59dc08ee04..dd7c814a25 100644 --- a/Walls/PyreMantleWallSafe.cs +++ b/Walls/PyreMantleWallSafe.cs @@ -4,8 +4,9 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class PyreMantleWallSafe : ModWall + public class PyreMantleWallSafe : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } public override string Texture => "CalamityMod/Walls/PyreMantleWall"; public override void SetStaticDefaults() @@ -13,6 +14,7 @@ namespace CalamityMod.Walls DustType = 33; Main.wallHouse[Type] = true; AddMapEntry(new Color(33, 30, 30)); + this.AddMapEntryWithWaterVisibility(new Color(16, 35, 82)); } public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; diff --git a/Walls/SulphurousSandWall.cs b/Walls/SulphurousSandWall.cs index 4ea9b6bf5e..57c41ca71f 100644 --- a/Walls/SulphurousSandWall.cs +++ b/Walls/SulphurousSandWall.cs @@ -5,12 +5,14 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class SulphurousSandWall : ModWall + public class SulphurousSandWall : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } public override void SetStaticDefaults() { DustType = 32; AddMapEntry(new Color(84, 71, 46)); + this.AddMapEntryWithWaterVisibility(new Color(59, 69, 121)); } public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; diff --git a/Walls/SulphurousSandWallSafe.cs b/Walls/SulphurousSandWallSafe.cs index e757dc2851..e2d950de00 100644 --- a/Walls/SulphurousSandWallSafe.cs +++ b/Walls/SulphurousSandWallSafe.cs @@ -4,14 +4,16 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class SulphurousSandWallSafe : ModWall + public class SulphurousSandWallSafe : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } public override string Texture => "CalamityMod/Walls/SulphurousSandWall"; public override void SetStaticDefaults() { Main.wallHouse[Type] = true; DustType = 32; AddMapEntry(new Color(84, 71, 46)); + this.AddMapEntryWithWaterVisibility(new Color(59, 69, 121)); } public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; diff --git a/Walls/SulphurousSandstoneWall.cs b/Walls/SulphurousSandstoneWall.cs index 24b9f1da62..1c8a801be3 100644 --- a/Walls/SulphurousSandstoneWall.cs +++ b/Walls/SulphurousSandstoneWall.cs @@ -5,12 +5,14 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class SulphurousSandstoneWall : ModWall + public class SulphurousSandstoneWall : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } public override void SetStaticDefaults() { DustType = 32; AddMapEntry(new Color(57, 45, 38)); + this.AddMapEntryWithWaterVisibility(new Color(45, 60, 120)); } public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; diff --git a/Walls/SulphurousShaleWall.cs b/Walls/SulphurousShaleWall.cs index a7a9c9e46d..2bf5adfba8 100644 --- a/Walls/SulphurousShaleWall.cs +++ b/Walls/SulphurousShaleWall.cs @@ -5,12 +5,14 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class SulphurousShaleWall : ModWall + public class SulphurousShaleWall : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } public override void SetStaticDefaults() { DustType = 32; AddMapEntry(new Color(59, 40, 63)); + this.AddMapEntryWithWaterVisibility(new (44, 62, 125)); } public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; diff --git a/Walls/SulphurousShaleWallSafe.cs b/Walls/SulphurousShaleWallSafe.cs index d0e37e5a12..487d8c5f9c 100644 --- a/Walls/SulphurousShaleWallSafe.cs +++ b/Walls/SulphurousShaleWallSafe.cs @@ -4,14 +4,16 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class SulphurousShaleWallSafe : ModWall + public class SulphurousShaleWallSafe : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } public override string Texture => "CalamityMod/Walls/SulphurousShaleWall"; public override void SetStaticDefaults() { Main.wallHouse[Type] = true; DustType = 32; AddMapEntry(new Color(59, 40, 63)); + this.AddMapEntryWithWaterVisibility(new Color(44, 62, 125)); } public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; diff --git a/Walls/VoidstoneWall.cs b/Walls/VoidstoneWall.cs index a239873c54..753c199c1a 100644 --- a/Walls/VoidstoneWall.cs +++ b/Walls/VoidstoneWall.cs @@ -9,8 +9,9 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class VoidstoneWall : ModWall + public class VoidstoneWall : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } internal static FramedMaskTexture GlowMask; public override void SetStaticDefaults() @@ -19,6 +20,7 @@ namespace CalamityMod.Walls Main.wallHouse[Type] = true; AddMapEntry(new Color(0, 0, 0)); + this.AddMapEntryWithWaterVisibility(new Color(11, 28, 67)); } public override void Unload() diff --git a/Walls/VoidstoneWallUnsafe.cs b/Walls/VoidstoneWallUnsafe.cs index 6469477f7c..26ea82eb9a 100644 --- a/Walls/VoidstoneWallUnsafe.cs +++ b/Walls/VoidstoneWallUnsafe.cs @@ -9,8 +9,9 @@ using Terraria.ModLoader; namespace CalamityMod.Walls { - public class VoidstoneWallUnsafe : ModWall + public class VoidstoneWallUnsafe : ModWall, IVisibleThroughWater { + int IVisibleThroughWater.WaterMapEntry { get; set; } internal static FramedMaskTexture GlowMask; public override string Texture => "CalamityMod/Walls/VoidstoneWall"; @@ -22,6 +23,7 @@ namespace CalamityMod.Walls DustType = 187; AddMapEntry(new Color(0, 0, 0)); + this.AddMapEntryWithWaterVisibility(new Color(11, 28, 67)); } public override void Unload() diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index e315f8fc49..1a3ec05a6c 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -267,48 +267,6 @@ namespace CalamityMod.World }); - //Makes a hole into the actual Sunken Sea at the bottom - left and bottom-right of the middle platform of the Timeless Shores. - - - ForLoop.Invoke(startPosX - furthestDistanceFromCenter, startPosX - shortestDistanceFromCenter, 1, (holeX) => - { - for (int holeY = startPosY + holeStart; holeY <= startPosY + holeDepth; holeY += 1) - { - ShapeData circle = new ShapeData(); - GenAction blotchFilter = new Modifiers.Blotches(6, 1.9); - - //WorldUtils.Gen(new Point(holeX, holeY), new Shapes.Circle(2, 3), Actions.Chain(new GenAction[] - //{ - // blotchFilter.Output(circle), // Applies a blotch filter to the rectangle. - //})); - - WorldUtils.Gen(new Point(holeX / 2, holeY / 2), new Shapes.Circle(2, 3), Actions.Chain(new GenAction[] - { - new Actions.ClearTile(), // The shape removes tiles. - new Actions.SetLiquid() // The shape adds liquid (Default to max water). - })); - } - }); - ForLoop.Invoke(startPosX - furthestDistanceFromCenter, startPosX + furthestDistanceFromCenter, 1, (holeX) => - { - for (int holeY = startPosY + holeStart; holeY <= startPosY + holeDepth; holeY += 1) - { - ShapeData circle = new ShapeData(); - GenAction blotchFilter = new Modifiers.Blotches(6, 1.9); - - //WorldUtils.Gen(new Point(holeX, holeY), new Shapes.Circle(2, 3), Actions.Chain(new GenAction[] - //{ - // blotchFilter.Output(circle), // Applies a blotch filter to the rectangle. - //})); - - WorldUtils.Gen(new Point(holeX / 2, holeY / 2), new Shapes.Circle(2, 3), Actions.Chain(new GenAction[] - { - new Actions.ClearTile(), // The shape removes tiles. - new Actions.SetLiquid() // The shape adds liquid (Default to max water). - })); - } - }); - //place water below the clear barrier for the islands so that theres water inbetween them ForLoop.Invoke(startPosX - biomeSize + 35, startPosX + biomeSize - 35, 1, (WaterX) => { @@ -353,16 +311,16 @@ namespace CalamityMod.World // Makes the transition area to the Timeless Shores. // Replaces tiles, walls, and places some water spots. // - ForLoop.Invoke(startPosX - biomeSize - 25, startPosX + biomeSize + 25, 20, (x) => + ForLoop.Invoke(startPosX - biomeSize - 30, startPosX + biomeSize + 30, 20, (x) => { int curveDepth = (int)MathHelper.Lerp( totalCuveDepth, 0f, - MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, x, true))); + MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 25, startPosX + biomeSize - 200, x, true))); int curveDepth2 = (int)MathHelper.Lerp( totalCuveDepth, 0f, - MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 17, startPosX - biomeSize + 200, x, true))); + MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 25, startPosX - biomeSize + 200, x, true))); for (int y = startPosY - 5; y >= startPosY - 149; y -= 15) { float interpolator = Utils.GetLerpValue(startPosY - 90, startPosY - 150, y, true); @@ -454,26 +412,26 @@ namespace CalamityMod.World WorldGen.KillTile(X, Y); } //Timeless Shores ambiant tiles - if (Main.tile[X, Y].TileType == ModContent.TileType()) - { - //Driftwood Ambiance - if (WorldGen.genRand.NextBool(150)) - { - ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + //if (Main.tile[X, Y].TileType == ModContent.TileType()) + //{ + // //Driftwood Ambiance + // if (WorldGen.genRand.NextBool(150)) + // { + // ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DriftwoodPiles)); - } - } - if (Main.tile[X, Y].TileType == ModContent.TileType()) - { - //Driftwood Ambiance - if (WorldGen.genRand.NextBool(150)) - { - ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + // WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DriftwoodPiles)); + // } + //} + //if (Main.tile[X, Y].TileType == ModContent.TileType()) + //{ + // //Driftwood Ambiance + // if (WorldGen.genRand.NextBool(150)) + // { + // ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DriftwoodPiles)); - } - } + // WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DriftwoodPiles)); + // } + //} } }); @@ -492,7 +450,7 @@ namespace CalamityMod.World //sides of the sunken sea (radiant reefs) //LeftSideBarrier is used to make the barrier of basalt either on the left or right, since the sunken sea is meant to have barriers on both sides and the reefs is generated twice - public static void PlaceRadiantReefs(int startPosX, int startPosY, bool LeftSideBarrier) + public static void PlaceRadiantReefs(int startPosX, int startPosY) { int cavePerlinSeed = WorldGen.genRand.Next(); int cavePerlinSeedWalls = WorldGen.genRand.Next(); @@ -500,78 +458,23 @@ namespace CalamityMod.World Point origin = new Point(startPosX, startPosY); Vector2 center = origin.ToVector2() * 16f + new Vector2(8f); - float angle = MathHelper.Pi * 0.15f; + float angle = MathHelper.Pi * 0.20f; float otherAngle = MathHelper.PiOver2 - angle; - int biomeSize = 180 + (Main.maxTilesX / 180); + int biomeSize = 280 + (Main.maxTilesX / 180); float actualSize = biomeSize * 16f; float constant = actualSize * 2f / (float)Math.Sin(angle); float fociSpacing = actualSize * (float)Math.Sin(otherAngle) / (float)Math.Sin(angle); - int verticalRadius = (int)(constant / 16f); + int verticalRadius = (int)(constant / 20f); Vector2 fociOffset = Vector2.UnitY * fociSpacing; Vector2 topFoci = center - fociOffset; Vector2 bottomFoci = center + fociOffset; - //first, place a basalt barrier on the left and right of the biome - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => - { - for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) - { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) - { - float percent = dist / constant; - float blurPercent = 0.99f; - - if (percent > blurPercent) - { - if (Y > origin.Y - 60) - { - if (LeftSideBarrier) - { - if (X <= origin.X && Main.tile[X - 40, Y - 25].TileType != ModContent.TileType()) - { - ShapeData circle = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - - WorldUtils.Gen(new Point(X - 15, Y - 20), new Shapes.Tail(50, new Vector2D(0,-50)), Actions.Chain(new GenAction[] - { - blotchMod.Output(circle) - })); - WorldUtils.Gen(new Point(X - 15, Y - 20), new ModShapes.All(circle), Actions.Chain(new GenAction[] - { - new Actions.Clear(), - new Actions.PlaceTile((ushort)ModContent.TileType()) - })); - } - } - else - { - if (X >= origin.X && Main.tile[X + 40, Y - 25].TileType != ModContent.TileType()) - { - ShapeData circle = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - - WorldUtils.Gen(new Point(X + 10, Y - 5), new Shapes.Tail(50, new Vector2D(37, -20)), Actions.Chain(new GenAction[] - { - blotchMod.Output(circle) - })); - WorldUtils.Gen(new Point(X + 10, Y - 5), new ModShapes.All(circle), Actions.Chain(new GenAction[] - { - new Actions.Clear(), - new Actions.PlaceTile((ushort)ModContent.TileType()) - })); - } - } - } - } - } - } - }); bool runonce = false; // this is used to make the wall on the left side go boom on the second run //generate the actual caverns - for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) + for (int X = origin.X - biomeSize - 170; X <= origin.X + biomeSize + 170; X++) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -791,8 +694,8 @@ namespace CalamityMod.World //generate perlin noise caves float horizontalOffsetNoise = CalamityUtils.PerlinNoise2D(X / 80f, Y / 80f, 5, unchecked(cavePerlinSeed + 1)) * 0.01f; - float cavePerlinValue = CalamityUtils.PerlinNoise2D(X / 600f, Y / 550f, 5, cavePerlinSeed) + 0.5f + horizontalOffsetNoise; - float cavePerlinValue2 = CalamityUtils.PerlinNoise2D(X / 600f, Y / 550f, 5, unchecked(cavePerlinSeed - 1)) + 0.5f; + float cavePerlinValue = CalamityUtils.PerlinNoise2D(X / 800f, Y / 450f, 5, cavePerlinSeed) + 0.5f + horizontalOffsetNoise; + float cavePerlinValue2 = CalamityUtils.PerlinNoise2D(X / 800f, Y / 450f, 5, unchecked(cavePerlinSeed - 1)) + 0.5f; float caveNoiseMap = (cavePerlinValue + cavePerlinValue2) * 0.5f; float caveCreationThreshold = horizontalOffsetNoise * 3.5f + 0.235f; @@ -820,7 +723,7 @@ namespace CalamityMod.World WorldGen.PlaceWall(X, Y, ModContent.WallType()); } - if ((caveNoiseMapWalls + 0.065f) * (caveNoiseMapWalls + 0.065f) > caveCreationThresholdWalls) + if ((caveNoiseMapWalls + 0.085f) * (caveNoiseMapWalls + 0.085f) > caveCreationThresholdWalls) { WorldGen.PlaceWall(X, Y, ModContent.WallType()); } @@ -942,7 +845,6 @@ namespace CalamityMod.World } }); } - //bottom of the biome (gleaming burrows) public static void PlaceGleamingBurrows(int startPosX, int startPosY) { @@ -998,6 +900,8 @@ namespace CalamityMod.World } }); + + //place the gleaming burrows caverns for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) { @@ -1074,6 +978,7 @@ namespace CalamityMod.World } } + //cleanup the perlin caves ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => { @@ -1101,6 +1006,7 @@ namespace CalamityMod.World } }); + //place extra tiles ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => { @@ -1167,6 +1073,193 @@ namespace CalamityMod.World } } + //Very bottom of the biome (Clam Den) + public static void PlaceClamDen(int startPosX, int startPosY) + { + int cavePerlinSeed = WorldGen.genRand.Next(); + int cavePerlinSeedWalls = WorldGen.genRand.Next(); + + Point origin = new Point(startPosX, startPosY); + Vector2 center = origin.ToVector2() * 16f + new Vector2(8f); + + float angle = MathHelper.Pi * 0.15f; + float otherAngle = MathHelper.PiOver2 - angle; + + int biomeSize = 60 + (Main.maxTilesX / 180); + float actualSize = biomeSize * 16f; + float constant = actualSize * 2f / (float)Math.Sin(angle); + + float fociSpacing = actualSize * (float)Math.Sin(otherAngle) / (float)Math.Sin(angle); + int verticalRadius = (int)(constant / 16f); + + Vector2 fociOffset = Vector2.UnitY * fociSpacing; + Vector2 topFoci = center - fociOffset; + Vector2 bottomFoci = center + fociOffset; + + //place the Clam Den caverns + for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) + { + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + { + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, true)) + { + float percent = dist / constant; + float blurPercent = 0.99f; + + if (percent > blurPercent) + { + if (Y > origin.Y - 50) + { + //place smaller navystone clumps infront of the basalt so the basalt isnt actually inside of the biome itself + WorldGen.TileRunner(X, Y, WorldGen.genRand.Next(8, 12), WorldGen.genRand.Next(8, 12), ModContent.TileType(), true, 0f, 0f, true, true); + } + //place clean transition between the burrows and the other biomes + if (Y < origin.Y && Main.tile[X, Y].HasTile && Main.tile[X, Y].TileType != ModContent.TileType()) + { + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + WorldUtils.Gen(new Point(X, Y), new Shapes.Slime(WorldGen.genRand.Next(1, 3)), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + + WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.ClearTile(), new Actions.PlaceTile((ushort)ModContent.TileType()) + })); + } + } + else + { + //clear absolutely everything before generating the caverns + Main.tile[X, Y].ClearEverything(); + + ////generate perlin noise caves + //float horizontalOffsetNoise = CalamityUtils.PerlinNoise2D(X / 80, Y / 80, 5, unchecked(cavePerlinSeed + 1)) * 0.01f; + //float cavePerlinValue = CalamityUtils.PerlinNoise2D(X / 1075f, Y / 1075f, 5, cavePerlinSeed) + 0.5f + horizontalOffsetNoise; + //float cavePerlinValue2 = CalamityUtils.PerlinNoise2D(X / 1075f, Y / 1075f, 5, unchecked(cavePerlinSeed - 1)) + 0.5f; + //float caveNoiseMap = (cavePerlinValue + cavePerlinValue2) * 0.5f; + //float caveCreationThreshold = horizontalOffsetNoise * 3.5f + 0.235f; + + ////kill or place tiles depending on the noise map + //if (caveNoiseMap * caveNoiseMap > caveCreationThreshold) + //{ + // WorldGen.KillTile(X, Y); + //} + //else + //{ + // WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType()); + //} + + //place walls in the biome using a different "seed" so it differs from the cave generation + //this creates a neat effect where walls worm their way through the caverns while leaving openings for the background to show through + float horizontalOffsetNoiseWalls = CalamityUtils.PerlinNoise2D(X / 80, Y / 80, 5, unchecked(cavePerlinSeedWalls + 1)) * 0.01f; + float cavePerlinValueWalls = CalamityUtils.PerlinNoise2D(X / 375f, Y / 375f, 5, cavePerlinSeedWalls) + 0.5f + horizontalOffsetNoiseWalls; + float cavePerlinValue2Walls = CalamityUtils.PerlinNoise2D(X / 375f, Y / 375f, 5, unchecked(cavePerlinSeedWalls - 1)) + 0.5f; + float caveNoiseMapWalls = (cavePerlinValueWalls + cavePerlinValue2Walls) * 0.5f; + float caveCreationThresholdWalls = horizontalOffsetNoiseWalls * 5.5f + 0.235f; + + if (caveNoiseMapWalls * caveNoiseMapWalls > caveCreationThresholdWalls) + { + WorldGen.PlaceWall(X, Y, ModContent.WallType()); + } + + Main.tile[X, Y].Get().LiquidType = LiquidID.Water; + Main.tile[X, Y].LiquidAmount = byte.MaxValue; + } + } + } + } + + + //cleanup the perlin caves + ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + { + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + { + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, true)) + { + //clean tiles that are sticking out (aka tiles only attached to one tile on one side) + bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; + bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; + + if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + { + WorldGen.KillTile(X, Y); + } + + //kill random single floating tiles + if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) + { + WorldGen.KillTile(X, Y); + } + } + } + }); + + + //place extra tiles + ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + { + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + { + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, true)) + { + bool canPlaceSand = false; + + //place sand clumps on top of exposed navystone + if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && !Main.tile[X, Y - 3].HasTile) + { + canPlaceSand = true; + } + + if (canPlaceSand) + { + PlaceSand(X, Y, 4, ModContent.TileType()); + } + } + } + }); + + //cleanup again + for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) + { + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + { + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, true)) + { + //clean tiles that are sticking out (aka tiles only attached to one tile on one side) + bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; + bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; + + if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + { + WorldGen.KillTile(X, Y); + } + + //kill random single floating tiles + if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) + { + WorldGen.KillTile(X, Y); + } + + //if any sand is floating, put tiles below it + if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y + 1].HasTile) + { + WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType()); + Main.tile[X, Y].TileType = (ushort)ModContent.TileType(); + } + + Tile.SmoothSlope(X, Y); + } + } + } + } + //basalt biome underneath the sunken sea public static void PlaceBasaltGully(int startPosX, int startPosY) { @@ -1174,67 +1267,31 @@ namespace CalamityMod.World int XLeft = GenVars.UndergroundDesertLocation.Left + 40; int XRight = GenVars.UndergroundDesertLocation.Right - 70; - - //place circles of basalt along the 2 edges of the area - //for (int Y = startPosY - 50; Y <= Main.maxTilesY - 200; Y += 20) - //{ - // ShapeData circle = new ShapeData(); - // GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - - // int radius = WorldGen.genRand.Next(30, 45); - // int RandomX = Main.rand.Next(-25, 25); - - // WorldUtils.Gen(new Point(XLeft, Y), new Shapes.Rectangle(radius, (radius)), Actions.Chain(new GenAction[] - // { - // blotchMod.Output(circle) - // })); - - // WorldUtils.Gen(new Point(XLeft, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] - // { - // new Actions.Clear(), - // new Actions.PlaceTile((ushort)ModContent.TileType()), - // new Actions.PlaceWall(WallID.LavaUnsafe1) - // })); - - // WorldUtils.Gen(new Point(XRight, Y), new Shapes.Rectangle(radius, (radius)), Actions.Chain(new GenAction[] - // { - // blotchMod.Output(circle) - // })); - - // WorldUtils.Gen(new Point(XRight, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] - // { - // new Actions.Clear(), - // new Actions.PlaceTile((ushort)ModContent.TileType()), - // new Actions.PlaceWall(WallID.LavaUnsafe1) - // })); - //} - - //place blocks of basalt all the way down to hell, here it just places one block and wall so it doesnt hurt preformance - ForLoop.Invoke(startPosX - biomeSize - 25, startPosX + biomeSize + 25, 1, (X) => + ForLoop.Invoke(startPosX - biomeSize - 60, startPosX + biomeSize + 60, 1, (X) => { //const int totalCuveDepth = -120; //const int totalCuveDepth2 = 120; int basaltbordernoise = Main.rand.Next(180, 185); - int basaltbordernoisetop = Main.rand.Next(145, 150); + int basaltbordernoisetop = Main.rand.Next(645, 650); const int totalCuveDepth = -220; - const int totalCuveDepth2 = 80; + const int totalCuveDepth2 = 90; int curveDepth = (int)MathHelper.Lerp( totalCuveDepth, 0f, - MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, X, true))); + MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 60, startPosX + biomeSize - 200, X, true))); int curveDepth2 = (int)MathHelper.Lerp( totalCuveDepth, 0f, - MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 20, startPosX - biomeSize + 200, X, true))); + MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 60, startPosX - biomeSize + 200, X, true))); int curveDepthtop = (int)MathHelper.Lerp( totalCuveDepth2, 0f, - MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, X, true))); + MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 60, startPosX + biomeSize - 200, X, true))); int curveDepth2top = (int)MathHelper.Lerp( totalCuveDepth2, 0f, - MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 20, startPosX - biomeSize + 200, X, true))); + MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 60, startPosX - biomeSize + 200, X, true))); for (int Y = startPosY - basaltbordernoisetop + curveDepthtop + curveDepth2top; Y <= Main.maxTilesY - basaltbordernoise + curveDepth + curveDepth2; Y++) { @@ -1347,6 +1404,7 @@ namespace CalamityMod.World } } + //place all the ambient tiles in the sunken sea public static void PlaceSunkenSeaAmbience() { @@ -1381,7 +1439,7 @@ namespace CalamityMod.World if (Main.tile[X, Y].TileType == ModContent.TileType()) { //Driftwood Ambiance - if (WorldGen.genRand.NextBool(5)) + if (WorldGen.genRand.NextBool(100)) { ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; @@ -1391,7 +1449,7 @@ namespace CalamityMod.World if (Main.tile[X, Y].TileType == ModContent.TileType()) { //Driftwood Ambiance - if (WorldGen.genRand.NextBool(5)) + if (WorldGen.genRand.NextBool(100)) { ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; @@ -1567,8 +1625,8 @@ namespace CalamityMod.World } if (Main.tile[X, Y].TileType == ModContent.TileType()) { - if (WorldGen.genRand.NextBool(100) && !Main.tile[X - 1, Y].HasTile) - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(7), Actions.Chain(new GenAction[] + if (WorldGen.genRand.NextBool(50) && !Main.tile[X - 1, Y].HasTile) + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(3), Actions.Chain(new GenAction[] { new Modifiers.OnlyTiles((ushort)ModContent.TileType(),(ushort)ModContent.TileType()), new Actions.ClearTile(), @@ -1765,10 +1823,11 @@ namespace CalamityMod.World WorldGen.PlaceTile(X - 2, Y, WorldGen.genRand.Next(WallCorals), true, false, -1, 0); } } + // Pearl Autism if (Main.tile[X, Y].TileType == ModContent.TileType()) { - if (WorldGen.genRand.NextBool(100) && !Main.tile[X - 1, Y].HasTile) - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(7), Actions.Chain(new GenAction[] + if (WorldGen.genRand.NextBool(50) && !Main.tile[X - 1, Y].HasTile) + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(3), Actions.Chain(new GenAction[] { new Modifiers.OnlyTiles((ushort)ModContent.TileType()), new Actions.ClearTile(), @@ -1777,8 +1836,8 @@ namespace CalamityMod.World } if (Main.tile[X, Y].TileType == ModContent.TileType()) { - if (WorldGen.genRand.NextBool(60) && !Main.tile[X - 1, Y].HasTile) - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(7), Actions.Chain(new GenAction[] + if (WorldGen.genRand.NextBool(30) && !Main.tile[X - 1, Y].HasTile) + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(3), Actions.Chain(new GenAction[] { new Modifiers.OnlyTiles((ushort)ModContent.TileType()), new Actions.ClearTile(), @@ -1937,6 +1996,7 @@ namespace CalamityMod.World }); } + //method to make sure things only generate in each biome circle public static bool CheckInBiomeArea(Point tile, Vector2 focus1, Vector2 focus2, float distanceConstant, Vector2 center, out float distance, bool collapse = false, bool collapseBottom = false) {