From 42947a3100bdaf9c2f9295732b3b1e184eeb0ed6 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Fri, 24 Oct 2025 11:58:00 -0400 Subject: [PATCH 01/48] Pixelation system + Particle system updates * Added a global pixelated drawing system. * Added LightDustPixelated. * Added the GeneralDrawLayer enum, which is now used for layered drawing in both the pixelation and particle systems. * Updated the particle system: * Now supports drawing on multiple different layers now instead of just after everything else in the world has been drawn. * Collapsed the three draw lists in favor of two dictionaries, which store lists of non-pixelated and pixelated particles respectively based on their BlendState. * particlesToSpawnNextFrame is now a dictionary which stores Queues based on their draw layer. --- Dusts/LightDust.cs | 51 ++- Enums/GeneralDrawLayer.cs | 20 + ILEditing/ILChangesLoading.cs | 1 - ILEditing/MechanicILChanges.cs | 6 +- Particles/GeneralParticleHandler.cs | 420 +++++++++--------- Particles/Particle.cs | 15 +- .../PixelationSystem/PixelatedDrawer.cs | 15 + .../PixelationSystem/PixelationManager.cs | 311 +++++++++++++ 8 files changed, 611 insertions(+), 228 deletions(-) create mode 100644 Enums/GeneralDrawLayer.cs create mode 100644 Systems/Graphic/PixelationSystem/PixelatedDrawer.cs create mode 100644 Systems/Graphic/PixelationSystem/PixelationManager.cs diff --git a/Dusts/LightDust.cs b/Dusts/LightDust.cs index d0f83ba587..3da334e73c 100644 --- a/Dusts/LightDust.cs +++ b/Dusts/LightDust.cs @@ -1,6 +1,9 @@ using System; +using CalamityMod.Enums; +using CalamityMod.Systems.Graphic.PixelationSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ModLoader; @@ -8,6 +11,19 @@ namespace CalamityMod.Dusts { public class LightDust : ModDust { + public static Asset SolidCircle; + + public static Asset BloomCircle; + + public override void Load() + { + if (Main.dedServ) + return; + + SolidCircle = ModContent.Request("CalamityMod/ExtraTextures/BasicCircle"); + BloomCircle = ModContent.Request("CalamityMod/Particles/BloomCircle"); + } + public override void OnSpawn(Dust dust) { dust.scale *= Main.rand.NextFloat(0.8f, 1f); @@ -28,21 +44,42 @@ namespace CalamityMod.Dusts return true; } + public override bool PreDraw(Dust dust) { Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f); - Texture2D solidCenter = ModContent.Request("CalamityMod/ExtraTextures/BasicCircle").Value; - Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; // Glow Orb - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(BloomCircle.Value, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(BloomCircle.Value, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); if (!dust.noLight) - { - Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); - } + Main.EntitySpriteDraw(SolidCircle.Value, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); + return false; } } + + public class LightDustPixelated : LightDust + { + public override string Texture => "CalamityMod/Dusts/LightDust"; + + public override bool PreDraw(Dust dust) + { + PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), GeneralDrawLayer.AfterDusts); + return false; + } + + private static void DrawPixelated(Dust dust) + { + Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f); + + // Glow Orb + Main.spriteBatch.Draw(BloomCircle.Value, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); + if (dust.alpha < 1) + Main.spriteBatch.Draw(BloomCircle.Value, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); + if (!dust.noLight) + Main.spriteBatch.Draw(SolidCircle.Value, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); + } + } } diff --git a/Enums/GeneralDrawLayer.cs b/Enums/GeneralDrawLayer.cs new file mode 100644 index 0000000000..23aa7c20d0 --- /dev/null +++ b/Enums/GeneralDrawLayer.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CalamityMod.Enums +{ + public enum GeneralDrawLayer + { + BeforeTiles, + BeforeNPCs, + AfterNPCs, + BeforeProjectiles, + AfterProjectiles, + AfterPlayers, + AfterDusts, + AfterEverything, + } +} diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index f7428ad488..e0df1824a2 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -46,7 +46,6 @@ namespace CalamityMod.ILEditing IL_Main.DoDraw += CustomDoDrawChanges; On_Main.DrawCursor += UseCoolFireCursorEffect; On_Main.SortDrawCacheWorms += DrawFusableParticles; - On_Main.DrawInfernoRings += DrawForegroundParticles; On_TileDrawing.Draw += ClearTilePings; On_CommonCode.ModifyItemDropFromNPC += ColorBlightedGel; On_MoonlordDeathDrama.RequestLight += DisableFlashesWithPhotosensitivityConfig; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index b181b5b09d..c0ac84b864 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -31,6 +31,7 @@ using CalamityMod.Projectiles; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Typeless; using CalamityMod.Systems; +using CalamityMod.Systems.Graphic.PixelationSystem; using CalamityMod.Tiles; using CalamityMod.Walls; using CalamityMod.Waterfalls; @@ -923,11 +924,6 @@ namespace CalamityMod.ILEditing orig(self); } - private static void DrawForegroundParticles(On_Main.orig_DrawInfernoRings orig, Main self) - { - GeneralParticleHandler.DrawAllParticles(Main.spriteBatch); - orig(self); - } #endregion #region Disable Moon Lord Style Flashes With Photosensitivity Config diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 415b7653c4..8285f5ada9 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -2,7 +2,10 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; +using CalamityMod.Effects; +using CalamityMod.Enums; using CalamityMod.Graphics; +using CalamityMod.Systems.Graphic.PixelationSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -17,39 +20,22 @@ namespace CalamityMod.Particles [Autoload(Side = ModSide.Client)] public sealed class GeneralParticleHandler : ModSystem { + #region Fields private static List particles; - private static Queue particlesToSpawnNextFrame; - //List containing the particles to delete + private static Dictionary> particlesToSpawnNextFrame; + // List containing the particles to delete private static List particlesToKill; - //Static list for details concerning every particle type + + // Static list for details concerning every particle type internal static Dictionary particleTypes; internal static Dictionary particleTextures; - //Lists used when drawing particles batched - private static List batchedAlphaBlendParticles; - private static List batchedNonPremultipliedParticles; - private static List batchedAdditiveBlendParticles; - private static ManagedRenderTarget PixelationTarget_AlphaBlend; - private static ManagedRenderTarget PixelationTarget_NonPremultiplied; - private static ManagedRenderTarget PixelationTarget_AdditiveBlend; - - /// - /// Whether or not the system is currently rendering any pixelated prticles to the render target or not. - /// - private static bool CurrentlyRendering { get; set; } - - /// - /// The resolution ratio at which pixelated particles should draw.
- /// 0.5f will draw at half resolution, 0.25f will draw at quarter resolution, etc. - ///
- private const float PixelationResolution = 0.5f; - - /// - /// Creates a render target at half the screen's dimensions. - /// This is done due to the fact that when the target itself drawn, it needs to be drawn at double the original scale in order to pixelate its contents - /// - private static RenderTarget2D CreatePixelTarget(int width, int height) => new(Main.instance.GraphicsDevice, (int)(width * PixelationResolution), (int)(height * PixelationResolution)); + // Collections for storing and ordring particle instances for drawing. + private static Dictionary> ParticlesToDraw; + private static Dictionary> ParticlesToDraw_Pixelated; + #endregion + #region Loading and Unloading public override void PostSetupContent() { Type baseParticleType = typeof(Particle); @@ -71,8 +57,6 @@ namespace CalamityMod.Particles texturePath = instance.Texture; particleTextures[ID] = ModContent.Request(texturePath, AssetRequestMode.ImmediateLoad).Value; }); - - On_Main.CheckMonoliths += DrawToTarget; } public override void Load() @@ -83,16 +67,15 @@ namespace CalamityMod.Particles particleTypes = []; particleTextures = []; - batchedAlphaBlendParticles = []; - batchedNonPremultipliedParticles = []; - batchedAdditiveBlendParticles = []; + ParticlesToDraw = []; + ParticlesToDraw_Pixelated = []; - Main.QueueMainThreadAction(() => - { - PixelationTarget_AlphaBlend = new(true, CreatePixelTarget); - PixelationTarget_NonPremultiplied = new(true, CreatePixelTarget); - PixelationTarget_AdditiveBlend = new(true, CreatePixelTarget); - }); + On_Main.DrawBackgroundBlackFill += DrawParticles_BeforeTiles; + On_Main.DrawNPCs += DrawParticles_NPCs; + On_Main.DrawProjectiles += DrawParticles_Projectiles; + On_Main.DrawPlayers_AfterProjectiles += DrawParticles_AfterPlayers; + On_Main.DrawDust += DrawParticles_AfterDusts; + On_Main.DrawInfernoRings += DrawParticles_AfterEverything; } public override void Unload() @@ -103,17 +86,16 @@ namespace CalamityMod.Particles particleTypes = null; particleTextures = null; - batchedAlphaBlendParticles = null; - batchedNonPremultipliedParticles = null; - batchedAdditiveBlendParticles = null; - - On_Main.CheckMonoliths -= DrawToTarget; + ParticlesToDraw = null; + ParticlesToDraw_Pixelated = null; } + #endregion /// /// Spawns the particle instance provided into the world. If the particle limit is reached but the particle is marked as important, it will try to replace a non important particle. /// - public static void SpawnParticle(Particle particle) + /// Only set this to a non-null value if you'd like to manually override the draw layer of the particle instance you are spawning. + public static void SpawnParticle(Particle particle, GeneralDrawLayer? manualDrawLayerOverride = null) { // Don't queue particles if the game is paused. // This precedent is established with how Dust instances are created. @@ -124,11 +106,21 @@ namespace CalamityMod.Particles if (particles.Count >= CalamityClientConfig.Instance.ParticleLimit && !particle.Important) return; + if (manualDrawLayerOverride.HasValue) + particle.DrawLayer = manualDrawLayerOverride.Value; + particles.Add(particle); + ReturnAssociatedDrawCollection(particle).Add(particle); particle.Type = particleTypes[particle.GetType()]; } - public static void QueueParticleForNextFrame(Particle particle) + /// + /// Queues a particle instance to be spawned from within a single frame after this is called. + ///
Should be used in cases where you need to spawn a particle type from inside the overall particle update loop, such as inside the Update method of + /// another particle type.
+ ///
The single frame buffer ensures the overall particle update loop isn't altered prematurely from within the loop itself.
+ ///
+ public static void QueueParticleForNextFrame(Particle particle, GeneralDrawLayer? manualDrawLayerOverride = null) { // Don't queue particles if the game is paused. // This precedent is established with how Dust instances are created. @@ -136,7 +128,24 @@ namespace CalamityMod.Particles if (Main.gamePaused || Main.dedServ || particles == null) return; - particlesToSpawnNextFrame.Enqueue(particle); + // Get the correct draw layer to spawn this particle on. + GeneralDrawLayer actualDrawLayer = manualDrawLayerOverride ?? particle.DrawLayer; + if (!particlesToSpawnNextFrame.ContainsKey(actualDrawLayer)) + particlesToSpawnNextFrame[actualDrawLayer] = []; + + particlesToSpawnNextFrame[actualDrawLayer].Enqueue(particle); + } + + /// + /// Removes an active particle instance from the world entirely. + /// + public static void RemoveParticle(Particle particle) + { + if (Main.dedServ) + return; + + particlesToKill.Add(particle); + ReturnAssociatedDrawCollection(particle).Remove(particle); } public static void Update() @@ -144,219 +153,206 @@ namespace CalamityMod.Particles if (Main.dedServ) return; - while (particlesToSpawnNextFrame.Count > 0) - SpawnParticle(particlesToSpawnNextFrame.Dequeue()); + // Spawn queued particles. + foreach (var keyValuePair in particlesToSpawnNextFrame) + { + while (keyValuePair.Value.Count > 0) + SpawnParticle(keyValuePair.Value.Dequeue(), keyValuePair.Key); + } + // Update all particle instances in the world. foreach (Particle particle in particles) { if (particle == null) continue; + particle.Position += particle.Velocity; particle.Time++; particle.Update(); } + //Clear out particles whose time is up - particles.RemoveAll(particle => (particle.Time >= particle.Lifetime && particle.SetLifetime) || particlesToKill.Contains(particle)); + particles.RemoveAll(particle => + { + if ((particle.Time >= particle.Lifetime && particle.SetLifetime) || particlesToKill.Contains(particle)) + { + ReturnAssociatedDrawCollection(particle).Remove(particle); + return true; + } + return false; + }); + particlesToKill.Clear(); } - public static void RemoveParticle(Particle particle) + private static void DrawParticles_BeforeTiles(On_Main.orig_DrawBackgroundBlackFill orig, Main self) { - if (Main.dedServ) - return; + Main.spriteBatch.End(); + DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.BeforeTiles); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - particlesToKill.Add(particle); + orig(self); } - private static void DrawToTarget(On_Main.orig_CheckMonoliths orig) + private static void DrawParticles_NPCs(On_Main.orig_DrawNPCs orig, Main self, bool behindTiles) { - if (Main.gameMenu) + if (!behindTiles) { - orig(); - return; - } - - List pixelatedAlphaBlendParticles = []; - List pixelatedNonPremultipliedParticles = []; - List pixelatedAdditiveBlendParticles = []; - - // Add each particle to their respective lists. - foreach (Particle particle in particles) - { - if (particle != null && particle.Pixelate) - { - pixelatedAlphaBlendParticles.AddWithCondition(particle, !particle.UseAdditiveBlend && !particle.UseHalfTransparency); - pixelatedNonPremultipliedParticles.AddWithCondition(particle, !particle.UseAdditiveBlend && particle.UseHalfTransparency); - pixelatedAdditiveBlendParticles.AddWithCondition(particle, particle.UseAdditiveBlend && !particle.UseHalfTransparency); - } - } - - CurrentlyRendering = true; - - Matrix pixelationMatrix = Main.GameViewMatrix.TransformationMatrix - * Matrix.CreateScale(PixelationResolution / Main.GameViewMatrix.Zoom.X, PixelationResolution / Main.GameViewMatrix.Zoom.Y, 1f) - * Matrix.CreateTranslation(Main.GameViewMatrix.Translation.X * PixelationResolution, Main.GameViewMatrix.Translation.Y * PixelationResolution, 0f); - - DrawParticlesToRenderTarget(PixelationTarget_AlphaBlend, pixelatedAlphaBlendParticles, BlendState.AlphaBlend, pixelationMatrix); - DrawParticlesToRenderTarget(PixelationTarget_NonPremultiplied, pixelatedNonPremultipliedParticles, BlendState.NonPremultiplied, pixelationMatrix); - DrawParticlesToRenderTarget(PixelationTarget_AdditiveBlend, pixelatedAdditiveBlendParticles, BlendState.Additive, pixelationMatrix); - - Main.instance.GraphicsDevice.SetRenderTarget(null); - CurrentlyRendering = false; - - orig(); - } - - private static void DrawParticlesToRenderTarget(RenderTarget2D target, List particles, BlendState blendStateToUse, Matrix pixelationMatrix) - { - target.SwapTo(); - - if (particles.Count > 0) - { - Main.spriteBatch.Begin(SpriteSortMode.Deferred, blendStateToUse, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, pixelationMatrix); - - foreach (Particle particle in particles) - { - if (particle.UseCustomDraw) - { - particle.CustomDraw(Main.spriteBatch); - } - else - { - Color lightColor = particle.Color; - if (particle.AffectedByLight) - lightColor = particle.Color.MultiplyRGB(Lighting.GetColor((particle.Position / 16).ToPoint())); - - Rectangle frame = particleTextures[particle.Type].Frame(1, particle.FrameVariants, 0, particle.Variant); - Main.spriteBatch.Draw(particleTextures[particle.Type], particle.Position - Main.screenPosition, frame, lightColor, particle.Rotation, frame.Size() * 0.5f, particle.Scale, SpriteEffects.None, 0f); - } - } - Main.spriteBatch.End(); + DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.BeforeNPCs); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + } + + orig(self, behindTiles); + + if (!behindTiles) + { + Main.spriteBatch.End(); + DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.AfterNPCs); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); } } - private static void DrawPixelatedParticles() + private static void DrawParticles_Projectiles(On_Main.orig_DrawProjectiles orig, Main self) { - DrawScaledTarget(PixelationTarget_AlphaBlend, Main.spriteBatch, BlendState.AlphaBlend); - DrawScaledTarget(PixelationTarget_NonPremultiplied, Main.spriteBatch, BlendState.NonPremultiplied); - DrawScaledTarget(PixelationTarget_AdditiveBlend, Main.spriteBatch, BlendState.Additive); + DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.BeforeProjectiles); + + orig(self); + + DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.AfterProjectiles); } - private static void DrawScaledTarget(ManagedRenderTarget targetToDraw, SpriteBatch spriteBatch, BlendState blendState) + private static void DrawParticles_AfterPlayers(On_Main.orig_DrawPlayers_AfterProjectiles orig, Main self) { - const float inversePixelationScale = 1f / PixelationResolution; - - spriteBatch.Begin(SpriteSortMode.Deferred, blendState, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - spriteBatch.Draw(targetToDraw, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, inversePixelationScale, SpriteEffects.None, 0f); - spriteBatch.End(); + orig(self); + DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.AfterPlayers); } - public static void DrawAllParticles(SpriteBatch sb) + private static void DrawParticles_AfterDusts(On_Main.orig_DrawDust orig, Main self) + { + orig(self); + DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.AfterDusts); + } + + private static void DrawParticles_AfterEverything(On_Main.orig_DrawInfernoRings orig, Main self) + { + orig(self); + + Main.spriteBatch.End(); + DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.AfterEverything); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + } + + private static void DrawParticleInstance(Particle particle) + { + if (particle.UseCustomDraw) + { + particle.CustomDraw(Main.spriteBatch); + } + else + { + Color lightColor = particle.Color; + if (particle.AffectedByLight) + lightColor = particle.Color.MultiplyRGB(Lighting.GetColor((particle.Position / 16).ToPoint())); + + Rectangle frame = particleTextures[particle.Type].Frame(1, particle.FrameVariants, 0, particle.Variant); + Main.spriteBatch.Draw(particleTextures[particle.Type], particle.Position - Main.screenPosition, frame, lightColor, particle.Rotation, frame.Size() * 0.5f, particle.Scale, SpriteEffects.None, 0f); + } + } + + private static void DrawParticleCollection(Dictionary> drawCollection, GeneralDrawLayer drawLayer, bool pixelated = false) + { + var scissorRectRasterizer = Main.Rasterizer; + scissorRectRasterizer.ScissorTestEnable = true; + Main.graphics.GraphicsDevice.RasterizerState.ScissorTestEnable = true; + Main.graphics.GraphicsDevice.ScissorRectangle = new Rectangle(0, 0, Main.screenWidth, Main.screenHeight); + + foreach (var keyValuePair in drawCollection) + { + if (pixelated) + { + PixelationManager.AddPixelatedDrawer((pixelationMatrix) => + { + var particlesAtSpecifiedLayer = keyValuePair.Value.Where(p => p.DrawLayer == drawLayer); + if (particlesAtSpecifiedLayer.Any()) + { + foreach (Particle particle in particlesAtSpecifiedLayer) + DrawParticleInstance(particle); + } + + }, drawLayer, keyValuePair.Key); + } + else + { + Main.spriteBatch.Begin(SpriteSortMode.Deferred, keyValuePair.Key, SamplerState.LinearClamp, DepthStencilState.None, scissorRectRasterizer, null, Main.GameViewMatrix.TransformationMatrix); + + var particlesAtSpecifiedLayer = keyValuePair.Value.Where(p => p.DrawLayer == drawLayer); + if (particlesAtSpecifiedLayer.Any()) + { + foreach (Particle particle in particlesAtSpecifiedLayer) + DrawParticleInstance(particle); + } + + Main.spriteBatch.End(); + } + } + } + + private static void DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer drawLayer) { if (Main.dedServ) return; - if (particles.Count == 0) - return; + DrawParticleCollection(ParticlesToDraw, drawLayer); + DrawParticleCollection(ParticlesToDraw_Pixelated, drawLayer, true); + } - sb.End(); - var rasterizer = Main.Rasterizer; - rasterizer.ScissorTestEnable = true; - Main.instance.GraphicsDevice.RasterizerState.ScissorTestEnable = true; - Main.instance.GraphicsDevice.ScissorRectangle = new Rectangle(0, 0, Main.screenWidth, Main.screenHeight); - - //Batch the particles to avoid constant restarting of the spritebatch - foreach (Particle particle in particles) + private static List ReturnAssociatedDrawCollection(Particle particle) + { + // Pixelated particles. + if (particle.Pixelate) { - if (particle == null) - continue; - - if (particle.Pixelate) - continue; - if (particle.UseAdditiveBlend) - batchedAdditiveBlendParticles.Add(particle); + { + if (!ParticlesToDraw_Pixelated.ContainsKey(BlendState.Additive)) + ParticlesToDraw_Pixelated[BlendState.Additive] = []; + return ParticlesToDraw_Pixelated[BlendState.Additive]; + } else if (particle.UseHalfTransparency) - batchedNonPremultipliedParticles.Add(particle); + { + if (!ParticlesToDraw_Pixelated.ContainsKey(BlendState.NonPremultiplied)) + ParticlesToDraw_Pixelated[BlendState.NonPremultiplied] = []; + return ParticlesToDraw_Pixelated[BlendState.NonPremultiplied]; + } else - batchedAlphaBlendParticles.Add(particle); - } - if (batchedAlphaBlendParticles.Count > 0) - { - sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - - foreach (Particle particle in batchedAlphaBlendParticles) { - if (particle.UseCustomDraw) - particle.CustomDraw(sb); - else - { - Color lightColor = particle.Color; - if (particle.AffectedByLight) - { - lightColor = particle.Color.MultiplyRGB(Lighting.GetColor((particle.Position / 16).ToPoint())); - } - - Rectangle frame = particleTextures[particle.Type].Frame(1, particle.FrameVariants, 0, particle.Variant); - sb.Draw(particleTextures[particle.Type], particle.Position - Main.screenPosition, frame, lightColor, particle.Rotation, frame.Size() * 0.5f, - particle.Scale, SpriteEffects.None, 0f); - } + if (!ParticlesToDraw_Pixelated.ContainsKey(BlendState.AlphaBlend)) + ParticlesToDraw_Pixelated[BlendState.AlphaBlend] = []; + return ParticlesToDraw_Pixelated[BlendState.AlphaBlend]; } - sb.End(); } - - - if (batchedNonPremultipliedParticles.Count > 0) + // Non-pixelated particles (regular). + else { - rasterizer = Main.Rasterizer; - rasterizer.ScissorTestEnable = true; - Main.instance.GraphicsDevice.RasterizerState.ScissorTestEnable = true; - Main.instance.GraphicsDevice.ScissorRectangle = new Rectangle(0, 0, Main.screenWidth, Main.screenHeight); - sb.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, DepthStencilState.Default, rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - - foreach (Particle particle in batchedNonPremultipliedParticles) + if (particle.UseAdditiveBlend) { - if (particle.UseCustomDraw) - particle.CustomDraw(sb); - else - { - Rectangle frame = particleTextures[particle.Type].Frame(1, particle.FrameVariants, 0, particle.Variant); - sb.Draw(particleTextures[particle.Type], particle.Position - Main.screenPosition, frame, particle.Color, particle.Rotation, frame.Size() * 0.5f, particle.Scale, SpriteEffects.None, 0f); - } + if (!ParticlesToDraw.ContainsKey(BlendState.Additive)) + ParticlesToDraw[BlendState.Additive] = []; + return ParticlesToDraw[BlendState.Additive]; } - sb.End(); - } - - if (batchedAdditiveBlendParticles.Count > 0) - { - rasterizer = RasterizerState.CullNone; - rasterizer.ScissorTestEnable = true; - Main.instance.GraphicsDevice.RasterizerState.ScissorTestEnable = true; - Main.instance.GraphicsDevice.ScissorRectangle = new Rectangle(0, 0, Main.screenWidth, Main.screenHeight); - sb.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.Default, rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - - foreach (Particle particle in batchedAdditiveBlendParticles) + else if (particle.UseHalfTransparency) { - if (particle.UseCustomDraw) - particle.CustomDraw(sb); - else - { - Rectangle frame = particleTextures[particle.Type].Frame(1, particle.FrameVariants, 0, particle.Variant); - sb.Draw(particleTextures[particle.Type], particle.Position - Main.screenPosition, frame, particle.Color, particle.Rotation, frame.Size() * 0.5f, particle.Scale, SpriteEffects.None, 0f); - } + if (!ParticlesToDraw.ContainsKey(BlendState.NonPremultiplied)) + ParticlesToDraw[BlendState.NonPremultiplied] = []; + return ParticlesToDraw[BlendState.NonPremultiplied]; + } + else + { + if (!ParticlesToDraw.ContainsKey(BlendState.AlphaBlend)) + ParticlesToDraw[BlendState.AlphaBlend] = []; + return ParticlesToDraw[BlendState.AlphaBlend]; } - sb.End(); } - - batchedAlphaBlendParticles.Clear(); - batchedNonPremultipliedParticles.Clear(); - batchedAdditiveBlendParticles.Clear(); - - // Draw all pixelated particles. - DrawPixelatedParticles(); - - sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); } /// diff --git a/Particles/Particle.cs b/Particles/Particle.cs index 0681436106..c53306ebaf 100644 --- a/Particles/Particle.cs +++ b/Particles/Particle.cs @@ -1,4 +1,6 @@ -using Microsoft.Xna.Framework; +using System.Collections.Generic; +using CalamityMod.Enums; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Particles @@ -54,12 +56,20 @@ namespace CalamityMod.Particles /// public bool AffectedByLight = false; + /// + /// The "layer" or point at which you'd like your particle to draw in Terraria's internal draw order. + ///
Defaults to .
+ ///
+ public GeneralDrawLayer DrawLayer = GeneralDrawLayer.AfterEverything; + public virtual int FrameVariants => 1; public int Variant = 0; + public virtual string Texture => ""; /// - /// Whether or not your particle should be drawn slightly pixelated to match Terraria's pixel size. + /// Whether or not your particle should be drawn with a pixelated effect to match Terraria's pixel size. + ///
Defaults to false.
///
public virtual bool Pixelate => false; @@ -95,6 +105,5 @@ namespace CalamityMod.Particles /// Removes the particle from the handler /// public void Kill() => GeneralParticleHandler.RemoveParticle(this); - } } diff --git a/Systems/Graphic/PixelationSystem/PixelatedDrawer.cs b/Systems/Graphic/PixelationSystem/PixelatedDrawer.cs new file mode 100644 index 0000000000..52c5295b11 --- /dev/null +++ b/Systems/Graphic/PixelationSystem/PixelatedDrawer.cs @@ -0,0 +1,15 @@ +using System; +using CalamityMod.Enums; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Systems.Graphic.PixelationSystem +{ + /// + /// Contains a singular Action function which is used to draw any relevant asset(s) automatically with a pixelated effect based on the specified . + /// + public record class PixelatedDrawer(Action DrawAction, GeneralDrawLayer DrawLayer, BlendState DefaultBlendState) + { + + } +} diff --git a/Systems/Graphic/PixelationSystem/PixelationManager.cs b/Systems/Graphic/PixelationSystem/PixelationManager.cs new file mode 100644 index 0000000000..a30a5f65ca --- /dev/null +++ b/Systems/Graphic/PixelationSystem/PixelationManager.cs @@ -0,0 +1,311 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Enums; +using CalamityMod.Graphics; +using CalamityMod.Items.Ammo; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Graphic.PixelationSystem +{ + public class PixelationManager : ModSystem + { + private static Dictionary PixelTargets_BeforeTiles; + private static Dictionary PixelTargets_BeforeNPCs; + private static Dictionary PixelTargets_AfterNPCs; + private static Dictionary PixelTargets_BeforeProjectiles; + private static Dictionary PixelTargets_AfterProjectiles; + private static Dictionary PixelTargets_AfterPlayers; + private static Dictionary PixelTargets_AfterDusts; + private static Dictionary PixelTargets_AfterEverything; + + private static List ActivePixelatedDrawers_BeforeTiles; + private static List ActivePixelatedDrawers_BeforeNPCs; + private static List ActivePixelatedDrawers_AfterNPCs; + private static List ActivePixelatedDrawers_BeforeProjectiles; + private static List ActivePixelatedDrawers_AfterProjectiles; + private static List ActivePixelatedDrawers_AfterPlayers; + private static List ActivePixelatedDrawers_AfterDusts; + private static List ActivePixelatedDrawers_AfterEverything; + + /// + /// The resolution ratio at which pixelated drawers should draw.
+ /// 0.5f will draw at half resolution, 0.25f will draw at quarter resolution, etc. + ///
+ internal const float PixelationResolution = 0.5f; + + /// + /// The transformation matrix used by to draw pixelated assets. + /// + internal static Matrix PixelationMatrix + { + get + { + return Main.GameViewMatrix.TransformationMatrix + * Matrix.CreateScale(PixelationResolution / Main.GameViewMatrix.Zoom.X, PixelationResolution / Main.GameViewMatrix.Zoom.Y, 1f) + * Matrix.CreateTranslation(Main.GameViewMatrix.Translation.X * PixelationResolution, Main.GameViewMatrix.Translation.Y * PixelationResolution, 0f); + } + } + + /// + /// Creates a render target at a ratio of the screen's current dimensions based on . + /// + internal static RenderTarget2D CreatePixelTarget(int width, int height) => new(Main.graphics.GraphicsDevice, (int)(width * PixelationResolution), (int)(height * PixelationResolution)); + + public override void OnModLoad() + { + if (Main.dedServ) + return; + + PixelTargets_BeforeTiles = []; + PixelTargets_BeforeNPCs = []; + PixelTargets_AfterNPCs = []; + PixelTargets_BeforeProjectiles = []; + PixelTargets_AfterProjectiles = []; + PixelTargets_AfterPlayers = []; + PixelTargets_AfterDusts = []; + PixelTargets_AfterEverything = []; + + ActivePixelatedDrawers_BeforeTiles = []; + ActivePixelatedDrawers_BeforeNPCs = []; + ActivePixelatedDrawers_AfterNPCs = []; + ActivePixelatedDrawers_BeforeProjectiles = []; + ActivePixelatedDrawers_AfterProjectiles = []; + ActivePixelatedDrawers_AfterPlayers = []; + ActivePixelatedDrawers_AfterDusts = []; + ActivePixelatedDrawers_AfterEverything = []; + + RenderTargetManager.RenderTargetUpdateLoopEvent += PrepareTargets; + On_Main.DrawBackgroundBlackFill += DrawPixelated_BeforeTiles; + On_Main.DrawNPCs += DrawPixelated_NPCs; + On_Main.DrawProjectiles += DrawPixelated_Projectiles; + On_Main.DrawPlayers_AfterProjectiles += DrawPixelated_AfterPlayers; + On_Main.DrawDust += DrawPixelated_AfterDusts; + On_Main.DrawInfernoRings += DrawPixelated_AfterEverything; + } + + public override void OnModUnload() + { + if (Main.dedServ) + return; + + PixelTargets_BeforeTiles = null; + PixelTargets_BeforeNPCs = null; + PixelTargets_AfterNPCs = null; + PixelTargets_BeforeProjectiles = null; + PixelTargets_AfterProjectiles = null; + PixelTargets_AfterPlayers = null; + PixelTargets_AfterDusts = null; + PixelTargets_AfterEverything = null; + + ActivePixelatedDrawers_BeforeTiles = null; + ActivePixelatedDrawers_BeforeNPCs = null; + ActivePixelatedDrawers_AfterNPCs = null; + ActivePixelatedDrawers_BeforeProjectiles = null; + ActivePixelatedDrawers_AfterProjectiles = null; + ActivePixelatedDrawers_AfterPlayers = null; + ActivePixelatedDrawers_AfterDusts = null; + ActivePixelatedDrawers_AfterEverything = null; + } + + public override void OnWorldUnload() + { + if (Main.dedServ) + return; + + ActivePixelatedDrawers_BeforeTiles = null; + ActivePixelatedDrawers_BeforeNPCs = null; + ActivePixelatedDrawers_AfterNPCs = null; + ActivePixelatedDrawers_BeforeProjectiles = null; + ActivePixelatedDrawers_AfterProjectiles = null; + ActivePixelatedDrawers_AfterPlayers = null; + ActivePixelatedDrawers_AfterDusts = null; + ActivePixelatedDrawers_AfterEverything = null; + } + + + /// + /// Queues a instance to draw pixelated assets. + /// + /// All relevant drawing code should be written here. + /// The layer at which you'd like these assets to be drawn on.
e.g. will make all drawn assets render behind all projectiles.
+ /// The default that your pixelated assets will be rendered in. + ///
Leave as null to render them using .
+ public static void AddPixelatedDrawer(Action drawAction, GeneralDrawLayer drawLayer, BlendState defaultBlendState = null) + { + if (Main.dedServ || Main.gameMenu) + return; + + BlendState blendState = defaultBlendState ?? BlendState.AlphaBlend; + + // Check if the associated render target for this drawer exists and create it if necessary. + VerifyTargetExistence(drawLayer, blendState); + + PixelatedDrawer drawer = new(drawAction, drawLayer, blendState); + ReturnAssociatedDrawerCollection(drawLayer).Add(drawer); + } + + private static void PrepareTargets() + { + if (!Main.gameMenu && !Main.dedServ) + { + // Draw all collections to their respctive render targets. + DrawCollectionsToTarget(PixelTargets_BeforeTiles, PixelationMatrix, ActivePixelatedDrawers_BeforeTiles); + DrawCollectionsToTarget(PixelTargets_BeforeNPCs, PixelationMatrix, ActivePixelatedDrawers_BeforeNPCs); + DrawCollectionsToTarget(PixelTargets_AfterNPCs, PixelationMatrix, ActivePixelatedDrawers_AfterNPCs); + DrawCollectionsToTarget(PixelTargets_BeforeProjectiles, PixelationMatrix, ActivePixelatedDrawers_BeforeProjectiles); + DrawCollectionsToTarget(PixelTargets_AfterProjectiles, PixelationMatrix, ActivePixelatedDrawers_AfterProjectiles); + DrawCollectionsToTarget(PixelTargets_AfterPlayers, PixelationMatrix, ActivePixelatedDrawers_AfterPlayers); + DrawCollectionsToTarget(PixelTargets_AfterDusts, PixelationMatrix, ActivePixelatedDrawers_AfterDusts); + DrawCollectionsToTarget(PixelTargets_AfterEverything, PixelationMatrix, ActivePixelatedDrawers_AfterEverything); + + Main.graphics.GraphicsDevice.SetRenderTarget(null); + } + } + + private static void DrawPixelated_BeforeTiles(On_Main.orig_DrawBackgroundBlackFill orig, Main self) + { + DrawPixelatedTargets(PixelTargets_BeforeTiles); + orig(self); + } + + private static void DrawPixelated_NPCs(On_Main.orig_DrawNPCs orig, Main self, bool behindTiles) + { + if (!behindTiles) + DrawPixelatedTargets(PixelTargets_BeforeNPCs); + + orig(self, behindTiles); + + if (!behindTiles) + DrawPixelatedTargets(PixelTargets_AfterNPCs); + } + + private static void DrawPixelated_Projectiles(On_Main.orig_DrawProjectiles orig, Main self) + { + DrawPixelatedTargets(PixelTargets_BeforeProjectiles); + orig(self); + DrawPixelatedTargets(PixelTargets_AfterProjectiles); + } + + private static void DrawPixelated_AfterPlayers(On_Main.orig_DrawPlayers_AfterProjectiles orig, Main self) + { + orig(self); + DrawPixelatedTargets(PixelTargets_AfterPlayers); + } + + private static void DrawPixelated_AfterDusts(On_Main.orig_DrawDust orig, Main self) + { + orig(self); + DrawPixelatedTargets(PixelTargets_AfterDusts); + } + + private static void DrawPixelated_AfterEverything(On_Main.orig_DrawInfernoRings orig, Main self) + { + orig(self); + DrawPixelatedTargets(PixelTargets_AfterEverything); + } + + private static void DrawCollectionsToTarget(Dictionary targetCollection, Matrix pixelationMatrix, List drawerCollection) + { + foreach (var blendStateTargetPair in targetCollection) + { + blendStateTargetPair.Value.SwapTo(); + + Main.spriteBatch.Begin(default, blendStateTargetPair.Key, SamplerState.LinearClamp, default, default, null, pixelationMatrix); + + // Select only drawers who match this target's BlendState. + var drawersByBlendState = drawerCollection.Where(d => d.DefaultBlendState == blendStateTargetPair.Key).ToList(); + if (drawersByBlendState.Count > 0) + { + foreach (PixelatedDrawer drawer in drawersByBlendState) + drawer.DrawAction.Invoke(pixelationMatrix); + } + + Main.spriteBatch.End(); + } + + drawerCollection.Clear(); + } + + private static void DrawPixelatedTargets(Dictionary targetCollection) + { + Main.spriteBatch.SafeAction(() => + { + foreach (var keyValuePair in targetCollection) + { + Main.spriteBatch.TryEnd(); + Main.spriteBatch.TryBegin(SpriteSortMode.Deferred, keyValuePair.Key, Main.DefaultSamplerState, default, default, null, Main.GameViewMatrix.TransformationMatrix); + + float targetScale = 1f / PixelationResolution; + Main.spriteBatch.Draw(keyValuePair.Value, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, targetScale, SpriteEffects.None, 0f); + } + }); + } + + private static List ReturnAssociatedDrawerCollection(GeneralDrawLayer drawLayer) + { + List drawerCollection = drawLayer switch + { + GeneralDrawLayer.BeforeTiles => ActivePixelatedDrawers_BeforeTiles, + GeneralDrawLayer.BeforeNPCs => ActivePixelatedDrawers_BeforeNPCs, + GeneralDrawLayer.AfterNPCs => ActivePixelatedDrawers_AfterNPCs, + GeneralDrawLayer.BeforeProjectiles => ActivePixelatedDrawers_BeforeProjectiles, + GeneralDrawLayer.AfterProjectiles => ActivePixelatedDrawers_AfterProjectiles, + GeneralDrawLayer.AfterPlayers => ActivePixelatedDrawers_AfterPlayers, + GeneralDrawLayer.AfterDusts => ActivePixelatedDrawers_AfterDusts, + _ => ActivePixelatedDrawers_AfterEverything, + }; + + return drawerCollection; + } + + private static void VerifyTargetExistence(GeneralDrawLayer drawLayer, BlendState blendState) + { + switch (drawLayer) + { + case GeneralDrawLayer.BeforeTiles: + if (!PixelTargets_BeforeTiles.ContainsKey(blendState)) + Main.QueueMainThreadAction(() => PixelTargets_BeforeTiles[blendState] = new(true, CreatePixelTarget)); + break; + + case GeneralDrawLayer.BeforeNPCs: + if (!PixelTargets_BeforeNPCs.ContainsKey(blendState)) + Main.QueueMainThreadAction(() => PixelTargets_BeforeNPCs[blendState] = new(true, CreatePixelTarget)); + break; + + case GeneralDrawLayer.AfterNPCs: + if (!PixelTargets_AfterNPCs.ContainsKey(blendState)) + Main.QueueMainThreadAction(() => PixelTargets_AfterNPCs[blendState] = new(true, CreatePixelTarget)); + break; + + case GeneralDrawLayer.BeforeProjectiles: + if (!PixelTargets_BeforeProjectiles.ContainsKey(blendState)) + Main.QueueMainThreadAction(() => PixelTargets_BeforeProjectiles[blendState] = new(true, CreatePixelTarget)); + break; + + case GeneralDrawLayer.AfterProjectiles: + if (!PixelTargets_AfterProjectiles.ContainsKey(blendState)) + Main.QueueMainThreadAction(() => PixelTargets_AfterProjectiles[blendState] = new(true, CreatePixelTarget)); + break; + + case GeneralDrawLayer.AfterPlayers: + if (!PixelTargets_AfterPlayers.ContainsKey(blendState)) + Main.QueueMainThreadAction(() => PixelTargets_AfterPlayers[blendState] = new(true, CreatePixelTarget)); + break; + + case GeneralDrawLayer.AfterDusts: + if (!PixelTargets_AfterDusts.ContainsKey(blendState)) + Main.QueueMainThreadAction(() => PixelTargets_AfterDusts[blendState] = new(true, CreatePixelTarget)); + break; + + case GeneralDrawLayer.AfterEverything: + if (!PixelTargets_AfterEverything.ContainsKey(blendState)) + Main.QueueMainThreadAction(() => PixelTargets_AfterEverything[blendState] = new(true, CreatePixelTarget)); + break; + } + } + } +} From d95113418e9f21c45bba1a4ba4dc2927dee5cf67 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Wed, 5 Nov 2025 11:48:22 -0400 Subject: [PATCH 02/48] ParticleAutoDrawingOverride + code cleanup, credits and bugfix * Added ParticleAutoDrawingOverride, which allows one to override the automatic drawing of a particular particle type and manually and efficiently control how each instance is drawn in the world. * Subsequently added the OverrideAutomaticDrawing property to Particle. * Multiple changes to GeneralParticleHander.cs: * Removed the noteToEveryone field, but moved the text to a comment at the top of the class. * Additionally, added credits to Luminance and their license notice since the new particle drawing logic was inspired by its system. * Reorganized fields based on their protection level. * Renamed "particles," "particleTypes" and "particleTextures" to "activeParticles," "particleIDsByTypes" and "particleTexturesByIDs" respectively. * Added documentation for all internal fields * Moved the GetTexture and FreeSpaceAvailable methods up with the rest of the public static methods for consistency. * The "ActivePixelatedDrawer_" fields in are now cleared upon unloading the world instead of being set to null to prevent a null reference exception when leaving and reentering worlds. --- Particles/GeneralParticleHandler.cs | 281 ++++++++++++------ Particles/Particle.cs | 9 +- Particles/ParticleAutoDrawingOverride.cs | 57 ++++ .../Melee/ArkoftheCosmos_Constellation.cs | 2 +- .../Melee/Galaxia_AriesWrathConstellation.cs | 2 +- .../PixelationSystem/PixelationManager.cs | 17 +- 6 files changed, 268 insertions(+), 100 deletions(-) create mode 100644 Particles/ParticleAutoDrawingOverride.cs diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 8285f5ada9..62d85051c4 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -2,37 +2,69 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; -using CalamityMod.Effects; using CalamityMod.Enums; -using CalamityMod.Graphics; using CalamityMod.Systems.Graphic.PixelationSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; -using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Core; -using Terraria.ModLoader.IO; namespace CalamityMod.Particles { + // IMPORTANT CREDITS: + + // 06JAN2022: Iban + // This particle system was inspired by spirit mod's own particle system, with permission granted by Yuyutsu. Love you spirit mod! -Iban + + // 05NOV2025: fryzahh + // Particle drawing implementation was inspired by Luminance's ParticleManager.cs. See licensing information below: + // https://github.com/LucilleKarma/Luminance/blob/main/LICENSE + // + // MIT License + // + // Copyright(c) 2024 Dominic + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to deal + // in the Software without restriction, including without limitation the rights + // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + // copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in all + // copies or substantial portions of the Software. + [Autoload(Side = ModSide.Client)] public sealed class GeneralParticleHandler : ModSystem { #region Fields - private static List particles; - private static Dictionary> particlesToSpawnNextFrame; - // List containing the particles to delete + /// + /// The integer ID of each particle type defined across all mods, identified by the internal type of the respective particle. + /// + internal static Dictionary particleIDsByTypes; + + /// + /// All types defined across all mods, identified by a string for each respective particle which follows the following format: + ///
{Particle's Home Mod's Internal Name}.{Particle's Internal Name}
+ ///
+ internal static Dictionary particleTypesByNames; + + /// + /// The individual, autoloaded textures of each particle type defined across all mods, identified by the ID of the respective particle. + /// + internal static Dictionary particleTexturesByIDs; + + /// + /// All types defined across all mods, identified by the type of the particle the drawers target. + /// + internal static Dictionary particleAutoDrawingOverrides; + + private static List activeParticles; private static List particlesToKill; - - // Static list for details concerning every particle type - internal static Dictionary particleTypes; - internal static Dictionary particleTextures; - - // Collections for storing and ordring particle instances for drawing. - private static Dictionary> ParticlesToDraw; - private static Dictionary> ParticlesToDraw_Pixelated; + private static Dictionary> particlesToSpawnNextFrame; + private static Dictionary> particlesToDraw; + private static Dictionary> particlesToDraw_Pixelated; #endregion #region Loading and Unloading @@ -41,8 +73,11 @@ namespace CalamityMod.Particles Type baseParticleType = typeof(Particle); ReflectionHelper.IterateEveryModsTypes(action: type => { - int ID = particleTypes.Count; //Get the ID of the particle - particleTypes[type] = ID; + int ID = particleIDsByTypes.Count; //Get the ID of the particle + particleIDsByTypes[type] = ID; + + string registrationName = string.Concat(type.FullName.AsSpan(0, type.FullName.IndexOf('.')), ".", type.Name); + particleTypesByNames[registrationName] = type; // Flow: 2024/09/17 // 'UnintializedObject' is allowed to use here as it's only read for Texture string Property @@ -55,20 +90,39 @@ namespace CalamityMod.Particles string texturePath = type.Namespace.Replace('.', '/') + "/" + type.Name; if (instance.Texture != "") texturePath = instance.Texture; - particleTextures[ID] = ModContent.Request(texturePath, AssetRequestMode.ImmediateLoad).Value; + particleTexturesByIDs[ID] = ModContent.Request(texturePath, AssetRequestMode.ImmediateLoad).Value; }); + + foreach (Mod mod in ModLoader.Mods) + { + var drawers = mod.GetContent().Where(c => c is ParticleAutoDrawingOverride).Select(c => c as ParticleAutoDrawingOverride); + foreach (var drawer in drawers) + { + if (drawer.TargetParticleTypeName != "") + { + if (particleTypesByNames.TryGetValue(drawer.TargetParticleTypeName, out Type particleType)) + particleAutoDrawingOverrides.Add(particleType, drawer); + else + throw new Exception($"The Particle of name \"{drawer.TargetParticleTypeName}\" used in {drawer.GetType().Name} could not be found! " + + $"Please ensure the Paricle's internal name is spelt correctly and is prefixed by its home mod's internal name."); + } + } + } } public override void Load() { - particles = []; - particlesToSpawnNextFrame = []; - particlesToKill = []; - particleTypes = []; - particleTextures = []; + particleTypesByNames = []; + particleIDsByTypes = []; + particleTexturesByIDs = []; - ParticlesToDraw = []; - ParticlesToDraw_Pixelated = []; + particleAutoDrawingOverrides = []; + + activeParticles = []; + particlesToKill = []; + particlesToSpawnNextFrame = []; + particlesToDraw = []; + particlesToDraw_Pixelated = []; On_Main.DrawBackgroundBlackFill += DrawParticles_BeforeTiles; On_Main.DrawNPCs += DrawParticles_NPCs; @@ -80,14 +134,26 @@ namespace CalamityMod.Particles public override void Unload() { - particles = null; - particlesToSpawnNextFrame = null; - particlesToKill = null; - particleTypes = null; - particleTextures = null; + particleTypesByNames = null; + particleIDsByTypes = null; + particleTexturesByIDs = null; - ParticlesToDraw = null; - ParticlesToDraw_Pixelated = null; + particleAutoDrawingOverrides = null; + + activeParticles = null; + particlesToKill = null; + particlesToSpawnNextFrame = null; + particlesToDraw = null; + particlesToDraw_Pixelated = null; + } + + public override void OnWorldUnload() + { + activeParticles.Clear(); + particlesToKill.Clear(); + particlesToSpawnNextFrame.Clear(); + particlesToDraw.Clear(); + particlesToDraw_Pixelated.Clear(); } #endregion @@ -100,18 +166,18 @@ namespace CalamityMod.Particles // Don't queue particles if the game is paused. // This precedent is established with how Dust instances are created. // Don't spawn particles if on the server either, or if the particles dictionary is somehow null. - if (Main.gamePaused || Main.dedServ || particles == null) + if (Main.gamePaused || Main.dedServ || activeParticles == null) return; - if (particles.Count >= CalamityClientConfig.Instance.ParticleLimit && !particle.Important) + if (activeParticles.Count >= CalamityClientConfig.Instance.ParticleLimit && !particle.Important) return; if (manualDrawLayerOverride.HasValue) particle.DrawLayer = manualDrawLayerOverride.Value; - particles.Add(particle); - ReturnAssociatedDrawCollection(particle).Add(particle); - particle.Type = particleTypes[particle.GetType()]; + activeParticles.Add(particle); + AddToAssociatedDrawCollection(particle); + particle.Type = particleIDsByTypes[particle.GetType()]; } /// @@ -125,7 +191,7 @@ namespace CalamityMod.Particles // Don't queue particles if the game is paused. // This precedent is established with how Dust instances are created. // Don't spawn particles if on the server side, or if the particles dictionary is somehow null. - if (Main.gamePaused || Main.dedServ || particles == null) + if (Main.gamePaused || Main.dedServ || activeParticles == null) return; // Get the correct draw layer to spawn this particle on. @@ -145,7 +211,31 @@ namespace CalamityMod.Particles return; particlesToKill.Add(particle); - ReturnAssociatedDrawCollection(particle).Remove(particle); + RemoveFromAssociatedDrawCollection(particle); + } + + /// + /// Gives you the amount of particle slots that are available. Useful when you need multiple particles at once to make an effect and dont want it to be only halfway drawn due to a lack of particle slots + /// + /// + public static int FreeSpacesAvailable() + { + //Safety check + if (Main.dedServ || activeParticles == null) + return 0; + + return CalamityClientConfig.Instance.ParticleLimit - activeParticles.Count(); + } + + /// + /// Gives you the texture of the particle type. Useful for custom drawing + /// + public static Texture2D GetTexture(int type) + { + if (Main.dedServ) + return null; + + return particleTexturesByIDs[type]; } public static void Update() @@ -161,7 +251,7 @@ namespace CalamityMod.Particles } // Update all particle instances in the world. - foreach (Particle particle in particles) + foreach (Particle particle in activeParticles) { if (particle == null) continue; @@ -172,11 +262,11 @@ namespace CalamityMod.Particles } //Clear out particles whose time is up - particles.RemoveAll(particle => + activeParticles.RemoveAll(particle => { if ((particle.Time >= particle.Lifetime && particle.SetLifetime) || particlesToKill.Contains(particle)) { - ReturnAssociatedDrawCollection(particle).Remove(particle); + RemoveFromAssociatedDrawCollection(particle); return true; } return false; @@ -255,8 +345,8 @@ namespace CalamityMod.Particles if (particle.AffectedByLight) lightColor = particle.Color.MultiplyRGB(Lighting.GetColor((particle.Position / 16).ToPoint())); - Rectangle frame = particleTextures[particle.Type].Frame(1, particle.FrameVariants, 0, particle.Variant); - Main.spriteBatch.Draw(particleTextures[particle.Type], particle.Position - Main.screenPosition, frame, lightColor, particle.Rotation, frame.Size() * 0.5f, particle.Scale, SpriteEffects.None, 0f); + Rectangle frame = particleTexturesByIDs[particle.Type].Frame(1, particle.FrameVariants, 0, particle.Variant); + Main.spriteBatch.Draw(particleTexturesByIDs[particle.Type], particle.Position - Main.screenPosition, frame, lightColor, particle.Rotation, frame.Size() * 0.5f, particle.Scale, SpriteEffects.None, 0f); } } @@ -303,8 +393,31 @@ namespace CalamityMod.Particles if (Main.dedServ) return; - DrawParticleCollection(ParticlesToDraw, drawLayer); - DrawParticleCollection(ParticlesToDraw_Pixelated, drawLayer, true); + DrawParticleCollection(particlesToDraw, drawLayer); + DrawParticleCollection(particlesToDraw_Pixelated, drawLayer, true); + + foreach (ParticleAutoDrawingOverride drawer in particleAutoDrawingOverrides.Values) + { + if (!drawer.ShouldDrawParticles) + return; + + foreach (var keyValuePair in drawer.ActiveParticleInstances) + { + if (keyValuePair.Value.Count == 0) + return; + + if (drawer.DrawLayerOverride.HasValue) + { + if (drawer.DrawLayerOverride.Value == drawLayer) + drawer.DrawAllParticles(Main.spriteBatch, keyValuePair.Value); + } + else + { + if (keyValuePair.Key == drawLayer) + drawer.DrawAllParticles(Main.spriteBatch, keyValuePair.Value); + } + } + } } private static List ReturnAssociatedDrawCollection(Particle particle) @@ -314,21 +427,21 @@ namespace CalamityMod.Particles { if (particle.UseAdditiveBlend) { - if (!ParticlesToDraw_Pixelated.ContainsKey(BlendState.Additive)) - ParticlesToDraw_Pixelated[BlendState.Additive] = []; - return ParticlesToDraw_Pixelated[BlendState.Additive]; + if (!particlesToDraw_Pixelated.ContainsKey(BlendState.Additive)) + particlesToDraw_Pixelated[BlendState.Additive] = []; + return particlesToDraw_Pixelated[BlendState.Additive]; } else if (particle.UseHalfTransparency) { - if (!ParticlesToDraw_Pixelated.ContainsKey(BlendState.NonPremultiplied)) - ParticlesToDraw_Pixelated[BlendState.NonPremultiplied] = []; - return ParticlesToDraw_Pixelated[BlendState.NonPremultiplied]; + if (!particlesToDraw_Pixelated.ContainsKey(BlendState.NonPremultiplied)) + particlesToDraw_Pixelated[BlendState.NonPremultiplied] = []; + return particlesToDraw_Pixelated[BlendState.NonPremultiplied]; } else { - if (!ParticlesToDraw_Pixelated.ContainsKey(BlendState.AlphaBlend)) - ParticlesToDraw_Pixelated[BlendState.AlphaBlend] = []; - return ParticlesToDraw_Pixelated[BlendState.AlphaBlend]; + if (!particlesToDraw_Pixelated.ContainsKey(BlendState.AlphaBlend)) + particlesToDraw_Pixelated[BlendState.AlphaBlend] = []; + return particlesToDraw_Pixelated[BlendState.AlphaBlend]; } } // Non-pixelated particles (regular). @@ -336,51 +449,45 @@ namespace CalamityMod.Particles { if (particle.UseAdditiveBlend) { - if (!ParticlesToDraw.ContainsKey(BlendState.Additive)) - ParticlesToDraw[BlendState.Additive] = []; - return ParticlesToDraw[BlendState.Additive]; + if (!particlesToDraw.ContainsKey(BlendState.Additive)) + particlesToDraw[BlendState.Additive] = []; + return particlesToDraw[BlendState.Additive]; } else if (particle.UseHalfTransparency) { - if (!ParticlesToDraw.ContainsKey(BlendState.NonPremultiplied)) - ParticlesToDraw[BlendState.NonPremultiplied] = []; - return ParticlesToDraw[BlendState.NonPremultiplied]; + if (!particlesToDraw.ContainsKey(BlendState.NonPremultiplied)) + particlesToDraw[BlendState.NonPremultiplied] = []; + return particlesToDraw[BlendState.NonPremultiplied]; } else { - if (!ParticlesToDraw.ContainsKey(BlendState.AlphaBlend)) - ParticlesToDraw[BlendState.AlphaBlend] = []; - return ParticlesToDraw[BlendState.AlphaBlend]; + if (!particlesToDraw.ContainsKey(BlendState.AlphaBlend)) + particlesToDraw[BlendState.AlphaBlend] = []; + return particlesToDraw[BlendState.AlphaBlend]; } } } - /// - /// Gives you the amount of particle slots that are available. Useful when you need multiple particles at once to make an effect and dont want it to be only halfway drawn due to a lack of particle slots - /// - /// - public static int FreeSpacesAvailable() + private static void AddToAssociatedDrawCollection(Particle particle) { - //Safety check - if (Main.dedServ || particles == null) - return 0; - - return CalamityClientConfig.Instance.ParticleLimit - particles.Count(); + if (particle.OverrideAutomaticDrawing && particleAutoDrawingOverrides[particle.GetType()].ShouldDrawParticles) + { + if (!particleAutoDrawingOverrides[particle.GetType()].ActiveParticleInstances.ContainsKey(particle.DrawLayer)) + particleAutoDrawingOverrides[particle.GetType()].ActiveParticleInstances[particle.DrawLayer] = []; + particleAutoDrawingOverrides[particle.GetType()].ActiveParticleInstances[particle.DrawLayer].Add(particle); + } + else + { + ReturnAssociatedDrawCollection(particle).Add(particle); + } } - /// - /// Gives you the texture of the particle type. Useful for custom drawing - /// - public static Texture2D GetTexture(int type) + private static void RemoveFromAssociatedDrawCollection(Particle particle) { - if (Main.dedServ) - return null; - - return particleTextures[type]; + if (particle.OverrideAutomaticDrawing) + particleAutoDrawingOverrides[particle.GetType()].ActiveParticleInstances[particle.DrawLayer].Remove(particle); + else + ReturnAssociatedDrawCollection(particle).Remove(particle); } - -#pragma warning disable CS0414 - private static string noteToEveryone = "This particle system was inspired by spirit mod's own particle system, with permission granted by Yuyutsu. Love you spirit mod! -Iban"; -#pragma warning restore CS0414 } } diff --git a/Particles/Particle.cs b/Particles/Particle.cs index c53306ebaf..3174ba2aba 100644 --- a/Particles/Particle.cs +++ b/Particles/Particle.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using CalamityMod.Enums; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -78,6 +77,12 @@ namespace CalamityMod.Particles /// public virtual bool UseCustomDraw => false; + /// + /// Override and set this to true to disable automatic drawing for all instances of this particle entirely. + ///
Drawing of this particle must be done from a class.
+ ///
+ public virtual bool OverrideAutomaticDrawing => false; + /// /// Use this method if you want to handle the particle drawing yourself. Only called if Particle.UseCustomDraw is set to true. /// diff --git a/Particles/ParticleAutoDrawingOverride.cs b/Particles/ParticleAutoDrawingOverride.cs new file mode 100644 index 0000000000..5a5ec3a257 --- /dev/null +++ b/Particles/ParticleAutoDrawingOverride.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using CalamityMod.Enums; +using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + /// + /// Allows one to directly control how all active instances of a specified particle type in the world are drawn. + ///
Useful for cases such as applying shaders to particles without resetting the SpriteBatch for every individual particle instance.
+ ///
+ /// + /// Note that particles using an instance of this class MUST have set to true. + /// + public abstract class ParticleAutoDrawingOverride : ModType + { + /// + /// All active particle instances for this drawer, identified by a particle's draw layer. + /// + public Dictionary> ActiveParticleInstances { get; private set; } = []; + + /// + /// The internal name of the particle type that should be manually drawn. + ///
Particle names should be prefixed with the internal name of the mod they are from.
+ ///
e.g. "CalamityMod.PulseRing" is valid, while just "PulseRing" is not.
+ ///
+ /// + /// This is only checked once when the mod is loading. Changing this during runtime will not affect anything. + /// + public abstract string TargetParticleTypeName { get; } + + /// + /// Whether or not this drawer should draw its particles this frame. + ///
Return false to prevent currently stored particles from being drawn and new ones from being added to .
+ ///
+ /// + /// Returns true by default. + /// + public virtual bool ShouldDrawParticles => true; + + /// + /// An optional property which will override the draw layer of all particles for this drawer entirely, using the specified one here instead. + /// + public virtual GeneralDrawLayer? DrawLayerOverride => null; + + protected sealed override void Register() => ModTypeLookup.Register(this); + + public sealed override void SetupContent() => SetStaticDefaults(); + + /// + /// Write all relevenat draw code for your particles here. + /// + /// Stores particles based on their default draw layer. + ///
Iterate through this collection to run individual particle drawing logic.
+ public abstract void DrawAllParticles(SpriteBatch spriteBatch, List particlesToDraw); + } +} diff --git a/Projectiles/Melee/ArkoftheCosmos_Constellation.cs b/Projectiles/Melee/ArkoftheCosmos_Constellation.cs index 796b9d43b2..b4cdf66a10 100644 --- a/Projectiles/Melee/ArkoftheCosmos_Constellation.cs +++ b/Projectiles/Melee/ArkoftheCosmos_Constellation.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Melee if (!Main.dedServ) { Particles.Add(particle); - particle.Type = GeneralParticleHandler.particleTypes[particle.GetType()]; + particle.Type = GeneralParticleHandler.particleIDsByTypes[particle.GetType()]; } } diff --git a/Projectiles/Melee/Galaxia_AriesWrathConstellation.cs b/Projectiles/Melee/Galaxia_AriesWrathConstellation.cs index f28406a3ee..fb8dcc5914 100644 --- a/Projectiles/Melee/Galaxia_AriesWrathConstellation.cs +++ b/Projectiles/Melee/Galaxia_AriesWrathConstellation.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Melee if (!Main.dedServ) { Particles.Add(particle); - particle.Type = GeneralParticleHandler.particleTypes[particle.GetType()]; + particle.Type = GeneralParticleHandler.particleIDsByTypes[particle.GetType()]; } } diff --git a/Systems/Graphic/PixelationSystem/PixelationManager.cs b/Systems/Graphic/PixelationSystem/PixelationManager.cs index a30a5f65ca..c3d80ecc30 100644 --- a/Systems/Graphic/PixelationSystem/PixelationManager.cs +++ b/Systems/Graphic/PixelationSystem/PixelationManager.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Enums; using CalamityMod.Graphics; -using CalamityMod.Items.Ammo; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -116,14 +115,14 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem if (Main.dedServ) return; - ActivePixelatedDrawers_BeforeTiles = null; - ActivePixelatedDrawers_BeforeNPCs = null; - ActivePixelatedDrawers_AfterNPCs = null; - ActivePixelatedDrawers_BeforeProjectiles = null; - ActivePixelatedDrawers_AfterProjectiles = null; - ActivePixelatedDrawers_AfterPlayers = null; - ActivePixelatedDrawers_AfterDusts = null; - ActivePixelatedDrawers_AfterEverything = null; + ActivePixelatedDrawers_BeforeTiles.Clear(); + ActivePixelatedDrawers_BeforeNPCs.Clear(); + ActivePixelatedDrawers_AfterNPCs.Clear(); + ActivePixelatedDrawers_BeforeProjectiles.Clear(); + ActivePixelatedDrawers_AfterProjectiles.Clear(); + ActivePixelatedDrawers_AfterPlayers.Clear(); + ActivePixelatedDrawers_AfterDusts.Clear(); + ActivePixelatedDrawers_AfterEverything.Clear(); } From a16bd3ec6eac66fcca4f10898b497e44cb063332 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Fri, 7 Nov 2025 13:16:02 -0400 Subject: [PATCH 03/48] Updated GeneralParticleHandler.SpawnParticle and reorganized Particle.cs * Updated GeneralParticleHandler.SpawnParticle with an optional pixelate parameter. Set to true to have spawned particles be pixelated. * Encapsulated GeneralParticleHandler's credits in a region. * Cleaned up and reorganized Particle.cs. * Added documentation comments for all fields and properties in Particle.cs. --- Particles/GeneralParticleHandler.cs | 68 ++++++++++--- Particles/Particle.cs | 151 +++++++++++++++++----------- 2 files changed, 148 insertions(+), 71 deletions(-) diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 62d85051c4..873bf88ae8 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -12,7 +12,8 @@ using Terraria.ModLoader; namespace CalamityMod.Particles { - // IMPORTANT CREDITS: + // Important credits for Spirit and Luminance: + #region CREDITS // 06JAN2022: Iban // This particle system was inspired by spirit mod's own particle system, with permission granted by Yuyutsu. Love you spirit mod! -Iban @@ -34,6 +35,7 @@ namespace CalamityMod.Particles // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. + #endregion [Autoload(Side = ModSide.Client)] public sealed class GeneralParticleHandler : ModSystem @@ -63,6 +65,7 @@ namespace CalamityMod.Particles private static List activeParticles; private static List particlesToKill; private static Dictionary> particlesToSpawnNextFrame; + private static Dictionary> particlesToSpawnNextFrame_Pixelated; private static Dictionary> particlesToDraw; private static Dictionary> particlesToDraw_Pixelated; #endregion @@ -121,6 +124,7 @@ namespace CalamityMod.Particles activeParticles = []; particlesToKill = []; particlesToSpawnNextFrame = []; + particlesToSpawnNextFrame_Pixelated = []; particlesToDraw = []; particlesToDraw_Pixelated = []; @@ -143,6 +147,7 @@ namespace CalamityMod.Particles activeParticles = null; particlesToKill = null; particlesToSpawnNextFrame = null; + particlesToSpawnNextFrame_Pixelated = null; particlesToDraw = null; particlesToDraw_Pixelated = null; } @@ -152,6 +157,7 @@ namespace CalamityMod.Particles activeParticles.Clear(); particlesToKill.Clear(); particlesToSpawnNextFrame.Clear(); + particlesToSpawnNextFrame_Pixelated.Clear(); particlesToDraw.Clear(); particlesToDraw_Pixelated.Clear(); } @@ -161,7 +167,7 @@ namespace CalamityMod.Particles /// Spawns the particle instance provided into the world. If the particle limit is reached but the particle is marked as important, it will try to replace a non important particle. /// /// Only set this to a non-null value if you'd like to manually override the draw layer of the particle instance you are spawning. - public static void SpawnParticle(Particle particle, GeneralDrawLayer? manualDrawLayerOverride = null) + public static void SpawnParticle(Particle particle, bool pixelate = false, GeneralDrawLayer? manualDrawLayerOverride = null) { // Don't queue particles if the game is paused. // This precedent is established with how Dust instances are created. @@ -172,6 +178,7 @@ namespace CalamityMod.Particles if (activeParticles.Count >= CalamityClientConfig.Instance.ParticleLimit && !particle.Important) return; + particle.Pixelate = pixelate; if (manualDrawLayerOverride.HasValue) particle.DrawLayer = manualDrawLayerOverride.Value; @@ -186,7 +193,7 @@ namespace CalamityMod.Particles /// another particle type.
///
The single frame buffer ensures the overall particle update loop isn't altered prematurely from within the loop itself.
/// - public static void QueueParticleForNextFrame(Particle particle, GeneralDrawLayer? manualDrawLayerOverride = null) + public static void QueueParticleForNextFrame(Particle particle, bool pixelate = false, GeneralDrawLayer? manualDrawLayerOverride = null) { // Don't queue particles if the game is paused. // This precedent is established with how Dust instances are created. @@ -194,12 +201,19 @@ namespace CalamityMod.Particles if (Main.gamePaused || Main.dedServ || activeParticles == null) return; - // Get the correct draw layer to spawn this particle on. GeneralDrawLayer actualDrawLayer = manualDrawLayerOverride ?? particle.DrawLayer; - if (!particlesToSpawnNextFrame.ContainsKey(actualDrawLayer)) - particlesToSpawnNextFrame[actualDrawLayer] = []; - - particlesToSpawnNextFrame[actualDrawLayer].Enqueue(particle); + if (pixelate) + { + if (!particlesToSpawnNextFrame_Pixelated.ContainsKey(actualDrawLayer)) + particlesToSpawnNextFrame_Pixelated[actualDrawLayer] = []; + particlesToSpawnNextFrame_Pixelated[actualDrawLayer].Enqueue(particle); + } + else + { + if (!particlesToSpawnNextFrame.ContainsKey(actualDrawLayer)) + particlesToSpawnNextFrame[actualDrawLayer] = []; + particlesToSpawnNextFrame[actualDrawLayer].Enqueue(particle); + } } /// @@ -207,11 +221,29 @@ namespace CalamityMod.Particles /// public static void RemoveParticle(Particle particle) { - if (Main.dedServ) - return; + if (!Main.dedServ) + particlesToKill.Add(particle); + } - particlesToKill.Add(particle); - RemoveFromAssociatedDrawCollection(particle); + /// + /// Removes all active particle instances in the world of a specified type. + /// + public static void RemoveParticlesOfType() where T : Particle + { + foreach (Particle particle in activeParticles) + { + if (particle.GetType() == typeof(T)) + particlesToKill.Add(particle); + } + } + + /// + /// Removes ALL active particle instances in the world. + /// + public static void RemoveAllParticles() + { + foreach (Particle particle in activeParticles) + particlesToKill.Add(particle); } /// @@ -244,10 +276,16 @@ namespace CalamityMod.Particles return; // Spawn queued particles. - foreach (var keyValuePair in particlesToSpawnNextFrame) + foreach (var collectionsByDrawLayer in particlesToSpawnNextFrame) { - while (keyValuePair.Value.Count > 0) - SpawnParticle(keyValuePair.Value.Dequeue(), keyValuePair.Key); + while (collectionsByDrawLayer.Value.Count > 0) + SpawnParticle(collectionsByDrawLayer.Value.Dequeue(), false, collectionsByDrawLayer.Key); + } + + foreach (var collectionsByDrawLayer in particlesToSpawnNextFrame_Pixelated) + { + while (collectionsByDrawLayer.Value.Count > 0) + SpawnParticle(collectionsByDrawLayer.Value.Dequeue(), true, collectionsByDrawLayer.Key); } // Update all particle instances in the world. diff --git a/Particles/Particle.cs b/Particles/Particle.cs index 3174ba2aba..ddc3f94bcf 100644 --- a/Particles/Particle.cs +++ b/Particles/Particle.cs @@ -7,18 +7,96 @@ namespace CalamityMod.Particles public class Particle { /// - /// The ID of the particle inside of the general particle handler's array. This is set automatically when the particle is created - /// - public int ID; - /// - /// The ID of the particle type as registered by the general particle handler. This is set automatically when the particle handler loads + /// The ID of the particle type as registered by when the mod loads. + ///
This field is set automatically when a particle instance is spawned in the world. This should NOT be set outside of that context.
///
public int Type; + /// /// The amount of frames this particle has existed for. You shouldn't have to touch this manually. /// public int Time; + /// + /// The maximum amount of frames a particle may stay alive if Particle.SetLifeTime is set to true + /// + public int Lifetime = 0; + + /// + /// The offset of the particle in relation to the origin of the set it belongs to. This is only used in the context of a . + /// + public Vector2 RelativeOffset; + + /// + /// The inworld position of a particle. Keep in mind this isn't used in the context of a , since all the particles work off their relative position to the set's origin + /// + public Vector2 Position; + + /// + /// The velocity of the particle. + /// + public Vector2 Velocity; + + /// + /// The point from which this particle's texture should be drawn from. + /// + public Vector2 Origin; + + /// + /// The color of the particle. + /// + public Color Color; + + /// + /// The current rotation of the particle in radians. + /// + public float Rotation; + + /// + /// The scale of the particle. + /// + public float Scale; + + /// + /// The current Y-frame of this particle's spritesheet. + /// + public int Variant = 0; + + /// + /// Whether your particle is affected by light levels. + /// + public bool AffectedByLight = false; + + /// + /// Whether or not your particle should be drawn with a pixelated effect to match Terraria's pixel size. + ///
Defaults to false.
+ ///
+ public bool Pixelate = false; + + /// + /// The "layer" or point at which you'd like your particle to draw in Terraria's internal draw order. + ///
Defaults to .
+ ///
+ public GeneralDrawLayer DrawLayer = GeneralDrawLayer.AfterEverything; + + /// + /// The path to this particle's autoloaded texture. + /// + /// + /// Can be accessed via . + /// + public virtual string Texture => ""; + + /// + /// The maximum amount of frames this particle's spritesheet has vertically. + /// + public virtual int FrameVariants => 1; + + /// + /// An 0-1 interpolant representing how close this particle is from its . + /// + public float LifetimeCompletion => Lifetime != 0 ? Time / (float)Lifetime : 0; + /// /// Set this to true if you NEED the particle to render even if the particle cap is reached. /// @@ -28,49 +106,16 @@ namespace CalamityMod.Particles /// Set this to true if you want your particle to automatically get removed when its time reaches its maximum lifetime ///
public virtual bool SetLifetime => false; - /// - /// The maximum amount of frames a particle may stay alive if Particle.SetLifeTime is set to true - /// - public int Lifetime = 0; - - public float LifetimeCompletion => Lifetime != 0 ? Time / (float)Lifetime : 0; /// - /// The offset of the particle in relation to the origin of the set it belongs to. This is only used in the context of a Particle Set + /// Set this to true to make your particle use additive blending instead of alphablend. /// - public Vector2 RelativeOffset; - /// - /// The inworld position of a particle. Keep in mind this isn't used in the context of a Particle Set, since all the particles work off their relative position to the set's origin - /// - public Vector2 Position; - public Vector2 Velocity; - - public Vector2 Origin; - public Color Color; - public float Rotation; - public float Scale; + public virtual bool UseAdditiveBlend => false; /// - /// Whether your particle is affected by light levels. + /// Set this to true to make your particles work with semi transparent pixels. Is overriden if UseAdditiveBlend is set to true. /// - public bool AffectedByLight = false; - - /// - /// The "layer" or point at which you'd like your particle to draw in Terraria's internal draw order. - ///
Defaults to .
- ///
- public GeneralDrawLayer DrawLayer = GeneralDrawLayer.AfterEverything; - - public virtual int FrameVariants => 1; - public int Variant = 0; - - public virtual string Texture => ""; - - /// - /// Whether or not your particle should be drawn with a pixelated effect to match Terraria's pixel size. - ///
Defaults to false.
- ///
- public virtual bool Pixelate => false; + public virtual bool UseHalfTransparency => false; /// /// Set this to true to disable default particle drawing, thus calling Particle.CustomDraw() instead. @@ -84,28 +129,22 @@ namespace CalamityMod.Particles public virtual bool OverrideAutomaticDrawing => false; /// - /// Use this method if you want to handle the particle drawing yourself. Only called if Particle.UseCustomDraw is set to true. + /// Use this method if you want to handle the particle drawing yourself. Only called if is set to true. /// public virtual void CustomDraw(SpriteBatch spriteBatch) { } - public virtual void CustomDraw(SpriteBatch spriteBatch, Vector2 basePosition) { } /// - /// Called for every update of the particle handler. + /// Use this method if you want to handle particle drawing yourself in the context of a . + /// + /// The base position of the particle set. + public virtual void CustomDraw(SpriteBatch spriteBatch, Vector2 basePosition) { } + + /// + /// Called every frame in . /// The particle's velocity gets automatically added to its position, and its time automatically increases. /// public virtual void Update() { } - /// - /// Set this to true to make your particle use additive blending instead of alphablend. - /// - public virtual bool UseAdditiveBlend => false; - - /// - /// Set this to true to make your particles work with semi transparent pixels. Is overriden if UseAdditiveBlend is set to true. - /// - public virtual bool UseHalfTransparency => false; - - /// /// Removes the particle from the handler /// From 4b962167cf46b47ef6d7b4a89d9ee2e1e0de96dd Mon Sep 17 00:00:00 2001 From: fryzahh Date: Sun, 9 Nov 2025 16:36:38 -0400 Subject: [PATCH 04/48] Pixelated dust variants * Added the following pixelated variants for their respective ModDust types: * DiamondDustPixelated * SquareDustPixelated * SquashDustPixelated * SquashDustHollowPixelated * SquashDustTileTouchPixelated * UnstableDustPixelated * VoidDustPixelated * VoidDustInvertedPixelated * Added missing documentation comment for the new "pixelate" parameter in GeneralParticleHandler.SpawnParticle. --- Dusts/DiamondDust.cs | 52 ++++++++++++++--- Dusts/LightDust.cs | 21 +++---- Dusts/SquareDust.cs | 47 ++++++++++++--- Dusts/SquashDust.cs | 55 +++++++++++++++--- Dusts/SquashDustHollow.cs | 51 ++++++++++++++--- Dusts/SquashDustTileTouch.cs | 32 +++++++---- Dusts/UnstableDust.cs | 47 ++++++++++++--- Dusts/VoidDust.cs | 49 ++++++++++++++-- Dusts/VoidDustInverted.cs | 57 +++++++++++++++---- Particles/GeneralParticleHandler.cs | 7 +-- .../PixelationSystem/PixelationManager.cs | 4 +- 11 files changed, 336 insertions(+), 86 deletions(-) diff --git a/Dusts/DiamondDust.cs b/Dusts/DiamondDust.cs index 501f5b7643..3b34857b02 100644 --- a/Dusts/DiamondDust.cs +++ b/Dusts/DiamondDust.cs @@ -1,5 +1,7 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Systems.Graphic.PixelationSystem; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ModLoader; @@ -7,7 +9,16 @@ namespace CalamityMod.Dusts { public class DiamondDust : ModDust { + public static Asset GlowDiamond { get; private set; } + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void Load() + { + if (!Main.dedServ) + GlowDiamond = ModContent.Request("CalamityMod/Particles/SquareRotated"); + } + public override void OnSpawn(Dust dust) { dust.scale *= Main.rand.NextFloat(0.8f, 1f); @@ -38,26 +49,51 @@ namespace CalamityMod.Dusts return false; } + public override bool PreDraw(Dust dust) { - Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f); - - Texture2D bloom = ModContent.Request("CalamityMod/Particles/SquareRotated").Value; - // dust.fadeIn is used to determine how intense the squash is, 1 is no squash, 0 is normal squash float squashLerp = Utils.GetLerpValue(10, 25, dust.fadeIn, true); Vector2 squash = new Vector2(MathHelper.Lerp(1, 0.3f, squashLerp), MathHelper.Lerp(1, 7f, squashLerp)); // Glow Orb - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(GlowDiamond.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowDiamond.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(GlowDiamond.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowDiamond.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0); if (!dust.noLight) { for (int i = 0; i < 2; i++) - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha) * (i == 0 ? 1f : 0.7f), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.08f * (i == 0 ? 0.7f : 1), SpriteEffects.None, 0); + Main.spriteBatch.Draw(GlowDiamond.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha) * (i == 0 ? 1f : 0.7f), dust.rotation, GlowDiamond.Size() * 0.5f, squash * dust.scale * 0.08f * (i == 0 ? 0.7f : 1), SpriteEffects.None, 0); } return false; } } + + public class DiamondDustPixelated : DiamondDust + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override bool PreDraw(Dust dust) + { + PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), Enums.GeneralDrawLayer.AfterDusts); + return false; + } + + public static void DrawPixelated(Dust dust) + { + // dust.fadeIn is used to determine how intense the squash is, 1 is no squash, 0 is normal squash + float squashLerp = Utils.GetLerpValue(10, 25, dust.fadeIn, true); + Vector2 squash = new Vector2(MathHelper.Lerp(1, 0.3f, squashLerp), MathHelper.Lerp(1, 7f, squashLerp)); + + // Glow Orb + Main.spriteBatch.Draw(GlowDiamond.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowDiamond.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); + if (dust.alpha < 1) + Main.spriteBatch.Draw(GlowDiamond.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowDiamond.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0); + if (!dust.noLight) + { + for (int i = 0; i < 2; i++) + Main.spriteBatch.Draw(GlowDiamond.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha) * (i == 0 ? 1f : 0.7f), dust.rotation, GlowDiamond.Size() * 0.5f, squash * dust.scale * 0.08f * (i == 0 ? 0.7f : 1), SpriteEffects.None, 0); + } + } + } } diff --git a/Dusts/LightDust.cs b/Dusts/LightDust.cs index 3da334e73c..6e5338861a 100644 --- a/Dusts/LightDust.cs +++ b/Dusts/LightDust.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Dusts { public class LightDust : ModDust { - public static Asset SolidCircle; + public static Asset SolidCircle { get; private set; } - public static Asset BloomCircle; + public static Asset BloomCircle { get; private set; } public override void Load() { @@ -47,15 +47,12 @@ namespace CalamityMod.Dusts public override bool PreDraw(Dust dust) { - Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f); - // Glow Orb - Main.EntitySpriteDraw(BloomCircle.Value, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.EntitySpriteDraw(BloomCircle.Value, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); if (!dust.noLight) - Main.EntitySpriteDraw(SolidCircle.Value, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); - + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); return false; } } @@ -72,14 +69,12 @@ namespace CalamityMod.Dusts private static void DrawPixelated(Dust dust) { - Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f); - // Glow Orb - Main.spriteBatch.Draw(BloomCircle.Value, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.spriteBatch.Draw(BloomCircle.Value, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); if (!dust.noLight) - Main.spriteBatch.Draw(SolidCircle.Value, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); } } } diff --git a/Dusts/SquareDust.cs b/Dusts/SquareDust.cs index 054b05ad37..7c25502b6a 100644 --- a/Dusts/SquareDust.cs +++ b/Dusts/SquareDust.cs @@ -1,6 +1,8 @@ using System; +using CalamityMod.Systems.Graphic.PixelationSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ModLoader; @@ -8,7 +10,16 @@ namespace CalamityMod.Dusts { public class SquareDust : ModDust { + public static Asset GlowSquare { get; private set; } + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void Load() + { + if (!Main.dedServ) + GlowSquare = ModContent.Request("CalamityMod/Particles/GlowSquareParticleThick"); + } + public override void OnSpawn(Dust dust) { dust.scale *= Main.rand.NextFloat(0.8f, 1f); @@ -42,22 +53,44 @@ namespace CalamityMod.Dusts } public override bool PreDraw(Dust dust) { - Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f); - - Texture2D bloom = ModContent.Request("CalamityMod/Particles/GlowSquareParticleThick").Value; - Vector2 squash = Vector2.One; // Glow Orb - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(GlowSquare.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowSquare.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0f); if (dust.alpha < 1) - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.095f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(GlowSquare.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowSquare.Size() * 0.5f, squash * dust.scale * 0.095f, SpriteEffects.None, 0f); if (!dust.noLight) { for (int i = 0; i < 2; i++) - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(GlowSquare.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowSquare.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0f); } return false; } } + + public class SquareDustPixelated : SquareDust + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override bool PreDraw(Dust dust) + { + PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), Enums.GeneralDrawLayer.AfterDusts); + return false; + } + + private static void DrawPixelated(Dust dust) + { + Vector2 squash = Vector2.One; + + // Glow Orb + Main.spriteBatch.Draw(GlowSquare.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowSquare.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0f); + if (dust.alpha < 1) + Main.spriteBatch.Draw(GlowSquare.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowSquare.Size() * 0.5f, squash * dust.scale * 0.095f, SpriteEffects.None, 0f); + if (!dust.noLight) + { + for (int i = 0; i < 2; i++) + Main.spriteBatch.Draw(GlowSquare.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowSquare.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0f); + } + } + } } diff --git a/Dusts/SquashDust.cs b/Dusts/SquashDust.cs index 5894cedb1b..8adfb2beaa 100644 --- a/Dusts/SquashDust.cs +++ b/Dusts/SquashDust.cs @@ -1,5 +1,7 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Systems.Graphic.PixelationSystem; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ModLoader; @@ -7,7 +9,21 @@ namespace CalamityMod.Dusts { public class SquashDust : ModDust { + public static Asset SolidCircle { get; private set; } + + public static Asset BloomCircle { get; private set; } + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void Load() + { + if (Main.dedServ) + return; + + SolidCircle = ModContent.Request("CalamityMod/ExtraTextures/BasicCircle"); + BloomCircle = ModContent.Request("CalamityMod/Particles/BloomCircle"); + } + public override void OnSpawn(Dust dust) { dust.scale *= Main.rand.NextFloat(0.8f, 1f); @@ -37,24 +53,45 @@ namespace CalamityMod.Dusts return false; } + public override bool PreDraw(Dust dust) { - Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f); - Texture2D solidCenter = ModContent.Request("CalamityMod/ExtraTextures/BasicCircle").Value; - - Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; - Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f)); // Glow Orb - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0); if (!dust.noLight) { - Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0); } return false; } } + + public class SquashDustPixelated : SquashDust + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override bool PreDraw(Dust dust) + { + PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), Enums.GeneralDrawLayer.AfterDusts); + return false; + } + + private static void DrawPixelated(Dust dust) + { + Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f)); + + // Glow Orb + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); + if (dust.alpha < 1) + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0); + if (!dust.noLight) + { + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0); + } + } + } } diff --git a/Dusts/SquashDustHollow.cs b/Dusts/SquashDustHollow.cs index 9378128784..ec82d5aa67 100644 --- a/Dusts/SquashDustHollow.cs +++ b/Dusts/SquashDustHollow.cs @@ -1,5 +1,7 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Systems.Graphic.PixelationSystem; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ModLoader; @@ -7,7 +9,16 @@ namespace CalamityMod.Dusts { public class SquashDustHollow : ModDust { + public static Asset BloomRing { get; private set; } + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void Load() + { + if (!Main.dedServ) + BloomRing = ModContent.Request("CalamityMod/Particles/BloomRing"); + } + public override void OnSpawn(Dust dust) { dust.scale *= Main.rand.NextFloat(0.8f, 1f); @@ -36,25 +47,49 @@ namespace CalamityMod.Dusts return false; } + public override bool PreDraw(Dust dust) { - Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f); - - Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomRing").Value; - // dust.fadeIn is used to determine how intense the squash is, 1 is no squash, 0 is normal squash Vector2 squash = Vector2.Lerp(new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f)), Vector2.One, dust.fadeIn); // Glow Orb - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(BloomRing.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomRing.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(BloomRing.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomRing.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0); if (!dust.noLight) { for (int i = 0; i < 2; i++) - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(BloomRing.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomRing.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0); } return false; } } + + public class SquashDustHollowPixelated : SquashDustHollow + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override bool PreDraw(Dust dust) + { + PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), Enums.GeneralDrawLayer.AfterDusts); + return false; + } + + private static void DrawPixelated(Dust dust) + { + // dust.fadeIn is used to determine how intense the squash is, 1 is no squash, 0 is normal squash + Vector2 squash = Vector2.Lerp(new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f)), Vector2.One, dust.fadeIn); + + // Glow Orb + Main.EntitySpriteDraw(BloomRing.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomRing.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); + if (dust.alpha < 1) + Main.EntitySpriteDraw(BloomRing.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomRing.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0); + if (!dust.noLight) + { + for (int i = 0; i < 2; i++) + Main.EntitySpriteDraw(BloomRing.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomRing.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0); + } + } + } } diff --git a/Dusts/SquashDustTileTouch.cs b/Dusts/SquashDustTileTouch.cs index 0884d87cb4..8b994b462d 100644 --- a/Dusts/SquashDustTileTouch.cs +++ b/Dusts/SquashDustTileTouch.cs @@ -1,13 +1,15 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Systems.Graphic.PixelationSystem; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Dusts { - public class SquashDustTileTouch : ModDust + public class SquashDustTileTouch : SquashDust { public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void OnSpawn(Dust dust) { dust.scale *= Main.rand.NextFloat(0.8f, 1f); @@ -16,12 +18,14 @@ namespace CalamityMod.Dusts public override bool Update(Dust dust) { bool touchedTiles = false; - int size = (int)(2); + int size = 2; + if (Collision.SolidCollision(dust.position, size, size)) { touchedTiles = true; dust.velocity = Vector2.Zero; } + float fadeSpeed = (dust.fadeIn + 1); // For this dust, fadeIn is used to increase the power of gravity if it's active, otherwise it makes it's lifetime change dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2; dust.velocity *= 0.96f; @@ -45,24 +49,30 @@ namespace CalamityMod.Dusts return false; } + } + + public class SquashDustTileTouchPixelated : SquashDustTileTouch + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override bool PreDraw(Dust dust) { - Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f); - Texture2D solidCenter = ModContent.Request("CalamityMod/ExtraTextures/BasicCircle").Value; - - Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), Enums.GeneralDrawLayer.AfterDusts); + return false; + } + private static void DrawPixelated(Dust dust) + { Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f)); // Glow Orb - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0); if (!dust.noLight) { - Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0); } - return false; } } } diff --git a/Dusts/UnstableDust.cs b/Dusts/UnstableDust.cs index ee9cbf0fce..82f42fbfb5 100644 --- a/Dusts/UnstableDust.cs +++ b/Dusts/UnstableDust.cs @@ -1,6 +1,8 @@ using System; +using CalamityMod.Systems.Graphic.PixelationSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ModLoader; @@ -8,7 +10,16 @@ namespace CalamityMod.Dusts { public class UnstableDust : ModDust { + public static Asset GlowStar { get; private set; } + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void Load() + { + if (!Main.dedServ) + GlowStar = ModContent.Request("CalamityMod/Particles/FullStar"); + } + public override void OnSpawn(Dust dust) { dust.scale *= Main.rand.NextFloat(0.8f, 1f); @@ -41,23 +52,45 @@ namespace CalamityMod.Dusts return false; } + public override bool PreDraw(Dust dust) { - Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f); - - Texture2D bloom = ModContent.Request("CalamityMod/Particles/FullStar").Value; - Vector2 squash = new Vector2(0.4f, 1); float texScaling = 6; - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f * texScaling, SpriteEffects.None, 0); + Main.spriteBatch.Draw(GlowStar.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowStar.Size() * 0.5f, squash * dust.scale * 0.1f * texScaling, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.04f * texScaling, SpriteEffects.None, 0); + Main.spriteBatch.Draw(GlowStar.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowStar.Size() * 0.5f, squash * dust.scale * 0.04f * texScaling, SpriteEffects.None, 0); if (!dust.noLight) { - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.025f * texScaling, SpriteEffects.None, 0); + Main.spriteBatch.Draw(GlowStar.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowStar.Size() * 0.5f, squash * dust.scale * 0.025f * texScaling, SpriteEffects.None, 0); } return false; } } + + public class UnstableDustPixelated : UnstableDust + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override bool PreDraw(Dust dust) + { + PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), Enums.GeneralDrawLayer.AfterDusts); + return false; + } + + private static void DrawPixelated(Dust dust) + { + Vector2 squash = new Vector2(0.4f, 1); + float texScaling = 6; + + Main.spriteBatch.Draw(GlowStar.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowStar.Size() * 0.5f, squash * dust.scale * 0.1f * texScaling, SpriteEffects.None, 0); + if (dust.alpha < 1) + Main.spriteBatch.Draw(GlowStar.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowStar.Size() * 0.5f, squash * dust.scale * 0.04f * texScaling, SpriteEffects.None, 0); + if (!dust.noLight) + { + Main.spriteBatch.Draw(GlowStar.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowStar.Size() * 0.5f, squash * dust.scale * 0.025f * texScaling, SpriteEffects.None, 0); + } + } + } } diff --git a/Dusts/VoidDust.cs b/Dusts/VoidDust.cs index 793f7b826d..e66a8f3bf4 100644 --- a/Dusts/VoidDust.cs +++ b/Dusts/VoidDust.cs @@ -1,6 +1,9 @@ using System; +using CalamityMod.Enums; +using CalamityMod.Systems.Graphic.PixelationSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ModLoader; @@ -8,6 +11,19 @@ namespace CalamityMod.Dusts { public class VoidDust : ModDust { + public static Asset SolidCircle { get; private set; } + + public static Asset BloomCircle { get; private set; } + + public override void Load() + { + if (Main.dedServ) + return; + + SolidCircle = ModContent.Request("CalamityMod/ExtraTextures/BasicCircle"); + BloomCircle = ModContent.Request("CalamityMod/Particles/BloomCircle"); + } + public override void OnSpawn(Dust dust) { dust.scale *= Main.rand.NextFloat(0.8f, 1f); @@ -28,20 +44,41 @@ namespace CalamityMod.Dusts return true; } + public override bool PreDraw(Dust dust) { - Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f); - Texture2D solidCenter = ModContent.Request("CalamityMod/ExtraTextures/BasicCircle").Value; if (!dust.noLight) { - Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; // Glow Orb - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); } - Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); return false; } } + + public class VoidDustPixelated : VoidDust + { + public override string Texture => "CalamityMod/Dusts/VoidDust"; + + public override bool PreDraw(Dust dust) + { + PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), GeneralDrawLayer.AfterDusts); + return false; + } + + private static void DrawPixelated(Dust dust) + { + if (!dust.noLight) + { + // Glow Orb + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); + if (dust.alpha < 1) + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); + } + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); + } + } } diff --git a/Dusts/VoidDustInverted.cs b/Dusts/VoidDustInverted.cs index d5df7d199f..4c30aec8d8 100644 --- a/Dusts/VoidDustInverted.cs +++ b/Dusts/VoidDustInverted.cs @@ -1,6 +1,9 @@ using System; +using CalamityMod.Enums; +using CalamityMod.Systems.Graphic.PixelationSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ModLoader; @@ -8,6 +11,22 @@ namespace CalamityMod.Dusts { public class VoidDustInverted : ModDust { + public static Asset SolidCircle { get; private set; } + + public static Asset BloomCircle { get; private set; } + + public static Asset SmallBloomCircle { get; private set; } + + public override void Load() + { + if (Main.dedServ) + return; + + SolidCircle = ModContent.Request("CalamityMod/ExtraTextures/BasicCircle"); + BloomCircle = ModContent.Request("CalamityMod/Particles/BloomCircle"); + SmallBloomCircle = ModContent.Request("CalamityMod/Particles/SmallBloom"); + } + public override void OnSpawn(Dust dust) { dust.scale *= Main.rand.NextFloat(0.8f, 1f); @@ -28,23 +47,39 @@ namespace CalamityMod.Dusts return true; } + public override bool PreDraw(Dust dust) { - Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f); - - Texture2D solidCenter = ModContent.Request("CalamityMod/ExtraTextures/BasicCircle").Value; - Texture2D bloom2 = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; - - Texture2D bloom = ModContent.Request("CalamityMod/Particles/SmallBloom").Value; - - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Black * 0.4f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.068f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(SmallBloomCircle.Value, dust.position - Main.screenPosition, null, Color.Black * 0.4f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SmallBloomCircle.Size() * 0.5f, dust.scale * 0.068f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.057f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(SmallBloomCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SmallBloomCircle.Size() * 0.5f, dust.scale * 0.057f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(bloom2, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom2.Size() * 0.5f, dust.scale * 0.07f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.07f, SpriteEffects.None, 0); if (!dust.noLight) - Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.75f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.75f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); return false; } } + + public class VoidDustInvertedPixelated : VoidDustInverted + { + public override string Texture => "CalamityMod/Dusts/VoidDustInverted"; + + public override bool PreDraw(Dust dust) + { + PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), GeneralDrawLayer.AfterDusts); + return false; + } + + private static void DrawPixelated(Dust dust) + { + Main.spriteBatch.Draw(SmallBloomCircle.Value, dust.position - Main.screenPosition, null, Color.Black * 0.4f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SmallBloomCircle.Size() * 0.5f, dust.scale * 0.068f, SpriteEffects.None, 0); + if (dust.alpha < 1) + Main.spriteBatch.Draw(SmallBloomCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SmallBloomCircle.Size() * 0.5f, dust.scale * 0.057f, SpriteEffects.None, 0); + + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.07f, SpriteEffects.None, 0); + if (!dust.noLight) + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.75f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); + } + } } diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 873bf88ae8..bb495b64dc 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -57,15 +57,13 @@ namespace CalamityMod.Particles /// internal static Dictionary particleTexturesByIDs; - /// - /// All types defined across all mods, identified by the type of the particle the drawers target. - /// - internal static Dictionary particleAutoDrawingOverrides; + private static Dictionary particleAutoDrawingOverrides; private static List activeParticles; private static List particlesToKill; private static Dictionary> particlesToSpawnNextFrame; private static Dictionary> particlesToSpawnNextFrame_Pixelated; + private static Dictionary> particlesToDraw; private static Dictionary> particlesToDraw_Pixelated; #endregion @@ -166,6 +164,7 @@ namespace CalamityMod.Particles /// /// Spawns the particle instance provided into the world. If the particle limit is reached but the particle is marked as important, it will try to replace a non important particle. /// + /// Set to true to force the particle being spawned to be drawn pixelated. /// Only set this to a non-null value if you'd like to manually override the draw layer of the particle instance you are spawning. public static void SpawnParticle(Particle particle, bool pixelate = false, GeneralDrawLayer? manualDrawLayerOverride = null) { diff --git a/Systems/Graphic/PixelationSystem/PixelationManager.cs b/Systems/Graphic/PixelationSystem/PixelationManager.cs index c3d80ecc30..00628ffda8 100644 --- a/Systems/Graphic/PixelationSystem/PixelationManager.cs +++ b/Systems/Graphic/PixelationSystem/PixelationManager.cs @@ -213,7 +213,7 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem { blendStateTargetPair.Value.SwapTo(); - Main.spriteBatch.Begin(default, blendStateTargetPair.Key, SamplerState.LinearClamp, default, default, null, pixelationMatrix); + Main.spriteBatch.Begin(default, blendStateTargetPair.Key, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, pixelationMatrix); // Select only drawers who match this target's BlendState. var drawersByBlendState = drawerCollection.Where(d => d.DefaultBlendState == blendStateTargetPair.Key).ToList(); @@ -236,7 +236,7 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem foreach (var keyValuePair in targetCollection) { Main.spriteBatch.TryEnd(); - Main.spriteBatch.TryBegin(SpriteSortMode.Deferred, keyValuePair.Key, Main.DefaultSamplerState, default, default, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.TryBegin(default, keyValuePair.Key, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); float targetScale = 1f / PixelationResolution; Main.spriteBatch.Draw(keyValuePair.Value, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, targetScale, SpriteEffects.None, 0f); From 8b10aadab87227d598a7511884ca4650ca694def Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Wed, 12 Nov 2025 12:24:31 -0500 Subject: [PATCH 05/48] Odd Mushroom now copies particles --- Particles/GeneralParticleHandler.cs | 51 ++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index bb495b64dc..c50b6d413e 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Particles particleAutoDrawingOverrides.Add(particleType, drawer); else throw new Exception($"The Particle of name \"{drawer.TargetParticleTypeName}\" used in {drawer.GetType().Name} could not be found! " + - $"Please ensure the Paricle's internal name is spelt correctly and is prefixed by its home mod's internal name."); + $"Please ensure the Particle's internal name is spelt correctly and is prefixed by its home mod's internal name."); } } } @@ -372,18 +372,47 @@ namespace CalamityMod.Particles private static void DrawParticleInstance(Particle particle) { - if (particle.UseCustomDraw) + int drawIterations = Main.LocalPlayer.Calamity().trippy ? 4 : 1; + for (int i = 0; i < drawIterations; i++) { - particle.CustomDraw(Main.spriteBatch); - } - else - { - Color lightColor = particle.Color; - if (particle.AffectedByLight) - lightColor = particle.Color.MultiplyRGB(Lighting.GetColor((particle.Position / 16).ToPoint())); + // If you have shrooms, manually spoof the position of the particle for each clone location + Vector2 positionSpoof = particle.Position; + Vector2 positionDiff = positionSpoof - Main.LocalPlayer.Center; + switch (i) + { + case 0: + break; + case 1: + particle.Position = Main.LocalPlayer.Center - positionDiff; + break; + case 2: + particle.Position = Main.LocalPlayer.Center - Vector2.UnitY * positionDiff.Y + Vector2.UnitX * positionDiff.X; + break; + case 3: + particle.Position = Main.LocalPlayer.Center - Vector2.UnitX * positionDiff.X + Vector2.UnitY * positionDiff.Y; + break; + } - Rectangle frame = particleTexturesByIDs[particle.Type].Frame(1, particle.FrameVariants, 0, particle.Variant); - Main.spriteBatch.Draw(particleTexturesByIDs[particle.Type], particle.Position - Main.screenPosition, frame, lightColor, particle.Rotation, frame.Size() * 0.5f, particle.Scale, SpriteEffects.None, 0f); + if (Main.LocalPlayer.Calamity().trippy) + particle.Color = Main.DiscoColor; + + // The actual drawing step + if (particle.UseCustomDraw) + { + particle.CustomDraw(Main.spriteBatch); + } + else + { + Color lightColor = particle.Color; + if (particle.AffectedByLight) + lightColor = particle.Color.MultiplyRGB(Lighting.GetColor((particle.Position / 16).ToPoint())); + + Rectangle frame = particleTexturesByIDs[particle.Type].Frame(1, particle.FrameVariants, 0, particle.Variant); + Main.spriteBatch.Draw(particleTexturesByIDs[particle.Type], particle.Position - Main.screenPosition, frame, lightColor, particle.Rotation, frame.Size() * 0.5f, particle.Scale, SpriteEffects.None, 0f); + } + + // Since the switch case directly modifies the particle position, this resets it to the proper location + particle.Position = positionSpoof; } } From b33a70fd086f0df4bcbc9dee6f68d6bfe6e13cf9 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Sat, 15 Nov 2025 16:41:52 -0400 Subject: [PATCH 06/48] GeneralDrawLayer generalization + TempParticle start * Split up GeneralDrawLayer.BeforeTiles into BeforeAllTiles and BeforeSolidTiles. * Moved screen renderers, metaballs and pixelated primitive drawing to use GeneralDrawLayer and subsequentially removed their own draw layer enums. * Moved screen renderers, metaballs, particles, pixelated primitive drawing and pixelated drawers draw calls to MechanicalILChanges. * Added TempParticle and TempParticleManager, used for defining temporary particle handlers in any file for short-term, fully-modifiable particle effects * Removed ParticleAutoDrawingOverride and added a "CustomShader" property and "PrepareCustomShader" method to Particle.cs. These should be used in conjunction when wanting to apply shader effects to particles. If anything more precise is needed, use the new TempParticleManager class. --- Enums/GeneralDrawLayer.cs | 25 +-- Graphics/Metaballs/BigRipMetaball.cs | 3 +- Graphics/Metaballs/BloodBoilerMetaball.cs | 3 +- Graphics/Metaballs/BloodBoilerMetaball2.cs | 3 +- Graphics/Metaballs/BloodMetaball.cs | 3 +- Graphics/Metaballs/CalamitasMetaball.cs | 4 +- Graphics/Metaballs/CataclysmMetaball.cs | 4 +- Graphics/Metaballs/CatastropheMetaball.cs | 4 +- Graphics/Metaballs/DoGDistortionMetaball.cs | 3 +- Graphics/Metaballs/DragonsBreathMetaball.cs | 3 +- Graphics/Metaballs/DragonsBreathMetaball2.cs | 3 +- Graphics/Metaballs/GalaxyMetaball.cs | 3 +- Graphics/Metaballs/GruesomeMetaball.cs | 3 +- Graphics/Metaballs/Metaball.cs | 3 +- Graphics/Metaballs/MetaballDrawLayer.cs | 9 -- Graphics/Metaballs/MetaballManager.cs | 44 +---- Graphics/Metaballs/PaintMetaballs.cs | 3 +- Graphics/Metaballs/PhotoMetaball.cs | 4 +- Graphics/Metaballs/PhotoMetaball2.cs | 4 +- Graphics/Metaballs/PhotoMetaball3.cs | 4 +- Graphics/Metaballs/PhotoMetaball4.cs | 4 +- Graphics/Metaballs/RancorLavaMetaball.cs | 3 +- Graphics/Metaballs/ScalArenaMetaball.cs | 9 +- Graphics/Metaballs/SeekersMetaball.cs | 4 +- Graphics/Metaballs/SignusMetaball.cs | 4 +- Graphics/Metaballs/StarsmokeMetaball.cs | 5 +- Graphics/Metaballs/StreamGougeMetaball.cs | 4 +- Graphics/Metaballs/VoidGeneratorMetaball.cs | 3 +- .../Primitives/IPixelatedPrimitiveRenderer.cs | 7 +- .../Primitives/PixelationPrimitiveLayer.cs | 17 -- .../Primitives/PrimitivePixelationSystem.cs | 143 ++++++++++------ Graphics/Primitives/PrimitiveRenderer.cs | 2 +- Graphics/Renderers/BaseRenderer.cs | 3 +- .../DeerclopsShadowRenderer.cs | 5 +- .../DoGDeathAnimationRenderer.cs | 5 +- .../DyeableShadersRenderer.cs | 3 +- .../CalamityRenderers/HolyInfernoRenderer.cs | 5 +- .../MiracleBlightRenderer.cs | 3 +- Graphics/Renderers/RendererManager.cs | 115 ++----------- ILEditing/ILChangesLoading.cs | 9 ++ ILEditing/MechanicILChanges.cs | 80 +++++++++ Particles/GeneralParticleHandler.cs | 152 +++++------------- Particles/Particle.cs | 25 +-- Particles/ParticleAutoDrawingOverride.cs | 57 ------- Projectiles/Boss/DoGFire.cs | 4 +- Projectiles/Magic/SHPB.cs | 5 +- Projectiles/Magic/SHPL.cs | 5 +- Projectiles/Magic/SHPS.cs | 3 +- Projectiles/Magic/SylvestaffHoldout.cs | 7 +- .../Melee/Galaxia_PhoenixsPrideFirewall.cs | 3 +- Projectiles/Summon/LiliesOfEternityBullet.cs | 5 +- Projectiles/Summon/LiliesOfFinalityBullet.cs | 5 +- .../PixelationSystem/PixelationManager.cs | 113 ++++++------- .../TempParticleSystem/TempParticle.cs | 67 ++++++++ .../TempParticleSystem/TempParticleManager.cs | 152 ++++++++++++++++++ 55 files changed, 636 insertions(+), 535 deletions(-) delete mode 100644 Graphics/Metaballs/MetaballDrawLayer.cs delete mode 100644 Graphics/Primitives/PixelationPrimitiveLayer.cs delete mode 100644 Particles/ParticleAutoDrawingOverride.cs create mode 100644 Systems/Graphic/TempParticleSystem/TempParticle.cs create mode 100644 Systems/Graphic/TempParticleSystem/TempParticleManager.cs diff --git a/Enums/GeneralDrawLayer.cs b/Enums/GeneralDrawLayer.cs index 23aa7c20d0..319e734f49 100644 --- a/Enums/GeneralDrawLayer.cs +++ b/Enums/GeneralDrawLayer.cs @@ -1,20 +1,21 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace CalamityMod.Enums { + /// + /// A general collection of points in Terraria's overall draw order that graphical systems in the mod draw to. + /// + [Flags] public enum GeneralDrawLayer { - BeforeTiles, - BeforeNPCs, - AfterNPCs, - BeforeProjectiles, - AfterProjectiles, - AfterPlayers, - AfterDusts, - AfterEverything, + BeforeAllTiles = 0, + BeforeSolidTiles = 1, + BeforeNPCs = 2, + AfterNPCs = 4, + BeforeProjectiles = 8, + AfterProjectiles = 16, + AfterPlayers = 32, + AfterDusts = 64, + AfterEverything = 128, } } diff --git a/Graphics/Metaballs/BigRipMetaball.cs b/Graphics/Metaballs/BigRipMetaball.cs index c78acfa9c5..faee855da9 100644 --- a/Graphics/Metaballs/BigRipMetaball.cs +++ b/Graphics/Metaballs/BigRipMetaball.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -77,7 +78,7 @@ namespace CalamityMod.Graphics.Metaballs // Load the layer asset wrapper. LayerAsset = ModContent.Request($"CalamityMod/Graphics/Metaballs/BigRipLayer", AssetRequestMode.ImmediateLoad); } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles; public override Color EdgeColor => new Color(239, 111, 85) * 0.5f; diff --git a/Graphics/Metaballs/BloodBoilerMetaball.cs b/Graphics/Metaballs/BloodBoilerMetaball.cs index 86bf43c440..e3ea116062 100644 --- a/Graphics/Metaballs/BloodBoilerMetaball.cs +++ b/Graphics/Metaballs/BloodBoilerMetaball.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Effects; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -48,7 +49,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public override Color EdgeColor => Color.Red with { A = 0 }; diff --git a/Graphics/Metaballs/BloodBoilerMetaball2.cs b/Graphics/Metaballs/BloodBoilerMetaball2.cs index a6034d5219..6f3829158d 100644 --- a/Graphics/Metaballs/BloodBoilerMetaball2.cs +++ b/Graphics/Metaballs/BloodBoilerMetaball2.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Effects; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -48,7 +49,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public override Color EdgeColor => Color.Red with { A = 0 }; diff --git a/Graphics/Metaballs/BloodMetaball.cs b/Graphics/Metaballs/BloodMetaball.cs index 28457126f8..952950e6ce 100644 --- a/Graphics/Metaballs/BloodMetaball.cs +++ b/Graphics/Metaballs/BloodMetaball.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -79,7 +80,7 @@ namespace CalamityMod.Graphics.Metaballs // Load the layer asset wrapper. LayerAsset = ModContent.Request($"CalamityMod/Graphics/Metaballs/BloodLayer", AssetRequestMode.ImmediateLoad); } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles; public override Color EdgeColor => new Color(67, 17, 17); diff --git a/Graphics/Metaballs/CalamitasMetaball.cs b/Graphics/Metaballs/CalamitasMetaball.cs index 86bcd3fa23..52e9eeb066 100644 --- a/Graphics/Metaballs/CalamitasMetaball.cs +++ b/Graphics/Metaballs/CalamitasMetaball.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.ModLoader; -using static CalamityMod.Graphics.Metaballs.StreamGougeMetaball; namespace CalamityMod.Graphics.Metaballs { @@ -71,7 +71,7 @@ namespace CalamityMod.Graphics.Metaballs // Load the layer asset wrapper. LayerAsset = ModContent.Request($"CalamityMod/Graphics/Metaballs/CalamitasLayer", AssetRequestMode.ImmediateLoad); } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles; public override Color EdgeColor => Color.Lerp(Color.Crimson, Color.Black, 0f); diff --git a/Graphics/Metaballs/CataclysmMetaball.cs b/Graphics/Metaballs/CataclysmMetaball.cs index 62131a6df4..59221f3d51 100644 --- a/Graphics/Metaballs/CataclysmMetaball.cs +++ b/Graphics/Metaballs/CataclysmMetaball.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.ModLoader; -using static CalamityMod.Graphics.Metaballs.StreamGougeMetaball; namespace CalamityMod.Graphics.Metaballs { @@ -71,7 +71,7 @@ namespace CalamityMod.Graphics.Metaballs // Load the layer asset wrapper. LayerAsset = ModContent.Request($"CalamityMod/Graphics/Metaballs/CataclysmLayer", AssetRequestMode.ImmediateLoad); } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles; public override Color EdgeColor => new Color(255,0,229); diff --git a/Graphics/Metaballs/CatastropheMetaball.cs b/Graphics/Metaballs/CatastropheMetaball.cs index 24f54493a0..399af76ad4 100644 --- a/Graphics/Metaballs/CatastropheMetaball.cs +++ b/Graphics/Metaballs/CatastropheMetaball.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.ModLoader; -using static CalamityMod.Graphics.Metaballs.StreamGougeMetaball; namespace CalamityMod.Graphics.Metaballs { @@ -73,7 +73,7 @@ namespace CalamityMod.Graphics.Metaballs // Load the layer asset wrapper. LayerAsset = ModContent.Request($"CalamityMod/Graphics/Metaballs/CatastropheLayer", AssetRequestMode.ImmediateLoad); } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles; public override Color EdgeColor => new Color(0,255,255); diff --git a/Graphics/Metaballs/DoGDistortionMetaball.cs b/Graphics/Metaballs/DoGDistortionMetaball.cs index 173b2430ea..c2c8992591 100644 --- a/Graphics/Metaballs/DoGDistortionMetaball.cs +++ b/Graphics/Metaballs/DoGDistortionMetaball.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using CalamityMod.Effects; +using CalamityMod.Enums; using CalamityMod.Projectiles.Boss; using CalamityMod.Systems.Graphic; using Microsoft.Xna.Framework; @@ -33,7 +34,7 @@ namespace CalamityMod.Graphics.Metaballs public static List Particles { get; private set; } = []; - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public override bool AnythingToDraw => Particles.Count > 0 || CalamityUtils.AnyProjectiles(ModContent.ProjectileType()); diff --git a/Graphics/Metaballs/DragonsBreathMetaball.cs b/Graphics/Metaballs/DragonsBreathMetaball.cs index e041506bb2..0f39f10fe5 100644 --- a/Graphics/Metaballs/DragonsBreathMetaball.cs +++ b/Graphics/Metaballs/DragonsBreathMetaball.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Effects; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -68,7 +69,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public override void Update() { diff --git a/Graphics/Metaballs/DragonsBreathMetaball2.cs b/Graphics/Metaballs/DragonsBreathMetaball2.cs index c07f13e894..1af9bd38ca 100644 --- a/Graphics/Metaballs/DragonsBreathMetaball2.cs +++ b/Graphics/Metaballs/DragonsBreathMetaball2.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Effects; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -68,7 +69,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public override void Update() { diff --git a/Graphics/Metaballs/GalaxyMetaball.cs b/Graphics/Metaballs/GalaxyMetaball.cs index 4d93ed1020..feec8791a1 100644 --- a/Graphics/Metaballs/GalaxyMetaball.cs +++ b/Graphics/Metaballs/GalaxyMetaball.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -56,7 +57,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeNPCs; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeNPCs; public override Color EdgeColor => Color.Lerp(Color.DarkBlue, Color.Black, 0.75f); diff --git a/Graphics/Metaballs/GruesomeMetaball.cs b/Graphics/Metaballs/GruesomeMetaball.cs index 0c281d7e5f..348099bcd6 100644 --- a/Graphics/Metaballs/GruesomeMetaball.cs +++ b/Graphics/Metaballs/GruesomeMetaball.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -56,7 +57,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public override Color EdgeColor => new(61, 6, 2); diff --git a/Graphics/Metaballs/Metaball.cs b/Graphics/Metaballs/Metaball.cs index adff926565..f4d6f366bf 100644 --- a/Graphics/Metaballs/Metaball.cs +++ b/Graphics/Metaballs/Metaball.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Effects; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -33,7 +34,7 @@ namespace CalamityMod.Graphics.Metaballs /// /// The draw layer in which metaballs should be drawn. /// - public abstract MetaballDrawLayer DrawContext + public abstract GeneralDrawLayer DrawLayer { get; } diff --git a/Graphics/Metaballs/MetaballDrawLayer.cs b/Graphics/Metaballs/MetaballDrawLayer.cs deleted file mode 100644 index d061aabe61..0000000000 --- a/Graphics/Metaballs/MetaballDrawLayer.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace CalamityMod.Graphics.Metaballs -{ - public enum MetaballDrawLayer - { - BeforeNPCs, - BeforeProjectiles, - AfterProjectiles, - } -} diff --git a/Graphics/Metaballs/MetaballManager.cs b/Graphics/Metaballs/MetaballManager.cs index 2e7721341b..123e007766 100644 --- a/Graphics/Metaballs/MetaballManager.cs +++ b/Graphics/Metaballs/MetaballManager.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -15,8 +16,6 @@ namespace CalamityMod.Graphics.Metaballs { // Prepare event subscribers. RenderTargetManager.RenderTargetUpdateLoopEvent += PrepareMetaballTargets; - On_Main.DrawProjectiles += DrawMetaballsAfterProjectiles; - On_Main.DrawNPCs += DrawMetaballsBeforeNPCs; } public override void OnModUnload() @@ -86,51 +85,20 @@ namespace CalamityMod.Graphics.Metaballs Main.spriteBatch.End(); } - private void DrawMetaballsAfterProjectiles(On_Main.orig_DrawProjectiles orig, Main self) - { - if (AnyActiveMetaballsAtLayer(MetaballDrawLayer.BeforeProjectiles)) - { - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - DrawMetaballs(MetaballDrawLayer.BeforeProjectiles); - Main.spriteBatch.End(); - } - - orig(self); - - if (AnyActiveMetaballsAtLayer(MetaballDrawLayer.AfterProjectiles)) - { - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - DrawMetaballs(MetaballDrawLayer.AfterProjectiles); - Main.spriteBatch.End(); - } - } - - private void DrawMetaballsBeforeNPCs(On_Main.orig_DrawNPCs orig, Main self, bool behindTiles) - { - if (!behindTiles && AnyActiveMetaballsAtLayer(MetaballDrawLayer.BeforeNPCs)) - { - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - DrawMetaballs(MetaballDrawLayer.BeforeNPCs); - Main.spriteBatch.ExitShaderRegion(); - } - orig(self, behindTiles); - } - /// /// Checks if a metaball of a given layering type is currently in use. This is used to minimize needless restarts when there is nothing to draw. /// /// The metaball layer type to check against. - internal static bool AnyActiveMetaballsAtLayer(MetaballDrawLayer layerType) => - metaballs.Any(m => m.AnythingToDraw && m.DrawContext == layerType); + internal static bool AnyActiveMetaballsAtLayer(GeneralDrawLayer layerType) => + metaballs.Any(m => m.AnythingToDraw && m.DrawLayer == layerType); /// - /// Draws all metaballs of a given . Used for layer ordering reasons. + /// Draws all metaballs of a given . Used for layer ordering reasons. /// /// The layer type to draw with. - public static void DrawMetaballs(MetaballDrawLayer layerType) + internal static void DrawMetaballs(GeneralDrawLayer layerType) { - foreach (Metaball metaball in metaballs.Where(m => m.DrawContext == layerType && m.AnythingToDraw)) + foreach (Metaball metaball in metaballs.Where(m => m.DrawLayer == layerType && m.AnythingToDraw)) { for (int i = 0; i < metaball.LayerTargets.Count; i++) { diff --git a/Graphics/Metaballs/PaintMetaballs.cs b/Graphics/Metaballs/PaintMetaballs.cs index 0501af90ff..8242812c96 100644 --- a/Graphics/Metaballs/PaintMetaballs.cs +++ b/Graphics/Metaballs/PaintMetaballs.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Effects; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -64,7 +65,7 @@ namespace CalamityMod.Graphics.Metaballs public override bool AnythingToDraw => Particles.Any(); - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public override IEnumerable Layers { diff --git a/Graphics/Metaballs/PhotoMetaball.cs b/Graphics/Metaballs/PhotoMetaball.cs index 6d3447dd90..e8d6a3bdca 100644 --- a/Graphics/Metaballs/PhotoMetaball.cs +++ b/Graphics/Metaballs/PhotoMetaball.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Effects; -using CalamityMod.Rarities; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -54,7 +54,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public Color sparkColor; public int Time = 0; diff --git a/Graphics/Metaballs/PhotoMetaball2.cs b/Graphics/Metaballs/PhotoMetaball2.cs index f1cdc7737f..0178d70457 100644 --- a/Graphics/Metaballs/PhotoMetaball2.cs +++ b/Graphics/Metaballs/PhotoMetaball2.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Effects; -using CalamityMod.Rarities; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -54,7 +54,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public Color sparkColor; public int Time; diff --git a/Graphics/Metaballs/PhotoMetaball3.cs b/Graphics/Metaballs/PhotoMetaball3.cs index cfb21ea60d..71c5d56f7a 100644 --- a/Graphics/Metaballs/PhotoMetaball3.cs +++ b/Graphics/Metaballs/PhotoMetaball3.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Effects; -using CalamityMod.Rarities; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -47,7 +47,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public Color sparkColor; public int Time = 0; diff --git a/Graphics/Metaballs/PhotoMetaball4.cs b/Graphics/Metaballs/PhotoMetaball4.cs index 2df1a25d8b..ad720df0c6 100644 --- a/Graphics/Metaballs/PhotoMetaball4.cs +++ b/Graphics/Metaballs/PhotoMetaball4.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Effects; -using CalamityMod.Rarities; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -47,7 +47,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public Color sparkColor; public int Time; diff --git a/Graphics/Metaballs/RancorLavaMetaball.cs b/Graphics/Metaballs/RancorLavaMetaball.cs index ef0d3c6124..33047c5d9e 100644 --- a/Graphics/Metaballs/RancorLavaMetaball.cs +++ b/Graphics/Metaballs/RancorLavaMetaball.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Effects; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -44,7 +45,7 @@ namespace CalamityMod.Graphics.Metaballs public override bool AnythingToDraw => Particles.Any(); - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public override IEnumerable Layers { diff --git a/Graphics/Metaballs/ScalArenaMetaball.cs b/Graphics/Metaballs/ScalArenaMetaball.cs index a57d474009..c7a1039e74 100644 --- a/Graphics/Metaballs/ScalArenaMetaball.cs +++ b/Graphics/Metaballs/ScalArenaMetaball.cs @@ -1,18 +1,13 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; -using CalamityMod.NPCs; +using CalamityMod.Enums; using CalamityMod.NPCs.SupremeCalamitas; -using CalamityMod.Systems.Mechanic; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.ModLoader; -using static CalamityMod.Graphics.Metaballs.StreamGougeMetaball; -using static CalamityMod.Systems.LavaRenderingSystem; namespace CalamityMod.Graphics.Metaballs { @@ -82,7 +77,7 @@ namespace CalamityMod.Graphics.Metaballs WavyLineLayer = ModContent.Request($"CalamityMod/Graphics/Metaballs/ScalArenaLayerWave", AssetRequestMode.ImmediateLoad).Value; } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeNPCs; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeNPCs; public override Color EdgeColor => SupremeCalamitas.CurrentColor; diff --git a/Graphics/Metaballs/SeekersMetaball.cs b/Graphics/Metaballs/SeekersMetaball.cs index d389e569e5..a0658bb66d 100644 --- a/Graphics/Metaballs/SeekersMetaball.cs +++ b/Graphics/Metaballs/SeekersMetaball.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.ModLoader; -using static CalamityMod.Graphics.Metaballs.StreamGougeMetaball; namespace CalamityMod.Graphics.Metaballs { @@ -73,7 +73,7 @@ namespace CalamityMod.Graphics.Metaballs // Load the layer asset wrapper. LayerAsset = ModContent.Request($"CalamityMod/Graphics/Metaballs/SeekersLayer", AssetRequestMode.ImmediateLoad); } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles; public override Color EdgeColor => new Color(255,106,0); diff --git a/Graphics/Metaballs/SignusMetaball.cs b/Graphics/Metaballs/SignusMetaball.cs index 7c90c5fda0..c0179a8ebc 100644 --- a/Graphics/Metaballs/SignusMetaball.cs +++ b/Graphics/Metaballs/SignusMetaball.cs @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Graphics.Metaballs @@ -77,7 +77,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeNPCs; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeNPCs; public override void Load() { if (Main.dedServ) diff --git a/Graphics/Metaballs/StarsmokeMetaball.cs b/Graphics/Metaballs/StarsmokeMetaball.cs index e5f2565257..3bdfa5e22d 100644 --- a/Graphics/Metaballs/StarsmokeMetaball.cs +++ b/Graphics/Metaballs/StarsmokeMetaball.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using CalamityMod.Particles; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Graphics.Metaballs @@ -80,7 +79,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeNPCs; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeNPCs; public override void Load() { if (Main.dedServ) diff --git a/Graphics/Metaballs/StreamGougeMetaball.cs b/Graphics/Metaballs/StreamGougeMetaball.cs index 0f31626192..d13ebc9af9 100644 --- a/Graphics/Metaballs/StreamGougeMetaball.cs +++ b/Graphics/Metaballs/StreamGougeMetaball.cs @@ -1,10 +1,10 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Graphics.Metaballs @@ -56,7 +56,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles; public override Color EdgeColor => Color.Lerp(Color.DarkBlue, Color.Black, 0.75f); diff --git a/Graphics/Metaballs/VoidGeneratorMetaball.cs b/Graphics/Metaballs/VoidGeneratorMetaball.cs index 69029411f3..a21754f651 100644 --- a/Graphics/Metaballs/VoidGeneratorMetaball.cs +++ b/Graphics/Metaballs/VoidGeneratorMetaball.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -26,7 +27,7 @@ namespace CalamityMod.Graphics.Metaballs } } - public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles; + public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles; public override Color EdgeColor => Color.Lerp(Color.Purple, Color.Black, 0.75f); diff --git a/Graphics/Primitives/IPixelatedPrimitiveRenderer.cs b/Graphics/Primitives/IPixelatedPrimitiveRenderer.cs index 14edbcb506..f40c983f56 100644 --- a/Graphics/Primitives/IPixelatedPrimitiveRenderer.cs +++ b/Graphics/Primitives/IPixelatedPrimitiveRenderer.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework.Graphics; +using CalamityMod.Enums; +using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Graphics.Primitives { @@ -10,11 +11,11 @@ namespace CalamityMod.Graphics.Primitives /// /// The layer to render the primitive(s) to. /// - PixelationPrimitiveLayer LayerToRenderTo => PixelationPrimitiveLayer.BeforeProjectiles; + GeneralDrawLayer LayerToRenderTo => GeneralDrawLayer.BeforeProjectiles; /// /// Render primitives that use pixelation here. /// - void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer); + void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer); } } diff --git a/Graphics/Primitives/PixelationPrimitiveLayer.cs b/Graphics/Primitives/PixelationPrimitiveLayer.cs deleted file mode 100644 index 4f05c51ef2..0000000000 --- a/Graphics/Primitives/PixelationPrimitiveLayer.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace CalamityMod.Graphics.Primitives -{ - /// - /// Controls what layer the renders to. - /// - [Flags] - public enum PixelationPrimitiveLayer - { - BeforeNPCs = 1, - AfterNPCs = 2, - BeforeProjectiles = 4, - AfterProjectiles = 8, - AfterPlayers = 16 - } -} diff --git a/Graphics/Primitives/PrimitivePixelationSystem.cs b/Graphics/Primitives/PrimitivePixelationSystem.cs index 4d2bc635de..36a0e186b8 100644 --- a/Graphics/Primitives/PrimitivePixelationSystem.cs +++ b/Graphics/Primitives/PrimitivePixelationSystem.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Graphics.Primitives public class PrimitivePixelationSystem : ModSystem { #region Fields/Properties + private static ManagedRenderTarget PixelationTarget_BeforeAllTiles; + + private static ManagedRenderTarget PixelationTarget_BeforeSolidTiles; + private static ManagedRenderTarget PixelationTarget_BeforeNPCs; private static ManagedRenderTarget PixelationTarget_AfterNPCs; @@ -20,6 +25,10 @@ namespace CalamityMod.Graphics.Primitives private static ManagedRenderTarget PixelationTarget_AfterPlayers; + private static ManagedRenderTarget PixelationTarget_AfterDusts; + + private static ManagedRenderTarget PixelationTarget_AfterEverything; + private static RenderTarget2D CreatePixelTarget(int width, int height) => new(Main.instance.GraphicsDevice, width / 2, height / 2); /// @@ -35,22 +44,38 @@ namespace CalamityMod.Graphics.Primitives #region Loading public override void Load() { - On_Main.CheckMonoliths += DrawToTargets; - On_Main.DoDraw_DrawNPCsOverTiles += DrawTarget_NPCs; - On_Main.DrawProjectiles += DrawTarget_Projectiles; - On_Main.DrawPlayers_AfterProjectiles += DrawTarget_Players; + if (Main.dedServ) + return; - PixelationTarget_BeforeNPCs = new(true, CreatePixelTarget); - PixelationTarget_AfterNPCs = new(true, CreatePixelTarget); - PixelationTarget_BeforeProjectiles = new(true, CreatePixelTarget); - PixelationTarget_AfterProjectiles = new(true, CreatePixelTarget); - PixelationTarget_AfterPlayers = new(true, CreatePixelTarget); + Main.QueueMainThreadAction(() => + { + PixelationTarget_BeforeAllTiles = new(true, CreatePixelTarget); + PixelationTarget_BeforeSolidTiles = new(true, CreatePixelTarget); + PixelationTarget_BeforeNPCs = new(true, CreatePixelTarget); + PixelationTarget_AfterNPCs = new(true, CreatePixelTarget); + PixelationTarget_BeforeProjectiles = new(true, CreatePixelTarget); + PixelationTarget_AfterProjectiles = new(true, CreatePixelTarget); + PixelationTarget_AfterPlayers = new(true, CreatePixelTarget); + PixelationTarget_AfterDusts = new(true, CreatePixelTarget); + PixelationTarget_AfterEverything = new(true, CreatePixelTarget); + }); + + On_Main.CheckMonoliths += DrawToTargets; + //On_Main.DrawBackgroundBlackFill += DrawTarget_BeforeAllTiles; + //On_Main.DoDraw_Tiles_Solid += DrawTarget_BeforeSolidTiles; + //On_Main.DoDraw_DrawNPCsOverTiles += DrawTarget_NPCs; + //On_Main.DrawProjectiles += DrawTarget_Projectiles; + //On_Main.DrawPlayers_AfterProjectiles += DrawTarget_Players; + //On_Main.DrawDust += DrawTarget_AfterDusts; + //On_Main.DrawInfernoRings += DrawTarget_AfterEverything; } public override void Unload() { + if (Main.dedServ) + return; + On_Main.CheckMonoliths -= DrawToTargets; - On_Main.DoDraw_DrawNPCsOverTiles -= DrawTarget_NPCs; } #endregion @@ -63,11 +88,15 @@ namespace CalamityMod.Graphics.Primitives return; } + var beforeAllTiles = new List(); + var beforeSolidTiles = new List(); var beforeNPCs = new List(); var afterNPCs = new List(); var beforeProjectiles = new List(); var afterProjectiles = new List(); var afterPlayers = new List(); + var afterDusts = new List(); + var afterEverything = new List(); // Check every active projectile. foreach (Projectile projectile in Main.ActiveProjectiles) @@ -75,14 +104,24 @@ namespace CalamityMod.Graphics.Primitives // If the projectile is active, a mod projectile, and uses the interface, add it to the list of primitives to draw this frame. if (projectile.ModProjectile != null && projectile.ModProjectile is IPixelatedPrimitiveRenderer pixelPrimitiveProjectile) { - if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.BeforeNPCs)) + if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeAllTiles)) + beforeAllTiles.Add(pixelPrimitiveProjectile); + if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeSolidTiles)) + beforeSolidTiles.Add(pixelPrimitiveProjectile); + if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeNPCs)) beforeNPCs.Add(pixelPrimitiveProjectile); - if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.AfterNPCs)) + if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterNPCs)) afterNPCs.Add(pixelPrimitiveProjectile); - if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.BeforeProjectiles)) + if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeProjectiles)) beforeProjectiles.Add(pixelPrimitiveProjectile); - if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.AfterPlayers)) + if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterProjectiles)) + afterProjectiles.Add(pixelPrimitiveProjectile); + if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterPlayers)) afterPlayers.Add(pixelPrimitiveProjectile); + if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterDusts)) + afterDusts.Add(pixelPrimitiveProjectile); + if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterEverything)) + afterEverything.Add(pixelPrimitiveProjectile); } } @@ -92,24 +131,38 @@ namespace CalamityMod.Graphics.Primitives // If the NPC is active, a mod NPC, and uses the interface, add it to the list of primitives to draw this frame. if (npc.ModNPC != null && npc.ModNPC is IPixelatedPrimitiveRenderer pixelPrimitiveNPC) { - if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.BeforeNPCs)) + if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeAllTiles)) + beforeAllTiles.Add(pixelPrimitiveNPC); + if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeSolidTiles)) + beforeSolidTiles.Add(pixelPrimitiveNPC); + if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeNPCs)) beforeNPCs.Add(pixelPrimitiveNPC); - if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.AfterNPCs)) + if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterNPCs)) afterNPCs.Add(pixelPrimitiveNPC); - if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.BeforeProjectiles)) + if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeProjectiles)) beforeProjectiles.Add(pixelPrimitiveNPC); - if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.AfterPlayers)) + if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterProjectiles)) + afterProjectiles.Add(pixelPrimitiveNPC); + if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterPlayers)) afterPlayers.Add(pixelPrimitiveNPC); + if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterDusts)) + afterDusts.Add(pixelPrimitiveNPC); + if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterEverything)) + afterEverything.Add(pixelPrimitiveNPC); } } CurrentlyRendering = true; - DrawPrimsToRenderTarget(PixelationTarget_BeforeNPCs, PixelationPrimitiveLayer.BeforeNPCs, beforeNPCs); - DrawPrimsToRenderTarget(PixelationTarget_AfterNPCs, PixelationPrimitiveLayer.AfterNPCs, afterNPCs); - DrawPrimsToRenderTarget(PixelationTarget_BeforeProjectiles, PixelationPrimitiveLayer.BeforeProjectiles, beforeProjectiles); - DrawPrimsToRenderTarget(PixelationTarget_AfterProjectiles, PixelationPrimitiveLayer.AfterProjectiles, afterProjectiles); - DrawPrimsToRenderTarget(PixelationTarget_AfterPlayers, PixelationPrimitiveLayer.AfterPlayers, afterPlayers); + DrawPrimsToRenderTarget(PixelationTarget_BeforeAllTiles, GeneralDrawLayer.BeforeAllTiles, beforeAllTiles); + DrawPrimsToRenderTarget(PixelationTarget_BeforeSolidTiles, GeneralDrawLayer.BeforeSolidTiles, beforeSolidTiles); + DrawPrimsToRenderTarget(PixelationTarget_BeforeNPCs, GeneralDrawLayer.BeforeNPCs, beforeNPCs); + DrawPrimsToRenderTarget(PixelationTarget_AfterNPCs, GeneralDrawLayer.AfterNPCs, afterNPCs); + DrawPrimsToRenderTarget(PixelationTarget_BeforeProjectiles, GeneralDrawLayer.BeforeProjectiles, beforeProjectiles); + DrawPrimsToRenderTarget(PixelationTarget_AfterProjectiles, GeneralDrawLayer.AfterProjectiles, afterProjectiles); + DrawPrimsToRenderTarget(PixelationTarget_AfterPlayers, GeneralDrawLayer.AfterPlayers, afterPlayers); + DrawPrimsToRenderTarget(PixelationTarget_AfterDusts, GeneralDrawLayer.AfterDusts, afterDusts); + DrawPrimsToRenderTarget(PixelationTarget_AfterEverything, GeneralDrawLayer.AfterEverything, afterEverything); Main.instance.GraphicsDevice.SetRenderTarget(null); @@ -117,7 +170,7 @@ namespace CalamityMod.Graphics.Primitives orig(); } - private static void DrawPrimsToRenderTarget(RenderTarget2D renderTarget, PixelationPrimitiveLayer layer, List pixelPrimitives) + private static void DrawPrimsToRenderTarget(RenderTarget2D renderTarget, GeneralDrawLayer layer, List pixelPrimitives) { // Swap to the target regardless, in order to clear any leftover content from last frame. Not doing this results in the final frame lingering once it stops rendering. renderTarget.SwapTo(); @@ -135,31 +188,31 @@ namespace CalamityMod.Graphics.Primitives #endregion #region Target Drawing - private void DrawTarget_NPCs(On_Main.orig_DoDraw_DrawNPCsOverTiles orig, Main self) + internal static void DrawTargetScaled(GeneralDrawLayer drawLayer, bool startSpritebatch = true) { - DrawTargetScaled(PixelationTarget_BeforeNPCs); - orig(self); - DrawTargetScaled(PixelationTarget_AfterNPCs); + if (startSpritebatch) + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + + Main.spriteBatch.Draw(ReturnAssociatedRenderTarget(drawLayer), Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + + if (startSpritebatch) + Main.spriteBatch.End(); } - private void DrawTarget_Projectiles(On_Main.orig_DrawProjectiles orig, Main self) + private static RenderTarget2D ReturnAssociatedRenderTarget(GeneralDrawLayer drawLayer) { - DrawTargetScaled(PixelationTarget_BeforeProjectiles); - orig(self); - DrawTargetScaled(PixelationTarget_AfterProjectiles); - } - - private void DrawTarget_Players(On_Main.orig_DrawPlayers_AfterProjectiles orig, Main self) - { - orig(self); - DrawTargetScaled(PixelationTarget_AfterPlayers); - } - - private static void DrawTargetScaled(ManagedRenderTarget target) - { - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - Main.spriteBatch.Draw(target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); - Main.spriteBatch.End(); + return drawLayer switch + { + GeneralDrawLayer.BeforeAllTiles => PixelationTarget_BeforeAllTiles, + GeneralDrawLayer.BeforeSolidTiles => PixelationTarget_BeforeSolidTiles, + GeneralDrawLayer.BeforeNPCs => PixelationTarget_BeforeNPCs, + GeneralDrawLayer.AfterNPCs => PixelationTarget_AfterNPCs, + GeneralDrawLayer.BeforeProjectiles => PixelationTarget_BeforeProjectiles, + GeneralDrawLayer.AfterProjectiles => PixelationTarget_AfterProjectiles, + GeneralDrawLayer.AfterPlayers => PixelationTarget_AfterPlayers, + GeneralDrawLayer.AfterDusts => PixelationTarget_AfterDusts, + _ => PixelationTarget_AfterEverything + }; } #endregion } diff --git a/Graphics/Primitives/PrimitiveRenderer.cs b/Graphics/Primitives/PrimitiveRenderer.cs index 2fcc1b9acf..84e3d9ca65 100644 --- a/Graphics/Primitives/PrimitiveRenderer.cs +++ b/Graphics/Primitives/PrimitiveRenderer.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Graphics.Primitives /// The third controls how many points are created for the trail, and the fourth determines whether the primitive is subsequently rendered. /// /// If you wish to use pixelation, you MUST make the NPC/Projectile inherit and use instead of predraw..
- /// You can also optionally specify a render layer with . It is by default. + /// You can also optionally specify a render layer with . It is by default. ///
[Autoload(Side = ModSide.Client)] public sealed class PrimitiveRenderer : ModSystem diff --git a/Graphics/Renderers/BaseRenderer.cs b/Graphics/Renderers/BaseRenderer.cs index 8cdfa0ae6d..cb1e3dc5a8 100644 --- a/Graphics/Renderers/BaseRenderer.cs +++ b/Graphics/Renderers/BaseRenderer.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; @@ -14,7 +15,7 @@ namespace CalamityMod.Graphics.Renderers /// /// The layer that the target should be drawn at. /// - public abstract DrawLayer Layer { get; } + public abstract GeneralDrawLayer Layer { get; } /// /// Whether the target should draw and be drawn to this frame. diff --git a/Graphics/Renderers/CalamityRenderers/DeerclopsShadowRenderer.cs b/Graphics/Renderers/CalamityRenderers/DeerclopsShadowRenderer.cs index ac4203ca1b..8c2f927e08 100644 --- a/Graphics/Renderers/CalamityRenderers/DeerclopsShadowRenderer.cs +++ b/Graphics/Renderers/CalamityRenderers/DeerclopsShadowRenderer.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; +using CalamityMod.Enums; +using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -11,7 +12,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers { #region Fields/Properties - public override DrawLayer Layer => DrawLayer.AfterEverything; + public override GeneralDrawLayer Layer => GeneralDrawLayer.AfterEverything; public static NPC Deerclops => Main.npc[NPC.deerclopsBoss]; diff --git a/Graphics/Renderers/CalamityRenderers/DoGDeathAnimationRenderer.cs b/Graphics/Renderers/CalamityRenderers/DoGDeathAnimationRenderer.cs index a00c083af6..fab7fc3d6f 100644 --- a/Graphics/Renderers/CalamityRenderers/DoGDeathAnimationRenderer.cs +++ b/Graphics/Renderers/CalamityRenderers/DoGDeathAnimationRenderer.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs; +using CalamityMod.Enums; +using CalamityMod.NPCs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -18,7 +19,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers private set; } - public override DrawLayer Layer => DrawLayer.NPC; + public override GeneralDrawLayer Layer => GeneralDrawLayer.AfterNPCs; public override bool ShouldDraw => !Main.gameMenu && CalamityDrawParameterNPC.DoGDeathAnimationTimer > 0; diff --git a/Graphics/Renderers/CalamityRenderers/DyeableShadersRenderer.cs b/Graphics/Renderers/CalamityRenderers/DyeableShadersRenderer.cs index 3b4b977c61..1e4c5f474e 100644 --- a/Graphics/Renderers/CalamityRenderers/DyeableShadersRenderer.cs +++ b/Graphics/Renderers/CalamityRenderers/DyeableShadersRenderer.cs @@ -3,6 +3,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using CalamityMod.DataStructures; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -28,7 +29,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers private static List RenderersToDrawThisFrame; - public override DrawLayer Layer => DrawLayer.Player; + public override GeneralDrawLayer Layer => GeneralDrawLayer.AfterPlayers; // This ignores MainTarget, and handles its own targets, so always call the draw methods. public override bool ShouldDraw => true; diff --git a/Graphics/Renderers/CalamityRenderers/HolyInfernoRenderer.cs b/Graphics/Renderers/CalamityRenderers/HolyInfernoRenderer.cs index 409ff05a3e..6599c20f89 100644 --- a/Graphics/Renderers/CalamityRenderers/HolyInfernoRenderer.cs +++ b/Graphics/Renderers/CalamityRenderers/HolyInfernoRenderer.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs; +using CalamityMod.Enums; +using CalamityMod.NPCs; using CalamityMod.NPCs.Providence; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -13,7 +14,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers { #region Fields/Properties - public override DrawLayer Layer => DrawLayer.BeforeTiles; + public override GeneralDrawLayer Layer => GeneralDrawLayer.BeforeAllTiles; public static Providence Provi { diff --git a/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs b/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs index 98871deb15..95ef112087 100644 --- a/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs +++ b/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using CalamityMod.Enums; using CalamityMod.NPCs; using CalamityMod.NPCs.ExoMechs.Ares; using Microsoft.Xna.Framework; @@ -42,7 +43,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers private set; } - public override DrawLayer Layer => DrawLayer.NPC; + public override GeneralDrawLayer Layer => GeneralDrawLayer.AfterNPCs; // Unsure whether its more performant to always draw, or to check if any NPC actually has the debuff. public override bool ShouldDraw => true; diff --git a/Graphics/Renderers/RendererManager.cs b/Graphics/Renderers/RendererManager.cs index a4b0132ce1..338feab7b0 100644 --- a/Graphics/Renderers/RendererManager.cs +++ b/Graphics/Renderers/RendererManager.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -24,16 +25,8 @@ namespace CalamityMod.Graphics.Renderers if (Main.dedServ) return; - Main.QueueMainThreadAction(() => - { - // This hooks here, because doing it any sooner causes the screen position to be a frame behind. - On_Main.CheckMonoliths += DrawToTargets; - On_Main.DrawNPCs += DrawNPCRenderers; - On_Main.DrawProjectiles += DrawProjectileRenderers; - On_Main.DrawPlayers_AfterProjectiles += DrawPlayerRenderers; - On_Main.DrawBackgroundBlackFill += DrawBeforeTileRenderers; - On_Main.DrawInfernoRings += DrawAfterEverythingRenderers; - }); + // This hooks here, because doing it any sooner causes the screen position to be a frame behind. + Main.QueueMainThreadAction(() => On_Main.CheckMonoliths += DrawToTargets); } public override void Unload() @@ -43,24 +36,13 @@ namespace CalamityMod.Graphics.Renderers // Clear the cached renderers, so they can be readded on mod loading when initialized. Renderers.Clear(); - - Main.QueueMainThreadAction(() => - { - // Supposed to be auto-unloaded, but considering TMods poor track record with actually doing this, manually unload them. - On_Main.CheckMonoliths -= DrawToTargets; - On_Main.DrawNPCs -= DrawNPCRenderers; - On_Main.DrawProjectiles -= DrawProjectileRenderers; - On_Main.DrawPlayers_AfterProjectiles -= DrawPlayerRenderers; - On_Main.DrawBackgroundBlackFill -= DrawBeforeTileRenderers; - On_Main.DrawInfernoRings -= DrawAfterEverythingRenderers; - }); } #endregion #region Updating public override void PreUpdateEntities() { - if (Main.netMode is NetmodeID.Server) + if (Main.dedServ) return; foreach (var renderer in Renderers) @@ -69,7 +51,7 @@ namespace CalamityMod.Graphics.Renderers public override void PostUpdateEverything() { - if (Main.netMode is NetmodeID.Server) + if (Main.dedServ) return; foreach (var renderer in Renderers) @@ -78,6 +60,17 @@ namespace CalamityMod.Graphics.Renderers #endregion #region Drawing + internal static void DrawRendererAtLayer(GeneralDrawLayer drawLayer) + { + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise); + + var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer == drawLayer); + foreach (var renderer in renderers) + renderer.DrawTarget(Main.spriteBatch); + + Main.spriteBatch.End(); + } + private void DrawToTargets(On_Main.orig_CheckMonoliths orig) { orig(); @@ -106,82 +99,6 @@ namespace CalamityMod.Graphics.Renderers Main.instance.GraphicsDevice.SetRenderTarget(null); } - - private void DrawNPCRenderers(On_Main.orig_DrawNPCs orig, Main self, bool behindTiles) - { - orig(self, behindTiles); - - if (behindTiles) - return; - - var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.NPC); - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise); - - foreach (var renderer in renderers) - renderer.DrawTarget(Main.spriteBatch); - - Main.spriteBatch.ExitShaderRegion(); - } - - private void DrawProjectileRenderers(On_Main.orig_DrawProjectiles orig, Main self) - { - orig(self); - - var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.Projectile); - - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise); - - foreach (var renderer in renderers) - renderer.DrawTarget(Main.spriteBatch); - - Main.spriteBatch.End(); - } - - private void DrawPlayerRenderers(On_Main.orig_DrawPlayers_AfterProjectiles orig, Main self) - { - orig(self); - - var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.Player); - - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise); - - foreach (var renderer in renderers) - renderer.DrawTarget(Main.spriteBatch); - - Main.spriteBatch.End(); - } - - private void DrawBeforeTileRenderers(On_Main.orig_DrawBackgroundBlackFill orig, Main self) - { - var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.BeforeTiles); - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise); - - foreach (var renderer in renderers) - renderer.DrawTarget(Main.spriteBatch); - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.Transform); - - orig(self); - } - - private void DrawAfterEverythingRenderers(On_Main.orig_DrawInfernoRings orig, Main self) - { - var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.AfterEverything); - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise); - foreach (var renderer in renderers) - renderer.DrawTarget(Main.spriteBatch); - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.Transform); - orig(self); - } #endregion } } diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 33d7ff2632..3ae73efc26 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -57,6 +57,15 @@ namespace CalamityMod.ILEditing IL_TileDrawing.DrawTrees += DrawTreeGlowMask; On_TileDrawing.DrawBasicTile += DrawTreeTrunkAndCactusGlowMask; + // Graphics (GeneralDrawLayer detours) + On_Main.DrawBackgroundBlackFill += GeneralDrawLayer_DrawToLayer_BeforeAllTiles; + On_Main.DoDraw_Tiles_Solid += GeneralDrawLayer_DrawToLayer_BeforeSolidTiles; + On_Main.DoDraw_DrawNPCsOverTiles += GeneralDrawLayer_DrawToLayer_NPCs; + On_Main.DrawProjectiles += GeneralDrawLayer_DrawToLayer_Projectiles; + On_Main.DrawPlayers_AfterProjectiles += GeneralDrawLayer_DrawToLayer_AfterPlayers; + On_Main.DrawDust += GeneralDrawLayer_DrawToLayer_AfterDusts; + On_Main.DrawInfernoRings += GeneralDrawLayer_DrawToLayer_AfterEverything; + // NPC behavior IL_Main.UpdateTime += PermitNighttimeTownNPCSpawning; On_Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index ecc6161446..4c3b68fb83 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -9,6 +9,9 @@ using CalamityMod.DataStructures; using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.FluidSimulation; +using CalamityMod.Graphics.Metaballs; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Graphics.Renderers; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Armor.Wulfrum; @@ -31,6 +34,7 @@ using CalamityMod.Projectiles; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Typeless; using CalamityMod.Systems; +using CalamityMod.Systems.Graphic.PixelationSystem; using CalamityMod.Systems.Mechanic; using CalamityMod.Tiles; using CalamityMod.Walls; @@ -914,6 +918,82 @@ namespace CalamityMod.ILEditing } #endregion + #region GeneralDrawLayer Systems Drawing + private static void GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer drawLayer) + { + Main.spriteBatch.SafeAction(() => + { + Main.spriteBatch.TryEnd(); + GeneralParticleHandler.DrawParticleCollectionsAtSpecificLayer(drawLayer); + }); + + Main.spriteBatch.SafeAction(() => + { + Main.spriteBatch.TryEnd(); + Main.spriteBatch.TryBegin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + MetaballManager.DrawMetaballs(drawLayer); + }); + + Main.spriteBatch.SafeAction(() => + { + Main.spriteBatch.TryEnd(); + PrimitivePixelationSystem.DrawTargetScaled(drawLayer); + }); + + PixelationManager.DrawPixelatedTargets(drawLayer); + + Main.spriteBatch.SafeAction(() => + { + Main.spriteBatch.TryEnd(); + RendererManager.DrawRendererAtLayer(drawLayer); + }); + } + + private static void GeneralDrawLayer_DrawToLayer_BeforeAllTiles(On_Main.orig_DrawBackgroundBlackFill orig, Main self) + { + GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.BeforeAllTiles); + orig(self); + } + + private static void GeneralDrawLayer_DrawToLayer_BeforeSolidTiles(On_Main.orig_DoDraw_Tiles_Solid orig, Main self) + { + GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.BeforeSolidTiles); + orig(self); + } + + private static void GeneralDrawLayer_DrawToLayer_NPCs(On_Main.orig_DoDraw_DrawNPCsOverTiles orig, Main self) + { + GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.BeforeNPCs); + orig(self); + GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.AfterNPCs); + } + + private static void GeneralDrawLayer_DrawToLayer_Projectiles(On_Main.orig_DrawProjectiles orig, Main self) + { + GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.BeforeProjectiles); + orig(self); + GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.AfterProjectiles); + } + + private static void GeneralDrawLayer_DrawToLayer_AfterPlayers(On_Main.orig_DrawPlayers_AfterProjectiles orig, Main self) + { + orig(self); + GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.AfterPlayers); + } + + private static void GeneralDrawLayer_DrawToLayer_AfterDusts(On_Main.orig_DrawDust orig, Main self) + { + orig(self); + GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.AfterDusts); + } + + private static void GeneralDrawLayer_DrawToLayer_AfterEverything(On_Main.orig_DrawInfernoRings orig, Main self) + { + orig(self); + GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.AfterEverything); + } + #endregion + #region General Particle Rendering private static void DrawFusableParticles(On_Main.orig_SortDrawCacheWorms orig, Main self) { diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index c50b6d413e..0e87641d04 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -57,15 +57,16 @@ namespace CalamityMod.Particles /// internal static Dictionary particleTexturesByIDs; - private static Dictionary particleAutoDrawingOverrides; - + // Collections for tracking particles active in the world. private static List activeParticles; private static List particlesToKill; private static Dictionary> particlesToSpawnNextFrame; private static Dictionary> particlesToSpawnNextFrame_Pixelated; + // Collections for correctly organizing active prticles for drawing. private static Dictionary> particlesToDraw; private static Dictionary> particlesToDraw_Pixelated; + private static Dictionary> particlesToDraw_CustomShader; #endregion #region Loading and Unloading @@ -93,22 +94,6 @@ namespace CalamityMod.Particles texturePath = instance.Texture; particleTexturesByIDs[ID] = ModContent.Request(texturePath, AssetRequestMode.ImmediateLoad).Value; }); - - foreach (Mod mod in ModLoader.Mods) - { - var drawers = mod.GetContent().Where(c => c is ParticleAutoDrawingOverride).Select(c => c as ParticleAutoDrawingOverride); - foreach (var drawer in drawers) - { - if (drawer.TargetParticleTypeName != "") - { - if (particleTypesByNames.TryGetValue(drawer.TargetParticleTypeName, out Type particleType)) - particleAutoDrawingOverrides.Add(particleType, drawer); - else - throw new Exception($"The Particle of name \"{drawer.TargetParticleTypeName}\" used in {drawer.GetType().Name} could not be found! " + - $"Please ensure the Particle's internal name is spelt correctly and is prefixed by its home mod's internal name."); - } - } - } } public override void Load() @@ -117,21 +102,14 @@ namespace CalamityMod.Particles particleIDsByTypes = []; particleTexturesByIDs = []; - particleAutoDrawingOverrides = []; - activeParticles = []; particlesToKill = []; particlesToSpawnNextFrame = []; particlesToSpawnNextFrame_Pixelated = []; + particlesToDraw = []; particlesToDraw_Pixelated = []; - - On_Main.DrawBackgroundBlackFill += DrawParticles_BeforeTiles; - On_Main.DrawNPCs += DrawParticles_NPCs; - On_Main.DrawProjectiles += DrawParticles_Projectiles; - On_Main.DrawPlayers_AfterProjectiles += DrawParticles_AfterPlayers; - On_Main.DrawDust += DrawParticles_AfterDusts; - On_Main.DrawInfernoRings += DrawParticles_AfterEverything; + particlesToDraw_CustomShader = []; } public override void Unload() @@ -140,14 +118,14 @@ namespace CalamityMod.Particles particleIDsByTypes = null; particleTexturesByIDs = null; - particleAutoDrawingOverrides = null; - activeParticles = null; particlesToKill = null; particlesToSpawnNextFrame = null; particlesToSpawnNextFrame_Pixelated = null; + particlesToDraw = null; particlesToDraw_Pixelated = null; + particlesToDraw_CustomShader = null; } public override void OnWorldUnload() @@ -156,8 +134,10 @@ namespace CalamityMod.Particles particlesToKill.Clear(); particlesToSpawnNextFrame.Clear(); particlesToSpawnNextFrame_Pixelated.Clear(); + particlesToDraw.Clear(); particlesToDraw_Pixelated.Clear(); + particlesToDraw_CustomShader.Clear(); } #endregion @@ -312,62 +292,14 @@ namespace CalamityMod.Particles particlesToKill.Clear(); } - private static void DrawParticles_BeforeTiles(On_Main.orig_DrawBackgroundBlackFill orig, Main self) + internal static void DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer drawLayer) { - Main.spriteBatch.End(); - DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.BeforeTiles); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + if (Main.dedServ) + return; - orig(self); - } - - private static void DrawParticles_NPCs(On_Main.orig_DrawNPCs orig, Main self, bool behindTiles) - { - if (!behindTiles) - { - Main.spriteBatch.End(); - DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.BeforeNPCs); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - } - - orig(self, behindTiles); - - if (!behindTiles) - { - Main.spriteBatch.End(); - DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.AfterNPCs); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - } - } - - private static void DrawParticles_Projectiles(On_Main.orig_DrawProjectiles orig, Main self) - { - DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.BeforeProjectiles); - - orig(self); - - DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.AfterProjectiles); - } - - private static void DrawParticles_AfterPlayers(On_Main.orig_DrawPlayers_AfterProjectiles orig, Main self) - { - orig(self); - DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.AfterPlayers); - } - - private static void DrawParticles_AfterDusts(On_Main.orig_DrawDust orig, Main self) - { - orig(self); - DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.AfterDusts); - } - - private static void DrawParticles_AfterEverything(On_Main.orig_DrawInfernoRings orig, Main self) - { - orig(self); - - Main.spriteBatch.End(); - DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer.AfterEverything); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + DrawParticleCollection(particlesToDraw, drawLayer); + DrawParticleCollection(particlesToDraw_Pixelated, drawLayer, true); + DrawParticlesWithShaders(drawLayer); } private static void DrawParticleInstance(Particle particle) @@ -454,35 +386,27 @@ namespace CalamityMod.Particles } } - private static void DrawParticleCollectionsAtSpecificLayer(GeneralDrawLayer drawLayer) + private static void DrawParticlesWithShaders(GeneralDrawLayer drawLayer) { - if (Main.dedServ) - return; - - DrawParticleCollection(particlesToDraw, drawLayer); - DrawParticleCollection(particlesToDraw_Pixelated, drawLayer, true); - - foreach (ParticleAutoDrawingOverride drawer in particleAutoDrawingOverrides.Values) + foreach (var keyValuePair in particlesToDraw_CustomShader) { - if (!drawer.ShouldDrawParticles) - return; - - foreach (var keyValuePair in drawer.ActiveParticleInstances) + // If there's nothing to be drawn, remove the effect from the dictionary and return. + if (keyValuePair.Value.Count == 0) { - if (keyValuePair.Value.Count == 0) - return; - - if (drawer.DrawLayerOverride.HasValue) - { - if (drawer.DrawLayerOverride.Value == drawLayer) - drawer.DrawAllParticles(Main.spriteBatch, keyValuePair.Value); - } - else - { - if (keyValuePair.Key == drawLayer) - drawer.DrawAllParticles(Main.spriteBatch, keyValuePair.Value); - } + particlesToDraw_CustomShader.Remove(keyValuePair.Key); + return; } + + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullNone, keyValuePair.Key, Main.GameViewMatrix.TransformationMatrix); + + var particlesAtDrawLayer = keyValuePair.Value.Where(p => p.DrawLayer == drawLayer); + foreach (Particle particle in particlesAtDrawLayer) + { + particle.PrepareCustomShader(keyValuePair.Key); + DrawParticleInstance(particle); + } + + Main.spriteBatch.End(); } } @@ -536,11 +460,11 @@ namespace CalamityMod.Particles private static void AddToAssociatedDrawCollection(Particle particle) { - if (particle.OverrideAutomaticDrawing && particleAutoDrawingOverrides[particle.GetType()].ShouldDrawParticles) + if (particle.CustomShader != null) { - if (!particleAutoDrawingOverrides[particle.GetType()].ActiveParticleInstances.ContainsKey(particle.DrawLayer)) - particleAutoDrawingOverrides[particle.GetType()].ActiveParticleInstances[particle.DrawLayer] = []; - particleAutoDrawingOverrides[particle.GetType()].ActiveParticleInstances[particle.DrawLayer].Add(particle); + if (!particlesToDraw_CustomShader.ContainsKey(particle.CustomShader)) + particlesToDraw_CustomShader[particle.CustomShader] = []; + particlesToDraw_CustomShader[particle.CustomShader].Add(particle); } else { @@ -550,8 +474,8 @@ namespace CalamityMod.Particles private static void RemoveFromAssociatedDrawCollection(Particle particle) { - if (particle.OverrideAutomaticDrawing) - particleAutoDrawingOverrides[particle.GetType()].ActiveParticleInstances[particle.DrawLayer].Remove(particle); + if (particle.CustomShader != null) + particlesToDraw_CustomShader[particle.CustomShader].Remove(particle); else ReturnAssociatedDrawCollection(particle).Remove(particle); } diff --git a/Particles/Particle.cs b/Particles/Particle.cs index ddc3f94bcf..2de8391621 100644 --- a/Particles/Particle.cs +++ b/Particles/Particle.cs @@ -75,9 +75,14 @@ namespace CalamityMod.Particles /// /// The "layer" or point at which you'd like your particle to draw in Terraria's internal draw order. - ///
Defaults to .
+ ///
Defaults to .
///
- public GeneralDrawLayer DrawLayer = GeneralDrawLayer.AfterEverything; + public GeneralDrawLayer DrawLayer = GeneralDrawLayer.AfterDusts; + + /// + /// An 0-1 interpolant representing how close this particle is from its . + /// + public float LifetimeCompletion => Lifetime != 0 ? Time / (float)Lifetime : 0; /// /// The path to this particle's autoloaded texture. @@ -92,11 +97,6 @@ namespace CalamityMod.Particles /// public virtual int FrameVariants => 1; - /// - /// An 0-1 interpolant representing how close this particle is from its . - /// - public float LifetimeCompletion => Lifetime != 0 ? Time / (float)Lifetime : 0; - /// /// Set this to true if you NEED the particle to render even if the particle cap is reached. /// @@ -123,10 +123,10 @@ namespace CalamityMod.Particles public virtual bool UseCustomDraw => false; /// - /// Override and set this to true to disable automatic drawing for all instances of this particle entirely. - ///
Drawing of this particle must be done from a class.
+ /// An optional shader parameter for this paricle to be drawn with. + /// Use to set shader parameters accordingly. ///
- public virtual bool OverrideAutomaticDrawing => false; + public virtual Effect CustomShader => null; /// /// Use this method if you want to handle the particle drawing yourself. Only called if is set to true. @@ -139,6 +139,11 @@ namespace CalamityMod.Particles /// The base position of the particle set. public virtual void CustomDraw(SpriteBatch spriteBatch, Vector2 basePosition) { } + /// + /// Use this method if you're using a custom shader effect with this particle type to set shader parameters accordingly. + /// + public virtual void PrepareCustomShader(Effect shader) { } + /// /// Called every frame in . /// The particle's velocity gets automatically added to its position, and its time automatically increases. diff --git a/Particles/ParticleAutoDrawingOverride.cs b/Particles/ParticleAutoDrawingOverride.cs deleted file mode 100644 index 5a5ec3a257..0000000000 --- a/Particles/ParticleAutoDrawingOverride.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Collections.Generic; -using CalamityMod.Enums; -using Microsoft.Xna.Framework.Graphics; -using Terraria.ModLoader; - -namespace CalamityMod.Particles -{ - /// - /// Allows one to directly control how all active instances of a specified particle type in the world are drawn. - ///
Useful for cases such as applying shaders to particles without resetting the SpriteBatch for every individual particle instance.
- ///
- /// - /// Note that particles using an instance of this class MUST have set to true. - /// - public abstract class ParticleAutoDrawingOverride : ModType - { - /// - /// All active particle instances for this drawer, identified by a particle's draw layer. - /// - public Dictionary> ActiveParticleInstances { get; private set; } = []; - - /// - /// The internal name of the particle type that should be manually drawn. - ///
Particle names should be prefixed with the internal name of the mod they are from.
- ///
e.g. "CalamityMod.PulseRing" is valid, while just "PulseRing" is not.
- ///
- /// - /// This is only checked once when the mod is loading. Changing this during runtime will not affect anything. - /// - public abstract string TargetParticleTypeName { get; } - - /// - /// Whether or not this drawer should draw its particles this frame. - ///
Return false to prevent currently stored particles from being drawn and new ones from being added to .
- ///
- /// - /// Returns true by default. - /// - public virtual bool ShouldDrawParticles => true; - - /// - /// An optional property which will override the draw layer of all particles for this drawer entirely, using the specified one here instead. - /// - public virtual GeneralDrawLayer? DrawLayerOverride => null; - - protected sealed override void Register() => ModTypeLookup.Register(this); - - public sealed override void SetupContent() => SetStaticDefaults(); - - /// - /// Write all relevenat draw code for your particles here. - /// - /// Stores particles based on their default draw layer. - ///
Iterate through this collection to run individual particle drawing logic.
- public abstract void DrawAllParticles(SpriteBatch spriteBatch, List particlesToDraw); - } -} diff --git a/Projectiles/Boss/DoGFire.cs b/Projectiles/Boss/DoGFire.cs index e036754e9f..dcb6e68f66 100644 --- a/Projectiles/Boss/DoGFire.cs +++ b/Projectiles/Boss/DoGFire.cs @@ -4,6 +4,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.DataStructures; using CalamityMod.Graphics.Primitives; using CalamityMod.Particles; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria.DataStructures; @@ -12,6 +13,7 @@ using Terraria.Audio; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Boss { public class DoGFire : ModProjectile, ILocalizedModType, IPixelatedPrimitiveRenderer @@ -159,7 +161,7 @@ namespace CalamityMod.Projectiles.Boss return Color.Lerp(fullBodyColor, Color.White, 0.175f); } - public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer) + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) { // Render the main trail for the body for the flame. GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); diff --git a/Projectiles/Magic/SHPB.cs b/Projectiles/Magic/SHPB.cs index 8e37b4b884..9b2448527d 100644 --- a/Projectiles/Magic/SHPB.cs +++ b/Projectiles/Magic/SHPB.cs @@ -2,6 +2,7 @@ using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Particles; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -13,7 +14,7 @@ namespace CalamityMod.Projectiles.Magic { public class SHPB : ModProjectile, ILocalizedModType, IPixelatedPrimitiveRenderer { - public PixelationPrimitiveLayer LayerToRenderTo => PixelationPrimitiveLayer.BeforeProjectiles; + public GeneralDrawLayer LayerToRenderTo => GeneralDrawLayer.BeforeProjectiles; public ref float ExplodeTimer => ref Projectile.ai[2]; @@ -377,7 +378,7 @@ namespace CalamityMod.Projectiles.Magic return Color.Lerp(endColor, Color.White, deathInterpolant); } - public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer) + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) { GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(PlasmaBallWidthFunction, PlasmaBallColorFunction, (_) => Projectile.Size * 0.5f, true, true, GameShaders.Misc["CalamityMod:ImpFlameTrail"]), Projectile.oldPos.Length * 2); diff --git a/Projectiles/Magic/SHPL.cs b/Projectiles/Magic/SHPL.cs index 055311f127..2d704a38a0 100644 --- a/Projectiles/Magic/SHPL.cs +++ b/Projectiles/Magic/SHPL.cs @@ -2,6 +2,7 @@ using System.Linq; using CalamityMod.Graphics.Primitives; using CalamityMod.Particles; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -22,7 +23,7 @@ namespace CalamityMod.Projectiles.Magic public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public PixelationPrimitiveLayer LayerToRenderTo => PixelationPrimitiveLayer.BeforeProjectiles; + public GeneralDrawLayer LayerToRenderTo => GeneralDrawLayer.BeforeProjectiles; public override void SetStaticDefaults() { @@ -137,7 +138,7 @@ namespace CalamityMod.Projectiles.Magic return Color.Lerp(startColor, bodyColor, completion); } - public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer) + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) { // Render the main trail for the body for the laser. GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); diff --git a/Projectiles/Magic/SHPS.cs b/Projectiles/Magic/SHPS.cs index bd02542b8b..d4d256b49c 100644 --- a/Projectiles/Magic/SHPS.cs +++ b/Projectiles/Magic/SHPS.cs @@ -3,6 +3,7 @@ using System.Linq; using CalamityMod.DataStructures; using CalamityMod.Graphics.Primitives; using CalamityMod.Particles; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -234,7 +235,7 @@ namespace CalamityMod.Projectiles.Magic return Color.Lerp(Color.White, tipColor, completion); } - public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer) + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) { // Render the main trail for the body for the soul. GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); diff --git a/Projectiles/Magic/SylvestaffHoldout.cs b/Projectiles/Magic/SylvestaffHoldout.cs index 3109ae5bff..095581baa7 100644 --- a/Projectiles/Magic/SylvestaffHoldout.cs +++ b/Projectiles/Magic/SylvestaffHoldout.cs @@ -2,6 +2,7 @@ using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Physics; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -14,7 +15,7 @@ namespace CalamityMod.Projectiles.Magic { public class SylvestaffHoldout : ModProjectile, IPixelatedPrimitiveRenderer { - public PixelationPrimitiveLayer LayerToRenderTo => PixelationPrimitiveLayer.BeforeProjectiles | PixelationPrimitiveLayer.AfterPlayers; + public GeneralDrawLayer LayerToRenderTo => GeneralDrawLayer.BeforeProjectiles | GeneralDrawLayer.AfterPlayers; public override LocalizedText DisplayName => CalamityUtils.GetItemName(); @@ -186,9 +187,9 @@ namespace CalamityMod.Projectiles.Magic } } - public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer) + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) { - bool backLayer = layer == PixelationPrimitiveLayer.BeforeProjectiles; + bool backLayer = layer == GeneralDrawLayer.BeforeProjectiles; RenderRibbon(LeftRibbon, -1, backLayer); RenderRibbon(RightRibbon, 1, backLayer); } diff --git a/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs b/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs index 90f305fa35..9bc3a59757 100644 --- a/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs +++ b/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs @@ -2,6 +2,7 @@ using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; +using CalamityMod.Enums; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -81,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee public float WidthFunction(float completionRatio) => MathF.Max(50f * Scale * (MathF.Pow(1f - completionRatio, 2) * 2.75f), 0.35f); public Color ColorFunction(float completionRatio) => Color.Orange * (completionRatio > 0.1f ? 1f : completionRatio * 10f); - public void RenderPixelatedPrimitives(SpriteBatch spritebatch, PixelationPrimitiveLayer layer) + public void RenderPixelatedPrimitives(SpriteBatch spritebatch, GeneralDrawLayer layer) { GameShaders.Misc["CalamityMod:Bordernado"].UseSaturation(-0.2f); GameShaders.Misc["CalamityMod:Bordernado"].UseOpacity(fadeOut); diff --git a/Projectiles/Summon/LiliesOfEternityBullet.cs b/Projectiles/Summon/LiliesOfEternityBullet.cs index d87e226da0..d60b3bb10a 100644 --- a/Projectiles/Summon/LiliesOfEternityBullet.cs +++ b/Projectiles/Summon/LiliesOfEternityBullet.cs @@ -1,4 +1,5 @@ -using CalamityMod.Graphics.Primitives; +using CalamityMod.Enums; +using CalamityMod.Graphics.Primitives; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -60,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon private Color PrimitiveColorFunction(float completionRatio) => Color.Lerp(Color.DarkGoldenrod, Color.LightGoldenrodYellow, completionRatio); - public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer) + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) { GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, pixelate: true, shader: GameShaders.Misc["CalamityMod:TrailStreak"])); diff --git a/Projectiles/Summon/LiliesOfFinalityBullet.cs b/Projectiles/Summon/LiliesOfFinalityBullet.cs index 19a527e5d2..b969ecd814 100644 --- a/Projectiles/Summon/LiliesOfFinalityBullet.cs +++ b/Projectiles/Summon/LiliesOfFinalityBullet.cs @@ -1,4 +1,5 @@ -using CalamityMod.Graphics.Primitives; +using CalamityMod.Enums; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -64,7 +65,7 @@ namespace CalamityMod.Projectiles.Summon private Color PrimitiveColorFunction(float completionRatio) => Color.Lerp(Color.DarkGoldenrod, Color.LightGoldenrodYellow, completionRatio); - public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer) + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) { GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, pixelate: true, shader: GameShaders.Misc["CalamityMod:TrailStreak"])); diff --git a/Systems/Graphic/PixelationSystem/PixelationManager.cs b/Systems/Graphic/PixelationSystem/PixelationManager.cs index 00628ffda8..8758c40444 100644 --- a/Systems/Graphic/PixelationSystem/PixelationManager.cs +++ b/Systems/Graphic/PixelationSystem/PixelationManager.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem { public class PixelationManager : ModSystem { - private static Dictionary PixelTargets_BeforeTiles; + private static Dictionary PixelTargets_BeforeAllTiles; + private static Dictionary PixelTargets_BeforeSolidTiles; private static Dictionary PixelTargets_BeforeNPCs; private static Dictionary PixelTargets_AfterNPCs; private static Dictionary PixelTargets_BeforeProjectiles; @@ -21,7 +22,8 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem private static Dictionary PixelTargets_AfterDusts; private static Dictionary PixelTargets_AfterEverything; - private static List ActivePixelatedDrawers_BeforeTiles; + private static List ActivePixelatedDrawers_BeforeAllTiles; + private static List ActivePixelatedDrawers_BeforeSolidTiles; private static List ActivePixelatedDrawers_BeforeNPCs; private static List ActivePixelatedDrawers_AfterNPCs; private static List ActivePixelatedDrawers_BeforeProjectiles; @@ -54,12 +56,13 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem ///
internal static RenderTarget2D CreatePixelTarget(int width, int height) => new(Main.graphics.GraphicsDevice, (int)(width * PixelationResolution), (int)(height * PixelationResolution)); - public override void OnModLoad() + public override void Load() { if (Main.dedServ) return; - PixelTargets_BeforeTiles = []; + PixelTargets_BeforeAllTiles = []; + PixelTargets_BeforeSolidTiles = []; PixelTargets_BeforeNPCs = []; PixelTargets_AfterNPCs = []; PixelTargets_BeforeProjectiles = []; @@ -68,7 +71,8 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem PixelTargets_AfterDusts = []; PixelTargets_AfterEverything = []; - ActivePixelatedDrawers_BeforeTiles = []; + ActivePixelatedDrawers_BeforeAllTiles = []; + ActivePixelatedDrawers_BeforeSolidTiles = []; ActivePixelatedDrawers_BeforeNPCs = []; ActivePixelatedDrawers_AfterNPCs = []; ActivePixelatedDrawers_BeforeProjectiles = []; @@ -78,20 +82,15 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem ActivePixelatedDrawers_AfterEverything = []; RenderTargetManager.RenderTargetUpdateLoopEvent += PrepareTargets; - On_Main.DrawBackgroundBlackFill += DrawPixelated_BeforeTiles; - On_Main.DrawNPCs += DrawPixelated_NPCs; - On_Main.DrawProjectiles += DrawPixelated_Projectiles; - On_Main.DrawPlayers_AfterProjectiles += DrawPixelated_AfterPlayers; - On_Main.DrawDust += DrawPixelated_AfterDusts; - On_Main.DrawInfernoRings += DrawPixelated_AfterEverything; } - public override void OnModUnload() + public override void Unload() { if (Main.dedServ) return; - PixelTargets_BeforeTiles = null; + PixelTargets_BeforeAllTiles = null; + PixelTargets_BeforeSolidTiles = null; PixelTargets_BeforeNPCs = null; PixelTargets_AfterNPCs = null; PixelTargets_BeforeProjectiles = null; @@ -100,7 +99,8 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem PixelTargets_AfterDusts = null; PixelTargets_AfterEverything = null; - ActivePixelatedDrawers_BeforeTiles = null; + ActivePixelatedDrawers_BeforeAllTiles = null; + ActivePixelatedDrawers_BeforeSolidTiles = null; ActivePixelatedDrawers_BeforeNPCs = null; ActivePixelatedDrawers_AfterNPCs = null; ActivePixelatedDrawers_BeforeProjectiles = null; @@ -115,7 +115,8 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem if (Main.dedServ) return; - ActivePixelatedDrawers_BeforeTiles.Clear(); + ActivePixelatedDrawers_BeforeAllTiles.Clear(); + ActivePixelatedDrawers_BeforeSolidTiles.Clear(); ActivePixelatedDrawers_BeforeNPCs.Clear(); ActivePixelatedDrawers_AfterNPCs.Clear(); ActivePixelatedDrawers_BeforeProjectiles.Clear(); @@ -152,7 +153,8 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem if (!Main.gameMenu && !Main.dedServ) { // Draw all collections to their respctive render targets. - DrawCollectionsToTarget(PixelTargets_BeforeTiles, PixelationMatrix, ActivePixelatedDrawers_BeforeTiles); + DrawCollectionsToTarget(PixelTargets_BeforeAllTiles, PixelationMatrix, ActivePixelatedDrawers_BeforeAllTiles); + DrawCollectionsToTarget(PixelTargets_BeforeSolidTiles, PixelationMatrix, ActivePixelatedDrawers_BeforeSolidTiles); DrawCollectionsToTarget(PixelTargets_BeforeNPCs, PixelationMatrix, ActivePixelatedDrawers_BeforeNPCs); DrawCollectionsToTarget(PixelTargets_AfterNPCs, PixelationMatrix, ActivePixelatedDrawers_AfterNPCs); DrawCollectionsToTarget(PixelTargets_BeforeProjectiles, PixelationMatrix, ActivePixelatedDrawers_BeforeProjectiles); @@ -164,49 +166,7 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem Main.graphics.GraphicsDevice.SetRenderTarget(null); } } - - private static void DrawPixelated_BeforeTiles(On_Main.orig_DrawBackgroundBlackFill orig, Main self) - { - DrawPixelatedTargets(PixelTargets_BeforeTiles); - orig(self); - } - - private static void DrawPixelated_NPCs(On_Main.orig_DrawNPCs orig, Main self, bool behindTiles) - { - if (!behindTiles) - DrawPixelatedTargets(PixelTargets_BeforeNPCs); - - orig(self, behindTiles); - - if (!behindTiles) - DrawPixelatedTargets(PixelTargets_AfterNPCs); - } - - private static void DrawPixelated_Projectiles(On_Main.orig_DrawProjectiles orig, Main self) - { - DrawPixelatedTargets(PixelTargets_BeforeProjectiles); - orig(self); - DrawPixelatedTargets(PixelTargets_AfterProjectiles); - } - - private static void DrawPixelated_AfterPlayers(On_Main.orig_DrawPlayers_AfterProjectiles orig, Main self) - { - orig(self); - DrawPixelatedTargets(PixelTargets_AfterPlayers); - } - - private static void DrawPixelated_AfterDusts(On_Main.orig_DrawDust orig, Main self) - { - orig(self); - DrawPixelatedTargets(PixelTargets_AfterDusts); - } - - private static void DrawPixelated_AfterEverything(On_Main.orig_DrawInfernoRings orig, Main self) - { - orig(self); - DrawPixelatedTargets(PixelTargets_AfterEverything); - } - + private static void DrawCollectionsToTarget(Dictionary targetCollection, Matrix pixelationMatrix, List drawerCollection) { foreach (var blendStateTargetPair in targetCollection) @@ -229,8 +189,9 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem drawerCollection.Clear(); } - private static void DrawPixelatedTargets(Dictionary targetCollection) + internal static void DrawPixelatedTargets(GeneralDrawLayer drawLayer) { + var targetCollection = ReturnAssociatedTargetCollection(drawLayer); Main.spriteBatch.SafeAction(() => { foreach (var keyValuePair in targetCollection) @@ -248,7 +209,8 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem { List drawerCollection = drawLayer switch { - GeneralDrawLayer.BeforeTiles => ActivePixelatedDrawers_BeforeTiles, + GeneralDrawLayer.BeforeAllTiles => ActivePixelatedDrawers_BeforeAllTiles, + GeneralDrawLayer.BeforeSolidTiles => ActivePixelatedDrawers_BeforeSolidTiles, GeneralDrawLayer.BeforeNPCs => ActivePixelatedDrawers_BeforeNPCs, GeneralDrawLayer.AfterNPCs => ActivePixelatedDrawers_AfterNPCs, GeneralDrawLayer.BeforeProjectiles => ActivePixelatedDrawers_BeforeProjectiles, @@ -261,13 +223,36 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem return drawerCollection; } + private static Dictionary ReturnAssociatedTargetCollection(GeneralDrawLayer drawLayer) + { + Dictionary targetCollection = drawLayer switch + { + GeneralDrawLayer.BeforeAllTiles => PixelTargets_BeforeAllTiles, + GeneralDrawLayer.BeforeSolidTiles => PixelTargets_BeforeSolidTiles, + GeneralDrawLayer.BeforeNPCs => PixelTargets_BeforeNPCs, + GeneralDrawLayer.AfterNPCs => PixelTargets_AfterNPCs, + GeneralDrawLayer.BeforeProjectiles => PixelTargets_BeforeProjectiles, + GeneralDrawLayer.AfterProjectiles => PixelTargets_AfterProjectiles, + GeneralDrawLayer.AfterPlayers => PixelTargets_AfterPlayers, + GeneralDrawLayer.AfterDusts => PixelTargets_AfterDusts, + _ => PixelTargets_AfterEverything, + }; + + return targetCollection; + } + private static void VerifyTargetExistence(GeneralDrawLayer drawLayer, BlendState blendState) { switch (drawLayer) { - case GeneralDrawLayer.BeforeTiles: - if (!PixelTargets_BeforeTiles.ContainsKey(blendState)) - Main.QueueMainThreadAction(() => PixelTargets_BeforeTiles[blendState] = new(true, CreatePixelTarget)); + case GeneralDrawLayer.BeforeAllTiles: + if (!PixelTargets_BeforeAllTiles.ContainsKey(blendState)) + Main.QueueMainThreadAction(() => PixelTargets_BeforeAllTiles[blendState] = new(true, CreatePixelTarget)); + break; + + case GeneralDrawLayer.BeforeSolidTiles: + if (!PixelTargets_BeforeSolidTiles.ContainsKey(blendState)) + Main.QueueMainThreadAction(() => PixelTargets_BeforeSolidTiles[blendState] = new(true, CreatePixelTarget)); break; case GeneralDrawLayer.BeforeNPCs: diff --git a/Systems/Graphic/TempParticleSystem/TempParticle.cs b/Systems/Graphic/TempParticleSystem/TempParticle.cs new file mode 100644 index 0000000000..19b747cbe7 --- /dev/null +++ b/Systems/Graphic/TempParticleSystem/TempParticle.cs @@ -0,0 +1,67 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; + +namespace CalamityMod.Systems.Graphic.TempParticleSystem +{ + public class TempParticle + { + public Asset StoredTexture; + + public Vector2 Position; + + public Vector2 StoredPosition; + + public Vector2 Velocity; + + public Vector2 Scale; + + public Color DrawColor; + + public float Rotation; + + public float Opacity; + + public float Depth; + + public int Lifetime; + + public int Time; + + public int FrameX; + + public int FrameY; + + public int MaxVerticalFrames; + + public int MaxHorizontalFrames; + + public float[] ExtraData; + + /// + /// An 0-1 interpolant representing how close this particle is from its . + /// + public float LifetimeCompletionRatio => MathHelper.Clamp(Time / (float)Lifetime, 0f, 1f); + + public void SetBasicParticleData(Asset storedTexture, Vector2 position, Vector2 storedPosition, Vector2 velocity, Vector2 scale, Color drawColor, float rotation, float opacity, float depth, int lifetime, int frameX, int frameY, int maxHorizontalFrames, int maxVerticalFrames) + { + StoredTexture = storedTexture; + Position = position; + StoredPosition = storedPosition; + Velocity = velocity; + Scale = scale; + DrawColor = drawColor; + Rotation = rotation; + Opacity = opacity; + Depth = depth; + Lifetime = lifetime; + FrameX = frameX; + FrameY = frameY; + MaxHorizontalFrames = maxHorizontalFrames; + MaxVerticalFrames = maxVerticalFrames; + + Time = 0; + ExtraData = new float[8]; + } + } +} diff --git a/Systems/Graphic/TempParticleSystem/TempParticleManager.cs b/Systems/Graphic/TempParticleSystem/TempParticleManager.cs new file mode 100644 index 0000000000..3a63fabf46 --- /dev/null +++ b/Systems/Graphic/TempParticleSystem/TempParticleManager.cs @@ -0,0 +1,152 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using ReLogic.Threading; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Graphic.TempParticleSystem +{ + public class TempParticleManager + { + public delegate void ParticleUpdateFunctionDelegate(TempParticle tempParticle); + + public delegate void ParticleDrawFunctionDelegate(TempParticle tempParticle, SpriteBatch spriteBatch, Vector2 drawOffset); + + public List ActiveParticles; + + public Queue ParticlePool; + + public int MaxParticles; + + public Asset BaseParticleTexture; + + public ParticleUpdateFunctionDelegate ParticleUpdateFunction; + + public ParticleDrawFunctionDelegate ParticleDrawingOverride; + + /// + /// A temporary particle handler made for the typically short-term creation and manipulation of particle effects done by instances of a generic particle object . + ///
Should typically be used in areas where is less practical or cannot work at all.
+ ///
+ /// The maximum amount of particles that can exist at a time in this manager. + /// The base texture that particles spawned by this manager will use when drawn. + /// An additional update function to control how particles spawned by this manager are updated. + /// Set this parameter to override how particles spawned by this manager are drawn. + public TempParticleManager(int maxParticles, string baseParticleTexturePath, ParticleUpdateFunctionDelegate particleUpdateFunction = null, ParticleDrawFunctionDelegate particleDrawingOverride = null) + { + MaxParticles = maxParticles; + BaseParticleTexture = ModContent.Request(baseParticleTexturePath); + ParticleUpdateFunction = particleUpdateFunction; + ParticleDrawingOverride = particleDrawingOverride; + + ActiveParticles = []; + if (ParticlePool is null) + { + ParticlePool = []; + for (int i = 0; i < maxParticles; i++) + ParticlePool.Enqueue(new TempParticle()); + } + } + + /// + /// Spawns a instance attached to a . + /// + /// The initial spawn position of this particle. + /// The initial velocity of this particle. + /// The initial scale of this particle. + /// The base color this particle is drawn in. + /// The maximum amount of time this particle can be alive for. + /// The initial rotation of this particle. + /// The initial opacity of this particle. + /// The depth at which this particle appears. Should only be used in cases where particles need to be drawn in the foreground or background. + /// The initial X-frame of this particle on its spritesheet. + /// The initial Y-frame of this particle on its spritesheet. + /// The maximum amount of horizontal frames this particle has on its spritesheet. + /// The maximum amount of horizontal frames this particle has on its spritesheet. + /// An optional position which can be stored for this particle to attach to. + public void SpawnParticle(Vector2 position, Vector2 velocity, Vector2 scale, Color drawColor, int lifetime, float rotation = 0f, float opacity = 1f, float depth = 0f, int frameX = 0, int frameY = 0, int maxHorizontalFrames = 0, int maxVerticalFrames = 0, Vector2? storedPosition = null) + { + if (ActiveParticles.Count >= MaxParticles || ActiveParticles.Count >= CalamityClientConfig.Instance.ParticleLimit) + return; + + if (ParticlePool.Count > 0) + { + TempParticle pooledParticle = ParticlePool.Dequeue(); + pooledParticle.SetBasicParticleData(BaseParticleTexture, position, storedPosition ?? Vector2.Zero, velocity, scale, drawColor, rotation, opacity, depth, lifetime, frameX, frameY, maxHorizontalFrames, maxVerticalFrames); + ActiveParticles.Add(pooledParticle); + } + } + + public void SpawnParticle(Vector2 position, Vector2 velocity, float scale, Color drawColor, int lifetime, float rotation = 0f, float opacity = 1f, float depth = 0f, int frameX = 0, int frameY = 0, int maxHorizontalFrames = 0, int maxVerticalFrames = 0, Vector2? storedPosition = null) + { + if (ActiveParticles.Count >= MaxParticles || ActiveParticles.Count >= CalamityClientConfig.Instance.ParticleLimit) + return; + + if (ParticlePool.Count > 0) + { + TempParticle pooledParticle = ParticlePool.Dequeue(); + pooledParticle.SetBasicParticleData(BaseParticleTexture, position, storedPosition ?? Vector2.Zero, velocity, new(scale), drawColor, rotation, opacity, depth, lifetime, frameX, frameY, maxHorizontalFrames, maxVerticalFrames); + ActiveParticles.Add(pooledParticle); + } + } + + /// + /// Updates all active particles attached to this + /// + public void Update() + { + FastParallel.For(0, MaxParticles, (start, end, context) => + { + for (int i = start; i < end; i++) + { + ActiveParticles[i].Time++; + ActiveParticles[i].Position += ActiveParticles[i].Velocity; + ParticleUpdateFunction.Invoke(ActiveParticles[i]); + } + }); + + // Return the particle to the pool upon death. + ActiveParticles.RemoveAll(p => + { + if (p.Time >= p.Lifetime) + { + ParticlePool.Enqueue(p); + return true; + } + return false; + }); + } + + /// + /// Draws all active particles attached to this + /// + /// + /// Note you will need to start the spritebatch manually before calling this. + /// + public void DrawAllParticles(SpriteBatch spriteBatch, Vector2? baseOffset = null) + { + Vector2 drawOffset = baseOffset ?? -Main.screenPosition; + + if (ParticleDrawingOverride != null) + { + foreach (TempParticle tempParticle in ActiveParticles) + ParticleDrawingOverride.Invoke(tempParticle, spriteBatch, drawOffset); + } + else + { + foreach (TempParticle tempParticle in ActiveParticles) + { + Vector2 drawPosition = tempParticle.Position + drawOffset + tempParticle.StoredPosition; + Rectangle frame = BaseParticleTexture.Frame(tempParticle.MaxHorizontalFrames, tempParticle.MaxVerticalFrames, tempParticle.FrameX, tempParticle.FrameY); + Vector2 origin = frame.Size() * 0.5f; + + spriteBatch.Draw(BaseParticleTexture.Value, drawPosition, frame, tempParticle.DrawColor * tempParticle.Opacity, tempParticle.Rotation, origin, tempParticle.Scale, SpriteEffects.None, 0f); + } + } + } + } +} From 9c11d520d686b9cc73b2f529c4268691d870e8ea Mon Sep 17 00:00:00 2001 From: fryzahh Date: Sat, 15 Nov 2025 21:30:02 -0400 Subject: [PATCH 07/48] General cleanup and fixes * Fixed an out of bounds error caused by TempParticleManager's update loop iterating through the maximum amount of particles that can exist at once rather than the maximum amount of particles that are currently active. * Removed particleTypesByNames from GeneralParticleHandler. * Renamed "Depth" to "ParallaxStrength" in TempParticle and other associated areas. * Added Main.dedServ checks where necessary in TempParticleManager. Other general cleanup besides that. * Added the "ReturnAll" method to TempParticleManager to allow users to forcibly return all active particles in the manager to the particle pool. --- Particles/GeneralParticleHandler.cs | 19 ++-- .../TempParticleSystem/TempParticle.cs | 16 ++-- .../TempParticleSystem/TempParticleManager.cs | 89 ++++++++++++------- 3 files changed, 77 insertions(+), 47 deletions(-) diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 0e87641d04..fe209f6950 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -46,12 +46,6 @@ namespace CalamityMod.Particles ///
internal static Dictionary particleIDsByTypes; - /// - /// All types defined across all mods, identified by a string for each respective particle which follows the following format: - ///
{Particle's Home Mod's Internal Name}.{Particle's Internal Name}
- ///
- internal static Dictionary particleTypesByNames; - /// /// The individual, autoloaded textures of each particle type defined across all mods, identified by the ID of the respective particle. /// @@ -78,9 +72,6 @@ namespace CalamityMod.Particles int ID = particleIDsByTypes.Count; //Get the ID of the particle particleIDsByTypes[type] = ID; - string registrationName = string.Concat(type.FullName.AsSpan(0, type.FullName.IndexOf('.')), ".", type.Name); - particleTypesByNames[registrationName] = type; - // Flow: 2024/09/17 // 'UnintializedObject' is allowed to use here as it's only read for Texture string Property // But do NOT EVER use it's instance as they are literally Uninitialized. @@ -98,7 +89,6 @@ namespace CalamityMod.Particles public override void Load() { - particleTypesByNames = []; particleIDsByTypes = []; particleTexturesByIDs = []; @@ -114,7 +104,6 @@ namespace CalamityMod.Particles public override void Unload() { - particleTypesByNames = null; particleIDsByTypes = null; particleTexturesByIDs = null; @@ -172,6 +161,8 @@ namespace CalamityMod.Particles /// another particle type.
///
The single frame buffer ensures the overall particle update loop isn't altered prematurely from within the loop itself.
/// + /// Set to true to force the particle being spawned to be drawn pixelated. + /// Only set this to a non-null value if you'd like to manually override the draw layer of the particle instance you are spawning. public static void QueueParticleForNextFrame(Particle particle, bool pixelate = false, GeneralDrawLayer? manualDrawLayerOverride = null) { // Don't queue particles if the game is paused. @@ -209,6 +200,9 @@ namespace CalamityMod.Particles /// public static void RemoveParticlesOfType() where T : Particle { + if (Main.dedServ || activeParticles is null || activeParticles.Count == 0) + return; + foreach (Particle particle in activeParticles) { if (particle.GetType() == typeof(T)) @@ -221,6 +215,9 @@ namespace CalamityMod.Particles /// public static void RemoveAllParticles() { + if (Main.dedServ || activeParticles is null || activeParticles.Count == 0) + return; + foreach (Particle particle in activeParticles) particlesToKill.Add(particle); } diff --git a/Systems/Graphic/TempParticleSystem/TempParticle.cs b/Systems/Graphic/TempParticleSystem/TempParticle.cs index 19b747cbe7..c73b3f8027 100644 --- a/Systems/Graphic/TempParticleSystem/TempParticle.cs +++ b/Systems/Graphic/TempParticleSystem/TempParticle.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Systems.Graphic.TempParticleSystem public float Opacity; - public float Depth; + public float ParallaxStrength; public int Lifetime; @@ -43,8 +43,11 @@ namespace CalamityMod.Systems.Graphic.TempParticleSystem /// public float LifetimeCompletionRatio => MathHelper.Clamp(Time / (float)Lifetime, 0f, 1f); - public void SetBasicParticleData(Asset storedTexture, Vector2 position, Vector2 storedPosition, Vector2 velocity, Vector2 scale, Color drawColor, float rotation, float opacity, float depth, int lifetime, int frameX, int frameY, int maxHorizontalFrames, int maxVerticalFrames) + public void SetBasicParticleData(Asset storedTexture, Vector2 position, Vector2 storedPosition, Vector2 velocity, Vector2 scale, Color drawColor, float rotation, float opacity, float parallaxStrength, int lifetime, int frameX, int frameY, int maxHorizontalFrames, int maxVerticalFrames, float extraData0, float extraData1, float extraData2, float extraData3) { + Time = 0; + ExtraData = new float[4]; + StoredTexture = storedTexture; Position = position; StoredPosition = storedPosition; @@ -53,15 +56,16 @@ namespace CalamityMod.Systems.Graphic.TempParticleSystem DrawColor = drawColor; Rotation = rotation; Opacity = opacity; - Depth = depth; + ParallaxStrength = parallaxStrength; Lifetime = lifetime; FrameX = frameX; FrameY = frameY; MaxHorizontalFrames = maxHorizontalFrames; MaxVerticalFrames = maxVerticalFrames; - - Time = 0; - ExtraData = new float[8]; + ExtraData[0] = extraData0; + ExtraData[1] = extraData1; + ExtraData[2] = extraData2; + ExtraData[3] = extraData3; } } } diff --git a/Systems/Graphic/TempParticleSystem/TempParticleManager.cs b/Systems/Graphic/TempParticleSystem/TempParticleManager.cs index 3a63fabf46..495226760d 100644 --- a/Systems/Graphic/TempParticleSystem/TempParticleManager.cs +++ b/Systems/Graphic/TempParticleSystem/TempParticleManager.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -16,17 +14,17 @@ namespace CalamityMod.Systems.Graphic.TempParticleSystem public delegate void ParticleDrawFunctionDelegate(TempParticle tempParticle, SpriteBatch spriteBatch, Vector2 drawOffset); - public List ActiveParticles; + public readonly List ActiveParticles; - public Queue ParticlePool; + public readonly int MaxParticles; - public int MaxParticles; + public readonly Asset BaseParticleTexture; - public Asset BaseParticleTexture; + public readonly ParticleUpdateFunctionDelegate ParticleUpdateFunction; - public ParticleUpdateFunctionDelegate ParticleUpdateFunction; + public readonly ParticleDrawFunctionDelegate ParticleDrawingOverride; - public ParticleDrawFunctionDelegate ParticleDrawingOverride; + private readonly Queue ParticlePool; /// /// A temporary particle handler made for the typically short-term creation and manipulation of particle effects done by instances of a generic particle object . @@ -38,6 +36,9 @@ namespace CalamityMod.Systems.Graphic.TempParticleSystem /// Set this parameter to override how particles spawned by this manager are drawn. public TempParticleManager(int maxParticles, string baseParticleTexturePath, ParticleUpdateFunctionDelegate particleUpdateFunction = null, ParticleDrawFunctionDelegate particleDrawingOverride = null) { + if (Main.dedServ) + return; + MaxParticles = maxParticles; BaseParticleTexture = ModContent.Request(baseParticleTexturePath); ParticleUpdateFunction = particleUpdateFunction; @@ -54,6 +55,7 @@ namespace CalamityMod.Systems.Graphic.TempParticleSystem /// /// Spawns a instance attached to a . + ///
The "extraData" parameters exist so that you can store any additional data for this manager's particles in up to four additional slots.
///
/// The initial spawn position of this particle. /// The initial velocity of this particle. @@ -62,44 +64,54 @@ namespace CalamityMod.Systems.Graphic.TempParticleSystem /// The maximum amount of time this particle can be alive for. /// The initial rotation of this particle. /// The initial opacity of this particle. - /// The depth at which this particle appears. Should only be used in cases where particles need to be drawn in the foreground or background. + /// The depth at which this particle appears. Should only be used in cases where particles need to be drawn in the foreground or background. /// The initial X-frame of this particle on its spritesheet. /// The initial Y-frame of this particle on its spritesheet. /// The maximum amount of horizontal frames this particle has on its spritesheet. /// The maximum amount of horizontal frames this particle has on its spritesheet. /// An optional position which can be stored for this particle to attach to. - public void SpawnParticle(Vector2 position, Vector2 velocity, Vector2 scale, Color drawColor, int lifetime, float rotation = 0f, float opacity = 1f, float depth = 0f, int frameX = 0, int frameY = 0, int maxHorizontalFrames = 0, int maxVerticalFrames = 0, Vector2? storedPosition = null) + public void SpawnParticle(Vector2 position, Vector2 velocity, Vector2 scale, Color drawColor, int lifetime, float rotation = 0f, float opacity = 1f, float parallaxStrength = 0f, int frameX = 0, int frameY = 0, int maxHorizontalFrames = 1, int maxVerticalFrames = 1, float extraData0 = 0f, float extraData1 = 0f, float extraData2 = 0f, float extraData3 = 0f, Vector2? storedPosition = null) { - if (ActiveParticles.Count >= MaxParticles || ActiveParticles.Count >= CalamityClientConfig.Instance.ParticleLimit) + if (ActiveParticles.Count >= MaxParticles || ActiveParticles.Count >= CalamityClientConfig.Instance.ParticleLimit || Main.dedServ) return; if (ParticlePool.Count > 0) { TempParticle pooledParticle = ParticlePool.Dequeue(); - pooledParticle.SetBasicParticleData(BaseParticleTexture, position, storedPosition ?? Vector2.Zero, velocity, scale, drawColor, rotation, opacity, depth, lifetime, frameX, frameY, maxHorizontalFrames, maxVerticalFrames); - ActiveParticles.Add(pooledParticle); - } - } - - public void SpawnParticle(Vector2 position, Vector2 velocity, float scale, Color drawColor, int lifetime, float rotation = 0f, float opacity = 1f, float depth = 0f, int frameX = 0, int frameY = 0, int maxHorizontalFrames = 0, int maxVerticalFrames = 0, Vector2? storedPosition = null) - { - if (ActiveParticles.Count >= MaxParticles || ActiveParticles.Count >= CalamityClientConfig.Instance.ParticleLimit) - return; - - if (ParticlePool.Count > 0) - { - TempParticle pooledParticle = ParticlePool.Dequeue(); - pooledParticle.SetBasicParticleData(BaseParticleTexture, position, storedPosition ?? Vector2.Zero, velocity, new(scale), drawColor, rotation, opacity, depth, lifetime, frameX, frameY, maxHorizontalFrames, maxVerticalFrames); + pooledParticle.SetBasicParticleData(BaseParticleTexture, position, storedPosition ?? Vector2.Zero, velocity, scale, drawColor, rotation, opacity, parallaxStrength, lifetime, frameX, frameY, maxHorizontalFrames, maxVerticalFrames, extraData0, extraData1, extraData2, extraData3); ActiveParticles.Add(pooledParticle); } } /// - /// Updates all active particles attached to this + /// Spawns a instance attached to a . + ///
The "extraData" parameters exist so that you can store any additional data for this manager's particles in up to four additional slots.
+ ///
+ /// The initial spawn position of this particle. + /// The initial velocity of this particle. + /// The initial scale of this particle. + /// The base color this particle is drawn in. + /// The maximum amount of time this particle can be alive for. + /// The initial rotation of this particle. + /// The initial opacity of this particle. + /// The depth at which this particle appears. Should only be used in cases where particles need to be drawn in the foreground or background. + /// The initial X-frame of this particle on its spritesheet. + /// The initial Y-frame of this particle on its spritesheet. + /// The maximum amount of horizontal frames this particle has on its spritesheet. + /// The maximum amount of horizontal frames this particle has on its spritesheet. + /// An optional position which can be stored for this particle to attach to. + public void SpawnParticle(Vector2 position, Vector2 velocity, float scale, Color drawColor, int lifetime, float rotation = 0f, float opacity = 1f, float parallaxStrength = 0f, int frameX = 0, int frameY = 0, int maxHorizontalFrames = 1, int maxVerticalFrames = 1, float extraData0 = 0f, float extraData1 = 0f, float extraData2 = 0f, float extraData3 = 0f, Vector2? storedPosition = null) + => SpawnParticle(position, velocity, new Vector2(scale), drawColor, lifetime, rotation, opacity, parallaxStrength, frameX, frameY, maxHorizontalFrames, maxVerticalFrames, extraData0, extraData1, extraData2, extraData3, storedPosition); + + /// + /// Updates all active particles attached to this . /// public void Update() { - FastParallel.For(0, MaxParticles, (start, end, context) => + if (ActiveParticles.Count == 0) + return; + + FastParallel.For(0, ActiveParticles.Count, (start, end, context) => { for (int i = start; i < end; i++) { @@ -122,15 +134,17 @@ namespace CalamityMod.Systems.Graphic.TempParticleSystem } /// - /// Draws all active particles attached to this + /// Draws all active particles attached to this . /// /// /// Note you will need to start the spritebatch manually before calling this. /// public void DrawAllParticles(SpriteBatch spriteBatch, Vector2? baseOffset = null) { - Vector2 drawOffset = baseOffset ?? -Main.screenPosition; + if (ActiveParticles.Count == 0) + return; + Vector2 drawOffset = baseOffset ?? -Main.screenPosition; if (ParticleDrawingOverride != null) { foreach (TempParticle tempParticle in ActiveParticles) @@ -148,5 +162,20 @@ namespace CalamityMod.Systems.Graphic.TempParticleSystem } } } + + /// + /// Returns all active particles back to the particle pool. + /// + public void ReturnAll() + { + if (ActiveParticles.Count == 0) + return; + + ActiveParticles.RemoveAll(p => + { + ParticlePool.Enqueue(p); + return true; + }); + } } } From 855ee59028a1675a428530c8777fb7d0bd9ea3c8 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Sat, 15 Nov 2025 21:36:02 -0400 Subject: [PATCH 08/48] Removed unnecessary documentation from Particle.cs --- Particles/Particle.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Particles/Particle.cs b/Particles/Particle.cs index 2de8391621..7e82f578cf 100644 --- a/Particles/Particle.cs +++ b/Particles/Particle.cs @@ -32,29 +32,14 @@ namespace CalamityMod.Particles ///
public Vector2 Position; - /// - /// The velocity of the particle. - /// public Vector2 Velocity; - /// - /// The point from which this particle's texture should be drawn from. - /// public Vector2 Origin; - /// - /// The color of the particle. - /// public Color Color; - /// - /// The current rotation of the particle in radians. - /// public float Rotation; - /// - /// The scale of the particle. - /// public float Scale; /// From 36b00a1c776f40b6bece39937ccf81881db2d279 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Sun, 16 Nov 2025 08:06:17 -0400 Subject: [PATCH 09/48] Particles with shaders now account for different BlendStates * particlesToDraw_CustomShader now separates particle collections based on their chosen BlendState --- Particles/GeneralParticleHandler.cs | 86 +++++++++++++++-------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index fe209f6950..4cf2323c8e 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Particles // Collections for correctly organizing active prticles for drawing. private static Dictionary> particlesToDraw; private static Dictionary> particlesToDraw_Pixelated; - private static Dictionary> particlesToDraw_CustomShader; + private static Dictionary>> particlesToDraw_CustomShader; #endregion #region Loading and Unloading @@ -151,7 +151,7 @@ namespace CalamityMod.Particles particle.DrawLayer = manualDrawLayerOverride.Value; activeParticles.Add(particle); - AddToAssociatedDrawCollection(particle); + ReturnAssociatedDrawCollection(particle).Add(particle); particle.Type = particleIDsByTypes[particle.GetType()]; } @@ -280,7 +280,7 @@ namespace CalamityMod.Particles { if ((particle.Time >= particle.Lifetime && particle.SetLifetime) || particlesToKill.Contains(particle)) { - RemoveFromAssociatedDrawCollection(particle); + ReturnAssociatedDrawCollection(particle).Remove(particle); return true; } return false; @@ -385,32 +385,56 @@ namespace CalamityMod.Particles private static void DrawParticlesWithShaders(GeneralDrawLayer drawLayer) { - foreach (var keyValuePair in particlesToDraw_CustomShader) + foreach (var shaderDrawCollectionPair in particlesToDraw_CustomShader) { - // If there's nothing to be drawn, remove the effect from the dictionary and return. - if (keyValuePair.Value.Count == 0) + foreach (var blendStateParticleListPair in shaderDrawCollectionPair.Value) { - particlesToDraw_CustomShader.Remove(keyValuePair.Key); - return; + if (blendStateParticleListPair.Value.Count == 0) + return; + + Main.spriteBatch.Begin(SpriteSortMode.Immediate, blendStateParticleListPair.Key, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullNone, shaderDrawCollectionPair.Key, Main.GameViewMatrix.TransformationMatrix); + + var particlesAtDrawLayer = blendStateParticleListPair.Value.Where(p => p.DrawLayer == drawLayer); + foreach (Particle particle in particlesAtDrawLayer) + { + particle.PrepareCustomShader(shaderDrawCollectionPair.Key); + DrawParticleInstance(particle); + } + + Main.spriteBatch.End(); } - - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullNone, keyValuePair.Key, Main.GameViewMatrix.TransformationMatrix); - - var particlesAtDrawLayer = keyValuePair.Value.Where(p => p.DrawLayer == drawLayer); - foreach (Particle particle in particlesAtDrawLayer) - { - particle.PrepareCustomShader(keyValuePair.Key); - DrawParticleInstance(particle); - } - - Main.spriteBatch.End(); } } private static List ReturnAssociatedDrawCollection(Particle particle) { + // Particles with custom shaders. + if (particle.CustomShader != null) + { + if (!particlesToDraw_CustomShader.ContainsKey(particle.CustomShader)) + particlesToDraw_CustomShader[particle.CustomShader] = []; + + if (particle.UseAdditiveBlend) + { + if (!particlesToDraw_CustomShader[particle.CustomShader].ContainsKey(BlendState.Additive)) + particlesToDraw_CustomShader[particle.CustomShader][BlendState.Additive] = []; + return particlesToDraw_CustomShader[particle.CustomShader][BlendState.Additive]; + } + else if (particle.UseHalfTransparency) + { + if (!particlesToDraw_CustomShader[particle.CustomShader].ContainsKey(BlendState.NonPremultiplied)) + particlesToDraw_CustomShader[particle.CustomShader][BlendState.NonPremultiplied] = []; + return particlesToDraw_CustomShader[particle.CustomShader][BlendState.NonPremultiplied]; + } + else + { + if (!particlesToDraw_CustomShader[particle.CustomShader].ContainsKey(BlendState.AlphaBlend)) + particlesToDraw_CustomShader[particle.CustomShader][BlendState.AlphaBlend] = []; + return particlesToDraw_CustomShader[particle.CustomShader][BlendState.AlphaBlend]; + } + } // Pixelated particles. - if (particle.Pixelate) + else if (particle.Pixelate) { if (particle.UseAdditiveBlend) { @@ -454,27 +478,5 @@ namespace CalamityMod.Particles } } } - - private static void AddToAssociatedDrawCollection(Particle particle) - { - if (particle.CustomShader != null) - { - if (!particlesToDraw_CustomShader.ContainsKey(particle.CustomShader)) - particlesToDraw_CustomShader[particle.CustomShader] = []; - particlesToDraw_CustomShader[particle.CustomShader].Add(particle); - } - else - { - ReturnAssociatedDrawCollection(particle).Add(particle); - } - } - - private static void RemoveFromAssociatedDrawCollection(Particle particle) - { - if (particle.CustomShader != null) - particlesToDraw_CustomShader[particle.CustomShader].Remove(particle); - else - ReturnAssociatedDrawCollection(particle).Remove(particle); - } } } From 6f7a7bead78f7965491ccd7d6733de566a66ce17 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Sun, 16 Nov 2025 12:32:21 -0600 Subject: [PATCH 10/48] saros balance also fixed critter shampoo applying sometimes but not others. It doesn't apply at all currently since I'm not sure how to do it right --- Items/Weapons/Summon/SarosPossession.cs | 2 +- Projectiles/Summon/SarosAura.cs | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Summon/SarosPossession.cs b/Items/Weapons/Summon/SarosPossession.cs index a030e24c03..f765b703cd 100644 --- a/Items/Weapons/Summon/SarosPossession.cs +++ b/Items/Weapons/Summon/SarosPossession.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 44; Item.height = 48; - Item.damage = 60; + Item.damage = 66; Item.mana = 10; Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Projectiles/Summon/SarosAura.cs b/Projectiles/Summon/SarosAura.cs index f05d8c81a4..9fa4c87c29 100644 --- a/Projectiles/Summon/SarosAura.cs +++ b/Projectiles/Summon/SarosAura.cs @@ -2,9 +2,12 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using rail; using ReLogic.Content; using Terraria; +using Terraria.DataStructures; using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon @@ -153,12 +156,13 @@ namespace CalamityMod.Projectiles.Summon public static Asset circle; public override bool PreDraw(ref Color lightColor) { - //Sigil - var spTex = TextureAssets.Projectile[Type].Value; - Main.spriteBatch.Draw(spTex, Projectile.Center - Main.screenPosition, null, Color.White, Main.GlobalTimeWrappedHourly, spTex.Size() * 0.5f, 0.75f, SpriteEffects.None, 0); - //Sunlines + Main.spriteBatch.SafeBegin(SpriteSortMode.Deferred, BatchSetting.Additive, null, Main.GameViewMatrix.TransformationMatrix, () => { + //Sigil + var spTex = TextureAssets.Projectile[Type].Value; + Main.spriteBatch.Draw(spTex, Projectile.Center - Main.screenPosition, null, Color.White, Main.GlobalTimeWrappedHourly, spTex.Size() * 0.5f, 0.75f, SpriteEffects.None, 0); + //Sunlines int count = (int)((Projectile.minionSlots - 1) / 3) * 2 + 2; for (var i = 0; i < count; i++) { From 67fdbeb25a95de110fcb7960992cd5fa73d908fb Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 16 Nov 2025 13:42:56 -0500 Subject: [PATCH 11/48] SSO September-October --- .../Furniture/Paintings/AmidiasPainting.cs | 19 ++++ .../Furniture/Paintings/AmidiasPainting.png | Bin 0 -> 1488 bytes .../Mods.CalamityMod.Items.Placeables.hjson | 81 ++++++++++-------- .../Paintings/AmidiasPaintingTile.cs | 34 ++++++++ .../Paintings/AmidiasPaintingTile.png | Bin 0 -> 4884 bytes 5 files changed, 98 insertions(+), 36 deletions(-) create mode 100644 Items/Placeables/Furniture/Paintings/AmidiasPainting.cs create mode 100644 Items/Placeables/Furniture/Paintings/AmidiasPainting.png create mode 100644 Tiles/Furniture/Paintings/AmidiasPaintingTile.cs create mode 100644 Tiles/Furniture/Paintings/AmidiasPaintingTile.png diff --git a/Items/Placeables/Furniture/Paintings/AmidiasPainting.cs b/Items/Placeables/Furniture/Paintings/AmidiasPainting.cs new file mode 100644 index 0000000000..d0457c7b26 --- /dev/null +++ b/Items/Placeables/Furniture/Paintings/AmidiasPainting.cs @@ -0,0 +1,19 @@ +using CalamityMod.Tiles.Furniture.Paintings; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Furniture.Paintings +{ + public class AmidiasPainting : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.width = 52; + Item.height = 34; + Item.value = Item.sellPrice(silver: 40); + } + } +} diff --git a/Items/Placeables/Furniture/Paintings/AmidiasPainting.png b/Items/Placeables/Furniture/Paintings/AmidiasPainting.png new file mode 100644 index 0000000000000000000000000000000000000000..2d555e093f6701267b0e1078ab632c05cc287a4c GIT binary patch literal 1488 zcmV;>1uy!EP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1!YM@K~z{r)!5B% zTvr*#@z1?;=f(5lv12>2W5*>)(}q?}+NMqGrmb4BpdyG$l@L-9s}`|9ASA?sKL8{a zNC+gvhBZi~q8lpI($K1<3iLfylVUXqapJ@t$BAEN#^bqn?q%WP(EJ6N-}0PC=lsrB z&pGEgCphxuakr|%n;UK=1rwuHeCN>vIDKgulRJm8)@);=8)LXy#`R_!rF?{>mm&;9 z>=>+Iwb@3i(?xZlhya9PupJpE3F@^9manfPigMdlDg#9fL;?PBw$WGQ{(L$>SQtfE znL#q#KvW+^K8jG=eGTnKghLbKm|XZ9k~qQXea~U;z1J~#q=2kb#kGYxl4c9m!NMu% zF8CkhT+qXVyIVMYWu;HZ{pjoW<9BauA_$6z#-BrX=evj=>SF)qFg|+iB!>4^kOa?T zc*h>((l#!<`yvWMXOVQ;xc8wMoXV~sND}1UJOEe!j;K(CtcNUK!xMYkc>lsJpL1U@ zmt|>|rGiY5_2Nb^Zsb>I@~bn+TrZjH9X~pA{OC+=EUJw~4ux4Q%xd{kC10w9 zxqO(*hfyhvN@1=L<_d9=Y;EeB&E0DHJm;RiZwh}sS3{U9L17x<$Z;f53+do23cH37 zw{An!+=GG9G79xP*3MnSX8jxrm5ZnrHnH+?9rs`FrO16Rfhc4jL##*0{ z`}QOI@uyD;+vKvb2a!AaeWdFNvatz78%-2@>u9$V6ml)Z%@(rC7_veYS!EbO6d;(N zNBQ<~bl!g%(fJoZdc#V#fql`ZSZK$6LhioF8qTz)5tW9J-17sB%zOnKYcb;4( z_6fP;hbHmH;uLcE3VPK8NXMT+IWcdKu{HqA}JcX=U zMsMd7g5|5oHU5og`DFy+8&=XL9vS@v(wN3_iNF+$ZE7-9Lg4TX!Ir zAA}%}G#ErW@=c`4Jd(ys*!RG*SPH&`VzrEXIgf5TLE4Rx&b^4$B`A~+BG5r@?F0nD zHu)^>A{TCAZ~lEO_RTrBRnPtYgHgx|+pC!#?cze=d&q(fN*p0JiGU#@3+m4G^Z(c#IUPZ6Fxm`sU3q4dXzko|?ojxJAb+^7WJBdZM+cVo1g;-T_u_|?g0FxS4F&+GkkbQ%)} z2C!!`M6%k%T9U)rGXcV@=aH61wkE>QpZG1VucR2As9p$`1@6i@;_NVH_bFDMOq? zsk(-r4E+=%lQkTDatc8%!s1+rSKeB}zux{BpIu$=6LMQO#BIBVFt($<-95j!j7~Sf zV5PL(d-mcYhH7PW;~2A-mhsr(+wsx)1ylw~SZ{40%`()hWn5gmhFZCZcBhN{|NWSZ qR7*Iuu-Yf&ZXE>yY`MCn$^93(2NbgoV<^A?0000 when placed to open a UI which allows customizing the focus of the painting - to make the focus follow the cursor, again to set it - Arrow keys can also be used to manually adjust the focus point - The scroll wheel zooms the focus in and out - Hold Shift to hide the UI without closing it - 'Embrace chaos' - ''' -} - -CalamityCanvas2024: { - DisplayName: Calamity Canvas 2024 - Tooltip: - ''' - when placed to open a UI which allows customizing the focus of the painting - to make the focus follow the cursor, again to set it - Arrow keys can also be used to manually adjust the focus point - The scroll wheel zooms the focus in and out - Hold Shift to hide the UI without closing it - 'Embrace havoc' - ''' -} - AquaticScourgeRelic: { DisplayName: Aquatic Scourge Relic Tooltip: A glimpse into what could have been... @@ -771,16 +745,6 @@ CrimsonEffigy: { ''' } -ThankYouPainting: { - DisplayName: Thank You - Tooltip: - ''' - Thanks to the entire team, everyone who supported, and those who all play the mod and keep it alive! - The confines of this painting is not enough to fit the entire team - Hold Shift to see a list of past and current developers - ''' -} - EffigyOfDecay: { DisplayName: Effigy of Decay Tooltip: @@ -901,6 +865,51 @@ NavyPrismTorch: { Tooltip: Can be placed in water } +AmidiasPainting: { + DisplayName: Sea King's Release + Tooltip: + ''' + 'O. Rios' + 'September-October!' + ''' +} + +CalamityCanvas2023: { + DisplayName: Calamity Canvas 2023 + Tooltip: + ''' + when placed to open a UI which allows customizing the focus of the painting + to make the focus follow the cursor, again to set it + Arrow keys can also be used to manually adjust the focus point + The scroll wheel zooms the focus in and out + Hold Shift to hide the UI without closing it + 'Embrace chaos' + ''' +} + +CalamityCanvas2024: { + DisplayName: Calamity Canvas 2024 + Tooltip: + ''' + when placed to open a UI which allows customizing the focus of the painting + to make the focus follow the cursor, again to set it + Arrow keys can also be used to manually adjust the focus point + The scroll wheel zooms the focus in and out + Hold Shift to hide the UI without closing it + 'Embrace havoc' + ''' +} + +ThankYouPainting: { + DisplayName: Thank You + Tooltip: + ''' + Thanks to the entire team, everyone who supported, and those who all play the mod and keep it alive! + The confines of this painting is not enough to fit the entire team + Hold Shift to see a list of past and current developers + ''' +} + PiggyCage: { DisplayName: Piggy Cage Tooltip: "" diff --git a/Tiles/Furniture/Paintings/AmidiasPaintingTile.cs b/Tiles/Furniture/Paintings/AmidiasPaintingTile.cs new file mode 100644 index 0000000000..cd203d22fe --- /dev/null +++ b/Tiles/Furniture/Paintings/AmidiasPaintingTile.cs @@ -0,0 +1,34 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Furniture.Paintings +{ + public class AmidiasPaintingTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileSpelunker[Type] = true; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall); + TileObjectData.newTile.Width = 6; + TileObjectData.newTile.Height = 4; + TileObjectData.newTile.Origin = new Point16(2, 2); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; + TileObjectData.newTile.LavaDeath = true; + TileObjectData.addTile(Type); + + TileID.Sets.DisableSmartCursor[Type] = true; + TileID.Sets.FramesOnKillWall[Type] = true; + TileID.Sets.DisableSmartCursor[Type] = true; + DustType = DustID.WoodFurniture; + AddMapEntry(new Color(99, 50, 30), Language.GetText("MapObject.Painting")); + } + } +} diff --git a/Tiles/Furniture/Paintings/AmidiasPaintingTile.png b/Tiles/Furniture/Paintings/AmidiasPaintingTile.png new file mode 100644 index 0000000000000000000000000000000000000000..b2f4c1b913103653c36aeb22bdde3ee0da858fad GIT binary patch literal 4884 zcmV+v6YK1WP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D5~)citxcOWG)=mfmbMlwMUhoxaUEm?fnhiYm{CLo2Vqo19Dx~R6xoEM zqR67SfZ$Qt%2H?%D72)dY11@I)6yi}l4iNd-Jbd5`@U)Owjl+XbLI~Bd(J&?-tG53 zH~05_e(Q6uSv+TwPaImXxZ8^ zV&6aSAHVIdZyA6S=S;8w^QKlD^g18GIQ8uQiD4!7@g z{aA8+4ff@Xc3trKLAgOWqun38&qt66!SVPQYaBj;;|XF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nu`rDAe^rMH$hrg*MzNO4I~k#1Z29W{q9{P!jc(7V~o1@2X5 z#fO{FTHT@fTE`V`P)~e%ycp8_kQN))T-9v>PHwvrfJ;x;O!LtF>Q!HIf*AkNQ#5n9 z;gM^3D;B9|Vt4BgEx^-{s`qbwT$z-Nw;JUy_vyQya-FhSjxp;|7k%Yg0FIw01}vB( z2JGD>O|ARbg9c#rut&GCzGE7y1Q=T$#S?0DV37xvSbCvVaB>@EJRzKw$j=!GDhxe^s zw%qF%OiE5>yw*)&B&X#k(+$8WbB?kA$IX%#TQ^?}TynCqGV4~#<{W*h-d_;IjB5Or z1?b+PVRf$Y`vHZo+@UOft{#=;7}G|Lh3z~041h1^z2bu|r)q+1T`rEwa*WET;BQ*^ z*uU3|gZ!Gy{+ajv;olcL?;jsaPVl+G^Zt0BZP;Ph@3%05&kf4)5tJAFO^x7vWBs3e zjP`3lK?LRGyuK{O0bbu&8aS5b1vMkM?<4q}(d76D-tS{9IX*@kM-V}V2j%z(K6kYL zQ*b<^UFRcsKF6pm!!V=XD-PAG84Ec%BjJ02K5~r868sPTu2g|h5kT?)0000 Date: Sun, 16 Nov 2025 14:55:22 -0500 Subject: [PATCH 12/48] Fixed compiler errors from graphic branch merge --- Projectiles/Summon/SarosEclipseBeam.cs | 3 ++- Projectiles/Summon/SarosSunfire.cs | 3 ++- Projectiles/Summon/SunSpiritBeam.cs | 3 ++- Projectiles/Summon/VengefulSunBeam.cs | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Projectiles/Summon/SarosEclipseBeam.cs b/Projectiles/Summon/SarosEclipseBeam.cs index 5e4fa5edea..3daab84071 100644 --- a/Projectiles/Summon/SarosEclipseBeam.cs +++ b/Projectiles/Summon/SarosEclipseBeam.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using CalamityMod.Graphics.Primitives; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -103,7 +104,7 @@ namespace CalamityMod.Projectiles.Summon return Color.Black * MathF.Pow(1 - completion, 0.5f); } - public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer) + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) { List posList = []; //For the prim to render properly I need to divide the distance between the positions into a couple points. Just using start and end doesn't render. diff --git a/Projectiles/Summon/SarosSunfire.cs b/Projectiles/Summon/SarosSunfire.cs index 3965be9cca..082e53b32a 100644 --- a/Projectiles/Summon/SarosSunfire.cs +++ b/Projectiles/Summon/SarosSunfire.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using CalamityMod.Enums; using CalamityMod.Graphics.Primitives; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -171,7 +172,7 @@ namespace CalamityMod.Projectiles.Summon return mainColor; } - public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer) + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) { //Flame body GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); diff --git a/Projectiles/Summon/SunSpiritBeam.cs b/Projectiles/Summon/SunSpiritBeam.cs index 5f7394ccd6..f94a544ac7 100644 --- a/Projectiles/Summon/SunSpiritBeam.cs +++ b/Projectiles/Summon/SunSpiritBeam.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Enums; using CalamityMod.Graphics.Primitives; using CalamityMod.Particles; using Microsoft.Xna.Framework; @@ -118,7 +119,7 @@ namespace CalamityMod.Projectiles.Summon return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; } - public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer) + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) { GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(FireWidthFunction, FireColorFunction, (_) => Projectile.Size * 0.5f, true, true, GameShaders.Misc["CalamityMod:ImpFlameTrail"]), Projectile.oldPos.Length + 32); diff --git a/Projectiles/Summon/VengefulSunBeam.cs b/Projectiles/Summon/VengefulSunBeam.cs index dd8c925f13..22d49d0e69 100644 --- a/Projectiles/Summon/VengefulSunBeam.cs +++ b/Projectiles/Summon/VengefulSunBeam.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Enums; using CalamityMod.Graphics.Primitives; using CalamityMod.Particles; using Microsoft.Xna.Framework; @@ -156,7 +157,7 @@ namespace CalamityMod.Projectiles.Summon return fullBodyColor; } - public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer) + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) { GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(FireWidthFunction, FireColorFunction, (_) => Projectile.Size * 0.5f, true, true, GameShaders.Misc["CalamityMod:ImpFlameTrail"]), Projectile.oldPos.Length + 32); From 0e422de13af7915f5a9bb3ba09f991fa4e07e45b Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 13 Nov 2025 16:49:16 -0500 Subject: [PATCH 13/48] Restrict Hognar to Black Cats and Silver Cats --- NPCs/CalamityGlobalTownNPC.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index e76d91bf1a..b3d8b52b76 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -351,13 +351,13 @@ namespace CalamityMod.NPCs "Lucerne", // <@!271954788676141066> (lord_lucerne) "Milo", // <@!401849201597874179> (maskedmilo) "Octo", // <@!796112889353994281> (octolinggrimm) - "Hognar the Wicked", // <@!766511001356468237> (xzier_tengal) }; private static readonly string[] TownCatSiameseNames = null; private static readonly string[] TownCatBlackNames = { "Bear", // <@!183424826407518208> (lilac_vrt_olligoci) "Storm", // <@!620383533516718085> (airwaveslr) + "Hognar the Wicked", // <@!766511001356468237> (xzier_tengal) }; private static readonly string[] TownCatOrangeTabbyNames = { @@ -370,6 +370,7 @@ namespace CalamityMod.NPCs private static readonly string[] TownCatSilverNames = { "Archie", // <@!303022375191183360> (jackshiz) + "Hognar the Wicked", // <@!766511001356468237> (xzier_tengal) }; private static readonly string[] TownCatWhiteNames = null; From e97d31cd20284c09881f7afad11f7afc2af59afb Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 16 Nov 2025 16:38:16 -0500 Subject: [PATCH 14/48] Expert items are now Expert exclusive again following overwhelming dev vote 1. The following items are no longer available in Classic: Royal Gel, Shield of Cthulhu, Worm Scarf, Brain of Confusion, Bone Helm, Hive Backpack, Bone Glove, Volatile Gelatin, Mechanical Cart pieces, Spore Sac, Shiny Stone, Shrimpy Truffle, Soaring Insignia, Gravity Globe, Suspicious Looking Tentacle, Celestial Starboard 2. The following items are no longer available in Classic: Ocean Crest, Fungal Clump, Rotten Brain, Bloody Worm Tooth, Mana Polarizer, Soul of Cryogen, Aquatic Emblem, Flame-Licked Shell, Void of Calamity, Interstellar Stompers, Leviathan Ambergris, Toxic Heart, Blood Pact, Hide of Astrum Deus, Dynamo Stem Cells, Warbanner of the Righteous, Blazing Core, Arc Flash Ring, The Evolution, Spectral Veil, Affliction, Old Duke's Scales, Nebulous Core, Yharim's Gift, Calamity (item), Draedon's Heart 3. Fixed an issue where Thank You dropped twice from Eater of Worlds. --- NPCs/AquaticScourge/AquaticScourgeHead.cs | 3 +- NPCs/AstrumAureus/AstrumAureus.cs | 3 +- NPCs/AstrumDeus/AstrumDeusHead.cs | 3 +- NPCs/BrimstoneElemental/BrimstoneElemental.cs | 3 +- NPCs/Bumblebirb/Dragonfolly.cs | 3 +- NPCs/CalClone/CalamitasClone.cs | 3 +- NPCs/CalamityGlobalNPCLoot.cs | 79 ++++++++++--------- NPCs/CeaselessVoid/CeaselessVoid.cs | 3 +- NPCs/Crabulon/Crabulon.cs | 3 +- NPCs/Cryogen/Cryogen.cs | 3 +- NPCs/DesertScourge/DesertScourgeHead.cs | 3 +- NPCs/DevourerofGods/DevourerofGodsHead.cs | 3 +- NPCs/ExoMechs/Ares/AresBody.cs | 3 +- NPCs/HiveMind/HiveMind.cs | 3 +- NPCs/Leviathan/Leviathan.cs | 3 +- NPCs/OldDuke/OldDuke.cs | 3 +- NPCs/Perforator/PerforatorHive.cs | 3 +- .../PlaguebringerGoliath.cs | 3 +- NPCs/Polterghast/Polterghast.cs | 3 +- .../ProfanedGuardianCommander.cs | 10 ++- NPCs/Providence/Providence.cs | 3 +- NPCs/Ravager/RavagerBody.cs | 3 +- NPCs/Signus/Signus.cs | 3 +- NPCs/SlimeGod/SlimeGodCore.cs | 3 +- NPCs/StormWeaver/StormWeaverHead.cs | 3 +- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 3 +- NPCs/Yharon/Yharon.cs | 3 +- 27 files changed, 98 insertions(+), 66 deletions(-) diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 90ef06dcaa..883e0fb931 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -689,7 +689,8 @@ namespace CalamityMod.NPCs.AquaticScourge normalOnly.Add(ModContent.ItemType(), ThankYouPainting.DropInt); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); normalOnly.Add(ModContent.ItemType(), 10); } diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index b7ed5d4d8b..a4693e2652 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -1309,7 +1309,8 @@ namespace CalamityMod.NPCs.AstrumAureus normalOnly.Add(ModContent.ItemType(), ThankYouPainting.DropInt); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Other normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 9, 12)); diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index e6a3b2f9fb..b9ab4e8182 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -974,7 +974,8 @@ namespace CalamityMod.NPCs.AstrumDeus normalOnly.Add(ModContent.ItemType(), ThankYouPainting.DropInt); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(ModContent.ItemType(), 5); // Materials diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index d98501fe87..35a898ecc0 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -897,7 +897,8 @@ namespace CalamityMod.NPCs.BrimstoneElemental ModContent.ItemType(), }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, accs)); - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Vanity normalOnly.Add(ModContent.ItemType(), 7); diff --git a/NPCs/Bumblebirb/Dragonfolly.cs b/NPCs/Bumblebirb/Dragonfolly.cs index b706d67a21..b9a6da5101 100644 --- a/NPCs/Bumblebirb/Dragonfolly.cs +++ b/NPCs/Bumblebirb/Dragonfolly.cs @@ -1248,7 +1248,8 @@ namespace CalamityMod.NPCs.Bumblebirb normalOnly.Add(ModContent.ItemType(), 1, 25, 30); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); // Vanity diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index 6f8ba0ac36..6e90520411 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -1036,7 +1036,8 @@ namespace CalamityMod.NPCs.CalClone normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, items)); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 4f0390cbe5..011d9d01e1 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1127,8 +1127,8 @@ namespace CalamityMod.NPCs }; npcLoot.Add(new DropOneByOne(ItemID.Gel, kingSlimeGelSpray)); - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.RoyalGel)); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.RoyalGel)); // Would be in the bag otherwise npcLoot.AddNormalOnly(ItemDropRule.ByCondition(DropHelper.Remix, ItemID.Keybrand, DropHelper.NormalWeaponDropRateInt)); @@ -1149,8 +1149,8 @@ namespace CalamityMod.NPCs break; case NPCID.EyeofCthulhu: - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.EoCShield)); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.EoCShield)); // Would be in the bag otherwise npcLoot.AddNormalOnly(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); @@ -1171,15 +1171,12 @@ namespace CalamityMod.NPCs case NPCID.EaterofWorldsHead: case NPCID.EaterofWorldsBody: case NPCID.EaterofWorldsTail: - // Expert+ drops are also available on Normal. Drop what would be in the bag otherwise + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic LeadingConditionRule EoWKill = new(DropHelper.If((info) => info.npc.boss)); - EoWKill.Add(DropHelper.PerPlayer(ItemID.WormScarf)); + // EoWKill.Add(DropHelper.PerPlayer(ItemID.WormScarf)); EoWKill.Add(ModContent.ItemType(), ThankYouPainting.DropInt); npcLoot.AddNormalOnly(EoWKill); - // Would be in the bag otherwise - npcLoot.AddIf((info) => info.npc.boss, ModContent.ItemType(), ThankYouPainting.DropInt); - // Master items drop in Revengeance rev.AddIf((info) => info.npc.boss, ItemID.EaterofWorldsMasterTrophy); rev.AddIf((info) => info.npc.boss, ItemID.EaterOfWorldsPetItem, 4); @@ -1203,8 +1200,8 @@ namespace CalamityMod.NPCs break; case NPCID.BrainofCthulhu: - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.BrainOfConfusion)); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.BrainOfConfusion)); // Would be in the bag otherwise npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); @@ -1253,8 +1250,8 @@ namespace CalamityMod.NPCs } catch (ArgumentNullException) { } - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.BoneHelm)); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.BoneHelm)); // Would be in the bag otherwise npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); @@ -1276,8 +1273,9 @@ namespace CalamityMod.NPCs // Define a replacement rule which drops the weapons Calamity style. npcLoot.AddNormalOnly(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, ItemID.BeeKeeper, ItemID.BeesKnees, ItemID.BeeGun, ModContent.ItemType())); - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.HiveBackpack)); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.HiveBackpack)); + npcLoot.AddNormalOnly(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); // Would be in the bag otherwise @@ -1311,8 +1309,8 @@ namespace CalamityMod.NPCs }; npcLoot.Add(new DropOneByOne(ItemID.Bone, skeletronBoneSpray)); - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.BoneGlove)); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.BoneGlove)); // Would be in the bag otherwise npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); @@ -1411,12 +1409,12 @@ namespace CalamityMod.NPCs break; case NPCID.QueenSlimeBoss: - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.VolatileGelatin)); - npcLoot.AddNormalOnly(ItemID.SoulofLight, 1, 15, 20); - npcLoot.AddNormalOnly(ItemID.PinkGel, 1, 15, 20); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.VolatileGelatin)); // Would be in the bag otherwise + npcLoot.AddNormalOnly(ItemID.SoulofLight, 1, 15, 20); + npcLoot.AddNormalOnly(ItemID.PinkGel, 1, 15, 20); npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); // Master items drop in Revengeance @@ -1438,8 +1436,8 @@ namespace CalamityMod.NPCs // Define a replacement rule which respects the Early Hardmode Progression Rework. npcLoot.AddNormalOnly(ItemDropRule.ByCondition(DropHelper.HallowedBarsCondition, ItemID.HallowedBar, 1, 15, 30)); - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.MechanicalWagonPiece)); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.MechanicalWagonPiece)); // Would be in the bag otherwise npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); @@ -1479,8 +1477,9 @@ namespace CalamityMod.NPCs } catch (ArgumentNullException) { } - // Expert+ drops are also available on Normal. These are done manually due to Last Twin Standing. - npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ItemID.MechanicalWheelPiece); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // These are done manually due to Last Twin Standing. + // npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ItemID.MechanicalWheelPiece); // Would be in the bag otherwise npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ModContent.ItemType(), ThankYouPainting.DropInt); @@ -1506,8 +1505,8 @@ namespace CalamityMod.NPCs // Define a replacement rule which respects the Early Hardmode Progression Rework. npcLoot.AddNormalOnly(ItemDropRule.ByCondition(DropHelper.HallowedBarsCondition, ItemID.HallowedBar, 1, 15, 30)); - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.MechanicalBatteryPiece)); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.MechanicalBatteryPiece)); // Would be in the bag otherwise npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); @@ -1564,8 +1563,8 @@ namespace CalamityMod.NPCs } catch (ArgumentNullException) { } - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.SporeSac)); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.SporeSac)); // Would be in the bag otherwise npcLoot.AddNormalOnly(ModContent.ItemType(), 10); @@ -1617,9 +1616,10 @@ namespace CalamityMod.NPCs } catch (ArgumentNullException) { } - // Expert+ drops are also available on Normal var normalOnly = npcLoot.DefineNormalOnlyDropSet(); - normalOnly.Add(DropHelper.PerPlayer(ItemID.ShinyStone)); + + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // normalOnly.Add(DropHelper.PerPlayer(ItemID.ShinyStone)); // Would be in the bag otherwise normalOnly.Add(ModContent.ItemType(), 1, 8, 10); @@ -1714,8 +1714,8 @@ namespace CalamityMod.NPCs catch (ArgumentNullException) { } DukeEditFailed: - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.ShrimpyTruffle)); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.ShrimpyTruffle)); // Would be in the bag otherwise npcLoot.AddNormalOnly(ModContent.ItemType(), 10); @@ -1788,8 +1788,8 @@ namespace CalamityMod.NPCs } catch (ArgumentNullException) { } - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.EmpressFlightBooster)); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.EmpressFlightBooster)); // Would be in the bag otherwise npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); @@ -1851,12 +1851,13 @@ namespace CalamityMod.NPCs } catch (ArgumentNullException) { } - // Expert+ drops are also available on Normal - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.GravityGlobe)); - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.SuspiciousLookingTentacle)); - npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.LongRainbowTrailWings)); + // 16NOV2025: Ozzatron: following overwhelming dev vote, Expert+ drops are NOT available in Classic + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.GravityGlobe)); + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.SuspiciousLookingTentacle)); + // npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.LongRainbowTrailWings)); // Would be in the bag otherwise + // 16NOV2025: Ozzatron (executive decision): Celestial Onion remains available as a 6th slot in Classic. npcLoot.AddNormalOnly(DropHelper.PerPlayer(ModContent.ItemType())); npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 7f21657f82..3f22fc8e57 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -764,7 +764,8 @@ namespace CalamityMod.NPCs.CeaselessVoid normalOnly.Add(DropHelper.PerPlayer(ItemType(), 1, 10, 12)); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ItemType())); // Vanity normalOnly.Add(ItemType(), 7); diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index 0e5f0a6128..41158c61b7 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -1185,7 +1185,8 @@ namespace CalamityMod.NPCs.Crabulon normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Vanity normalOnly.Add(ModContent.ItemType(), 7); diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index d061adf8e5..63ce720037 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -1381,7 +1381,8 @@ namespace CalamityMod.NPCs.Cryogen normalOnly.Add(ModContent.ItemType(), 1, 8, 10); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); } diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 4bbc6757cd..8d50de290d 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -995,7 +995,8 @@ namespace CalamityMod.NPCs.DesertScourge normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 25, 30)); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index dea7b7c164..e039bf5035 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -2570,7 +2570,8 @@ namespace CalamityMod.NPCs.DevourerofGods normalOnly.Add(ModContent.ItemType(), 1, 150, 250); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); } // Relic diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index b0b3000a31..34d62e6a3e 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -1650,7 +1650,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Equipment normalOnly.Add(ModContent.ItemType()); - normalOnly.Add(ModContent.ItemType()); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(ModContent.ItemType()); // Vanity // Higher chance due to how the drops work diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 9d61e78cf9..16e9d8986b 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -1350,7 +1350,8 @@ namespace CalamityMod.NPCs.HiveMind // Equipment normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Vanity normalOnly.Add(ModContent.ItemType(), 7); diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index b35a1dbe4b..8e51696358 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -867,7 +867,8 @@ namespace CalamityMod.NPCs.Leviathan normalOnly.Add(ModContent.ItemType(), ThankYouPainting.DropInt); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); normalOnly.Add(ModContent.ItemType(), 10); } diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 038a7dd847..4ba61aec24 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -2098,7 +2098,8 @@ namespace CalamityMod.NPCs.OldDuke normalOnly.Add(ModContent.ItemType(), 10); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Vanity normalOnly.Add(ModContent.ItemType(), 7); diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 30856c4c53..de4c592c7f 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -686,7 +686,8 @@ namespace CalamityMod.NPCs.Perforator // Equipment normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Vanity normalOnly.Add(ModContent.ItemType(), 7); diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 5056b4f28b..3c1ddadae8 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -1354,7 +1354,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 30, 40)); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Vanity normalOnly.Add(ModContent.ItemType(), 7); diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index b9c2689631..3b5e659e2b 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -992,7 +992,8 @@ namespace CalamityMod.NPCs.Polterghast normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Materials normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 20, 25)); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 74d2195fcc..9d1b8fc89c 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -23,7 +23,7 @@ using Terraria; using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; -using Terraria.Graphics.Effects; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Filters = Terraria.Graphics.Effects.Filters; @@ -1199,7 +1199,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians { npcLoot.Add(ModContent.ItemType(), 4); npcLoot.Add(ModContent.ItemType(), 7); - npcLoot.Add(ModContent.ItemType(), 4); + + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // npcLoot.Add(ModContent.ItemType(), 4); + LeadingConditionRule expert = npcLoot.DefineConditionalDropSet(new Conditions.IsExpert()); + expert.Add(ModContent.ItemType(), 4); + npcLoot.Add(expert); + npcLoot.Add(ModContent.ItemType(), 10); npcLoot.Add(ModContent.ItemType()); npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 15, 20, 20, 25)); diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index fe971ce389..5794954d51 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -2028,7 +2028,8 @@ namespace CalamityMod.NPCs.Providence normalOnly.Add(ModContent.ItemType(), 10); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Materials normalOnly.Add(ModContent.ItemType(), 1, 50, 60); diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 6eea24650b..bd7552cf28 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -1014,7 +1014,8 @@ namespace CalamityMod.NPCs.Ravager normalOnly.Add(ItemDropRule.ByCondition(DropHelper.If(() => DownedBossSystem.downedProvidence), ModContent.ItemType()), hideLootReport: !DownedBossSystem.downedProvidence); // Equipment - normalOnly.Add(ModContent.ItemType(), 3); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(ModContent.ItemType(), 3); normalOnly.Add(ModContent.ItemType(), 3); normalOnly.Add(ItemDropRule.ByCondition(DropHelper.PostProv(), ModContent.ItemType())); diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 1b1c79e4a6..21b8a4b2bf 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -924,7 +924,8 @@ namespace CalamityMod.NPCs.Signus normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 10, 12)); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Vanity normalOnly.Add(ModContent.ItemType(), 7); diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 36c88d757b..a63f26c58d 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -754,7 +754,8 @@ namespace CalamityMod.NPCs.SlimeGod normalOnly.Add(ModContent.ItemType(), ThankYouPainting.DropInt); // Equipment - normalOnly.Add(ModContent.ItemType()); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(ModContent.ItemType()); } npcLoot.Add(ModContent.ItemType(), 10); diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 89ec7bec83..26d5966777 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -981,7 +981,8 @@ namespace CalamityMod.NPCs.StormWeaver normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Materials normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 10, 12)); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 2f169574ce..cc8becde11 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -3542,7 +3542,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 25, 30)); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // SCal vanity set (This drops all at once, or not at all) var scalVanitySet = ItemDropRule.Common(ModContent.ItemType(), 7); diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 67321609d4..b90ee34476 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2987,7 +2987,8 @@ namespace CalamityMod.NPCs.Yharon normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 35, 40)); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); } From 879e4924ae0b2c78acc972927f4c244c2e9e2393 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Sun, 16 Nov 2025 16:55:27 -0500 Subject: [PATCH 15/48] Warbanner of the Righteous is a guaranteed drop --- NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 9d1b8fc89c..fb99a5576a 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -1201,9 +1201,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians npcLoot.Add(ModContent.ItemType(), 7); // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss - // npcLoot.Add(ModContent.ItemType(), 4); + // npcLoot.Add(ModContent.ItemType(), 1); LeadingConditionRule expert = npcLoot.DefineConditionalDropSet(new Conditions.IsExpert()); - expert.Add(ModContent.ItemType(), 4); + expert.Add(ModContent.ItemType(), 1); npcLoot.Add(expert); npcLoot.Add(ModContent.ItemType(), 10); From cbd2d2c96a898a65abf65f3a25d0802162d02da9 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Sun, 16 Nov 2025 17:13:32 -0500 Subject: [PATCH 16/48] Updated Ravager bag drops to account for Blood Pact being the new Expert item Flesh Totem is now a 33/50 drop --- Items/TreasureBags/RavagerBag.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Items/TreasureBags/RavagerBag.cs b/Items/TreasureBags/RavagerBag.cs index ea20f25040..3acad9e6e1 100644 --- a/Items/TreasureBags/RavagerBag.cs +++ b/Items/TreasureBags/RavagerBag.cs @@ -76,10 +76,8 @@ namespace CalamityMod.Items.TreasureBags itemLoot.Add(ModContent.ItemType(), 20); // Equipment - itemLoot.Add(ItemDropRule.OneFromOptionsNotScalingWithLuck(1, - ModContent.ItemType(), - ModContent.ItemType() - )); + itemLoot.Add(ModContent.ItemType()); + itemLoot.Add(ModContent.ItemType(), 2); itemLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType()); itemLoot.AddRevBagAccessories(); itemLoot.AddIf((info) => CalamityWorld.revenge && !info.player.Calamity().rageBoostTwo, ModContent.ItemType()); From dd834b182c95bbcf1714566be148c6501834318e Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 16 Nov 2025 17:22:26 -0500 Subject: [PATCH 17/48] Restored Expert rarity for Expert exclusive items --- Items/Accessories/Affliction.cs | 1 + Items/Accessories/AquaticEmblem.cs | 1 + Items/Accessories/ArcFlashRing.cs | 1 + Items/Accessories/BlazingCore.cs | 1 + Items/Accessories/BloodPact.cs | 1 + Items/Accessories/BloodyWormTooth.cs | 1 + Items/Accessories/Calamity.cs | 1 + Items/Accessories/DraedonsHeart.cs | 1 + Items/Accessories/DynamoStemCells.cs | 1 + Items/Accessories/FlameLickedShell.cs | 1 + Items/Accessories/FungalClump.cs | 1 + Items/Accessories/HideofAstrumDeus.cs | 1 + Items/Accessories/InterstellarStompers.cs | 1 + Items/Accessories/LeviathanAmbergris.cs | 1 + Items/Accessories/ManaPolarizer.cs | 1 + Items/Accessories/NebulousCore.cs | 1 + Items/Accessories/OceanCrest.cs | 1 + Items/Accessories/OldDukeScales.cs | 1 + Items/Accessories/RottenBrain.cs | 1 + Items/Accessories/SpectralVeil.cs | 1 + Items/Accessories/TheEvolution.cs | 1 + Items/Accessories/ToxicHeart.cs | 1 + Items/Accessories/VoidofCalamity.cs | 1 + Items/Accessories/WarbanneroftheRighteous.cs | 1 + Items/Accessories/Wings/SoulofCryogen.cs | 1 + Items/Accessories/YharimsGift.cs | 3 ++- Items/CalamityGlobalItem.cs | 6 +++--- 27 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Items/Accessories/Affliction.cs b/Items/Accessories/Affliction.cs index be8a8b917a..443bffa212 100644 --- a/Items/Accessories/Affliction.cs +++ b/Items/Accessories/Affliction.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; Item.rare = ModContent.RarityType(); + Item.expert = true; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) diff --git a/Items/Accessories/AquaticEmblem.cs b/Items/Accessories/AquaticEmblem.cs index 7171d7c9d2..caca886525 100644 --- a/Items/Accessories/AquaticEmblem.cs +++ b/Items/Accessories/AquaticEmblem.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/ArcFlashRing.cs b/Items/Accessories/ArcFlashRing.cs index ab5618118d..3599b8c00c 100644 --- a/Items/Accessories/ArcFlashRing.cs +++ b/Items/Accessories/ArcFlashRing.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/BlazingCore.cs b/Items/Accessories/BlazingCore.cs index d77f390a86..4bdcef3fcf 100644 --- a/Items/Accessories/BlazingCore.cs +++ b/Items/Accessories/BlazingCore.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/BloodPact.cs b/Items/Accessories/BloodPact.cs index deb11f3734..739dbe82c0 100644 --- a/Items/Accessories/BloodPact.cs +++ b/Items/Accessories/BloodPact.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.Yellow; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/BloodyWormTooth.cs b/Items/Accessories/BloodyWormTooth.cs index aeb23ca680..f81bb96832 100644 --- a/Items/Accessories/BloodyWormTooth.cs +++ b/Items/Accessories/BloodyWormTooth.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/Calamity.cs b/Items/Accessories/Calamity.cs index 0b60fcda8f..14c7c7566f 100644 --- a/Items/Accessories/Calamity.cs +++ b/Items/Accessories/Calamity.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Items.Accessories Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.accessory = true; + Item.expert = true; } public override void UpdateVanity(Player player) diff --git a/Items/Accessories/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index 0177e7f04c..66d5d7aa9a 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -45,6 +45,7 @@ namespace CalamityMod.Items.Accessories Item.defense = 20; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/DynamoStemCells.cs b/Items/Accessories/DynamoStemCells.cs index 4885c220ef..730a23181a 100644 --- a/Items/Accessories/DynamoStemCells.cs +++ b/Items/Accessories/DynamoStemCells.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/FlameLickedShell.cs b/Items/Accessories/FlameLickedShell.cs index 4cf105a720..39b31a175b 100644 --- a/Items/Accessories/FlameLickedShell.cs +++ b/Items/Accessories/FlameLickedShell.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/FungalClump.cs b/Items/Accessories/FungalClump.cs index b7a5cb048e..b244204a94 100644 --- a/Items/Accessories/FungalClump.cs +++ b/Items/Accessories/FungalClump.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityGreenBuyPrice; Item.rare = ItemRarityID.Green; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/HideofAstrumDeus.cs b/Items/Accessories/HideofAstrumDeus.cs index cb4e4dba87..7185fcd33b 100644 --- a/Items/Accessories/HideofAstrumDeus.cs +++ b/Items/Accessories/HideofAstrumDeus.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityCyanBuyPrice; Item.rare = ItemRarityID.Cyan; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/InterstellarStompers.cs b/Items/Accessories/InterstellarStompers.cs index 992c2d701c..2f82b292fb 100644 --- a/Items/Accessories/InterstellarStompers.cs +++ b/Items/Accessories/InterstellarStompers.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.accessory = true; Item.rare = ItemRarityID.Lime; + Item.expert = true; } public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.GravistarSabatonHotkey); diff --git a/Items/Accessories/LeviathanAmbergris.cs b/Items/Accessories/LeviathanAmbergris.cs index 29b3f78836..9b2c6f2057 100644 --- a/Items/Accessories/LeviathanAmbergris.cs +++ b/Items/Accessories/LeviathanAmbergris.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.accessory = true; Item.rare = ItemRarityID.Lime; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/ManaPolarizer.cs b/Items/Accessories/ManaPolarizer.cs index 95e449d742..73fc472501 100644 --- a/Items/Accessories/ManaPolarizer.cs +++ b/Items/Accessories/ManaPolarizer.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/NebulousCore.cs b/Items/Accessories/NebulousCore.cs index 103e179a93..f4cea457eb 100644 --- a/Items/Accessories/NebulousCore.cs +++ b/Items/Accessories/NebulousCore.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); + Item.expert = true; } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Accessories/OceanCrest.cs b/Items/Accessories/OceanCrest.cs index 9266827683..26d97b69d3 100644 --- a/Items/Accessories/OceanCrest.cs +++ b/Items/Accessories/OceanCrest.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityGreenBuyPrice; Item.rare = ItemRarityID.Green; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/OldDukeScales.cs b/Items/Accessories/OldDukeScales.cs index 0a7355d763..cbe4f9314f 100644 --- a/Items/Accessories/OldDukeScales.cs +++ b/Items/Accessories/OldDukeScales.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; Item.rare = ModContent.RarityType(); + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/RottenBrain.cs b/Items/Accessories/RottenBrain.cs index d48784a538..01a644c84f 100644 --- a/Items/Accessories/RottenBrain.cs +++ b/Items/Accessories/RottenBrain.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/SpectralVeil.cs b/Items/Accessories/SpectralVeil.cs index c2c749190f..3cc01929cb 100644 --- a/Items/Accessories/SpectralVeil.cs +++ b/Items/Accessories/SpectralVeil.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); Item.accessory = true; + Item.expert = true; } public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.SpectralVeilHotKey); diff --git a/Items/Accessories/TheEvolution.cs b/Items/Accessories/TheEvolution.cs index 7f0dff4b8a..5b90135f40 100644 --- a/Items/Accessories/TheEvolution.cs +++ b/Items/Accessories/TheEvolution.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/ToxicHeart.cs b/Items/Accessories/ToxicHeart.cs index da800d501b..5981c7e279 100644 --- a/Items/Accessories/ToxicHeart.cs +++ b/Items/Accessories/ToxicHeart.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/VoidofCalamity.cs b/Items/Accessories/VoidofCalamity.cs index adbefc4037..0bbdbe026a 100644 --- a/Items/Accessories/VoidofCalamity.cs +++ b/Items/Accessories/VoidofCalamity.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/WarbanneroftheRighteous.cs b/Items/Accessories/WarbanneroftheRighteous.cs index a2ba0a5298..fb469a4bb3 100644 --- a/Items/Accessories/WarbanneroftheRighteous.cs +++ b/Items/Accessories/WarbanneroftheRighteous.cs @@ -42,6 +42,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index 14aedb1d51..f9f009b438 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Items.Accessories.Wings Item.height = 26; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; + Item.expert = true; } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Accessories/YharimsGift.cs b/Items/Accessories/YharimsGift.cs index 2d0096cb73..919e4a0b4c 100644 --- a/Items/Accessories/YharimsGift.cs +++ b/Items/Accessories/YharimsGift.cs @@ -18,10 +18,11 @@ namespace CalamityMod.Items.Accessories { Item.width = 20; Item.height = 22; - Item.defense = 12; // Why did this give 30 defense? This thing really needs a rework lol + Item.defense = 12; Item.accessory = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 84e7a6ee9f..fe36457f50 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -262,8 +262,8 @@ namespace CalamityMod.Items if (item.type == ItemID.Zenith) item.rare = RarityType(); - // Make most expert items no longer expert because they drop in all modes now. - switch (item.type) + // CIT 16OCT2025: Following overwhelming dev vote, Expert+ drops are NOT available in Classic + /*switch (item.type) { case ItemID.RoyalGel: case ItemID.EoCShield: @@ -288,7 +288,7 @@ namespace CalamityMod.Items case ItemID.LongRainbowTrailWings: item.expert = false; break; - } + }*/ // Allow Souls to be used as ammo for SHPC. if (item.type == ItemID.SoulofLight || item.type == ItemID.SoulofNight || item.type == ItemID.SoulofFlight || item.type == ItemID.SoulofMight || item.type == ItemID.SoulofSight || item.type == ItemID.SoulofFright) From 31f7c4b5898d9dea5d51a350747afc1753bb8364 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 16 Nov 2025 18:13:55 -0500 Subject: [PATCH 18/48] SSO September-October is obtainable --- Items/Placeables/Furniture/Paintings/AmidiasPainting.cs | 2 +- NPCs/CalamityGlobalTownNPC.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Items/Placeables/Furniture/Paintings/AmidiasPainting.cs b/Items/Placeables/Furniture/Paintings/AmidiasPainting.cs index d0457c7b26..e0225466c7 100644 --- a/Items/Placeables/Furniture/Paintings/AmidiasPainting.cs +++ b/Items/Placeables/Furniture/Paintings/AmidiasPainting.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings Item.DefaultToPlaceableTile(ModContent.TileType()); Item.width = 52; Item.height = 34; - Item.value = Item.sellPrice(silver: 40); + Item.value = Item.buyPrice(gold: 1); } } } diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index b3d8b52b76..74f80155f6 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -14,6 +14,7 @@ using CalamityMod.Items.Placeables.Astral; using CalamityMod.Items.Placeables.Crags; using CalamityMod.Items.Placeables.Furniture; using CalamityMod.Items.Placeables.Furniture.Fountains; +using CalamityMod.Items.Placeables.Furniture.Paintings; using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.SummonItems.Invasion; @@ -1236,7 +1237,8 @@ namespace CalamityMod.NPCs if (type == NPCID.Painter) { - shop.AddWithCustomValue(ItemID.PainterPaintballGun, Item.buyPrice(gold: 15)); + shop.AddWithCustomValue(ItemID.PainterPaintballGun, Item.buyPrice(gold: 15)) + .Add(ItemType(), CalamityConditions.InSunken, Condition.NpcIsPresent(NPCType())); } if (type == NPCID.Steampunker) From 882e205d02ce59961f93123a8d9717510fe849a7 Mon Sep 17 00:00:00 2001 From: Nathanael Overton Date: Sun, 16 Nov 2025 20:35:59 -0500 Subject: [PATCH 19/48] Damagetype fix on a UCG proj --- Projectiles/Magic/AerSigilMissile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Magic/AerSigilMissile.cs b/Projectiles/Magic/AerSigilMissile.cs index f58b2ccb57..c3fa5fdccb 100644 --- a/Projectiles/Magic/AerSigilMissile.cs +++ b/Projectiles/Magic/AerSigilMissile.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = 40; Projectile.height = 40; Projectile.friendly = true; - Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.DamageType = DamageClass.Magic; Projectile.ignoreWater = true; Projectile.tileCollide = true; Projectile.penetrate = 1; From 47f84326aaf26e9566a3349cba69ec566b648a4d Mon Sep 17 00:00:00 2001 From: Listentowind <2926669682@qq.com> Date: Mon, 17 Nov 2025 14:45:43 +0800 Subject: [PATCH 20/48] clean removed loc entry --- Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson index df88751a5d..b78a858638 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -241,7 +241,6 @@ SandMark.DisplayName: Mark SandnadoMinion.DisplayName: Sandnado SandTornado.DisplayName: Tornado SarosAura.DisplayName: Saros Aura -SarosMicrosun.DisplayName: Saros Microsun SarosSunfire.DisplayName: Saros Sunfire SeashineSwordProj.DisplayName: Seashine Sword SeekerSummonProj.DisplayName: Soul Seeker @@ -274,9 +273,6 @@ MinionPlasmaBlast.DisplayName: Volatile Plasma Blast MinionPlasmaGas.DisplayName: Superheated Plasma Cloud MinionTeslaOrb.DisplayName: Tesla Sphere SmallSkeletonMinion.DisplayName: Small Skeleton -SolarBeam.DisplayName: Solar Beam -SolarGod.DisplayName: Vengeful Solar Spirit -SolarPixie.DisplayName: Solar Pixie Spikecrag.DisplayName: Spikecrag SpikecragSpike.DisplayName: Spikecrag Spike SquirrelSquireAcorn.DisplayName: Squirrel Acorn From fd58ab04daf2fb1e7ef3d527b9740ddd115c9fe4 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Mon, 17 Nov 2025 13:13:22 -0600 Subject: [PATCH 21/48] shaderregion utils now allow matrix parameter --- Utilities/DrawingUtils.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Utilities/DrawingUtils.cs b/Utilities/DrawingUtils.cs index e801c90b54..f1ea89bed9 100644 --- a/Utilities/DrawingUtils.cs +++ b/Utilities/DrawingUtils.cs @@ -680,16 +680,16 @@ namespace CalamityMod return shader; } - public static void EnterShaderRegion(this SpriteBatch spriteBatch, BlendState newBlendState = null, Effect effect = null) + public static void EnterShaderRegion(this SpriteBatch spriteBatch, BlendState newBlendState = null, Effect effect = null, Matrix? matrix = null) { spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Immediate, newBlendState ?? BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, effect, Main.GameViewMatrix.TransformationMatrix); + spriteBatch.Begin(SpriteSortMode.Immediate, newBlendState ?? BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, effect, matrix ?? Main.GameViewMatrix.TransformationMatrix); } - public static void ExitShaderRegion(this SpriteBatch spriteBatch) + public static void ExitShaderRegion(this SpriteBatch spriteBatch, Matrix? matrix = null) { spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, matrix ?? Main.GameViewMatrix.TransformationMatrix); } /// From 570da6961bb48050c494fa36aeb40fe42eaec8f9 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Mon, 17 Nov 2025 21:31:58 -0400 Subject: [PATCH 22/48] Fixed pixelated assets being offset by camera movements * Pixelated assets are now drawn to render targets during Main.CheckMonoliths instead of Main.PreDraw. The latter drew them to early and caused them to be offset incorrectly whenever the camera moved --- Systems/Graphic/PixelationSystem/PixelationManager.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Systems/Graphic/PixelationSystem/PixelationManager.cs b/Systems/Graphic/PixelationSystem/PixelationManager.cs index 8758c40444..24b243a8dd 100644 --- a/Systems/Graphic/PixelationSystem/PixelationManager.cs +++ b/Systems/Graphic/PixelationSystem/PixelationManager.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem ActivePixelatedDrawers_AfterDusts = []; ActivePixelatedDrawers_AfterEverything = []; - RenderTargetManager.RenderTargetUpdateLoopEvent += PrepareTargets; + On_Main.CheckMonoliths += PrepareTargets; } public override void Unload() @@ -148,7 +148,7 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem ReturnAssociatedDrawerCollection(drawLayer).Add(drawer); } - private static void PrepareTargets() + private static void PrepareTargets(On_Main.orig_CheckMonoliths orig) { if (!Main.gameMenu && !Main.dedServ) { @@ -165,6 +165,8 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem Main.graphics.GraphicsDevice.SetRenderTarget(null); } + + orig(); } private static void DrawCollectionsToTarget(Dictionary targetCollection, Matrix pixelationMatrix, List drawerCollection) From b6a82d80fe7f190554d46623f0ef0a4ae5b58055 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Wed, 19 Nov 2025 14:46:19 +0700 Subject: [PATCH 23/48] i got reminded to do this username parity go --- Items/Placeables/Furniture/Paintings/ThankYouPainting.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs index 659e6039de..5a84fa4b08 100644 --- a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings public static IList devList = new List() { - "Altix", + "Altixal", "apotofkoolaid", "AquaSG", "Atalya", From 8cab4faeb37b8157fac689043a7e16567e7a625d Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Wed, 19 Nov 2025 12:07:51 -0500 Subject: [PATCH 24/48] Removed recipe turning Bloody Tear into Blood Orbs It would allow sequence-breaking Blood Orbs before Eye of Cthulhu, and it's not necessary anymore since Bloody Tear is consumable --- Items/Materials/BloodOrb.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Items/Materials/BloodOrb.cs b/Items/Materials/BloodOrb.cs index d5daec913e..f5cc0493f7 100644 --- a/Items/Materials/BloodOrb.cs +++ b/Items/Materials/BloodOrb.cs @@ -30,13 +30,5 @@ namespace CalamityMod.Items.Materials brightness *= Main.essScale; Lighting.AddLight((int)((Item.position.X + (Item.width / 2)) / 16f), (int)((Item.position.Y + (Item.height / 2)) / 16f), 0.75f * brightness, 0f, 0f); } - - public override void AddRecipes() - { - CreateRecipe(10). - AddIngredient(ItemID.BloodMoonStarter). - Register() - .DisableDecraft(); - } } } From 752084ffb5d1866c9f218302a852893cb087d936 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Wed, 19 Nov 2025 23:57:51 -0500 Subject: [PATCH 25/48] Omniscience projectile highlighting only occurs if it's dark enough --- Projectiles/CalamityGlobalProjectile.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index e9e6b69a59..93689b44fe 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -4748,8 +4748,9 @@ namespace CalamityMod.Projectiles { if (projectile.ModProjectile is null || (projectile.ModProjectile != null && projectile.ModProjectile.CanHitPlayer(Main.LocalPlayer) && (projectile.ModProjectile.CanDamage() ?? true))) { - Color mainColor = Color.Lerp(Color.Crimson with { A = 0 }, Color.OrangeRed with { A = 0 }, ((Main.GlobalTimeWrappedHourly * 2) % 1f)); - return mainColor; + Color mainColor = Color.Lerp(Color.Crimson with { A = 0 }, Color.OrangeRed with { A = 0 }, (Main.GlobalTimeWrappedHourly * 2) % 1f); + Color actualDisplayColor = new Color(Math.Max(mainColor.R, lightColor.R), Math.Max(mainColor.G, lightColor.G), Math.Max(mainColor.B, lightColor.B)); + return actualDisplayColor; } } From 68fef99673b8a156cb264db5b475bab63a6eca63 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 20 Nov 2025 00:14:23 -0500 Subject: [PATCH 26/48] Storm Saber's base damage no longer lies --- Items/Weapons/Melee/StormSaber.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Items/Weapons/Melee/StormSaber.cs b/Items/Weapons/Melee/StormSaber.cs index 4df89ae204..723257bc87 100644 --- a/Items/Weapons/Melee/StormSaber.cs +++ b/Items/Weapons/Melee/StormSaber.cs @@ -14,10 +14,9 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 58; Item.height = 64; - Item.damage = 66; + Item.damage = 50; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 23; - Item.useTime = 23; + Item.useTime = Item.useAnimation = 23; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 6f; @@ -31,17 +30,15 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 0.8), knockback, player.whoAmI); + Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); Vector2 spawnPos = new Vector2(player.MountedCenter.X + Main.rand.Next(-200, 201), player.MountedCenter.Y - 600f); // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction Vector2 targetPos = Main.MouseWorld + new Vector2(Main.rand.Next(-30, 31), Main.rand.Next(-30, 31)); - velocity = targetPos - spawnPos; - velocity.Normalize(); - velocity *= 13f; + velocity = Utils.DirectionTo(spawnPos, targetPos) * Item.shootSpeed; - Projectile.NewProjectile(source, spawnPos, velocity, type, (int)(damage * 0.6), knockback, player.whoAmI); + Projectile.NewProjectile(source, spawnPos, velocity, type, (int)(damage * 0.75), knockback, player.whoAmI); return false; } From 86643a3ab30f2f15e21073a26481b44dd4954264 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 20 Nov 2025 12:49:05 -0500 Subject: [PATCH 27/48] Removed Nimble Bounder --- CalPlayer/CalamityPlayer.cs | 7 -- CalPlayer/CalamityPlayerMiscEffects.cs | 7 -- Items/CalamityGlobalItemTooltip.cs | 2 - Items/CalamityGlobalItemTweaks.cs | 3 - Items/DisgustingMeat.cs | 1 - Items/PermanentBoosters/NimbleBounder.cs | 71 ------------------ Items/PermanentBoosters/NimbleBounder.png | Bin 760 -> 0 bytes .../en-US/Mods.CalamityMod.Items.Misc.hjson | 10 --- ModSupport/ModCalls.cs | 4 - 9 files changed, 105 deletions(-) delete mode 100644 Items/PermanentBoosters/NimbleBounder.cs delete mode 100644 Items/PermanentBoosters/NimbleBounder.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 392cd70ebb..336d2744d0 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -728,8 +728,6 @@ namespace CalamityMod.CalPlayer public bool tCloudberry = false; /// If true, the player has consumed Sacred Strawberry. public bool sStrawberry = false; - /// If true, the player has consumed Nimble Bounder. - public bool nimbleBounderBoost = false; public bool revJamDrop = false; /// If true, the player has consumed Mushroom Plasma Root. public bool rageBoostOne = false; @@ -1751,7 +1749,6 @@ namespace CalamityMod.CalPlayer sStrawberry = false; pHeart = false; cShard = false; - nimbleBounderBoost = false; revJamDrop = false; rageBoostOne = false; rageBoostTwo = false; @@ -1804,7 +1801,6 @@ namespace CalamityMod.CalPlayer boost.AddWithCondition("dragonFruit", sStrawberry); boost.AddWithCondition("phantomHeart", pHeart); boost.AddWithCondition("cometShard", cShard); - boost.AddWithCondition("nimbleBounder", nimbleBounderBoost); boost.AddWithCondition("revJam", revJamDrop); boost.AddWithCondition("rageOne", rageBoostOne); boost.AddWithCondition("rageTwo", rageBoostTwo); @@ -1895,7 +1891,6 @@ namespace CalamityMod.CalPlayer sStrawberry = boost.Contains("dragonFruit"); pHeart = boost.Contains("phantomHeart"); cShard = boost.Contains("cometShard"); - nimbleBounderBoost = boost.Contains("nimbleBounder"); revJamDrop = boost.Contains("revJam"); rageBoostOne = boost.Contains("rageOne"); rageBoostTwo = boost.Contains("rageTwo"); @@ -4566,7 +4561,6 @@ namespace CalamityMod.CalPlayer (CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) + (silvaSet ? SilvaArmor.AccelerationBoost : 0f) + (getSandCloakAccelBoost ? 0.75f : 0f) + - (nimbleBounderBoost ? NimbleBounder.AccelerationBoost : 0f) + (ascendantInsignia ? 0.25f : 0f) + // Added to Soaring Insignia's 1.25x multiplier to get 1.5x (statisNinjaBelt ? 0.6f : 0f) + (statisVoidSash ? 0.85f : 0f) + @@ -4586,7 +4580,6 @@ namespace CalamityMod.CalPlayer (dragonScales ? 0.1f : 0f) + (CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) + (silvaSet ? SilvaArmor.AccelerationBoost : 0f) + - (nimbleBounderBoost ? NimbleBounder.AccelerationBoost : 0f) + (planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) + //(exaltedKillMode ? 0.4f : devilsDevastationKillMode ? 0.7f : 0) + (hasteLevel * 0.05f); diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 05ec0a8a49..22f3afb339 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2710,13 +2710,6 @@ namespace CalamityMod.CalPlayer Player.jumpSpeedBoost += TheAbsorber.JumpSpeedBoost; } - // Nimble Bounder bonus - if (nimbleBounderBoost) - { - Player.moveSpeed += NimbleBounder.MoveSpeedBoost; - Player.jumpSpeedBoost += NimbleBounder.JumpSpeedBoost; - } - // Affliction bonus if (affliction || afflicted) { diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 5a95f46cb8..ac63b0d935 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -369,8 +369,6 @@ namespace CalamityMod.Items nameLine.OverrideColor = ShatteredCommunity.GetRarityColor(); if (item.type == ModContent.ItemType()) nameLine.OverrideColor = ShatteredCommunity.GetRarityColor(); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(132, 37, 147), new Color(0, 255, 0), 5f); //alternates purple and neon green if (item.type == ModContent.ItemType()) nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 6f); //alternates between emerald green and amber (BanditHueh) if (item.type == ModContent.ItemType()) diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 2526913ed4..27102ec65d 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -1260,9 +1260,6 @@ namespace CalamityMod.Items shimmerTransmute[ModContent.ItemType()] = ModContent.ItemType(); shimmerTransmute[ModContent.ItemType()] = ModContent.ItemType(); - //Calamity Permanent Upgrades - shimmerTransmute[ItemID.FrogLeg] = ModContent.ItemType(); - // -- Vanilla Boss Shimmer Drop Cycles -- // These cycles follow the order of: Melee Weapons A to Z -> Ranged Weapons A to Z -> Magic Weapons A to Z -> Summon Weapons A to Z -> Rogue Weapons A to Z (Based off of their in-game names) diff --git a/Items/DisgustingMeat.cs b/Items/DisgustingMeat.cs index 9a635b1bec..1f334a6ab9 100644 --- a/Items/DisgustingMeat.cs +++ b/Items/DisgustingMeat.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items TryDropBoosterItem(player, ref calPlayer.adrenalineBoostOne, ModContent.ItemType()); TryDropBoosterItem(player, ref calPlayer.adrenalineBoostTwo, ModContent.ItemType()); TryDropBoosterItem(player, ref calPlayer.adrenalineBoostThree, ModContent.ItemType()); - TryDropBoosterItem(player, ref calPlayer.nimbleBounderBoost, ModContent.ItemType()); } else { diff --git a/Items/PermanentBoosters/NimbleBounder.cs b/Items/PermanentBoosters/NimbleBounder.cs deleted file mode 100644 index 04ebe5daa6..0000000000 --- a/Items/PermanentBoosters/NimbleBounder.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.Collections.Generic; -using CalamityMod.CalPlayer; -using CalamityMod.Rarities; -using Terraria; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Items.PermanentBoosters -{ - public class NimbleBounder : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Misc"; - - public static float MoveSpeedBoost = 0.05f; - public static float JumpSpeedBoost = 0.25f; // This also amounts to 5% so the tooltip is shared with movement speed - public static float AccelerationBoost = 0.1f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent(), AccelerationBoost.ToPercent()); - - public override void SetDefaults() - { - Item.width = 20; - Item.height = 20; - Item.consumable = true; - Item.useAnimation = Item.useTime = 30; - Item.UseSound = SoundID.Zombie13; // frog sfx - Item.useStyle = ItemUseStyleID.HoldUp; - // Same price as Frog Leg, which is used to shimmer into it - Item.value = Item.sellPrice(gold: 1); - Item.rare = ModContent.RarityType(); - Item.maxStack = Item.CommonMaxStack; - Item.Calamity().devItem = true; - } - - public static bool HasConsumedBefore(Player player) => player.Calamity().nimbleBounderBoost; - - public override bool CanUseItem(Player player) - { - if (HasConsumedBefore(player)) - { - // Refuse Text can be added on here - return false; - } - - return true; - } - - public override bool? UseItem(Player player) - { - if (player.itemAnimation > 0 && player.itemTime == 0) - { - player.itemTime = Item.useTime; - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.nimbleBounderBoost = true; - } - return true; - } - - // Gives a purple light when dropped as an item - public override void PostUpdate() - { - Lighting.AddLight((int)((Item.position.X + Item.width / 2) / 16f), (int)((Item.position.Y + Item.height / 2) / 16f), 0.51f, 0.14f, 0.57f); - } - - public override void ModifyTooltips(List list) - { - if (HasConsumedBefore(Main.LocalPlayer)) - list.AddConsumedTooltip(); - } - } -} diff --git a/Items/PermanentBoosters/NimbleBounder.png b/Items/PermanentBoosters/NimbleBounder.png deleted file mode 100644 index a329a79c5792f8532db6a818453dddc708811160..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 760 zcmVPx#1ZP1_K>z@;j|==^1poj7h)G02R9HvNmp@2bK^(`EB2q9Qc8WvcJ#|P14S9C) z4=NG_9ZHF<1pf@8Q>~j=L`6hIv~JZ+aj_*7D$=1{+G2};7JVT)#K9WD!KG9L1?iHW z-^(}X;X|i;{SNuug}dXv_xs)Nz3260RZ&_6R@c>on?HYK&`=bx!nrwD+P4$8juY!( zoLC3_-CtYa1N>@~m(I$=VQ?=Ycf9)bJNi^S{tn!>6Cm}(lJjD*4v=~lX#~Z(a4ObC zU%$hK+9(=-PEO!#>g_!G%>lXdZ-kuIM;OEgNH?X-Ma)I<1@ICq`a_WtIizXJj(FlBG9d*U~HnB^ z$~0t*oa8kA^B0+&jHUhvz}`X-C6XR0L;yzJ)^4Su!bi9AA(QoD}PoC!o&b^Yi@l)TJ2m z9x_%RKg@y5wt>L`kg=f?iq1KIc4ii2cDJ^@0y$s5!|01XIOGoaF2fy$%Bn%$Pbcxd zB@Z@1o)F({cmmoT=AIVZ868pF*Zw||6eWzD>Ag;Awe9M;(KfZq$Krnu%5JG~~1r!#(I zutJG-FqKi?9k)+2MYQ4ijYvn q;s5{u4rN$LW=%~1DgXcg2mk;800000(o>TF0000 player.Calamity().tCloudberry, "SacredStrawberry" => player.Calamity().sStrawberry, - "NimbleBounder" => player.Calamity().nimbleBounderBoost, - "CometShard" => player.Calamity().cShard, "EtherealCore" => player.Calamity().eCore, "PhantomHeart" => player.Calamity().pHeart, @@ -1016,8 +1014,6 @@ namespace CalamityMod case "EtherealCore": player.Calamity().eCore = value; break; case "PhantomHeart": player.Calamity().pHeart = value; break; - case "NimbleBounder": player.Calamity().nimbleBounderBoost = value; break; - case "MushroomPlasmaRoot": player.Calamity().rageBoostOne = value; break; case "InfernalBlood": player.Calamity().rageBoostTwo = value; break; case "RedLightningContainer": player.Calamity().rageBoostThree = value; break; From bb785094fc6d4b665264ae296e19bd1e2f7a2947 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 20 Nov 2025 12:54:01 -0500 Subject: [PATCH 28/48] Removed Punch Card --- ILEditing/ILChangesLoading.cs | 1 - ILEditing/MechanicILChanges.cs | 36 ----------- Items/Accessories/Vanity/PunchCard.cs | 39 ------------ Items/Accessories/Vanity/PunchCard.png | Bin 741 -> 0 bytes Items/Accessories/Vanity/Shayy_Body.png | Bin 4405 -> 0 bytes Items/Accessories/Vanity/Shayy_Head.png | Bin 4492 -> 0 bytes Items/Accessories/Vanity/Shayy_Legs.png | Bin 2287 -> 0 bytes Items/TreasureBags/MiscGrabBags/StarterBag.cs | 10 --- .../Mods.CalamityMod.Items.Accessories.hjson | 9 --- NPCs/CalamityGlobalTownNPC.cs | 19 ------ NPCs/DevourerofGods/DevourerofGodsHead.cs | 29 ++------- UI/PunchCardGUI.cs | 59 ------------------ 12 files changed, 4 insertions(+), 198 deletions(-) delete mode 100644 Items/Accessories/Vanity/PunchCard.cs delete mode 100644 Items/Accessories/Vanity/PunchCard.png delete mode 100644 Items/Accessories/Vanity/Shayy_Body.png delete mode 100644 Items/Accessories/Vanity/Shayy_Head.png delete mode 100644 Items/Accessories/Vanity/Shayy_Legs.png delete mode 100644 UI/PunchCardGUI.cs diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index d3e1f57f94..80315b5772 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -95,7 +95,6 @@ namespace CalamityMod.ILEditing On_Item.GetShimmered += ShimmerEffectEdits; On_Player.Teleport += TPOverride; On_TileDrawing.DrawSingleTile += GlowMaskTileRender; - On_Main.DoUpdate_HandleChat += SpawnPunchCard; On_Player.PlaceThing_CannonBall += AllowCannonJellyfishUse; On_Player.ItemCheck_ReleaseCritter += ReleaseCritterVariant; On_Player.IsItemSlotUnlockedAndUsable += MasterModeCelestialOnionCheck; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index cc30098985..aa38dfed86 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -77,42 +77,6 @@ namespace CalamityMod.ILEditing //private static readonly MethodInfo textureGetValueMethod = typeof(Asset).GetMethod("get_Value", BindingFlags.Public | BindingFlags.Instance); - #region Punch Card Spawning Command - private static void SpawnPunchCard(On_Main.orig_DoUpdate_HandleChat orig) - { - // Any of these conditions should result in normal behaviour - if (!Main.drawingPlayerChat || Main.CurrentInputTextTakerOverride != null || Main.editSign || PlayerInput.UsingGamepad) - { - orig(); - return; - } - - // Allow only one pick up of the card this way per player (also don't give it to dead people) - Player player = Main.LocalPlayer; - if (player.Calamity().spawnedPunchCard || player.dead || !player.active) - { - orig(); - return; - } - - // Find 2 specific sets of text from the live chat box (as the player is typing) - // Gives the item to you and abruptly shuts the chat box down if both parts are found - string text = Main.chatText.ToLower(); - string prefix = "Items.Accessories.PunchCard.SpawnText"; - if ((text.Contains(CalamityUtils.GetTextValue($"{prefix}1")) || text.Contains(CalamityUtils.GetTextValue($"{prefix}1Alt"))) && text.Contains(CalamityUtils.GetTextValue($"{prefix}2"))) - { - player.QuickSpawnItem(Player.GetSource_None(), ModContent.ItemType(), 1); - player.Calamity().spawnedPunchCard = true; - Main.chatText = ""; - Main.ClosePlayerChat(); - Main.chatRelease = false; - SoundEngine.PlaySound(SoundID.MenuClose); - return; - } - orig(); - } - #endregion - #region Dash Fixes and Improvements private static void MakeShieldSlamIFramesConsistent(ILContext il) { diff --git a/Items/Accessories/Vanity/PunchCard.cs b/Items/Accessories/Vanity/PunchCard.cs deleted file mode 100644 index 17f7cb92c1..0000000000 --- a/Items/Accessories/Vanity/PunchCard.cs +++ /dev/null @@ -1,39 +0,0 @@ -using CalamityMod.Items.BaseItems; -using CalamityMod.UI; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Accessories.Vanity -{ - public class PunchCard : TransformationAccessory, ILocalizedModType - { - public new string LocalizationCategory => "Items.Accessories"; - public override (EquipType, string, string)[] EquipSlots => - [ - (EquipType.Head, "Shayy", null), - (EquipType.Body, "Shayy", null), - (EquipType.Legs, "Shayy", null), - ]; - - public override void SetDefaults() - { - Item.width = 42; - Item.height = 38; - Item.accessory = true; - Item.value = Item.buyPrice(gold: 10); // Sold by Skeleton Merchant named "Sans Undertale" - Item.rare = ItemRarityID.Purple; - Item.vanity = true; - Item.Calamity().devItem = true; - Item.useAnimation = Item.useTime = 20; - Item.useStyle = ItemUseStyleID.HoldUp; - } - - public override bool? UseItem(Player player) - { - if (Main.myPlayer == player.whoAmI) - PopupGUIManager.FlipActivityOfGUIWithType(typeof(PunchCardGUI)); - return true; - } - } -} diff --git a/Items/Accessories/Vanity/PunchCard.png b/Items/Accessories/Vanity/PunchCard.png deleted file mode 100644 index 51e56a531975cf6131d9912f2eea79ec88aa34c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 741 zcmVPx%pGibPR9J=8m_bNXK^Vt>FE_$1HfS{$QkPwd!owPAN{g4GOLa;rk_E4wq7ELG z2qNgPL5HGKM}sgj=;V5dIw%U^W)UoU5ljOs?6BcVhk72~ey%gUVSBm+^S{i_H}l@S z{mp#;nfDxasAPN2H{KXI2tYW}qLh2XKLD7UdGGpN7ims903Qlhl=!ZlKIs2aNDl-h z)D&F4le4*+oO&S@o{A8i1jT>9!ezBNQ0At=NWN4$SrEX?_? zp|*~*zBjs&Jp@2cXKY&!k{Kuf&=g&B0A?qq0a*B)1uP;O0$ixBsh{iKntJfG7uY_b zppqFG8XT6HbhfrzMHHxJVWz*Ut^<_EW&nt02bB0~ZUlhvg>K;QnUkCm*+=wWWg=u! zW2Mvyh7JA2RdheKhv>2H6AnOrw7~_)^m`2^awbBxWFlx%dt#qA&a&t8)(~}0rpEvX zM_OEfXCw8^deOU&D*!yoeNp22jwbzv28TDF5iBAalI&Vt{sh3{%3Ei8KD_MUP8Ca31zt>cNB zW4i&Hh{_2%+A4k;>;|%i^M*AH=Kx5>$6bIkmo6&j%r`Gz`L0n}`%mtAZ>#nYl^?pF zg6gMca$dbw_QNJI%7FVW*&F90ZgU-13*R4+n7Wew2{ XwBz+%Zr-$M00000NkvXXu0mjfKM+-Y diff --git a/Items/Accessories/Vanity/Shayy_Body.png b/Items/Accessories/Vanity/Shayy_Body.png deleted file mode 100644 index 56fbab6258096d9ecb3091edf68df5676ee5a645..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4405 zcmb`KX;c$wm&fBPil~4fnr;+OlYpRrD| z@@WrO^^Lk40RVtH%*_P>0IUg7UJq?puRNMXEp{tUYhnRsLJ zoEnc0Ya3_$QLyDUxnAF-%st%%;ebdta9-GOT>T*RUDSi0$^i~l{D&Og0Y$Z~15;p7 z8T`evX{z^)K(JrVnW6CJ#3 zxO~$w8dhgLgr&`U@#GbO$X%M3bmFoeu?fVjJc^g)_DeSXx_b78u>QW~2jB^L?KN-6 zL{@X8d;j_6NJB+i3hjnRdeNG{&VtAFWglY{5gXB}*TA-Ub!11wa5z?R-TIlboyjKTD)h-oS@RF zxUrs?nv4E%Vn$i2kL+$kKx6yJ{F8-a2-C&_D_{Xr7+`ylv_PGCV`n+R!0i6jfYxe1 z5kDO{&9ZVf5soa) zpth1)?155iH=5B@isv966q^uEo^iXeRoXJWG^BG~)H`D^-VlFJ6fHN*7gl9mVb&s} zJsz|9F|r3ebM}gnIY-UexoahU23^DK)IlL^-*7zoVea7ogAqNsjBJ#{`Z0a_7 zNyy--R0FjDS$E&%?paMr^zm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5mDK-FUpmKhy6(hFEt?5wImow?tQOEji#h*ViU(` zimpY2TCl##PJWYEXmD~(1U=jgM^JuS8k`(zgpc$2t*u_mtrVLj1%gAvV@tskuN(Je zfL`*}r)>vM48FhLeHq?0`ZZ$+m^9|3d7D~fPJJg!LO_S%hOg?JaUaN#Ox4V+egHL!=BL r+bKhVU6j9jX+uEeH2k+Q-M_rHVDGWu4Tfi-D>uQ8d$>@Xeop!~yql1+ diff --git a/Items/Accessories/Vanity/Shayy_Head.png b/Items/Accessories/Vanity/Shayy_Head.png deleted file mode 100644 index 25b28f865af15a449f800f2eef55bef238d1883e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4492 zcmbVQc|4Ts+ka%TMM#!8M>KX(V$_@@4zjO@Vn*4*P|9@dGYp!85|MR`38N&+zI8Ao zNfO51*hjyzkH|7)vb;~H`n>MD06^UNc)%xe!{I1!;0m-iH3Z7KrRM=a)WrO}!G*8~pK{J7UY-_zvsZ1q zObESkT_f_SS)w^t>SF~$3!z0wPB{Ot$wPC|csUmZ$rQPSefj4f<|m!kG4z)Fqu{>y zy#wk9iM!{c?S^^ex0{94^@np@dX@_Q4h)&et@n8mzBvw^T<+c*TI}x1A+aYX@%YWq z9kBGBygyywP>t))~TEu3%4#x9kd7ajiiE-$}N37w2=C0vx9zeZ(lBa^Lz#<;i@w82C4BI;ZG`}>>vp&}}z6}9B4^O@1 z0lE^GA;5!r&X8f0`!>HtfP-i9KEQEk`8n77=DIwe6Xj`#>+bcO1}OD)={UV~Un;n! z@k#DJVEi&I-NGide@?SFPf~`IeNtSIoA z2zSFYMD%RfC*9S0uCk)2(%!V*e#_0D!{wt9mF2uExn~x+`xOxdh}hWQuPln!GJqbq zL1_$GfCL5X;lCaSn#*78$OG@=m1Ver%a?W2aCs3)ySjerZAAATQF!z&zG#=Iub(14 zZMC=X1c=Uad0^}M#ckDdrS%yQ?X z)QUl^yRreRJ^X8HQ}zws(odNsv?~1e+sQo$rBTB6*|gIx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QOtq7;W=$QQSa>dN^7dJz9xEvUo3 Ko|T6p(*Fk()); - // Shayy dev item - // Name specific: "Shayy" - static bool getsPunchCard(DropAttemptInfo info) - { - string playerName = info.player.name; - return playerName == "Shayy"; - } - - itemLoot.AddIf(getsPunchCard, ModContent.ItemType()); - // Xyk dev item // Name specific: "Xyk" static bool getsXyksBlessing(DropAttemptInfo info) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 73152d034c..62a94655b7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -2163,15 +2163,6 @@ Popo: { ''' } -PunchCard: { - DisplayName: Punch Card - Tooltip: "[c/842593:'Please... please get world record...']" - // These are used to spawn the item via chat -- both must be all lower case for the detection to work - SpawnText1: it's late - SpawnText1Alt: its late - SpawnText2: go to bed -} - SharkyPlush: { DisplayName: Sharky Plush Tooltip: "[c/696969:'Look out, for the force without form...']" diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 74f80155f6..93cd34033c 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1317,25 +1317,6 @@ namespace CalamityMod.NPCs shop.Add(); } } - - public override void ModifyActiveShop(NPC npc, string shopName, Item[] items) - { - // TODO: Uses a hardcoded string since dedicated names are currently hardcoded strings - // Will need to be changed if dedicated names are localized in the future - if (npc.type == NPCID.SkeletonMerchant && npc.GivenName == "Sans Undertale") - { - int index = 0; - for (int i = 0; i < Chest.maxItems; i++) - { - if (items[i] == null) - { - index = i; - break; - } - } - items[index] = new Item(ItemType()); - } - } #endregion } } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index e039bf5035..911ee1a799 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -2799,32 +2799,11 @@ namespace CalamityMod.NPCs.DevourerofGods text = headHitKeys[Main.rand.Next(0, 4)]; //DogHead1-4 } } - // Speak in Wingdings if the Punch Card is equipped - if (target.Transformation().Type == ModContent.ItemType() && FontAssetSystem.Fonts["Wingdings"] != null && System.Environment.OSVersion.Platform == PlatformID.Win32NT && !GameCulture.FromCultureName(GameCulture.CultureName.Chinese).IsActive && !GameCulture.FromCultureName(GameCulture.CultureName.Russian).IsActive) - { - Vector2 vector = FontAssetSystem.Fonts["Wingdings"].MeasureString(Language.GetTextValue(text)); - // This is how normal combat text spawn positioning is handled - float positionX = (float)location.X + (float)location.Width * 0.5f - vector.X * 0.5f + Main.rand.Next(-(int)((double)location.Width * 0.5), (int)((double)location.Width * 0.5) + 1); - float positionY = (float)location.Y + (float)location.Height * 0.25f - vector.Y * 0.5f + Main.rand.Next(-(int)((double)location.Height * 0.5), (int)((double)location.Height * 0.5) + 1); - if (target.gravDir == -1f) - { - positionY = (float)location.Y + (float)location.Height * 0.75f + vector.Y * 0.5f; - } - // Spawn a projectile that mimmicks combat text behaviour - Projectile proj = Projectile.NewProjectileDirect(NPC.GetSource_FromThis(), new Vector2(positionX, positionY), new Vector2((float)Main.rand.Next(-25, 26) * 0.05f, -14f * target.gravDir), ModContent.ProjectileType(), 0, 0, -1, -1); - proj.rotation = proj.velocity.X < 0 ? -0.06f : 0.06f; - // Pass the spoken dialogue into it - DoGWingdings wingdings = proj.ModProjectile(); - wingdings.dialogue = Language.GetTextValue(text); - } - else - { - var ctid = CombatText.NewText(location, messageColor, Language.GetTextValue(text), true); - if (ctid < Main.maxCombatText) - target.Calamity().subtitletext = Main.combatText[ctid]; - target.Calamity().subtitleColors = new Color[] { Color.Cyan, Color.Fuchsia }; - } + var ctid = CombatText.NewText(location, messageColor, Language.GetTextValue(text), true); + if (ctid < Main.maxCombatText) + target.Calamity().subtitletext = Main.combatText[ctid]; + target.Calamity().subtitleColors = new Color[] { Color.Cyan, Color.Fuchsia }; target.Calamity().dogTextCooldown = 60; } target.Calamity().DoGHeadHitCounter++; diff --git a/UI/PunchCardGUI.cs b/UI/PunchCardGUI.cs deleted file mode 100644 index 3dbe2fac1a..0000000000 --- a/UI/PunchCardGUI.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.GameContent; -using Terraria.ModLoader; - -namespace CalamityMod.UI -{ - public class PunchCardGUI : PopupGUI - { - public bool HoveringOverBook = false; - - public override void Update() - { - if (Active) - { - if (FadeTime < FadeTimeMax) - FadeTime++; - } - else if (FadeTime > 0) - { - FadeTime--; - } - - if (Main.mouseLeft && !HoveringOverBook && FadeTime >= 30) - { - Active = false; - } - - HoveringOverBook = false; - } - - public override void Draw(SpriteBatch spriteBatch) - { - Texture2D pageTexture = ModContent.Request("CalamityMod/UI/MiscTextures/PunchCardPopup").Value; - float xScale = MathHelper.Lerp(0.004f, 1f, FadeTime / (float)FadeTimeMax); - Vector2 scale = new Vector2(xScale, 1f) * new Vector2(Main.screenWidth, Main.screenHeight) / pageTexture.Size(); - scale.Y *= 1.5f; - scale *= 0.5f; - - float bookScale = 0.5f; - scale *= bookScale; - - float yPageTop = MathHelper.Lerp(Main.screenHeight * 2, Main.screenHeight * 0.5f, FadeTime / (float)FadeTimeMax); - - Rectangle mouseRectangle = new Rectangle((int)Main.MouseScreen.X, (int)Main.MouseScreen.Y, 2, 2); - float drawPositionX = Main.screenWidth * 0.5f; - Vector2 drawPosition = new Vector2(drawPositionX, yPageTop); - Rectangle pageRectangle = new Rectangle((int)drawPosition.X - (int)(pageTexture.Width * 0.5f * scale.X), (int)drawPosition.Y - (int)(pageTexture.Height * 0.5f * scale.Y), (int)(pageTexture.Width * scale.X), (int)(pageTexture.Height * scale.Y)); - - spriteBatch.Draw(pageTexture, drawPosition, null, Color.White, 0f, pageTexture.Size() / 2, scale, SpriteEffects.None, 0f); - - if (!HoveringOverBook) - HoveringOverBook = mouseRectangle.Intersects(pageRectangle); - } - } -} From 50f67e6fc893b621c5c2fb560064ccc3f14b068c Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 20 Nov 2025 12:59:09 -0500 Subject: [PATCH 29/48] Removed Seared Pan --- CalPlayer/CalamityPlayer.cs | 4 - CalPlayer/CalamityPlayerMiscEffects.cs | 12 - Items/Weapons/Rogue/SearedPan.cs | 78 ------- Items/Weapons/Rogue/SearedPan.png | Bin 912 -> 0 bytes ...Mods.CalamityMod.Items.Weapons.Rogue.hjson | 14 -- .../Mods.CalamityMod.Projectiles.Rogue.hjson | 3 - Projectiles/Rogue/NiceCock.cs | 154 ------------- Projectiles/Rogue/NiceCock.png | Bin 4834 -> 0 bytes Projectiles/Rogue/PanSpark.cs | 139 ------------ Projectiles/Rogue/PanSpark.png | Bin 313 -> 0 bytes Projectiles/Rogue/SearedPanProjectile.cs | 206 ------------------ Projectiles/Rogue/SearedPanProjectile.png | Bin 469 -> 0 bytes Sounds/Item/SearedPanSmash.ogg | Bin 18250 -> 0 bytes 13 files changed, 610 deletions(-) delete mode 100644 Items/Weapons/Rogue/SearedPan.cs delete mode 100644 Items/Weapons/Rogue/SearedPan.png delete mode 100644 Projectiles/Rogue/NiceCock.cs delete mode 100644 Projectiles/Rogue/NiceCock.png delete mode 100644 Projectiles/Rogue/PanSpark.cs delete mode 100644 Projectiles/Rogue/PanSpark.png delete mode 100644 Projectiles/Rogue/SearedPanProjectile.cs delete mode 100644 Projectiles/Rogue/SearedPanProjectile.png delete mode 100644 Sounds/Item/SearedPanSmash.ogg diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 336d2744d0..ebc472c5ba 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -112,8 +112,6 @@ namespace CalamityMod.CalPlayer public double projectileDamageReduction = 0D; public int hellbornShots = 0; public int garandShots = 0; - public int searedPanCounter = 0; - public int searedPanTimer = 0; /// If set to true, prevents all player dashes. Used by Ball and Chain, and Stygian Shield. public bool blockAllDashes = false; /// Used by Flamsteed Ring to reset the player's hitbox size after dismounting. @@ -3249,8 +3247,6 @@ namespace CalamityMod.CalPlayer lucreciaEnergy = 0; elementalMastery = 0; garandShots = 0; - searedPanCounter = 0; - searedPanTimer = 0; persecutedEnchantSummonTimer = 0; momentumCapacitorTime = 0; momentumCapacitorBoost = 0f; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 22f3afb339..2cb5537364 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3702,18 +3702,6 @@ namespace CalamityMod.CalPlayer if (Player.HeldItem.type != ModContent.ItemType()) evilSmasherBoost = 0; } - if (searedPanCounter > 0) - { - if (Player.HeldItem.type != ModContent.ItemType()) - { - searedPanCounter = 0; - searedPanTimer = 0; - } - else if (searedPanTimer < SearedPan.ConsecutiveHitOpening) - searedPanTimer++; - else - searedPanCounter = 0; - } // Flight time boosts double flightTimeMult = 1D + diff --git a/Items/Weapons/Rogue/SearedPan.cs b/Items/Weapons/Rogue/SearedPan.cs deleted file mode 100644 index 5ccd6b6204..0000000000 --- a/Items/Weapons/Rogue/SearedPan.cs +++ /dev/null @@ -1,78 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; -using CalamityMod.Rarities; -using CalamityMod.Tiles.Furniture.CraftingStations; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Rogue -{ - public class SearedPan : RogueWeapon - { - public static readonly SoundStyle SmashSound = new("CalamityMod/Sounds/Item/SearedPanSmash"); - - // Attacks must be within 40 frames of each other to count as "consecutive" hits - // This is a little less than double the use time - public static int ConsecutiveHitOpening = 40; - public override void SetDefaults() - { - Item.width = 60; - Item.height = 36; - Item.damage = 2222; - Item.DamageType = RogueDamageClass.Instance; - Item.knockBack = 10f; - Item.noMelee = true; - Item.noUseGraphic = true; - Item.useStyle = ItemUseStyleID.Swing; - Item.useAnimation = Item.useTime = 25; - Item.reuseDelay = 1; - Item.useLimitPerAnimation = 1; - Item.UseSound = SoundID.Item1; - Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 15f; - Item.Calamity().donorItem = true; - } - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - float mode = 1f; - if (player.Calamity().searedPanCounter >= 3) - { - player.Calamity().searedPanCounter = 0; - mode = 2f; - } - if (player.Calamity().StealthStrikeAvailable()) - { - player.Calamity().searedPanCounter = 0; - mode = 3f; - } - int pan = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, mode); - if (mode > 1f && pan.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[pan].extraUpdates++; - if (mode == 3f) - Main.projectile[pan].Calamity().stealthStrike = true; - } - return false; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(). - AddIngredient(5). - AddIngredient(ItemID.LifeCrystal). - AddIngredient(ItemID.Bone, 92). - // AddIngredient(ItemID.Steak). - AddTile(). - Register(); - } - } -} diff --git a/Items/Weapons/Rogue/SearedPan.png b/Items/Weapons/Rogue/SearedPan.png deleted file mode 100644 index b5bef1d2cc96f67b191cbe62923abdf606187e34..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 912 zcmV;B18@9^P)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00Q1gL_t(&-tC!9PZL2HfS)xs#kRl# zu^1FVMWv!q!o`CSgHiElP*X1^k{Ayj{0sgG{SCy#cvTZI!7~99kwhe7BnSnepGZSY zIn+0G#vPW*(rC8NZFZ;cw0-uSoq5NiLiEIX0cflb0}u>{0Qfe)RM<(}!|ewxfb41# zfR$7ZfU&8!j{Wyk>IeTTSi3!dm_5|q3c%d#*8;%twkQBCr@P9E7j14<+7quw0GR%g z0HCw0!vgr3O#?9e;+fLFYS=4GW^WF~0Z1$^0x3CvR zM>j3M)pv&XdKE}=H_~7O&}4^|`zEtuXn)Irvc_AQUvP|TG9Iyu-^+J~Jlp z!rvNoLyYU_x$HZ`p5^d%@!G5&*JN6#8ul8~tXU~eoQwh094?>VX663^S-V#a3-N(L zrJc#G1CU+I0}u!V09Z|B9cxmOGqPWmwREMp9xtu~o(~Tz*ZpT$H!0Kvg8;1O^96v~ za18(p%jsV|il(pj^#IUu?1=LDHxrXeTYpdP)=Eo{`(bk zxp=g#wXA@;=~pA8fH{}FHhrP*B2da*F^pgL!&ZD?umEtSzfZYgcb-w&PoF#n{xtq_ zbZpB3^jei(Wt8frX$|c51c*^VH(O`dS^()}2JoZdo>*@I;KAJ+jvYSDd+D(p(#ect zZtI9~(+P!s-Oa4vKf{$8$St?aWnVC00sP2sDA(PdK;IeO1hFq2If$F5KmY&$5_Cma mbVXQ6MmkS&X=QG7VRUJ4ZU8ZaSnTfr0000 "Projectiles.Rogue"; - public bool homing = false; - public int Timer = 0; - private bool initialized = false; - private Color[] colors = new Color[] - { - new Color(255, 0, 0, 50), //Red - new Color(255, 128, 0, 50), //Orange - new Color(255, 255, 0, 50), //Yellow - new Color(128, 255, 0, 50), //Lime - new Color(0, 255, 0, 50), //Green - new Color(0, 255, 128, 50), //Turquoise - new Color(0, 255, 255, 50), //Cyan - new Color(0, 128, 255, 50), //Light Blue - new Color(0, 0, 255, 50), //Blue - new Color(128, 0, 255, 50), //Purple - new Color(255, 0, 255, 50), //Fuschia - new Color(255, 0, 128, 50) //Hot Pink - }; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 5; - } - - public override void SetDefaults() - { - Projectile.width = 44; - Projectile.height = 70; - Projectile.friendly = true; - Projectile.tileCollide = false; - Projectile.DamageType = RogueDamageClass.Instance; - Projectile.timeLeft = 180; - Projectile.alpha = 255; - } - - public override void SendExtraAI(BinaryWriter writer) => writer.Write(homing); - - public override void ReceiveExtraAI(BinaryReader reader) => homing = reader.ReadBoolean(); - - public override bool? CanHitNPC(NPC target) - { - // Do not deal damage before fully opaque - if (Projectile.alpha >= 10) - return false; - int index = (int)Projectile.ai[1]; - if (Main.npc[index] is null || !Main.npc[index].active || Main.npc[index].life < 0) - return false; - // Do not deal damage to any NPC that isn't the specified target - if (index != target.whoAmI) - return false; - return null; - } - - public override void AI() - { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - // Fireballs disappear if you can't stealth strike - if (!modPlayer.wearingRogueArmor || modPlayer.rogueStealthMax <= 0) - Projectile.Kill(); - - Projectile.alpha -= 5; - - if (!initialized) - { - // Pick a random frame to start on - Projectile.frame = Main.rand.Next(Main.projFrames[Type]); - initialized = true; - } - - Projectile.frameCounter++; - if (Projectile.frameCounter > 8) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame >= Main.projFrames[Type]) - Projectile.frame = 0; - - int index = (int)Projectile.ai[1]; - - // If the target doesn't exist or is dead, spontaneously combust - if (Main.npc[index] is null || !Main.npc[index].active || Main.npc[index].life < 0) - Projectile.Kill(); - - // Decrement the timer. This should last a second as stealth strikes will initialize this at 61. - if (Timer > 1) - Timer--; - if (Timer == 1) - homing = true; - - NPC target = Main.npc[index]; - - if (homing) - { - // Home in on the target - Vector2 moveDirection = Projectile.SafeDirectionTo(target.Center, Vector2.UnitY); - Projectile.velocity = (Projectile.velocity * 20f + moveDirection * 15f) / 21f; - } - else - { - // Circle around the target counter-clockwise at 4 radians per frame - float height = target.getRect().Height; - float width = target.getRect().Width; - float circleDist = MathHelper.Min((height > width ? height : width) * 3f, (Main.LogicCheckScreenWidth * Main.LogicCheckScreenHeight) / 2); - if (circleDist > Main.LogicCheckScreenWidth / 3) - circleDist = Main.LogicCheckScreenWidth / 3; - Projectile.Center = target.Center + Projectile.ai[0].ToRotationVector2() * circleDist; - Projectile.ai[0] -= MathHelper.ToRadians(4f); - } - } - - public override void OnKill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.Item74, Projectile.Center); - Projectile.ExpandHitboxBy(50); - - // Create into some rainbow-colored dust when dead - for (int d = 0; d < 5; d++) - { - int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.RainbowMk2, 0f, 0f, 150, Main.rand.Next(colors), 2f); - Main.dust[idx].velocity *= 3f; - Main.dust[idx].noGravity = true; - if (Main.rand.NextBool()) - { - Main.dust[idx].scale = 0.5f; - Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int d = 0; d < 8; d++) - { - int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.RainbowMk2, 0f, 0f, 150, Main.rand.Next(colors), 3f); - Main.dust[idx].noGravity = true; - Main.dust[idx].velocity *= 5f; - idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.RainbowMk2, 0f, 0f, 150, Main.rand.Next(colors), 2f); - Main.dust[idx].velocity *= 2f; - Main.dust[idx].noGravity = true; - } - } - } -} diff --git a/Projectiles/Rogue/NiceCock.png b/Projectiles/Rogue/NiceCock.png deleted file mode 100644 index 8881462c5cacb04edbdd35914317cb73a544b010..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4834 zcmX9?2Uru$(?38Y(t{MG7ZDVtcLaQCp-CXprKlu?-UTHgfJE90M5IYq0@4JeNe5q$ zBE1O`Kt!5^8hQ(S@&7${&+g66-aI?M+273V#h98vnCQ9b0RUh!(AR-c`a1wX31VJZ#*aH9vz6k(fSO7So42Asx zfM?PGKzs}Us&4^+%O|VR>>fpN`Kb{^2e|lqy=y5<0suB?1D$`&pA$Ch?c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VL<%SEy^R^K_KqT+6*T-;Z-ZZI^lcG!1sC`P$MC6ett@Kc>a5_d|e%IIBf zvo855H+ "Projectiles.Rogue"; - private bool initialized = false; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 3; - ProjectileID.Sets.TrailCacheLength[Type] = 2; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 14; - Projectile.height = 14; - Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.timeLeft = 120; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - Projectile.DamageType = RogueDamageClass.Instance; - Projectile.ignoreWater = true; - } - - public override void AI() - { - //make it face the way it's going - if (Projectile.ai[1] > 0f) - { - Projectile.rotation = -Projectile.velocity.X * 0.05f + MathHelper.PiOver2; - } - else - { - Projectile.rotation = Projectile.velocity.ToRotation(); - } - Projectile.ai[1]--; - - //frames - if (!initialized) - { - initialized = true; - Projectile.frame = Main.rand.Next(Main.projFrames[Type]); - } - Projectile.frameCounter++; - if (Projectile.frameCounter > 6) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame >= Main.projFrames[Type]) - { - Projectile.frame = 0; - } - - //movement - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X *= -0.1f; - } - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X *= -0.5f; - } - if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) - { - Projectile.velocity.Y *= -0.5f; - } - Projectile.ai[0] += 1f; - if (Projectile.ai[0] > 5f) - { - Projectile.ai[0] = 5f; - if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) - { - Projectile.velocity.X *= 0.97f; - if (Projectile.velocity.X > -0.01f && Projectile.velocity.X < 0.01f) - { - Projectile.velocity.X = 0f; - Projectile.netUpdate = true; - } - } - Projectile.velocity.Y += 0.2f; - } - if (Projectile.velocity.Y < 0.25f && Projectile.velocity.Y > 0.15f) - { - Projectile.velocity.X *= 0.8f; - } - if (Projectile.velocity.Y > 16f) - { - Projectile.velocity.Y = 16f; - } - - //dust - if (Main.rand.NextBool(4)) - { - int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Torch, 0f, 0f, 100, default, 1f); - Dust dust = Main.dust[fire]; - dust.position.X -= 2f; - dust.position.Y += 2f; - dust.scale += (float)Main.rand.Next(50) * 0.01f; - dust.noGravity = true; - dust.velocity.Y -= 2f; - } - if (Main.rand.NextBool(10)) - { - int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Torch, 0f, 0f, 100, default, 1f); - Dust dust = Main.dust[fire]; - dust.position.X -= 2f; - dust.position.Y += 2f; - dust.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - dust.noGravity = true; - dust.velocity *= 0.1f; - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.ai[1] = 10f; - return false; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Daybreak, 90); - - public override Color? GetAlpha(Color lightColor) => new Color(255, 230, 130); - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - } - } -} diff --git a/Projectiles/Rogue/PanSpark.png b/Projectiles/Rogue/PanSpark.png deleted file mode 100644 index c74b2ed1a70e345c163f9500d5e65b4e36833276..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 313 zcmeAS@N?(olHy`uVBq!ia0vp^GC-`w!3-p)e>g1$q!^2X+?^QKos)S9^9T5Zxc>Zq>)R2#zki~xHmU%{c1(}&2U4shL4Lvifq>!nHojn>0B3G z^JVUxKN+-QYxAkomkgb+c3D+U;BXR5`(pB7<3gF9#-|PfUJizi#M@6@zlr^bbq?o(Bb~$yMHGiVPa0MTs(X7 "Projectiles.Rogue"; - internal enum SearedPanTypes - { - VenLocket = 0, - Normal = 1, - Golden = 2, - StealthStrike = 3 - } - - internal SearedPanTypes PanType - { - get => (SearedPanTypes)(int)Projectile.ai[0]; - set => Projectile.ai[0] = (int)value; - } - - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Type] = 6; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = Projectile.height = 20; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.timeLeft = 420; - Projectile.DamageType = RogueDamageClass.Instance; - Projectile.extraUpdates = 2; - } - - public override void AI() - { - if (Main.rand.NextBool(5)) - { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Blood, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); - } - Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); - Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - // Don't increment the Seared Pan counter when hitting dummies - //&& target.type != ModContent.NPCType() this is here just in case its needed again - bool dummy = target.type != NPCID.TargetDummy; - OnHitEffects(target.whoAmI, target.life, dummy); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(BuffID.Bleeding, 300); - OnHitEffects(-1, target.statLife, true); - } - - private void OnHitEffects(int targetIndex, int health, bool specialEffects) - { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - - // Don't spawn fireballs or increment the special effects counter if you can't even stealth strike - bool playerCanStealthStrike = modPlayer.wearingRogueArmor && modPlayer.rogueStealthMax > 0; - if (!playerCanStealthStrike) - return; - - // Increment the seared pan counter. Pans summoned via the Venerated Locket shouldn't increment the counter. - // See CalamityPlayerMiscEffects.cs for code that resets the counter after 40 frames - modPlayer.searedPanTimer = 0; - if (specialEffects && PanType != SearedPanTypes.VenLocket) - modPlayer.searedPanCounter++; - - // Pans summoned via the Venerated Locket have zero special effects - if (PanType == SearedPanTypes.StealthStrike) - { - modPlayer.searedPanCounter = 0; - // Stealth strikes spawn four golden sparks on hit - for (int t = 0; t < 4; t++) - { - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.2), 0f, Projectile.owner); - } - SoundEngine.PlaySound(SearedPan.SmashSound, Projectile.position); - // Stealth strikes also cause any existing fireballs to home in on their targets - FireballStuff(true); - - if (!specialEffects) - return; - // Stealth strikes then summon five fireballs to circle the hit enemy, they will home in on their own after a second. - for (int t = 0; t < 5; t++) - { - int i = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), 0f, Projectile.owner, 0f, targetIndex); - Main.projectile[i].ModProjectile().Timer = 61; - } - FireballPositions(targetIndex); - } - else if (PanType == SearedPanTypes.Golden) - { - modPlayer.searedPanCounter = 0; - SoundEngine.PlaySound(SearedPan.SmashSound, Projectile.position); - // Golden pans simply cause all fireballs to home in on their targets - FireballStuff(true); - } - else if (PanType == SearedPanTypes.Normal && targetIndex != -1 && health > 0 && specialEffects) - { - // Summon three fireballs to circle the hit enemy - for (int t = 0; t < 3; t++) - { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), 0f, Projectile.owner, 0f, targetIndex); - } - FireballPositions(targetIndex); - } - } - - private void FireballStuff(bool activate) - { - if (Projectile.owner == Main.myPlayer) - { - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.owner != Projectile.owner) - continue; - if (p.ModProjectile is NiceCock) - { - if (!activate) - p.Kill(); - else - { - p.ModProjectile().homing = true; - p.extraUpdates += 2; - } - } - } - } - } - - private void FireballPositions(int targetIndex) - { - int fireballCount = 0; - // Count how many fireballs exist already around the given target - foreach (Projectile p in Main.ActiveProjectiles) - { - // Keep the loop as short as possible - if (p.owner != Projectile.owner || !p.CountsAsClass() || targetIndex != (int)p.ai[1]) - continue; - if (p.ModProjectile is NiceCock) - { - if (p.ModProjectile().homing) - continue; - fireballCount++; - } - } - // Adjust the angle of the existing fireballs around a target - float angleVariance = MathHelper.TwoPi / fireballCount; - float angle = 0f; - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.owner != Projectile.owner || !p.CountsAsClass() || targetIndex != (int)p.ai[1]) - continue; - if (p.ModProjectile is NiceCock) - { - if (p.ModProjectile().homing) - continue; - p.ai[0] = angle; - p.netUpdate = true; - angle += angleVariance; - } - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - // Kill all fireballs if you miss a stealth strike or golden pan - if (PanType == SearedPanTypes.Golden || PanType == SearedPanTypes.StealthStrike) - FireballStuff(false); - return true; - } - - public override Color? GetAlpha(Color lightColor) - { - // Stealth strikes and golden pans are golden colored - if (PanType == SearedPanTypes.Golden || PanType == SearedPanTypes.StealthStrike) - return new Color(255, 222, 0); - return null; - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - } - } -} diff --git a/Projectiles/Rogue/SearedPanProjectile.png b/Projectiles/Rogue/SearedPanProjectile.png deleted file mode 100644 index 559b586cb82c928d727393035e6c31a743a3bfac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 469 zcmeAS@N?(olHy`uVBq!ia0vp^PC(4V!3HF+v1NY&QY`6?zK#qG8~eHcB(ehejKx9j zP7LeL$-D$|6p}rHd>I(3)EF2VS{N990fib~Fff!FFfhDIU|_JC!N4G1FlSew4N!tD z$=lt9;Xep2*t>i(&?IF~7sn8f(+2|u1hkik2OzuN^$y|=CDIaFS}$@$^?{RN_{_pN@e|H$1B}Tt(p8v&;P72`|BRqhhaED4Sh(f~ zoci(ioo?924Qp~l>^5pL*{a6qdVp@-bWv1qpB$j06=P?+zM7((qlx6UA^>bP0l+XkK6oR$* diff --git a/Sounds/Item/SearedPanSmash.ogg b/Sounds/Item/SearedPanSmash.ogg deleted file mode 100644 index c39b602f293c27ab23a758810da662e5ad12e205..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18250 zcmeIacUY6j+dn!fgb<1$6zK*C2%!iX5K!DC5K17JgaoNdRf3?PfZYucS||bnY6MLJ zfe=9jX`<^Qg1tZ}A_!s!EUT{FT|E!(_kF+L_xH~^*Y%#i&UNOR%yUnl`P}o&-1p2p zS-WXdFo1)98T^U8e=d-Zw{@O{nZYu*Zj0q@UkHGEH!nN@;CH}&KD%LS7jpi$S;)B% zb8VTGyEf&=|1_$Ie@fDX5(LI%Zgg>TT^~V{D*rsKs9qs3Kn8%Y-GJyL+paIb8c~^sk4>nzH@`Hb25M)UEDwyhVYR)? zyk1N#h_J~TEaQTO4EdCux&k2uZ7#6#46Vpn>IqQ=?ob$SAq-3XFNfxy2*py+rh>;# zZW=jH-9DQLXzrm{C~OulSVZj>atcjq{-bR?+@6@d?K)TozXFqYe zI+CMKEfD4SyL>hhY@+Pc|ECTD#jh*}MY(Dq@S#90K)HA83T{y3MgpQcdWir}iq`{W z0EneFLa7Y~Yt)7TR{_A1S-Mx!Os3xU8z1x{G`5!i-I>GQ~b_hePlDDx5Rp5j$ME&Fg)C|71(5avQUm)`h=vq>>7WW4= zkHukHB6_R4X^mgUu8O0=v+mDpw%@+?tj75^L`iGHG(=Fk=QaJ}Fw8&H($-yrBH}_= z+U>dM8tuyvW!4@!RgY7rnX9<`zY`*Xbcw-ExAgj-7cwSSV< z>UgqrX~QJ$kX{sPWeUqRVb~=q*fok9lCrKkC89H9@=(I$r+p9p!$zt8>>>^Tj|xlM z3Jcqc$8Mzre{$kgA|Rs{-bmpio6^T_6$JkZD_+H>UDfgD*{0CpkCf)O_C z6gKS?%6FE|7E~l2sg^g1?5;Pw>^b@3|IVua9N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j|5!@v VJ6&RLFqqhXWbyH1aPczme*vUJQltO? From ae9f038d0ed3db9afff837d7ddc8f616ddf92a98 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 20 Nov 2025 13:02:01 -0500 Subject: [PATCH 30/48] Removed from Thank You --- Items/Placeables/Furniture/Paintings/ThankYouPainting.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs index 5a84fa4b08..efd95563bb 100644 --- a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs @@ -85,7 +85,6 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "Raesh", "Sagittariod", "Shade", - "Shayy", "Spider Prov", "StipulateVenus", "Sunny", From 2c27c5528e6f665aabc29b4fb60544f8356b4a52 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 20 Nov 2025 13:10:44 -0500 Subject: [PATCH 31/48] Removed remaining instances from repo --- NPCs/CalamityGlobalTownNPC.cs | 1 - Sounds/Custom/BEES/Names.txt | 2 +- Sounds/Custom/BEES/bees8.ogg | Bin 8165 -> 0 bytes Systems/Collections/DonatorsNameList.cs | 1 - 4 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 Sounds/Custom/BEES/bees8.ogg diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 93cd34033c..2e7bc1a3af 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -210,7 +210,6 @@ namespace CalamityMod.NPCs }; private static readonly string[] SkeletonMerchantNames = { - "Sans Undertale", // <@!145379091648872450> (shayy) "Papyrus Undertale", // <@!262663471189983242> (nycro) "Gaster Undertale", // <@!924706306093379614> (enamoured) "Mr. Bones", // <@!359215912856977408> (jaybones.) diff --git a/Sounds/Custom/BEES/Names.txt b/Sounds/Custom/BEES/Names.txt index 5645ea0a79..0ddbdd5284 100644 --- a/Sounds/Custom/BEES/Names.txt +++ b/Sounds/Custom/BEES/Names.txt @@ -6,7 +6,7 @@ Names: 5 - moonburn 6 - Ozzatron 7 - Rebecca -8 - Shayy +8 - Unused 9 - StipulatedVenus 10 - Xyk 11 - Shade diff --git a/Sounds/Custom/BEES/bees8.ogg b/Sounds/Custom/BEES/bees8.ogg deleted file mode 100644 index 677b47fc65e1183447e5b05bede81848295b2c91..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8165 zcmd6Mdpwlg*Y`E#kVC1QkE4WShMZGFj+Gllc&^cX|DNCbd7tNfKJVxK=iQ%u?b&;+wZGR|Yp=ccx;|s!>1hqH z0DqU#Grv2RPBz?yNJ4`A16^?hCJ7SW{G0R7ZzIHlIrCqIITHeoO7%v>`F5js|GlWO z{sw}Be0yAgmy$)GC)5|`YP$yyHHNCGsHv!&R)It1kyv+<8_v%Ydd@Eh7wGSY$NCXr zT;Mzy__zgPU5Ge;KW8EikJSMu!B483I;o;=qoSgvrmm%qP*T||4m_Z+uZy22$;A_^ zL-KP!2#)bMKmS1IAZ#E3M9@(Y0ZCpie(t{5KxaP}5YE~k6g2ux5d@h*SU-1g0?u8> zQ3dm_DhYD1es2Em*gzdqmmoI{6{S;3swyf>bAB7i$9$KIH#pTb5Jc0#2f)=tL7JOC zJ^<9-)ffAlL11!JaRh(-Igm@l5q+^bNUR%ZFVqcG%o9t1o`hO>c;MV{F22ySF1{{! z95EPb=I;)*!};K#AH!3@K?u&**9CeW7l`%nzsj`9C6I_C5OvIOZh`&;e-9$m5Ht>I zV2gyX{nk%P|Ew*zP!K@a%?5Tp3;E6@R)mnMdOpiF#U!>gQc&M0m%wjbfuQI3R6VYT zM)HYTTf*3~kcmi~h+7h~$9KW_IPtKST&^3RqjB3%rq3O{2JuKjyFy-YH%fFt9>}4r-uK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-BWH@`j|fUYuR}`N6(PABh^vMZC2Z5Mgbt|I&L# zYKL3cbGe_Unfo*##ovucu?#YbpJvf_e1gI zj#SAvBbVB1S~;cJ--d)7S4IL)>sUQ8PPk77LyJEd#bzNIvJLImora}CDxIacDJtyi z=G?ph@sA(pTy>k-5Nb-n_u7BHJJh-UTydB`c0c!1tL}BRZONQ#_5xvvb~@4e_H?#Y z!)HJ7q|nf2BSYaISx?Fu(f$|Or5o1R=I%U}^DL37>B$gx(sp|P$s@V60nYVEV?1b! z@#JZ6MMM0#*-*15-w&yY1k|)CNCX(f zQa5B8O4)&W+4Ir*K2kqg)_o^W80vg{H^7glCf>TM>DyA#or`~SdzyFta(>Rk^VMy& zfBIBvaIdrYPtb16ihN4;MAt{%jOZ5msPZzT9 zE6_40P-)!7{bGnmOsP3aXvB<8(ss);NYp=At zPus#0b$za}pN?twJBq^JRQ?t5H1E~&yS9KCfrsU&^W+GRKWUi{3v7<3Lt6(-1wqHH9Y}oDm(Hae_*|mw!o!bM#@tlV_t(Q5?Z3bZgXDM^B%+>h;@eZ57ls^~ zJS{8#fvA*A9qyZg^1hkL%?4}yt*jzqD(v$^{RMrDd947r3!a<9jzd~@XfqC zZgA^``^y{EQhXnS?$-B|JNE15HOpN_Dd!JFAG?0xEYdrMJmVx@)3Z)imP7Ead@6V3 zy%zkAgPtfGreAO{82I*HZd1oJa2}8XoaRFPc^^4%zd>-4P?2~TvbGAC=jB~lZywhk z{_=exqq7~({J&*DRyX4MNKWtRw(4r@zzN&9FKfeZruVZB4=yZhve)uIqdD<#!Ezq; nhPk`EO)$G#Ps-+R&Ak%C4VZI;VCek1tYfiO0WCoILEt|C Date: Thu, 20 Nov 2025 13:16:59 -0500 Subject: [PATCH 32/48] Restored Sans Undertale with different dedication --- NPCs/CalamityGlobalTownNPC.cs | 1 + Systems/Collections/DonatorsNameList.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 2e7bc1a3af..fbfdf1a4e2 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -210,6 +210,7 @@ namespace CalamityMod.NPCs }; private static readonly string[] SkeletonMerchantNames = { + "Sans Undertale", // <@!534770496038895616> (done_22_) "Papyrus Undertale", // <@!262663471189983242> (nycro) "Gaster Undertale", // <@!924706306093379614> (enamoured) "Mr. Bones", // <@!359215912856977408> (jaybones.) diff --git a/Systems/Collections/DonatorsNameList.cs b/Systems/Collections/DonatorsNameList.cs index 2aebb2cfd4..58f140c34d 100644 --- a/Systems/Collections/DonatorsNameList.cs +++ b/Systems/Collections/DonatorsNameList.cs @@ -618,7 +618,7 @@ namespace CalamityMod.Systems.Collections "Shadoku", "SharZz", "Shaun", - "Shay", // There were two "Shay"s on the old list + //"Shayy", // Removed from circulation as the user in question committed acts undeserving of recognition "sherk", "Shifter", "Shiny", From e619b1426e88dfb6344efd245762664b7b3b3e36 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 20 Nov 2025 18:16:18 -0500 Subject: [PATCH 33/48] Giant Hive now generates randomly underground The large surface living mahogany tree still exists, separate from the hive --- Localization/en-US/Mods.CalamityMod.UI.hjson | 1 + Systems/World/WorldgenManagementSystem.cs | 20 +++++++++++++++++++- World/GiantHive.cs | 17 ++++++++++++++--- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index d01cc8ac60..79e29e3425 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -618,6 +618,7 @@ ShimmerShrine: Excavating an ancient shimmer well EvilIslandCorrupt: Adding a putrid floating island EvilIslandCrimson: Adding a grotesque floating island AstralChest: Placing an astral chest +LivingMahoganyTree: Growing a giant jungle tree BetterJungleTemple: Building a bigger jungle temple JungleTempleAltar: Placing the Lihzahrd altar GiantBeehive: Building a giant beehive diff --git a/Systems/World/WorldgenManagementSystem.cs b/Systems/World/WorldgenManagementSystem.cs index f88fefc31f..8774fd17dc 100644 --- a/Systems/World/WorldgenManagementSystem.cs +++ b/Systems/World/WorldgenManagementSystem.cs @@ -107,6 +107,24 @@ namespace CalamityMod.Systems })); } + // Generate a large Living Mahogany tree on the surface of the jungle (or anywhere in Drunk world) + int livingTreeIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Living Trees")); + if (livingTreeIndex != -1) + { + tasks.Insert(livingTreeIndex + 1, new PassLegacy("Living Mahogany Tree", (progress, config) => + { + progress.Message = Language.GetOrRegister("Mods.CalamityMod.UI.LivingMahoganyTree").Value; + int attempts = 0; + while (attempts < 1000) + { + attempts++; + Point origin = WorldGen.RandomWorldPoint((int)Main.worldSurface + 25, 100, Main.maxTilesY - (int)Main.worldSurface - 125, 100); + if (GiantHive.GrowLivingJungleTree(origin, GenVars.structures)) + break; + } + })); + } + // Larger Jungle Temple int jungleTempleIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Jungle Temple")); if (jungleTempleIndex != -1) @@ -162,7 +180,7 @@ namespace CalamityMod.Systems while (attempts < 1000) { attempts++; - Point origin = WorldGen.RandomWorldPoint((int)Main.worldSurface + 25, 20, Main.maxTilesY - (int)Main.worldSurface - 125, 20); + Point origin = WorldGen.RandomWorldPoint((int)Main.worldSurface + 25, 100, Main.maxTilesY - (int)Main.UnderworldLayer + 125, 100); if (GiantHive.CanPlaceGiantHive(origin, GenVars.structures)) break; } diff --git a/World/GiantHive.cs b/World/GiantHive.cs index b5fbcbd987..faeea12c16 100644 --- a/World/GiantHive.cs +++ b/World/GiantHive.cs @@ -31,8 +31,21 @@ namespace CalamityMod.World { public class GiantHive { - public static bool GrowLivingJungleTree(Point origin) + public static bool GrowLivingJungleTree(Point origin, StructureMap structures) { + if (!structures.CanPlace(new Rectangle(origin.X - 50, origin.Y - 50, 100, 100))) + return false; + + if (TooCloseToImportantLocations(origin)) + return false; + + Ref ref1 = new Ref(0); + Ref ref2 = new Ref(0); + Ref ref3 = new Ref(0); + WorldUtils.Gen(origin, new Shapes.Circle(15), Actions.Chain(new Modifiers.IsSolid(), new Actions.Scanner(ref1), new Modifiers.OnlyTiles(TileID.JungleGrass, TileID.Mud), new Actions.Scanner(ref2), new Modifiers.OnlyTiles(TileID.JungleGrass), new Actions.Scanner(ref3))); + if ((ref2.Value / (float)ref1.Value < 0.75f || ref3.Value < 2) && !WorldGen.drunkWorldGen) + return false; + int treeHeight = (int)Main.worldSurface - (Main.maxTilesY / 10); //start here to not touch floating islands bool validHeightFound = false; int attempts = 0; @@ -220,8 +233,6 @@ namespace CalamityMod.World } } - GrowLivingJungleTree(new Point(origin.X, origin.Y)); - CreateStandForLarva(larvaLocation); // Generate a second larva stand From 809fea87ff5c77f92d4e94e91d8a15530b6076b9 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Fri, 21 Nov 2025 11:59:08 +0900 Subject: [PATCH 34/48] Dictionary -> ConcurrentDictionary --- Systems/TileMerging/TileBlendMergeSystem_TileData.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Systems/TileMerging/TileBlendMergeSystem_TileData.cs b/Systems/TileMerging/TileBlendMergeSystem_TileData.cs index 5cded28957..6f602c76f2 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_TileData.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_TileData.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Concurrent; using Terraria; using Terraria.ModLoader; @@ -7,7 +7,7 @@ namespace CalamityMod.Systems public sealed partial class TileBlendMergeSystem : ModSystem { // Blending Refs for every tiles - private static readonly Dictionary _TileBlendingRefs = []; + private static readonly ConcurrentDictionary _TileBlendingRefs = []; public override void ClearWorld() { @@ -20,7 +20,7 @@ namespace CalamityMod.Systems return; var tileIdx = tileX + (Main.tile.Width * tileY); - _TileBlendingRefs.Remove(tileIdx); + _TileBlendingRefs.TryRemove(tileIdx, out _); } public static void SetBlendingRefData(int tileX, int tileY, TileBlendingRef[] blendingRef) From 0d4a286be02badc10af4f1c751d52c9c9b507245 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 20 Nov 2025 23:21:10 -0500 Subject: [PATCH 35/48] Removed Dreadstone and Underworld pillars --- Items/Placeables/Underworld/Dreadstone.cs | 17 -- Items/Placeables/Underworld/Dreadstone.png | Bin 282 -> 0 bytes .../Mods.CalamityMod.Items.Placeables.hjson | 5 - Localization/en-US/Mods.CalamityMod.UI.hjson | 1 - Systems/World/WorldgenManagementSystem.cs | 3 - Tiles/Underworld/Dreadstone.cs | 40 ---- Tiles/Underworld/Dreadstone.png | Bin 7275 -> 0 bytes World/CustomUnderworld.cs | 201 +----------------- 8 files changed, 7 insertions(+), 260 deletions(-) delete mode 100644 Items/Placeables/Underworld/Dreadstone.cs delete mode 100644 Items/Placeables/Underworld/Dreadstone.png delete mode 100644 Tiles/Underworld/Dreadstone.cs delete mode 100644 Tiles/Underworld/Dreadstone.png diff --git a/Items/Placeables/Underworld/Dreadstone.cs b/Items/Placeables/Underworld/Dreadstone.cs deleted file mode 100644 index 1927f25e75..0000000000 --- a/Items/Placeables/Underworld/Dreadstone.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Placeables.Underworld -{ - public class Dreadstone : 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/Underworld/Dreadstone.png b/Items/Placeables/Underworld/Dreadstone.png deleted file mode 100644 index 3ad756b5e31e9c7ff7e3788893cae96d653263ae..0000000000000000000000000000000000000000 GIT binary patch literal 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>^N~G&*|%@eTj=#NbYJ)wl8P5j Odv+y!P`mTk*Z&C&cDIKB diff --git a/World/CustomUnderworld.cs b/World/CustomUnderworld.cs index 3271f7e3f4..21608b0539 100644 --- a/World/CustomUnderworld.cs +++ b/World/CustomUnderworld.cs @@ -1,14 +1,11 @@ using System; using System.Collections.Generic; -using CalamityMod.Tiles.Underworld; using CalamityMod.Schematics; using Microsoft.Xna.Framework; -using ReLogic.Utilities; using Terraria; using Terraria.DataStructures; using Terraria.GameContent.Generation; using Terraria.ID; -using Terraria.ModLoader; using Terraria.WorldBuilding; using static CalamityMod.Schematics.SchematicManager; @@ -30,10 +27,10 @@ namespace CalamityMod.World private const int SmallWorldOuterIslands = 1; private const int MediumAndLargeWorldOuterIslands = 2; - // Pillar variables - private const int MaxPillarHeight = 68; - private const int RandomizedPillarSectionHeight = 4; - private const int MaxPillarDepthAboveTheUnderworldFloor = 40; + // Wall variables + private const int MaxWallHeight = 68; + private const int RandomizedWallSectionHeight = 4; + private const int MaxWallDepthAboveUnderworldFloor = 40; public static void NewUnderworld() { @@ -433,11 +430,11 @@ namespace CalamityMod.World } // Generate a line of background walls from the approximate underworld lava line and down - int maxWallHeight = MaxPillarHeight; - int randomizedWallSectionsHeight = RandomizedPillarSectionHeight; + int maxWallHeight = MaxWallHeight; + int randomizedWallSectionsHeight = RandomizedWallSectionHeight; int maxWallTypes = 4; int newWallTypeStart = maxWallHeight / maxWallTypes; - int maxWallDepth = Main.maxTilesY - MaxPillarDepthAboveTheUnderworldFloor; + int maxWallDepth = Main.maxTilesY - MaxWallDepthAboveUnderworldFloor; int smoulderingStoneWallStartDepth = maxWallDepth - maxWallHeight; int cinderWallStartDepth = smoulderingStoneWallStartDepth + newWallTypeStart; int emberWallStartDepth = cinderWallStartDepth + newWallTypeStart; @@ -1276,190 +1273,6 @@ namespace CalamityMod.World } } - public static void NewUnderworldPillars() - { - int maxWallHeight = MaxPillarHeight; - int randomizedWallSectionsHeight = RandomizedPillarSectionHeight; - int maxWallDepth = Main.maxTilesY - MaxPillarDepthAboveTheUnderworldFloor; - int smoulderingStoneWallStartDepth = maxWallDepth - maxWallHeight; - - // Generate after houses to avoid complications - // Place pillars of walls to show that the roof of the underworld is being held up - // Do not place any pillars in the Brimstone Crags - bool cragsLocationIsLeft = GenVars.dungeonLocation < Main.maxTilesX / 2; - int brimstoneCragsSize = Main.maxTilesX / 5; - int brimstoneCragsLocationStart = cragsLocationIsLeft ? (25 + brimstoneCragsSize) : ((Main.maxTilesX - brimstoneCragsSize) - 25); - int pillarDistanceFromCragsLimit = 160; - int pillarIndexStartX = (cragsLocationIsLeft ? brimstoneCragsLocationStart : 0) + pillarDistanceFromCragsLimit; - int pillarIndexEndX = (cragsLocationIsLeft ? Main.maxTilesX : brimstoneCragsLocationStart) - pillarDistanceFromCragsLimit; - int pillarIndexStarY = Main.maxTilesY - 200; - int pillarIndexEndY = smoulderingStoneWallStartDepth + randomizedWallSectionsHeight; - int pillarMidPointY = pillarIndexStarY + (pillarIndexEndY - pillarIndexStarY) / 2; - int pillarCutOffCheckStart = pillarMidPointY - 10; - int pillarMinWidth = 6; - int pillarMinWidthPerSide = pillarMinWidth / 2; - int pillarMinStartingWidth = 18; - int pillarMaxWidth = 24; - int pillarMaxWidthPerSide = pillarMaxWidth / 2; - int pillarY = 0; - int pillarLeftSize = 0; - int pillarRightSize = 0; - int topTileSectionSize = 10; - int pillarTopTileSectionCutOff = pillarIndexStarY + topTileSectionSize; - ushort pillarTileID = Main.zenithWorld ? TileID.PoopBlock : (ushort)ModContent.TileType(); - ushort pillarWallID = Main.zenithWorld ? WallID.PoopWall : WallID.RocksUnsafe3; - - // Use the x tile index to find pillar locations - for (int x = pillarIndexStartX; x < pillarIndexEndX; x += WorldGen.genRand.Next(80, pillarDistanceFromCragsLimit + 1)) - { - int pillarStartingWidth = WorldGen.genRand.Next(pillarMinStartingWidth, pillarMaxWidth + 1); - pillarLeftSize = pillarStartingWidth / 2; - pillarRightSize = pillarStartingWidth / 2; - if (pillarStartingWidth % 2 != 0) - { - if (WorldGen.genRand.NextBool()) - pillarLeftSize++; - else - pillarRightSize++; - } - - int startOfPillarX = x - pillarMaxWidthPerSide; - int endOfPillarX = x + pillarMaxWidthPerSide; - int wallsDetected = 0; - bool tooManyWallsToPlacePillarRow = false; - - // Start the pillar at the top of the underworld and extend down to the hellstone wall - for (int y = pillarIndexStarY; y <= pillarIndexEndY; y++) - { - // The amount of walls required to stop generating the pillar when it's deeper than pillarCutoffCheckStart - int pillarCutOffSize = pillarLeftSize + pillarRightSize + 2; - - // Get the amount of empty space on the left and right of the pillar's X mid point - int emptySpaceOnLeft = pillarMaxWidthPerSide - pillarLeftSize; - int emptySpaceOnRight = pillarMaxWidthPerSide - pillarRightSize; - - // Used for wall cleanup around top tile section - int topTileSectionWallCleanupLeft = startOfPillarX + emptySpaceOnLeft + 1; - int topTileSectionWallCleanupRight = endOfPillarX - emptySpaceOnRight - 1; - - // Create sections of pillar - for (int x2 = startOfPillarX; x2 <= endOfPillarX; x2++) - { - // Check if there are too many walls in a line (this ends the current pillar generation and moves to the next) - if (Main.tile[x2, y].WallType != WallID.None) - { - // Only try to kill further pillar gen if the gen is beyond the pillar's mid point minus 10 tiles - if (y > pillarCutOffCheckStart) - wallsDetected++; - - if (wallsDetected > pillarCutOffSize) - { - tooManyWallsToPlacePillarRow = true; - break; - } - } - else - { - if (x2 >= startOfPillarX + emptySpaceOnLeft && x2 <= endOfPillarX - emptySpaceOnRight) - { - Main.tile[x2, y].WallType = pillarWallID; - - // Blocks on top to hold the pillars - if (y < pillarTopTileSectionCutOff) - { - // Clean up walls at the top so it doesn't look ugly - if (x2 <= topTileSectionWallCleanupLeft || x2 >= topTileSectionWallCleanupRight || y == pillarIndexStarY) - Main.tile[x2, y].WallType = WallID.None; - - Main.tile[x2, y].Get().HasTile = true; - Main.tile[x2, y].TileType = pillarTileID; - } - } - } - } - - // Break out if too many walls are already in place - if (tooManyWallsToPlacePillarRow) - break; - else - wallsDetected = 0; - - if (y < pillarMidPointY) - { - // Becomes more likely to become thinner the further down the pillar is before the mid point - pillarY++; - int chance = pillarY / 3; - if (chance < 2) - chance = 2; - - if (!WorldGen.genRand.NextBool(chance)) - { - switch (WorldGen.genRand.Next(4)) - { - default: - break; - - case 0: - pillarLeftSize--; - break; - - case 1: - pillarRightSize--; - break; - - case 2: - pillarLeftSize--; - pillarRightSize--; - break; - } - - // Cap the min width of each side of the pillar - if (pillarLeftSize < pillarMinWidthPerSide) - pillarLeftSize = pillarMinWidthPerSide; - if (pillarRightSize < pillarMinWidthPerSide) - pillarRightSize = pillarMinWidthPerSide; - } - } - else - { - // Becomes more likely to become thicker the further down the pillar is beyond the mid point - pillarY -= 2; - int chance = pillarY; - if (chance < 2) - chance = 2; - - if (WorldGen.genRand.NextBool(chance)) - { - switch (WorldGen.genRand.Next(4)) - { - default: - break; - - case 0: - pillarLeftSize++; - break; - - case 1: - pillarRightSize++; - break; - - case 2: - pillarLeftSize++; - pillarRightSize++; - break; - } - - // Cap the max width of each side of the pillar - if (pillarLeftSize > pillarMaxWidthPerSide) - pillarLeftSize = pillarMaxWidthPerSide; - if (pillarRightSize > pillarMaxWidthPerSide) - pillarRightSize = pillarMaxWidthPerSide; - } - } - } - } - } - public static void AshTreesAndGrass() { // Start generating islands at this point From 26c20595bb830c3f7303acfa61a37b206fb76199 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Fri, 21 Nov 2025 19:57:38 +0900 Subject: [PATCH 36/48] RampartOfDeities - HP% trigger effects are moved to PostUpdateEquips --- CalPlayer/CalamityPlayer.cs | 24 ++++++++++++++++++++++++ Items/Accessories/RampartofDeities.cs | 26 ++------------------------ 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ebc472c5ba..75ba1a7412 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4454,6 +4454,30 @@ namespace CalamityMod.CalPlayer Lighting.AddLight(Player.Center, Light * (0.55f + (oceanCrestTimer * 0.0035f))); } + if (rampartOfDeities) + { + // Ice Barrier buff inherited from Frozen Turtle Shell + if (Player.statLife <= Player.statLifeMax2 * 0.5) + Player.AddBuff(BuffID.IceBarrier, 5); + + // Paladin's Shield application + if (Player.statLife > Player.statLifeMax2 * 0.25f) + { + Player.hasPaladinShield = true; + if (Player.whoAmI != Main.myPlayer && Player.miscCounter % 10 == 0) + { + var localPlayer = Main.LocalPlayer; + if (localPlayer.team == Player.team && Player.team != 0) + { + float teamPlayerXDist = Player.position.X - localPlayer.position.X; + float teamPlayerYDist = Player.position.Y - localPlayer.position.Y; + if ((float)Math.Sqrt(teamPlayerXDist * teamPlayerXDist + teamPlayerYDist * teamPlayerYDist) < 800f) + localPlayer.AddBuff(BuffID.PaladinsShield, 20); + } + } + } + } + // True melee damage from various vanilla equipment placed here. // Titan Glove and ALL upgrades. diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index 68bc76f46d..a36913d189 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; @@ -7,7 +6,6 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -81,31 +79,11 @@ namespace CalamityMod.Items.Accessories player.panic = panicNecklaceEnabled; // Large hit iframe effect taken from Seraph Tracers + // IceBarrier and PaladinsShield effects are defined in CalPlayer.PostUpdateEquips modPlayer.rampartOfDeities = true; - // Ice Barrier buff inherited from Frozen Turtle Shell - if (player.statLife <= player.statLifeMax2 * 0.5) - player.AddBuff(BuffID.IceBarrier, 5); - // Knockback immunity inherited from Paladin's Shield player.noKnockback = true; - - // Paladin's Shield application - if (player.statLife > player.statLifeMax2 * 0.25f) - { - player.hasPaladinShield = true; - if (player.whoAmI != Main.myPlayer && player.miscCounter % 10 == 0) - { - int myPlayer = Main.myPlayer; - if (Main.player[myPlayer].team == player.team && player.team != 0) - { - float teamPlayerXDist = player.position.X - Main.player[myPlayer].position.X; - float teamPlayerYDist = player.position.Y - Main.player[myPlayer].position.Y; - if ((float)Math.Sqrt(teamPlayerXDist * teamPlayerXDist + teamPlayerYDist * teamPlayerYDist) < 800f) - Main.player[myPlayer].AddBuff(BuffID.PaladinsShield, 20); - } - } - } } public override void AddRecipes() From 52ed3384c9ac31e39f9c23348ad3a1eaf1b99a4b Mon Sep 17 00:00:00 2001 From: Flowaria Date: Fri, 21 Nov 2025 20:11:53 +0900 Subject: [PATCH 37/48] Removed Outdated tooltip modify on IceBarrier buff --- Buffs/CalamityGlobalBuff.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 0fe1c1512f..aa31164e4e 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -204,10 +204,6 @@ namespace CalamityMod.Buffs tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.ChaosState"); break; - case BuffID.IceBarrier: - tip = tip.Replace("25", "15"); - break; - case BuffID.MagicPower: tip = tip.Replace("20", "10"); break; From 6c1feae1931e2b27483f222325a0b4ec0f3ed460 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 21 Nov 2025 18:17:18 +0700 Subject: [PATCH 38/48] 1) Revised all 'A' accessory tooltips and added formats 2) Reduced Aquatic Emblem scaling time from 83.33 to 10 seconds 3) ACTUALLY removed Void of Extinction inflicting Brimstone Flames 4) Removed some deprecated variables 5) Fixed Ascendant/Soaring Insignia funnies --- CalPlayer/CalamityPlayer.cs | 24 ++-- CalPlayer/CalamityPlayerHitHurt.cs | 4 +- CalPlayer/CalamityPlayerLifeRegen.cs | 10 +- CalPlayer/CalamityPlayerMiscEffects.cs | 43 ++++--- CalPlayer/CalamityPlayerOnHit.cs | 8 +- Items/Accessories/Abaddon.cs | 7 +- Items/Accessories/AbyssalMirror.cs | 13 ++- Items/Accessories/AeroStone.cs | 6 +- Items/Accessories/Affliction.cs | 9 ++ Items/Accessories/AlchemicalFlask.cs | 5 + Items/Accessories/AlluringBait.cs | 7 +- Items/Accessories/AmalgamatedBrain.cs | 5 +- Items/Accessories/AmbrosialAmpoule.cs | 7 +- Items/Accessories/AncientFossil.cs | 7 +- Items/Accessories/AngelicAlliance.cs | 21 +++- Items/Accessories/AquaticEmblem.cs | 7 ++ Items/Accessories/AquaticHeart.cs | 5 +- Items/Accessories/ArcFlashRing.cs | 6 + Items/Accessories/ArchaicPowder.cs | 10 +- Items/Accessories/AscendantInsignia.cs | 15 ++- Items/Accessories/RadiantOoze.cs | 6 + Items/Accessories/VoidofExtinction.cs | 9 +- .../Mods.CalamityMod.Items.Accessories.hjson | 106 +++++++++--------- .../en-US/Mods.CalamityMod.Vanilla.hjson | 2 +- 24 files changed, 215 insertions(+), 127 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ebc472c5ba..f39081b8ab 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -366,12 +366,8 @@ namespace CalamityMod.CalPlayer public int dragonRageHits = 0; /// Cooldown variable for Dragon Rage's fireball spawning to prevent spamming projectiles when hitting multiple enemies simultaneously. public int dragonRageCooldown = 0; - public const float AquaticBoostMax = 10000f; - /// - /// Counter variable which controls Aquatic Emblem's stat boosts while underwater.
- /// This counter starts at , and is decremented by 2 for every frame the player remains underwater, reaching maximum boosts when it hits 0. - ///
- public float aquaticBoost = 0f; + /// Counter variable which controls Aquatic Emblem's stat boosts while underwater. + public float aquaticBoost = 0; public int galileoCooldown = 0; /// Used to track Prideful Hunter's Planar Ripper's movement speed boost, along with its visual effects. public int planarSpeedBoost = 0; @@ -800,7 +796,6 @@ namespace CalamityMod.CalPlayer public bool ascendantInsignia = false; public int ascendantInsigniaBuffTime = 0; public int ascendantInsigniaCooldown = 0; - public bool ascendantTrail = false; /// Used to toggle dust spawned while swinging, through accessory visibility. public bool magmaStoneVisuals = true; public bool eGauntlet = false; @@ -2021,7 +2016,7 @@ namespace CalamityMod.CalPlayer percentMaxLifeIncrease += 25; if (affliction || afflicted) - percentMaxLifeIncrease += 10; + percentMaxLifeIncrease += Affliction.MaxLifeBoostPercent; if (community) percentMaxLifeIncrease += (int)(TheCommunity.CalculatePower() * TheCommunity.HealthMultiplier); @@ -2237,7 +2232,6 @@ namespace CalamityMod.CalPlayer teslaVisuals = true; cryogenSoul = false; ascendantInsignia = false; - ascendantTrail = false; magmaStoneVisuals = true; eGauntlet = false; eGauntletVisuals = true; @@ -3239,7 +3233,6 @@ namespace CalamityMod.CalPlayer CurrentlyViewedHologramText = string.Empty; #endregion - ascendantTrail = false; evilSmasherBoost = 0; burningSeaBurnOut = 0; flareGunOverheat = 0; @@ -3311,8 +3304,8 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_Accessory(FindAccessory(ItemType())); Projectile.NewProjectile(source, Player.Center - Vector2.UnitY * 45f, Vector2.Zero, ProjectileType(), 0, 0f); SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/AscendantActivate")); - ascendantInsigniaCooldown = 2400; - ascendantInsigniaBuffTime = 240; //4 seconds + ascendantInsigniaCooldown = AscendantInsignia.AbilityCooldown; + ascendantInsigniaBuffTime = AscendantInsignia.AbilityDuration; } int numOfBlobs = Player.ownedProjectileCounts[ProjectileType()]; @@ -3391,8 +3384,7 @@ namespace CalamityMod.CalPlayer } if (CalamityKeybinds.AngelicAllianceHotKey.JustPressed && angelicAlliance && Main.myPlayer == Player.whoAmI && !divineBless && !Player.HasCooldown(Cooldowns.DivineBless.ID)) { - int seconds = CalamityUtils.SecondsToFrames(15f); - Player.AddBuff(BuffType(), seconds, false); + Player.AddBuff(BuffType(), AngelicAlliance.DivineBlessDuration, false); SoundEngine.PlaySound(AngelicAlliance.ActivationSound, Player.Center); // Spawn an archangel for every minion you have @@ -3414,7 +3406,7 @@ namespace CalamityMod.CalPlayer float start = 360f / angelAmt; Projectile.NewProjectile(source, new Vector2((int)(Player.Center.X + (Math.Sin(projIndex * start) * 300)), (int)(Player.Center.Y + (Math.Cos(projIndex * start) * 300))), Vector2.Zero, ProjectileType(), proj.damage / 10, proj.knockBack / 10f, Player.whoAmI, Main.rand.Next(180), projIndex * start); - Player.HealPlayer(2); + Player.HealPlayer(AngelicAlliance.HealPerAngelSpawned); } } if (CalamityKeybinds.SpectralVeilHotKey.JustPressed && spectralVeil && Main.myPlayer == Player.whoAmI && rogueStealth >= rogueStealthMax * 0.25f && @@ -4557,7 +4549,7 @@ namespace CalamityMod.CalPlayer (CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) + (silvaSet ? SilvaArmor.AccelerationBoost : 0f) + (getSandCloakAccelBoost ? 0.75f : 0f) + - (ascendantInsignia ? 0.25f : 0f) + // Added to Soaring Insignia's 1.25x multiplier to get 1.5x + (ascendantInsignia ? (AscendantInsignia.AccelerationBoost - 0.25f) : 0f) + // Subtracted 0.25 provided by Soaring Insignia (statisNinjaBelt ? 0.6f : 0f) + (statisVoidSash ? 0.85f : 0f) + (blueCandle ? WeightlessCandle.AccelerationBoost : 0f) + diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index afe9da6ed0..6ecc8fd1d2 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1014,7 +1014,7 @@ namespace CalamityMod.CalPlayer bool isReducedTrap = (proj.trap || proj.type == ProjectileID.RollingCactusSpike || proj.type == ProjectileID.Landmine) && !isIgnoredTrap; if (Player.Calamity().trapProtection && isReducedTrap) - modifiers.SourceDamage *= 0.35f; + modifiers.SourceDamage *= (1f - ArchaicPowder.TrapDamageReduction); // Reduce damage dealt by rainbow trails if (proj.type == ProjectileID.HallowBossLastingRainbow) @@ -2261,7 +2261,7 @@ namespace CalamityMod.CalPlayer if (aquaticHeartIce) { SoundEngine.PlaySound(SoundID.NPCDeath7, Player.Center); - Player.AddCooldown(AquaticHeartIceShield.ID, CalamityUtils.SecondsToFrames(30)); + Player.AddCooldown(AquaticHeartIceShield.ID, AquaticHeart.IceShieldCooldown); for (int d = 0; d < 10; d++) { diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 20bce9b8de..f963418e0e 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -117,8 +117,8 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(crushDepth, 18, purity); ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity); ApplyDoTDebuff(shadowflame, 30, purity); - ApplyDoTDebuff(brimstoneFlames, abaddon ? 15 : 30, purity); - ApplyDoTDebuff(plague, alchFlask ? 15 : 30, purity); + ApplyDoTDebuff(brimstoneFlames, (int)MathF.Round(30 * (abaddon ? (1f - Abaddon.BrimstoneFlamesReduction) : 1f)), purity); + ApplyDoTDebuff(plague, (int)MathF.Round(30 * (abaddon ? (1f - AlchemicalFlask.PlagueReduction) : 1f)), purity); ApplyDoTDebuff(vHex, 30); // Has other effects ApplyDoTDebuff(searingLava, 30); ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player @@ -320,7 +320,7 @@ namespace CalamityMod.CalPlayer if (divineBless) { - if (Player.whoAmI == Main.myPlayer && Player.miscCounter % 15 == 0) // Flat 4 health per second + if (Player.whoAmI == Main.myPlayer && Player.miscCounter % AngelicAlliance.DivineBlessFramesPerHeal == 0) // Flat 4 health per second { if (!noLifeRegen) Player.HealPlayer(1, HealTextType.None); @@ -368,7 +368,7 @@ namespace CalamityMod.CalPlayer { float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / (float)Player.statLifeMax2; //Ambrosial Ampule and ooze give between 2 and 5 hp/s - int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp(4f, 10f, missingLifeRatio));//Rounding is needed for it to ever actually give +5 hp/s, as the integer conversion would otherwise floor it. + int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp(RadiantOoze.MinRegenBoost, RadiantOoze.MaxRegenBoost, missingLifeRatio));//Rounding is needed for it to ever actually give +5 hp/s, as the integer conversion would otherwise floor it. Player.lifeRegen += lifeRegenToGive; radiantOozeRegen += lifeRegenToGive / 2f; purityRegen += lifeRegenToGive / 2f; @@ -574,7 +574,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += HallowedRune.RegenBoost; if (affliction || afflicted) - Player.lifeRegen += 1; + Player.lifeRegen += Affliction.RegenBoost; if (trinketOfChi || chiRegen) Player.lifeRegen += 2; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 2cb5537364..cd5faf4a03 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2713,9 +2713,9 @@ namespace CalamityMod.CalPlayer // Affliction bonus if (affliction || afflicted) { - Player.endurance += 0.07f; - Player.statDefense += 9; - Player.GetDamage() += 0.1f; + Player.endurance += Affliction.DamageReductionBoost; + Player.statDefense += Affliction.DefenseBoost; + Player.GetDamage() += Affliction.DamageBoost; } float[] light = new float[3]; @@ -2938,8 +2938,8 @@ namespace CalamityMod.CalPlayer if (!ascendantInsignia && ascendantInsigniaBuffTime > 0) { ascendantInsigniaBuffTime = 0; - ascendantInsigniaCooldown = 2400; - Player.AddCooldown(AscendEffect.ID, 2400); + ascendantInsigniaCooldown = AscendantInsignia.AbilityCooldown; + Player.AddCooldown(AscendEffect.ID, AscendantInsignia.AbilityCooldown); } if (!brimflameSet && brimflameFrenzy) @@ -3306,15 +3306,14 @@ namespace CalamityMod.CalPlayer // Aquatic Emblem bonus if (aquaticEmblem) { - if (countsAsAnyWet && !Player.lavaWet && !Player.honeyWet && - !Player.mount.Active) + if (countsAsAnyWet && !Player.lavaWet && !Player.honeyWet && !Player.mount.Active) { - if (aquaticBoost > 0f) + if (aquaticBoost < AquaticEmblem.TimeToReachMaxBoost) { - aquaticBoost -= 2f; - if (aquaticBoost <= 0f) + aquaticBoost++; + if (aquaticBoost > AquaticEmblem.TimeToReachMaxBoost) { - aquaticBoost = 0f; + aquaticBoost = AquaticEmblem.TimeToReachMaxBoost; if (Main.netMode == NetmodeID.MultiplayerClient) NetMessage.SendData(MessageID.PlayerStealth, -1, -1, null, Player.whoAmI, 0f, 0f, 0f, 0, 0, 0); } @@ -3322,18 +3321,18 @@ namespace CalamityMod.CalPlayer } else { - aquaticBoost += 2f; - if (aquaticBoost > AquaticBoostMax) - aquaticBoost = AquaticBoostMax; + aquaticBoost--; + if (aquaticBoost <= 0f) + aquaticBoost = 0f; if (Player.mount.Active) - aquaticBoost = AquaticBoostMax; + aquaticBoost = 0f; } - Player.statDefense += (int)((1f - aquaticBoost * 0.0001f) * 20f); - Player.moveSpeed -= (1f - aquaticBoost * 0.0001f) * 0.1f; + Player.statDefense += (int)Utils.Remap(aquaticBoost, 0, AquaticEmblem.TimeToReachMaxBoost, 0, AquaticEmblem.MaxDefenseBoost); + Player.moveSpeed -= Utils.Remap(aquaticBoost, 0, AquaticEmblem.TimeToReachMaxBoost, 0, AquaticEmblem.MaxMoveSpeedReduction); } else - aquaticBoost = AquaticBoostMax; + aquaticBoost = 0f; if (Player.HeldItem.type == ModContent.ItemType() && Player.StandingStill(0.1f)) { @@ -3712,8 +3711,7 @@ namespace CalamityMod.CalPlayer (soaring ? SoaringPotion.FlightBoost : 0D) + (prismaticGreaves ? PrismaticGreaves.FlightTimeBoost : 0D) + (plagueReaper ? PlagueReaperMask.SetBonusFlightTimeBoost : 0D) + - (ascendantInsignia ? 0.17 : 0D) + // Added to soaring insignia's flight to get 50% - (Player.empressBrooch ? 0.33 : 0D) + + (ascendantInsignia ? AscendantInsignia.FlightTimeBoost : Player.empressBrooch ? 0.33D : 0D) + externalFlightTimeMultBoost; if (community) @@ -3957,10 +3955,9 @@ namespace CalamityMod.CalPlayer if (ascendantInsignia && ascendantInsigniaBuffTime > 0) { - ascendantTrail = true; infiniteFlight = true; if (ascendantInsigniaBuffTime == 1) - Player.AddCooldown(AscendEffect.ID, 2400); + Player.AddCooldown(AscendEffect.ID, AscendantInsignia.AbilityCooldown); ascendantInsigniaBuffTime--; } @@ -4336,7 +4333,7 @@ namespace CalamityMod.CalPlayer angelicActivate = -1; if (angelicActivate == 1) - Player.AddCooldown(Cooldowns.DivineBless.ID, CalamityUtils.SecondsToFrames(60)); + Player.AddCooldown(Cooldowns.DivineBless.ID, AngelicAlliance.DivineBlessCooldown); } if (theBee && Player.statLife >= Player.statLifeMax2 && (!HasAnyEnergyShield || TotalEnergyShielding >= TotalMaxShieldDurability)) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 90d305f192..ddd461c91f 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -202,11 +202,11 @@ namespace CalamityMod.CalPlayer // Arc Flash Ring lightning strike (Remember to change the one for projectile hits if applicable when you change this one!) // This one has a lot less limits than the projectile one, but that's because vanilla broadsword code is limiting (wow so surprising) - bool spawnChance = (Main.rand.Next(0, 100) < 6); + bool spawnChance = (Main.rand.Next(100) < ArcFlashRing.LightningSpawnPercent); if (arcFlashRing && spawnChance) { var source = item.GetSource_FromThis(); - int damage = (int)(((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline) + int damage = (int)(((hit.Damage * ArcFlashRing.LightningDamageMult) * (hit.Crit ? 0.5f : 1)) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline) Projectile bolt = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType(), damage, 0f, Player.whoAmI, target.whoAmI); bolt.DamageType = hit.DamageType; @@ -1227,7 +1227,7 @@ namespace CalamityMod.CalPlayer } if (divineBless) - target.AddBuff(BuffType(), 60); + target.AddBuff(BuffType(), AngelicAlliance.BanishingFireDuration); if (shadowMinions) target.AddBuff(BuffID.ShadowFlame, 180); @@ -1256,8 +1256,6 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), 120); target.AddBuff(BuffType(), 120); } - if (voidOfExtinction) - CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); if (frostFlare) CalamityUtils.Inflict246DebuffsNPC(target, BuffID.Frostburn2); if (omegaBlueChestplate) diff --git a/Items/Accessories/Abaddon.cs b/Items/Accessories/Abaddon.cs index cf3c780050..6f3dfd0ba5 100644 --- a/Items/Accessories/Abaddon.cs +++ b/Items/Accessories/Abaddon.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -9,7 +10,11 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; + public static int CritBoost = 8; + public static float BrimstoneFlamesReduction = 0.5f; public static int AbaddonExploDamage = 25; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, BrimstoneFlamesReduction.ToPercent()); + public override void SetDefaults() { Item.width = 26; @@ -22,7 +27,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().abaddon = true; - player.GetCritChance() += 8; + player.GetCritChance() += CritBoost; } } } diff --git a/Items/Accessories/AbyssalMirror.cs b/Items/Accessories/AbyssalMirror.cs index 40e9b7a0eb..d3135909f2 100644 --- a/Items/Accessories/AbyssalMirror.cs +++ b/Items/Accessories/AbyssalMirror.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -11,6 +12,12 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; public bool HasFlavorTooltip => true; + + public static int AggroReduction = 450; + public static float StandingStealthRegenBoost = 0.25f; + public static float MovingStealthRegenBoost = 0.12f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(StandingStealthRegenBoost.ToPercent(), MovingStealthRegenBoost.ToPercent()); + public override void SetDefaults() { Item.width = 30; @@ -23,10 +30,10 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.stealthGenStandstill += 0.25f; - modPlayer.stealthGenMoving += 0.12f; + modPlayer.stealthGenStandstill += StandingStealthRegenBoost; + modPlayer.stealthGenMoving += MovingStealthRegenBoost; modPlayer.abyssalMirror = true; - player.aggro -= 450; + player.aggro -= AggroReduction; } public override void AddRecipes() diff --git a/Items/Accessories/AeroStone.cs b/Items/Accessories/AeroStone.cs index 93676815e0..c1a23a6579 100644 --- a/Items/Accessories/AeroStone.cs +++ b/Items/Accessories/AeroStone.cs @@ -4,6 +4,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.GameContent; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -12,6 +13,9 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; + public static int FlightTimeBoostFlat = 50; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightTimeBoostFlat.FramesToSeconds()); + public override void SetStaticDefaults() { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(4, 8)); @@ -30,7 +34,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().aeroStone = true; - player.wingTimeMax += 50; + player.wingTimeMax += FlightTimeBoostFlat; } public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) diff --git a/Items/Accessories/Affliction.cs b/Items/Accessories/Affliction.cs index 443bffa212..1a4317f211 100644 --- a/Items/Accessories/Affliction.cs +++ b/Items/Accessories/Affliction.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -12,6 +13,14 @@ namespace CalamityMod.Items.Accessories public class Affliction : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int RegenBoost = 1; + public static int MaxLifeBoostPercent = 10; + public static float DamageReductionBoost = 0.07f; + public static int DefenseBoost = 9; + public static float DamageBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), MaxLifeBoostPercent, DamageReductionBoost.ToPercent(), DefenseBoost, DamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 38; diff --git a/Items/Accessories/AlchemicalFlask.cs b/Items/Accessories/AlchemicalFlask.cs index aea37c1bf8..15197f8af1 100644 --- a/Items/Accessories/AlchemicalFlask.cs +++ b/Items/Accessories/AlchemicalFlask.cs @@ -3,6 +3,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Accessories public class AlchemicalFlask : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static float PlagueReduction = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(PlagueReduction.ToPercent()); + public override void SetDefaults() { Item.width = 26; diff --git a/Items/Accessories/AlluringBait.cs b/Items/Accessories/AlluringBait.cs index 786435906e..d31ed4b4d0 100644 --- a/Items/Accessories/AlluringBait.cs +++ b/Items/Accessories/AlluringBait.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -7,6 +8,10 @@ namespace CalamityMod.Items.Accessories public class AlluringBait : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int FishingPowerBoost = 10; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FishingPowerBoost); + public override void SetDefaults() { Item.width = 26; @@ -19,7 +24,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().alluringBait = true; - player.fishingSkill += 10; + player.fishingSkill += FishingPowerBoost; } } } diff --git a/Items/Accessories/AmalgamatedBrain.cs b/Items/Accessories/AmalgamatedBrain.cs index ac6c8b1a82..15cefab5ce 100644 --- a/Items/Accessories/AmalgamatedBrain.cs +++ b/Items/Accessories/AmalgamatedBrain.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Projectiles.Magic; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -12,7 +13,9 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; + public static float DamageBoost = 0.05f; public static int NimbusDamage => CalamityUtils.ScaleWithDifficulty(18); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent()); public override void SetDefaults() { @@ -29,7 +32,7 @@ namespace CalamityMod.Items.Accessories modPlayer.rBrain = true; // Handles shaderain cloud spawning on hit modPlayer.aBrain = true; player.brainOfConfusionItem = Item; - player.GetDamage() += 0.05f; + player.GetDamage() += DamageBoost; } public override void AddRecipes() diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index 9036f66442..8cd7145e58 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Accessories public class AmbrosialAmpoule : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int MaxLifeBoost = 50; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifeBoost, RadiantOoze.MinRegenBoost.ToRegenPerSecond(), RadiantOoze.MaxRegenBoost.ToRegenPerSecond()); + public override void SetDefaults() { Item.width = 20; @@ -23,7 +28,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - player.statLifeMax2 += 50; + player.statLifeMax2 += MaxLifeBoost; if (!player.HasBuff(BuffID.Honey)) player.AddBuff(BuffID.Honey, 2); diff --git a/Items/Accessories/AncientFossil.cs b/Items/Accessories/AncientFossil.cs index 6293e34145..ef73c7adbe 100644 --- a/Items/Accessories/AncientFossil.cs +++ b/Items/Accessories/AncientFossil.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -7,6 +8,10 @@ namespace CalamityMod.Items.Accessories public class AncientFossil : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static float MiningSpeedBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MiningSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 26; @@ -18,7 +23,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.pickSpeed -= 0.1f; + player.pickSpeed -= MiningSpeedBoost; player.Calamity().aFossil = true; player.Calamity().fallingBlockProtection = true; } diff --git a/Items/Accessories/AngelicAlliance.cs b/Items/Accessories/AngelicAlliance.cs index e1b1cdfc06..e0cc74a488 100644 --- a/Items/Accessories/AngelicAlliance.cs +++ b/Items/Accessories/AngelicAlliance.cs @@ -6,6 +6,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.Audio; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -16,6 +17,18 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/AngelicAllianceActivation"); + // This accessory is insane. wtf. - Iris + public static int MinionSlotBoost = 2; + public static float TotalSummonDamageBoost = 0.15f; // this is partially all-class -- this number represents the whole thing + public static float DamageBoost = 0.08f; + public static int RegenBoostDuringFlight = 4; + public static int DivineBlessDuration = CalamityUtils.SecondsToFrames(15); + public static int DivineBlessCooldown = CalamityUtils.SecondsToFrames(60); + public static int HealPerAngelSpawned = 2; + public static int BanishingFireDuration = CalamityUtils.SecondsToFrames(1); + public static int DivineBlessFramesPerHeal = 15; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, TotalSummonDamageBoost.ToPercent(), DamageBoost.ToPercent(), RegenBoostDuringFlight.ToRegenPerSecond(), DivineBlessDuration.FramesToSeconds(), HealPerAngelSpawned, (60 / (float)DivineBlessFramesPerHeal).Round(), (DivineBlessCooldown / 3600f).Round()); + public override void SetDefaults() { Item.width = 56; @@ -32,11 +45,11 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.angelicAlliance = true; - player.GetDamage() += 0.08f; - player.GetDamage() += 0.07f; //7% + 8% = 15% - player.maxMinions += 2; + player.GetDamage() += DamageBoost; + player.GetDamage() += TotalSummonDamageBoost - DamageBoost; + player.maxMinions += MinionSlotBoost; if (player.wingTime < player.wingTimeMax) - player.lifeRegen += 4; + player.lifeRegen += RegenBoostDuringFlight; } public override void AddRecipes() diff --git a/Items/Accessories/AquaticEmblem.cs b/Items/Accessories/AquaticEmblem.cs index caca886525..760c5ba1ef 100644 --- a/Items/Accessories/AquaticEmblem.cs +++ b/Items/Accessories/AquaticEmblem.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -8,6 +9,12 @@ namespace CalamityMod.Items.Accessories public class AquaticEmblem : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int MaxDefenseBoost = 20; + public static float MaxMoveSpeedReduction = 0.1f; + public static int TimeToReachMaxBoost = CalamityUtils.SecondsToFrames(10); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(TimeToReachMaxBoost.FramesToSeconds(), MaxDefenseBoost, MaxMoveSpeedReduction.ToPercent()); + public override void SetDefaults() { Item.width = 18; diff --git a/Items/Accessories/AquaticHeart.cs b/Items/Accessories/AquaticHeart.cs index d8605af83c..be830a8235 100644 --- a/Items/Accessories/AquaticHeart.cs +++ b/Items/Accessories/AquaticHeart.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.BaseItems; using Terraria; using Terraria.Audio; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -14,6 +15,8 @@ namespace CalamityMod.Items.Accessories public static float WaterSpeedBoost = 0.15f; public static float IceShieldDamageReductionBoost = 0.2f; + public static int IceShieldCooldown = CalamityUtils.SecondsToFrames(30); + public static LocalizedText FullTooltip => CalamityUtils.GetText("Items.Accessories.AquaticHeart.FullTooltip").WithFormatArgs(WaterSpeedBoost.ToPercent(), IceShieldDamageReductionBoost.ToPercent(), IceShieldCooldown.FramesToSeconds()); public override string AssetPath => "CalamityMod/Items/Accessories/"; public override (EquipType, string, string)[] EquipSlots => @@ -39,7 +42,7 @@ namespace CalamityMod.Items.Accessories public override void ModifyTooltips(List tooltips) { - string statusTooltip = this.GetLocalizedValue(NPC.downedBoss3 ? "FullTooltip" : "LockedTooltip"); + string statusTooltip = NPC.downedBoss3 ? FullTooltip.ToString() : this.GetLocalizedValue("LockedTooltip"); tooltips.FindAndReplace("[STATUS]", statusTooltip); } } diff --git a/Items/Accessories/ArcFlashRing.cs b/Items/Accessories/ArcFlashRing.cs index 3599b8c00c..c2e110cae8 100644 --- a/Items/Accessories/ArcFlashRing.cs +++ b/Items/Accessories/ArcFlashRing.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.GameContent; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -11,6 +12,11 @@ namespace CalamityMod.Items.Accessories public class ArcFlashRing : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int LightningSpawnPercent = 6; + public static float LightningDamageMult = 4f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(LightningSpawnPercent, LightningDamageMult); + public override void SetDefaults() { Item.width = 56; diff --git a/Items/Accessories/ArchaicPowder.cs b/Items/Accessories/ArchaicPowder.cs index 452d0a0bcc..bb6f6d5597 100644 --- a/Items/Accessories/ArchaicPowder.cs +++ b/Items/Accessories/ArchaicPowder.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Placeables.Crags; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Accessories public class ArchaicPowder : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static float MiningSpeedBoost = 0.25f; + public static float TrapDamageReduction = 0.65f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MiningSpeedBoost.ToPercent(), TrapDamageReduction.ToPercent()); + public override void SetDefaults() { Item.width = 56; @@ -20,7 +26,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.pickSpeed -= 0.25f; + player.pickSpeed -= MiningSpeedBoost; player.Calamity().aPowder = true; player.Calamity().fallingBlockProtection = true; player.Calamity().trapProtection = true; @@ -29,7 +35,7 @@ namespace CalamityMod.Items.Accessories if (player.chiselSpeed) player.pickSpeed += 0.15f; if (player.Calamity().aFossil) - player.pickSpeed += 0.1f; + player.pickSpeed += AncientFossil.MiningSpeedBoost; } public override void AddRecipes() diff --git a/Items/Accessories/AscendantInsignia.cs b/Items/Accessories/AscendantInsignia.cs index d1d22d9a12..24f8cd8b45 100644 --- a/Items/Accessories/AscendantInsignia.cs +++ b/Items/Accessories/AscendantInsignia.cs @@ -7,6 +7,7 @@ using CalamityMod.Items.Placeables.Ores; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -15,6 +16,16 @@ namespace CalamityMod.Items.Accessories public class AscendantInsignia : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + // These values override Soaring Insignia's + public static double FlightTimeBoost = 0.5D; + public static float MoveSpeedBoost = 0.15f; + public static float JumpSpeedBoost = 0.75f; // NOTE: Tooltip shares this number with move speed % as they're equal + public static float AccelerationBoost = 0.5f; + public static int AbilityDuration = CalamityUtils.SecondsToFrames(4); + public static int AbilityCooldown = CalamityUtils.SecondsToFrames(40); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightTimeBoost.ToPercent(), MoveSpeedBoost.ToPercent(), (1f + AccelerationBoost).Round(), AbilityDuration.FramesToSeconds(), AbilityCooldown.FramesToSeconds()); + public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.AscendantInsigniaHotKey); public override void SetDefaults() { @@ -30,8 +41,8 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.ascendantInsignia = true; player.empressBrooch = true; - player.moveSpeed += 0.05f; - player.jumpSpeedBoost += 0.25f; + player.moveSpeed += MoveSpeedBoost; + player.jumpSpeedBoost += JumpSpeedBoost - 0.5f; } public override void AddRecipes() diff --git a/Items/Accessories/RadiantOoze.cs b/Items/Accessories/RadiantOoze.cs index 42a64e5120..6c5173059b 100644 --- a/Items/Accessories/RadiantOoze.cs +++ b/Items/Accessories/RadiantOoze.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -11,6 +12,11 @@ namespace CalamityMod.Items.Accessories public class RadiantOoze : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int MinRegenBoost = 4; + public static int MaxRegenBoost = 10; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(), MaxRegenBoost.ToRegenPerSecond()); + public override void SetDefaults() { Item.width = 20; diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index 33898f8cf4..01b6b8c0ea 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -12,10 +13,10 @@ namespace CalamityMod.Items.Accessories public class VoidofExtinction : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public const int FireProjectiles = 2; - public const float FireAngleSpread = 120; - public int FireCountdown = 0; + + public static int CritBoost = 13; public static int VoidExploDamage = 40; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, Abaddon.BrimstoneFlamesReduction.ToPercent()); public override void SetDefaults() { @@ -41,7 +42,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.voidOfExtinction = true; modPlayer.abaddon = true; - player.GetCritChance() += 13; + player.GetCritChance() += CritBoost; } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 62a94655b7..109aeaf3d7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -2,9 +2,9 @@ Abaddon: { DisplayName: Abaddon Tooltip: ''' - 8% increased critical strike chance - Critical strikes explode, causing nearby enemies to ignite with Brimstone Flames - Reduces the damage of the Brimstone Flames debuff by 50% + {$CommonItemTooltip.PercentIncreasedCritChance} + Critical strikes explode, igniting nearby foes with [cbuff:CalamityMod/BrimstoneFlames] + Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}% ''' } @@ -29,8 +29,8 @@ AbyssalDivingSuit: { Grants the ability to swim, extends underwater breathing, emits light underwater, and improves mobility on ice Provides a moderate amount of light, reduces breath loss, and reduces damage caused by drowning in the abyss Abyss creatures are less likely to see you, mitigates the abyss' defense reduction, and lets you sink faster in liquids - Grants immunity to the sulphurous waters and Crush Depth's increased breath loss - Grants resistance to the increased breath loss caused by Hadopelagic Pressure + Grants immunity to the sulphurous waters and [cbuff:CalamityMod/CrushDepth]'s increased breath loss + Grants resistance to the increased breath loss caused by [cbuff:CalamityMod/HadopelagicPressure] ''' } @@ -39,7 +39,7 @@ AbyssalMirror: { Tooltip: ''' Enemies are less likely to target you, even in the abyss - Generate stealth 25% faster when standing still and 12% faster while moving + Generate stealth {0}% faster when standing still and {1}% faster while moving Grants the ability to dodge attacks, releasing a cloud of lumenyl fluid which damages and stuns nearby enemies ''' HoldShiftTooltip: @@ -54,7 +54,7 @@ AeroStone: { DisplayName: Aero Stone Tooltip: ''' - Provides an additional 50 flight time + Provides an additional {0} seconds of flight time You slowly recover flight time while in the air while not flying or gliding 'One of the ancient relics' ''' @@ -62,16 +62,16 @@ AeroStone: { Affliction: { DisplayName: Affliction - Tooltip: Gives all teammates +0.5 HP/s life regen, +10% max life, 7% damage reduction, 9 defense and 10% increased damage + Tooltip: Gives all teammates +{0} HP/s life regen, +{1}% max life, {2}% damage reduction, {3} defense and {4}% increased damage } AlchemicalFlask: { DisplayName: Alchemical Flask Tooltip: ''' - All attacks inflict the Plague and reduces damage taken from the Plague by 50% + All attacks inflict the [cbuff:CalamityMod/Plague] and reduces damage taken from the [cbuff:CalamityMod/Plague] by {0}% Projectiles spawn plague seekers on enemy hits - Releases plague bees when damaged and douses you in honey + Releases plague bees and douses you in [cbuff:Honey] when damaged ''' } @@ -79,7 +79,7 @@ AlluringBait: { DisplayName: Alluring Bait Tooltip: ''' - Increases fishing power by 10 + Increases fishing power by {0} Increases the yield of potion ingredient fish ''' } @@ -88,7 +88,7 @@ AmalgamatedBrain: { DisplayName: Amalgamated Brain Tooltip: ''' - 5% increased damage + {0}% increased damage Taking damage confuses nearby enemies and spawns a dank creeper The dank creeper flies above you, exploding into several shaderain clouds Grants the ability to dodge attacks @@ -101,9 +101,9 @@ AmbrosialAmpoule: { DisplayName: Ambrosial Ampoule Tooltip: ''' - +50 max life - Grants +2 to +5 HP/s life regen based on missing health - Grants the Honey buff + +{0} max life + Grants +{1} to +{2} HP/s life regen based on missing health + Grants the [cbuff:Honey] buff Current boost: +[REGEN] HP/s Fire and sickness debuff durations are halved You emit yellow light if visibility is enabled @@ -114,7 +114,7 @@ AncientFossil: { DisplayName: Ancient Fossil Tooltip: ''' - Increases mining speed by 10% + Increases mining speed by {0}% Provides immunity to damage from falling blocks ''' } @@ -134,13 +134,13 @@ AngelicAlliance: { ''' Call upon the force of heaven to empower your attacks and minions Courage, Enlightenment, Bliss. United in Judgement - +2 max minions, 15% increased summon damage, and 8% increased damage to all other classes - +2 HP/s life regen while airborne using wings - Press [KEY] to grace yourself in divinity for 15 seconds + +{0} max minions, {1}% increased summon damage, and {2}% increased damage to all other classes + +{3} HP/s life regen while airborne using wings + Press [KEY] to grace yourself in divinity for {4} seconds, granting [cbuff:CalamityMod/DivineBless] While Divine Bless is active, for every minion you have, an archangel shall be summoned to aid you in combat - Each spawned angel will instantly restore 2 HP - All minion attacks inflict Banishing Fire, and you are granted a flat 4 HP/s regen - This effect has a cooldown of 1 minute + Each spawned angel will instantly restore {5} HP + All minion attacks inflict [cbuff:CalamityMod/BanishingFire], and you are granted a flat {6} HP/s regen + This effect has a cooldown of {7} minute ''' } @@ -162,9 +162,9 @@ AquaticEmblem: { Tooltip: ''' Most ocean enemies become friendly and allows breathing underwater - Being underwater boosts your defense over time, and slows movement speed - The defense boost and movement speed reduction slowly vanish outside of water - Maximum defense boost is 50 and movement speed reduction is 10% + Being underwater gradually increases defense but slows movement speed over {0} seconds + This effect slowly vanishes outside of water and resets while mounted + Maximum defense boost is {1} and movement speed reduction is {2}% Provides a small amount of light and moderately reduces breath loss in the abyss ''' } @@ -180,11 +180,11 @@ AquaticHeart: { FullTooltip: ''' Wow, you can swim now! - Being underwater increases max speed and acceleration by 15% + Being underwater increases max speed and acceleration by {0}% Greatly reduces breath loss and provides a small amount of light in the abyss - Attackers are inflicted with Glacial State - Gain a fragile ice barrier that grants 20% damage reduction for one hit - The ice shield regenerates after 30 seconds + Attackers are inflicted with [cbuff:CalamityMod/GlacialState] + Gain a fragile ice barrier that grants {1}% damage reduction for one hit + The ice shield regenerates after {2} seconds ''' } @@ -192,7 +192,7 @@ ArcFlashRing: { DisplayName: Arc Flash Ring Tooltip: ''' - Attacks have a 6% chance to call down a lightning bolt for 4x damage + Attacks have a {0}% chance to call down a lightning bolt for {1}x damage The chance is reduced for each enemy an attack hits The bolt's damage is based on non-crit damage, but can itself crit Bolts are transparent and silent if visibility is disabled @@ -203,9 +203,9 @@ ArchaicPowder: { DisplayName: Archaic Powder Tooltip: ''' - Increases mining speed by 25% + Increases mining speed by {0}% Provides immunity to damage from falling blocks and dart traps - 65% resistance to all damage from traps + {1}% resistance to all damage from traps Does not stack with downgrades ''' } @@ -214,9 +214,9 @@ AscendantInsignia: { DisplayName: Ascendant Insignia Tooltip: ''' - Increases wing flight time by 50%, movement and jump speed by 15%, and acceleration by 1.5x - Pressing [KEY] grants you the power of ascension, providing infinite flight time for 4 seconds - Ascension has a 40 second cooldown + Increases wing flight time by {0}%, movement and jump speed by {1}%, and acceleration by {2}x + Pressing [KEY] grants you the power of ascension, providing infinite flight time for {3} seconds + Ascension has a {4} second cooldown ''' } @@ -224,9 +224,9 @@ AsgardianAegis: { DisplayName: Asgardian Aegis Tooltip: ''' + {$Common.KnockbackImmunity} Allows the ability to dash, empowered by a cosmic inferno This dash can ram through enemies without taking damage - Grants immunity to knockback ''' } @@ -234,9 +234,9 @@ AsgardsValor: { DisplayName: Asgard's Valor Tooltip: ''' + {$Common.KnockbackImmunity} Allows the ability to ram dash This dash can ram through enemies without taking damage - Grants immunity to knockback ''' } @@ -293,7 +293,7 @@ BlazingCore: { DisplayName: Blazing Core Tooltip: ''' - Grants immunity to knockback + {$Common.KnockbackImmunity} The searing core of the Profaned Goddess Pressing [KEY] will activate a parry, encasing you in luminous profaned crystal Being hit shortly after encasement will shatter the crystal @@ -308,7 +308,7 @@ BloodflareCore: { DisplayName: Bloodflare Core Tooltip: ''' - Grants immunity to knockback + {$Common.KnockbackImmunity} Recovering defense damage heals you, each defense recovered gives 1 HP Taking damage converts at least half of your total defense in defense damage ''' @@ -531,7 +531,7 @@ DarkSunRing: { DisplayName: Dark Sun Ring Tooltip: ''' - Grants immunity to knockback + {$Common.KnockbackImmunity} 12% increased damage +0.5 HP/s life regen and +2 max minions Increased minion knockback @@ -615,8 +615,8 @@ DraedonsHeart: { DisplayName: Draedon's Heart Tooltip: ''' + {$Common.KnockbackImmunity} {0}% reduced contact damage from enemies - Grants immunity to knockback [NANODESC] With full Nanomachines, press [KEY] to heal {1} health over {2} {^2:second;seconds} While healing, you take [DR]% less damage @@ -716,9 +716,9 @@ ElysianAegis: { DisplayName: Elysian Aegis Tooltip: ''' + {$Common.KnockbackImmunity} Allows the ability to dash, empowered by holy fire This dash can ram through enemies without taking damage - Grants immunity to knockback 'Blessed by the Profaned Flame' ''' } @@ -787,7 +787,7 @@ FlameLickedShell: { DisplayName: Flame-Licked Shell Tooltip: ''' - Grants immunity to knockback + {$Common.KnockbackImmunity} Pressing [KEY] will activate a parry, encasing you in rocks Being hit shortly after encasement will implode the rocks Upon implosion, a ring of brimstone hellfire is launched outwards and you receive 90% DR for that hit @@ -869,7 +869,7 @@ GiantTortoiseShell: { DisplayName: Giant Tortoise Shell Tooltip: ''' - Grants immunity to knockback + {$Common.KnockbackImmunity} 5% increased damage reduction and 10% reduced dash velocity Taking a hit restores dash velocity and reduces defense and damage reduction for 3 seconds ''' @@ -1238,7 +1238,7 @@ OldDukeScales: { DisplayName: Old Duke's Scales Tooltip: ''' - Grants immunity to knockback + {$Common.KnockbackImmunity} 10% increased damage reduction, max movement speed, and acceleration 25% increased dash velocity and length Adds a stamina tracker to the cooldown rack @@ -1417,7 +1417,7 @@ RadiantOoze: { DisplayName: Radiant Ooze Tooltip: ''' - Grants +2 to +5 HP/s life regen based on missing health + Grants +{0} to +{1} HP/s life regen based on missing health Current boost: +[REGEN] HP/s You emit yellow light if visibility is enabled ''' @@ -1432,7 +1432,7 @@ RampartofDeities: { DisplayName: Rampart of Deities Tooltip: ''' - Grants immunity to knockback + {$Common.KnockbackImmunity} Releases a blast of homing star-bees[TOGGLE] and drenches you in [cbuff:Honey] after taking damage Increases the length of invincibility, with it increasing even more when at low health or taking high damage attacks Reduces damage taken by 25% when below 50% life @@ -1859,8 +1859,8 @@ TheAbsorber: { DisplayName: The Absorber Tooltip: ''' + {$Common.KnockbackImmunity} {0}% increased movement and jump speed - Grants immunity to knockback Attackers take immense damage and are afflicted with a crippling sickness debuff Using a healing potion will spawn a green aura that lasts for {1} seconds Walking into the aura removes all debuffs once and grants {2} HP/s regen, {3}% damage, and {4}% damage reduction @@ -1949,7 +1949,7 @@ TheSponge: { DisplayName: The Sponge Tooltip: ''' - Grants immunity to knockback + {$Common.KnockbackImmunity} Gain a barrier with {0} health The barrier grants {1}% damage reduction while active [ADREN] @@ -2051,9 +2051,9 @@ VoidofExtinction: { DisplayName: Void of Extinction Tooltip: ''' - 13% increased critical strike chance - Critical strikes explode, igniting enemies with Brimstone Flames - Reduces the damage of the Brimstone Flames debuff by 50% + {$CommonItemTooltip.PercentIncreasedCritChance} + Critical strikes explode, igniting nearby foes with [cbuff:CalamityMod/BrimstoneFlames] + Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}% ''' } @@ -2108,7 +2108,7 @@ YharimsGift: { DisplayName: Yharim's Gift Tooltip: ''' - Grants immunity to knockback + {$Common.KnockbackImmunity} Flaming meteors rain down after getting hit Volatile dragon dust trails behind you Increases damage and movement speed by 15% diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 2a3d8e8414..4814d6cee0 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -188,7 +188,7 @@ EditedTooltip: { FrogLeg: Increases jump speed by {0}% and allows auto-jump // Soaring Insignia EmpressFlightBooster1: Increases wing flight time by 33% - EmpressFlightBooster2: Increases movement and jump speed by 10% and acceleration by 1.25x + EmpressFlightBooster2: Increases movement speed by 7.5%, jump speed by 10%, and acceleration by 1.25x GravityGlobe: ''' Provides 32% increased jump speed and increased fall speed From 0627b0986978aa2376bb92273ec969651f35f7d5 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 21 Nov 2025 19:06:10 +0700 Subject: [PATCH 39/48] 1) Rewrote Angelic Alliance tooltip again 2) Fixed "minion attacks" on-hit debuffs applying to whips --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- CalPlayer/CalamityPlayerOnHit.cs | 9 +++------ .../en-US/Mods.CalamityMod.Items.Accessories.hjson | 10 +++++----- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index cd5faf4a03..7fe500b940 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2995,7 +2995,7 @@ namespace CalamityMod.CalPlayer { divineBless = false; Player.ClearBuff(ModContent.BuffType()); - Player.AddCooldown(Cooldowns.DivineBless.ID, CalamityUtils.SecondsToFrames(60)); + Player.AddCooldown(Cooldowns.DivineBless.ID, AngelicAlliance.DivineBlessCooldown); } // Armageddon's Dodge Disable feature puts Shadow Dodge/Holy Protection on permanent cooldown diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index ddd461c91f..f409370f5c 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1216,15 +1216,12 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), TitanHeartMask.OnHitDebuffDuration); } } - if (summon) + if (summon && !whip) { - if (pSoulArtifact && !profanedCrystal) - target.AddBuff(BuffType(), 300); - if (profanedCrystal && (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)) - { target.AddBuff(BuffType(), 600); - } + else if (pSoulArtifact) + target.AddBuff(BuffType(), 300); if (divineBless) target.AddBuff(BuffType(), AngelicAlliance.BanishingFireDuration); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 109aeaf3d7..b61a8f2699 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -135,11 +135,11 @@ AngelicAlliance: { Call upon the force of heaven to empower your attacks and minions Courage, Enlightenment, Bliss. United in Judgement +{0} max minions, {1}% increased summon damage, and {2}% increased damage to all other classes - +{3} HP/s life regen while airborne using wings - Press [KEY] to grace yourself in divinity for {4} seconds, granting [cbuff:CalamityMod/DivineBless] - While Divine Bless is active, for every minion you have, an archangel shall be summoned to aid you in combat - Each spawned angel will instantly restore {5} HP - All minion attacks inflict [cbuff:CalamityMod/BanishingFire], and you are granted a flat {6} HP/s regen + +{3} HP/s life regen while flight time is partially or fully expended + Press [KEY] to grace yourself with the [cbuff:CalamityMod/DivineBless] buff for {4} seconds + While active, an archangel is summoned for every minion you have + Archangels vaporize foes with heavenly light and each restore {5} HP upon spawning + Minion attacks inflict [cbuff:CalamityMod/BanishingFire], and you gain a flat {6} HP/s regen This effect has a cooldown of {7} minute ''' } From 6f3919bb840b829cbe7cfc0035a1f71c8b52c5ea Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Fri, 21 Nov 2025 09:07:02 -0600 Subject: [PATCH 40/48] armored dig-gone fully removed armored digger, transfering it's bestiary and banner to burrower. reduced burrower spawn rate --- Gores/ArmoredDigger/ArmoredDiggerBody.png | Bin 515 -> 0 bytes Gores/ArmoredDigger/ArmoredDiggerBody2.png | Bin 1139 -> 0 bytes Gores/ArmoredDigger/ArmoredDiggerHead.png | Bin 808 -> 0 bytes Gores/ArmoredDigger/ArmoredDiggerHead2.png | Bin 922 -> 0 bytes Gores/ArmoredDigger/ArmoredDiggerTail.png | Bin 600 -> 0 bytes Gores/ArmoredDigger/ArmoredDiggerTail2.png | Bin 884 -> 0 bytes ...moredDiggerBanner.cs => BurrowerBanner.cs} | 2 +- ...redDiggerBanner.png => BurrowerBanner.png} | Bin .../en-US/Mods.CalamityMod.Bestiary.hjson | 2 +- .../Mods.CalamityMod.Items.Placeables.hjson | 2 +- NPCs/BaseWormNPC.cs | 26 +- NPCs/Deconstructors/Burrower.cs | 21 +- NPCs/NormalNPCs/ArmoredDiggerBody.cs | 200 ------- NPCs/NormalNPCs/ArmoredDiggerBody.png | Bin 864 -> 0 bytes NPCs/NormalNPCs/ArmoredDiggerHead.cs | 505 ------------------ NPCs/NormalNPCs/ArmoredDiggerHead.png | Bin 1251 -> 0 bytes NPCs/NormalNPCs/ArmoredDiggerTail.cs | 150 ------ NPCs/NormalNPCs/ArmoredDiggerTail.png | Bin 735 -> 0 bytes Tiles/MonsterBanner.cs | 3 +- UI/BossHealthBarManager.cs | 1 - Utilities/NPCDebuffs.cs | 3 - 21 files changed, 46 insertions(+), 869 deletions(-) delete mode 100644 Gores/ArmoredDigger/ArmoredDiggerBody.png delete mode 100644 Gores/ArmoredDigger/ArmoredDiggerBody2.png delete mode 100644 Gores/ArmoredDigger/ArmoredDiggerHead.png delete mode 100644 Gores/ArmoredDigger/ArmoredDiggerHead2.png delete mode 100644 Gores/ArmoredDigger/ArmoredDiggerTail.png delete mode 100644 Gores/ArmoredDigger/ArmoredDiggerTail2.png rename Items/Placeables/Banners/{ArmoredDiggerBanner.cs => BurrowerBanner.cs} (77%) rename Items/Placeables/Banners/{ArmoredDiggerBanner.png => BurrowerBanner.png} (100%) delete mode 100644 NPCs/NormalNPCs/ArmoredDiggerBody.cs delete mode 100644 NPCs/NormalNPCs/ArmoredDiggerBody.png delete mode 100644 NPCs/NormalNPCs/ArmoredDiggerHead.cs delete mode 100644 NPCs/NormalNPCs/ArmoredDiggerHead.png delete mode 100644 NPCs/NormalNPCs/ArmoredDiggerTail.cs delete mode 100644 NPCs/NormalNPCs/ArmoredDiggerTail.png diff --git a/Gores/ArmoredDigger/ArmoredDiggerBody.png b/Gores/ArmoredDigger/ArmoredDiggerBody.png deleted file mode 100644 index 082eb57526697d951df1d3fdc7dc9ec7a95c73d5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 515 zcmV+e0{s1nP)Px$y-7qtR7i=<)y-=YQ4|I6-$-LB*rsg?*4DJ~qk%%L(v=%sx)B9kyLacpz5k4K z(S@i~{0A%|h~Ni;pjK*Y)sQAJieefuE~b+-L#i(9=-JG>^WNNd4)@$Uff!P$RJ3fy z_h4#rGJvo326(mfvfHs1cKveqFQ6w{M9kCaUQn-p0~arx@AzQx;iD!@92gC@zTZyC zjw=Wv=Hp{yU}bGBWH_D&Z&sGkR&p?(1J|xEv~s{q@om=&lB+?)JYqU`huD&KC}Y`T1LD*T!bQ%%;Osqqz)tw_3x$P*ALV?0BA- zJ&HE-I4&K@f{F1yaQ|NDrrtfNfF$~0WOx{qYqcgEpFY<0;B?_oM;y5%fbE$_NbY}NbEZVhb3^?g zzdNkO!iys4+4vH`(uWfMM+Lt_CNmJg`g-Y)F4%DeKLKO*g^|_H`gi~U002ovPDHLk FV1jy&^=|+G diff --git a/Gores/ArmoredDigger/ArmoredDiggerBody2.png b/Gores/ArmoredDigger/ArmoredDiggerBody2.png deleted file mode 100644 index a7a22f0697c7d0b4a57623f60f1b7afd3b0fec86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1139 zcmV-(1dRKMP)Px(ElET{RA_OKT4MFj&$M($9i}b*+|(qE5iFqdw_7JQ`xqc zR+0AsGMS7AP^;B|M$(BR9P450T`QZFiKt{fEQz$#gm~mkxOoUmBE7qRSLFRO<7b_6 z<cAb<+V2e$aZ#m0CV&6Ku9`ygrC^C&8g_h1#|pczh6|9lQYD{Q_Xyq zSbu2%fHzOP?bJW>^pj5cspHQ%{rq_PCjbihya!OJR)GW(Zl9f5^Z|D63TCVw*)|WL z)E4|N<$qQH*k3spT+>159$oy~=}2VXeg9{BP_ zNFHJR@%V!`0Py-dzxeIq|ozw@dYr9Vrf<`tApyk*qvx+aDhe$m$#T=KEiozHs6Q zd)ixD$fW@Ia4J}*701!q88&?%gj@^AT5Rx5VN=3eCVhJ~_ z>Gr0~DtT~wy%$&*l!B zEKT0EdufI4AiuUN5IcjZoxJ>LsQ`pzHJ;91y4%}YBo0ej)Ae{klZ(FZ#AU@@#ap}j z)sB!|J>P%l?SOOU5vk$99stgt4W1Y2)*&p})wA`k^`gjHiL~7>mQ>%9+TsCRm=C@k zdybem!s|XovYu3K5a(G*_a{uf$ZAjR&)Fc}7wb`BWNyLvb`nQ;%^r?BHL{+K%V%xQ zp?2x?Ru95+zRkA-FU66zvU_6L&Q9v(xcquu=XHrA{4eERwGu(wPx%;z>k7R9J=8m^)}wQ5eU6S9;0Aw%&xsR7%tI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#?#pYzQ5i1+H zwr@{va%E*1_X5#NKPLYnIDNjj1p1~IzuB?K+dwRjmnK^7En|;+&&Hb|x zDM;4qbrgtbJ3rchdVkul-Z*>uwi`Wr4qm?aXBT~Hb&@H4(v`B^uL-g-gKRtO3EwZyqOC?x1d%6Mp zUU~%^{bdk*^3Y*$>EbwAq)(pu3cNA;GWh1(i>dYD4SKqJN>I&-P=z5{df}<}!P1{M z!SB@ySgid5W~-B_*q^n{AUbyH3>Xqo{mjh%~9HR5vswFu0*=XAuQTNVA5?kq* z2jdeL8f?teBWubk8;QbJ^T_3?FhuY8yFMb)?%ssl?A%<6?DNkY0@o(5qeU*yCPP`< zj9OEzRzm^(=$30wc{Qf27uageDUW2RFhp~|nKn~zGusI-kX2+uQ`1SV5U)O4bJD!k wJd&Zp5WVaAXf`j+Q?>$~cZNKYp~4XT3(R9}Is#<#$^ZZW07*qoM6N<$f+5ez2LJ#7 diff --git a/Gores/ArmoredDigger/ArmoredDiggerTail.png b/Gores/ArmoredDigger/ArmoredDiggerTail.png deleted file mode 100644 index 6a30219a5b7767f6c89bbab8aeba0f1c22163954..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 600 zcmV-e0;m0nP)Px%5=lfsR7i={mQPC?K^Vq=8w|10rt!}jY-`n00#XnJFFgo)=&=Vq`x!j+-jjC^ z{R};~huqqOir0b`6d@=kQ7h|OO+`&Y#OY!3HanA4#X?q}%d$H=e}41K`@Z8uqfr1- zt_y(Y`-*@%J31VIv-9)dXR6gIcTwa{z5YXv5CRI|?c@{y{?Rc2YwJH6`UGG4pFO|T zM1|ZA5CUP_zZ%@$ZUAOyrUCf$`HM6ufX>GW2jEdM20*D;Q8bsaBjI~E_+kiviSaSx z$Kjy?0Ol7y0*&6Krv?Go*wzfu!p`40AY>1Xz0VhN#`DAbxuzWt_V)njeKP?-c2N_^ zeqF_N{6;R!_zlHF!#g3f-z7f3EiE=3DAAYFM3*`Pl}jb#DGDzR0DjfL-o?zJGnGpqOhU;dc1E#f zdnXd2rvpy____NVsFU?aw7IR1!_n6x0BmNr6f|a*%-3ZAPEPfTPx&E=fc|R9J=8*v)U0RTRhZ&(jyNuk_7O!M^a)5)iN&5+sI1O$ckda7DsDpvLIh zl}l4Y3>)Lh#5E=oHkyboOk?6g8so@Vq)-JL`vyZxX{F=h_A)$=GtwAi9)7EN&biN> zd%tt;Ip9dN*1dH&frZj!c8YS=u%U#%lZ?b39YV`@=Rk2{3>@FzhE!~U@rgjJ zr)w~Qo2B1sk%`LslLsGiM<{vNfNg#I!OZlJshwp>eOLGZ4D=6ztJkJd&rzN2Tfz4~ zTnx`09U%r67x5?(%Brp9NwBgynOyKQxg%8b zl-1J8>TFeeBy)1~6)-a&Vj_|m-nDa6^XHDxrei2(*4CC5aC>Q~OeJ<=Y-Dv{co!nqCS znNVB%7Ero%w`wig+Yr`Xycb9v>wO%wcLp*OGfQCP@Uy|cumG-1O`}4lR=$e)D8GcF zw)ch8^6JaI;M>Wil>gk9VP~HeXTZrLov4tBivDAVw}W@ydIP-seyDkoOjfxgbUzQh zwl5IrX{`qnh50g^y?rP3Lam-T8yiuP#PiP`1cSr7!P5svz?rersKi+A2sOm~bA3A0 zoa-Bo!s=QAJ@sMDbL;mHUzth|9EoMgWc#3VpMMQr-yjspWR*WcGCl6lKwAQZpFVEmh3 zs}77A{7m8Zl)blQO9FGN>kqq+rPSQqoWSz(GID%#O>CU9_f8C@95F^>%tUgRlX3zV zODmwRF6^nkzW!e=Ap0*!ehFoj?I63mn?kJ2g}jrkasQQaN9Zq#DHtCpA^YwC0000< KMNUMnLSTZR#kdjx diff --git a/Items/Placeables/Banners/ArmoredDiggerBanner.cs b/Items/Placeables/Banners/BurrowerBanner.cs similarity index 77% rename from Items/Placeables/Banners/ArmoredDiggerBanner.cs rename to Items/Placeables/Banners/BurrowerBanner.cs index f035d46d06..0b5abd9db3 100644 --- a/Items/Placeables/Banners/ArmoredDiggerBanner.cs +++ b/Items/Placeables/Banners/BurrowerBanner.cs @@ -1,6 +1,6 @@ namespace CalamityMod.Items.Placeables.Banners { - public class ArmoredDiggerBanner : BaseBanner + public class BurrowerBanner : BaseBanner { public override int BannerTileStyle => 77; public override int BannerKillRequirement => 25; diff --git a/Items/Placeables/Banners/ArmoredDiggerBanner.png b/Items/Placeables/Banners/BurrowerBanner.png similarity index 100% rename from Items/Placeables/Banners/ArmoredDiggerBanner.png rename to Items/Placeables/Banners/BurrowerBanner.png diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson index bed501d96b..eaab8a1256 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson @@ -66,7 +66,7 @@ Nanodroid: Ambient lighting, total surveillance, instantaneous repair… With en RepairUnitCritter: These handy little helpers are the reason that Draedon's decades-old labs stand to this day. Though bulkier and less energy efficient than nanodroids, having to take what power they need from the labs' generators, they can easily clean up the dust, though struggle with the rust. //Normal Uncategorized Enemies AeroSlime: Previously mundane slimes that have absorbed trace amounts of draconic essence from the outpour of energy caused by the re-enchantment of Aerialite. They now soar the skies with their newly sprouted wings, reaching heights few of their gelatinous kind ever have. -ArmoredDigger: Despite being relatively primitive compared to Draedon's current technology, armored diggers continue to see use to this day. Though their primary directive is mining and delivering minerals, they also once cleared room for the numerous underground laboratories. +Burrower: Despite being relatively primitive compared to Draedon's current technology, Burrowers continue to see use to this day. Though their primary directive is mining and delivering minerals, they also once cleared room for the numerous underground laboratories. AuroraSpirit: Thought to be no more than an old wives' tale, sightings of aurora spirits have become commonplace since the defeat of the wall of flesh. Upon closer inspection, it appears these "spirits" are rather wisp-like entities clad in a cryonic shell, a sure sign that these were created by Archmage Permafrost. BloomSlime: Imbued with profaned energy, this slime wishes to see the world reduced to ashes to ensure the suffering it brings is no more. However, the simplicity of their form makes it difficult for the slain goddess to fully impose her will onto them. Bohldohr: Bohldohrs were made to serve the lihzahrds, being crafted from ancient stone and brought to life with magical power in the twilight of the great Lihzahrd Dynasty. But the sun sets on every civilization, and once their deity abandoned them, they were left to fend for themselves. diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index b98b629888..56cbde33cc 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -8,7 +8,7 @@ AndroombaBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" AnthozoanCrabBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" AquaticUrchinBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" AriesBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" -ArmoredDiggerBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" +BurrowerBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" AstraglomerateBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" AstralachneaBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" AstralProbeBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" diff --git a/NPCs/BaseWormNPC.cs b/NPCs/BaseWormNPC.cs index 26e5538370..3535bd42d5 100644 --- a/NPCs/BaseWormNPC.cs +++ b/NPCs/BaseWormNPC.cs @@ -593,33 +593,51 @@ namespace CalamityMod.NPCs #endregion #region Draw + + public override void FindFrame(int frameHeight) + { + if (NPC.IsABestiaryIconDummy) + { + NPC.rotation = MathF.Sin(Main.GlobalTimeWrappedHourly) * 0.2f + MathHelper.PiOver2; + } + } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { + if (NPC.IsABestiaryIconDummy) + { + drawColor = Color.White; + SegmentRigidity = 0.1f; + UpdateSegments(); + } for (int i = Segments.Count - 1; i >= 0; i--) { DrawSegment(spriteBatch, screenPos, drawColor, Segments[i]); } - spriteBatch.Draw(TextureAssets.Npc[Type].Value, NPC.Center - Main.screenPosition, null, drawColor* NPC.Opacity, NPC.rotation, TextureAssets.Npc[Type].Value.Size() / 2, NPC.scale, SpriteEffects.None, 1); + spriteBatch.Draw(TextureAssets.Npc[Type].Value, NPC.Center - screenPos, null, drawColor* NPC.Opacity, NPC.rotation, TextureAssets.Npc[Type].Value.Size() / 2, NPC.scale, SpriteEffects.None, 1); if (GlowTextures.Count > 0 && GlowTextures[0] is not null) - spriteBatch.Draw(GlowTextureAssets[0].Value, NPC.Center - Main.screenPosition, null, Color.White * NPC.Opacity, NPC.rotation, GlowTextureAssets[0].Size() / 2, NPC.scale, SpriteEffects.None, 1); + spriteBatch.Draw(GlowTextureAssets[0].Value, NPC.Center - screenPos, null, Color.White * NPC.Opacity, NPC.rotation, GlowTextureAssets[0].Size() / 2, NPC.scale, SpriteEffects.None, 1); return false; } public virtual void DrawSegment(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor, BaseWormSegment segment) { var color = Lighting.GetColor(segment.Center.ToTileCoordinates()); + if (NPC.IsABestiaryIconDummy) + { + color = Color.White; + } if (!SegmentTextureAssets.IndexInRange(segment.segmentType)) { return; } var tex = SegmentTextureAssets[segment.segmentType].Value; - spriteBatch.Draw(tex, segment.Center - Main.screenPosition, null, color * segment.Opacity, segment.rotation, tex.Size() / 2 + (SegmentTypeDrawOffsets[segment.segmentType]), NPC.scale, SpriteEffects.None, 1); + spriteBatch.Draw(tex, segment.Center - screenPos, null, color * segment.Opacity, segment.rotation, tex.Size() / 2 + (SegmentTypeDrawOffsets[segment.segmentType]), NPC.scale, SpriteEffects.None, 1); if (!GlowTextures.IndexInRange(segment.segmentType+1) || GlowTextures[segment.segmentType+1] is null) { return; } tex = GlowTextureAssets[segment.segmentType+1].Value; - spriteBatch.Draw(tex, segment.Center - Main.screenPosition, null, Color.White * segment.Opacity, segment.rotation, tex.Size() / 2 + (SegmentTypeDrawOffsets[segment.segmentType]), NPC.scale, SpriteEffects.None, 1); + spriteBatch.Draw(tex, segment.Center - screenPos, null, Color.White * segment.Opacity, segment.rotation, tex.Size() / 2 + (SegmentTypeDrawOffsets[segment.segmentType]), NPC.scale, SpriteEffects.None, 1); } #endregion } diff --git a/NPCs/Deconstructors/Burrower.cs b/NPCs/Deconstructors/Burrower.cs index 46c35ffc76..55ec956f4b 100644 --- a/NPCs/Deconstructors/Burrower.cs +++ b/NPCs/Deconstructors/Burrower.cs @@ -5,6 +5,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Effects; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; @@ -15,13 +16,16 @@ using CalamityMod.Tiles.Ores; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; +using Terraria.GameContent.Bestiary; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Deconstructors { public class BurrowerHitbox : BaseWormHitboxNPC { + public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.Burrower.DisplayName"); public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { return false; @@ -46,6 +50,9 @@ namespace CalamityMod.NPCs.Deconstructors NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = false; + + Banner = ModContent.NPCType(); + BannerItem = ModContent.ItemType(); base.SetDefaults(); } public override void AI() @@ -110,7 +117,7 @@ namespace CalamityMod.NPCs.Deconstructors NPC.height = 38; NPC.lifeMax = 1000; NPC.value = Item.buyPrice(1, 0, 0, 0); - + NPC.rarity = 3; NPC.HitSound = ThanatosHead.ThanatosHitSoundClosed; NPC.DeathSound = SoundID.NPCDeath44; NPC.knockBackResist = 0f; @@ -125,6 +132,8 @@ namespace CalamityMod.NPCs.Deconstructors NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = false; + Banner = NPC.type; + BannerItem = ModContent.ItemType(); for (var i = 0; i < SegmentCount - 1; i++) { @@ -132,6 +141,14 @@ namespace CalamityMod.NPCs.Deconstructors } Segments.Add(new BaseWormSegment(this, 3)); } + public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) + { + bestiaryEntry.Info.AddRange( + [ + BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns, + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.Burrower") + ]); + } #region AI Variables @@ -547,7 +564,7 @@ namespace CalamityMod.NPCs.Deconstructors { return 0f; } - return SpawnCondition.Cavern.Chance * (Main.projectile.Any(x=> x.active && x.type == ModContent.ProjectileType()) ? 5f : 0.1f); + return SpawnCondition.Cavern.Chance * (Main.projectile.Any(x=> x.active && x.type == ModContent.ProjectileType()) ? 5f : 0.05f); } } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs deleted file mode 100644 index a4a5b58ce7..0000000000 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ /dev/null @@ -1,200 +0,0 @@ -using System; -using CalamityMod.Items.Placeables.Banners; -using CalamityMod.Projectiles.Boss; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.NormalNPCs -{ - [LongDistanceNetSync(SyncWith = typeof(ArmoredDiggerHead))] - public class ArmoredDiggerBody : ModNPC - { - public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.ArmoredDiggerHead.DisplayName"); - public override void SetStaticDefaults() - { - this.HideFromBestiary(); - } - - public override void SetDefaults() - { - NPC.damage = 70; - NPC.width = 38; - NPC.height = 38; - NPC.defense = 20; - NPC.lifeMax = 20000; - NPC.knockBackResist = 0f; - NPC.aiStyle = -1; - AIType = -1; - NPC.behindTiles = true; - NPC.noGravity = true; - NPC.noTileCollide = true; - NPC.HitSound = SoundID.NPCHit4; - NPC.DeathSound = SoundID.NPCDeath14; - NPC.netAlways = true; - NPC.dontCountMe = true; - Banner = ModContent.NPCType(); - BannerItem = ModContent.ItemType(); - NPC.Calamity().VulnerableToSickness = false; - NPC.Calamity().VulnerableToElectricity = true; - } - - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) - { - return false; - } - - public override void AI() - { - if (NPC.ai[3] > 0f && Main.npc[(int)NPC.ai[3]].type == ModContent.NPCType()) - { - NPC.realLife = (int)NPC.ai[3]; - } - if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) - { - NPC.TargetClosest(true); - } - bool shouldDie = false; - if (NPC.ai[1] <= 0f) - { - shouldDie = true; - } - else if (Main.npc[(int)NPC.ai[1]].life <= 0) - { - shouldDie = true; - } - if (shouldDie) - { - if (!Main.zenithWorld) - { - NPC.life = 0; - NPC.HitEffect(0, 10.0); - NPC.checkDead(); - } - else - { - // find a new npc to attatch to in gfb, it's not a bug, it's a feature:tm: - foreach (NPC host in Main.ActiveNPCs) - { - if (!host.friendly && !host.dontTakeDamage && host.type != ModContent.NPCType() && host.type != ModContent.NPCType() && host.type != ModContent.NPCType()) - { - NPC.ai[1] = host.whoAmI; - NPC.ai[3] = host.whoAmI; - break; - } - } - // if it goes through the loop without finding an npc to attatch to (aka, ai[1] never changes and the head is still dead) kill as normal - if (Main.npc[(int)NPC.ai[1]].life <= 0) - { - NPC.life = 0; - NPC.HitEffect(0, 10.0); - NPC.checkDead(); - } - } - } - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.localAI[0] += (float)Main.rand.Next(4); - if (NPC.localAI[0] >= (float)Main.rand.Next(1800, 26000)) - { - NPC.localAI[0] = 0f; - NPC.TargetClosest(true); - if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, - Main.player[NPC.target].width, Main.player[NPC.target].height)) - { - float speed = 7f; - Vector2 projFirePosition = new Vector2(NPC.position.X + (float)NPC.width * 0.5f, NPC.position.Y + (float)(NPC.height / 2)); - float projTargetX = Main.player[NPC.target].position.X + (float)Main.player[NPC.target].width * 0.5f - projFirePosition.X + (float)Main.rand.Next(-20, 21); - float projTargetY = Main.player[NPC.target].position.Y + (float)Main.player[NPC.target].height * 0.5f - projFirePosition.Y + (float)Main.rand.Next(-20, 21); - float projTargetDist = (float)Math.Sqrt((double)(projTargetX * projTargetX + projTargetY * projTargetY)); - projTargetDist = speed / projTargetDist; - projTargetX *= projTargetDist; - projTargetY *= projTargetDist; - int projType = Main.zenithWorld ? ModContent.ProjectileType() : ProjectileID.SaucerScrap; - projFirePosition.X += projTargetX * 5f; - projFirePosition.Y += projTargetY * 5f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projFirePosition.X, projFirePosition.Y, projTargetX, projTargetY, projType, 30, 0f, Main.myPlayer, 0f, 0f); - NPC.netUpdate = true; - } - } - } - Vector2 segmentPosition = new Vector2(NPC.position.X + (float)NPC.width * 0.5f, NPC.position.Y + (float)NPC.height * 0.5f); - float targetXDist = Main.player[NPC.target].position.X + (float)(Main.player[NPC.target].width / 2); - float targetYDist = Main.player[NPC.target].position.Y + (float)(Main.player[NPC.target].height / 2); - targetXDist = (float)((int)(targetXDist / 16f) * 16); - targetYDist = (float)((int)(targetYDist / 16f) * 16); - segmentPosition.X = (float)((int)(segmentPosition.X / 16f) * 16); - segmentPosition.Y = (float)((int)(segmentPosition.Y / 16f) * 16); - targetXDist -= segmentPosition.X; - targetYDist -= segmentPosition.Y; - float targetDistance = (float)Math.Sqrt((double)(targetXDist * targetXDist + targetYDist * targetYDist)); - if (NPC.ai[1] > 0f && NPC.ai[1] < (float)Main.npc.Length) - { - try - { - segmentPosition = new Vector2(NPC.position.X + (float)NPC.width * 0.5f, NPC.position.Y + (float)NPC.height * 0.5f); - targetXDist = Main.npc[(int)NPC.ai[1]].position.X + (float)(Main.npc[(int)NPC.ai[1]].width / 2) - segmentPosition.X; - targetYDist = Main.npc[(int)NPC.ai[1]].position.Y + (float)(Main.npc[(int)NPC.ai[1]].height / 2) - segmentPosition.Y; - } - catch - { - } - NPC.rotation = (float)Math.Atan2((double)targetYDist, (double)targetXDist) + 1.57f; - targetDistance = (float)Math.Sqrt((double)(targetXDist * targetXDist + targetYDist * targetYDist)); - int segmentWidth = (int)(44f * NPC.scale); - targetDistance = (targetDistance - (float)segmentWidth) / targetDistance; - targetXDist *= targetDistance; - targetYDist *= targetDistance; - NPC.velocity = Vector2.Zero; - NPC.position.X = NPC.position.X + targetXDist; - NPC.position.Y = NPC.position.Y + targetYDist; - } - } - - public override void HitEffect(NPC.HitInfo hit) - { - for (int k = 0; k < 3; k++) - { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); - } - if (NPC.life <= 0) - { - for (int k = 0; k < 10; k++) - { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); - } - if (!Main.dedServ) - { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ArmoredDiggerBody").Type, 1f); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ArmoredDiggerBody2").Type, 1f); - } - } - } - - public override bool CheckActive() - { - return false; - } - - public override void ModifyTypeName(ref string typeName) - { - if (Main.zenithWorld) - { - typeName = CalamityUtils.GetTextValue("NPCs.MechanizedSerpent"); - } - } - - public override Color? GetAlpha(Color drawColor) - { - if (Main.zenithWorld) - { - Color lightColor = Color.Orange * drawColor.A; - return lightColor * NPC.Opacity; - } - else return null; - } - } -} diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.png b/NPCs/NormalNPCs/ArmoredDiggerBody.png deleted file mode 100644 index 6f582bdb3e21ebefa2b81317ac5bca42b0937dde..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 864 zcmV-m1E2hfP)W^00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0`*BmK~!i%?U+Ak z6LA#BqnNl=Qw#+`O)CV!R;x&KskVb%B%*fd(8)yyb#QZVa_Huu4!SsX=u#DfOC4J6 zqDB1MK?1f>K`4<%yO|8ieRCg3AN z<+lFTR$n`gwz+`Q6Bo`awoE;GENz$b9qag}-S|>&S=(k2-WsR22m22zF0TKU4jnrp zU3l|O8t>X6eZTZU+G?$b&vBgIw>PO6M-#icr9Is{rK@Ydq=lbrQZn-OTVC3%^Wkya zRnw5_>y_q~SEM$ER%<@^j^p&{;St3+Xlt8Vw%GGzii|v;pOe<>e8)Q8^o@H?d7I~4 zb)EO8`m}+Kxt`BAOK@x4_G{pu5$c^ws@?bCpB3uu@4p5cl?v2L}eF z&t_(%%-bBle5ulXsMWOZ{QU=&ZoxB=&wY`e85@%l)1Bx(E`nF%Oo4FX=zzbs5&Aiq zA-34_Hk0t`?I(Y)f@^9Fp5v@=EY>L;q(8edgOl`o*Y{XlE2PeM9H%oUhZKMGpX#%z z9%)xRE?q4Ak=m7xo%&qZDUwX36WgWh#iI0SZdH27?=sn!3sRg9p5u^=mHfR5I6w9J zv((Pz^xPqjN=X8xaW+wd8>O?_#U3q)ib#_doX`^ z*zJ6N^R!dj%qmc;j|1-(sdc(nt=fj*Ic~9UWoxb0xvu)1i-+s&0N1g~ zw*=R57i7XtjkZ>+J54n>>UuUp^X{-^$L-8wYZ`1Om{H)r<1TRCb{SxPw%GaJc9D9W qhVVEJu72-wuF>mj(V>n(); - NPC.Calamity().VulnerableToSickness = false; - NPC.Calamity().VulnerableToElectricity = true; - } - - public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) - { - bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] - { - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns, - new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.ArmoredDigger") - }); - } - - public override void AI() - { - Point point = NPC.Center.ToTileCoordinates(); - Tile tileSafely = Framing.GetTileSafely(point); - bool createDust = tileSafely.HasUnactuatedTile && NPC.Distance(Main.player[NPC.target].Center) < 800f; - if (createDust) - { - if (Main.rand.NextBool()) - { - Dust dust = Dust.NewDustDirect(NPC.position, NPC.width, NPC.height, DustID.TreasureSparkle, 0f, 0f, 150, default(Color), 0.3f); - dust.fadeIn = 0.75f; - dust.velocity *= 0.1f; - dust.noLight = true; - } - } - - bool death = CalamityWorld.death; - if (NPC.ai[3] > 0f) - { - NPC.realLife = (int)NPC.ai[3]; - } - if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) - { - NPC.TargetClosest(true); - } - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (!TailSpawned) - { - NPC.ai[3] = (float)NPC.whoAmI; - NPC.realLife = NPC.whoAmI; - int thisSegment = NPC.whoAmI; - int segmentAmt = 30; - for (int j = 0; j <= segmentAmt; j++) - { - int segmentType = ModContent.NPCType(); - if (j == segmentAmt) - { - segmentType = ModContent.NPCType(); - } - int newSegment = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.position.X + (float)(NPC.width / 2)), (int)(NPC.position.Y + (float)NPC.height), segmentType, NPC.whoAmI, 0f, 0f, 0f, 0f, 255); - Main.npc[newSegment].ai[3] = (float)NPC.whoAmI; - Main.npc[newSegment].realLife = NPC.whoAmI; - Main.npc[newSegment].ai[1] = (float)thisSegment; - Main.npc[thisSegment].ai[0] = (float)newSegment; - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, newSegment, 0f, 0f, 0f, 0, 0, 0); - thisSegment = newSegment; - } - TailSpawned = true; - } - } - int tileXPosition = (int)(NPC.position.X / 16f) - 1; - int tileWidthXPos = (int)((NPC.position.X + (float)NPC.width) / 16f) + 2; - int tileYPosition = (int)(NPC.position.Y / 16f) - 1; - int tileWidthYPos = (int)((NPC.position.Y + (float)NPC.height) / 16f) + 2; - if (tileXPosition < 0) - { - tileXPosition = 0; - } - if (tileWidthXPos > Main.maxTilesX) - { - tileWidthXPos = Main.maxTilesX; - } - if (tileYPosition < 0) - { - tileYPosition = 0; - } - if (tileWidthYPos > Main.maxTilesY) - { - tileWidthYPos = Main.maxTilesY; - } - bool flying = false; - if (!flying) - { - for (int k = tileXPosition; k < tileWidthXPos; k++) - { - for (int l = tileYPosition; l < tileWidthYPos; l++) - { - if (Main.tile[k, l] != null && ((Main.tile[k, l].HasUnactuatedTile && (Main.tileSolid[(int)Main.tile[k, l].TileType] || (Main.tileSolidTop[(int)Main.tile[k, l].TileType] && Main.tile[k, l].TileFrameY == 0))) || Main.tile[k, l].LiquidAmount > 64)) - { - Vector2 segmentPos; - segmentPos.X = (float)(k * 16); - segmentPos.Y = (float)(l * 16); - if (NPC.position.X + (float)NPC.width > segmentPos.X && NPC.position.X < segmentPos.X + 16f && NPC.position.Y + (float)NPC.height > segmentPos.Y && NPC.position.Y < segmentPos.Y + 16f) - { - flying = true; - break; - } - } - } - } - } - if (!flying) - { - NPC.localAI[1] = 1f; - Rectangle rectangle = new Rectangle((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height); - int noFlyZone = 1000; - bool outsideNoFlyZone = true; - if (NPC.position.Y > Main.player[NPC.target].position.Y) - { - foreach (Player player in Main.ActivePlayers) - { - Rectangle noFlyArea = new Rectangle((int)player.position.X - noFlyZone, (int)player.position.Y - noFlyZone, noFlyZone * 2, noFlyZone * 2); - if (rectangle.Intersects(noFlyArea)) - { - outsideNoFlyZone = false; - break; - } - } - if (outsideNoFlyZone) - { - flying = true; - } - } - } - else - { - NPC.localAI[1] = 0f; - } - float maxChaseSpeed = death ? 13.5f : 10f; - if (Main.player[NPC.target].dead || (!Main.zenithWorld && (double)Main.player[NPC.target].position.Y < Main.rockLayer * 16.0)) - { - flying = false; - NPC.velocity.Y = NPC.velocity.Y + 1f; - if ((double)NPC.position.Y > Main.rockLayer * 16.0) - { - NPC.velocity.Y = NPC.velocity.Y + 1f; - maxChaseSpeed *= 2f; - } - if ((double)NPC.position.Y > (double)(Main.UnderworldLayer * 16)) - { - for (int a = 0; a < Main.maxNPCs; a++) - { - if (Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType() || - Main.npc[a].type == ModContent.NPCType()) - { - Main.npc[a].active = false; - } - } - } - } - float acceleration = death ? 0.0675f : 0.05f; - float deceleration = death ? 0.10125f : 0.075f; - Vector2 segmentPosition = new Vector2(NPC.position.X + (float)NPC.width * 0.5f, NPC.position.Y + (float)NPC.height * 0.5f); - float targetXDist = Main.player[NPC.target].position.X + (float)(Main.player[NPC.target].width / 2); - float targetYDist = Main.player[NPC.target].position.Y + (float)(Main.player[NPC.target].height / 2); - targetXDist = (float)((int)(targetXDist / 16f) * 16); - targetYDist = (float)((int)(targetYDist / 16f) * 16); - segmentPosition.X = (float)((int)(segmentPosition.X / 16f) * 16); - segmentPosition.Y = (float)((int)(segmentPosition.Y / 16f) * 16); - targetXDist -= segmentPosition.X; - targetYDist -= segmentPosition.Y; - float targetDistance = (float)Math.Sqrt((double)(targetXDist * targetXDist + targetYDist * targetYDist)); - if (!flying) - { - NPC.TargetClosest(true); - NPC.velocity.Y = NPC.velocity.Y + 0.15f; - if (NPC.velocity.Y > maxChaseSpeed) - { - NPC.velocity.Y = maxChaseSpeed; - } - if ((double)(Math.Abs(NPC.velocity.X) + Math.Abs(NPC.velocity.Y)) < (double)maxChaseSpeed * 0.4) - { - if (NPC.velocity.X < 0f) - { - NPC.velocity.X = NPC.velocity.X - acceleration * 1.1f; - } - else - { - NPC.velocity.X = NPC.velocity.X + acceleration * 1.1f; - } - } - else if (NPC.velocity.Y == maxChaseSpeed) - { - if (NPC.velocity.X < targetXDist) - { - NPC.velocity.X = NPC.velocity.X + acceleration; - } - else if (NPC.velocity.X > targetXDist) - { - NPC.velocity.X = NPC.velocity.X - acceleration; - } - } - else if (NPC.velocity.Y > 4f) - { - if (NPC.velocity.X < 0f) - { - NPC.velocity.X = NPC.velocity.X + acceleration * 0.9f; - } - else - { - NPC.velocity.X = NPC.velocity.X - acceleration * 0.9f; - } - } - } - else - { - if (NPC.soundDelay == 0) - { - float soundDelay = targetDistance / 40f; - if (soundDelay < 10f) - { - soundDelay = 10f; - } - if (soundDelay > 20f) - { - soundDelay = 20f; - } - NPC.soundDelay = (int)soundDelay; - SoundEngine.PlaySound(SoundID.WormDig, NPC.Center); - } - targetDistance = (float)Math.Sqrt((double)(targetXDist * targetXDist + targetYDist * targetYDist)); - float absoluteTargetX = Math.Abs(targetXDist); - float absoluteTargetY = Math.Abs(targetYDist); - float timeToReachTarget = maxChaseSpeed / targetDistance; - targetXDist *= timeToReachTarget; - targetYDist *= timeToReachTarget; - if (((NPC.velocity.X > 0f && targetXDist > 0f) || (NPC.velocity.X < 0f && targetXDist < 0f)) && ((NPC.velocity.Y > 0f && targetYDist > 0f) || (NPC.velocity.Y < 0f && targetYDist < 0f))) - { - if (NPC.velocity.X < targetXDist) - { - NPC.velocity.X = NPC.velocity.X + deceleration; - } - else if (NPC.velocity.X > targetXDist) - { - NPC.velocity.X = NPC.velocity.X - deceleration; - } - if (NPC.velocity.Y < targetYDist) - { - NPC.velocity.Y = NPC.velocity.Y + deceleration; - } - else if (NPC.velocity.Y > targetYDist) - { - NPC.velocity.Y = NPC.velocity.Y - deceleration; - } - } - if ((NPC.velocity.X > 0f && targetXDist > 0f) || (NPC.velocity.X < 0f && targetXDist < 0f) || (NPC.velocity.Y > 0f && targetYDist > 0f) || (NPC.velocity.Y < 0f && targetYDist < 0f)) - { - if (NPC.velocity.X < targetXDist) - { - NPC.velocity.X = NPC.velocity.X + acceleration; - } - else if (NPC.velocity.X > targetXDist) - { - NPC.velocity.X = NPC.velocity.X - acceleration; - } - if (NPC.velocity.Y < targetYDist) - { - NPC.velocity.Y = NPC.velocity.Y + acceleration; - } - else if (NPC.velocity.Y > targetYDist) - { - NPC.velocity.Y = NPC.velocity.Y - acceleration; - } - if ((double)Math.Abs(targetYDist) < (double)maxChaseSpeed * 0.2 && ((NPC.velocity.X > 0f && targetXDist < 0f) || (NPC.velocity.X < 0f && targetXDist > 0f))) - { - if (NPC.velocity.Y > 0f) - { - NPC.velocity.Y = NPC.velocity.Y + acceleration * 2f; - } - else - { - NPC.velocity.Y = NPC.velocity.Y - acceleration * 2f; - } - } - if ((double)Math.Abs(targetXDist) < (double)maxChaseSpeed * 0.2 && ((NPC.velocity.Y > 0f && targetYDist < 0f) || (NPC.velocity.Y < 0f && targetYDist > 0f))) - { - if (NPC.velocity.X > 0f) - { - NPC.velocity.X = NPC.velocity.X + acceleration * 2f; - } - else - { - NPC.velocity.X = NPC.velocity.X - acceleration * 2f; - } - } - } - else if (absoluteTargetX > absoluteTargetY) - { - if (NPC.velocity.X < targetXDist) - { - NPC.velocity.X = NPC.velocity.X + acceleration * 1.1f; - } - else if (NPC.velocity.X > targetXDist) - { - NPC.velocity.X = NPC.velocity.X - acceleration * 1.1f; - } - if ((double)(Math.Abs(NPC.velocity.X) + Math.Abs(NPC.velocity.Y)) < (double)maxChaseSpeed * 0.5) - { - if (NPC.velocity.Y > 0f) - { - NPC.velocity.Y = NPC.velocity.Y + acceleration; - } - else - { - NPC.velocity.Y = NPC.velocity.Y - acceleration; - } - } - } - else - { - if (NPC.velocity.Y < targetYDist) - { - NPC.velocity.Y = NPC.velocity.Y + acceleration * 1.1f; - } - else if (NPC.velocity.Y > targetYDist) - { - NPC.velocity.Y = NPC.velocity.Y - acceleration * 1.1f; - } - if ((double)(Math.Abs(NPC.velocity.X) + Math.Abs(NPC.velocity.Y)) < (double)maxChaseSpeed * 0.5) - { - if (NPC.velocity.X > 0f) - { - NPC.velocity.X = NPC.velocity.X + acceleration; - } - else - { - NPC.velocity.X = NPC.velocity.X - acceleration; - } - } - } - } - - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + 1.57f; - - if (flying) - { - if (NPC.localAI[0] != 1f) - { - NPC.netUpdate = true; - } - NPC.localAI[0] = 1f; - } - else - { - if (NPC.localAI[0] != 0f) - { - NPC.netUpdate = true; - } - NPC.localAI[0] = 0f; - } - if (((NPC.velocity.X > 0f && NPC.oldVelocity.X < 0f) || (NPC.velocity.X < 0f && NPC.oldVelocity.X > 0f) || (NPC.velocity.Y > 0f && NPC.oldVelocity.Y < 0f) || (NPC.velocity.Y < 0f && NPC.oldVelocity.Y > 0f)) && !NPC.justHit) - { - NPC.netUpdate = true; - } - } - - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - Player player = spawnInfo.Player; - bool gfbCondition = Main.zenithWorld && (player.ZoneHallow || player.ZoneUnderworldHeight) && NPC.downedMoonlord; - if ((gfbCondition || (player.ZoneRockLayerHeight && !player.ZoneUnderworldHeight && !player.ZoneJungle)) && !player.ZoneDungeon && !player.Calamity().ZoneSunkenSea && !player.Calamity().ZoneAbyss) - { - if (!CalamityPlayer.areThereAnyDamnBosses && NPC.downedPlantBoss && !NPC.AnyNPCs(ModContent.NPCType())) - { - float spawnRateDivisor = CalamityWorld.revenge ? 425f : 500f; - return 1 / spawnRateDivisor; - } - } - return 0f; - } - - public override void BossLoot(ref int potionType) - { - potionType = ItemID.GreaterHealingPotion; - } - - public override bool CheckActive() - { - return false; - } - - public override void HitEffect(NPC.HitInfo hit) - { - for (int k = 0; k < 3; k++) - { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); - } - if (NPC.life <= 0) - { - for (int k = 0; k < 10; k++) - { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); - } - if (!Main.dedServ) - { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ArmoredDiggerHead").Type, 1f); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ArmoredDiggerHead2").Type, 1f); - } - } - } - - public override bool SpecialOnKill() - { - int closestSegmentID = DropHelper.FindClosestWormSegment(NPC, - ModContent.NPCType(), - ModContent.NPCType(), - ModContent.NPCType()); - NPC.position = Main.npc[closestSegmentID].position; - return false; - } - - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 1, 4, 8); - npcLoot.Add(ModContent.ItemType(), 1, 4, 8); - npcLoot.AddIf(() => Main.zenithWorld, ModContent.ItemType(), 1, 3, 6, ui: false); - npcLoot.AddIf(() => Main.zenithWorld, ModContent.ItemType(), 10, ui: false); - } - - public override void ModifyTypeName(ref string typeName) - { - if (Main.zenithWorld) - { - typeName = CalamityUtils.GetTextValue("NPCs.MechanizedSerpent"); - } - } - - public override Color? GetAlpha(Color drawColor) - { - if (Main.zenithWorld) - { - Color lightColor = Color.Orange * drawColor.A; - return lightColor * NPC.Opacity; - } - else return null; - } - public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) - { - if (NPC.IsABestiaryIconDummy) - { - return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, 4, 26, 0.6f, new Vector2(10, -10), 4, 16); - } - return true; - } - } -} diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.png b/NPCs/NormalNPCs/ArmoredDiggerHead.png deleted file mode 100644 index ee6a1bdf465eb073db990fe655e44ab7ce6bf99b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1251 zcmV<91RVQ`P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1b9hAK~!i%?V4MN zO;H%fhnjgDW+G9;AS1a;E)Q;nltzeBw7$K5IrC?=_8Fee-oILXYtK1n?K$hezROzs^y}&ADJw<#ds}k!^R{Tp z%gcL7-QC^Y=dlX;U*qPA0W-R5^%A>oJb%qBGn;nCL+^`?pO%tU?4Q5bh~c%?+)TT6 z^2Cuc*V4lK`8?zOE4h!c_8S(?wCmQc3bSqPon|N0jWWAn@qDuzH*GZ=^D)%Db^W&4 zSIr;H)>K!Tt*z)Xd+g>zvuS-T_c6sO<(g9pwH)IoPO+92eLv$deqYJ1Vni!{X};we zGyApuhqaNlHP-qHpJzPA=YF97Pl)VAMV*yJ^B4GDZ)Q!K=z9tK4;?j|HhOWN-P^a= zH9UCo()W6E(j}`ts=uSIjCX->`XuSzyJeFJ?!vkW!E8znNWn zf2`U4jeE_$e)-HS>^pGS_Y&qzpK3O=FXMi?54-pHsae>wbDQraumjk=EBQaJ&VFll zM$=%ks$BLIQ{N&A0r^ey8t9r=^uC~ZOY;>`I_7KHQ7rAAN)=<~G)jK_)M{3JOi!YS zf;yfm7DDq`=_{r+qQZ>e0}7P~Xa%B*X~hAd$^##cttj$lb}A3uDQmRTsEIFtMyD7W zjX}p}T+o%HyNc3R3^YoDRtA7C5xrRBL_MNn>>3{@+J3)Gku z2S1y|XNj6bJ$#~T$1tB*>gCBTyr&|YfdTGoDzk($mO@f9LMXt zpU*QM=>5`?Js$&&imdS$zEaQ~Gf|9u!*0N-;h>7AS|>k-#+l?*#>auE2$}J*zvh5K zR6(L8(MW$$6MDL$= CalamityUtils.GetText("NPCs.ArmoredDiggerHead.DisplayName"); - public override void SetStaticDefaults() - { - this.HideFromBestiary(); - } - - public override void SetDefaults() - { - NPC.damage = 55; - NPC.width = 34; - NPC.height = 34; - NPC.defense = 30; - NPC.lifeMax = 20000; - NPC.knockBackResist = 0f; - NPC.aiStyle = -1; - AIType = -1; - NPC.behindTiles = true; - NPC.noGravity = true; - NPC.noTileCollide = true; - NPC.HitSound = SoundID.NPCHit4; - NPC.DeathSound = SoundID.NPCDeath14; - NPC.netAlways = true; - NPC.dontCountMe = true; - Banner = ModContent.NPCType(); - BannerItem = ModContent.ItemType(); - NPC.Calamity().VulnerableToSickness = false; - NPC.Calamity().VulnerableToElectricity = true; - } - - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) - { - return false; - } - - public override void AI() - { - if (NPC.ai[3] > 0f && Main.npc[(int)NPC.ai[3]].type == ModContent.NPCType()) - { - NPC.realLife = (int)NPC.ai[3]; - } - if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) - { - NPC.TargetClosest(true); - } - bool shouldDie = false; - if (NPC.ai[1] <= 0f) - { - shouldDie = true; - } - else if (Main.npc[(int)NPC.ai[1]].life <= 0) - { - shouldDie = true; - } - if (shouldDie && !Main.zenithWorld) - { - NPC.life = 0; - NPC.HitEffect(0, 10.0); - NPC.checkDead(); - } - Vector2 segmentPosition = new Vector2(NPC.position.X + (float)NPC.width * 0.5f, NPC.position.Y + (float)NPC.height * 0.5f); - float targetXDist = Main.player[NPC.target].position.X + (float)(Main.player[NPC.target].width / 2); - float targetYDist = Main.player[NPC.target].position.Y + (float)(Main.player[NPC.target].height / 2); - targetXDist = (float)((int)(targetXDist / 16f) * 16); - targetYDist = (float)((int)(targetYDist / 16f) * 16); - segmentPosition.X = (float)((int)(segmentPosition.X / 16f) * 16); - segmentPosition.Y = (float)((int)(segmentPosition.Y / 16f) * 16); - targetXDist -= segmentPosition.X; - targetYDist -= segmentPosition.Y; - float targetDistance = (float)Math.Sqrt((double)(targetXDist * targetXDist + targetYDist * targetYDist)); - if (NPC.ai[1] > 0f && NPC.ai[1] < (float)Main.npc.Length) - { - try - { - segmentPosition = new Vector2(NPC.position.X + (float)NPC.width * 0.5f, NPC.position.Y + (float)NPC.height * 0.5f); - targetXDist = Main.npc[(int)NPC.ai[1]].position.X + (float)(Main.npc[(int)NPC.ai[1]].width / 2) - segmentPosition.X; - targetYDist = Main.npc[(int)NPC.ai[1]].position.Y + (float)(Main.npc[(int)NPC.ai[1]].height / 2) - segmentPosition.Y; - } - catch - { - } - NPC.rotation = (float)Math.Atan2((double)targetYDist, (double)targetXDist) + 1.57f; - targetDistance = (float)Math.Sqrt((double)(targetXDist * targetXDist + targetYDist * targetYDist)); - int segmentWidth = (int)(44f * NPC.scale); - targetDistance = (targetDistance - (float)segmentWidth) / targetDistance; - targetXDist *= targetDistance; - targetYDist *= targetDistance; - NPC.velocity = Vector2.Zero; - NPC.position.X = NPC.position.X + targetXDist; - NPC.position.Y = NPC.position.Y + targetYDist; - } - } - - public override bool CheckActive() - { - return false; - } - - public override void HitEffect(NPC.HitInfo hit) - { - for (int k = 0; k < 3; k++) - { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); - } - if (NPC.life <= 0) - { - for (int k = 0; k < 10; k++) - { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); - } - if (!Main.dedServ) - { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ArmoredDiggerTail").Type, 1f); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ArmoredDiggerTail2").Type, 1f); - } - } - } - - public override void ModifyTypeName(ref string typeName) - { - if (Main.zenithWorld) - { - typeName = CalamityUtils.GetTextValue("NPCs.MechanizedSerpent"); - } - } - - public override Color? GetAlpha(Color drawColor) - { - if (Main.zenithWorld) - { - Color lightColor = Color.Orange * drawColor.A; - return lightColor * NPC.Opacity; - } - else return null; - } - } -} diff --git a/NPCs/NormalNPCs/ArmoredDiggerTail.png b/NPCs/NormalNPCs/ArmoredDiggerTail.png deleted file mode 100644 index ce25bd2ffe977dc0ea250d898a22493f310a57a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 735 zcmV<50wDc~P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0(414K~z{r-Iz^C z6k!<0H*q^8m`dWwToo4~+cpS0MRll4DEV;^l0DR=gB5h|Wnjv?0F*7-n@>zs&rz+?v7;JG4b2ls(9+e zaq;c@4`OxYK`}G^QAEXJ#$89k@!X=!s?Z zadBmGLY)11KqQ~M>sS(7M)r%T-cE7w_Fd5#N6G^h#7x`M8}HP{2#%!^Lcs|%?&U$0H%2b>^oTQ484-<+J`>4^h`eL_4l;CK-$fA}IhquokBy1W#mE*%V)14X z-Mc>|vTLXzVVxHaQIps;*9I<&DC>O^-E$;hq1HTna7X6|M{L*57o8PffVQi*j$FBV zLv*+LBAhAKwNs6G$HW-bwpds1Y|px7BK}PM!=Jf-_)g%4FW(8=_?zr~o@YG94{jIa zZj4wFGxq-w+i8V$cH8~Gr1Ts?Hgi&Ys4Zcc_y2Lk$~weK!>(^vjyMvD`~f}JHMS^s R$HD*r002ovPDHLkV1n<*XK(-j diff --git a/Tiles/MonsterBanner.cs b/Tiles/MonsterBanner.cs index 80e501748d..d4b21318ae 100644 --- a/Tiles/MonsterBanner.cs +++ b/Tiles/MonsterBanner.cs @@ -4,6 +4,7 @@ using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.Crags; +using CalamityMod.NPCs.Deconstructors; using CalamityMod.NPCs.DraedonLabThings; using CalamityMod.NPCs.Leviathan; using CalamityMod.NPCs.NormalNPCs; @@ -306,7 +307,7 @@ namespace CalamityMod.Tiles npc = NPCType(); break; case 77: - npc = NPCType(); + npc = NPCType(); break; case 78: npc = NPCType(); diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index 119239acb0..167a5018ac 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -279,7 +279,6 @@ namespace CalamityMod.UI NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), //Clone's brothers NPCType(), diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index f9a001ad6f..bc6f2278bd 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -403,9 +403,6 @@ namespace CalamityMod { ModContent.NPCType(), holy }, { ModContent.NPCType(), holy }, - { ModContent.NPCType(), immuneToEverything }, - { ModContent.NPCType(), immuneToEverything }, - { ModContent.NPCType(), immuneToEverything }, { ModContent.NPCType(), immuneToEverything }, { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { BuffID.Poisoned, BuffID.Venom }) }, From 44ca80f234a516eeaafb470570bd0a53d2e56d15 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Fri, 21 Nov 2025 09:25:31 -0600 Subject: [PATCH 41/48] burrower bestiary shows cobalt --- NPCs/Deconstructors/Burrower.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NPCs/Deconstructors/Burrower.cs b/NPCs/Deconstructors/Burrower.cs index 55ec956f4b..ea4d2d5f7d 100644 --- a/NPCs/Deconstructors/Burrower.cs +++ b/NPCs/Deconstructors/Burrower.cs @@ -548,7 +548,7 @@ namespace CalamityMod.NPCs.Deconstructors npcLoot.Add(ItemID.CrimtaneOre, 5, 6, 32); var condition = npcLoot.DefineConditionalDropSet(DropHelper.PostPlant()); - condition.Add(ItemID.CobaltOre, 2, 6, 32,true); + condition.Add(ItemID.CobaltOre, 2, 6, 32); condition.Add(ItemID.PalladiumOre, 2, 6, 32); condition.Add(ItemID.MythrilOre, 3, 6, 32); condition.Add(ItemID.OrichalcumOre, 3, 6, 32); From 5928e271177157991dac67595caadfdaf975cc37 Mon Sep 17 00:00:00 2001 From: Raesh Date: Fri, 21 Nov 2025 14:59:13 -0500 Subject: [PATCH 42/48] Festive Wing Sound Reduction + Rusty Beacon Classification fix -Rusty beacon prototype is now properly classified as a sentry item. -Festive wings ornaments make 25% less sound when spawning ornaments and 75% less when picking them up as they were far too loud before. --- Items/Weapons/Summon/RustyBeaconPrototype.cs | 1 + Projectiles/Typeless/FestiveWingsOrnament.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Summon/RustyBeaconPrototype.cs b/Items/Weapons/Summon/RustyBeaconPrototype.cs index 392bacbe06..b70e451dc8 100644 --- a/Items/Weapons/Summon/RustyBeaconPrototype.cs +++ b/Items/Weapons/Summon/RustyBeaconPrototype.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; + Item.sentry = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Projectiles/Typeless/FestiveWingsOrnament.cs b/Projectiles/Typeless/FestiveWingsOrnament.cs index f502cd8046..9190221ad3 100644 --- a/Projectiles/Typeless/FestiveWingsOrnament.cs +++ b/Projectiles/Typeless/FestiveWingsOrnament.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Typeless public new string LocalizationCategory => "Projectiles.Typeless"; public override string Texture => "Terraria/Images/Projectile_" + ProjectileID.OrnamentFriendly; - internal static readonly SoundStyle JingleSound = new("CalamityMod/Sounds/Item/FestiveJingle") { Volume = 0.5f, PitchVariance = 0.5f }; + internal static readonly SoundStyle JingleSound = new("CalamityMod/Sounds/Item/FestiveJingle") { Volume = 0.25f, PitchVariance = 0.5f }; public override void SetStaticDefaults() => Main.projFrames[Type] = Main.projFrames[ProjectileID.OrnamentFriendly]; @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Typeless if (Vector2.Distance(player.Center, Projectile.Bottom) < 32f && player.wingTimeMax > 0f) { player.wingTime = MathHelper.Clamp(player.wingTime + 75f, 0f, player.wingTimeMax); - SoundEngine.PlaySound(SoundID.Item29, player.Center); + SoundEngine.PlaySound(SoundID.Item29 with { Volume = 0.25f }, player.Center); Projectile.Kill(); int dustType = DustID.GemRuby - Projectile.frame; From 447c61e2b303c11c74297d8ec9831ad250be4860 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 21 Nov 2025 17:56:55 -0500 Subject: [PATCH 43/48] Fixed True VHex being boosted by sickness instead of heat --- Buffs/DamageOverTime/TrueVulnerabilityHex.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs index b4d0be15c0..97cc48f2b3 100644 --- a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs +++ b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Buffs.DamageOverTime public static DebuffData debuffData = new DebuffData() { EnemyLostRegen = 3996, //6x the tick size - SicknessDebuffScaling = 1, + HeatDebuffScaling = 1, MinimumDamageTickSize = 666, //Vhex should always have ticks of 666 MultiplierDamageTickSize = 0 }; From 093678d65dc900008f2294686da004d50d47bf77 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 21 Nov 2025 20:18:47 -0500 Subject: [PATCH 44/48] Added Bottled Panacea --- Cooldowns/PanaceaCooldown.cs | 18 +++++ Cooldowns/PanaceaCooldown.png | Bin 0 -> 387 bytes Cooldowns/PanaceaCooldownOutline.png | Bin 0 -> 235 bytes Cooldowns/PanaceaCooldownOverlay.png | Bin 0 -> 198 bytes Items/Potions/BottledPanacea.cs | 67 ++++++++++++++++++ Items/Potions/BottledPanacea.png | Bin 0 -> 399 bytes .../Mods.CalamityMod.Items.Potions.hjson | 9 +++ Localization/en-US/Mods.CalamityMod.UI.hjson | 1 + NPCs/SunkenSea/PolypPanasea.cs | 4 +- 9 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 Cooldowns/PanaceaCooldown.cs create mode 100644 Cooldowns/PanaceaCooldown.png create mode 100644 Cooldowns/PanaceaCooldownOutline.png create mode 100644 Cooldowns/PanaceaCooldownOverlay.png create mode 100644 Items/Potions/BottledPanacea.cs create mode 100644 Items/Potions/BottledPanacea.png diff --git a/Cooldowns/PanaceaCooldown.cs b/Cooldowns/PanaceaCooldown.cs new file mode 100644 index 0000000000..cc2e416f71 --- /dev/null +++ b/Cooldowns/PanaceaCooldown.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework; +using Terraria.Audio; +using Terraria.Localization; + +namespace CalamityMod.Cooldowns +{ + public class PanaceaCooldown : CooldownHandler + { + public static new string ID => "Panacea"; + public override bool ShouldDisplay => true; + public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); + public override string Texture => "CalamityMod/Cooldowns/PanaceaCooldown"; + public override Color OutlineColor => new Color(122, 198, 255); + public override Color CooldownStartColor => new Color(0, 128, 255); + public override Color CooldownEndColor => new Color(0, 255, 255); + public override SoundStyle? EndSound => new("CalamityMod/Sounds/Custom/AbilitySounds/PotionSicknessOver"); + } +} diff --git a/Cooldowns/PanaceaCooldown.png b/Cooldowns/PanaceaCooldown.png new file mode 100644 index 0000000000000000000000000000000000000000..290132735c2d86b7887071494d51fa1dc75f6145 GIT binary patch literal 387 zcmV-}0et?6P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0T@X{K~y+Tz0y5P zLQx#R;YSICpiKm!&)^4exd;w{b6ZopUm%*xtyO4k5JQ@R1{W6{baHEH5gHsE3JP(! zO$UxI7=gFnbpB^J_u-tI^T)0(j?;L)dHBl3b3Psp(c0;|YBrlGj7B5ye18repYFi> z+Xs>K|Aax-Xf(idIt8=Y3|wEHvO}7^a8p*TR>5#M1mp1-e81j; z$miF;QK?jj?r^zWfbh$Nx;d=5&b5-69;pxthhrSK>$ zYPA~Z^?F32(59@@=@7|62N!O=@@lnW&z%KXzu({bhh-`Z)$8>Xk|bH%9}EWUk%h7s hhJrNon=Ev2;SZ#@Y*PPue%1g0002ovPDHLkV1hm#pf>;j literal 0 HcmV?d00001 diff --git a/Cooldowns/PanaceaCooldownOutline.png b/Cooldowns/PanaceaCooldownOutline.png new file mode 100644 index 0000000000000000000000000000000000000000..f31edcf0b449a5d8be2ce60e7116f21003bf383e GIT binary patch literal 235 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!3Iwk#}E(it5Y1g4k+-j%>MWP{KreWn|2(@ z5-!Md>$T>(wY6h+wY{0~>*Eie9lFosFDs~e%;x%KUZ+2euesvp=PBHGxcgG)MtuH; z*)mfk_k4K0{!r~F-XBL|cigvRTjjrxF@RHPQEe%kf)`8L^{dhhQv9b dzfCXMc%>`)mz~$m&;h!I!PC{xWt~$(69Dd}SP=jK literal 0 HcmV?d00001 diff --git a/Cooldowns/PanaceaCooldownOverlay.png b/Cooldowns/PanaceaCooldownOverlay.png new file mode 100644 index 0000000000000000000000000000000000000000..7d72fd3769a6ed54d09db0e8465025d39a481f19 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r*vAk26?e?}78*1_d5x$H#x)$AmXViR>4= zuO}_3p`@FZ_RO5&$K1a=0>4(R)_CRm()!^Von_+hPR;PE(7GJ^GvwGm(S5&9ufC*_ oY^5meS#7jTe3ORk$s47KjFIy+#P7Sifn3Sp>FVdQ&MBb@007cK5C8xG literal 0 HcmV?d00001 diff --git a/Items/Potions/BottledPanacea.cs b/Items/Potions/BottledPanacea.cs new file mode 100644 index 0000000000..347e59c2f1 --- /dev/null +++ b/Items/Potions/BottledPanacea.cs @@ -0,0 +1,67 @@ +using CalamityMod.Cooldowns; +using CalamityMod.DataStructures; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Potions +{ + public class BottledPanacea : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Potions"; + + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[2] { + new Color(84, 215, 254), + new Color(35, 101, 192) + }; + } + + public override void SetDefaults() + { + Item.UseSound = SoundID.Item3; + Item.useStyle = ItemUseStyleID.DrinkLiquid; + Item.useTurn = true; + Item.useTime = Item.useAnimation = 17; + Item.maxStack = Item.CommonMaxStack; + Item.consumable = true; + Item.value = Item.sellPrice(silver: 2); + Item.rare = ItemRarityID.Blue; + } + + public override bool CanUseItem(Player player) => !player.HasCooldown(PanaceaCooldown.ID); + + public override bool? UseItem(Player player) + { + if (player.itemAnimation > 0 && player.itemTime == 0) + { + player.itemTime = Item.useTime; + SoundEngine.PlaySound(SoundID.Item4, player.Center); + + for (int i = Player.MaxBuffs - 1; i >= 0; i--) + { + int buffType = player.buffType[i]; + if (BuffDatasets.DebuffDataset[buffType] is not null && (BuffDatasets.DebuffDataset[buffType].SicknessDebuffScaling > 0 || BuffDatasets.DebuffDataset[buffType].ElectricDebuffScaling > 0)) + player.DelBuff(i); + } + + for (int i = 0; i < 4; i++) + { + Vector2 plusVel = new Vector2(Main.rand.NextFloat(-0.55f, 0.55f), Main.rand.NextFloat(-6f, 0f)); + HealingPlus plus = new(Main.rand.NextVector2FromRectangle(player.Hitbox), Main.rand.NextFloat(1.25f, 1.5f), plusVel, Color.SkyBlue, Color.SkyBlue, 20); + GeneralParticleHandler.SpawnParticle(plus); + } + for (int d = 0; d < 10; d++) + Dust.NewDust(player.position, player.width, player.height, DustID.BlueTorch); + + player.AddCooldown(PanaceaCooldown.ID, CalamityUtils.SecondsToFrames(30)); + } + return true; + } + } +} diff --git a/Items/Potions/BottledPanacea.png b/Items/Potions/BottledPanacea.png new file mode 100644 index 0000000000000000000000000000000000000000..8a98e6f6bfceac88cf4ff96ec22e18785a28ae1c GIT binary patch literal 399 zcmV;A0dW3_P)Px#1ZP1_K>z@;j|==^1poj6IY~r8R5(w)(mzN7VHn5p??n*^wP~{{Efvz#)E|n% zDTHWi5TvEi&72D&CPujB@k>V5CjnlLPEC#9Sa0;xQ6$hcrUF8?(Mg{_dM^* z%ZK+li$CUIH{|N|(N)*d>k+*OBEH*)CAL>~0VbzY60*RjRFum-UgsndoVNQQIXx8kEu>wEh2HeHQel}jp=a!<`WG7x~lt` z;Dz#W(q94~NgIH+h`daBGAq?r`)M11SMTj4feQzwe7zO|P57;>aysx2V^k=KFJ@hU tNNUH|@7M+SK_)RTl!#RFn@ke8@B^kTXaFom=t%$o002ovPDHLkV1jrEpeg_W literal 0 HcmV?d00001 diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index fe583cd6b0..8f627dff88 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -36,6 +36,15 @@ BlasphemousDonut: { ''' } +BottledPanacea: { + DisplayName: Bottled Panacea + Tooltip: + ''' + Cures you of all sickness and electricity debuffs when consumed + This has a 30 second cooldown + ''' +} + BoundingPotion: { DisplayName: Bounding Potion Tooltip: "{0}% increased jump speed and {1}% increased jump height" diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 447903f9c0..87001e5c43 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -127,6 +127,7 @@ Cooldowns: { OldDukeScalesFatigue: Stamina OmegaBlueActive: Abyssal Madness OmegaBlueCooldown: Abyssal Madness Cooldown + Panacea: Panacea Cooldown PermafrostConcoction: Permafrost's Concoction Cooldown PlagueBlackout: Plague Blackout Cooldown PotionSickness: Healing Cooldown diff --git a/NPCs/SunkenSea/PolypPanasea.cs b/NPCs/SunkenSea/PolypPanasea.cs index 384e6de48e..8d25c15808 100644 --- a/NPCs/SunkenSea/PolypPanasea.cs +++ b/NPCs/SunkenSea/PolypPanasea.cs @@ -16,6 +16,7 @@ using CalamityMod.Enums; using System.IO; using CalamityMod.Particles; using Terraria.Audio; +using CalamityMod.Items.Potions; namespace CalamityMod.NPCs.SunkenSea { @@ -480,8 +481,7 @@ namespace CalamityMod.NPCs.SunkenSea { if (PanaceaTimer > 60) { - // TODO: add actual panacea item - Item.NewItem(NPC.GetSource_CatchEntity(NPC), (int)NPC.Center.X, (int)NPC.Center.Y, 1, 1, ItemID.FlaskofPoison); + Item.NewItem(NPC.GetSource_CatchEntity(NPC), (int)NPC.Center.X, (int)NPC.Center.Y, 1, 1, ModContent.ItemType()); PanaceaTimer = 60; } return false; From f7c7007617813347408f99c3db32bda39ab9ce9d Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 21 Nov 2025 20:55:43 -0500 Subject: [PATCH 45/48] Removed IsSicknessDebuff and IsFireDebuff buff ID sets in favor of checking DebuffData --- Buffs/StatDebuffs/WhisperingDeath.cs | 9 ++++++++- CalPlayer/CalamityPlayerLifeRegen.cs | 7 ++++--- DataStructures/DebuffData.cs | 6 ++++++ Systems/Collections/CalamityBuffSets.cs | 17 ----------------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/Buffs/StatDebuffs/WhisperingDeath.cs b/Buffs/StatDebuffs/WhisperingDeath.cs index dc05297df1..d24a61bc89 100644 --- a/Buffs/StatDebuffs/WhisperingDeath.cs +++ b/Buffs/StatDebuffs/WhisperingDeath.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.DataStructures; +using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -7,12 +8,18 @@ namespace CalamityMod.Buffs.StatDebuffs { public class WhisperingDeath : ModBuff { + // Whispering Death does not deal DoT, but is classified as a sickness debuff. + public static DebuffData debuffData = new DebuffData() + { + SicknessDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index f963418e0e..b6d1b0e46a 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -6,6 +6,7 @@ using CalamityMod.Buffs.Placeables; using CalamityMod.Buffs.StatBuffs; using CalamityMod.CalPlayer.Dashes; using CalamityMod.Cooldowns; +using CalamityMod.DataStructures; using CalamityMod.Enums; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Wings; @@ -307,9 +308,9 @@ namespace CalamityMod.CalPlayer int buffID = Player.buffType[l]; if (Player.buffTime[l] <= 2) continue; - bool shouldHalveDuration = CalamityBuffSets.IsSicknessDebuff[buffID]; + bool shouldHalveDuration = BuffDatasets.DebuffDataset[buffID].SicknessDebuffScaling > 0; if (livingDewHalveDebuffs) - shouldHalveDuration |= CalamityBuffSets.IsFireDebuff[buffID]; + shouldHalveDuration |= BuffDatasets.DebuffDataset[buffID].HeatDebuffScaling > 0; if (purity) shouldHalveDuration |= CalamityBuffSets.IsDebuff[buffID]; @@ -355,7 +356,7 @@ namespace CalamityMod.CalPlayer } // Permafrost's Concoction increases life regen while afflicted with a fire debuff - if (permafrostsConcoction && Player.buffType.Any(l => CalamityBuffSets.IsFireDebuff[l])) + if (permafrostsConcoction && Player.buffType.Any(l => BuffDatasets.DebuffDataset[l].HeatDebuffScaling > 0)) { if (Player.lifeRegenTime < 900) Player.lifeRegenTime = 900; diff --git a/DataStructures/DebuffData.cs b/DataStructures/DebuffData.cs index f663064384..e468aef941 100644 --- a/DataStructures/DebuffData.cs +++ b/DataStructures/DebuffData.cs @@ -23,6 +23,7 @@ namespace CalamityMod.DataStructures BuffID.CursedInferno, DebuffData.CursedInferno, BuffID.ShadowFlame, DebuffData.Shadowflame, BuffID.Daybreak, DebuffData.Daybroken, + BuffID.Burning, DebuffData.Burning, BuffID.Frostburn, DebuffData.Frostburn, BuffID.Frostburn2, DebuffData.Frostbite, BuffID.Poisoned, DebuffData.Poisoned, @@ -378,6 +379,11 @@ namespace CalamityMod.DataStructures HeatDebuffScaling = 1, NPCLifeRegenMethod = DaybrokenRegen }; + // Provided purely to classify it as a heat debuff + public static DebuffData Burning = new DebuffData() + { + HeatDebuffScaling = 1 + }; public static DebuffData Frostburn = new DebuffData() { EnemyLostRegen = 16, diff --git a/Systems/Collections/CalamityBuffSets.cs b/Systems/Collections/CalamityBuffSets.cs index 35a8b9fd1f..4a1b8a821d 100644 --- a/Systems/Collections/CalamityBuffSets.cs +++ b/Systems/Collections/CalamityBuffSets.cs @@ -49,23 +49,6 @@ namespace CalamityMod.Systems.Collections BuffID.WeaponImbueIchor, BuffID.WeaponImbueNanites, BuffID.WeaponImbueConfetti, BuffID.WeaponImbuePoison, BuffType(), BuffType(), BuffType()); - /// - /// If for a buff type, then that buff is considered to be a sickness debuff.
- /// Used for reducing buff duration with Honey Dew and its upgrades.
- /// Defaults to . - ///
- public static bool[] IsSicknessDebuff = Factory.CreateBoolSet(BuffID.Poisoned, BuffID.Venom, BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType()); - - /// - /// If for a buff type, then that buff is considered to be a fire debuff.
- /// Used for reducing buff duration with Living Dew and its upgrades, and providing Permafrost's Concoction's life regeneration boost.
- /// Defaults to . - ///
- public static bool[] IsFireDebuff = Factory.CreateBoolSet(BuffID.OnFire, BuffID.OnFire3, BuffID.Burning, BuffID.CursedInferno, BuffID.ShadowFlame, BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType()); - /// /// If for a buff type, then that buff is considered to be a debuff.
/// This general-purpose set has several different uses, including reducing buff duration with Radiance, Crown Jewel and its upgrades' debuff effects, and removing debuffs with Cleansing Jelly and its upgrades' auras.
From faaa80a43483ff9e6054f7bcab14da2a15623bf2 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 22 Nov 2025 09:02:36 +0700 Subject: [PATCH 46/48] Effervescence sound and spread tweak --- Items/Weapons/Magic/Effervescence.cs | 12 ++++++++---- Projectiles/Magic/BlueBubble.cs | 5 +++-- Projectiles/Magic/UberBubble.cs | 12 +++++++----- Sounds/Item/EffervescenceBurst.ogg | Bin 0 -> 13371 bytes Sounds/Item/EffervescenceFire.ogg | Bin 0 -> 16815 bytes Sounds/Item/EffervescencePop.ogg | Bin 0 -> 9279 bytes 6 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 Sounds/Item/EffervescenceBurst.ogg create mode 100644 Sounds/Item/EffervescenceFire.ogg create mode 100644 Sounds/Item/EffervescencePop.ogg diff --git a/Items/Weapons/Magic/Effervescence.cs b/Items/Weapons/Magic/Effervescence.cs index e594491c7e..515cf9267c 100644 --- a/Items/Weapons/Magic/Effervescence.cs +++ b/Items/Weapons/Magic/Effervescence.cs @@ -2,6 +2,7 @@ using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Magic public class Effervescence : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/EffervescenceFire") { PitchVariance = 0.1f }; + public static readonly SoundStyle BurstSound = new("CalamityMod/Sounds/Item/EffervescenceBurst") { PitchVariance = 0.1f }; + public static readonly SoundStyle PopSound = new("CalamityMod/Sounds/Item/EffervescencePop") { PitchVariance = 0.1f }; + public override void SetDefaults() { Item.width = 56; @@ -25,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.knockBack = 3.75f; Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; - Item.UseSound = SoundID.Item95; + Item.UseSound = FireSound; Item.autoReuse = true; Item.shootSpeed = 13f; Item.shoot = ModContent.ProjectileType(); @@ -37,9 +42,8 @@ namespace CalamityMod.Items.Weapons.Magic { for (int randomBullets = 0; randomBullets < 4; randomBullets++) { - float SpeedX = velocity.X + Main.rand.Next(-25, 26) * 0.05f; - float SpeedY = velocity.Y + Main.rand.Next(-25, 26) * 0.05f; - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); + Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(10f)) * Main.rand.NextFloat(0.85f, 1.2f); + Projectile.NewProjectile(source, position, newVel, type, damage, knockback, player.whoAmI); } return false; } diff --git a/Projectiles/Magic/BlueBubble.cs b/Projectiles/Magic/BlueBubble.cs index e54b7b72f7..9d95003c4c 100644 --- a/Projectiles/Magic/BlueBubble.cs +++ b/Projectiles/Magic/BlueBubble.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -83,7 +84,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnKill(int timeLeft) { - SoundEngine.PlaySound(SoundID.Item54, Projectile.Center); + SoundEngine.PlaySound(Effervescence.PopSound, Projectile.Center); Particle Star = new CritSpark(Projectile.Center, Vector2.Zero, Color.SkyBlue, Color.DeepSkyBlue, Main.rand.NextFloat(1f, 1.1f), 30, 0.1f, 3f); GeneralParticleHandler.SpawnParticle(Star); int num190 = Main.rand.Next(5, 9); diff --git a/Projectiles/Magic/UberBubble.cs b/Projectiles/Magic/UberBubble.cs index 36f9ad6e48..6af07a9d9d 100644 --- a/Projectiles/Magic/UberBubble.cs +++ b/Projectiles/Magic/UberBubble.cs @@ -1,10 +1,12 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Particles; -using CalamityMod.Dusts; + namespace CalamityMod.Projectiles.Magic { public class UberBubble : ModProjectile, ILocalizedModType @@ -63,7 +65,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnKill(int timeLeft) { - SoundEngine.PlaySound(SoundID.Item96, Projectile.Center); + SoundEngine.PlaySound(Effervescence.BurstSound, Projectile.Center); Particle Star = new GenericSparkle(Projectile.Center, Vector2.Zero, Color.Purple, Color.PeachPuff, Main.rand.NextFloat(0.5f, 0.6f), 30, 0.1f, 3f); GeneralParticleHandler.SpawnParticle(Star); Star = new GenericSparkle(Projectile.Center + Projectile.velocity, Vector2.Zero, Color.MediumPurple, Color.LightPink, Main.rand.NextFloat(0.5f, 0.6f), 20, 0.1f, 3f); @@ -80,7 +82,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.owner == Main.myPlayer) { for (int numBubbles = 0; numBubbles < 3; numBubbles++) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Projectile.velocity.X * (Main.rand.NextFloat() * 2f), Projectile.velocity.Y * (Main.rand.NextFloat() * 2f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(20f)) * Main.rand.NextFloat(0.5f, 2f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } } } diff --git a/Sounds/Item/EffervescenceBurst.ogg b/Sounds/Item/EffervescenceBurst.ogg new file mode 100644 index 0000000000000000000000000000000000000000..bdffb45db542abf6ed5411326fd8b10b6dcc2b55 GIT binary patch literal 13371 zcmeIYc|4Tg`#*jUL&!4rJu?iM385h*X2y&d#xiE?$-a~9TE|xQeNSZ>Vk{v`X+sDh zOG>;*Wr?H|rFzl#rq}!Pet*9Ie14C|=l9p|@jH)mpZhx3b=K!~-RE3q&X{|7Sph7- zKOwUALC`L_K7Wb|IRFVi9qj58vdds0)b73jfZhVxd*6YW@7DaUuv>Fi5|hP4!Waz?5@Q>wpFYCi{$9UA~Z01mL6Q4+%_ZQdvgX_qCx7Z($mN>7{i zqWWHSBLJ|l9C|6B(c_F(^?IkNc%TmRHyVXuoG%u3Io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s z!liYi^J?)v7XO7i=tWs;D5sDlk1WMMMwO-epoArC(%PRJ(U>F`Z#KI>Je{jYf6+G+@!XP&)(N+y0*M(OxeGnvXs&JBJcH)jg>RNAu9CHQNW_by#iJ=qmZAn!H<1hNua~I15W$$3Xa#hU3l`9?0MG zRgU|1=B~01f)==`@<7hpilt*;!@G2md0*xU0Ok#F@v>geYsPZE(#Jv~?8jK--G2jY ze;v(WpLRbJGN;fVEH9jx!NR|fTkUxf54S<>`Y1ewQ%I=i2^$3i`i!{;n8cQ4<07*$ zoaxrbGbp5%Wfk>i4u`;Wdih}qtf{^yQq=Q+@6|NeC{<&^r|pD`^ccQuqyiHVM#;e- zU2mP{fLUPMN#%t-FkT!Jg``efY7;+&$Juj;oTz1fdDmq4HR(a5S@2~CAyvc*bu7GQ zsxqmmW~Mjl(|1#Yng(Ih!i7(7IXS9Ippy-yICiJJW*pBq86$znr&*d+oja_?EZ>#E z--qN~dNiYYiVs;Y!R$u@jW7d6|#Vsl@kLt2!z?(4zqmAbNSt&guQXy)mr!-Hi8tEBO0_o7mhX%}@QWM2;HQ zT3`{hXahEW0YhUkNyS#zx1&%BY`=9^L6sB%;W9UZgC%w+sBWaJj98cBd4Ddn{GO!B zPTWS*NF^Km|8L+OzE1+IEC8fBqW%xRn=Wey~r(63w>7l_Ny9p`mF70YOuP zqHYKMp<64SX#yPRUiYsDN-|%$V+Yycz{A}6u-9>7oDam?GQF0qvtC{hbVY7>>Ka}r zdRbWP?{vLui=fbi@h(VBm5bi~j^|?tf&~82JCj%!tXRHkCP8pxm5QEdz7}XTv9a1* zUD-DNG4xn~)fTq5F|)shAwna8jH{%IrUy&S9>PFhG8>gT9)MnZbrI*{9?hM{W(j-t zG(Rxp4)~>mN;Bv!uQpd98Xnd^)xDgM)MOivYgQ+|C`jSoZ$|TP0sW literal 0 HcmV?d00001 diff --git a/Sounds/Item/EffervescenceFire.ogg b/Sounds/Item/EffervescenceFire.ogg new file mode 100644 index 0000000000000000000000000000000000000000..585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0gM+PpugI621Ux|F$X@wApNWH8fnS)N)!4elnS`)M;P>}&dJ zwTKk$Vt{n*SPvWcK{(SStqcPZWZ<=qzTv2Q4fmiSB?ylg{9+c?IB{kP$|9ky4{nbnyz$=<$0s%1W*RcH>p>n~I)qVQ@Q0w=Zp(8&6ScK$aEj&Z^xcdcO(QJJb*+;d!$t zKK?yTqGX!ZAO^ZM$9JkbLFU6iJk^W!0WMw%x{u=qU1hyD=YDNXY`V{ew6h1v-(BSK zUXmAE{r#)fYwpJEyk66Q;i#mFwQU1V+*rkQ-X-0|ysFZLElG~LSmVKd_=72S&`w(* zZb6hT7Xf^~tyIeE!hruXARaCmY~O2LdIiY}S!NPx0qf1c#t>^yLh$KQvoS>@Rt_VM zN8i}XZB@-yC*`+GBe{Y%q`M|v(w(n!l*amU=`5r*Nf)dYC^NSXqNNgj0L&8p;2!&H zK*E{&TdrY_Zbo@e^>VNIM(D#W5jr0QmN6&&<$GOmjASfU+6D(rjO_c~nEPoTKT)T$R(^f%sz!7YQ&Ac|_!H^} zRXr*BSYo<4p+>T2QqJnB^*a9j`hv?!0fw?!+<{i(dbQa0v7`J(IHJ6h?bUC)!9v)-0< vePAvSeCvngtcW;;$+;)<4N1-l6jFaLJ#3PK&Ac|>$adKsCiVH>KEeJMsMece literal 0 HcmV?d00001 From 9d73881d4a81e2d358cd26f1192c127fad5987d9 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 22 Nov 2025 09:11:03 +0700 Subject: [PATCH 47/48] Restored Witch's Broom expert exclusivity --- NPCs/CalamityGlobalNPCLoot.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 011d9d01e1..571ad01b7c 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -899,8 +899,6 @@ namespace CalamityMod.NPCs // 5-10 Nightmare Fuel @ 100% IF Devourer of Gods dead postDoG.Add(ModContent.ItemType(), 1, 5, 10); - pMoon.OnSuccess(ItemDropRule.ByCondition(new Conditions.NotExpert(), ItemID.WitchBroom, 5)); - // Master items drop in Revengeance pMoon.OnSuccess(ItemDropRule.ByCondition(DropHelper.RevNoMaster, ItemID.MourningWoodMasterTrophy)); pMoon.OnSuccess(ItemDropRule.ByCondition(DropHelper.RevNoMaster, ItemID.SpookyWoodMountItem, 4)); From 9c6b8b24841c757b826b9b3b451c8c248d210690 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 22 Nov 2025 09:43:34 +0700 Subject: [PATCH 48/48] cascaded expert rarities onto upgrades --- Items/Accessories/AmalgamatedBrain.cs | 1 + Items/Accessories/AscendantInsignia.cs | 1 + Items/Accessories/BloodyWormScarf.cs | 1 + Items/Accessories/ChaliceOfTheBloodGod.cs | 1 + Items/Accessories/ShieldoftheHighRuler.cs | 3 ++- Items/Accessories/TheAmalgam.cs | 1 + Items/Accessories/TheCamper.cs | 1 + Rarities/CosmicPurple.cs | 3 +++ 8 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Items/Accessories/AmalgamatedBrain.cs b/Items/Accessories/AmalgamatedBrain.cs index 15cefab5ce..06edff9d56 100644 --- a/Items/Accessories/AmalgamatedBrain.cs +++ b/Items/Accessories/AmalgamatedBrain.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/AscendantInsignia.cs b/Items/Accessories/AscendantInsignia.cs index 24f8cd8b45..63c682c630 100644 --- a/Items/Accessories/AscendantInsignia.cs +++ b/Items/Accessories/AscendantInsignia.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; Item.accessory = true; Item.rare = ModContent.RarityType(); + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/BloodyWormScarf.cs b/Items/Accessories/BloodyWormScarf.cs index 23c4716747..94f56a3c97 100644 --- a/Items/Accessories/BloodyWormScarf.cs +++ b/Items/Accessories/BloodyWormScarf.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/ChaliceOfTheBloodGod.cs b/Items/Accessories/ChaliceOfTheBloodGod.cs index 60bd140a45..c9e140fe6e 100644 --- a/Items/Accessories/ChaliceOfTheBloodGod.cs +++ b/Items/Accessories/ChaliceOfTheBloodGod.cs @@ -43,6 +43,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/ShieldoftheHighRuler.cs b/Items/Accessories/ShieldoftheHighRuler.cs index 1d7bc17922..c824ecf196 100644 --- a/Items/Accessories/ShieldoftheHighRuler.cs +++ b/Items/Accessories/ShieldoftheHighRuler.cs @@ -24,13 +24,14 @@ namespace CalamityMod.Items.Accessories Item.width = 36; Item.height = 38; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 30; + Item.damage = 300; Item.knockBack = 9f; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; Item.defense = 4; Item.accessory = true; + Item.expert = true; } public override bool MeleePrefix() => false; diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index d8c8cc6475..f6b903d3fa 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = RarityType(); + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/TheCamper.cs b/Items/Accessories/TheCamper.cs index 740b72b151..6f41d35859 100644 --- a/Items/Accessories/TheCamper.cs +++ b/Items/Accessories/TheCamper.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.Yellow; Item.accessory = true; Item.defense = 10; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Rarities/CosmicPurple.cs b/Rarities/CosmicPurple.cs index a30636dfdc..34602f8965 100644 --- a/Rarities/CosmicPurple.cs +++ b/Rarities/CosmicPurple.cs @@ -30,6 +30,9 @@ namespace CalamityMod.Rarities var fontSize = font.MeasureString(text); var center = fontSize / 2f; + if (Item.expert) + textColor = Main.DiscoColor; + var glowPosition = new Vector2(X + center.X, Y + center.Y / 1.5f); textColor.A = 0; float pulsing = 2.5f + (float)Math.Sin(time * 5f);