diff --git a/Backgrounds/AstralDesertBG.cs b/Backgrounds/AstralDesertBG.cs deleted file mode 100644 index 854191a17d..0000000000 --- a/Backgrounds/AstralDesertBG.cs +++ /dev/null @@ -1,114 +0,0 @@ -using Terraria; -using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; - -using CalamityMod.BiomeManagers; -using CalamityMod.World; - -namespace CalamityMod.Backgrounds -{ - internal static class AstralDesertBG - { - public static void Load() - { - if (Main.dedServ) - { - return; - } - - On_Main.DrawSurfaceBG += DrawAstralSnowBG; - } - - public static float Transparency; - - public static float TransitionSpeed => 0.02f; - - private static void DrawAstralSnowBG(On_Main.orig_DrawSurfaceBG orig, Main self) - { - if (Main.gameMenu) - { - orig(self); - - return; - } - - orig(self); - - if (Main.LocalPlayer.InModBiome(ModContent.GetInstance())) - { - Transparency += TransitionSpeed; - - if (Transparency > 1f) - { - Transparency = 1f; - } - } - else - { - Transparency -= TransitionSpeed; - - if (Transparency < 0f) - { - Transparency = 0f; - } - } - - //dont bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active) - if (Transparency > 0f && Main.BackgroundEnabled) - { - Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1)); - float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f; - float Scale = 2f; - - for (int Layers = 2; Layers >= 0; Layers--) - { - //get each background texture - Texture2D BGTexture = ModContent.Request("CalamityMod/Backgrounds/AstralDesertBG" + Layers).Value; - - Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f; - float num2 = (Layers * 2 + 3f); - Vector2 vector3 = new Vector2(1f / num2); - Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height); - Vector2 zero = Vector2.Zero; - - switch (Layers) - { - case 0: - { - zero.Y += 125f; - break; - } - case 1: - { - zero.Y += 170f; - break; - } - case 2: - { - zero.Y += 125f; - break; - } - } - - vector2 *= Scale; - - zero.Y -= num; - float RectangleScale = Scale * rectangle.Width; - int num6 = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / RectangleScale); - - for (int j = num6 - 2; j < num6 + 4 + (int)(Main.screenWidth / RectangleScale); j++) - { - int AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 2; - - Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), AstralBiomeHeight * 16f) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero; - var frame = rectangle; - var clr = new Color(50, 50, 50) * Transparency; - - Main.spriteBatch.Draw(BGTexture, drawPosition, frame, clr, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f); - } - } - } - } - } -} diff --git a/Backgrounds/AstralDesertBG0.png b/Backgrounds/AstralDesertSurfaceClose.png similarity index 100% rename from Backgrounds/AstralDesertBG0.png rename to Backgrounds/AstralDesertSurfaceClose.png diff --git a/Backgrounds/AstralDesertBG2.png b/Backgrounds/AstralDesertSurfaceFar.png similarity index 100% rename from Backgrounds/AstralDesertBG2.png rename to Backgrounds/AstralDesertSurfaceFar.png diff --git a/Backgrounds/AstralDesertBG1.png b/Backgrounds/AstralDesertSurfaceMiddle.png similarity index 100% rename from Backgrounds/AstralDesertBG1.png rename to Backgrounds/AstralDesertSurfaceMiddle.png diff --git a/Backgrounds/AstralSnowBG.cs b/Backgrounds/AstralSnowBG.cs deleted file mode 100644 index 526d9d4fe5..0000000000 --- a/Backgrounds/AstralSnowBG.cs +++ /dev/null @@ -1,132 +0,0 @@ -using Terraria; -using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; - -using CalamityMod.BiomeManagers; -using CalamityMod.World; - -namespace CalamityMod.Backgrounds -{ - internal static class AstralSnowBG - { - public static void Load() - { - if (Main.dedServ) - { - return; - } - - On_Main.DrawSurfaceBG += DrawAstralSnowBG; - } - - public static float Transparency; - - public static float TransitionSpeed => 0.02f; - - private static void DrawAstralSnowBG(On_Main.orig_DrawSurfaceBG orig, Main self) - { - if (Main.gameMenu) - { - orig(self); - - return; - } - - orig(self); - - if (Main.LocalPlayer.InModBiome(ModContent.GetInstance())) - { - Transparency += TransitionSpeed; - - if (Transparency > 1f) - { - Transparency = 1f; - } - } - else - { - Transparency -= TransitionSpeed; - - if (Transparency < 0f) - { - Transparency = 0f; - } - } - - //dont bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active) - if (Transparency > 0f && Main.BackgroundEnabled) - { - Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1)); - float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f; - float Scale = 2f; - - for (int Layers = 4; Layers >= 0; Layers--) - { - //get each background texture - Texture2D BGTexture = ModContent.Request("CalamityMod/Backgrounds/AstralSnowBG" + Layers).Value; - - Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f; - float num2 = (Layers * 2 + 3f); - Vector2 vector3 = new Vector2(1f / num2); - Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height); - Vector2 zero = Vector2.Zero; - - switch (Layers) - { - case 0: - { - zero.Y += 125f; - break; - } - case 1: - { - zero.Y += 160f; - break; - } - case 2: - { - zero.Y += 280f; - break; - } - case 3: - { - zero.Y += 135f; - break; - } - case 4: - { - zero.Y += 110f; - break; - } - } - - vector2 *= Scale; - - zero.Y -= num; - float RectangleScale = Scale * rectangle.Width; - int num6 = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / RectangleScale); - - for (int j = num6 - 2; j < num6 + 4 + (int)(Main.screenWidth / RectangleScale); j++) - { - int AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 2; - - Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), AstralBiomeHeight * 16f) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero; - var frame = rectangle; - var clr = new Color(50, 50, 50) * Transparency; - - Main.spriteBatch.Draw(BGTexture, drawPosition, frame, clr, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f); - - //draw glowmasks - if (Layers < 2) - { - Texture2D BGTextureGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSnowBG" + Layers + "_Glow").Value; - - Main.spriteBatch.Draw(BGTextureGlow, drawPosition, frame, Color.White * Transparency, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f); - } - } - } - } - } - } -} diff --git a/Backgrounds/AstralSurfaceBG.cs b/Backgrounds/AstralSurfaceBG.cs deleted file mode 100644 index 1a24522f03..0000000000 --- a/Backgrounds/AstralSurfaceBG.cs +++ /dev/null @@ -1,132 +0,0 @@ -using Terraria; -using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; - -using CalamityMod.BiomeManagers; -using CalamityMod.World; - -namespace CalamityMod.Backgrounds -{ - internal static class AstralSurfaceBG - { - public static void Load() - { - if (Main.dedServ) - { - return; - } - - On_Main.DrawSurfaceBG += DrawAstralBG; - } - - public static float Transparency; - - public static float TransitionSpeed => 0.02f; - - private static void DrawAstralBG(On_Main.orig_DrawSurfaceBG orig, Main self) - { - if (Main.gameMenu) - { - orig(self); - - return; - } - - orig(self); - - if (Main.LocalPlayer.InModBiome(ModContent.GetInstance())) - { - Transparency += TransitionSpeed; - - if (Transparency > 1f) - { - Transparency = 1f; - } - } - else - { - Transparency -= TransitionSpeed; - - if (Transparency < 0f) - { - Transparency = 0f; - } - } - - //dont bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active) - if (Transparency > 0f && Main.BackgroundEnabled) - { - Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1)); - float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f; - float Scale = 2f; - - for (int Layers = 4; Layers >= 0; Layers--) - { - //get each background texture - Texture2D BGTexture = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceBG" + Layers).Value; - - Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f; - float num2 = (Layers * 2 + 3f); - Vector2 vector3 = new Vector2(1f / num2); - Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height); - Vector2 zero = Vector2.Zero; - - switch (Layers) - { - case 0: - { - zero.Y += 125f; - break; - } - case 1: - { - zero.Y += 160f; - break; - } - case 2: - { - zero.Y += 280f; - break; - } - case 3: - { - zero.Y += 135f; - break; - } - case 4: - { - zero.Y += 110f; - break; - } - } - - vector2 *= Scale; - - zero.Y -= num; - float RectangleScale = Scale * rectangle.Width; - int num6 = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / RectangleScale); - - for (int j = num6 - 2; j < num6 + 4 + (int)(Main.screenWidth / RectangleScale); j++) - { - int AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 2; - - Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), AstralBiomeHeight * 16f) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero; - var frame = rectangle; - var clr = new Color(50, 50, 50) * Transparency; - - Main.spriteBatch.Draw(BGTexture, drawPosition, frame, clr, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f); - - //draw glowmasks - if (Layers < 3) - { - Texture2D BGTextureGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceBG" + Layers + "_Glow").Value; - - Main.spriteBatch.Draw(BGTextureGlow, drawPosition, frame, Color.White * Transparency, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f); - } - } - } - } - } - } -} diff --git a/Backgrounds/AstralSurfaceBG0.png b/Backgrounds/AstralSurfaceBG0.png deleted file mode 100644 index d9db0020e9..0000000000 Binary files a/Backgrounds/AstralSurfaceBG0.png and /dev/null differ diff --git a/Backgrounds/AstralSurfaceBG0_Glow.png b/Backgrounds/AstralSurfaceBG0_Glow.png deleted file mode 100644 index 6fca957aaa..0000000000 Binary files a/Backgrounds/AstralSurfaceBG0_Glow.png and /dev/null differ diff --git a/Backgrounds/AstralSurfaceBG1.png b/Backgrounds/AstralSurfaceBG1.png deleted file mode 100644 index 166e8bc48d..0000000000 Binary files a/Backgrounds/AstralSurfaceBG1.png and /dev/null differ diff --git a/Backgrounds/AstralSurfaceBG1_Glow.png b/Backgrounds/AstralSurfaceBG1_Glow.png deleted file mode 100644 index 3fafef6c36..0000000000 Binary files a/Backgrounds/AstralSurfaceBG1_Glow.png and /dev/null differ diff --git a/Backgrounds/AstralSurfaceBG3.png b/Backgrounds/AstralSurfaceBG3.png deleted file mode 100644 index de6901e9e4..0000000000 Binary files a/Backgrounds/AstralSurfaceBG3.png and /dev/null differ diff --git a/Backgrounds/AstralSurfaceBG4.png b/Backgrounds/AstralSurfaceBG4.png deleted file mode 100644 index 8f448fb3b4..0000000000 Binary files a/Backgrounds/AstralSurfaceBG4.png and /dev/null differ diff --git a/Backgrounds/AstralSurfaceBGStyle.cs b/Backgrounds/AstralSurfaceBGStyle.cs index 8bb3cd6fd7..bc53eed640 100644 --- a/Backgrounds/AstralSurfaceBGStyle.cs +++ b/Backgrounds/AstralSurfaceBGStyle.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Backgrounds if (fades[i] < 0f) { fades[i] = 0f; + } } } } diff --git a/Backgrounds/SulphurSeaBG.cs b/Backgrounds/SulphurSeaBG.cs deleted file mode 100644 index e46c6357f6..0000000000 --- a/Backgrounds/SulphurSeaBG.cs +++ /dev/null @@ -1,121 +0,0 @@ -using Terraria; -using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; - -using CalamityMod.World; -using CalamityMod.Systems; - -namespace CalamityMod.Backgrounds -{ - internal static class SulphurSeaBG - { - public static void Load() - { - if (Main.dedServ) - { - return; - } - - On_Main.DrawBG += DrawSulphurBG; - } - - public static float Transparency; - - public static float TransitionSpeed => 0.02f; - - private static void DrawSulphurBG(On_Main.orig_DrawBG orig, Main self) - { - //conditions for the sulphur sea biome (copied directly from the biome manager) - Point point = Main.LocalPlayer.Center.ToTileCoordinates(); - bool sulphurPosX = false; - - if (Abyss.AtLeftSideOfWorld) - { - if (point.X < 435) - { - sulphurPosX = true; - } - } - else - { - if (point.X > Main.maxTilesX - 435) - { - sulphurPosX = true; - } - } - - bool inSulphurSeaBiome = (BiomeTileCounterSystem.SulphurTiles >= 300 || (point.Y < (Main.rockLayer - Main.maxTilesY / 13) && sulphurPosX && !WeakReferenceSupport.InAnySubworld())) && !Main.LocalPlayer.Calamity().ZoneAbyss; - - //dont run if you are on the menu - if (Main.gameMenu) - { - orig(self); - - return; - } - - //always call orig - orig(self); - - //increase transparency while in the biome, and decrease it if not - if (inSulphurSeaBiome) - { - Transparency += TransitionSpeed; - - if (Transparency > 1f) - { - Transparency = 1f; - } - } - else - { - Transparency -= TransitionSpeed; - - if (Transparency < 0f) - { - Transparency = 0f; - } - } - - //dont bother running any of the background drawing if the transparency is zero (meaning the background isnt actually being used in game) - if (Transparency > 0f && Main.BackgroundEnabled) - { - Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1)); - float ZoomPos = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f; - - //the scale of the entire background - float Scale = 2f; - - //get each background texture - Texture2D BGTexture = ModContent.Request("CalamityMod/Backgrounds/SulphurSeaBG").Value; - Texture2D BGFrontTexture = ModContent.Request("CalamityMod/Backgrounds/SulphurSeaBGFront").Value; - - Vector2 BackgroundTexCenter = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f; - Vector2 vector3 = new Vector2(1f / 3f); - Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height); - Vector2 zero = Vector2.Zero; - - BackgroundTexCenter *= Scale; - - zero.Y -= ZoomPos; - float RectangleScale = Scale * rectangle.Width; - int num6 = (int)((vector.X * vector3.X - BackgroundTexCenter.X + zero.X - (Main.screenWidth >> 1)) / RectangleScale); - - for (int j = num6 - 2; j < num6 + 4 + (int)(Main.screenWidth / RectangleScale); j++) - { - int sulphurSeaHeight = SulphurousSea.YStart; - - Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), sulphurSeaHeight * 16f) + BackgroundTexCenter - vector) * vector3 + vector - Main.screenPosition - BackgroundTexCenter + zero; - - var frame = rectangle; - var color = Main.ColorOfTheSkies * Transparency; - var frontColor = Color.LightSeaGreen * 0.5f; - - Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(BGFrontTexture, drawPosition, frame, frontColor * Transparency, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f); - } - } - } - } -} diff --git a/Backgrounds/SulphurSeaBGFront.png b/Backgrounds/SulphurSeaBGFront.png deleted file mode 100644 index 6058c2345d..0000000000 Binary files a/Backgrounds/SulphurSeaBGFront.png and /dev/null differ diff --git a/Backgrounds/SulphurSeaSky.png b/Backgrounds/SulphurSeaSky.png deleted file mode 100644 index c4e3558a69..0000000000 Binary files a/Backgrounds/SulphurSeaSky.png and /dev/null differ diff --git a/Backgrounds/SulphurSeaBG.png b/Backgrounds/SulphurSeaSurfaceClose.png similarity index 100% rename from Backgrounds/SulphurSeaBG.png rename to Backgrounds/SulphurSeaSurfaceClose.png diff --git a/CalamityMod.cs b/CalamityMod.cs index 8a379ab12c..78154dc736 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -248,13 +248,6 @@ namespace CalamityMod BalancingChangesManager.Load(); BaseIdleHoldoutProjectile.LoadAll(); PlayerDashManager.Load(); - - //load all the detours for the custom backgrounds - Backgrounds.AstralSurfaceBG.Load(); - Backgrounds.AstralDesertBG.Load(); - Backgrounds.AstralSnowBG.Load(); - Backgrounds.SulphurSeaBG.Load(); - Backgrounds.SunkenSeaBurrowsBG.Load(); } private void LoadClient() diff --git a/Items/Tools/AcidwoodAxe.cs b/Items/Tools/AcidwoodAxe.cs index 6c74de4565..a14997a250 100644 --- a/Items/Tools/AcidwoodAxe.cs +++ b/Items/Tools/AcidwoodAxe.cs @@ -1,6 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; -using Microsoft.Xna.Framework; +using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -23,7 +21,7 @@ namespace CalamityMod.Items.Tools Item.height = 32; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.Rarity0BuyPrice; + Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; Item.rare = ItemRarityID.White; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/AcidwoodHammer.cs b/Items/Tools/AcidwoodHammer.cs index 1059e38f90..fb19a29600 100644 --- a/Items/Tools/AcidwoodHammer.cs +++ b/Items/Tools/AcidwoodHammer.cs @@ -1,6 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; -using Microsoft.Xna.Framework; +using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -23,7 +21,7 @@ namespace CalamityMod.Items.Tools Item.height = 40; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.Rarity0BuyPrice; + Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; Item.rare = ItemRarityID.White; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/AcidwoodPickaxe.cs b/Items/Tools/AcidwoodPickaxe.cs index f51f029566..986357d323 100644 --- a/Items/Tools/AcidwoodPickaxe.cs +++ b/Items/Tools/AcidwoodPickaxe.cs @@ -1,5 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Tools Item.height = 36; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.Rarity0BuyPrice; + Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; Item.rare = ItemRarityID.White; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/DriftwoodAxe.cs b/Items/Tools/DriftwoodAxe.cs index 49d0596735..0c772ac67e 100644 --- a/Items/Tools/DriftwoodAxe.cs +++ b/Items/Tools/DriftwoodAxe.cs @@ -1,5 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -23,7 +22,7 @@ namespace CalamityMod.Items.Tools Item.height = 34; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.Rarity0BuyPrice; + Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; Item.rare = ItemRarityID.White; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/DriftwoodHammer.cs b/Items/Tools/DriftwoodHammer.cs index 11880202d5..56870482ce 100644 --- a/Items/Tools/DriftwoodHammer.cs +++ b/Items/Tools/DriftwoodHammer.cs @@ -1,5 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -23,7 +22,7 @@ namespace CalamityMod.Items.Tools Item.height = 42; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.Rarity0BuyPrice; + Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; Item.rare = ItemRarityID.White; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/DriftwoodPickaxe.cs b/Items/Tools/DriftwoodPickaxe.cs index 86aa35c0b4..5fec674b3a 100644 --- a/Items/Tools/DriftwoodPickaxe.cs +++ b/Items/Tools/DriftwoodPickaxe.cs @@ -1,9 +1,8 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using CalamityMod.Items.Placeables; namespace CalamityMod.Items.Tools { @@ -23,7 +22,7 @@ namespace CalamityMod.Items.Tools Item.height = 38; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.Rarity0BuyPrice; + Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; Item.rare = ItemRarityID.White; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/MonolithAxe.cs b/Items/Tools/MonolithAxe.cs index 8cfc6b34b6..5ed613a3d3 100644 --- a/Items/Tools/MonolithAxe.cs +++ b/Items/Tools/MonolithAxe.cs @@ -1,5 +1,4 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using Microsoft.Xna.Framework; using Terraria; @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Tools Item.height = 36; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.Rarity3BuyPrice; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/MonolithHammer.cs b/Items/Tools/MonolithHammer.cs index 331b86c862..aa50f8cb3d 100644 --- a/Items/Tools/MonolithHammer.cs +++ b/Items/Tools/MonolithHammer.cs @@ -1,5 +1,4 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using Microsoft.Xna.Framework; using Terraria; @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Tools Item.height = 44; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.Rarity3BuyPrice; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/MonolithPickaxe.cs b/Items/Tools/MonolithPickaxe.cs index 2b3f315879..132c26cd51 100644 --- a/Items/Tools/MonolithPickaxe.cs +++ b/Items/Tools/MonolithPickaxe.cs @@ -1,10 +1,9 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Dusts; using CalamityMod.Items.Placeables; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using CalamityMod.Dusts; namespace CalamityMod.Items.Tools { @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Tools Item.height = 40; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.Rarity3BuyPrice; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/AcidwoodSword.cs b/Items/Weapons/Melee/AcidwoodSword.cs index 93a1e5864f..3d8eaf9876 100644 --- a/Items/Weapons/Melee/AcidwoodSword.cs +++ b/Items/Weapons/Melee/AcidwoodSword.cs @@ -1,7 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Items.Materials; -using Microsoft.Xna.Framework; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -23,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.useTurn = true; - Item.value = CalamityGlobalItem.Rarity0BuyPrice; + Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; Item.rare = ItemRarityID.White; } public override void AddRecipes() diff --git a/Items/Weapons/Melee/DriftwoodSword.cs b/Items/Weapons/Melee/DriftwoodSword.cs index 974abd751d..57f1ca8924 100644 --- a/Items/Weapons/Melee/DriftwoodSword.cs +++ b/Items/Weapons/Melee/DriftwoodSword.cs @@ -1,7 +1,5 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; using Microsoft.Xna.Framework; -using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -23,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.useTurn = true; - Item.value = CalamityGlobalItem.Rarity0BuyPrice; + Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; Item.rare = ItemRarityID.White; } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/MonolithSword.cs b/Items/Weapons/Melee/MonolithSword.cs index 011ce74457..3af19b0da7 100644 --- a/Items/Weapons/Melee/MonolithSword.cs +++ b/Items/Weapons/Melee/MonolithSword.cs @@ -1,12 +1,10 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Items.Materials; -using Microsoft.Xna.Framework; +using CalamityMod.Dusts; using CalamityMod.Items.Placeables; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Dusts; -using CalamityMod.Particles; namespace CalamityMod.Items.Weapons.Melee { @@ -25,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.useTurn = true; - Item.value = CalamityGlobalItem.Rarity3BuyPrice; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; } public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) diff --git a/Items/Weapons/Ranged/AcidwoodBow.cs b/Items/Weapons/Ranged/AcidwoodBow.cs index 5d000c3bb3..f57096b36e 100644 --- a/Items/Weapons/Ranged/AcidwoodBow.cs +++ b/Items/Weapons/Ranged/AcidwoodBow.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 0f; - Item.value = CalamityGlobalItem.Rarity0BuyPrice; + Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; Item.rare = ItemRarityID.White; Item.UseSound = SoundID.Item5; Item.autoReuse = true; diff --git a/Items/Weapons/Ranged/DriftwoodBow.cs b/Items/Weapons/Ranged/DriftwoodBow.cs index 3d357a9451..f79dfada00 100644 --- a/Items/Weapons/Ranged/DriftwoodBow.cs +++ b/Items/Weapons/Ranged/DriftwoodBow.cs @@ -1,10 +1,9 @@ -using Terraria.DataStructures; -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Placeables; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Items.Placeables; namespace CalamityMod.Items.Weapons.Ranged { @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 0f; - Item.value = CalamityGlobalItem.Rarity0BuyPrice; + Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; Item.rare = ItemRarityID.White; Item.UseSound = SoundID.Item5; Item.autoReuse = true; diff --git a/Items/Weapons/Ranged/MonolithBow.cs b/Items/Weapons/Ranged/MonolithBow.cs index 7d6a7561a0..e467e12c49 100644 --- a/Items/Weapons/Ranged/MonolithBow.cs +++ b/Items/Weapons/Ranged/MonolithBow.cs @@ -1,11 +1,10 @@ -using Terraria.DataStructures; -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Items.Placeables; -using CalamityMod.Dusts; namespace CalamityMod.Items.Weapons.Ranged { @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 0f; - Item.value = CalamityGlobalItem.Rarity3BuyPrice; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item5; Item.autoReuse = true; diff --git a/Tiles/Abyss/AbyssCoral.cs b/Tiles/Abyss/AbyssCoral.cs index 6520fc2686..29a66b7009 100644 --- a/Tiles/Abyss/AbyssCoral.cs +++ b/Tiles/Abyss/AbyssCoral.cs @@ -9,8 +9,6 @@ namespace CalamityMod.Tiles.Abyss { public class AbyssCoral : ModTile { - public byte[,] tileAdjacency; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; @@ -28,8 +26,6 @@ namespace CalamityMod.Tiles.Abyss Main.tileShine2[Type] = true; TileID.Sets.CanBeDugByShovel[Type] = true; - - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) @@ -52,7 +48,6 @@ namespace CalamityMod.Tiles.Abyss public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/Abyss/SulphurousShale.cs b/Tiles/Abyss/SulphurousShale.cs index 8ff32441a6..dbd4219573 100644 --- a/Tiles/Abyss/SulphurousShale.cs +++ b/Tiles/Abyss/SulphurousShale.cs @@ -1,11 +1,6 @@ -//using CalamityMod.Tiles.Abyss.AbyssAmbient; -using System; -using System.Collections.Generic; -using CalamityMod.Tiles.Abyss.AbyssAmbient; +using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.World; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -46,14 +41,6 @@ namespace CalamityMod.Tiles.Abyss } } - public override void NearbyEffects(int i, int j, bool closer) - { - if (Main.LocalPlayer.InModBiome(ModContent.GetInstance())) - { - Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/SulphuricDepthsWater").Slot; - } - } - public override bool CanExplode(int i, int j) { return false; diff --git a/Tiles/SunkenSea/Basalt.cs b/Tiles/SunkenSea/Basalt.cs index 1c1ad976d8..400d198569 100644 --- a/Tiles/SunkenSea/Basalt.cs +++ b/Tiles/SunkenSea/Basalt.cs @@ -1,8 +1,7 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { @@ -34,10 +33,11 @@ namespace CalamityMod.Tiles.SunkenSea MinPick = 100; - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.Sandstone, out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.Sand, out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.HardenedSand, out fourthTileAdjacency); + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); } public override bool CreateDust(int i, int j, ref int type) @@ -52,21 +52,10 @@ namespace CalamityMod.Tiles.SunkenSea frameYOffset = j % 4 * sheetHeight; } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/SandstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/SandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/HardenedSandMerge"); - } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.Sandstone, out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.Sand, out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.HardenedSand, out thirdTileAdjacency[i, j]); - return true; + // 02JUN2024: Ozzatron: unclear if this is the correct framing strategy for Basalt + return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } } diff --git a/Tiles/SunkenSea/BlackPearlPile.cs b/Tiles/SunkenSea/BlackPearlPile.cs index fcf4d5aaae..79329bcd99 100644 --- a/Tiles/SunkenSea/BlackPearlPile.cs +++ b/Tiles/SunkenSea/BlackPearlPile.cs @@ -1,18 +1,12 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class BlackPearlPile : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public byte[,] fourthTileAdjacency; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; @@ -31,26 +25,17 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.CanBeDugByShovel[Type] = true; - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out fourthTileAdjacency); - } + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - //TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/ShellstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/EutrophicSandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out fourthTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/CyanCoral.cs b/Tiles/SunkenSea/CyanCoral.cs index bcffb9392d..31182aeff1 100644 --- a/Tiles/SunkenSea/CyanCoral.cs +++ b/Tiles/SunkenSea/CyanCoral.cs @@ -1,9 +1,8 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; -using System; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { @@ -32,19 +31,15 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.CanBeDugByShovel[Type] = true; - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out fourthTileAdjacency); + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); + + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - //TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/ShellstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/EutrophicSandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/NavystoneMerge"); - } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { if (!Main.tile[i - 1, j].HasTile || !Main.tile[i + 1, j].HasTile || !Main.tile[i, j - 1].HasTile || !Main.tile[i, j + 1].HasTile) @@ -65,10 +60,6 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out fourthTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/Driftwood.cs b/Tiles/SunkenSea/Driftwood.cs index 4186b385c7..87238d3856 100644 --- a/Tiles/SunkenSea/Driftwood.cs +++ b/Tiles/SunkenSea/Driftwood.cs @@ -1,20 +1,13 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.Metadata; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class Driftwood : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public byte[,] fourthTileAdjacency; - public byte[,] fifthTileAdjacency; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; @@ -32,29 +25,18 @@ namespace CalamityMod.Tiles.SunkenSea DustType = 121; AddMapEntry(new Color(136, 129, 154)); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.Sandstone, out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.Sand, out fourthTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.HardenedSand, out fifthTileAdjacency); - } + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - //TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/ShellstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/SandstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/SandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fifthTileAdjacency, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.Sandstone, out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.Sand, out fourthTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.HardenedSand, out fifthTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/LimeCoral.cs b/Tiles/SunkenSea/LimeCoral.cs index d64276807a..057dc93370 100644 --- a/Tiles/SunkenSea/LimeCoral.cs +++ b/Tiles/SunkenSea/LimeCoral.cs @@ -1,19 +1,13 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; -using System; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class LimeCoral : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public byte[,] fourthTileAdjacency; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; @@ -32,10 +26,13 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.CanBeDugByShovel[Type] = true; - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out fourthTileAdjacency); + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); + + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { @@ -54,20 +51,9 @@ namespace CalamityMod.Tiles.SunkenSea b *= brightness; } } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - //TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/ShellstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/EutrophicSandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/NavystoneMerge"); - } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out fourthTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/Limestone.cs b/Tiles/SunkenSea/Limestone.cs index 4cb0c6fdaf..d741e2ad16 100644 --- a/Tiles/SunkenSea/Limestone.cs +++ b/Tiles/SunkenSea/Limestone.cs @@ -1,18 +1,12 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class Limestone : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public byte[,] fourthTileAdjacency; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; @@ -27,26 +21,17 @@ namespace CalamityMod.Tiles.SunkenSea DustType = 22; AddMapEntry(new Color(154, 119, 119)); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out fourthTileAdjacency); - } + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - //TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/ShellstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/EutrophicSandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out fourthTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/MagentaCoral.cs b/Tiles/SunkenSea/MagentaCoral.cs index ed7657f1cc..80df31c297 100644 --- a/Tiles/SunkenSea/MagentaCoral.cs +++ b/Tiles/SunkenSea/MagentaCoral.cs @@ -1,9 +1,8 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; -using System; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { @@ -32,10 +31,13 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.CanBeDugByShovel[Type] = true; - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out fourthTileAdjacency); + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); + + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { @@ -55,20 +57,8 @@ namespace CalamityMod.Tiles.SunkenSea } } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - //TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/ShellstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/EutrophicSandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/NavystoneMerge"); - } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out fourthTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/Navystone.cs b/Tiles/SunkenSea/Navystone.cs index 5684d4e237..e64618908a 100644 --- a/Tiles/SunkenSea/Navystone.cs +++ b/Tiles/SunkenSea/Navystone.cs @@ -1,13 +1,9 @@ -using System.Collections.Generic; +using CalamityMod.Tiles.SunkenSea.Ambient; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; -using CalamityMod.Tiles.SunkenSea.Ambient; - namespace CalamityMod.Tiles.SunkenSea { public class Navystone : ModTile @@ -47,10 +43,10 @@ namespace CalamityMod.Tiles.SunkenSea public override void RandomUpdate(int i, int j) { Tile Tile = Framing.GetTileSafely(i, j); - Tile Below = Framing.GetTileSafely(i, j + 1); + Tile Below = Framing.GetTileSafely(i, j + 1); Tile Above = Framing.GetTileSafely(i, j - 1); - if (!Below.HasTile && Below.LiquidType <= 0 && !Tile.BottomSlope) + if (!Below.HasTile && Below.LiquidType <= 0 && !Tile.BottomSlope) { if (Main.rand.NextBool(10)) { diff --git a/Tiles/SunkenSea/OrangeCoral.cs b/Tiles/SunkenSea/OrangeCoral.cs index bdeca4d1f6..524eaa2a2c 100644 --- a/Tiles/SunkenSea/OrangeCoral.cs +++ b/Tiles/SunkenSea/OrangeCoral.cs @@ -1,19 +1,13 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; -using System; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class OrangeCoral : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public byte[,] fourthTileAdjacency; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; @@ -32,10 +26,13 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.CanBeDugByShovel[Type] = true; - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out fourthTileAdjacency); + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); + + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { @@ -55,20 +52,8 @@ namespace CalamityMod.Tiles.SunkenSea } } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - //TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/ShellstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/EutrophicSandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/NavystoneMerge"); - } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out fourthTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/PinkPearlPile.cs b/Tiles/SunkenSea/PinkPearlPile.cs index 32195f82b3..73dc8d3d12 100644 --- a/Tiles/SunkenSea/PinkPearlPile.cs +++ b/Tiles/SunkenSea/PinkPearlPile.cs @@ -1,18 +1,12 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class PinkPearlPile : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public byte[,] fourthTileAdjacency; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; @@ -31,26 +25,17 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.CanBeDugByShovel[Type] = true; - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out fourthTileAdjacency); - } + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - //TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/ShellstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/EutrophicSandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out fourthTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/PolypSand.cs b/Tiles/SunkenSea/PolypSand.cs index bcbec8847c..a89bd0d3c6 100644 --- a/Tiles/SunkenSea/PolypSand.cs +++ b/Tiles/SunkenSea/PolypSand.cs @@ -1,17 +1,12 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class PolypSand : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public override void SetStaticDefaults() { TileID.Sets.GeneralPlacementTiles[Type] = false; @@ -30,9 +25,9 @@ namespace CalamityMod.Tiles.SunkenSea DustType = 147; AddMapEntry(new Color(221, 180, 182)); - TileFraming.SetUpUniversalMerge(Type, TileID.Sandstone, out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.Sand, out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.HardenedSand, out thirdTileAdjacency); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); } public override void NumDust(int i, int j, bool fail, ref int num) @@ -40,18 +35,8 @@ namespace CalamityMod.Tiles.SunkenSea num = fail ? 1 : 3; } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/SandstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/SandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/HardenedSandMerge"); - } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, TileID.Sandstone, out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.Sand, out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.HardenedSand, out thirdTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/RuneSand.cs b/Tiles/SunkenSea/RuneSand.cs index 5b4b7c391b..b477d06e0a 100644 --- a/Tiles/SunkenSea/RuneSand.cs +++ b/Tiles/SunkenSea/RuneSand.cs @@ -1,17 +1,12 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class RuneSand : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public override void SetStaticDefaults() { TileID.Sets.GeneralPlacementTiles[Type] = false; @@ -30,9 +25,9 @@ namespace CalamityMod.Tiles.SunkenSea DustType = 147; AddMapEntry(new Color(210, 124, 45)); - TileFraming.SetUpUniversalMerge(Type, TileID.Sandstone, out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.Sand, out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.HardenedSand, out thirdTileAdjacency); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); } public override void NumDust(int i, int j, bool fail, ref int num) @@ -40,18 +35,8 @@ namespace CalamityMod.Tiles.SunkenSea num = fail ? 1 : 3; } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/SandstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/SandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/HardenedSandMerge"); - } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, TileID.Sandstone, out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.Sand, out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.HardenedSand, out thirdTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/Runestone.cs b/Tiles/SunkenSea/Runestone.cs index 9554e81b42..020cb14e1d 100644 --- a/Tiles/SunkenSea/Runestone.cs +++ b/Tiles/SunkenSea/Runestone.cs @@ -1,18 +1,12 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class Runestone : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public byte[,] fourthTileAdjacency; - public override void SetStaticDefaults() { TileID.Sets.GeneralPlacementTiles[Type] = false; @@ -32,26 +26,17 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.CanBeDugByShovel[Type] = true; - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out fourthTileAdjacency); - } + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - //TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/ShellstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/EutrophicSandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out fourthTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/SeaPrism.cs b/Tiles/SunkenSea/SeaPrism.cs index 2647ae83e5..4ffb9390f8 100644 --- a/Tiles/SunkenSea/SeaPrism.cs +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -1,10 +1,7 @@ using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea @@ -60,11 +57,6 @@ namespace CalamityMod.Tiles.SunkenSea b *= brightness; } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/NavystoneMerge"); - } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { return TileFraming.BrimstoneFraming(i, j, resetFrame); diff --git a/Tiles/SunkenSea/Shellstone.cs b/Tiles/SunkenSea/Shellstone.cs index 53c7ca128f..6cd502cd9c 100644 --- a/Tiles/SunkenSea/Shellstone.cs +++ b/Tiles/SunkenSea/Shellstone.cs @@ -1,18 +1,12 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class Shellstone : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public byte[,] fourthTileAdjacency; - public override void SetStaticDefaults() { TileID.Sets.GeneralPlacementTiles[Type] = false; @@ -30,26 +24,16 @@ namespace CalamityMod.Tiles.SunkenSea DustType = 17; AddMapEntry(new Color(113, 117, 160)); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.Sandstone, out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.Sand, out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.HardenedSand, out fourthTileAdjacency); - } + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/SandstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/SandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.Sandstone, out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.Sand, out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.HardenedSand, out fourthTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/VolcanicSand.cs b/Tiles/SunkenSea/VolcanicSand.cs index eeb4e4568d..49bdcd390b 100644 --- a/Tiles/SunkenSea/VolcanicSand.cs +++ b/Tiles/SunkenSea/VolcanicSand.cs @@ -1,17 +1,12 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class VolcanicSand : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public override void SetStaticDefaults() { TileID.Sets.GeneralPlacementTiles[Type] = false; @@ -29,9 +24,9 @@ namespace CalamityMod.Tiles.SunkenSea DustType = 147; AddMapEntry(new Color(117, 79, 97)); - TileFraming.SetUpUniversalMerge(Type, TileID.Sandstone, out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.Sand, out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, TileID.HardenedSand, out thirdTileAdjacency); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); } public override void NumDust(int i, int j, bool fail, ref int num) @@ -39,18 +34,8 @@ namespace CalamityMod.Tiles.SunkenSea num = fail ? 1 : 3; } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/SandstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/SandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/HardenedSandMerge"); - } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, TileID.Sandstone, out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.Sand, out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, TileID.HardenedSand, out thirdTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/WhitePearlPile.cs b/Tiles/SunkenSea/WhitePearlPile.cs index 4175b690a5..5cacbe7df5 100644 --- a/Tiles/SunkenSea/WhitePearlPile.cs +++ b/Tiles/SunkenSea/WhitePearlPile.cs @@ -1,18 +1,12 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class WhitePearlPile : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public byte[,] fourthTileAdjacency; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; @@ -32,26 +26,17 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.CanBeDugByShovel[Type] = true; - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out fourthTileAdjacency); - } + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - //TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/ShellstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/EutrophicSandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out fourthTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/YellowCoral.cs b/Tiles/SunkenSea/YellowCoral.cs index c057374302..1a7a29bbfb 100644 --- a/Tiles/SunkenSea/YellowCoral.cs +++ b/Tiles/SunkenSea/YellowCoral.cs @@ -1,19 +1,13 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Microsoft.Xna.Framework.Graphics; -using System; +using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { public class YellowCoral : ModTile { - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public byte[,] fourthTileAdjacency; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; @@ -32,10 +26,13 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.CanBeDugByShovel[Type] = true; - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out thirdTileAdjacency); - TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out fourthTileAdjacency); + // 02JUN2024: Ozzatron: RuneSand has no merge + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined + // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); + + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { @@ -55,20 +52,8 @@ namespace CalamityMod.Tiles.SunkenSea } } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - //TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/TimelessSandMerge"); - //TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/ShellstoneMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, thirdTileAdjacency, "CalamityMod/Tiles/Merges/EutrophicSandMerge"); - TileFraming.DrawUniversalMergeFrames(i, j, fourthTileAdjacency, "CalamityMod/Tiles/Merges/NavystoneMerge"); - } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out tileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out secondTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out thirdTileAdjacency[i, j]); - TileFraming.GetAdjacencyData(i, j, ModContent.TileType(), out fourthTileAdjacency[i, j]); return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } }