diff --git a/BiomeManagers/FloralParadiseBiome.cs b/BiomeManagers/FloralParadiseBiome.cs deleted file mode 100644 index bfe9d45095..0000000000 --- a/BiomeManagers/FloralParadiseBiome.cs +++ /dev/null @@ -1,19 +0,0 @@ -using CalamityMod.Systems; -using CalamityMod.Waters; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.BiomeManagers -{ - public class FloralParadiseBiome : ModBiome - { - public override ModWaterStyle WaterStyle => FloralParadiseWater.Instance; - public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find("CalamityMod/FloralParadiseBGStyle"); - public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - - public override bool IsBiomeActive(Player player) - { - return BiomeTileCounterSystem.FloralParadiseTiles >= 300; - } - } -} diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 8258fe08dd..625f1d6bd4 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1574,13 +1574,11 @@ namespace CalamityMod.CalPlayer public bool ZoneAbyssLayer3 => Player.InModBiome(); public bool ZoneAbyssLayer4 => Player.InModBiome(); - public bool ZoneFloralParadise => Player.InModBiome(); - public bool ZoneCalamity => Player.InModBiome(); public bool ZoneAstral => Player.InModBiome() && !ZoneAbyss; - public bool InAnyCalamityBiome => ZoneAbyss || ZoneCalamity || ZoneFloralParadise || ZoneSulphur || ZoneSunkenSea || ZoneAstral; + public bool InAnyCalamityBiome => ZoneAbyss || ZoneCalamity || ZoneSulphur || ZoneSunkenSea || ZoneAstral; public bool abyssDeath = false; public int abyssBreathCD; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index e12c3ca848..5229cab18d 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -142,9 +142,6 @@ namespace CalamityMod.CalPlayer // Check if schematics are present on the mouse, for the sake of registering their recipes. CheckIfMouseItemIsSchematic(); - // Do environmental effects. - DoEnvironmentalEffects(); - // Handle Androomba's Right Click function AndroombaRightClick(); @@ -2997,31 +2994,6 @@ namespace CalamityMod.CalPlayer } #endregion - #region Biome Effects - public void DrawPollenInFloralParadise() - { - if (!ZoneFloralParadise || !Main.rand.NextBool(7) || Main.dedServ) - return; - - for (int i = 0; i < 15; i++) - { - Vector2 dustSpawnPosition = Player.Center + Main.rand.NextVector2Square(-360f, 360f); - dustSpawnPosition.Y += 200f; - Tile tile = CalamityUtils.ParanoidTileRetrieval((int)(dustSpawnPosition.X / 16f), (int)(dustSpawnPosition.Y / 16f)); - if (WorldGen.SolidTile(tile) || tile.LiquidAmount > 0) - continue; - - Dust pollen = Dust.NewDustPerfect(dustSpawnPosition, DustID.AncientLight); - pollen.velocity = Main.rand.NextVector2Circular(0.4f, 0.4f); - pollen.scale = Main.rand.NextFloat(0.8f, 1f); - pollen.fadeIn = 2f; - pollen.color = Color.YellowGreen; - pollen.noGravity = true; - break; - } - } - #endregion Biome Effects - #region Abyss Effects private void AbyssEffects() { diff --git a/CalPlayer/PlayerEnvironmentEffects.cs b/CalPlayer/PlayerEnvironmentEffects.cs deleted file mode 100644 index 8dc7eee830..0000000000 --- a/CalPlayer/PlayerEnvironmentEffects.cs +++ /dev/null @@ -1,37 +0,0 @@ -using CalamityMod.Projectiles.Environment; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ModLoader; - -namespace CalamityMod.CalPlayer -{ - public partial class CalamityPlayer : ModPlayer - { - public void DoEnvironmentalEffects() - { - CreateLilyglowInFloralParadise(); - } - - public void CreateLilyglowInFloralParadise() - { - // Don't do anything if the player is not in the floral paradise of if this code is called by anyone other than the player. - if (!ZoneFloralParadise || Main.myPlayer != Player.whoAmI) - return; - - if (!Main.rand.NextBool(12)) - return; - - for (int tries = 0; tries < 50; tries++) - { - Vector2 potentialSpawnPosition = Player.Center + new Vector2(Main.rand.NextFloat(-1000f, 1000f), Main.rand.NextFloat(-300f, 300f)); - if (Collision.SolidCollision(potentialSpawnPosition, 1, 1)) - continue; - - Vector2 spawnVelocity = -Vector2.UnitY.RotatedByRandom(0.82f) * Main.rand.NextFloat(0.5f, 1.35f); - Projectile.NewProjectile(new EntitySource_WorldEvent(), potentialSpawnPosition, spawnVelocity, ModContent.ProjectileType(), 0, 0f, Player.whoAmI); - break; - } - } - } -} diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 0afb4a96a3..324837ce32 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -29,7 +29,6 @@ using CalamityMod.Tiles; using CalamityMod.Utilities.Daybreak; using CalamityMod.Walls; using CalamityMod.Walls.UnsafeWalls; -using CalamityMod.Waterfalls; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Mono.Cecil.Cil; @@ -795,22 +794,12 @@ namespace CalamityMod.ILEditing #region Custom DoDraw Changes private static void CustomDoDrawChanges(ILContext il) { - // This IL edit accomplishes two things: - // 1. Calls a helper function for drawing the fog in the Floral Paradise. - // 2. Allows for drawing additive blend projectiles using IAdditiveDrawer. + // Allows for drawing additive blend projectiles using IAdditiveDrawer. ILCursor cursor = new ILCursor(il); - // First, Floral Paradise fog. + // Move before the place we want to inject code. if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchCallOrCallvirt
("DrawInfernoRings"))) return; - - cursor.EmitDelegate(() => - { - if (!Main.dedServ && BiomeTileCounterSystem.FloralParadiseTiles > 0) - DrawFog(Utils.GetLerpValue(0f, 250f, BiomeTileCounterSystem.FloralParadiseTiles, true)); - }); - - // Then, additive drawing. if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall("Draw"))) return; @@ -835,28 +824,6 @@ namespace CalamityMod.ILEditing Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); }); } - - private static void DrawFog(float intensity) - { - Main.spriteBatch.EnterShaderRegion(); - WaterfallRenderer.DrawWaterfalls(); - - Texture2D fogTexture = ModContent.Request("Terraria/Images/Misc/Perlin").Value; - Vector2 scale = new Vector2(Main.screenWidth, Main.screenHeight) / fogTexture.Size(); - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - GameShaders.Misc["CalamityMod:Fog"].UseOpacity(intensity * 0.74f); - GameShaders.Misc["CalamityMod:Fog"].UseColor(Color.Lerp(Color.Lime, Color.Black, 0.85f)); - GameShaders.Misc["CalamityMod:Fog"].UseSaturation(1.67f); - GameShaders.Misc["CalamityMod:Fog"].Shader.Parameters["fogMovementSpeed"].SetValue(1.75f); - GameShaders.Misc["CalamityMod:Fog"].Apply(); - - Main.spriteBatch.Draw(fogTexture, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f); - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(); - } #endregion #region General Particle Rendering diff --git a/Items/Placeables/FloralParadise/AlgalSlateItem.cs b/Items/Placeables/FloralParadise/AlgalSlateItem.cs deleted file mode 100644 index d8a610e9d1..0000000000 --- a/Items/Placeables/FloralParadise/AlgalSlateItem.cs +++ /dev/null @@ -1,17 +0,0 @@ -using CalamityMod.Tiles.FloralParadise; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Placeables.FloralParadise -{ - public class AlgalSlateItem : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Placeables"; - - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 100; - } - - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); - } -} diff --git a/Items/Placeables/FloralParadise/AlgalSlateItem.png b/Items/Placeables/FloralParadise/AlgalSlateItem.png deleted file mode 100644 index a589261603..0000000000 Binary files a/Items/Placeables/FloralParadise/AlgalSlateItem.png and /dev/null differ diff --git a/Items/Placeables/FloralParadise/PeatItem.cs b/Items/Placeables/FloralParadise/PeatItem.cs deleted file mode 100644 index a2209f999b..0000000000 --- a/Items/Placeables/FloralParadise/PeatItem.cs +++ /dev/null @@ -1,17 +0,0 @@ -using CalamityMod.Tiles.FloralParadise; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Placeables.FloralParadise -{ - public class PeatItem : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Placeables"; - - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 100; - } - - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); - } -} diff --git a/Items/Placeables/FloralParadise/PeatItem.png b/Items/Placeables/FloralParadise/PeatItem.png deleted file mode 100644 index 2c060a37a8..0000000000 Binary files a/Items/Placeables/FloralParadise/PeatItem.png and /dev/null differ diff --git a/Items/Placeables/FloralParadise/PeatMossItem.cs b/Items/Placeables/FloralParadise/PeatMossItem.cs deleted file mode 100644 index 30fb745ea5..0000000000 --- a/Items/Placeables/FloralParadise/PeatMossItem.cs +++ /dev/null @@ -1,17 +0,0 @@ -using CalamityMod.Tiles.FloralParadise; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Placeables.FloralParadise -{ - public class PeatMossItem : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Placeables"; - - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 100; - } - - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); - } -} diff --git a/Items/Placeables/FloralParadise/PeatMossItem.png b/Items/Placeables/FloralParadise/PeatMossItem.png deleted file mode 100644 index e7b019ef74..0000000000 Binary files a/Items/Placeables/FloralParadise/PeatMossItem.png and /dev/null differ diff --git a/Items/Placeables/FloralParadise/ScintillatingBloom.cs b/Items/Placeables/FloralParadise/ScintillatingBloom.cs deleted file mode 100644 index 37482b37b7..0000000000 --- a/Items/Placeables/FloralParadise/ScintillatingBloom.cs +++ /dev/null @@ -1,17 +0,0 @@ -using CalamityMod.Tiles.FloralParadise; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Placeables.FloralParadise -{ - public class ScintillatingBloom : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Placeables"; - - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 10; - } - - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); - } -} diff --git a/Items/Placeables/FloralParadise/ScintillatingBloom.png b/Items/Placeables/FloralParadise/ScintillatingBloom.png deleted file mode 100644 index 12b82912c8..0000000000 Binary files a/Items/Placeables/FloralParadise/ScintillatingBloom.png and /dev/null differ diff --git a/Systems/Tile/BiomeTileCounterSystem.cs b/Systems/Tile/BiomeTileCounterSystem.cs index a8ba756175..d5f6121d11 100644 --- a/Systems/Tile/BiomeTileCounterSystem.cs +++ b/Systems/Tile/BiomeTileCounterSystem.cs @@ -4,7 +4,6 @@ using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; using CalamityMod.Tiles.Crags; -using CalamityMod.Tiles.FloralParadise; using CalamityMod.Tiles.DraedonStructures; using CalamityMod.Tiles.Ores; using CalamityMod.Tiles.SunkenSea; @@ -27,7 +26,6 @@ namespace CalamityMod.Systems public static int SunkenSeaBasaltTiles = 0; public static int ArsenalLabTiles = 0; public static int AbyssTiles = 0; - public static int FloralParadiseTiles = 0; public static int UndergroundTiles = 0; public static int Layer1Tiles = 0; public static int Layer2Tiles = 0; @@ -53,7 +51,6 @@ namespace CalamityMod.Systems Layer2Tiles = 0; Layer3Tiles = 0; Layer4Tiles = 0; - FloralParadiseTiles = 0; } public override void TileCountsAvailable(ReadOnlySpan tileCounts) @@ -67,7 +64,6 @@ namespace CalamityMod.Systems SunkenSeaBasaltTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; AbyssTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; SulphurTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; - FloralParadiseTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; ArsenalLabTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; UndergroundTiles = tileCounts[TileID.Stone]; diff --git a/Systems/World/WorldgenManagementSystem.cs b/Systems/World/WorldgenManagementSystem.cs index 581f681051..6d51a28c57 100644 --- a/Systems/World/WorldgenManagementSystem.cs +++ b/Systems/World/WorldgenManagementSystem.cs @@ -5,7 +5,6 @@ using CalamityMod.Items.SummonItems; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.World; -using CalamityMod.World.Minibiomes; using CalamityMod.World.Planets; using Microsoft.Xna.Framework; using Terraria; @@ -130,14 +129,6 @@ namespace CalamityMod.Systems progress.Message = Language.GetOrRegister("Mods.CalamityMod.UI.BetterJungleTemple").Value; CustomTemple.NewJungleTemple(); }); - - // Floral Paradise Biome - tasks.Insert(jungleTempleIndex + 1, new PassLegacy("FloralParadise", (progress, config) => - { - progress.Message = "Growing a floral paradise underground"; - if (FloralParadiseMinibiome.SHOULD_GENERATE) - FloralParadiseMinibiome.GenerateInstances(); - })); } // Improved Golem Arena diff --git a/Tiles/FloralParadise/BloodOrangePlant.cs b/Tiles/BloodOrangePlant.cs similarity index 96% rename from Tiles/FloralParadise/BloodOrangePlant.cs rename to Tiles/BloodOrangePlant.cs index 29a758eb30..6810ed1226 100644 --- a/Tiles/FloralParadise/BloodOrangePlant.cs +++ b/Tiles/BloodOrangePlant.cs @@ -6,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.FloralParadise +namespace CalamityMod.Tiles { public class BloodOrangePlant : ModTile { diff --git a/Tiles/FloralParadise/BloodOrangePlant.png b/Tiles/BloodOrangePlant.png similarity index 100% rename from Tiles/FloralParadise/BloodOrangePlant.png rename to Tiles/BloodOrangePlant.png diff --git a/Tiles/FloralParadise/AlgalSlate.cs b/Tiles/FloralParadise/AlgalSlate.cs deleted file mode 100644 index 34d06658d4..0000000000 --- a/Tiles/FloralParadise/AlgalSlate.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CalamityMod.Systems; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class AlgalSlate : ModTile - { - public override void SetStaticDefaults() - { - Main.tileSolid[Type] = true; - Main.tileBlockLight[Type] = true; - Main.tileBrick[Type] = true; - TileID.Sets.Stone[Type] = true; - TileID.Sets.Conversion.Stone[Type] = true; - TileID.Sets.CanBeClearedDuringOreRunner[Type] = false; - - CalamityUtils.MergeWithGeneral(Type); - CalamityUtils.MergeWithOres(Type); - CalamityUtils.MergeWithFloralParadise(Type); - - DustType = DustID.t_LivingWood; - - HitSound = SoundID.Tink; - - AddMapEntry(new Color(33, 56, 27)); - } - - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) - { - TileFramingSystem.CustomMergeFrame(i, j, Type, TileID.Dirt, false, false, false, true); - return false; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - } -} diff --git a/Tiles/FloralParadise/AlgalSlate.png b/Tiles/FloralParadise/AlgalSlate.png deleted file mode 100644 index 86f7743da6..0000000000 Binary files a/Tiles/FloralParadise/AlgalSlate.png and /dev/null differ diff --git a/Tiles/FloralParadise/LargeLogPiles.cs b/Tiles/FloralParadise/LargeLogPiles.cs deleted file mode 100644 index 6e73e2f86a..0000000000 --- a/Tiles/FloralParadise/LargeLogPiles.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class LargeLogPiles : ModTile - { - public const int Variants = 2; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileObsidianKill[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 3; - TileObjectData.newTile.Height = 3; - TileObjectData.newTile.Origin = new Point16(1, 2); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16, - 16, - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - - TileObjectData.addTile(Type); - - DustType = DustID.Mud; - - AddMapEntry(new Color(114, 72, 49)); - } - - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) - { - offsetY = 2; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 4; - } - } -} diff --git a/Tiles/FloralParadise/LargeLogPiles.png b/Tiles/FloralParadise/LargeLogPiles.png deleted file mode 100644 index e343f8254a..0000000000 Binary files a/Tiles/FloralParadise/LargeLogPiles.png and /dev/null differ diff --git a/Tiles/FloralParadise/LargeMossPiles.cs b/Tiles/FloralParadise/LargeMossPiles.cs deleted file mode 100644 index a3ad646b2b..0000000000 --- a/Tiles/FloralParadise/LargeMossPiles.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class LargeMossPiles : ModTile - { - public const int Variants = 4; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileObsidianKill[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 3; - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16, - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - - DustType = DustID.Mud; - - AddMapEntry(new Color(56, 56, 56)); - } - - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) - { - offsetY = 2; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 4; - } - } -} diff --git a/Tiles/FloralParadise/LargeMossPiles.png b/Tiles/FloralParadise/LargeMossPiles.png deleted file mode 100644 index ee20cf395a..0000000000 Binary files a/Tiles/FloralParadise/LargeMossPiles.png and /dev/null differ diff --git a/Tiles/FloralParadise/LargeSubterraneanGrass.cs b/Tiles/FloralParadise/LargeSubterraneanGrass.cs deleted file mode 100644 index b614e182f0..0000000000 --- a/Tiles/FloralParadise/LargeSubterraneanGrass.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class LargeSubterraneanGrass : ModTile - { - public const int Variants = 5; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileObsidianKill[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 3; - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16, - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - - DustType = DustID.JungleGrass; - - AddMapEntry(new Color(106, 163, 74)); - } - - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) - { - offsetY = 2; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 4; - } - } -} diff --git a/Tiles/FloralParadise/LargeSubterraneanGrass.png b/Tiles/FloralParadise/LargeSubterraneanGrass.png deleted file mode 100644 index 4069f95cae..0000000000 Binary files a/Tiles/FloralParadise/LargeSubterraneanGrass.png and /dev/null differ diff --git a/Tiles/FloralParadise/LargeWallFungi.cs b/Tiles/FloralParadise/LargeWallFungi.cs deleted file mode 100644 index f37aba5fe8..0000000000 --- a/Tiles/FloralParadise/LargeWallFungi.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.Enums; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class LargeWallFungi : ModTile - { - public const int Variants = 3; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 2; - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16, - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.AnchorBottom = AnchorData.Empty; - TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, 2, 0); - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - DustType = DustID.Dirt; - - AddMapEntry(new Color(165, 126, 84)); - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - } -} diff --git a/Tiles/FloralParadise/LargeWallFungi.png b/Tiles/FloralParadise/LargeWallFungi.png deleted file mode 100644 index 89c0975133..0000000000 Binary files a/Tiles/FloralParadise/LargeWallFungi.png and /dev/null differ diff --git a/Tiles/FloralParadise/LargeWallFungiLeft.cs b/Tiles/FloralParadise/LargeWallFungiLeft.cs deleted file mode 100644 index 342a581159..0000000000 --- a/Tiles/FloralParadise/LargeWallFungiLeft.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.Enums; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class LargeWallFungiLeft : ModTile - { - public const int Variants = 3; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 2; - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16, - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.AnchorBottom = AnchorData.Empty; - TileObjectData.newTile.AnchorLeft = new AnchorData(AnchorType.SolidTile, 2, 0); - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - DustType = DustID.Dirt; - - AddMapEntry(new Color(165, 126, 84)); - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - } -} diff --git a/Tiles/FloralParadise/LargeWallFungiLeft.png b/Tiles/FloralParadise/LargeWallFungiLeft.png deleted file mode 100644 index 8e765ea7fd..0000000000 Binary files a/Tiles/FloralParadise/LargeWallFungiLeft.png and /dev/null differ diff --git a/Tiles/FloralParadise/LushVines.cs b/Tiles/FloralParadise/LushVines.cs deleted file mode 100644 index 8c6a9ceecc..0000000000 --- a/Tiles/FloralParadise/LushVines.cs +++ /dev/null @@ -1,95 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class LushVines : ModTile - { - public override void SetStaticDefaults() - { - Main.tileCut[Type] = true; - Main.tileBlockLight[Type] = true; - Main.tileLavaDeath[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileFrameImportant[Type] = true; - AddMapEntry(new Color(47, 75, 32)); - HitSound = SoundID.Grass; - DustType = DustID.Grass; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - - public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem) - { - if (WorldGen.genRand.NextBool(2) && Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].cordage) - Item.NewItem(new EntitySource_TileBreak(i, j), new Vector2(i * 16 + 8f, j * 16 + 8f), ItemID.VineRope); - - if (Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType == Type) - { - WorldGen.KillTile(i, j + 1, false, false, false); - if (!Main.tile[i, j + 1].HasTile && Main.netMode != NetmodeID.SinglePlayer) - { - NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); - } - } - - if (Main.tile[i, j - 1].HasTile && Main.tile[i, j - 1].TileType == Type) - { - Main.tile[i, j - 1].TileFrameX = (short)(WorldGen.genRand.Next(3) * 18); - Main.tile[i, j - 1].TileFrameY = 54; - if (Main.netMode != NetmodeID.SinglePlayer) - NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); - } - } - - public override void RandomUpdate(int i, int j) - { - if (Main.tile[i, j + 1] != null) - { - if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != Type) - { - if (Main.tile[i, j + 1].LiquidAmount >= 128 && Main.tile[i, j + 1].LiquidType == LiquidID.Water) - { - bool canGrow = false; - for (int y = j; y > j - 10; j--) - { - if (Main.tile[i, y].BottomSlope) - { - canGrow = false; - break; - } - if (Main.tile[i, y].HasTile && !Main.tile[i, y].BottomSlope) - { - canGrow = true; - break; - } - } - if (canGrow) - { - int below = j + 1; - Main.tile[i, below].TileType = Type; - Main.tile[i, below].TileFrameX = (short)(WorldGen.genRand.Next(3) * 18); - Main.tile[i, below].TileFrameY = 54; - Main.tile[i, below - 1].TileFrameX = (short)(WorldGen.genRand.Next(3) * 18); - Main.tile[i, below - 1].TileFrameY = (short)(WorldGen.genRand.Next(3) * 18); - Main.tile[i, below].Get().HasTile = true; - WorldGen.SquareTileFrame(i, below, true); - WorldGen.SquareTileFrame(i, below - 1, true); - if (Main.dedServ) - { - NetMessage.SendTileSquare(-1, i, below, 3, TileChangeType.None); - NetMessage.SendTileSquare(-1, i, below - 1, 3, TileChangeType.None); - } - } - } - } - } - } - } -} diff --git a/Tiles/FloralParadise/LushVines.png b/Tiles/FloralParadise/LushVines.png deleted file mode 100644 index 2ef0db6a25..0000000000 Binary files a/Tiles/FloralParadise/LushVines.png and /dev/null differ diff --git a/Tiles/FloralParadise/MediumFloralPlants.cs b/Tiles/FloralParadise/MediumFloralPlants.cs deleted file mode 100644 index 72bd04cc3b..0000000000 --- a/Tiles/FloralParadise/MediumFloralPlants.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class MediumFloralPlants : ModTile - { - public const int Variants = 8; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileCut[Type] = true; - Main.tileObsidianKill[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 2; - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16, - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - - HitSound = SoundID.Grass; - DustType = DustID.Grass; - AddMapEntry(new Color(106, 135, 69)); - } - - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) - { - offsetY = 2; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 4; - } - - public override void NearbyEffects(int i, int j, bool closer) - { - if (CalamityUtils.ParanoidTileRetrieval(i, j).LiquidAmount > 64) - WorldGen.KillTile(i, j); - } - } -} diff --git a/Tiles/FloralParadise/MediumFloralPlants.png b/Tiles/FloralParadise/MediumFloralPlants.png deleted file mode 100644 index 643c9e94cc..0000000000 Binary files a/Tiles/FloralParadise/MediumFloralPlants.png and /dev/null differ diff --git a/Tiles/FloralParadise/MediumLargeMossPiles.cs b/Tiles/FloralParadise/MediumLargeMossPiles.cs deleted file mode 100644 index 0651506f46..0000000000 --- a/Tiles/FloralParadise/MediumLargeMossPiles.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class MediumLargeMossPiles : ModTile - { - public const int Variants = 4; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileObsidianKill[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 2; - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16, - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.RandomStyleRange = Variants; - - TileObjectData.addTile(Type); - - DustType = DustID.Mud; - - AddMapEntry(new Color(56, 56, 56)); - } - - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) - { - offsetY = 2; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 4; - } - } -} diff --git a/Tiles/FloralParadise/MediumLargeMossPiles.png b/Tiles/FloralParadise/MediumLargeMossPiles.png deleted file mode 100644 index cbf4ace032..0000000000 Binary files a/Tiles/FloralParadise/MediumLargeMossPiles.png and /dev/null differ diff --git a/Tiles/FloralParadise/MediumMossPiles.cs b/Tiles/FloralParadise/MediumMossPiles.cs deleted file mode 100644 index 4c6359eca2..0000000000 --- a/Tiles/FloralParadise/MediumMossPiles.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class MediumMossPiles : ModTile - { - public const int Variants = 4; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileObsidianKill[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - - DustType = DustID.Mud; - - AddMapEntry(new Color(56, 56, 56)); - } - - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) - { - offsetY = 2; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 4; - } - } -} diff --git a/Tiles/FloralParadise/MediumMossPiles.png b/Tiles/FloralParadise/MediumMossPiles.png deleted file mode 100644 index 05ca5e1d5f..0000000000 Binary files a/Tiles/FloralParadise/MediumMossPiles.png and /dev/null differ diff --git a/Tiles/FloralParadise/Peat.cs b/Tiles/FloralParadise/Peat.cs deleted file mode 100644 index 0d56eb20a0..0000000000 --- a/Tiles/FloralParadise/Peat.cs +++ /dev/null @@ -1,40 +0,0 @@ -using CalamityMod.Systems; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class Peat : ModTile - { - public override void SetStaticDefaults() - { - Main.tileSolid[Type] = true; - Main.tileBlockLight[Type] = true; - Main.tileBrick[Type] = true; - TileID.Sets.Stone[Type] = true; - TileID.Sets.Conversion.Stone[Type] = true; - TileID.Sets.CanBeClearedDuringOreRunner[Type] = false; - - CalamityUtils.MergeWithGeneral(Type); - CalamityUtils.MergeWithOres(Type); - CalamityUtils.MergeWithFloralParadise(Type); - - DustType = DustID.t_LivingWood; - - AddMapEntry(new Color(72, 91, 47)); - } - - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) - { - TileFramingSystem.CustomMergeFrame(i, j, Type, TileID.Dirt, false, false, false, true); - return false; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - } -} diff --git a/Tiles/FloralParadise/Peat.png b/Tiles/FloralParadise/Peat.png deleted file mode 100644 index 2ebbd88951..0000000000 Binary files a/Tiles/FloralParadise/Peat.png and /dev/null differ diff --git a/Tiles/FloralParadise/PeatMoss.cs b/Tiles/FloralParadise/PeatMoss.cs deleted file mode 100644 index 3ca2caa81e..0000000000 --- a/Tiles/FloralParadise/PeatMoss.cs +++ /dev/null @@ -1,116 +0,0 @@ -using CalamityMod.Projectiles.Environment; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class PeatMoss : ModTile - { - public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/MossMine"); - - public override void SetStaticDefaults() - { - Main.tileSolid[Type] = true; - Main.tileBlockLight[Type] = true; - Main.tileBrick[Type] = true; - - TileID.Sets.Grass[Type] = true; - TileID.Sets.NeedsGrassFraming[Type] = true; - TileID.Sets.NeedsGrassFramingDirt[Type] = ModContent.TileType(); - TileID.Sets.Conversion.Grass[Type] = true; - - CalamityUtils.SetMerge(Type, TileID.Dirt); - CalamityUtils.SetMerge(Type, TileID.Grass); - CalamityUtils.SetMerge(Type, TileID.CorruptGrass); - CalamityUtils.SetMerge(Type, TileID.HallowedGrass); - CalamityUtils.SetMerge(Type, TileID.CrimsonGrass); - CalamityUtils.MergeWithFloralParadise(Type); - - DustType = DustID.JungleGrass; - HitSound = MineSound; - - AddMapEntry(new Color(65, 142, 101)); - } - - public override void NumDust(int i, int j, bool fail, ref int Type) - { - Type = fail ? 1 : 3; - } - - public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem) - { - if (fail && !effectOnly) - Main.tile[i, j].TileType = (ushort)ModContent.TileType(); - } - - public override void NearbyEffects(int i, int j, bool closer) - { - if (WorldGen.genRand.NextBool(180) && !Main.gamePaused && CalamityUtils.ParanoidTileRetrieval(i, j - 1).LiquidAmount >= 200) - { - Vector2 algaeVelocity = -Vector2.UnitY.RotatedByRandom(0.91f) * Main.rand.NextFloat(0.85f, 1.6f); - Projectile.NewProjectile(new EntitySource_WorldEvent(), new Vector2(i + 0.5f, j - 0.5f) * 16f, algaeVelocity, ModContent.ProjectileType(), 0, 0f); - } - } - - public override void RandomUpdate(int i, int j) - { - int num8 = WorldGen.genRand.Next((int)Main.rockLayer, (int)(Main.rockLayer + Main.maxTilesY * 0.143)); - int nearbyVineCount = 0; - for (int x = i - 15; x <= i + 15; x++) - { - for (int y = j - 15; y <= j + 15; y++) - { - if (WorldGen.InWorld(x, y)) - { - if (CalamityUtils.ParanoidTileRetrieval(x, y).HasTile && - CalamityUtils.ParanoidTileRetrieval(x, y).TileType == (ushort)ModContent.TileType()) - { - nearbyVineCount++; - } - } - } - } - if (Main.tile[i, j + 1] != null && nearbyVineCount < 5) - { - if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != (ushort)ModContent.TileType()) - { - if (Main.tile[i, j + 1].LiquidAmount == 255 && - Main.tile[i, j + 1].LiquidType == LiquidID.Water) - { - bool growMoss = false; - for (int y = num8; y > num8 - 10; y--) - { - if (Main.tile[i, y].BottomSlope) - { - growMoss = false; - break; - } - if (Main.tile[i, y].HasTile && !Main.tile[i, y].BottomSlope) - { - growMoss = true; - break; - } - } - if (growMoss) - { - int belowY = j + 1; - Main.tile[i, belowY].TileType = (ushort)ModContent.TileType(); - Main.tile[i, belowY].Get().HasTile = true; - WorldGen.SquareTileFrame(i, belowY, true); - if (Main.dedServ) - { - NetMessage.SendTileSquare(-1, i, belowY, 3, TileChangeType.None); - } - } - Main.tile[i, j].Get().Slope = SlopeType.Solid; - Main.tile[i, j].Get().IsHalfBlock = false; - } - } - } - } - } -} diff --git a/Tiles/FloralParadise/PeatMoss.png b/Tiles/FloralParadise/PeatMoss.png deleted file mode 100644 index 8a38476c20..0000000000 Binary files a/Tiles/FloralParadise/PeatMoss.png and /dev/null differ diff --git a/Tiles/FloralParadise/PerennialTree.cs b/Tiles/FloralParadise/PerennialTree.cs deleted file mode 100644 index 7a0bc73d1d..0000000000 --- a/Tiles/FloralParadise/PerennialTree.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System; -using CalamityMod.DataStructures; -using CalamityMod.Tiles.BaseTiles; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class PerennialTree : DynamicallyGrownTree - { - // The max amount that branches can travel. Once the distance of the branches reaches or exceeds this threshold, the tree is done growing. - public override float MaxDistanceBeforeCutoff => 2100f; - - public override float DistanceUsedForTrunk => 140f; - - public override float BranchMaxBendFactor => 0.7f; - - public override float BranchTurnAngleVariance => 0.4f; - - public override float MinBranchLength => 30f; - - public override float TrunkWidth => 16f; - - public override float ChanceToCreateNewBranches => 0.8f; - - public override float VerticalStretchFactor => 12f; - - public override float DownwardBiasFactor => 0.4f; - - public override float BranchGrowthWidthDecay => 0.61f; - - public override int MaxCutoffBranchesPerBranch => 5; - - public Asset VineTexture; - - public override void SetStaticDefaults() - { - Main.tileAxe[Type] = true; - Main.tileFrameImportant[Type] = true; - DustType = DustID.WoodFurniture; - ItemDrop = ItemID.Wood; - UseDefaultSize(); - TileObjectData.addTile(Type); - - AddMapEntry(Color.SaddleBrown); - } - - public void DrawVine(Vector2 vineTop, Vector2 downwardBottom, int totalVinesToDraw, float swayFactor) - { - VineTexture ??= ModContent.Request("CalamityMod/Tiles/FloralParadise/PerennialTreeVines"); - Texture2D vineTexture = VineTexture.Value; - - // Determine the initial points for the vines. - Vector2[] controlPoints = new Vector2[8]; - Vector2 lightOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(-Main.offScreenRange); - for (int i = 0; i < controlPoints.Length; i++) - { - float swayOffset = swayFactor; - controlPoints[i] = Vector2.Lerp(vineTop, downwardBottom, i / (float)(controlPoints.Length - 1f)); - - Point p = (controlPoints[i] + lightOffset + BranchDrawer.PreviousPoint.ToWorldCoordinates()).ToTileCoordinates(); - - // 02JUN2024: Ozzatron: directionY did not exist at the time of the creation of the Perennial Tree. As such, it is ignored here. - Main.instance.TilesRenderer.Wind.GetWindTime(p.X, p.Y, 40, out int windTimeLeft, out int direction, out _); - - float windInterpolant = windTimeLeft / 40f; - swayOffset += Utils.GetLerpValue(0f, 0.45f, windInterpolant, true) * Utils.GetLerpValue(1f, 0.55f, windInterpolant, true) * direction * 28f; - controlPoints[i].X += swayOffset * Utils.GetLerpValue(0f, controlPoints.Length - 1f, i, true); - controlPoints[i].Y -= 4f; - } - BezierCurve vineCurve = new(controlPoints); - - int drawCount = (int)(totalVinesToDraw * 2.4f); - for (int i = 0; i < drawCount - 1; i++) - { - Vector2 vineCenter = vineCurve.Evaluate(i / (float)(drawCount - 1f)); - Vector2 ahead = vineCurve.Evaluate((i + 1f) / (float)(drawCount - 1f)); - float rotation = (ahead - vineCenter).ToRotation() - MathHelper.PiOver2; - vineCenter += BranchDrawer.PreviousPoint.ToWorldCoordinates() - Main.screenPosition; - - // Calculate light values. - Vector2 lightPosition = vineCenter + lightOffset + Main.screenPosition; - - int frameX = 0; - int frameY = 0; - if (i > 0) - frameY = RNG.Next(1, 3); - if (i >= drawCount - 3) - { - frameY = 3; - frameX = RNG.Next(3); - } - if (i == drawCount - 2) - frameY = 4; - - Rectangle frame = vineTexture.Frame(3, 5, frameX, frameY, -2, -2); - Color color = Lighting.GetColor(lightPosition.ToTileCoordinates()); - - Main.spriteBatch.Draw(vineTexture, vineCenter, frame, color, rotation, frame.Size() * 0.5f, 1f, 0f, 0); - } - } - - public override void DrawThingAtEndOfBranch(BranchDrawer.Branch branch) - { - int totalVinesToDraw = RNG.Next(4, 7); - float swayFactor = Main.windSpeedCurrent + (float)Math.Sin(Main.GlobalTimeWrappedHourly * 1.87f + RNG.NextFloat(0.94f)) * 0.4f; - Vector2 top = branch.EndOfCurve + Vector2.UnitY * 12f; - Vector2 bottom = top + Vector2.UnitY * totalVinesToDraw * 30f; - DrawVine(top, bottom, totalVinesToDraw, swayFactor * 35f); - } - } -} diff --git a/Tiles/FloralParadise/PerennialTree.png b/Tiles/FloralParadise/PerennialTree.png deleted file mode 100644 index 77e0372437..0000000000 Binary files a/Tiles/FloralParadise/PerennialTree.png and /dev/null differ diff --git a/Tiles/FloralParadise/PerennialTreeVines.png b/Tiles/FloralParadise/PerennialTreeVines.png deleted file mode 100644 index 19356dd5fe..0000000000 Binary files a/Tiles/FloralParadise/PerennialTreeVines.png and /dev/null differ diff --git a/Tiles/FloralParadise/PinkFlower.cs b/Tiles/FloralParadise/PinkFlower.cs deleted file mode 100644 index bc1f59ecba..0000000000 --- a/Tiles/FloralParadise/PinkFlower.cs +++ /dev/null @@ -1,92 +0,0 @@ -using CalamityMod.Items.Placeables.FloralParadise; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class PinkFlower : ModTile - { - public const int Variants = 2; - - public const int WindPushLifetime = 45; - - public Asset StamenTexture; - - public override void SetStaticDefaults() - { - StamenTexture = ModContent.Request("CalamityMod/Tiles/FloralParadise/PinkFlowerStamen"); - - Main.tileFrameImportant[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileObsidianKill[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 2; - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16, - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.RandomStyleRange = Variants; - - TileObjectData.addTile(Type); - - HitSound = SoundID.Grass; - DustType = DustID.JungleSpore; - AddMapEntry(new Color(255, 155, 202)); - RegisterItemDrop(ModContent.ItemType()); - } - - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) - { - if (drawData.tileFrameX % 36 == 0 && drawData.tileFrameY == 0) - Main.instance.TilesRenderer.AddSpecialLegacyPoint(i, j); - } - - public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) - { - if (Main.tile[i, j].IsTileActuallyInvisible()) - return; - - // 02JUN2024: Ozzatron: directionY did not exist at the time of the creation of this content. As such, it is ignored here. - Main.instance.TilesRenderer.Wind.GetWindTime(i, j, WindPushLifetime, out int windTimeLeft, out int direction, out _); - - float windInterpolant = windTimeLeft / (float)WindPushLifetime; - float windRotation = Utils.GetLerpValue(0f, 0.5f, windInterpolant, true) * Utils.GetLerpValue(1f, 0.5f, windInterpolant, true) * direction * 0.34f; - - int frameX = Main.tile[i, j].TileFrameX; - Color drawColor = Lighting.GetColor(i, j); - Texture2D stamenTexture = StamenTexture.Value; - Rectangle stamenFrame = stamenTexture.Frame(2, 1, frameX > 36 ? 1 : 0, 0); - Vector2 stamenOrigin = stamenFrame.Size() * new Vector2(0.5f, 1f); - Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - Vector2 drawPos = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffset + new Vector2(17f, 24f); - - // Create some pollen dust. - if (!Main.gamePaused && windTimeLeft >= 2 && Main.rand.NextBool(6)) - { - Vector2 pollenVelocity = -Vector2.UnitY.RotatedByRandom(windRotation * 2.3f) * 3f; - Dust pollen = Dust.NewDustPerfect(drawPos + Main.screenPosition - drawOffset - Vector2.UnitY * 16f, DustID.JungleSpore); - pollen.velocity = pollenVelocity; - pollen.scale = 1.4f; - } - - Main.spriteBatch.Draw(stamenTexture, drawPos, stamenFrame, drawColor, windRotation, stamenOrigin, 1f, SpriteEffects.None, 0f); - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 4; - } - } -} diff --git a/Tiles/FloralParadise/PinkFlower.png b/Tiles/FloralParadise/PinkFlower.png deleted file mode 100644 index 283ca92731..0000000000 Binary files a/Tiles/FloralParadise/PinkFlower.png and /dev/null differ diff --git a/Tiles/FloralParadise/PinkFlowerBig.cs b/Tiles/FloralParadise/PinkFlowerBig.cs deleted file mode 100644 index 529a8d630d..0000000000 --- a/Tiles/FloralParadise/PinkFlowerBig.cs +++ /dev/null @@ -1,103 +0,0 @@ -using CalamityMod.Items.Placeables.FloralParadise; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class PinkFlowerBig : ModTile - { - public const int Variants = 2; - - public const int WindPushLifetime = 48; - - public Asset StamenTexture; - - public override void SetStaticDefaults() - { - StamenTexture = ModContent.Request("CalamityMod/Tiles/FloralParadise/PinkFlowerBigStamen"); - - Main.tileFrameImportant[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileObsidianKill[Type] = true; - Main.tileLighted[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 4; - TileObjectData.newTile.Height = 3; - TileObjectData.newTile.Origin = new Point16(2, 2); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16, - 16, - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.RandomStyleRange = Variants; - - HitSound = SoundID.Grass; - TileObjectData.addTile(Type); - - DustType = DustID.JungleSpore; - AddMapEntry(new Color(255, 155, 202)); - RegisterItemDrop(ModContent.ItemType()); - } - - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - r = 0.5f; - g = 0.4f; - b = 0.16f; - } - - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) - { - if (drawData.tileFrameX % 72 == 0 && drawData.tileFrameY == 0) - Main.instance.TilesRenderer.AddSpecialLegacyPoint(i, j); - } - - public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) - { - if (Main.tile[i, j].IsTileActuallyInvisible()) - return; - - // 02JUN2024: Ozzatron: directionY did not exist at the time of the creation of this content. As such, it is ignored here. - Main.instance.TilesRenderer.Wind.GetWindTime(i, j, WindPushLifetime, out int windTimeLeft, out int direction, out _); - - float windInterpolant = windTimeLeft / (float)WindPushLifetime; - float windRotation = Utils.GetLerpValue(0f, 0.5f, windInterpolant, true) * Utils.GetLerpValue(1f, 0.5f, windInterpolant, true) * direction * 0.34f; - - int frameX = Main.tile[i, j].TileFrameX; - Color drawColor = Lighting.GetColor(i, j); - Texture2D stamenTexture = StamenTexture.Value; - Rectangle stamenFrame = stamenTexture.Frame(2, 1, frameX > 72 ? 1 : 0, 0); - Vector2 stamenOrigin = stamenFrame.Size() * new Vector2(0.5f, 1f); - Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - Vector2 drawPos = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffset + new Vector2(31f, 38f); - if (frameX < 72) - drawPos.X += 4f; - - // Create some pollen dust. - if (!Main.gamePaused && windTimeLeft >= 2 && Main.rand.NextBool(4)) - { - Vector2 pollenVelocity = -Vector2.UnitY.RotatedByRandom(windRotation * 2.3f) * 3f; - Dust pollen = Dust.NewDustPerfect(drawPos + Main.screenPosition - drawOffset - Vector2.UnitY * 16f, DustID.JungleSpore); - pollen.velocity = pollenVelocity; - pollen.scale = 1.6f; - } - - Main.spriteBatch.Draw(stamenTexture, drawPos, stamenFrame, drawColor, windRotation, stamenOrigin, 1f, SpriteEffects.None, 0f); - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 4; - } - } -} diff --git a/Tiles/FloralParadise/PinkFlowerBig.png b/Tiles/FloralParadise/PinkFlowerBig.png deleted file mode 100644 index b8611c19c8..0000000000 Binary files a/Tiles/FloralParadise/PinkFlowerBig.png and /dev/null differ diff --git a/Tiles/FloralParadise/PinkFlowerBigStamen.png b/Tiles/FloralParadise/PinkFlowerBigStamen.png deleted file mode 100644 index 146950fb0d..0000000000 Binary files a/Tiles/FloralParadise/PinkFlowerBigStamen.png and /dev/null differ diff --git a/Tiles/FloralParadise/PinkFlowerStamen.png b/Tiles/FloralParadise/PinkFlowerStamen.png deleted file mode 100644 index 9641dcb280..0000000000 Binary files a/Tiles/FloralParadise/PinkFlowerStamen.png and /dev/null differ diff --git a/Tiles/FloralParadise/SmallFloralPlants.cs b/Tiles/FloralParadise/SmallFloralPlants.cs deleted file mode 100644 index 4bbd8ef9a8..0000000000 --- a/Tiles/FloralParadise/SmallFloralPlants.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class SmallFloralPlants : ModTile - { - public const int Variants = 8; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileCut[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileObsidianKill[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - - HitSound = SoundID.Grass; - DustType = DustID.Grass; - AddMapEntry(new Color(28, 216, 94)); - } - - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) - { - offsetY = 2; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 4; - } - - public override void NearbyEffects(int i, int j, bool closer) - { - if (CalamityUtils.ParanoidTileRetrieval(i, j).LiquidAmount > 64) - WorldGen.KillTile(i, j); - } - } -} diff --git a/Tiles/FloralParadise/SmallFloralPlants.png b/Tiles/FloralParadise/SmallFloralPlants.png deleted file mode 100644 index f16c30cd3a..0000000000 Binary files a/Tiles/FloralParadise/SmallFloralPlants.png and /dev/null differ diff --git a/Tiles/FloralParadise/SmallMossPiles.cs b/Tiles/FloralParadise/SmallMossPiles.cs deleted file mode 100644 index 0e9c4dc5cb..0000000000 --- a/Tiles/FloralParadise/SmallMossPiles.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class SmallMossPiles : ModTile - { - public const int Variants = 4; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileObsidianKill[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 1; - TileObjectData.newTile.Height = 1; - TileObjectData.newTile.Origin = new Point16(0, 0); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.RandomStyleRange = Variants; - - TileObjectData.addTile(Type); - - DustType = DustID.Mud; - - AddMapEntry(new Color(56, 56, 56)); - } - - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) - { - offsetY = 2; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 4; - } - } -} diff --git a/Tiles/FloralParadise/SmallMossPiles.png b/Tiles/FloralParadise/SmallMossPiles.png deleted file mode 100644 index 78133c1a7d..0000000000 Binary files a/Tiles/FloralParadise/SmallMossPiles.png and /dev/null differ diff --git a/Tiles/FloralParadise/SmallVines.cs b/Tiles/FloralParadise/SmallVines.cs deleted file mode 100644 index 7497023bda..0000000000 --- a/Tiles/FloralParadise/SmallVines.cs +++ /dev/null @@ -1,95 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class SmallVines : ModTile - { - public override void SetStaticDefaults() - { - Main.tileCut[Type] = true; - Main.tileBlockLight[Type] = true; - Main.tileLavaDeath[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileFrameImportant[Type] = true; - AddMapEntry(new Color(100, 151, 31)); - HitSound = SoundID.Grass; - DustType = DustID.Grass; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - - public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem) - { - if (WorldGen.genRand.NextBool(2) && Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].cordage) - Item.NewItem(new EntitySource_TileBreak(i, j), new Vector2(i * 16 + 8f, j * 16 + 8f), ItemID.VineRope); - - if (Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType == Type) - { - WorldGen.KillTile(i, j + 1, false, false, false); - if (!Main.tile[i, j + 1].HasTile && Main.netMode != NetmodeID.SinglePlayer) - { - NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); - } - } - - if (Main.tile[i, j - 1].HasTile && Main.tile[i, j - 1].TileType == Type) - { - Main.tile[i, j - 1].TileFrameX = (short)(WorldGen.genRand.Next(3) * 18); - Main.tile[i, j - 1].TileFrameY = 54; - if (Main.netMode != NetmodeID.SinglePlayer) - NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); - } - } - - public override void RandomUpdate(int i, int j) - { - if (Main.tile[i, j + 1] != null) - { - if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != Type) - { - if (Main.tile[i, j + 1].LiquidAmount >= 128 && Main.tile[i, j + 1].LiquidType == LiquidID.Water) - { - bool canGrow = false; - for (int y = j; y > j - 10; j--) - { - if (Main.tile[i, y].BottomSlope) - { - canGrow = false; - break; - } - if (Main.tile[i, y].HasTile && !Main.tile[i, y].BottomSlope) - { - canGrow = true; - break; - } - } - if (canGrow) - { - int below = j + 1; - Main.tile[i, below].TileType = Type; - Main.tile[i, below].TileFrameX = (short)(WorldGen.genRand.Next(3) * 18); - Main.tile[i, below].TileFrameY = 54; - Main.tile[i, below - 1].TileFrameX = (short)(WorldGen.genRand.Next(3) * 18); - Main.tile[i, below - 1].TileFrameY = (short)(WorldGen.genRand.Next(3) * 18); - Main.tile[i, below].Get().HasTile = true; - WorldGen.SquareTileFrame(i, below, true); - WorldGen.SquareTileFrame(i, below - 1, true); - if (Main.dedServ) - { - NetMessage.SendTileSquare(-1, i, below, 3, TileChangeType.None); - NetMessage.SendTileSquare(-1, i, below - 1, 3, TileChangeType.None); - } - } - } - } - } - } - } -} diff --git a/Tiles/FloralParadise/SmallVines.png b/Tiles/FloralParadise/SmallVines.png deleted file mode 100644 index 6b64a467be..0000000000 Binary files a/Tiles/FloralParadise/SmallVines.png and /dev/null differ diff --git a/Tiles/FloralParadise/SmallWallFungi.cs b/Tiles/FloralParadise/SmallWallFungi.cs deleted file mode 100644 index aa7d67c480..0000000000 --- a/Tiles/FloralParadise/SmallWallFungi.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.Enums; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class SmallWallFungi : ModTile - { - public const int Variants = 3; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 1; - TileObjectData.newTile.Height = 1; - TileObjectData.newTile.Origin = new Point16(0, 0); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.AnchorBottom = AnchorData.Empty; - TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, 1, 0); - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - DustType = DustID.Dirt; - - AddMapEntry(new Color(165, 126, 84)); - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - } -} diff --git a/Tiles/FloralParadise/SmallWallFungi.png b/Tiles/FloralParadise/SmallWallFungi.png deleted file mode 100644 index de025416bc..0000000000 Binary files a/Tiles/FloralParadise/SmallWallFungi.png and /dev/null differ diff --git a/Tiles/FloralParadise/SmallWallFungiLeft.cs b/Tiles/FloralParadise/SmallWallFungiLeft.cs deleted file mode 100644 index 7aeb6bf321..0000000000 --- a/Tiles/FloralParadise/SmallWallFungiLeft.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.Enums; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class SmallWallFungiLeft : ModTile - { - public const int Variants = 3; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 1; - TileObjectData.newTile.Height = 1; - TileObjectData.newTile.Origin = new Point16(0, 0); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.AnchorBottom = AnchorData.Empty; - TileObjectData.newTile.AnchorLeft = new AnchorData(AnchorType.SolidTile, 1, 0); - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - DustType = DustID.Dirt; - - AddMapEntry(new Color(165, 126, 84)); - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - } -} diff --git a/Tiles/FloralParadise/SmallWallFungiLeft.png b/Tiles/FloralParadise/SmallWallFungiLeft.png deleted file mode 100644 index 55d42f575c..0000000000 Binary files a/Tiles/FloralParadise/SmallWallFungiLeft.png and /dev/null differ diff --git a/Tiles/FloralParadise/TallFloralPlants.cs b/Tiles/FloralParadise/TallFloralPlants.cs deleted file mode 100644 index 45b8794cfd..0000000000 --- a/Tiles/FloralParadise/TallFloralPlants.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class TallFloralPlants : ModTile - { - public const int Variants = 12; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileCut[Type] = true; - Main.tileObsidianKill[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 2; - TileObjectData.newTile.Height = 1; - TileObjectData.newTile.Origin = new Point16(1, 0); - TileObjectData.newTile.CoordinateHeights = new int[] - { - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - - HitSound = SoundID.Grass; - DustType = DustID.Grass; - AddMapEntry(new Color(106, 135, 69)); - } - - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) - { - offsetY = 2; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 4; - } - - public override void NearbyEffects(int i, int j, bool closer) - { - if (CalamityUtils.ParanoidTileRetrieval(i, j).LiquidAmount > 64) - WorldGen.KillTile(i, j); - } - } -} diff --git a/Tiles/FloralParadise/TallFloralPlants.png b/Tiles/FloralParadise/TallFloralPlants.png deleted file mode 100644 index 45e35742a0..0000000000 Binary files a/Tiles/FloralParadise/TallFloralPlants.png and /dev/null differ diff --git a/Tiles/FloralParadise/VineLoops.cs b/Tiles/FloralParadise/VineLoops.cs deleted file mode 100644 index e7259e51c4..0000000000 --- a/Tiles/FloralParadise/VineLoops.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.Enums; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class VineLoops : ModTile - { - public const int Variants = 3; - - public override void SetStaticDefaults() - { - Main.tileCut[Type] = true; - Main.tileBlockLight[Type] = true; - Main.tileLavaDeath[Type] = true; - Main.tileNoFail[Type] = true; - Main.tileFrameImportant[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.AnchorBottom = AnchorData.Empty; - TileObjectData.newTile.AnchorTop = new(AnchorType.SolidTile, 2, 0); - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - - AddMapEntry(new Color(47, 75, 32)); - HitSound = SoundID.Grass; - DustType = DustID.Grass; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - } -} diff --git a/Tiles/FloralParadise/VineLoops.png b/Tiles/FloralParadise/VineLoops.png deleted file mode 100644 index 987e3b445d..0000000000 Binary files a/Tiles/FloralParadise/VineLoops.png and /dev/null differ diff --git a/Tiles/FloralParadise/WallLeaves.cs b/Tiles/FloralParadise/WallLeaves.cs deleted file mode 100644 index 8b74a74127..0000000000 --- a/Tiles/FloralParadise/WallLeaves.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.Enums; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class WallLeaves : ModTile - { - public const int Variants = 3; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.AnchorBottom = AnchorData.Empty; - TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, 2, 0); - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - - HitSound = SoundID.Grass; - DustType = DustID.Dirt; - - AddMapEntry(new Color(145, 170, 61)); - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - } -} diff --git a/Tiles/FloralParadise/WallLeaves.png b/Tiles/FloralParadise/WallLeaves.png deleted file mode 100644 index 2a9a284419..0000000000 Binary files a/Tiles/FloralParadise/WallLeaves.png and /dev/null differ diff --git a/Tiles/FloralParadise/WallLeavesLeft.cs b/Tiles/FloralParadise/WallLeavesLeft.cs deleted file mode 100644 index d68e4f0195..0000000000 --- a/Tiles/FloralParadise/WallLeavesLeft.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.Enums; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class WallLeavesLeft : ModTile - { - public const int Variants = 3; - - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.AnchorBottom = AnchorData.Empty; - TileObjectData.newTile.AnchorLeft = new AnchorData(AnchorType.SolidTile, 2, 0); - TileObjectData.newTile.RandomStyleRange = Variants; - TileObjectData.addTile(Type); - - HitSound = SoundID.Grass; - DustType = DustID.Dirt; - - AddMapEntry(new Color(145, 170, 61)); - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - } -} diff --git a/Tiles/FloralParadise/WallLeavesLeft.png b/Tiles/FloralParadise/WallLeavesLeft.png deleted file mode 100644 index a82df1d3ea..0000000000 Binary files a/Tiles/FloralParadise/WallLeavesLeft.png and /dev/null differ diff --git a/Tiles/FloralParadise/WaterfallCreator.cs b/Tiles/FloralParadise/WaterfallCreator.cs deleted file mode 100644 index 9bda03602b..0000000000 --- a/Tiles/FloralParadise/WaterfallCreator.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CalamityMod.Particles; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Tiles.FloralParadise -{ - public class WaterfallCreator : ModTile - { - public override void SetStaticDefaults() - { - Main.tileSolid[Type] = false; - Main.tileBlockLight[Type] = true; - Main.tileBrick[Type] = true; - - CalamityUtils.MergeWithGeneral(Type); - CalamityUtils.MergeWithOres(Type); - CalamityUtils.MergeWithFloralParadise(Type); - - HitSound = SoundID.Tink; - - AddMapEntry(new Color(33, 56, 27)); - } - - public override void NearbyEffects(int i, int j, bool closer) - { - Tile tile = CalamityUtils.ParanoidTileRetrieval(i, j); - if (Main.dedServ || !Main.rand.NextBool() || Main.gamePaused || tile.LiquidAmount > 0) - return; - - for (int k = 0; k < 16; k++) - { - Vector2 waterVelocity = -Vector2.UnitY.RotatedByRandom(0.29f) * Main.rand.NextFloat(1f, 2.4f); - float waterScale = Main.rand.NextFloat(0.08f, 0.12f); - Color waterColor = Color.Lerp(Color.Cyan, Color.SkyBlue, Main.rand.NextFloat()); - Vector2 particlePosition = new Vector2(i + 0.5f, j + 0.5f) * 16f + Vector2.UnitY * Main.rand.NextFloat(24f); - GeneralParticleHandler.SpawnParticle(new WaterFoamParticle(particlePosition, waterVelocity, 150, waterScale, waterColor)); - } - } - } -} diff --git a/Tiles/FloralParadise/WaterfallCreator.png b/Tiles/FloralParadise/WaterfallCreator.png deleted file mode 100644 index 622533204a..0000000000 Binary files a/Tiles/FloralParadise/WaterfallCreator.png and /dev/null differ diff --git a/Tiles/Ores/PerennialOre.cs b/Tiles/Ores/PerennialOre.cs index a3fc7bb519..2340f44e3e 100644 --- a/Tiles/Ores/PerennialOre.cs +++ b/Tiles/Ores/PerennialOre.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Tiles.Ores Main.tileShine2[Type] = true; CalamityUtils.MergeWithGeneral(Type); - CalamityUtils.MergeWithFloralParadise(Type); TileID.Sets.Ore[Type] = true; TileID.Sets.OreMergesWithMud[Type] = true; diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index d597f965bc..6e17f8856c 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -348,8 +348,6 @@ namespace CalamityMod public static bool InSulphur(this Player player) => player.Calamity().ZoneSulphur; - public static bool InFloralParadise(this Player player) => player.Calamity().ZoneFloralParadise; - public static bool InAstral(this Player player, int biome = 0) //1 is above ground, 2 is underground, 3 is desert { switch (biome) diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 6830bc572b..28e6382e8d 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -8,7 +8,6 @@ using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; using CalamityMod.Tiles.Crags; -using CalamityMod.Tiles.FloralParadise; using CalamityMod.Tiles.FurnitureAbyss; using CalamityMod.Tiles.FurnitureAshen; using CalamityMod.Tiles.FurnitureDriftwood; @@ -533,17 +532,6 @@ namespace CalamityMod TileType(), }); - /// - /// Makes the tile merge with all the tile types that generate within various types of floral paradise tiles. - /// - /// The tile whose merging properties will be set. - public static void MergeWithFloralParadise(int type) => MergeWithSet(type, new int[] { - TileType(), - TileType(), - TileType(), - TileType(), - }); - /// /// Makes the tile merge with all the tile types that generate within various types of astral tiles /// diff --git a/Waterfalls/WaterfallRenderer.cs b/Waterfalls/WaterfallRenderer.cs deleted file mode 100644 index c70c472cde..0000000000 --- a/Waterfalls/WaterfallRenderer.cs +++ /dev/null @@ -1,105 +0,0 @@ -using CalamityMod.Graphics.Primitives; -using CalamityMod.Tiles.FloralParadise; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using Terraria; -using Terraria.Graphics.Shaders; -using Terraria.ModLoader; - -namespace CalamityMod.Waterfalls -{ - public static class WaterfallRenderer - { - private static Vector2 currentWaterfallPosition; - - private static float currentWaterfallBrightness; - - private static float currentWaterfallHeight; - - internal static float PrimitiveWidthFunction(float completionRatio, Vector2 vertexPos) - { - float baseWidth = MathHelper.Lerp(16f, 6f, Utils.GetLerpValue(36f, 216f, currentWaterfallHeight, true)); - float positionOffset = currentWaterfallPosition.X * 0.17f % 300f + currentWaterfallPosition.Y * 0.33f % 300f; - float x1Offset = (float)(Math.Sin(-Main.GlobalTimeWrappedHourly * 3f + completionRatio * 9f + positionOffset) * 0.5f + 0.5f) * baseWidth * 0.2f; - float x2Offset = (float)(Math.Sin(-Main.GlobalTimeWrappedHourly * 6f + completionRatio * 6f + positionOffset) * 0.5f + 0.5f) * baseWidth * 0.25f; - - if (completionRatio < 0.2f) - return MathHelper.SmoothStep(1f, baseWidth + x2Offset - x1Offset, Utils.GetLerpValue(0f, 0.2f, completionRatio, true)); - return baseWidth + x2Offset + MathHelper.SmoothStep(0f, baseWidth * 0.85f, Utils.GetLerpValue(0.84f, 0.96f, completionRatio, true)) - x1Offset; - } - - internal static Color PrimitiveColorFunction(float completionRatio, Vector2 vertexPos) - { - Color c = Color.Lerp(Color.Cyan, new Color(1f, 1f, 1f, 0f), (float)Math.Pow(Utils.GetLerpValue(0.75f, 1f, completionRatio, true), 0.68)); - return c; - } - - public static IEnumerable FindNearbyWaterfallRenderers() - { - int waterfallGeneratorID = ModContent.TileType(); - Point center = Main.LocalPlayer.Center.ToTileCoordinates(); - for (int i = -Main.screenWidth / 16 - 10; i < Main.screenWidth / 16 + 10; i++) - { - for (int j = -Main.screenHeight / 16 - 10; j < Main.screenHeight / 16 + 10; j++) - { - Tile tile = CalamityUtils.ParanoidTileRetrieval(center.X + i, center.Y + j); - if (tile.TileType != waterfallGeneratorID || !tile.HasTile) - continue; - - yield return new Vector2(center.X + i, center.Y + j); - } - } - } - - public static void DrawWaterfalls() - { - foreach (Vector2 drawTilePosition in FindNearbyWaterfallRenderers()) - { - Vector2 drawPosition = drawTilePosition * 16f; - Vector2 bottom = drawPosition; - for (int i = 0; i < 16; i++) - { - if (CalamityUtils.ParanoidTileRetrieval((int)drawTilePosition.X, (int)drawTilePosition.Y + i).LiquidAmount > 0) - { - bottom.Y += i * 16f; - break; - } - } - - bottom.Y += 4f; - currentWaterfallHeight = MathHelper.Distance(bottom.Y, drawPosition.Y); - if (currentWaterfallHeight <= 20f) - continue; - - currentWaterfallBrightness = Lighting.Brightness((int)(drawPosition.X / 16f), (int)(drawPosition.Y / 16f)); - currentWaterfallPosition = drawPosition + Vector2.One * 8f; - - Vector2[] drawPoints = new Vector2[] - { - drawPosition, - Vector2.Lerp(drawPosition, bottom, 0.5f), - bottom - }; - - // Determine the position of the waterfall's ambience sound. - float distanceFromWaterfall = Main.LocalPlayer.Distance(drawPosition + Vector2.One * 8f); - float distanceFromOldWaterfall = 100000f; - if (Main.ambientWaterfallX != -1f && Main.ambientWaterfallY != -1f) - distanceFromOldWaterfall = Main.LocalPlayer.Distance(new Vector2(Main.ambientWaterfallX, Main.ambientWaterfallY)); - - if (distanceFromOldWaterfall > distanceFromWaterfall) - { - Main.ambientWaterfallX = drawPosition.X + 8f; - Main.ambientWaterfallY = drawPosition.Y + 8f; - Main.ambientWaterfallStrength = MathHelper.Max(Main.ambientWaterfallStrength, Utils.GetLerpValue(740f, 300f, distanceFromWaterfall, true)); - } - - GameShaders.Misc["CalamityMod:Waterfall"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/WorleyNoise")); - GameShaders.Misc["CalamityMod:Waterfall"].UseOpacity((float)Math.Pow(currentWaterfallBrightness, 0.62)); - PrimitiveRenderer.RenderTrail(drawPoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, shader: GameShaders.Misc["CalamityMod:Waterfall"]), 80); - } - } - } -} diff --git a/World/Minibiomes/FloralParadiseMinibiome.cs b/World/Minibiomes/FloralParadiseMinibiome.cs deleted file mode 100644 index 511652ec56..0000000000 --- a/World/Minibiomes/FloralParadiseMinibiome.cs +++ /dev/null @@ -1,535 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using CalamityMod.Tiles.DraedonStructures; -using CalamityMod.Tiles.FloralParadise; -using CalamityMod.Tiles.SunkenSea; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; -using Terraria.Utilities; -using Terraria.WorldBuilding; - -namespace CalamityMod.World.Minibiomes -{ - public class FloralParadiseMinibiome - { - // 02JUN2024: Ozzatron: Disable generation of the Floral Paradise biome on the assumption that it will break horribly until tested. - internal static readonly bool SHOULD_GENERATE = false; - - // Constants pertaining to the more important details of the world-gen, to allow for ease-of-change. - // Certain numbers are hardcoded and not present here, but they tend to be in regards to things that either really shouldn't need changing or - // are extremely subtle details. - public const int TotalCavesInMediumWorld = 3; - - public const int MaxHorizontalDistanceFromWorldCenter = 1250; - - public const int MinSurfaceDepth = 250; - - public const int MaxSurfaceDepth = 420; - - public const int BlacklistedTileCheckArea = 50; - - public const float CaveOpennessFactor = 0.08f; - - public const float WallOpennessFactor = 0.135f; - - public const int TotalSecondaryDirtCreationPasses = 1; - - public const float SecondaryPassDirtCreationChance = 0.5f; - - public const int MinVigorousVineLength = 6; - - public const int MaxVigorousVineLength = 16; - - public const int MinSmallVineLength = 9; - - public const int MaxSmallVineLength = 17; - - public const int MinSmallVineCount = 45; - - public const int MaxSmallVineCount = 64; - - public const int MinPondWaterTileCount = 180; - - public const int MaxPondWaterTileCount = 210; - - public static int[] BlacklistedNearbyTiles => new int[] - { - TileID.Sand, - TileID.Sandstone, - TileID.HardenedSand, - TileID.DesertFossil, - TileID.SnowBlock, - TileID.IceBlock, - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), - }; - - public static void GenerateInstances() - { - float worldSize = Main.maxTilesX / 4200f; - int totalCaves = (int)(worldSize * TotalCavesInMediumWorld); - int infiniteLoopPreventerIncrement = 0; - List existingCaveAreas = new List(); - for (int i = 0; i < totalCaves - 1; i++) - { - // Use an emergency infinite loop increment. - // The placement loop is left if it exceeds an extremely large quantity. - // This exists primarily due to potential issues in small worlds. - // This will likely never be hit in typical circumstances, but it's better to be safe than sorry. - infiniteLoopPreventerIncrement++; - if (infiniteLoopPreventerIncrement >= 3000) - break; - - int x = Main.maxTilesX / 2 + WorldGen.genRand.Next(-MaxHorizontalDistanceFromWorldCenter, MaxHorizontalDistanceFromWorldCenter); - int y = (int)Main.worldSurface + WorldGen.genRand.Next(MinSurfaceDepth, MaxSurfaceDepth); - int width = (int)(WorldGen.genRand.Next(127, 140) * worldSize); - int height = (int)(WorldGen.genRand.Next(80, 104) * worldSize); - Rectangle caveArea = Utils.CenteredRectangle(new Vector2(x, y), new Vector2(width, height)); - - // Try again if this selected location is near blacklisted tiles. - // This is done to prevent logical consistencies/intrusion on unrelated biomes. - bool needsToTryAgain = false; - for (int dx = -BlacklistedTileCheckArea; dx < BlacklistedTileCheckArea; dx++) - { - for (int dy = -BlacklistedTileCheckArea; dy < BlacklistedTileCheckArea; dy++) - { - if (!needsToTryAgain) - { - Tile tile = CalamityUtils.ParanoidTileRetrieval(x + dx, y + dy); - needsToTryAgain = tile.HasTile && BlacklistedNearbyTiles.Contains(tile.TileType); - } - else - break; - } - } - - // If the blacklisted tile check was passed, check to see if the potential spot is near. - if (!needsToTryAgain) - needsToTryAgain = existingCaveAreas.Any(c => caveArea.Intersects(c)); - - if (needsToTryAgain) - { - i--; - continue; - } - - Place(caveArea); - existingCaveAreas.Add(caveArea); - } - - // Generate a single, special living tree on the surface with a floral paradise biome underneath. - for (int i = 0; i < 2000; i++) - { - int x = Main.maxTilesX / 2 + WorldGen.genRand.Next(330, MaxHorizontalDistanceFromWorldCenter) * WorldGen.genRand.NextBool().ToDirectionInt(); - int y = (int)Main.worldSurface - 120; - if (!FloralParadiseTree.Create(new(x, y))) - continue; - break; - } - } - - public static void Place(Rectangle placementArea) - { - int seed = WorldGen.genRand.Next(); - int pondCount = WorldGen.genRand.Next(3); - int smallVineCount = WorldGen.genRand.Next(MinSmallVineCount, MaxSmallVineCount); - int waterTileCount = WorldGen.genRand.Next(MinPondWaterTileCount, MaxPondWaterTileCount); - int smallFlowerCount = WorldGen.genRand.Next(150, 200); - int bigTreeCount = WorldGen.genRand.Next(2, 5); - - CutOutCave(placementArea, seed, out bool[,] grassDirtMap); - GenerateDirtBehindGrass(placementArea, grassDirtMap); - GenerateWalls(placementArea, unchecked(seed - 8)); - GenerateVines(placementArea, smallVineCount); - GeneratePonds(placementArea, waterTileCount, pondCount); - CreateScenicPlants(placementArea, smallFlowerCount); - CreateTrees(placementArea, bigTreeCount); - - // Place a blood orange. THIS IS FOR TESTING PURPOSES. - for (int i = 0; i < 1; i++) - { - int x = placementArea.X + WorldGen.genRand.Next(24, placementArea.Width - 24); - int y = placementArea.Y + WorldGen.genRand.Next(18, placementArea.Height - 18); - Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y); - if (!WorldGen.SolidTile(x, y + 1) || !WorldGen.SolidTile(x + 1, y + 1) || tile.HasTile || tile.LiquidAmount > 0) - { - i--; - continue; - } - x--; - - for (int dx = 0; dx < 3; dx++) - { - for (int dy = 0; dy < 3; dy++) - { - Main.tile[x + dx, y + dy].TileType = (ushort)ModContent.TileType(); - Main.tile[x + dx, y + dy].TileFrameX = (short)(dx * 18); - Main.tile[x + dx, y + dy].TileFrameY = (short)(dy * 18); - Main.tile[x + dx, y + dy].Get().HasTile = true; - } - } - } - } - - public static void CutOutCave(Rectangle placementArea, int seed, out bool[,] grassDirtMap) - { - // Calculate the initial cell states with perlin noise. - // To be specific, it uses values near the midpoint of 0.5 as open caves. - // This helps solve the problem of having disconnected areas that using min/max threshold values causes. - bool[,] caveState = new bool[placementArea.Width, placementArea.Height]; - for (int i = 0; i < placementArea.Width; i++) - { - for (int j = 0; j < placementArea.Height; j++) - { - float noise = CalamityUtils.PerlinNoise2D(i / 240f, j / 180f, 3, seed) * 0.5f + 0.5f; - caveState[i, j] = MathHelper.Distance(noise, 0.56f) < CaveOpennessFactor; - if (WorldGen.genRand.NextBool(3)) - caveState[i, j] = WorldGen.genRand.NextBool(); - } - } - - // Repeatedly smoothen out the cave state with celluar automata. - for (int i = 0; i < 8; i++) - caveState = CalamityUtils.SimulateCelluarAutomata(caveState); - - // Reset tile states based on the above results. - ushort grassID = (ushort)ModContent.TileType(); - ushort stoneID = (ushort)ModContent.TileType(); - grassDirtMap = new bool[placementArea.Width, placementArea.Height]; - for (int x = placementArea.X; x < placementArea.X + placementArea.Width; x++) - { - for (int y = placementArea.Y; y < placementArea.Y + placementArea.Height; y++) - { - // Don't attempt to change tile data if a tile is outside of the world for some reason. - if (!WorldGen.InWorld(x, y, 1)) - continue; - - int arrayRelativeX = x - placementArea.X; - int arrayRelativeY = y - placementArea.Y; - Vector2 normalizedPosition = new Vector2(arrayRelativeX / (float)placementArea.Width, arrayRelativeY / (float)placementArea.Height); - float distanceFromCenter = Vector2.Distance(normalizedPosition, Vector2.One * 0.5f) * 1.75f; - if (distanceFromCenter > 1f) - distanceFromCenter = 1f; - - float ditherChance = Utils.GetLerpValue(0.97f, 0.72f, distanceFromCenter, true); - - Main.tile[x, y].WallType = WallID.None; - if (WorldGen.genRand.NextFloat() < ditherChance) - { - if (!caveState[arrayRelativeX, arrayRelativeY] && distanceFromCenter < 0.7f) - Main.tile[x, y].ClearEverything(); - else - { - bool useGrass = CalamityUtils.CountCellsAtPosition(caveState, arrayRelativeX, arrayRelativeY, false) >= 1 && distanceFromCenter < 0.72f; - grassDirtMap[arrayRelativeX, arrayRelativeY] = useGrass; - Main.tile[x, y].ClearEverything(); - Main.tile[x, y].ResetToType(useGrass ? grassID : stoneID); - WorldGen.SquareTileFrame(x, y); - } - } - } - } - } - - public static void GenerateDirtBehindGrass(Rectangle placementArea, bool[,] grassDirtMap) - { - ushort dirtID = (ushort)ModContent.TileType(); - ushort stoneID = (ushort)ModContent.TileType(); - ushort grassID = (ushort)ModContent.TileType(); - - // Perform secondary passes that overlay dirt behind grass. - for (int i = 0; i < TotalSecondaryDirtCreationPasses + 1; i++) - { - for (int x = placementArea.X; x < placementArea.X + placementArea.Width; x++) - { - for (int y = placementArea.Y; y < placementArea.Y + placementArea.Height; y++) - { - int arrayRelativeX = x - placementArea.X; - int arrayRelativeY = y - placementArea.Y; - bool nearbyGrassOrDirt = false; - if (arrayRelativeX - 1 >= 0 && grassDirtMap[arrayRelativeX - 1, arrayRelativeY]) - nearbyGrassOrDirt = true; - else if (arrayRelativeX + 1 < placementArea.Width && grassDirtMap[arrayRelativeX + 1, arrayRelativeY]) - nearbyGrassOrDirt = true; - else if (arrayRelativeY - 1 >= 0 && grassDirtMap[arrayRelativeX, arrayRelativeY - 1]) - nearbyGrassOrDirt = true; - else if (arrayRelativeY + 1 < placementArea.Height && grassDirtMap[arrayRelativeX, arrayRelativeY + 1]) - nearbyGrassOrDirt = true; - - // The first pass always generates dirt behind grass. - // However, successive passes only generate dirt with a specific probability. - // This makes the dirt feel more natural and connected to the underlying rock. - bool canPerformPlacement = i == 0 || WorldGen.genRand.NextFloat() < SecondaryPassDirtCreationChance; - Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y); - if (canPerformPlacement && tile.HasTile && tile.TileType == stoneID && nearbyGrassOrDirt) - Main.tile[x, y].TileType = dirtID; - } - } - - // Reset the dirt/grass map for the next pass. - // This is skipped on the last pass for performance reasons, since the map won't be used after that point. - if (i >= TotalSecondaryDirtCreationPasses) - continue; - - for (int x = placementArea.X; x < placementArea.X + placementArea.Width; x++) - { - for (int y = placementArea.Y; y < placementArea.Y + placementArea.Height; y++) - { - Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y); - int arrayRelativeX = x - placementArea.X; - int arrayRelativeY = y - placementArea.Y; - grassDirtMap[arrayRelativeX, arrayRelativeY] = tile.TileType == grassID || tile.TileType == dirtID; - } - } - } - } - - public static void GenerateWalls(Rectangle placementArea, int seed) - { - for (int x = placementArea.X; x < placementArea.X + placementArea.Width; x++) - { - for (int y = placementArea.Y; y < placementArea.Y + placementArea.Height; y++) - { - float noise = CalamityUtils.PerlinNoise2D(x / 160f, y / 160f, 3, seed) * 0.5f + 0.5f; - if (MathHelper.Distance(noise, 0.555f) < WallOpennessFactor) - Main.tile[x, y].WallType = WorldGen.genRand.NextBool(4) ? WallID.GrassUnsafe : WallID.FlowerUnsafe; - } - } - } - - public static void GenerateVines(Rectangle placementArea, int smallVineCount) - { - ushort[] vineIDs = new ushort[] - { - (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), - }; - - // Place small vines. - for (int i = 0; i < smallVineCount; i++) - { - int x = placementArea.X + WorldGen.genRand.Next(24, placementArea.Width - 24); - int y = placementArea.Y + WorldGen.genRand.Next(18, placementArea.Height - 18); - - // Ensure that the initial tile is empty and that there's a solid tile above for the vine to hang from. - // If these conditions are not met, try again. - if (CalamityUtils.ParanoidTileRetrieval(x, y).HasTile || !WorldGen.SolidTile(x, y - 1)) - { - i--; - continue; - } - - // Search to ensure that nothing is in the way of the vine's potential positions. - // If something is, try again. - int vineLength = WorldGen.genRand.Next(MinSmallVineLength, MaxSmallVineLength + 1); - bool neeedsToTryAgain = false; - for (int dy = 0; dy < vineLength; dy++) - { - if (CalamityUtils.ParanoidTileRetrieval(x, y + dy).HasTile) - { - neeedsToTryAgain = true; - break; - } - } - - if (neeedsToTryAgain) - { - i--; - continue; - } - - // Perform placement. - ushort vineID = WorldGen.genRand.Next(vineIDs); - for (int dy = 0; dy < vineLength; dy++) - { - Main.tile[x, y + dy].TileType = vineID; - if (dy == vineLength - 1) - { - Main.tile[x, y + dy].TileFrameX = (short)(WorldGen.genRand.Next(3) * 18); - Main.tile[x, y + dy].TileFrameY = 54; - } - else - { - Main.tile[x, y + dy].TileFrameX = (short)(WorldGen.genRand.Next(3) * 18); - Main.tile[x, y + dy].TileFrameY = (short)(WorldGen.genRand.Next(3) * 18); - } - Main.tile[x, y + dy].Get().HasTile = true; - WorldGen.SquareTileFrame(x, y, true); - } - } - } - - public static void GeneratePonds(Rectangle placementArea, int waterTileCount, int pondCount) - { - for (int i = 0; i < pondCount; i++) - { - int x = placementArea.X + WorldGen.genRand.Next(24, placementArea.Width - 24); - int y = placementArea.Y + WorldGen.genRand.Next(24, placementArea.Height - 24); - Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y); - if (tile.HasTile || tile.LiquidAmount > 0) - { - i--; - continue; - } - - // Go upward once an open area is found. This is where water will be created. - Point waterSpawnPoint = new Point(x, y); - for (int dy = 0; dy < 100; dy++) - { - if (CalamityUtils.ParanoidTileRetrieval(x, y - dy).HasTile) - { - waterSpawnPoint.Y -= dy - 1; - break; - } - } - - // Create a predetermined quantity of water via recursion. - // This starts at the initial water spawn point and the expands outward in all four cardinal directions repeatedly until either no more locations - // are valid or the water limit has been reached. - int increment = 0; - RecursivelyFillAreaWithWater(x, y, waterTileCount, ref increment); - - // Settle water and create waterfalls. - Liquid.QuickWater(3); - WorldGen.WaterCheck(); - Liquid.quickSettle = true; - Liquid.UpdateLiquid(); - WorldGen.WaterCheck(); - Liquid.quickSettle = false; - - for (int dy = 0; dy < 50; dy++) - { - if (CalamityUtils.ParanoidTileRetrieval(x, y + dy).LiquidAmount > 0) - { - Main.tile[x, y + dy - 8].Get().HasTile = true; - Main.tile[x, y + dy - 8].TileType = (ushort)ModContent.TileType(); - break; - } - } - } - } - - public static void CreateScenicPlants(Rectangle placementArea, int smallFlowerCount) - { - for (int i = 0; i < smallFlowerCount; i++) - { - int x = placementArea.X + WorldGen.genRand.Next(16, placementArea.Width - 16); - int y = placementArea.Y + WorldGen.genRand.Next(12, placementArea.Height - 12); - Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y); - if (tile.HasTile || tile.LiquidAmount > 0 || !WorldGen.SolidTile(x, y + 1)) - { - i--; - continue; - } - - Main.tile[x, y].TileType = (ushort)ModContent.TileType(); - Main.tile[x, y].TileFrameX = (short)(WorldGen.genRand.Next(8) * 18); - Main.tile[x, y].TileFrameY = 0; - Main.tile[x, y].Get().HasTile = true; - } - - // TODO -- Move this to another method. - int tries = 0; - WeightedRandom tileSelector = new(WorldGen.genRand); - tileSelector.Add(ModContent.TileType(), 0.66D); - tileSelector.Add(ModContent.TileType(), 0.66D); - tileSelector.Add(ModContent.TileType(), 0.66D); - tileSelector.Add(ModContent.TileType(), 0.66D); - tileSelector.Add(ModContent.TileType(), 0.66D); - tileSelector.Add(ModContent.TileType(), 1D); - tileSelector.Add(ModContent.TileType(), 1D); - tileSelector.Add(ModContent.TileType(), 1D); - tileSelector.Add(ModContent.TileType(), 1D); - tileSelector.Add(ModContent.TileType(), 0.5D); - tileSelector.Add(ModContent.TileType(), 1D); - tileSelector.Add(ModContent.TileType(), 1D); - tileSelector.Add(ModContent.TileType(), 1D); - tileSelector.Add(ModContent.TileType(), 1D); - tileSelector.Add(ModContent.TileType(), 1D); - tileSelector.Add(ModContent.TileType(), 1D); - tileSelector.Add(ModContent.TileType(), 1D); - - for (int i = 0; i < 2400; i++) - { - tries++; - if (tries >= 16000) - break; - - int x = placementArea.X + WorldGen.genRand.Next(16, placementArea.Width - 16); - int y = placementArea.Y + WorldGen.genRand.Next(12, placementArea.Height - 12); - if (WorldGen.genRand.NextBool() && WorldUtils.Find(new(x, y), Searches.Chain(new Searches.Down(400), new Conditions.IsSolid()), out Point result)) - y = result.Y - 1; - - Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y); - if (tile.HasTile || tile.LiquidAmount > 0) - { - i--; - continue; - } - - int tileID = tileSelector.Get(); - WorldGen.PlaceTile(x, y, tileID, style: WorldGen.genRand.Next(TileObjectData.GetTileData(tileID, 0).RandomStyleRange)); - } - } - - public static void CreateTrees(Rectangle placementArea, int treeCount) - { - int tries = 0; - int treeID = ModContent.TileType(); - - for (int i = 0; i < treeCount; i++) - { - tries++; - - int x = placementArea.X + WorldGen.genRand.Next(16, placementArea.Width - 16); - int y = placementArea.Y + WorldGen.genRand.Next(12, placementArea.Height - 12); - Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y); - Vector2 checkTopLeft = new Vector2(x, y).ToWorldCoordinates() - new Vector2(120f, 300f); - Vector2 checkArea = new Vector2(240f, 200f); - - if (tries >= 2500) - break; - - if (tile.HasTile || tile.LiquidAmount > 0 || !WorldGen.SolidTile(x, y + 1) || - !TileObject.CanPlace(x, y, treeID, 0, 0, out _, true, checkStay: true) || - Collision.SolidCollision(checkTopLeft, (int)checkArea.X, (int)checkArea.Y)) - { - i--; - continue; - } - - WorldGen.PlaceTile(x, y, treeID); - } - } - - #region Biome-Specific Utilities - - public static void RecursivelyFillAreaWithWater(int x, int y, int limit, ref int increment) - { - Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y); - if (tile.HasTile || tile.LiquidAmount > 127) - return; - - increment++; - if (increment >= limit) - return; - - Main.tile[x, y].LiquidAmount = 255; - RecursivelyFillAreaWithWater(x + 1, y, limit, ref increment); - RecursivelyFillAreaWithWater(x - 1, y, limit, ref increment); - RecursivelyFillAreaWithWater(x, y + 1, limit, ref increment); - RecursivelyFillAreaWithWater(x, y - 1, limit, ref increment); - } - - #endregion Biome-Specific Utilities - } -} diff --git a/World/Minibiomes/FloralParadiseTree.cs b/World/Minibiomes/FloralParadiseTree.cs deleted file mode 100644 index e6bb80098e..0000000000 --- a/World/Minibiomes/FloralParadiseTree.cs +++ /dev/null @@ -1,138 +0,0 @@ -using Microsoft.Xna.Framework; -using System.Collections.Generic; -using Terraria; -using Terraria.GameContent.Generation; -using Terraria.ID; -using Terraria.WorldBuilding; - -namespace CalamityMod.World.Minibiomes -{ - public class FloralParadiseTree - { - public const int TrunkHeight = 220; - - public const int TrunkWidth = 10; - - public const int TrunkHollowSpace = 4; - - public const int RootCount = 5; - - public static bool Create(Point placementPosition) - { - float worldSize = Main.maxTilesX / 4200f; - if (!WorldUtils.Find(new Point(placementPosition.X - 3, placementPosition.Y), Searches.Chain(new Searches.Down(400), new GenCondition[] - { - new Conditions.IsSolid().AreaAnd(6, 1) - }), out Point ground)) - { - return false; - } - - ground.Y += (int)(TrunkHeight * 0.645f); - - // Get all tiles in a specific area. - Dictionary tileCounts = new Dictionary(); - WorldUtils.Gen(new Point(ground.X - TrunkHeight / 2, ground.Y - TrunkHeight / 2), new Shapes.Rectangle(TrunkHeight, TrunkHeight), new Actions.TileScanner(new ushort[] - { - TileID.Dirt, - TileID.Stone, - TileID.Mud, - TileID.JungleGrass, - TileID.SnowBlock, - TileID.Sand, - }).Output(tileCounts)); - - int overworldTileCount = tileCounts[TileID.Dirt] + tileCounts[TileID.Stone]; - int jungleTileCount = tileCounts[TileID.Mud] + tileCounts[TileID.JungleGrass]; - - // Avoid jungles, deserts, and snow biomes. - if (tileCounts[TileID.SnowBlock] > jungleTileCount || jungleTileCount > overworldTileCount || overworldTileCount < 50 || tileCounts[TileID.Sand] >= 50) - return false; - - float trunkRotation = WorldGen.genRand.NextFloatDirection() * 0.116f; - for (int i = 0; i < TrunkHeight; i += 2) - { - Point currentPoint = (ground.ToVector2() - Vector2.UnitY.RotatedBy(trunkRotation) * i).ToPoint(); - - // Create the trunk. - WorldUtils.Gen(currentPoint, new Shapes.Rectangle(TrunkWidth, TrunkWidth), Actions.Chain(new GenAction[] - { - new Actions.ClearTile(), - new Actions.PlaceWall(WallID.LivingWood, true), - new Actions.PlaceTile(TileID.LivingMahogany) - })); - } - - // Generate roots. - for (int i = 0; i < RootCount; i++) - { - int rootLength = (int)(TrunkHeight * WorldGen.genRand.NextFloat(0.425f, 0.7f)); - float rootAngle = MathHelper.Lerp(-0.89f, 0.89f, i / (float)(RootCount - 1f)) + WorldGen.genRand.NextFloatDirection() * 0.074f + trunkRotation + MathHelper.PiOver2; - WorldUtils.Gen(ground, new ShapeRoot(rootAngle, rootLength, TrunkWidth - 1), Actions.Chain(new GenAction[] - { - new Actions.SetTile(TileID.LivingMahogany), - })); - } - - List branchEnds = new(); - Point topOfTrunk = (ground.ToVector2() - Vector2.UnitY.RotatedBy(trunkRotation) * (TrunkHeight - 4f)).ToPoint(); - - // Create side branches. - for (int i = 0; i < RootCount - 1; i++) - { - int branchLength = WorldGen.genRand.Next(26, 49); - float branchDirectionX = -WorldGen.genRand.NextFloat(1.25f, 4.5f) * WorldGen.genRand.NextBool().ToDirectionInt(); - float branchDirectionY = -2f; - Vector2 branchDirection = new Vector2(branchDirectionX, branchDirectionY).SafeNormalize(Vector2.UnitX); - Point branchStart = (ground.ToVector2() - Vector2.UnitY.RotatedBy(trunkRotation) * Main.rand.NextFloat(0.45f, 0.84f) * TrunkHeight).ToPoint(); - WorldUtils.Gen(branchStart, new ShapeBranch(branchDirection.ToRotation(), branchLength).OutputEndpoints(branchEnds), Actions.Chain(new GenAction[] - { - new Actions.SetTile(TileID.LivingMahogany), - })); - } - - // Create branch leaves. - using (List.Enumerator enumerator = branchEnds.GetEnumerator()) - { - while (enumerator.MoveNext()) - { - WorldUtils.Gen(enumerator.Current, new Shapes.Circle(4), Actions.Chain(new GenAction[] - { - new Modifiers.Blotches(4, 2, 0.3), - new Actions.SetTile(TileID.LivingMahoganyLeaves), - new Actions.SetFrames(true) - })); - } - } - - // Create leaves at the top of the trunk. - WorldUtils.Gen(topOfTrunk, new Shapes.Circle(TrunkWidth * 2), Actions.Chain(new GenAction[] - { - new Modifiers.Blotches(3, 2, 0.1), - new Actions.SetTile(TileID.LivingMahoganyLeaves), - new Actions.SetFrames(true) - })); - - // Generate a cave in the roots of the biome. - int width = (int)(WorldGen.genRand.Next(104, 120) * worldSize); - int height = (int)(WorldGen.genRand.Next(88, 110) * worldSize); - Vector2 cavePosition = ground.ToVector2() + Vector2.UnitY * height * 0.44f; - Rectangle caveArea = Utils.CenteredRectangle(cavePosition, new Vector2(width, height)); - FloralParadiseMinibiome.Place(caveArea); - - // Clear out the inner part of the tiles to create an open space in the tree. - for (int i = 0; i < TrunkHeight * 0.9f; i += 2) - { - Point currentPoint = (ground.ToVector2() - Vector2.UnitY.RotatedBy(trunkRotation) * i).ToPoint(); - Point center = (currentPoint.ToVector2() + Vector2.One * TrunkHollowSpace - Vector2.UnitX * 2f).ToPoint(); - WorldUtils.Gen(center, new Shapes.Rectangle(TrunkHollowSpace, TrunkHollowSpace), Actions.Chain(new GenAction[] - { - new Actions.ClearTile(true), - new Actions.PlaceWall(WallID.LivingWood, true) - })); - } - - return true; - } - } -}