From 650fb436607c041f6660f3f5ccbe4db11e734095 Mon Sep 17 00:00:00 2001 From: Big E Date: Sun, 4 Jan 2026 18:26:53 -0500 Subject: [PATCH 01/56] + Palette Swapping --- Effects/CalamityShaders.cs | 4 ++++ Effects/PaletteSwap.fx | 35 +++++++++++++++++++++++++++++++++++ Effects/PaletteSwap.xnb | Bin 0 -> 2876 bytes 3 files changed, 39 insertions(+) create mode 100644 Effects/PaletteSwap.fx create mode 100644 Effects/PaletteSwap.xnb diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 0e06aeef01..c97027ab00 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -261,6 +261,7 @@ namespace CalamityMod.Effects internal static Asset SeaPrismColorBlendingShader; internal static Asset Dissolve; + internal static Asset PaletteSwap; internal static Asset BrainOfCthulhuForcefield; #endregion @@ -525,6 +526,9 @@ namespace CalamityMod.Effects Dissolve = LoadShader("Dissolve"); RegisterMiscShader(Dissolve, "DissolvePass", "Dissolve"); + PaletteSwap = LoadShader("PaletteSwap"); + RegisterMiscShader(PaletteSwap, "PaletteSwapPass", "PaletteSwap"); + BrainOfCthulhuForcefield = LoadShader("ScreenShaders/BrainOfCthulhuForcefield"); RegisterScreenShader(BrainOfCthulhuForcefield, "BoCShieldPass", "BrainOfCthulhuForcefield"); #endregion diff --git a/Effects/PaletteSwap.fx b/Effects/PaletteSwap.fx new file mode 100644 index 0000000000..2de436b8cd --- /dev/null +++ b/Effects/PaletteSwap.fx @@ -0,0 +1,35 @@ +sampler baseTexture : register(s0); + +float4 sourcePalette[16]; +float4 targetPalette[16]; +float matchThreshold = 0.01; +int paletteSize; + +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR +{ + float4 color = tex2D(baseTexture, coords) * sampleColor; + + // Check each color in the source palette + for (int i = 0; i < paletteSize; i++) + { + float3 diff = color.rgb - sourcePalette[i].rgb; + float distance = sqrt(dot(diff, diff)); + + // If color is close enough to this palette color, swap it + if (distance <= matchThreshold) + { + color.rgb = targetPalette[i].rgb; + break; // Stop checking once we find a match + } + } + + return color; +} + +technique Technique1 +{ + pass PaletteSwapPass + { + PixelShader = compile ps_3_0 PixelShaderFunction(); + } +} \ No newline at end of file diff --git a/Effects/PaletteSwap.xnb b/Effects/PaletteSwap.xnb new file mode 100644 index 0000000000000000000000000000000000000000..742449fa6d836c4acd755fc77f535116ffbf5e95 GIT binary patch literal 2876 zcmeH|&u`pB6vv;vzucr`!|worx=jSFSXOD8pj2wqkO&%yf z1WwC+4nc4PX?v?S{S$gf??@csz@Y~pIQGB+E;Zjb_BPIr_zTMHe(m=@els4wH)C&o zy1HL5u8k8J-y5Ga>%JFwyJ2;!?N&eX-954I`FE;oUON=+u=?TduBeB%gu5gBiv3^F zH+;9#Xx4*@{kiairq^CxsLt`PVy|^uVb>SSZP5*Vw^gw>y4$U0{bTV>&ATJo%S#LM z_1&dyad}59&MhupA#TQxV?@7>KYlQ&+~i=KiJw$*iH*yYho%$v>G3SAZ8s1#alm&a z4mY56KA`b<+%I(*J+o~BPab$(zb-c1mIy-uf0(ZWGfB(;`8ru1oUhRJzY^i;d~wA6 zG+%7<+G36UHgm0v^PU^l8?}Znf`-@HAsU808XB2CFp1Z2C#lG0^IM_D;&FK0W*gTg zoyq3D+u3k~fUv2lChCoL^Xsm-Op^upJQuDj-;T$af`+XEV}0o0`~`v!xI@|`I^E06 z^BDFY8Gkz6kKDz|*gvHG|3d8JG(Iyd#c0EO+$+M$#qpE)XIiU$u*!S-I`;wN`KNo_ zUIObeh73H7#F^VqkV&?B&ik+*K)*nIKi2QipU~eB56gM8aAArCV1h8a2%A~<{gFpC z4D~|*+DI*rcsAMVT=OI{IcDp~cgn^N<9LqTPVdE|BSVdyS941up6%o5y{G4=6WqRX zdybxdqwI^fF4^lhH*eaT4gP%DYu;X`*@AJkI{$w4>f(HLeraKWJ|iler*a>w>zJqy z9Yc?fnO{(x9%9u%HZ=E;`HbQ#@He0@p^oCSNjzb!>o~07zj6+R$M>p7R6b-IYr2Qp zDjP9}WR?4?YFU@TBluAtF<9nh^odx92KpIPQhs7vy;)55ZMDQB-eNfu@dm}<(Ovd) zsehiLKKuF9zmWQc)SrRRV;0F!V{YL!QKX3;`e2J4_KTSB33H^OSd?J{ye2p<%VL=u zVR#^!*O(&<8XL%>#$s6-VR)BGOJj~aqp^V;(^xFWM;LN0&uYw(&uMHRCo~qza>_W@ zoIm8Lhn#$8Dc^+sk5WnHntcc2yeIZ0l+Z>^nJ4)!sTxe8J|{I`=E&z2OY&`EU6?eG zFK8^5FM^qAT{wHJH+vBVW_lK)$ZASiUjBxCYZ2bL5*E z8_2gb7Rz%f Date: Wed, 18 Mar 2026 23:28:26 -0500 Subject: [PATCH 02/56] doze dev wings --- Items/Accessories/Wings/TiredTail.cs | 432 ++++++++++++++++++ Items/Accessories/Wings/TiredTail.png | Bin 0 -> 557 bytes Items/Accessories/Wings/TiredTailPallette.png | Bin 0 -> 1005 bytes Items/Accessories/Wings/TiredTailSegment.png | Bin 0 -> 520 bytes Items/Accessories/Wings/TiredTailTail.png | Bin 0 -> 564 bytes Items/Accessories/Wings/TiredTail_Wings.png | Bin 0 -> 165 bytes ....CalamityMod.Items.Accessories.Wings.hjson | 10 + 7 files changed, 442 insertions(+) create mode 100644 Items/Accessories/Wings/TiredTail.cs create mode 100644 Items/Accessories/Wings/TiredTail.png create mode 100644 Items/Accessories/Wings/TiredTailPallette.png create mode 100644 Items/Accessories/Wings/TiredTailSegment.png create mode 100644 Items/Accessories/Wings/TiredTailTail.png create mode 100644 Items/Accessories/Wings/TiredTail_Wings.png diff --git a/Items/Accessories/Wings/TiredTail.cs b/Items/Accessories/Wings/TiredTail.cs new file mode 100644 index 0000000000..b0cb5af6c7 --- /dev/null +++ b/Items/Accessories/Wings/TiredTail.cs @@ -0,0 +1,432 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Enums; +using CalamityMod.Items.Armor.Auric; +using CalamityMod.Items.Armor.Bloodflare; +using CalamityMod.Items.Armor.Demonshade; +using CalamityMod.Items.Armor.Empyrean; +using CalamityMod.Items.Armor.Fearmonger; +using CalamityMod.Items.Armor.GemTech; +using CalamityMod.Items.Armor.GodSlayer; +using CalamityMod.Items.Armor.Hydrothermic; +using CalamityMod.Items.Armor.OmegaBlue; +using CalamityMod.Items.Armor.Prismatic; +using CalamityMod.Items.Armor.Silva; +using CalamityMod.Items.Armor.Tarragon; +using CalamityMod.Rarities; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Items.Accessories.Wings +{ + // The equip sprite is actually blank as a custom draw layer is used to draw the real sprites without any base sprites conflicting + + [AutoloadEquip(EquipType.Wings)] + public class TiredTail : BaseWings + { + //Same stats as Starboard, but with 4 seconds flight instead of 3 + public override float BonusAscentWhileFalling => 0.95f; + public override float BonusAscentWhileRising => 0.15f; + public override float RisingSpeedThreshold => 1f; + public override float MaxAscentSpeed => 4.5f; + public override float BaseAscent => 0.1f; + + float BoostPower => 3f; + + public override void SetStaticDefaults() + { + //Same stats as Starboard, but with 4 seconds flight instead of 3 + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = ArmorIDs.Wing.Sets.Stats[(int)VanillaWingID.LongRainbowTrailWings]; + ArmorIDs.Wing.Sets.Stats[Item.wingSlot].FlyTime = CalamityUtils.SecondsToFrames(4); + } + + public override void SetDefaults() + { + base.SetDefaults(); + Item.width = 22; + Item.height = 20; + Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + Item.rare = ModContent.RarityType(); + Item.Calamity().devItem = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (!hideVisual) + player.GetModPlayer().tiredTailDraw = true; + if (player.velocity.Y != 0) + { + + if (player.dashDelay != -1) + player.runSlowdown *= 6; + } + + + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(210, 9f, 3.25f, true, 16, 10f); + } + + public override void UpdateVanity(Player player) + { + player.GetModPlayer().tiredTailDraw = true; + } + + public override bool WingUpdate(Player player, bool inUse) => true; + + public override void AdditionalFlightMovement(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) + { + if (player.TryingToHoverDown && player.controlJump && player.wingTime > 0f && !player.merman) + { + player.wingTime += 0.5f; + player.velocity.Y *= 0.8f; + if (player.velocity.Y > -2f && player.velocity.Y < 1f) + player.velocity.Y = 1E-05f; + + ascentWhenFalling *= 0f; + ascentWhenRising *= 0f; + constantAscend *= 0f; + } + if (player.TryingToHoverUp) + { + ascentWhenFalling *= BoostPower; + ascentWhenRising *= BoostPower; + maxCanAscendMultiplier /= 1.5f; + maxAscentMultiplier /= 1.5f; + constantAscend *= BoostPower; + player.wingTime -= 1; + } + } + } + + public class TiredTailPlayer : ModPlayer + { + public bool tiredTailDraw = false; + public List<(Vector2 pos, float rot)> tailPos; + public override void ResetEffects() + { + tiredTailDraw = false; + } + public override void PostUpdate() + { + if (tiredTailDraw) + { + if (tailPos == null) + { + tailPos = new(); + for (var i = 0; i < 3; i++) + { + + tailPos.Add(new(Player.Center, 0)); + } + } + for (var i = 0; i < tailPos.Count; i++) + { + Vector2 nextCent = Vector2.Zero; + float nextRot = 0; + if (i == 0) + { + nextCent = Player.Center + new Vector2(0, 6); + nextRot = new Vector2(Player.direction, -0.325f).ToRotation(); + } + else + { + nextCent = tailPos[i - 1].Item1; + nextRot = tailPos[i - 1].Item2; + } + + Vector2 destinationOffset = nextCent - tailPos[i].Item1; + if (nextRot != tailPos[i].Item2) + { + float angle = MathHelper.WrapAngle(nextRot - tailPos[i].Item2); + destinationOffset = destinationOffset.RotatedBy(angle * 0.1f); + } + var rotation = destinationOffset.ToRotation(); + + var center = nextCent - destinationOffset.SafeNormalize(Vector2.Zero) * (12 * 1); + if (i == tailPos.Count - 1) + { + center = nextCent - destinationOffset.SafeNormalize(Vector2.Zero) * (22 * 1); + } + tailPos[i] = new(center, rotation); + } + } + else + { + tailPos = null; + } + } + } + public class TailDraw : PlayerDrawLayer + { + List ColorPallettes = new(); + public override void SetStaticDefaults() + { + Main.QueueMainThreadAction(() => + { + //Load palettes automatically + var texture = ModContent.Request("CalamityMod/Items/Accessories/Wings/TiredTailPallette",ReLogic.Content.AssetRequestMode.ImmediateLoad).Value; + var BaseArray = new Color[texture.Width * texture.Height]; + texture.GetData(BaseArray); + List pal = new(); + for (var i = 0; i < BaseArray.Length; i++) + { + if (i % texture.Width == 0) + { + if (pal.Count > 0) + ColorPallettes.Add(pal.ToArray()); + pal = new(); + } + pal.Add(BaseArray[i].ToVector4()); + } + ColorPallettes.Add(pal.ToArray()); + ArmorPallettes = + [ + //silva + ([ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[2]), + //god slayer + ([ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[3]), + //hydro + ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[4]), + //auric + ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[5]), + //fearmonger + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[6]), + //Bloodlfare + ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[7]), + //Tarragon + ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[8]), + //Omega Blue + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[9]), + //Gem Tech + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[10]), + //Demonshade + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[11]), + //Prismatic + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[12]), + //Empyrean + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[13]), + //Solar + ([ItemID.SolarFlareHelmet], + [ItemID.SolarFlareBreastplate], + [ItemID.SolarFlareLeggings], + ColorPallettes[14]), + //Vortex + ([ItemID.VortexHelmet], + [ItemID.VortexBreastplate], + [ItemID.VortexLeggings], + ColorPallettes[15]), + //Nebula + ([ItemID.NebulaHelmet], + [ItemID.NebulaBreastplate], + [ItemID.NebulaLeggings], + ColorPallettes[16]), + //Stardust + ([ItemID.StardustHelmet], + [ItemID.StardustBreastplate], + [ItemID.StardustLeggings], + ColorPallettes[17]), + ]; + }); + + } + + List<(List heads, List bodies, List legs, Vector4[] pallette)> ArmorPallettes = []; + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) => true; + + public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Wings); + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + ArmorPallettes = + [ + //silva + ([ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[2]), + //god slayer + ([ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[3]), + //hydro + ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[4]), + //auric + ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[5]), + //fearmonger + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[6]), + //Bloodlfare + ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[7]), + //Tarragon + ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[8]), + //Omega Blue + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[9]), + //Gem Tech + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[10]), + //Demonshade + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[11]), + //Prismatic + ([ItemType()], + [ItemType()], + [ItemType()], + ColorPallettes[12]) + ]; + var player = drawInfo.drawPlayer; + var modplayer = drawInfo.drawPlayer.GetModPlayer(); + var tex1 = Request("CalamityMod/Items/Accessories/Wings/TiredTailSegment").Value; + var tex2 = Request("CalamityMod/Items/Accessories/Wings/TiredTailTail").Value; + if (modplayer.tailPos != null) + { + var TargetPallette = ColorPallettes[1]; + foreach (var item in ArmorPallettes) + { + if ((item.heads.Count == 0 || item.heads.Any(x => ContentSamples.ItemsByType[x].headSlot == player.head)) + && (item.bodies.Count == 0 || item.bodies.Any(x => ContentSamples.ItemsByType[x].bodySlot == player.body)) + && (item.legs.Count == 0 || item.legs.Any(x => ContentSamples.ItemsByType[x].legSlot == player.legs))) + { + TargetPallette = item.pallette; + break; + } + } + using var SegmentLease = RenderTargetPool.Shared.Rent(Main.instance.GraphicsDevice, tex1.Width, tex1.Height); + using var TailLease = RenderTargetPool.Shared.Rent(Main.instance.GraphicsDevice, tex2.Width, tex2.Height); + using (Main.spriteBatch.Scope()) + { + using (SegmentLease.Scope(clearColor: Color.Transparent)) + { + var shaderSnap = new SpriteBatchSnapshot(); + shaderSnap.SortMode = SpriteSortMode.Immediate; + shaderSnap.SamplerState = SamplerState.PointClamp; + shaderSnap.TransformMatrix = Matrix.identity; + Main.spriteBatch.Begin(shaderSnap); + + MiscShaderData paletteSwap = GameShaders.Misc["CalamityMod:PaletteSwap"]; + paletteSwap.Shader.Parameters["sourcePalette"].SetValue(ColorPallettes[0]); + paletteSwap.Shader.Parameters["paletteSize"].SetValue(ColorPallettes[0].Length); + paletteSwap.Shader.Parameters["targetPalette"].SetValue(TargetPallette); + paletteSwap.Shader.Parameters["matchThreshold"].SetValue(0.0001f); + paletteSwap.Apply(); + Main.spriteBatch.Draw(tex1, Vector2.Zero, Color.White); + Main.spriteBatch.End(); + } + using (TailLease.Scope(clearColor: Color.Transparent)) + { + var shaderSnap = new SpriteBatchSnapshot(); + shaderSnap.SortMode = SpriteSortMode.Immediate; + shaderSnap.SamplerState = SamplerState.PointClamp; + shaderSnap.TransformMatrix = Matrix.identity; + Main.spriteBatch.Begin(shaderSnap); + + MiscShaderData paletteSwap = GameShaders.Misc["CalamityMod:PaletteSwap"]; + paletteSwap.Shader.Parameters["sourcePalette"].SetValue(ColorPallettes[0]); + paletteSwap.Shader.Parameters["paletteSize"].SetValue(ColorPallettes[0].Length); + paletteSwap.Shader.Parameters["targetPalette"].SetValue(TargetPallette); + paletteSwap.Shader.Parameters["matchThreshold"].SetValue(0.01f); + paletteSwap.Apply(); + Main.spriteBatch.Draw(tex2, Vector2.Zero, Color.White); + Main.spriteBatch.End(); + } + } + var calamityPlayer = drawInfo.drawPlayer.Calamity(); + //Copied from the rogue steallth visuals + // TODO -- rogue stealth visuals are an utter catastrophe and should be fully destroyed on next stealth rework + float r = 1; + float g = 1; + float b = 1; + float a = 1; + if (calamityPlayer.rogueStealth > 0f && calamityPlayer.rogueStealthMax > 0f && drawInfo.drawPlayer.townNPCs < 3f && CalamityClientConfig.Instance.StealthInvisibility) + { + // A translucent orchid color, the rogue class color + float colorValue = calamityPlayer.rogueStealth / calamityPlayer.rogueStealthMax * 0.9f; //0 to 0.9 + r = 1f - (colorValue * 0.89f); //255 to 50 + g = 1f - colorValue; //255 to 25 + b = 1f - (colorValue * 0.89f); //255 to 50 + a = 1f - colorValue; //255 to 25 + } + + for (var i = modplayer.tailPos.Count - 1; i >= 0; i--) + { + var color2 = Lighting.GetColor(modplayer.tailPos[i].pos.ToTileCoordinates()); + var color = new Color((int)(color2.R * r), (int)(color2.G * g), (int)(color2.B * b), (int)(color2.A * a)); + if (i == modplayer.tailPos.Count - 1) + { + drawInfo.DrawDataCache.Add(new(TailLease.Target, modplayer.tailPos[i].pos - Main.screenPosition, null, color, modplayer.tailPos[i].rot + (float)Math.PI, tex2.Size() / 2f, 1f, SpriteEffects.None, 0)); + } + else + { + drawInfo.DrawDataCache.Add(new(SegmentLease.Target, modplayer.tailPos[i].pos - Main.screenPosition, null, color, modplayer.tailPos[i].rot + (float)Math.PI, tex1.Size() / 2f, 1f, SpriteEffects.None, 0)); + } + } + } + + } + } +} diff --git a/Items/Accessories/Wings/TiredTail.png b/Items/Accessories/Wings/TiredTail.png new file mode 100644 index 0000000000000000000000000000000000000000..2f0bacd764022998fa394efd25f851832554984c GIT binary patch literal 557 zcmeAS@N?(olHy`uVBq!ia0vp^3P3Ez!3-p)wda)qDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheDgizruJSUDn_pf}-hRi`IzF=Vcv;@`)icl77>B)Fw&qUSteD_Zpu&`G zIr2b?rzFTP_&)+L2;Dz-4k*r9;1OBOz`(a3gc&VZgH?cn5+$w?CBgY=CFO}lsSE*$ znRz98ey$-3rh0~YmN|L1?0{;vrABzBd3tIwZ~!^13{s4&42(dQ7Z6KB*&ttOFfxP1 znSg9VMkWRUARPt7ne8lK@hl)41eTRCGQ0qK9!8^C$^ev_z|Oz|RB2#jY{0kxVk*c+ z)&&rgrU2O>zyvgx39K^6(gMhW>M}Gi0LiklO*yqQuqqqKoZ{)?7@`q8by6VT5d{vH zz?IBZ|9|JPWtsmDzU#R{ch3m{En}61HUF>9y~Cii^orMl)_<%~!F!$7uKj#FkKf>? zwetMytQ(#h)pE_4Dfn`3s$i7gZFPrfXYX8A3Rs=hc0%&P?%mb5Qn;`7EI+Ev@F8m2 z3PT}Jg=2S^ikX(C2udh6aMzS=Wc_h);S8q?-B&U<{uSjPV9#DBxOcZtU_HpKp00i_ I>zopr0DNDd%m4rY literal 0 HcmV?d00001 diff --git a/Items/Accessories/Wings/TiredTailPallette.png b/Items/Accessories/Wings/TiredTailPallette.png new file mode 100644 index 0000000000000000000000000000000000000000..9951e8cd5af02487ada4b84538e1b805f6e80fff GIT binary patch literal 1005 zcmeAS@N?(olHy`uVBq!ia0vp^JU}eM!2~4DCV9I7DaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheoCO|{#S9F5`$3q|f;CtLC@4|l8c`CQpH@ne8c>S(n@eucd&K5+Uf zH6Idh^*TFiiQn|3;PSl_?)`rF`O#zHk535BhrF>?Zzw{QE)1_D`NCwloy2*^^?t{m03G0B5ah zF4MBi3Tb4NlruCWU#2}ns^Gu&Qhefxx@N&T5sseI8DAG5=*?)bWyFLd4( z+d2K}=hLr<-Fc zem`*Yv$=X^XB5M%Q$Lm&{d@Yf>5H+)`IwJYegb=o*6Ezyv}TvdRPEC)>wCTxEo1t2 Zz`o}Cm4%@~zczu=tf#A=%Q~loCIBE~g-`$h literal 0 HcmV?d00001 diff --git a/Items/Accessories/Wings/TiredTailSegment.png b/Items/Accessories/Wings/TiredTailSegment.png new file mode 100644 index 0000000000000000000000000000000000000000..786afd620d79b29b5841a45776ae8dd69428f3bd GIT binary patch literal 520 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!3-q-mAvr-QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`)dPG&T+#Br15j!LI|B<)rGb&L0pkLQsURC!7eGv! z0%U^#6VO~Hu*x7y3m^-s%h138B&#F(+IV6x`$-@(+tbA{L?gKLf+Lr+AqPu?KmJ`)>DrI9YL7+-L@;;-YmLe?d<0 MboFyt=akR{0Kq$mQUCw| literal 0 HcmV?d00001 diff --git a/Items/Accessories/Wings/TiredTailTail.png b/Items/Accessories/Wings/TiredTailTail.png new file mode 100644 index 0000000000000000000000000000000000000000..f1f10c2e9a1c1f6d20e9f8df31b8fd39605eeba3 GIT binary patch literal 564 zcmeAS@N?(olHy`uVBq!ia0vp^3P3Ez!3-p)wda)qDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(ehe>H$6>u4xPm{}~w0FfbS!8_#55m^pLinKNf3B_+YaKmp^lG@ufOOAq8W z11a8;Aiv=MNPxlig;E<(g0sLQvY3H^Z$Ah#TCfJI00kvVTq8kOkFcXkY-6)e(JdJTaL4B#=4X)5S4FBY5hh+k8h9I9xsk zxn2DK|K3@Lw`uXKtU0%~3QIbr?m8m+e*dn?(he$1=WvQ#-|wKgHEvzdwV%1$*=K~L z9{IeBVOz{H|Hf-k%8O2I;?Qk>E8Ot(UbQ)Qx5K%uZXI(NSEZ#TPS(xpt%%yg#IQcK zQ%ZRPL(Lgo1N8|(B8?B3b{t3-k8Y5c>C)VBZPB^LxBB1NY8amU6}r0QN7D(Ab3I-C KT-G@yGywporJctB literal 0 HcmV?d00001 diff --git a/Items/Accessories/Wings/TiredTail_Wings.png b/Items/Accessories/Wings/TiredTail_Wings.png new file mode 100644 index 0000000000000000000000000000000000000000..08ddcaa27ae16f1906d6523bab897357e380ccc2 GIT binary patch literal 165 zcmeAS@N?(olHy`uVBq!ia0vp^VL<$YgAGWQIS6I~sVq+y$B>FSZx0$W0(plPeD%-e i Date: Tue, 7 Apr 2026 20:59:09 -0500 Subject: [PATCH 03/56] Custom Rarity --- ChatTags/CustomColorEffectHandler.cs | 3 + Items/Accessories/Wings/TiredTail.cs | 105 ++++++++++++++++++++++++++- Rarities/ColorTool.cs | 6 ++ Rarities/HotPink.cs | 71 +++++++++++++++--- 4 files changed, 171 insertions(+), 14 deletions(-) diff --git a/ChatTags/CustomColorEffectHandler.cs b/ChatTags/CustomColorEffectHandler.cs index b99db87773..03cda39a56 100644 --- a/ChatTags/CustomColorEffectHandler.cs +++ b/ChatTags/CustomColorEffectHandler.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Items.Accessories.Wings; using CalamityMod.NPCs.DevourerofGods; using CalamityMod.Rarities; using CalamityMod.Utilities.Daybreak; @@ -35,6 +36,8 @@ namespace CalamityMod.ChatTags return new CalamityRed.CustomTextSnippet(text); if (options.Equals("exo", StringComparison.OrdinalIgnoreCase)) return new ExoticRainbow.CustomTextSnippet(text); + if (options.Equals("doze", StringComparison.OrdinalIgnoreCase)) + return new TiredTailTextEffects(text); return new TextSnippet(text); } } diff --git a/Items/Accessories/Wings/TiredTail.cs b/Items/Accessories/Wings/TiredTail.cs index b0cb5af6c7..fe31ed2a38 100644 --- a/Items/Accessories/Wings/TiredTail.cs +++ b/Items/Accessories/Wings/TiredTail.cs @@ -19,11 +19,14 @@ using CalamityMod.Utilities.Daybreak; using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Graphics; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; +using Terraria.UI.Chat; using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Accessories.Wings @@ -55,7 +58,7 @@ namespace CalamityMod.Items.Accessories.Wings Item.width = 22; Item.height = 20; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.Calamity().devItem = true; } @@ -112,6 +115,18 @@ namespace CalamityMod.Items.Accessories.Wings public List<(Vector2 pos, float rot)> tailPos; public override void ResetEffects() { + //Handled here to prevent issues with instancing of chat tags + if (TiredTailTextEffects.displayTimer > 0) + { + TiredTailTextEffects.expansionFactor += 0.033f; + + TiredTailTextEffects.displayTimer -= 1; + } + else + { + TiredTailTextEffects.expansionFactor = 0f; + } + tiredTailDraw = false; } public override void PostUpdate() @@ -172,7 +187,7 @@ namespace CalamityMod.Items.Accessories.Wings Main.QueueMainThreadAction(() => { //Load palettes automatically - var texture = ModContent.Request("CalamityMod/Items/Accessories/Wings/TiredTailPallette",ReLogic.Content.AssetRequestMode.ImmediateLoad).Value; + var texture = ModContent.Request("CalamityMod/Items/Accessories/Wings/TiredTailPallette", ReLogic.Content.AssetRequestMode.ImmediateLoad).Value; var BaseArray = new Color[texture.Width * texture.Height]; texture.GetData(BaseArray); List pal = new(); @@ -271,7 +286,7 @@ namespace CalamityMod.Items.Accessories.Wings ColorPallettes[17]), ]; }); - + } List<(List heads, List bodies, List legs, Vector4[] pallette)> ArmorPallettes = []; @@ -429,4 +444,88 @@ namespace CalamityMod.Items.Accessories.Wings } } + + public sealed class TiredTailTextEffects(string text) : TextSnippet + { + //Handled by TiredTailPlayer as this effect is for TiredTail + public static float expansionFactor = 0; + public static int displayTimer = 0; + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + //size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (color == default || color == Main.MouseTextColorReal) + { + color = Colors.AlphaDarken(HotPink.TextColor); + } + var textarray = text.ToArray(); + for (var i = 0; i < textarray.Length; i++) + { + if (expansionFactor - 10 > i) + { + textarray[i] = (i == 0 ? 'ɔ' : '»'); + } + } + var textToDraw = new string(textarray); + + size = FontAssets.MouseText.Value.MeasureString(textToDraw)*scale; + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var pos = position; + using var lease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); + string txt = ""; + var matrix = spriteBatch.transformMatrix; + using (spriteBatch.Scope()) + { + using (lease.Scope(clearColor: Color.Transparent)) + { + var max = FontAssets.MouseText.Value.MeasureString(text) * Math.Min(1f,expansionFactor); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); + + foreach (var item in textarray) + {//new(92,83,117) + pos = position; + pos.X += Math.Min(FontAssets.MouseText.Value.MeasureString(txt).X,max.X+9999); + float sin = (MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -1.5f) + 1) * 0.5f; + float sin2 = (MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -0.9f) + 1) * 0.5f; + float sin3 = MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -1.5f + MathHelper.PiOver2); + var c = new Color(171, 153, 204); + if (txt.Length == 0 || txt.Length == text.Length-1) + c = Color.Cyan; + else if (txt.Length % 4 == 3) + { + c = Color.HotPink; + } + c = Color.Lerp(Colors.AlphaDarken(new Color(0, 255, 200)), c, MathHelper.Clamp(expansionFactor - 2, 0, 1)); + float posMult = Math.Max(MathHelper.Clamp((expansionFactor - 10) * 0.5f, 0, 3), MathHelper.Clamp((expansionFactor - 2) * 0.5f, 0, 1)); + var origin = FontAssets.MouseText.Value.MeasureString(item.ToString()) * 0.5f; + ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, item.ToString(), origin + pos + new Vector2(0, item == 'ɔ' ? -1 : 0) + new Vector2((-2f + 4*sin2) * posMult, (-2 + sin * 4) * posMult), c, sin3*posMult * 0.1f, origin, new Vector2(scale)); + txt += item; + } + spriteBatch.End(); + } + + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + foreach (var item in ChatManager.ShadowDirections) + { + spriteBatch.Draw(lease.Target, Vector2.Zero + Vector2.TransformNormal(item * 2, matrix), null, Color.Black, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.End(); + } + } + return true; + } + + public override void Update() + { + displayTimer = 10; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } } diff --git a/Rarities/ColorTool.cs b/Rarities/ColorTool.cs index 45eb3a0820..4a5b029452 100644 --- a/Rarities/ColorTool.cs +++ b/Rarities/ColorTool.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Rarities public static int RarityBurnishedAuric => ModContent.GetInstance().Type; public static int RarityCalamityRed => ModContent.GetInstance().Type; public static int RarityExoticRainbow => ModContent.GetInstance().Type; + public static int RarityCustomDev => ModContent.GetInstance().Type; public override bool PreDrawTooltipLine(Item Item, DrawableTooltipLine line, ref int yOffset) @@ -37,6 +38,11 @@ namespace CalamityMod.Rarities ExoticRainbow.Draw(Item, line); return false; } + if (Item.rare == RarityCustomDev) + { + HotPink.Draw(Item, line); + return false; + } } return true; } diff --git a/Rarities/HotPink.cs b/Rarities/HotPink.cs index 38dfd4abf9..3e39b5ac17 100644 --- a/Rarities/HotPink.cs +++ b/Rarities/HotPink.cs @@ -1,21 +1,70 @@ -using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; +using CalamityMod.Items.Accessories.Wings; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; using Terraria.ModLoader; +using Terraria.UI.Chat; namespace CalamityMod.Rarities { public class HotPink : ModRarity { - // Hot Pink is Rarity 16 - public override Color RarityColor => new Color(255, 0, 255); + // Hot Pink is used for developer items. Has a system built in for custom rarity effects. + public override Color RarityColor => TextColor; + public static Color TextColor => new Color(255, 0, 255); - // Hot Pink cannot turn into other rarities via prefix - /*public override int GetPrefixedRarity(int offset, float valueMult) => offset switch + public static Dictionary> CustomRarities = new() { - -2 => ModContent.RarityType(), - -1 => ModContent.RarityType(), - 1 => ModContent.RarityType(), - 2 => ModContent.RarityType(), - _ => Type, - };*/ + { ModContent.ItemType(), text => new TiredTailTextEffects(text) } + }; + public static void Draw(Item Item, SpriteBatch spriteBatch, string text, int X, int Y, Color textColor, Color lightColor, float rotation, + Vector2 origin, Vector2 baseScale, float time, bool renderTextSparkles, DynamicSpriteFont font) + { + TextSnippet[] snippets = ChatManager.ParseMessage(text, textColor).ToArray(); + + + if (CustomRarities.ContainsKey(Item.type)) //For items in the custom rarity table, give them custom rarity effects. + { + for (int i = 0; i < snippets.Length; i++) + { + TextSnippet textSnippet = snippets[i]; + if (snippets[i].GetType() == typeof(TextSnippet)) + { + snippets[i] = CustomRarities[Item.type].Invoke(textSnippet.Text); + continue; + } + } + } + else + ChatManager.ConvertNormalSnippets(snippets); + + ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X, Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); + + } + + public static void Draw(Item Item, string text, int X, int Y, float rotation, Vector2 origin, Vector2 baseScale, Color? textColor = null, Color? lightColor = null, bool? renderTextSparkles = null) + { + Draw(Item, Main.spriteBatch, text, X, Y, Colors.AlphaDarken(textColor ?? TextColor), lightColor ?? Color.White, rotation, origin, baseScale, Main.GlobalTimeWrappedHourly, + renderTextSparkles ?? CalamityClientConfig.Instance.TextEffects, FontAssets.MouseText.Value); + } + + public static void Draw(Item Item, DrawableTooltipLine line) + { + Draw(Item, line.Text, line.X, line.Y, line.Rotation, line.Origin, line.BaseScale); + } + + #region Custom Draw Effects + + #region Doze's Effect + + #endregion + + #endregion + } } From f60a8359becab88969e824ca20641388736e7a83 Mon Sep 17 00:00:00 2001 From: sunny-raindrops Date: Fri, 26 Jun 2026 11:26:07 -0700 Subject: [PATCH 04/56] Lashes of Chaos --- Items/Weapons/Magic/LashesofChaos.cs | 12 +- ...Mods.CalamityMod.Items.Weapons.Magic.hjson | 2 +- .../Mods.CalamityMod.Projectiles.Magic.hjson | 3 + Projectiles/Magic/CalamitousDartFriendly.cs | 104 ++++++++++++++++++ .../Magic/CalamitousExplosionFriendly.cs | 94 ++++++++++++++++ .../Magic/CalamitousFireballFriendly.cs | 92 ++++++++++++++++ 6 files changed, 302 insertions(+), 5 deletions(-) create mode 100644 Projectiles/Magic/CalamitousDartFriendly.cs create mode 100644 Projectiles/Magic/CalamitousExplosionFriendly.cs create mode 100644 Projectiles/Magic/CalamitousFireballFriendly.cs diff --git a/Items/Weapons/Magic/LashesofChaos.cs b/Items/Weapons/Magic/LashesofChaos.cs index 1c05db456a..74a3367f25 100644 --- a/Items/Weapons/Magic/LashesofChaos.cs +++ b/Items/Weapons/Magic/LashesofChaos.cs @@ -1,11 +1,11 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; -using CalamityMod.Items.Weapons.Summon; using CalamityMod.Particles; using CalamityMod.Projectiles.Magic; using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic public int FiringMode = 0; // 0 = hellfireballs, 1 = hellblasts public int ProjectilesFired = 0; + public static readonly SoundStyle FireSound = new SoundStyle("CalamityMod/Sounds/Custom/CalamitasClone/CalClone_BigFireballBit", 4) with { Volume = 0.6f, MaxInstances = 4 }; public override void SetStaticDefaults() { CalamityItemSets.ExtraDebuffTooltip_Enemy[Type] = [ModContent.BuffType()]; @@ -32,13 +33,14 @@ namespace CalamityMod.Items.Weapons.Magic Item.mana = 28; Item.useAnimation = Item.useTime = 46; Item.useStyle = ItemUseStyleID.Shoot; + Item.UseSound = FireSound; Item.noMelee = true; Item.knockBack = 7.5f; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 14f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 22f; } // Shoots twice as fast (and uses half as much mana to compensate) during hellblasts @@ -52,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { ProjectilesFired++; - type = FiringMode == 1 ? ModContent.ProjectileType() : Item.shoot; + type = FiringMode == 1 ? ModContent.ProjectileType() : Item.shoot; Projectile.NewProjectile(source, position, velocity, type, damage, knockback, Main.myPlayer); // DUST @@ -86,11 +88,13 @@ namespace CalamityMod.Items.Weapons.Magic { FiringMode = 1; ProjectilesFired = 0; + SoundEngine.PlaySound(SoundID.Item100 with { Volume = 0.8f }, player.Center); } if (FiringMode == 1 && ProjectilesFired >= 10) { FiringMode = 0; ProjectilesFired = 0; + SoundEngine.PlaySound(SoundID.Item100 with { Volume = 0.8f }, player.Center); } return false; } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 4730855f11..388b1b5def 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -493,7 +493,7 @@ LashesofChaos: { DisplayName: Lashes of Chaos Tooltip: ''' - Alternates between exploding hellfireballs and piercing hellblasts + Alternates between exploding hellfire bursts and piercing brimstone darts 'Watch the world burn...' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson index 4a28d5a5dc..f49128fa42 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson @@ -292,3 +292,6 @@ FleshTotemMinion.DisplayName: Flesh Totem Minion FleshTotemSoul.DisplayName: Flesh Totem Soul SpectralFeather.DisplayName: Spectral Feather MoonSigil.DisplayName: Moon Sigil +CalamitousDartFriendly.DisplayName: Calamitous Dart Friendly +CalamitousExplosionFriendly.DisplayName: Calamitous Explosion Friendly +CalamitousFireballFriendly.DisplayName: Calamitous Fireball Friendly diff --git a/Projectiles/Magic/CalamitousDartFriendly.cs b/Projectiles/Magic/CalamitousDartFriendly.cs new file mode 100644 index 0000000000..df3c1d95d7 --- /dev/null +++ b/Projectiles/Magic/CalamitousDartFriendly.cs @@ -0,0 +1,104 @@ +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Graphics.Metaballs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class CalamitousDartFriendly : ModProjectile, ILocalizedModType + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public new string LocalizationCategory => "Projectiles.Magic"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 40; + Projectile.height = 40; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.tileCollide = false; + Projectile.penetrate = 3; + Projectile.timeLeft = 300; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 20; + } + + public override void AI() + { + if (Projectile.extraUpdates == 0) + { + Projectile.extraUpdates = 1; + Projectile.velocity *= 0.5f; + } + Projectile.frameCounter++; + if (Projectile.frameCounter >= 10) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 3) + Projectile.frame = 0; + + Lighting.AddLight(Projectile.Center, 0.9f * Projectile.Opacity, 0f, 0f); + + + if (Projectile.timeLeft < 51) + Projectile.Opacity -= 0.02f; + + if (Projectile.velocity.X < 0f) + { + Projectile.spriteDirection = -1; + Projectile.rotation = (float)Math.Atan2(-Projectile.velocity.Y, -Projectile.velocity.X); + } + else + { + Projectile.spriteDirection = 1; + Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X); + } + Projectile.rotation = Projectile.velocity.ToRotation(); + Projectile.spriteDirection = 1; + var dir = Projectile.rotation.ToRotationVector2(); + if (Projectile.spriteDirection == -1) + dir = dir.RotatedBy(MathHelper.Pi); + var spot = Vector2.Lerp(Projectile.Center + dir.RotatedBy(MathHelper.PiOver2) * 26, Projectile.Center + dir.RotatedBy(-MathHelper.PiOver2) * 26, Main.rand.NextFloat()); + for (var i = 0; i < 1; i++) + { + var p = CalamitasMetaball.SpawnParticle(Projectile.Center + Projectile.velocity * 2, Vector2.Zero, 40); + p.rotation = Projectile.rotation + MathHelper.PiOver2; + p.TextureToUse = ModContent.Request("CalamityMod/Particles/PointParticle").Value; + p.SizeScaling = 0.65f; + p = CalamitasMetaball.SpawnParticle(Projectile.Center, Main.rand.NextVector2Circular(3, 3), 24f); + p.SizeScaling = 0.8f; + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); + + public override bool PreDraw(ref Color lightColor) + { + return false; + } + + public override void OnKill(int timeLeft) + { + for (int dust = 0; dust <= 5; dust++) + { + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f); + } + } + } +} diff --git a/Projectiles/Magic/CalamitousExplosionFriendly.cs b/Projectiles/Magic/CalamitousExplosionFriendly.cs new file mode 100644 index 0000000000..1bee87c6ab --- /dev/null +++ b/Projectiles/Magic/CalamitousExplosionFriendly.cs @@ -0,0 +1,94 @@ +using System.IO; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Metaballs; +using CalamityMod.NPCs.CalClone; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class CalamitousExplosionFriendly : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Magic"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetDefaults() + { + Projectile.width = 130; + Projectile.height = 130; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = 120; + Projectile.DamageType = DamageClass.Magic; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 20; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(Projectile.localAI[0]); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + Projectile.localAI[0] = reader.ReadSingle(); + } + + public override void AI() + { + Lighting.AddLight(Projectile.Center, 0.75f, 0f, 0f); + if (Projectile.localAI[0] == 0f) + { + SoundEngine.PlaySound(CalamitasClone.CalamitousExplosionSound, Projectile.Center); + Projectile.localAI[0] += 1f; + } + bool xflag = false; + bool yflag = false; + if (Projectile.velocity.X < 0f && Projectile.position.X < Projectile.ai[0]) + { + xflag = true; + } + if (Projectile.velocity.X > 0f && Projectile.position.X > Projectile.ai[0]) + { + xflag = true; + } + if (Projectile.velocity.Y < 0f && Projectile.position.Y < Projectile.ai[1]) + { + yflag = true; + } + if (Projectile.velocity.Y > 0f && Projectile.position.Y > Projectile.ai[1]) + { + yflag = true; + } + if (xflag && yflag) + { + Projectile.Kill(); + } + float projTimer = 25f; + if (Projectile.ai[0] > 180f) + { + projTimer -= (Projectile.ai[0] - 180f) / 2f; + } + if (projTimer <= 0f) + { + projTimer = 0f; + Projectile.Kill(); + } + projTimer *= 0.7f; + Projectile.ai[0] += 4f; + var p = CalamitasMetaball.SpawnParticle(Projectile.Center, Main.rand.NextVector2CircularEdge(4, 4), 32f); + p.SizeScaling = 0.96f; + + p = CalamitasMetaball.SpawnParticle(Projectile.Center, Main.rand.NextVector2CircularEdge(3, 3), 40f); + p.SizeScaling = 0.96f; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); + } +} diff --git a/Projectiles/Magic/CalamitousFireballFriendly.cs b/Projectiles/Magic/CalamitousFireballFriendly.cs new file mode 100644 index 0000000000..736d4ab02e --- /dev/null +++ b/Projectiles/Magic/CalamitousFireballFriendly.cs @@ -0,0 +1,92 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Graphics.Metaballs; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Magic +{ + public class CalamitousFireballFriendly : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Magic"; + + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 48; + Projectile.height = 48; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.Magic; + Projectile.penetrate = 1; + Projectile.timeLeft = 300; + Projectile.alpha = 255; + } + + public override void AI() + { + // Animation + Projectile.frameCounter++; + if (Projectile.frameCounter > 9) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame >= 6) + Projectile.frame = 0; + + // Fade in + if (Projectile.alpha > 5) + Projectile.alpha -= 15; + if (Projectile.alpha < 5) + Projectile.alpha = 5; + + // Rotation + Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); + Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) - MathHelper.ToRadians(90f) * Projectile.direction; + + if (Projectile.velocity.Length() < 16f) + Projectile.velocity *= 1.01f; + + Lighting.AddLight(Projectile.Center, 0.5f, 0f, 0f); + + var brimDust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(32, 32), (int)CalamityDusts.Brimstone, null, 170, default, 1.1f); + brimDust.noGravity = true; + brimDust.velocity *= 0.5f; + brimDust.velocity += Projectile.velocity * 0.1f; + for (var i = 0; i < 1; i++) + { + CalamitasMetaball.SpawnParticle(Projectile.Center + Projectile.velocity, Main.rand.NextVector2Circular(2, 2), 64f); + } + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(250, 50, 50, Projectile.alpha); + } + + public override void OnKill(int timeLeft) + { + if (Projectile.owner == Main.myPlayer) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); + + public override bool PreDraw(ref Color lightColor) + { + return false; + } + } +} From 65a2e20503ae4ed32ea8e43de0ee9ef33a809058 Mon Sep 17 00:00:00 2001 From: sunny-raindrops Date: Fri, 26 Jun 2026 12:21:55 -0700 Subject: [PATCH 05/56] Havoc's Breath --- Items/Weapons/Ranged/HavocsBreath.cs | 6 +- Projectiles/Ranged/BrimstoneFireFriendly.cs | 67 ++++----------------- 2 files changed, 16 insertions(+), 57 deletions(-) diff --git a/Items/Weapons/Ranged/HavocsBreath.cs b/Items/Weapons/Ranged/HavocsBreath.cs index 9ca4a9a5a4..3b12791325 100644 --- a/Items/Weapons/Ranged/HavocsBreath.cs +++ b/Items/Weapons/Ranged/HavocsBreath.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; - Item.UseSound = SoundID.Item34; + Item.UseSound = SoundID.DD2_BetsyFireballShot; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.autoReuse = true; @@ -38,9 +38,9 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - for (int i = 0; i <= 2; i++) + for (int i = 0; i <= 3; i++) { - Projectile.NewProjectile(source, position + velocity * 4f, velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.9f, 1.25f), type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.9f, 1.25f), type, damage, knockback, player.whoAmI); } return false; } diff --git a/Projectiles/Ranged/BrimstoneFireFriendly.cs b/Projectiles/Ranged/BrimstoneFireFriendly.cs index d10e45801b..f669431f87 100644 --- a/Projectiles/Ranged/BrimstoneFireFriendly.cs +++ b/Projectiles/Ranged/BrimstoneFireFriendly.cs @@ -1,6 +1,7 @@ using System; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.Graphics.Metaballs; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -15,7 +16,7 @@ namespace CalamityMod.Projectiles.Ranged public override string Texture => "CalamityMod/Projectiles/FireProj"; public static int Lifetime => 60; - public static int Fadetime => 50; + public static int Fadetime => 100; public ref float Time => ref Projectile.ai[0]; public int MistType = -1; @@ -54,6 +55,14 @@ namespace CalamityMod.Projectiles.Ranged MistType = Main.rand.Next(3); Lighting.AddLight(Projectile.Center, 0.75f, 0.15f, 0.15f); + if (Projectile.timeLeft > Lifetime - 10) + return; + float timeRatio = Utils.GetLerpValue(0f, Lifetime, Time); + float fireSize = Utils.Remap(timeRatio, 0.2f, 0.5f, 0.25f, 1f); + var p = CataclysmMetaball.SpawnParticle(Projectile.Center, Vector2.Zero, Terraria.GameContent.TextureAssets.Projectile[Type].Width() * fireSize); + p.rotation = Main.rand.NextFloat(MathHelper.TwoPi); + p.TextureToUse = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + p.SizeScaling = 0.6f; } // Keeping the flames in place when hitting a block @@ -87,68 +96,18 @@ namespace CalamityMod.Projectiles.Ranged target.AddBuff(ModContent.BuffType(), 1200); // Gas up the enemy - int smokeCount = 3 + (int)MathHelper.Clamp(target.width * 0.1f, 0f, 20f); + int smokeCount = 4 + (int)MathHelper.Clamp(target.width * 0.1f, 0f, 20f); for (int i = 0; i < smokeCount; i++) { - bool Smoketype = Main.rand.NextBool(); Vector2 smokePos = target.Center + Main.rand.NextVector2Circular(target.width * 0.5f, target.height * 0.5f); - Vector2 smokeVel = Vector2.UnitY * (Smoketype ? Main.rand.NextFloat(-0.8f, -2f) : Main.rand.NextFloat(-1.2f, -0.2f)) * MathHelper.Clamp(target.height * 0.1f, 1f, 10f); - Particle smoke = new MediumMistParticle(smokePos, smokeVel, new Color(255, 50, 50), Color.DimGray, Smoketype ? Main.rand.NextFloat(0.4f, 0.75f) : Main.rand.NextFloat(1.5f, 2f), 220 - Main.rand.Next(50), 0.1f); + Vector2 smokeVel = Vector2.UnitY * Main.rand.NextFloat(-2.4f, -0.8f) * MathHelper.Clamp(target.height * 0.1f, 1f, 10f); + Particle smoke = new MediumMistParticle(smokePos, smokeVel, Color.MediumVioletRed, Color.Purple, Main.rand.NextFloat(1f, 2f), 245 - Main.rand.Next(50), 0.1f); GeneralParticleHandler.SpawnParticle(smoke); } } public override bool PreDraw(ref Color lightColor) { - Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Texture2D mist = ModContent.Request("CalamityMod/Particles/MediumMist").Value; - - // The conga line of colors to sift through - Color color1 = new Color(255, 110, 100, 200); - Color color2 = new Color(255, 50, 50, 70); - Color color3 = new Color(255, 100, 100, 100); - Color color4 = new Color(200, 35, 30, 100); - float length = ((Time > Fadetime - 10f) ? 0.1f : 0.15f); - float vOffset = Math.Min(Time, 20f); - float timeRatio = Utils.GetLerpValue(0f, Lifetime, Time); - float fireSize = Utils.Remap(timeRatio, 0.2f, 0.5f, 0.25f, 1f); - - if (timeRatio >= 1f) - return false; - - for (float j = 1f; j >= 0f; j -= length) - { - // Color - Color fireColor = ((timeRatio < 0.1f) ? Color.Lerp(Color.Transparent, color1, Utils.GetLerpValue(0f, 0.1f, timeRatio)) : - ((timeRatio < 0.2f) ? Color.Lerp(color1, color2, Utils.GetLerpValue(0.1f, 0.2f, timeRatio)) : - ((timeRatio < 0.35f) ? color2 : - ((timeRatio < 0.7f) ? Color.Lerp(color2, color3, Utils.GetLerpValue(0.35f, 0.7f, timeRatio)) : - ((timeRatio < 0.85f) ? Color.Lerp(color3, color4, Utils.GetLerpValue(0.7f, 0.85f, timeRatio)) : - Color.Lerp(color4, Color.Transparent, Utils.GetLerpValue(0.85f, 1f, timeRatio))))))); - fireColor *= (1f - j) * Utils.GetLerpValue(0f, 0.2f, timeRatio, true); - Color innerColor = Color.Lerp(fireColor, Color.Black, 0.3f); - - // Positions and rotations - Vector2 firePos = Projectile.Center - Main.screenPosition - Projectile.velocity * vOffset * j; - float mainRot = -j * MathHelper.PiOver2 - Main.GlobalTimeWrappedHourly * (j + 1f) * 2f / length; - float trailRot = MathHelper.PiOver4 - mainRot; - - // Draw one backtrail - Vector2 trailOffset = Projectile.velocity * vOffset * length * 0.5f; - Main.EntitySpriteDraw(fire, firePos - trailOffset, null, innerColor * 0.25f, trailRot, fire.Size() * 0.5f, fireSize, SpriteEffects.None); - - // Draw the main fire - Main.EntitySpriteDraw(fire, firePos, null, innerColor, mainRot, fire.Size() * 0.5f, fireSize, SpriteEffects.None); - - // Draw the masking smoke - if (MistType > 2 || MistType < 0) - return false; - Main.spriteBatch.SetBlendState(BlendState.Additive); - Rectangle frame = mist.Frame(1, 3, 0, MistType); - Main.EntitySpriteDraw(mist, firePos, frame, Color.Lerp(fireColor, Color.White, 0.3f), mainRot, frame.Size() * 0.5f, fireSize, SpriteEffects.None); - Main.EntitySpriteDraw(mist, firePos, frame, fireColor, mainRot, frame.Size() * 0.5f, fireSize * 3f, SpriteEffects.None); - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); - } return false; } } From 42a3f91b84ac72b2d70efbd6dbd52015dedd2916 Mon Sep 17 00:00:00 2001 From: sunny-raindrops Date: Fri, 26 Jun 2026 13:16:13 -0700 Subject: [PATCH 06/56] Entropy's Vigil --- .../Mods.CalamityMod.Projectiles.Summon.hjson | 2 +- Projectiles/Summon/BrimstoneLaserSummon.cs | 25 ++++++++++++------ Projectiles/Summon/BrimstoneLaserSummon.png | Bin 180 -> 0 bytes 3 files changed, 18 insertions(+), 9 deletions(-) delete mode 100644 Projectiles/Summon/BrimstoneLaserSummon.png diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson index 121827ff82..f4b7fda204 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -47,7 +47,7 @@ BrimstoneElementalMinion.DisplayName: Brimstone Elemental BrimstoneExplosionMinion.DisplayName: Explosion BrimstoneFireballMinion.DisplayName: Brimstone Fireball BrimstoneFireSummon.DisplayName: Brimstone Fire -BrimstoneLaserSummon.DisplayName: Brimstone Laser +BrimstoneLaserSummon.DisplayName: Vigil Mini Fireball BrittleStarMinion.DisplayName: Brittle Star CalamarisLamentMinion.DisplayName: Calamari CalamarisLamentProjectile.DisplayName: Calamari Ink diff --git a/Projectiles/Summon/BrimstoneLaserSummon.cs b/Projectiles/Summon/BrimstoneLaserSummon.cs index 69c063bd29..151eafd682 100644 --- a/Projectiles/Summon/BrimstoneLaserSummon.cs +++ b/Projectiles/Summon/BrimstoneLaserSummon.cs @@ -1,5 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; +using CalamityMod.Graphics.Metaballs; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -8,6 +8,7 @@ namespace CalamityMod.Projectiles.Summon public class BrimstoneLaserSummon : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetStaticDefaults() { @@ -17,8 +18,6 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { Projectile.width = Projectile.height = 10; - Projectile.aiStyle = ProjAIStyleID.Arrow; - AIType = ProjectileID.CursedBullet; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.alpha = 120; @@ -29,13 +28,23 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - Lighting.AddLight(Projectile.Center, Projectile.Opacity * 0.5f, Projectile.Opacity * 0.05f, Projectile.Opacity * 0.05f); - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + CalamityUtils.HomeInOnNPC(Projectile, false, 300, 5.5f, 10f, true); + + if (Projectile.Calamity().HomingTarget < 0) + { + Projectile.velocity.Y += 0.025f; + } + + CalamitasMetaball.SpawnParticle(Projectile.Center + Projectile.velocity, Main.rand.NextVector2Circular(2, 2), 16f); + + if (Projectile.velocity.Y > 16f) + { + Projectile.velocity.Y = 16f; + } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 300); - public override Color? GetAlpha(Color lightColor) => new Color(250, 50, 50, Projectile.alpha); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); } } diff --git a/Projectiles/Summon/BrimstoneLaserSummon.png b/Projectiles/Summon/BrimstoneLaserSummon.png deleted file mode 100644 index 9b0d2a4f50ed6094d184a05aab71934a6add2435..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^OhBx_!3HEPF0GUVQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XBj({-ZRBb+KprEIxi(`mJaPpsgxnJ`cIc7Mpa0GN8{4w9L zw`8*9dn1iW59g`#)Jr%>D1Msq(43h=*(J{SPbx!V%L!uz{uV){^Nnc@1|cntj6fmD VqunlUwm?G}JYD@<);T3K0RUYoGEo2k From 23dba8d379ff27e40919265eaa197d93c23dc8eb Mon Sep 17 00:00:00 2001 From: sunny-raindrops Date: Fri, 26 Jun 2026 13:41:29 -0700 Subject: [PATCH 07/56] deleted unused projectiles + slight havoc buff --- .../en-US/Mods.CalamityMod.NPCs.hjson | 2 +- .../Mods.CalamityMod.Projectiles.Magic.hjson | 2 - .../Magic/BrimstoneHellfireballFriendly.cs | 94 ------------------- .../Magic/HellfireExplosionFriendly.cs | 77 --------------- Projectiles/Ranged/BrimstoneFireFriendly.cs | 2 +- 5 files changed, 2 insertions(+), 175 deletions(-) delete mode 100644 Projectiles/Magic/BrimstoneHellfireballFriendly.cs delete mode 100644 Projectiles/Magic/HellfireExplosionFriendly.cs diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 9c0835999f..e21ebc6a6a 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -598,7 +598,7 @@ TownPiggy: { Techno: Techno JohnPork: John Pork Piglet: Piglet - Poogie: Poogie + Poogie: Poogie } Chat: { diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson index f49128fa42..c7ede7f1b5 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson @@ -43,7 +43,6 @@ BloodRay.DisplayName: Blood Ray BlueBubble.DisplayName: Bubble BlushieStaffProj.DisplayName: Staff of Blushie BrimroseBeam.DisplayName: Brimrose Beam -BrimstoneHellfireballFriendly.DisplayName: Hellfireball CauldronProj.DisplayName: Smauldron CauldronProjSmall.DisplayName: Smaullerdron ChronoIcicleLarge.DisplayName: Chrono Icicle @@ -96,7 +95,6 @@ HadalUrnLamprey.DisplayName: Sea Lamprey HadalUrnStarfish.DisplayName: Marianan Starfish HadalUrnStarfishShard.DisplayName: Starfish Shard HeliumFlashBlast.DisplayName: Helium Flash -HellfireExplosionFriendly.DisplayName: Explosion HellwingBat.DisplayName: Ashen Hellwing HolyFlame.DisplayName: Holy Flame HolyLaser.DisplayName: Holy Laser diff --git a/Projectiles/Magic/BrimstoneHellfireballFriendly.cs b/Projectiles/Magic/BrimstoneHellfireballFriendly.cs deleted file mode 100644 index d19ac4ede9..0000000000 --- a/Projectiles/Magic/BrimstoneHellfireballFriendly.cs +++ /dev/null @@ -1,94 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using CalamityMod.NPCs.BrimstoneElemental; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class BrimstoneHellfireballFriendly : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Magic"; - public override string Texture => "CalamityMod/Projectiles/Boss/BrimstoneHellfireball"; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 6; - ProjectileID.Sets.TrailCacheLength[Type] = 3; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 12; - Projectile.height = 12; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.timeLeft = 300; - Projectile.penetrate = 1; - Projectile.MaxUpdates = 2; - Projectile.DamageType = DamageClass.Magic; - } - - public override void AI() - { - //Animation - Projectile.frameCounter++; - if (Projectile.frameCounter > 9) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame >= 6) - { - Projectile.frame = 0; - } - - //Fade in - if (Projectile.alpha > 5) - Projectile.alpha -= 15; - if (Projectile.alpha < 5) - Projectile.alpha = 5; - - //Rotation - Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); - Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) - MathHelper.ToRadians(90) * Projectile.direction; - - int brimDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 170, default, 1.1f); - Main.dust[brimDust].noGravity = true; - Main.dust[brimDust].velocity *= 0.5f; - Main.dust[brimDust].velocity += Projectile.velocity * 0.1f; - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.05f / 255f, (255 - Projectile.alpha) * 0.05f / 255f); - - if (Projectile.localAI[0] == 0f) - { - SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound, Projectile.Center); - Projectile.localAI[0] += 1f; - } - - // Speed up as time goes on - Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * (Projectile.velocity.Length() + 0.25f); - } - - public override void OnKill(int timeLeft) - { - if (Projectile.owner == Main.myPlayer) - { - int fire = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.66f), Projectile.knockBack, Projectile.owner); - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 240); - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - } - } -} diff --git a/Projectiles/Magic/HellfireExplosionFriendly.cs b/Projectiles/Magic/HellfireExplosionFriendly.cs deleted file mode 100644 index 7b73558e5a..0000000000 --- a/Projectiles/Magic/HellfireExplosionFriendly.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class HellfireExplosionFriendly : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Magic"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 130; - Projectile.height = 130; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.penetrate = -1; - Projectile.timeLeft = 120; - Projectile.DamageType = DamageClass.Magic; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 20; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, 0.9f, 0f, 0f); - if (Projectile.localAI[0] == 0f) - { - SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); - Projectile.localAI[0] += 1f; - } - float projTimer = 25f; - if (Projectile.ai[0] > 180f) - { - projTimer -= (Projectile.ai[0] - 180f) / 2f; - } - if (projTimer <= 0f) - { - projTimer = 0f; - Projectile.Kill(); - } - projTimer *= 0.7f; - Projectile.ai[0] += 4f; - int timerCounter = 0; - while ((float)timerCounter < projTimer) - { - float rando1 = (float)Main.rand.Next(-10, 11); - float rando2 = (float)Main.rand.Next(-10, 11); - float rando3 = (float)Main.rand.Next(3, 9); - float randoAdjuster = (float)Math.Sqrt((double)(rando1 * rando1 + rando2 * rando2)); - randoAdjuster = rando3 / randoAdjuster; - rando1 *= randoAdjuster; - rando2 *= randoAdjuster; - int brimDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1.5f); - Dust dust = Main.dust[brimDust]; - dust.noGravity = true; - dust.position.X = Projectile.Center.X; - dust.position.Y = Projectile.Center.Y; - dust.position.X += (float)Main.rand.Next(-10, 11); - dust.position.Y += (float)Main.rand.Next(-10, 11); - dust.velocity.X = rando1; - dust.velocity.Y = rando2; - timerCounter++; - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 240); - } - } -} diff --git a/Projectiles/Ranged/BrimstoneFireFriendly.cs b/Projectiles/Ranged/BrimstoneFireFriendly.cs index f669431f87..41f1f48bed 100644 --- a/Projectiles/Ranged/BrimstoneFireFriendly.cs +++ b/Projectiles/Ranged/BrimstoneFireFriendly.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.timeLeft = Lifetime; Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 6; + Projectile.idStaticNPCHitCooldown = 5; } public override void AI() From f580e205d898fccb5617933cdacdcd866479748f Mon Sep 17 00:00:00 2001 From: sunny-raindrops Date: Sat, 27 Jun 2026 22:25:35 -0700 Subject: [PATCH 08/56] Oblivion Rework --- CalPlayer/CalamityPlayer.cs | 1 + CalPlayer/CalamityPlayerMiscEffects.cs | 2 + Cooldowns/OblivionCooldown.cs | 17 + Cooldowns/OblivionCooldownOutline.png | Bin 0 -> 2880 bytes Items/Weapons/Melee/Oblivion.cs | 17 +- ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 9 +- .../Mods.CalamityMod.Projectiles.Melee.hjson | 2 + Localization/en-US/Mods.CalamityMod.UI.hjson | 1 + Projectiles/Melee/OblivionBolt.cs | 97 +++++ Projectiles/Melee/OblivionFire.cs | 43 +++ Projectiles/Melee/Yoyos/OblivionYoyo.cs | 342 +++++++++++++++++- 11 files changed, 520 insertions(+), 11 deletions(-) create mode 100644 Cooldowns/OblivionCooldown.cs create mode 100644 Cooldowns/OblivionCooldownOutline.png create mode 100644 Projectiles/Melee/OblivionBolt.cs create mode 100644 Projectiles/Melee/OblivionFire.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index da94a934fc..ebff8b8943 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -327,6 +327,7 @@ namespace CalamityMod.CalPlayer public int arsenalCooldown = 0; public int killModeCooldown = 0; public bool demonSwordKillMode = false; + public int oblivionCooldown = 0; public bool exaltedKillMode => (demonSwordKillMode && Player.HeldItem.type == ItemType()); public bool devilsDevastationKillMode => (demonSwordKillMode && Player.HeldItem.type == ItemType()); /// diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index cb171220f8..74c79f631b 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2333,6 +2333,8 @@ namespace CalamityMod.CalPlayer arsenalCooldown--; if (killModeCooldown > 0) killModeCooldown--; + if (oblivionCooldown > 0) + oblivionCooldown--; if (ascendantInsigniaCooldown > 0 && ascendantInsigniaBuffTime <= 0) ascendantInsigniaCooldown--; if (transformerCooldown > 0) diff --git a/Cooldowns/OblivionCooldown.cs b/Cooldowns/OblivionCooldown.cs new file mode 100644 index 0000000000..2e87ddcbb4 --- /dev/null +++ b/Cooldowns/OblivionCooldown.cs @@ -0,0 +1,17 @@ +using Microsoft.Xna.Framework; +using Terraria.Localization; + +namespace CalamityMod.Cooldowns +{ + public class OblivionCooldown : CooldownHandler + { + public static new string ID => "OblivionCooldown"; + public override bool ShouldDisplay => true; + public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); + public override string Texture => "CalamityMod/Projectiles/Melee/Yoyos/OblivionYoyo"; + public override string OutlineTexture => "CalamityMod/Cooldowns/OblivionCooldownOutline"; + public override Color OutlineColor => Color.MediumVioletRed; + public override Color CooldownStartColor => Color.DarkRed; + public override Color CooldownEndColor => Color.Red; + } +} diff --git a/Cooldowns/OblivionCooldownOutline.png b/Cooldowns/OblivionCooldownOutline.png new file mode 100644 index 0000000000000000000000000000000000000000..edc4369894eed21829240b9e2a4fe4f24cd40851 GIT binary patch literal 2880 zcmV-G3%~Sf6 zXi@@54ZTQ_E-Enz5K6$103tR-RB%L5k){YTDBysjLy@r}iiH7DvFijGMAUI`6dRUF zWUU$Bym{}eS9UO(Z2>7`&z9wUXbV-Il#&6`Y8GKGQ04S2&F6MJnWNa;Ck|;8QE#r9r;7G||@X{|> z%+C|c55>;RS}qbKr-&IQTvLXPlM{>K&(BTgi^a?^4mXV>;xX8n8Ce|RasXz}{8imI52H3ZN4bfe_i~WlJ|C&UW9+{8AKoW!}eExnGFE2re(F+`iE_46#!l9 z0Z_aBhs|Iw0E)7{bq;-T9=d#9QpDmcXDh4R++0fmpKB>E=%LdZt9g$j;($`3&Zthxi`{{&gM}5&R^+h%b~yM9Zd3AWW9ETgVfL z1(`yIK=_}U_z%PWq}jQaiQ4!P(3V&Nr6C$XejWfQDiI(Fdt@un?|lo#M+5oIi_w{w zo%_#%{(V=tO#a9gB!7-$M?^BX5>d|Vn*3S!?g~$*UQipUPL&zMmg;!4Do9IA%up=Rh? z=qPj=x&RGBx1dpI68aT-2O}^EromdU5o`ssU{5#*j)WJ%$?!5bA1;Eoz?EiTr=n?cd`V|I)p<|3Oju?MT93~aB0<#&j8`F+Cg&D?-VWzQItUA^l>xvD zRIYI4MQ`g1<+DyrL=EogS06Xii({| zv`U^zjmmKqDIK93(F5q|^fLNk`gQs{RV`IdRle#b)i%{Ds;|}NsClUI)k@Ub)kf6b zsWa4l)YH_rsduU0(?DsMX@qO!YV6TCtMPOWZH~(v?wpc2hv(eZgf-1HBQ#fN?$aF5 zoYvCT^3%%Fs?s{6^;Da#?V+8jy+iwi_M{F~$4y6|vqR^k&SQoO!;_KDsATjprgSxR z{dFa}^}2()GkV5)QF?`X?Rxk03HmJkB>f%wz4}uIItC#I1qQ7Kw+-=zEW;GTU55RJ zuZ@h2VvIHzbs0S}Rx=JT&Npr~zH34@aW`3J(qMAU6l2OVO*7qXdf5y%vo}jIt1%lg zhs_<#1?IcWhb_<+P8LFo28$a^64R5J!)#@aTGB0pEekEXET35!SjAgyv+B3{Xl-wu zZrx~o$A)4PXj5p@WAm%6nJw40#`fA=@?77!tLJvleQsxN$G6*KchjC~A7a13zSsVP zgQJ7Uq0M2^(ZDg$vDWbhi^d9LZDyT!LOXdmt#&%*^w!zIS?qk+`4<X~g?%56 z2@eae34a)26HyS+zks@6$%2*zuOhu7%OdYYnM6sVdZQJi6QY}=U&naIl*dS8tzuWk zUW(I*6U24LW8oFzvR(TOpM zEs5_rp_~TJ^wNN(wM(bCZ0;`Z6P^ce2XB(^$}i_nB)KM)Cp}7bP2Qe7nc|*Ok@8f) z7E}wKr~0SXrM^xJP1~RLDLp2=Jp-4Km~m7{5vB?IGPN`FGKaIwvx>8%%bb_(Ts9>N z5;bK**^9Ef#WdN^)PTf9vR*Qp{o-l7 zTcBI8wqSIn=gRt3(5j`YdRObOE?Pal#&6AmwS={4Ykw%TE-Wv6xh`g1Pmxy9nxe7w ze(PI{6^cd0H#WFzsN0CzDA+i-Y3`<~O&?2mB^OJrODjs>Z{}{k_?699m0x|@lC)*8 z%%N=0R?Jr6*6Z8cw;d=~F3&F?+a9vLa|dHb$&Qyhm+ZVyVOLSNi?B>BD~Ee(8aT1AWbo&CM;EEoH56tE6@EV8X%6-*|u1-NtOIZ>P7H z9s-9XhaP{M`0e$>L5F*fu#U8SXZT%h2eqT56Y5;vIn|ZYCGC#u9zGg)w718lr{jCe z@An_mJyvsE<#^c%!il02pHAkVoIaIx>gnm^(__6$dheWxJ#(!uyl?Pq(Ao3ne9xWf z_v}A;-u3*k3(gmgUSwVDy5w-FbHIL};|Kd6ItCpEJBJ*Hx-UCj?irppeBz4xmD5+f zub#UWaP88_{E^}7QP*$YNVp-r$-DXJR{E{yw{vdK+*xxMeYfPE(!GlNn)e%iH2tw% z>L5Kn>ODH}V8MesW8ASPKV|>)e!S=*`C-L`&P4Mg+egPHeJ3wJUif(YN!F8@r^P=j z|6Kdbc>FRj6+1QlT=e|YubW?}zu5oM?q%0Dy!50Qvv` z0D$NK0Cg|`0P0`>06Lfe02gqax=}m;000SaNLh0L01FZT01FZU(%pXi0000RbVXQn zQ*UN;cVTj607GSLb9r+hQ*?D?X>TA@Z*OeDr{R16002x$L_t(Ijbr@(|33o`fKvhr z7_kb{!$6n-Rt<#I(bPa<4Z>?MO$;R0Agl(D8aQeonFgW=kYOt4nH literal 0 HcmV?d00001 diff --git a/Items/Weapons/Melee/Oblivion.cs b/Items/Weapons/Melee/Oblivion.cs index 178a6e626d..ca79b991de 100644 --- a/Items/Weapons/Melee/Oblivion.cs +++ b/Items/Weapons/Melee/Oblivion.cs @@ -1,7 +1,8 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Melee.Yoyos; using CalamityMod.Systems.Collections; +using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -13,9 +14,10 @@ namespace CalamityMod.Items.Weapons.Melee { public new string LocalizationCategory => "Items.Weapons.Melee"; + public static float Lifetime => 15; //Technically has infinite lifetime, but manually sets 15 seconds. See projectile file for details public static float Reach = 512f; public static float Speed = 36f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(Reach.ToTiles(), Speed); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(Reach.ToTiles(), Speed, Lifetime); public override void SetStaticDefaults() { @@ -30,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 28; Item.height = 38; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 50; + Item.damage = 40; Item.knockBack = 4f; Item.useTime = 22; Item.useAnimation = 22; @@ -48,5 +50,14 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Lime; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; } + + public override bool CanUseItem(Player player) + { + CalamityPlayer modPlayer = player.Calamity(); + if (modPlayer.oblivionCooldown == 0) + return true; + else + return false; + } } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 43d0904593..a62c6f5a10 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -918,8 +918,13 @@ Oblivion: { DisplayName: Oblivion Tooltip: ''' - {$Common.YoyoStatsInfinite} - Fires brimstone darts when enemies are near + {$Common.YoyoStats} + An unstable yoyo that slowly releases homing brimstone hellblasts + Striking an enemy with the yoyo charges power, increasing the fire rate of the hellblasts + At maximum power, the yoyo bursts into brimstone darts and resets its duration + Striking an enemy at max power will overload the yoyo, causing it to release all stored up power and shatter + Shattering the yoyo deals immense damage but leaves it unable to be used for several seconds + [c/C61B40:'I have memories from eyes that are not my own'] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 1dd7bb9076..ba72470e9f 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -312,3 +312,5 @@ WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YinYoDark.DisplayName: Dark Shard YinYoLight.DisplayName: Light Shard EvilSmasherProjectile.DisplayName: Evil Smasher +OblivionFire.DisplayName: Oblivion Fire +OblivionBolt.DisplayName: Oblivion Bolt diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index bd0c8302a5..213982f7b2 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -129,6 +129,7 @@ Cooldowns: { MasterChefShieldDurability: MJOLNIR Shield Level MasterChefShieldRecharge: MJOLNIR Shield Recharge NebulousCore: Nebulous Core Cooldown + OblivionCooldown: Oblivion Cooldown OldDukeScalesFatigue: Stamina OmegaBlueActive: Abyssal Madness OmegaBlueCooldown: Abyssal Madness Cooldown diff --git a/Projectiles/Melee/OblivionBolt.cs b/Projectiles/Melee/OblivionBolt.cs new file mode 100644 index 0000000000..2b26a74f0b --- /dev/null +++ b/Projectiles/Melee/OblivionBolt.cs @@ -0,0 +1,97 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Metaballs; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class OblivionBolt : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/Boss/BurningBolt"; + public int time = 0; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 18; + Projectile.height = 44; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.penetrate = 3; + Projectile.timeLeft = 690; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + if (Projectile.velocity.Length() < Projectile.ai[2]) + { + Projectile.velocity *= 1.01f; + if (Projectile.velocity.Length() > Projectile.ai[2]) + { + Projectile.velocity.Normalize(); + Projectile.velocity *= Projectile.ai[2]; + } + } + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + + Projectile.frameCounter++; + if (Projectile.frameCounter > 4) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 3) + Projectile.frame = 0; + + if (Projectile.timeLeft < 60) + Projectile.Opacity = MathHelper.Clamp(Projectile.timeLeft / 60f, 0f, 1f); + + if (Projectile.ai[0] == 2f) + { + if (Projectile.timeLeft > 570) + { + int player = Player.FindClosest(Projectile.Center, 1, 1); + Vector2 vector = Main.player[player].Center - Projectile.Center; + float scaleFactor = Projectile.velocity.Length(); + vector.Normalize(); + vector *= scaleFactor; + Projectile.velocity = (Projectile.velocity * 15f + vector) / 16f; + Projectile.velocity.Normalize(); + Projectile.velocity *= scaleFactor; + } + } + + Lighting.AddLight(Projectile.Center, 0.75f * Projectile.Opacity, 0f, 0f); + time++; + + var p = SeekersMetaball.SpawnParticle(Projectile.Center + Projectile.velocity * Projectile.MaxUpdates, Vector2.Zero, Terraria.GameContent.TextureAssets.Projectile[Type].Width() * Projectile.scale); + p.rotation = Projectile.rotation; + p.CurrentFrame = Projectile.frame; + p.MaxFrames = Main.projFrames[Type]; + p.TextureToUse = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + p.SizeScaling = 0f; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 300); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); + + public override bool PreDraw(ref Color lightColor) + { + return false; + } + } +} diff --git a/Projectiles/Melee/OblivionFire.cs b/Projectiles/Melee/OblivionFire.cs new file mode 100644 index 0000000000..dd2eb863b6 --- /dev/null +++ b/Projectiles/Melee/OblivionFire.cs @@ -0,0 +1,43 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Metaballs; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class OblivionFire : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public ref float Time => ref Projectile.ai[0]; + + public override void SetDefaults() + { + Projectile.width = 8; + Projectile.height = 8; + Projectile.friendly = true; + Projectile.penetrate = 1; + Projectile.timeLeft = 240; + Projectile.MaxUpdates = 4; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.MeleeNoSpeed; + } + + public override void AI() + { + Time++; + if (Time >= 100f) + CalamityUtils.HomeInOnNPC(Projectile, false, 300, 2.5f, 10f, true); + CalamitasMetaball.SpawnParticle(Projectile.Center + Projectile.velocity, Main.rand.NextVector2Circular(2, 2), 16f); + } + + public override bool? CanDamage() => Time >= 45f; + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 300); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); + } +} diff --git a/Projectiles/Melee/Yoyos/OblivionYoyo.cs b/Projectiles/Melee/Yoyos/OblivionYoyo.cs index 257a5f2c41..5856f74925 100644 --- a/Projectiles/Melee/Yoyos/OblivionYoyo.cs +++ b/Projectiles/Melee/Yoyos/OblivionYoyo.cs @@ -1,8 +1,15 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Cooldowns; +using CalamityMod.Dusts; +using CalamityMod.Enums; using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Projectiles.Magic; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -13,6 +20,19 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public const int MaxUpdates = 2; + //How many hits the yoyo has gotten. Starts at 1 to avoid a dividing by zero error + public int hitCounter = 1; + //20 hits to maximum + public int hitCountMax = 21; + public int time = 0; + //Used for visual intensity rising as the yoyo gets more hits + public float power = 0; + public float powerMax = 1; + //The grace period after the yoyo reaches max power to avoid insta-shattering + public int graceTimer = 0; + public bool shatter = false; + //Yoyo bag behavior + public bool cloneYoyo = false; public override void SetStaticDefaults() { @@ -33,21 +53,331 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Projectile.penetrate = -1; Projectile.MaxUpdates = MaxUpdates; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10 * MaxUpdates; + Projectile.localNPCHitCooldown = 15 * MaxUpdates; } public override void AI() { - CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 9f, 48f, 5, ModContent.ProjectileType(), 0.5, damageType: Projectile.DamageType); - if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks + var player = Main.player[Projectile.owner]; + //Yoyo glove is stupid and dumb and smells bad + //Using yoyo glove or yoyo bag makes yoyos run out of air time 2-4x faster (randomized) when the second yoyo is out + //Therefore, we set the flight to infinite, but manually set it to recall after 15 seconds and update it across both yoyos + if (time >= 1800) + { + if (!cloneYoyo) + { + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile p = Main.projectile[i]; + if (p.active && p.type == Type && p.owner == Projectile.owner) + { + if (p.ModProjectile is OblivionYoyo oblivion) + { + oblivion.Projectile.ai[0] = -1f; + } + } + } + } + } + // Determine if the yoyo is a yoyo bag/yoyo glove clone + if (!cloneYoyo) + { + int MainYoyo = -1; + for (int x = 0; x < Main.maxProjectiles; x++) + { + Projectile proj = Main.projectile[x]; + if (proj.active && proj.type == Type && proj.owner == Projectile.owner) + { + MainYoyo = x; + break; + } + } + if (Projectile.whoAmI != MainYoyo) + cloneYoyo = true; + //Yoyo behavior. Nothing will trigger on yoyos from yoyo bag + + //Fireball spawning. Fire rate increases with how many hits the yoyo has gotten + if (time % (120 / hitCounter) == 0 && !shatter && Projectile.owner == Main.myPlayer) + { + float randRot = Main.rand.NextFloat(0, MathHelper.TwoPi); + Vector2 spawnVel = randRot.ToRotationVector2() * 2f; + Projectile flames = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, spawnVel, ModContent.ProjectileType(), (int)(Projectile.damage * 0.85f), Projectile.knockBack, Projectile.owner); + } + if (graceTimer > 0) + graceTimer--; + if (shatter) + { + //Constantly keep the yoyo out, even if the player lets go of the mouse + Projectile.ai[0] = 0f; + //TODO: Make this follow yoyo range limits & tilecollide + Projectile.Center = player.Calamity().mouseWorld; + //Charge up visuals + power += 0.01f; + float fade = Utils.GetLerpValue(powerMax + 2, 0, power); + float numberOfDusts = 2f; + float rotFactor = 360f / numberOfDusts; + for (int i = 0; i < numberOfDusts; i++) + { + float rot = MathHelper.ToRadians(i * rotFactor); + Vector2 velOffset = CalamityUtils.RandomVelocity(100f, 70f, 250f, 0.04f); + velOffset *= Main.rand.NextFloat(25, 45) * fade; + Particle energy = new GlowOrbParticle(Projectile.Center + velOffset * 2.5f, -velOffset * Main.rand.NextFloat(0.08f, 0.12f) * 1.5f, false, (int)(14 - (5 * fade)), Main.rand.NextFloat(1.1f, 1.25f) - 0.5f * fade, Main.rand.NextBool() ? Color.Red : Color.MediumVioletRed); + GeneralParticleHandler.SpawnParticle(energy); + Dust dust = Dust.NewDustPerfect(Projectile.Center + velOffset * 2.5f, DustID.FireworksRGB, -velOffset * Main.rand.NextFloat(0.08f, 0.12f) * 1.5f, 0, default, Main.rand.NextFloat(0.6f, 0.8f)); + dust.noGravity = true; + dust.color = Color.DarkRed; + } + if (time == 240) + { + #region Visuals and Sounds + Player Owner = Main.player[Projectile.owner]; + for (int i = 0; i < 2; i++) + { + Particle centerVoid = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), (2.2f + i * 0.5f), 0f, 80, false); + GeneralParticleHandler.SpawnParticle(centerVoid); + } + for (int i = 0; i < 2; i++) + { + Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 1f, 3f, 25, true); + GeneralParticleHandler.SpawnParticle(blastRing); + Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.MediumVioletRed, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.5f, 1.5f, 25, true); + GeneralParticleHandler.SpawnParticle(blastRing2); + } + Particle backBlast1 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.MediumVioletRed, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 2.56f * 1.3f, 18); + GeneralParticleHandler.SpawnParticle(backBlast1, false, GeneralDrawLayer.AfterEverything); + + Particle backBlast2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.MediumVioletRed, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.3f, 30); + GeneralParticleHandler.SpawnParticle(backBlast2, false, GeneralDrawLayer.AfterEverything); + + Particle backBlast3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DarkRed * 0.55f, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.3f * 1.35f, 30); + GeneralParticleHandler.SpawnParticle(backBlast3, false, GeneralDrawLayer.AfterEverything); + + Particle ring1 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/FlameExplosion2", new Vector2(0.01f, 0.085f), MathHelper.PiOver2, -4f, 4f, 30); + GeneralParticleHandler.SpawnParticle(ring1); + + Particle ring2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/FlameExplosion", new Vector2(0.02f, 0.07f), 0f, -4f, 4f, 25); + GeneralParticleHandler.SpawnParticle(ring2); + + Particle ring3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/FlameExplosion", new Vector2(0.02f, 0.07f), MathHelper.PiOver4, -4f, 4f, 25); + GeneralParticleHandler.SpawnParticle(ring3); + + Particle ring4 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/FlameExplosion", new Vector2(0.02f, 0.07f), -MathHelper.PiOver4, -4f, 4f, 25); + GeneralParticleHandler.SpawnParticle(ring4); + + for (int i = 0; i < 19; i++) + { + int dustStyle = ModContent.DustType(); + Dust dust = Dust.NewDustPerfect(Projectile.Center, dustStyle); + dust.scale = Main.rand.NextFloat(1.4f, 2.2f); + dust.velocity = new Vector2(21, 21).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1f); + dust.noGravity = true; + dust.color = Color.MediumVioletRed; + } + for (int i = 0; i < (25); i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.FireworksRGB); + dust.noGravity = false; + dust.velocity = new Vector2(18, 18).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f); + dust.scale = Main.rand.NextFloat(0.8f, 1.2f); + dust.color = Color.DarkRed; + } + Owner.SetScreenshake(6f); + SoundStyle boom = new("CalamityMod/Sounds/Custom/CalamitasClone/BulletHellEnd"); + SoundEngine.PlaySound(boom with { Volume = 1.5f }, Projectile.Center); + #endregion + if (Projectile.owner == Main.myPlayer) + { + float blastSize = 240; + float minMultiplier = 0.25f; + int hitsToMinMult = 3; + int debuff1 = ModContent.BuffType(); + int debufftime = 180; + //I promise this is balanced + Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 50f), Projectile.knockBack, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); + blast.localAI[0] = debuff1; + blast.localAI[1] = debufftime; + blast.timeLeft = 2; + blast.DamageType = Projectile.DamageType; + blast.CritChance = 100; + } + + //Set cooldown + player.Calamity().oblivionCooldown = 300; + int duration = CalamityUtils.SecondsToFrames(5); + player.AddCooldown(OblivionCooldown.ID, duration, true); + + //We manually kill the projectile to skip the retracting, to make it look like the yoyo is destroyed + //This needs to happen for both the main and secondary yoyo + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile p = Main.projectile[i]; + if (p.active && p.type == Type && p.owner == Projectile.owner) + { + p.Kill(); + } + } + } + } + } + //If the player gets more than 200 blocks away, kill the yoyo + if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) Projectile.Kill(); + time++; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + //Only applies to the main yoyo + if (!cloneYoyo) + { + hitCounter++; + if (!shatter) + { + power += 0.05f; + SoundStyle onHit = new("CalamityMod/Sounds/Item/TearsOfHeavenUse"); + SoundEngine.PlaySound(onHit, Projectile.Center); + if (power > powerMax) + { + power = powerMax; + } + } + if (hitCounter == hitCountMax) + { + //Refresh duration on both yoyos + if(!cloneYoyo) + { + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile p = Main.projectile[i]; + if (p.active && p.type == Type && p.owner == Projectile.owner) + { + if (p.ModProjectile is OblivionYoyo oblivion) + { + oblivion.time = 0; + } + } + } + } + //Start a 1.5 second grace period where the yoyo cannot damage enemies. This is to avoid instant shattering after reaching max power + graceTimer = 90; + //Small burst and a ring of darts + if (Projectile.owner == Main.myPlayer) + { + int totalProjectiles = 18; + float radians = MathHelper.TwoPi / totalProjectiles; + float velocity = 8f; + Vector2 spinningPoint = new Vector2(0f, -velocity); + for (int k = 0; k < totalProjectiles; k++) + { + Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, 0f, Projectile.ai[1], velocity * 1.5f); + } + float blastSize = 120; + float minMultiplier = 0.25f; + int hitsToMinMult = -1; + int debuff1 = ModContent.BuffType(); + int debufftime = 180; + Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 5f), Projectile.knockBack, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); + blast.localAI[0] = debuff1; + blast.localAI[1] = debufftime; + blast.timeLeft = 2; + blast.DamageType = Projectile.DamageType; + } + #region Visuals and Sounds + SoundStyle boom = new("CalamityMod/Sounds/Custom/CalamitasClone/CalClone_BigFireballBit", 4); + SoundEngine.PlaySound(boom with { Volume = 1.5f }, Projectile.Center); + SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode with { Volume = 1f, Pitch = -0.5f }, Projectile.Center); + SoundEngine.PlaySound(SoundID.Item74 with { Volume = 0.7f, Pitch = 1f }, Projectile.Center); + for (int i = 0; i < 5; i++) + { + Particle explosion = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Lerp(Color.Red, Color.MediumVioletRed, Utils.GetLerpValue(0, 5, i, true)), "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0f, 0.12f + 0.005f * i, (int)(20 - i * 1.5f)); + GeneralParticleHandler.SpawnParticle(explosion); + } + for (int i = 0; i < 3; i++) + { + Particle explosion = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Lerp(Color.DarkRed, Color.DarkOrchid, Utils.GetLerpValue(0, 3, i, true)), "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0f, 0.12f + 0.01f * i, (int)(20 - i * 2f)); + GeneralParticleHandler.SpawnParticle(explosion); + } + Particle outerGlow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DarkRed, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.2f, 2f, 24); + GeneralParticleHandler.SpawnParticle(outerGlow); + Particle innerGlow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.1f, 1f, 24); + GeneralParticleHandler.SpawnParticle(innerGlow); + #endregion + } + //If the yoyo hits while at maximum, reset the duration of both yoyos and trigger shattering + if (hitCounter > hitCountMax && !shatter) + { + SoundEngine.PlaySound(SoundID.DD2_EtherianPortalDryadTouch with { Volume = 4f }, Projectile.Center); + shatter = true; + if (!cloneYoyo) + { + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile p = Main.projectile[i]; + if (p.active && p.type == Type && p.owner == Projectile.owner) + { + if (p.ModProjectile is OblivionYoyo oblivion) + { + oblivion.time = 0; + } + } + } + } + } + } + } + + //During the grace period after reaching max power, the yoyo cannot hit enemies for 1.5s to avoid unfair shattering + public override bool? CanDamage() => graceTimer == 0; + + //Avoids instantly spawning a fireball + public override void OnSpawn(IEntitySource source) + { + time = 1; + } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + Texture2D bloomTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D shineTexture = ModContent.Request("CalamityMod/Particles/HalfStar").Value; + + float randSize = Main.rand.NextFloat(0.9f, 1.1f); + float rotationAngle = MathHelper.PiOver4; + Vector2 drawPos = Projectile.Center - Main.screenPosition; + + //Only applies to the main yoyo + if (!cloneYoyo) + { + //Red backglow, scales in size with power + Main.EntitySpriteDraw(bloomTexture, drawPos, null, Color.Red with { A = 0 }, Projectile.rotation, bloomTexture.Size() * 0.5f, 0.3f * randSize * power, SpriteEffects.None, 0); + Main.EntitySpriteDraw(bloomTexture, drawPos, null, Color.MediumVioletRed with { A = 0 } * 0.65f, Projectile.rotation, bloomTexture.Size() * 0.5f, 0.2f * randSize * power, SpriteEffects.None, 0); + + //X, scales in size with power + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.Red with { A = 0 }, rotationAngle, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 2.75f * randSize * power, SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.Purple with { A = 0 } * 0.65f, rotationAngle, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 2.25f * randSize * power, SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.Red with { A = 0 }, rotationAngle + MathHelper.PiOver2, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 2.75f * randSize * power, SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.Purple with { A = 0 } * 0.65f, rotationAngle + MathHelper.PiOver2, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 2.25f * randSize * power, SpriteEffects.None, 0); + + //Yoyo drawing + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + + //Red cross, doesn't scale in size unless shattering + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.DarkRed with { A = 0 }, 0, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 1.35f * randSize * (shatter ? power : 1f), SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.Purple with { A = 0 } * 0.65f, 0, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 1.35f * randSize * (shatter ? power : 1f), SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.DarkRed with { A = 0 }, MathHelper.PiOver2, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 1.35f * randSize * (shatter ? power : 1f), SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTexture, drawPos, null, Color.Purple with { A = 0 } * 0.65f, MathHelper.PiOver2, shineTexture.Size() * 0.5f, new Vector2(0.4f, 1f) * 1.35f * randSize * (shatter ? power : 1f), SpriteEffects.None, 0); + + //Black backglow, scales in size with power + for (int i = 0; i < 2; i++) + { + Particle backglow = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.25f * (power * 2), 0f, 10, false); + GeneralParticleHandler.SpawnParticle(backglow); + backglow.DrawLayer = Enums.GeneralDrawLayer.BeforeProjectiles; + backglow.DrawLayer = Enums.GeneralDrawLayer.BeforeNPCs; + } + } + else + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } From fc07a671229fc95851994f8d69aa933647253371 Mon Sep 17 00:00:00 2001 From: sunny-raindrops Date: Sat, 27 Jun 2026 22:59:50 -0700 Subject: [PATCH 09/56] Projectiles no longer have flask dust --- Projectiles/Melee/OblivionBolt.cs | 1 + Projectiles/Melee/OblivionFire.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/Projectiles/Melee/OblivionBolt.cs b/Projectiles/Melee/OblivionBolt.cs index 2b26a74f0b..f35c5390c5 100644 --- a/Projectiles/Melee/OblivionBolt.cs +++ b/Projectiles/Melee/OblivionBolt.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = 690; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; + Projectile.noEnchantmentVisuals = true; } public override void AI() diff --git a/Projectiles/Melee/OblivionFire.cs b/Projectiles/Melee/OblivionFire.cs index dd2eb863b6..f67af50a7f 100644 --- a/Projectiles/Melee/OblivionFire.cs +++ b/Projectiles/Melee/OblivionFire.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.MaxUpdates = 4; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.noEnchantmentVisuals = true; } public override void AI() From 21462599d68f9cb4e715e70d1e21c6a27333212b Mon Sep 17 00:00:00 2001 From: sunny-raindrops Date: Sat, 27 Jun 2026 23:25:52 -0700 Subject: [PATCH 10/56] Oblivion balance changes --- Items/Weapons/Melee/Oblivion.cs | 2 +- Projectiles/Melee/OblivionBolt.cs | 1 + Projectiles/Melee/Yoyos/OblivionYoyo.cs | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Melee/Oblivion.cs b/Items/Weapons/Melee/Oblivion.cs index ca79b991de..ca9d8bf80d 100644 --- a/Items/Weapons/Melee/Oblivion.cs +++ b/Items/Weapons/Melee/Oblivion.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 28; Item.height = 38; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 40; + Item.damage = 35; Item.knockBack = 4f; Item.useTime = 22; Item.useAnimation = 22; diff --git a/Projectiles/Melee/OblivionBolt.cs b/Projectiles/Melee/OblivionBolt.cs index f35c5390c5..966ee0bca9 100644 --- a/Projectiles/Melee/OblivionBolt.cs +++ b/Projectiles/Melee/OblivionBolt.cs @@ -27,6 +27,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.ArmorPenetration = 20; Projectile.penetrate = 3; Projectile.timeLeft = 690; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Melee/Yoyos/OblivionYoyo.cs b/Projectiles/Melee/Yoyos/OblivionYoyo.cs index 5856f74925..52073ed362 100644 --- a/Projectiles/Melee/Yoyos/OblivionYoyo.cs +++ b/Projectiles/Melee/Yoyos/OblivionYoyo.cs @@ -109,7 +109,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { //Constantly keep the yoyo out, even if the player lets go of the mouse Projectile.ai[0] = 0f; - //TODO: Make this follow yoyo range limits & tilecollide Projectile.Center = player.Calamity().mouseWorld; //Charge up visuals power += 0.01f; From 1afcd083ffb7c9d68d65d09983a355462f2a19b5 Mon Sep 17 00:00:00 2001 From: sunny-raindrops Date: Sat, 27 Jun 2026 23:27:45 -0700 Subject: [PATCH 11/56] Oblivion tooltip adjustments --- .../en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index a62c6f5a10..1ff605dc1c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -919,10 +919,10 @@ Oblivion: { Tooltip: ''' {$Common.YoyoStats} - An unstable yoyo that slowly releases homing brimstone hellblasts - Striking an enemy with the yoyo charges power, increasing the fire rate of the hellblasts - At maximum power, the yoyo bursts into brimstone darts and resets its duration - Striking an enemy at max power will overload the yoyo, causing it to release all stored up power and shatter + A hightly unstable yoyo that slowly releases homing brimstone hellblasts + Enemy hits with the yoyo charge its power, greatly increasing the fire rate of the hellblasts + At maximum power, the yoyo bursts into brimstone darts and resets its flight duration + Striking an enemy at maximum power will overload the yoyo, causing it to release all stored up power and shatter Shattering the yoyo deals immense damage but leaves it unable to be used for several seconds [c/C61B40:'I have memories from eyes that are not my own'] ''' From 1d9b602f36dbbd5ee1c4d5a3d1438f8b5b6f4d95 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 28 Jun 2026 17:26:58 -0400 Subject: [PATCH 12/56] Enraged Providence is now FTW Providence Also features a few minor AI changes to account for this --- Items/SummonItems/ProfanedCore.cs | 31 +++---- .../Mods.CalamityMod.Items.SummonItems.hjson | 4 +- .../en-US/Mods.CalamityMod.NPCs.hjson | 2 +- NPCs/Providence/Providence.cs | 80 ++++--------------- Projectiles/Boss/HolyBlast.cs | 3 - Projectiles/Boss/HolyBurnOrb.cs | 6 +- Projectiles/Boss/HolyFire.cs | 8 +- Projectiles/Boss/MoltenBlast.cs | 2 +- Scenes/MusicScenes/ProvidenceMusicScene.cs | 4 +- 9 files changed, 43 insertions(+), 97 deletions(-) diff --git a/Items/SummonItems/ProfanedCore.cs b/Items/SummonItems/ProfanedCore.cs index 0176a2ae0c..4cb746ce79 100644 --- a/Items/SummonItems/ProfanedCore.cs +++ b/Items/SummonItems/ProfanedCore.cs @@ -1,4 +1,6 @@ -using CalamityMod.Events; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Events; using CalamityMod.NPCs; using CalamityMod.NPCs.Providence; using CalamityMod.Projectiles.Boss; @@ -36,28 +38,27 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - var Prov = CalamityGlobalNPC.holyBoss; - bool canPissOffProvi = Prov != -1 && Main.npc[Prov].life >= (Main.npc[Prov].lifeMax * 0.95f) && Main.npc[Prov].Calamity().newAI[3] >= 180f && !Main.npc[Prov].Calamity().CurrentlyEnraged; - return ((!NPC.AnyNPCs(ModContent.NPCType()) && (player.ZoneHallow || player.ZoneUnderworldHeight)) || canPissOffProvi) && !BossRushEvent.BossRushActive; + return !NPC.AnyNPCs(ModContent.NPCType()) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; } public override bool? UseItem(Player player) { - var Prov = CalamityGlobalNPC.holyBoss; - bool usingToMakeProviPissedOff = Prov != -1 && Main.npc[Prov].life >= (Main.npc[Prov].lifeMax * 0.95f) && Main.npc[Prov].Calamity().newAI[3] >= 180f && !Main.npc[Prov].Calamity().CurrentlyEnraged; - if (usingToMakeProviPissedOff) + int posX = (int)player.position.X; + int posY = (int)(player.position.Y - 100f); + int bossToSpawn = ModContent.NPCType(); + NPC prov = CalamityUtils.SpawnBossOnPosUsingItem(player, bossToSpawn, posX, posY, Providence.SpawnSound); + if (Main.getGoodWorld) { - (Main.npc[Prov].ModNPC as Providence).hasBeenGivenFullPower = true; + (prov.ModNPC as Providence).hasBeenGivenFullPower = true; Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0); } - else - { - int posX = (int)player.position.X; - int posY = (int)(player.position.Y - 100f); - int bossToSpawn = ModContent.NPCType(); - CalamityUtils.SpawnBossOnPosUsingItem(player, bossToSpawn, posX, posY, Providence.SpawnSound); - } return true; } + + public override void ModifyTooltips(List tooltips) + { + string enrageTooltip = Main.getGoodWorld ? "\n" + this.GetLocalizedValue("EnrageText") : ""; + tooltips.FindAndReplace("[ENRAGE]", enrageTooltip); + } } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index 3ae132b727..4e949f3dee 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -226,11 +226,11 @@ ProfanedCore: { DisplayName: Profaned Core Tooltip: ''' - Summons Providence when used in the Hallow or Underworld - Use again while Providence is at high health to unleash Her perfect fury + Summons Providence when used in the Hallow or Underworld[ENRAGE] {$Common.NotConsumable} 'The heart of Her Guardians, Her wicked wrath shall burn upon whoever now wields it.' ''' + EnrageText: "[c/64c8fa:The nature of this world will unleash Her perfect fury, beware!]" } ProfanedShard: { diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 9c0835999f..e21ebc6a6a 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -598,7 +598,7 @@ TownPiggy: { Techno: Techno JohnPork: John Pork Piglet: Piglet - Poogie: Poogie + Poogie: Poogie } Chat: { diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 43ff5d3db8..06a46f1b90 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -290,7 +290,7 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - if (Main.getGoodWorld) + if (Main.zenithWorld) NPC.scale *= 0.25f; } @@ -400,8 +400,7 @@ namespace CalamityMod.NPCs.Providence Player player = Main.player[NPC.target]; // Enraged bool and Color shifting - bool getFuckedAI = Main.zenithWorld; - if (getFuckedAI) + if (Main.zenithWorld) NPC.localAI[1] = (float)BossMode.Rainbow; else if (hasBeenGivenFullPower) // Enraged behavior NPC.localAI[1] = (float)BossMode.Enraged; @@ -426,29 +425,15 @@ namespace CalamityMod.NPCs.Providence // Is in spawning animation float spawnAnimationTime = 180f; bool spawnAnimation = calamityGlobalNPC.newAI[3] < spawnAnimationTime; - if (!spawnAnimation) - { NPC.Opacity = 1f; - } // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; - // Play enrage animation if she gets angy - if (!getFuckedAI && fullPowerAI && calamityGlobalNPC.newAI[3] == spawnAnimationTime) + // Sync "enrage" status in FTW + if (NPC.localAI[1] == (float)BossMode.Enraged && calamityGlobalNPC.newAI[3] == 0f) { - AIState = (int)Phase.HolyBlast; - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - calamityGlobalNPC.newAI[1] = 0f; - calamityGlobalNPC.newAI[2] = 0f; - calamityGlobalNPC.newAI[3] = 0f; - - // Despawn existing projectiles and summon the aura again - DespawnSpecificProjectiles(true); - Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, -1); if (Main.netMode != NetmodeID.SinglePlayer) ProvidenceDyeConditionSyncPacket.Send(this); NPC.ForceNetUpdate(false); @@ -811,7 +796,7 @@ namespace CalamityMod.NPCs.Providence calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon || AIState == (int)Phase.Laser || spawnAnimation; // Movement - if (getFuckedAI || (AIState != (int)Phase.FlameCocoon && AIState != (int)Phase.SpearCocoon)) + if (Main.zenithWorld || (AIState != (int)Phase.FlameCocoon && AIState != (int)Phase.SpearCocoon)) { // Slowly drift down when spawning if (spawnAnimation) @@ -878,14 +863,8 @@ namespace CalamityMod.NPCs.Providence } if (laserPhaseSlow) { - acceleration *= getFuckedAI ? 0.6f : 0.2f; - velocity *= getFuckedAI ? 0.6f : 0.2f; - } - - if (Main.getGoodWorld) - { - velocity *= 1.2f; - acceleration *= 1.2f; + acceleration *= Main.zenithWorld ? 0.6f : 0.2f; + velocity *= Main.zenithWorld ? 0.6f : 0.2f; } if (!targetDead) @@ -898,14 +877,11 @@ namespace CalamityMod.NPCs.Providence float moveUpThreshold = player.position.Y - (NPC.position.Y + NPC.height); if (moveUpThreshold < (laserPhaseSlow ? 150f : 200f)) // 150 - NPC.velocity.Y -= Main.getGoodWorld ? 0.4f : 0.2f; + NPC.velocity.Y -= fullPowerAI ? 0.4f : 0.2f; if (moveUpThreshold > (laserPhaseSlow ? 200f : 250f)) // 200 - NPC.velocity.Y += Main.getGoodWorld ? 0.4f : 0.2f; + NPC.velocity.Y += fullPowerAI ? 0.4f : 0.2f; float speedCap = laserPhaseSlow ? 2f : 6f; - if (Main.getGoodWorld) - speedCap *= 1.5f; - if (NPC.velocity.Y > speedCap) NPC.velocity.Y = speedCap; if (NPC.velocity.Y < -speedCap) @@ -1121,29 +1097,7 @@ namespace CalamityMod.NPCs.Providence GeneralParticleHandler.SpawnParticle(new SparkParticle(startPos, startPos.DirectionTo(destination) * (startPos.Distance(destination) / 10), false, 10, Main.rand.NextFloat(0.2f, 0.5f) * (sc * 2), medColor)); } - // Used to heal her back to full HP during enrage animation - if (fullPowerAI && calamityGlobalNPC.newAI[3] % 9f == 0f) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int healAmt = NPC.lifeMax / 400; - if (healAmt > NPC.lifeMax - NPC.life) - healAmt = NPC.lifeMax - NPC.life; - - if (healAmt > 0) - { - NPC.life += healAmt; - NPC.HealEffect(healAmt, true); - NPC.ForceNetUpdate(false); - } - } - } - calamityGlobalNPC.newAI[3] += 1f; - - if (fullPowerAI && calamityGlobalNPC.newAI[3] >= spawnAnimationTime) - calamityGlobalNPC.newAI[3] += 1f; - return; } @@ -1238,7 +1192,7 @@ namespace CalamityMod.NPCs.Providence borderPosition ??= NPC.Center; borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f); Vector2 fireSparklesFrom = fireFrom + new Vector2(0, -30); - if (!targetDead && !getFuckedAI) + if (!targetDead && !Main.zenithWorld) { if (NPC.velocity.Length() <= 2f) NPC.velocity = Vector2.Zero; @@ -1509,7 +1463,7 @@ namespace CalamityMod.NPCs.Providence borderPosition ??= NPC.Center; borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f); - if (!targetDead && !getFuckedAI) + if (!targetDead && !Main.zenithWorld) { if (NPC.velocity.Length() <= 2f) NPC.velocity = Vector2.Zero; @@ -1554,9 +1508,6 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); - - if (Main.getGoodWorld) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } @@ -1581,9 +1532,6 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); - - if (Main.getGoodWorld) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); } } @@ -1601,7 +1549,7 @@ namespace CalamityMod.NPCs.Providence case (int)Phase.Crystal: - if (!targetDead && !getFuckedAI) + if (!targetDead && !Main.zenithWorld) NPC.velocity *= 0.9f; NPC.ai[1] += 1f; @@ -1673,7 +1621,7 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { - float timeLeft = fullPowerAI ? (float)(getFuckedAI ? gfbCrystalTime : enragedCrystalTime) : 0f; + float timeLeft = fullPowerAI ? (float)(Main.zenithWorld ? gfbCrystalTime : enragedCrystalTime) : 0f; Projectile.NewProjectile(NPC.GetSource_FromAI(), crystalSpawnPos, Vector2.Zero, ModContent.ProjectileType(), CrystalDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, lifeRatio, 0f, timeLeft); } } @@ -2094,7 +2042,7 @@ namespace CalamityMod.NPCs.Providence public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - bool offColor = NPC.localAI[1] != (float)BossMode.Normal && (NPC.Calamity().newAI[3] >= 180f || Main.zenithWorld); + bool offColor = NPC.localAI[1] != (float)BossMode.Normal; Texture2D texture = offColor ? TextureNight.Value : TextureAssets.Npc[Type].Value; Texture2D textureGlow = offColor ? TextureNight_Glow.Value : Texture_Glow.Value; diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 3abbfc578f..c70af794b1 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -161,9 +161,6 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { int totalProjectiles = !ProvUtils.StandardAI() ? 8 : 6; - if (Main.getGoodWorld) - totalProjectiles *= 2; - float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = 5f; diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 36404593ba..e76ac00c6f 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.timeLeft = 160; } - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) { if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f) { @@ -74,8 +74,8 @@ namespace CalamityMod.Projectiles.Boss } else { - Projectile.ai[1] += 0.05f; - Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, (float)Math.Abs(Math.Sin(Projectile.ai[1]))); + Projectile.ai[1] += 0.075f; + Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, MathF.Abs(MathF.Sin(Projectile.ai[1]))); } } else if (Projectile.velocity.Length() < 16f) diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index a25b4d1497..5347d93748 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -90,12 +90,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 velocity = new Vector2(0.01f, 0f); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); @@ -106,12 +106,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 velocity = new Vector2(0.05f, 0f); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index c5a137939a..1a972a6df7 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -166,7 +166,7 @@ namespace CalamityMod.Projectiles.Boss { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f) + additionalBlobVelocity; velocity.Y = -Math.Abs(velocity.Y); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= 2f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), BlobDamage, 0f, Projectile.owner); diff --git a/Scenes/MusicScenes/ProvidenceMusicScene.cs b/Scenes/MusicScenes/ProvidenceMusicScene.cs index 33b94b0f75..57c5e761e3 100644 --- a/Scenes/MusicScenes/ProvidenceMusicScene.cs +++ b/Scenes/MusicScenes/ProvidenceMusicScene.cs @@ -13,12 +13,12 @@ namespace CalamityMod.Systems public override int NPCType => ModContent.NPCType(); public static int ProvidenceTrack => (int)CalamityMod.Instance.GetMusicFromMusicMod("Providence"); public static int SilenceTrack => MusicLoader.GetMusicSlot(CalamityMod.Instance, "Sounds/Music/Silence"); - public override int? MusicModMusic => ProvidenceSpawnState() < 180f && ProvUtils.StandardAI() ? SilenceTrack : ProvidenceTrack; + public override int? MusicModMusic => ProvidenceSpawnState() < 180f ? SilenceTrack : ProvidenceTrack; public override int VanillaMusic => MusicID.LunarBoss; public override int OtherworldMusic => MusicID.OtherworldlyLunarBoss; public override void SpecialVisuals(Player player, bool isActive) { - if (ProvidenceSpawnState() == 180f && ProvUtils.StandardAI()) + if (ProvidenceSpawnState() == 180f) Main.musicFade[ProvidenceTrack] = 1f; } public static float ProvidenceSpawnState() From a75d4240c59e70d34991f4364c7d344ef234a086 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 28 Jun 2026 17:35:28 -0400 Subject: [PATCH 13/56] Profaned Moonlight Dye is now obtained via shimmering Profaned Flame Dye --- Items/Dyes/ProfanedFlameDye.cs | 2 ++ Items/Dyes/ProfanedMoonlightDye.cs | 2 ++ Localization/en-US/Mods.CalamityMod.Condition.hjson | 1 - NPCs/Providence/Providence.cs | 6 ------ Utilities/DropHelper.cs | 2 -- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Items/Dyes/ProfanedFlameDye.cs b/Items/Dyes/ProfanedFlameDye.cs index 5170ee340b..fbdfae0100 100644 --- a/Items/Dyes/ProfanedFlameDye.cs +++ b/Items/Dyes/ProfanedFlameDye.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.Dyes { @@ -14,6 +15,7 @@ namespace CalamityMod.Items.Dyes public override void SafeSetStaticDefaults() { Item.ResearchUnlockCount = 3; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SafeSetDefaults() diff --git a/Items/Dyes/ProfanedMoonlightDye.cs b/Items/Dyes/ProfanedMoonlightDye.cs index 7b19417b60..110cdac0fb 100644 --- a/Items/Dyes/ProfanedMoonlightDye.cs +++ b/Items/Dyes/ProfanedMoonlightDye.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Graphics.Shaders; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Dyes @@ -12,6 +13,7 @@ namespace CalamityMod.Items.Dyes public override void SafeSetStaticDefaults() { Item.ResearchUnlockCount = 3; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SafeSetDefaults() diff --git a/Localization/en-US/Mods.CalamityMod.Condition.hjson b/Localization/en-US/Mods.CalamityMod.Condition.hjson index d7a27389e1..40b195b93b 100644 --- a/Localization/en-US/Mods.CalamityMod.Condition.hjson +++ b/Localization/en-US/Mods.CalamityMod.Condition.hjson @@ -42,7 +42,6 @@ Drops: { DownedT2AR: After defeating the second tier of Acid Rain FirstKill: Drops only on the first kill MechBoss: Drops on the first kill of the final Mechanical Boss - ProvidenceEnraged: Drops if Providence has been enraged ProvidenceChallenge: ''' Drops if Providence was defeated only with the [i:CalamityMod/ProfanedSoulArtifact] Profaned Soul Artifact diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 06a46f1b90..395e594285 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1977,12 +1977,6 @@ namespace CalamityMod.NPCs.Providence return prov.challenge; }, () => Main.expertMode, DropHelper.ProvidenceChallengeText)).Add(ModContent.ItemType()); - npcLoot.AddIf(info => - { - Providence prov = info.npc.ModNPC(); - return prov.hasBeenGivenFullPower; - }, ModContent.ItemType(), 1, 4, 4, desc: DropHelper.ProvidenceEnragedText); - npcLoot.AddIf(info => { Providence prov = info.npc.ModNPC(); diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index ee239e25e2..6ba7f98fe0 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -115,8 +115,6 @@ namespace CalamityMod public static string CataclysmKilledLast = CalamityUtils.GetTextValue("Condition.Drops.CataclysmKilledLast"); public static string CatastropheKilledLast = CalamityUtils.GetTextValue("Condition.Drops.CatastropheKilledLast"); public static string CynosureText = CalamityUtils.GetTextValue("Condition.Drops.Cynosure"); - - public static string ProvidenceEnragedText = CalamityUtils.GetTextValue("Condition.Drops.ProvidenceEnraged"); public static string ProvidenceChallengeText = CalamityUtils.GetTextValue("Condition.Drops.ProvidenceChallenge"); #endregion From 16d6388778eb0a6615013767600fc8fc5e0836a3 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Sun, 28 Jun 2026 20:20:33 -0400 Subject: [PATCH 14/56] Miscellaneous pig trio fixes and changes * Divine Swine's Swinespeak sound should now properly end after it despawns upon granting Divine Meat * Divine Swine is now immune to all debuffs and resistant to all elemental typings * Fixed Horrible Hog despawning immediately on hit after being transformed from a Piggy --- NPCs/NormalNPCs/DivineSwine.cs | 28 +++++++++++-------- .../HorribleHog.AI.Transitionals.cs | 6 +--- NPCs/NormalNPCs/Piggy.cs | 13 +++------ NPCs/NormalNPCs/PiggyGold.cs | 9 ++++-- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/NPCs/NormalNPCs/DivineSwine.cs b/NPCs/NormalNPCs/DivineSwine.cs index 931bab8b93..8743051f3b 100644 --- a/NPCs/NormalNPCs/DivineSwine.cs +++ b/NPCs/NormalNPCs/DivineSwine.cs @@ -112,7 +112,9 @@ namespace CalamityMod.NPCs.NormalNPCs Main.npcFrameCount[Type] = 14; NPCID.Sets.CountsAsCritter[Type] = true; NPCID.Sets.CantTakeLunchMoney[Type] = true; - NPCID.Sets.NormalGoldCritterBestiaryPriority.Insert(NPCID.Sets.NormalGoldCritterBestiaryPriority.IndexOf(NPCID.GoldBunny) + 3, Type); + NPCID.Sets.NormalGoldCritterBestiaryPriority.Insert(NPCID.Sets.NormalGoldCritterBestiaryPriority.IndexOf(NPCID.GoldBunny) + 1, Type); + NPCID.Sets.ImmuneToAllBuffs[Type] = true; + NPCID.Sets.ShimmerImmunity[Type] = true; } public override void SetDefaults() @@ -129,9 +131,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.DeathSound = SoundID.NPCDeath1; NPC.immortal = true; NPC.noGravity = true; - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToCold = true; - NPC.Calamity().VulnerableToSickness = true; + + NPC.Calamity().VulnerableToCold = false; + NPC.Calamity().VulnerableToElectricity = false; + NPC.Calamity().VulnerableToHeat = false; + NPC.Calamity().VulnerableToSickness = false; + NPC.Calamity().VulnerableToWater = false; } public override void OnSpawn(IEntitySource source) @@ -290,14 +295,10 @@ namespace CalamityMod.NPCs.NormalNPCs SoundEngine.PlaySound(SoundID.Item29 with { Volume = 0.1f }, NPC.Center); SoundEngine.PlaySound(IdleSound, NPC.Center); - if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out var activeSound)) - activeSound.Stop(); + if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out ActiveSound swineSpeakInstance)) + swineSpeakInstance.Stop(); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.Transform(ModContent.NPCType()); - NPC.netUpdate = true; - } + NPC.Transform(ModContent.NPCType()); } } @@ -432,6 +433,9 @@ namespace CalamityMod.NPCs.NormalNPCs GeneralParticleHandler.SpawnParticle(Main.rand.NextBool() ? meatSparkle : meatLight, true, Enums.GeneralDrawLayer.AfterNPCs); } + if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out ActiveSound swineSpeakInstance)) + swineSpeakInstance.Stop(); + // Despawn immediately afterwards. NPC.checkDead(); NPC.active = false; @@ -465,6 +469,8 @@ namespace CalamityMod.NPCs.NormalNPCs SoundEngine.PlaySound(SoundID.Item29 with { Volume = 0.1f }, NPC.Center); SoundEngine.PlaySound(IdleSound, NPC.Center); + if (SoundEngine.TryGetActiveSound(SwineSpeakSoundSlot, out ActiveSound swineSpeakInstance)) + swineSpeakInstance.Stop(); NPC.checkDead(); NPC.active = false; diff --git a/NPCs/NormalNPCs/HorribleHog/HorribleHog.AI.Transitionals.cs b/NPCs/NormalNPCs/HorribleHog/HorribleHog.AI.Transitionals.cs index 5d8522b4fe..0dd70afbc7 100644 --- a/NPCs/NormalNPCs/HorribleHog/HorribleHog.AI.Transitionals.cs +++ b/NPCs/NormalNPCs/HorribleHog/HorribleHog.AI.Transitionals.cs @@ -104,11 +104,7 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog if (SoundEngine.TryGetActiveSound(DevilsTongueSlot, out var activeSound)) activeSound.Stop(); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.Transform(ModContent.NPCType()); - NPC.netUpdate = true; - } + NPC.Transform(ModContent.NPCType()); } Animate(IdleFrame, IdleFrame, 0, false, dynamicChanges: true); diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index 86fc4b4116..20f8127463 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -168,7 +168,7 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.velocity.X *= 0.9f; NPC.rotation = 0f; - if (!SoundEngine.TryGetActiveSound(NearbySoundSlot, out _)) + if (Timer < 2 && !SoundEngine.TryGetActiveSound(NearbySoundSlot, out _)) NearbySoundSlot = SoundEngine.PlaySound(DivineSwine_SwineSpeakLoopingSound, NPC.Center, NearbySoundCallbackMethod); float lightSpawnDistance = MathHelper.Lerp(52f, 84f, Timer / 180f); @@ -211,7 +211,7 @@ namespace CalamityMod.NPCs.NormalNPCs GeneralParticleHandler.SpawnParticle(feather, manualDrawLayerOverride: Enums.GeneralDrawLayer.BeforeNPCs); } - if (Timer >= 180f && Main.netMode != NetmodeID.MultiplayerClient) + if (Timer >= 180f) { CustomPulse lightRing = new(NPC.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomRing", Vector2.One, 0f, 0f, 2f, 75); GeneralParticleHandler.SpawnParticle(lightRing); @@ -232,7 +232,6 @@ namespace CalamityMod.NPCs.NormalNPCs activeSound.Stop(); NPC.Transform(ModContent.NPCType()); - NPC.netUpdate = true; } } @@ -240,7 +239,7 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.velocity.X *= 0.9f; NPC.rotation = 0f; - if (!SoundEngine.TryGetActiveSound(NearbySoundSlot, out _)) + if (Timer < 2 && !SoundEngine.TryGetActiveSound(NearbySoundSlot, out _)) NearbySoundSlot = SoundEngine.PlaySound(HorribleHog_DevilsTongueLoopingSound, NPC.Center, NearbySoundCallbackMethod); float smokeOpacity = Utils.GetLerpValue(0f, 45f, Timer, true); @@ -264,11 +263,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (SoundEngine.TryGetActiveSound(NearbySoundSlot, out var activeSound)) activeSound.Stop(); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.Transform(ModContent.NPCType()); - NPC.netUpdate = true; - } + NPC.Transform(ModContent.NPCType()); } } diff --git a/NPCs/NormalNPCs/PiggyGold.cs b/NPCs/NormalNPCs/PiggyGold.cs index de5acee1b0..5f6978d906 100644 --- a/NPCs/NormalNPCs/PiggyGold.cs +++ b/NPCs/NormalNPCs/PiggyGold.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using CalamityMod.Items.Critters; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; +using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; @@ -16,9 +17,13 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { + Main.npcFrameCount[Type] = 8; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; + NPCID.Sets.CantTakeLunchMoney[Type] = true; + NPCID.Sets.TakesDamageFromHostilesWithoutBeingFriendly[Type] = true; NPCID.Sets.GoldCrittersCollection.Add(Type); - NPCID.Sets.NormalGoldCritterBestiaryPriority.Insert(NPCID.Sets.NormalGoldCritterBestiaryPriority.IndexOf(NPCID.GoldBunny) + 2, Type); - base.SetStaticDefaults(); + NPCID.Sets.NormalGoldCritterBestiaryPriority.Insert(NPCID.Sets.NormalGoldCritterBestiaryPriority.IndexOf(ModContent.NPCType()) + 1, Type); } public override void SetDefaults() From 717e2410dc5936a76e760ff9b73042ee00e9a539 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 29 Jun 2026 15:33:44 -0400 Subject: [PATCH 15/56] A few Boss Rush changes: * Decreased cooldown between boss spawns in tier 4 from 4 seconds to 3 * Fixed Twins only requiring killing Spazmatism to progress * Fixed DoG still using its spawn dialogue --- Events/BossRushEvent.cs | 20 ++++++++++++++++--- .../en-US/Mods.CalamityMod.NPCs.hjson | 2 +- NPCs/DevourerofGods/DevourerofGodsHead.cs | 5 ++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index ce412a01e9..48cbda15d3 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -586,12 +586,14 @@ namespace CalamityMod.Events // Cooldown and boss spawn. if (BossRushSpawnCountdown <= 0 && BossRushStage < Bosses.Count) { - // Cooldown before next boss spawns. + // Cooldown before next boss spawns. Defaults to 1 second. BossRushSpawnCountdown = 60; - // Increase cooldown post-Moon Lord. + // Cooldown increases to 3 seconds in tier 4 and 4 seconds in tier 5. if (BossRushStage >= Bosses.FindIndex(boss => boss.EntityID == NPCID.MoonLordCore)) - BossRushSpawnCountdown += 180; + BossRushSpawnCountdown += 120; + if (BossRushStage >= Bosses.FindIndex(boss => boss.EntityID == ModContent.NPCType())) + BossRushSpawnCountdown += 60; // Override the spawn countdown if specified. if (BossRushStage < Bosses.Count - 1 && Bosses[BossRushStage + 1].SpecialSpawnCountdown != -1) @@ -691,6 +693,18 @@ namespace CalamityMod.Events } } + // Both Twins must be killed to progress. + else if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer) + { + int bossType = npc.type == NPCID.Spazmatism ? NPCID.Retinazer : NPCID.Spazmatism; + if (!NPC.AnyNPCs(bossType)) + { + BossRushStage++; + CalamityUtils.KillAllHostileProjectiles(); + HostileProjectileKillCounter = 3; + } + } + // Anahita and Leviathan manually check for each other (this probably isn't necessary). else if (npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType()) { diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 9c0835999f..e21ebc6a6a 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -598,7 +598,7 @@ TownPiggy: { Techno: Techno JohnPork: John Pork Piglet: Piglet - Poogie: Poogie + Poogie: Poogie } Chat: { diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 2d45fb0d1d..fed2affc2e 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -306,10 +306,13 @@ namespace CalamityMod.NPCs.DevourerofGods public override void OnSpawn(IEntitySource source) { + // Don't display the dialogue in Boss Rush + if (BossRushEvent.BossRushActive) + return; + string key = "Mods.CalamityMod.Status.Boss.DoGSpawn"; Color messageColor = Color.Cyan; CalamityUtils.BroadcastLocalizedText(key, messageColor); - DialogueDisplaySystem.StartDialogue("Mods.CalamityMod.DevourerOfGods.Phases", NPC, 0, 120, false, new BossText()); } From 05f3812ac5e9e0913bb28ed3b710e5618a4f5563 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Mon, 29 Jun 2026 16:01:21 -0400 Subject: [PATCH 16/56] Providence star trails refactor * Completely redid the trails for Providence's HolyBurnOrb and HolyLight projectiles because they've been bringing in many reports of lag since the release of Hog Wild --- Effects/CalamityShaders.cs | 6 + Effects/ProvidenceHolyOrbTrailShader.fx | 68 ++++ Effects/ProvidenceHolyOrbTrailShader.xnb | Bin 0 -> 2444 bytes Projectiles/Boss/HolyBurnOrb.cs | 417 +++++++++++------------ Projectiles/Boss/HolyLight.cs | 151 ++++---- 5 files changed, 361 insertions(+), 281 deletions(-) create mode 100644 Effects/ProvidenceHolyOrbTrailShader.fx create mode 100644 Effects/ProvidenceHolyOrbTrailShader.xnb diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index e9ff7b8999..6c70e67afb 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -266,6 +266,9 @@ namespace CalamityMod.Effects // The swirling aura effect seen around Horrible Hog while its idling. internal static Asset HorribleHogAuraShader; + + // The shader effect for the primitive trails drawn for Providence's HolyBurnOrb/HolyLight projectiles. + internal static Asset ProvidenceHolyOrbTrailShader; #endregion #region Big E's Shaders @@ -537,6 +540,9 @@ namespace CalamityMod.Effects HorribleHogAuraShader = LoadShader("HorribleHogAuraShader"); RegisterMiscShader(HorribleHogAuraShader, "ScaryAuraPass", "HorribleHogAura"); + + ProvidenceHolyOrbTrailShader = LoadShader("ProvidenceHolyOrbTrailShader"); + RegisterMiscShader(ProvidenceHolyOrbTrailShader, "TrailPass", "ProvidenceHolyOrbTrail"); #endregion #region Loading Big E's Shaders diff --git a/Effects/ProvidenceHolyOrbTrailShader.fx b/Effects/ProvidenceHolyOrbTrailShader.fx new file mode 100644 index 0000000000..9f5c67d241 --- /dev/null +++ b/Effects/ProvidenceHolyOrbTrailShader.fx @@ -0,0 +1,68 @@ +// 29JUN2026: fryzahh +// Programmed to work under the use of SanePrimitiveRenderer. +// Never use this shader with PrimitveRenderer. + +sampler baseStreakTexture : register(s0); +sampler distortionTexture : register(s1); + +matrix uTransformMatrix; +float time; +float glowPower; +float pixelationFactor; + +struct VertexShaderInput +{ + float4 Position : POSITION0; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +struct VertexShaderOutput +{ + float4 Position : SV_POSITION; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) +{ + VertexShaderOutput output; + output.Position = mul(input.Position, uTransformMatrix); + output.Color = input.Color; + output.TextureCoordinates = input.TextureCoordinates; + return output; +} + +float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 +{ + float4 color = input.Color; + float2 coords = input.TextureCoordinates; + + // Fade out at the horizontal and vertical ends of the streak. + float horizonatalDistanceFromCenter = distance(0.5, coords.y); + float opacity = smoothstep(0.5, 0.5 - 0.486, horizonatalDistanceFromCenter); + + // Glow from the center go out. + float glow = pow(0.1 / horizonatalDistanceFromCenter, glowPower); + + float2 distortionCoords = coords + float2(time * -3.12, 0); + distortionCoords *= float2(0.25, 1); + float distortion = tex2D(distortionTexture, distortionCoords).r * 0.43; + + float2 streakCoords = coords + float2(time * -2.34, 0); + streakCoords *= float2(1.25, 1); + float4 streakMapColor = tex2D(baseStreakTexture, streakCoords + distortion); + + float4 returnColor = (streakMapColor * color * glow) * opacity; + returnColor = round(returnColor * 7) / 7; + return returnColor; +} + +technique Technique1 +{ + pass TrailPass + { + VertexShader = compile vs_2_0 VertexShaderFunction(); + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} \ No newline at end of file diff --git a/Effects/ProvidenceHolyOrbTrailShader.xnb b/Effects/ProvidenceHolyOrbTrailShader.xnb new file mode 100644 index 0000000000000000000000000000000000000000..dda2ab7acc51bea346d761e05c5b53108f9cd75e GIT binary patch literal 2444 zcmb_ePiP}m82@G_DOqtYAq|b?ppiez;X9-MW^M7mY2KQXo$MEDXbmg z&YKTIzvf!)UAx|yH{TR)$97uFh1>!^^JcNz^t!HCZi%kvTFrU0+}&>4_1DGw6=zSh zmX`|odShu@T-p(f3yX^{5tBB`5dD1i{?U_Cjb7TBaD1di@)H;NA zWS<<9>91&zZ!R}3nbMFwd!NghU@xl47^hUO_noG5P<9T4o4{8T-~^s?YTJjRX>lLc ztvWgalZ?&Z;AGw0o9w^XIW9`Gn`Nuhfqa&AQQvLZ?{>u{x-bKsQ{Y;-UiNzdtf&Ct zno=fRWi4B`3f+L z&VJi&Lb#mEznr_gn9t>x3I!U6bt-RO-O}{h`Z&Be>C0R2&NhxG`=XJ_Jy`(rcVPPx zn7_H)+x+i)&{~%h~q0#{Ycuz;VczP8x>qdkE924Z-4f~pPAw9XFtAo z5Yx_d!`u7!uvU5i=+o!2JF1 z-x))U;MG;Or(pl-_;{JfzXD!)F!$RPwx=aNSYaE{-BqkvVfzg1FKo;LJEiBM&*$S7 z=uKr~5X(KvWCJB@kWnX&fd)JczyWH7Nrzq?pbpF#kVk%sehk*6o|U?m83ob2T#NZo z`oihKJPqJS`oj5wULBwh_%nPBzS1-bfbo<5XyPyOkC;8qE%H|#Ad%pCB*r>?`?#+l z>rz%Ywlj|N(&)ULGpHKtjIH`eA}}$pQ%34oE9cQK(n3K@gzEAnm7w}FA$BA-!g zjx*J(G7js?2hT_KMn2Qv150_g1_|eYKDA`-MJ7dm6pM wcgptgj}m&W4SBDCgGkq TrailNoiseTexture { get; private set; } + public static Asset TrailDistortionTexture { get; private set; } + bool started = false; + public new string LocalizationCategory => "Projectiles.Boss"; public override string Texture => "CalamityMod/Projectiles/StarProj"; + public override void Load() + { + if (!Main.dedServ) + { + TrailNoiseTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise"); + TrailDistortionTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2"); + } + } + public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Type] = 32; - ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() { @@ -87,59 +100,6 @@ namespace CalamityMod.Projectiles.Boss Projectile.position -= (Projectile.velocity / Projectile.MaxUpdates) * (Projectile.MaxUpdates - 1); } - public override bool PreDraw(ref Color lightColor) - { - //drawn by the HolyBurnOrbDrawer system - return false; - } - public float FireWidthFunction(float completion, Vector2 pos) - { - float width; - float maxBodyWidth = 32f * Projectile.scale; - float curveRatio = 0.2f; - var positions = Projectile.oldPos.ToList(); - positions.RemoveAll(x => x == Vector2.Zero); - // Crop the tip of the trail into a conic shape. - if (completion < curveRatio) - width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; - else - width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); - - // Pulse inwards and outwards over time. - float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; - float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); - return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; - } - - public Color FireColorFunction(float completion, Vector2 pos) - { - Color mainColor = ProvUtils.GetProjectileColor(255) * 1.3f; - Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); - return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; - } - - public float FireCoreWidthFunction(float completion, Vector2 pos) - { - float width; - float maxBodyWidth = Projectile.scale * 24; - float curveRatio = 0.25f; - var positions = Projectile.oldPos.ToList(); - positions.RemoveAll(x => x == Vector2.Zero); - - if (completion < curveRatio) - width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; - else - width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); - return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; - } - - public Color FireCoreColorFunction(float completion, Vector2 pos) - { - Color mainColor = ProvUtils.GetProjectileColor(255); - Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); - Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion); - return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; - } public override void OnKill(int timeLeft) { @@ -173,191 +133,206 @@ namespace CalamityMod.Projectiles.Boss ProvUtils.ApplyDebuffs(target, 120); } - } - - public class HolyBurnOrbDrawer : ModSystem - { - public override void Load() + public float FireWidthFunction(float completion) { - On_Main.DrawProjectiles += DrawAll; + float width; + float maxBodyWidth = 36f * Projectile.scale; + float curveRatio = 0.2f; + + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 12f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 6f, pulseInterpolant); + return (width + additionalPulseWidth); } - private void DrawAll(On_Main.orig_DrawProjectiles orig, Main self) + public Color FireColorFunction(float completion) { - orig(self); - - var device = Main.instance.GraphicsDevice; - - List burnToDraw = []; - List healToDraw = []; - - - foreach (var item in Main.ActiveProjectiles) - { - if (item.type == ModContent.ProjectileType()) - burnToDraw.Add(item); - - if (item.type == ModContent.ProjectileType()) - healToDraw.Add(item); - } - - if ((healToDraw.Count() + burnToDraw.Count()) < 1) - return; - - using (Main.spriteBatch.Scope()) - { - - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - - //Burn trails - using (ProvUtils.PrimaryLease.Scope(clearColor: Color.Transparent)) - { - foreach (var item in burnToDraw) - DrawBurnOrbTrail(item); - - } - Main.spriteBatch.Draw(ProvUtils.PrimaryLease.Target, Vector2.Zero, null, Color.White * 0.75f, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - - //Heal trail - using (ProvUtils.SecondaryLease.Scope(clearColor: Color.Transparent)) - { - foreach (var item in healToDraw) - DrawHealOrbTrail(item); - - } - Main.spriteBatch.Draw(ProvUtils.SecondaryLease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - - //Main orb - foreach (var item in burnToDraw) - DrawBurnOrb(item); - foreach (var item in healToDraw) - DrawHealOrb(item); - - //Additive orb - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - foreach (var item in burnToDraw) - DrawBurnOrbAdditive(item); - foreach (var item in healToDraw) - DrawHealOrbAdditive(item); - Main.spriteBatch.End(); - } + Color mainColor = Color.Lerp(ProvUtils.GetProjectileColor(255, true) * 2f, ProvUtils.GetProjectileColor(255), 0.75f); + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; } - void DrawBurnOrbTrail(Projectile Projectile) + public override bool PreDraw(ref Color lightColor) { - if (Projectile.ModProjectile is HolyBurnOrb M) - { - var tex = GeneralParticleHandler.GetTexture(GeneralParticleHandler.particleIDsByTypes[typeof(BloomParticle)]); - var len = Math.Min(Projectile.oldPos.Length, 32); - for (var i = 0; i < len; i++) - { - Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color color = M.FireColorFunction(i / (float)len, Projectile.oldPos[i]); - var color2 = ProvUtils.GetProjectileColor(255, true); - float width = M.FireWidthFunction(i / (float)len, Projectile.oldPos[i]); - Main.spriteBatch.Draw(tex, drawPos, null, (color2 with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(tex, drawPos, null, (color with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width * 0.25f, SpriteEffects.None, 0f); - } - } - } - void DrawBurnOrb(Projectile Projectile) - { - float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); - - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4; - Color baseColor2 = ProvUtils.GetProjectileColor(255); - baseColor.A = 0; - baseColor *= lerpMult; - baseColor2 *= lerpMult; - Vector2 origin = texture.Size() / 2f; - Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult - 1) * 0.5f + 1f); - - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f); - - float upRight = MathHelper.PiOver4; - float up = MathHelper.PiOver2; - float upLeft = 3f * MathHelper.PiOver4; - float left = MathHelper.Pi; - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + // Trail drawn by the HolyBurnOrbDrawer system. + DrawBurnOrb(); + DrawBurnOrbAdditive(); + return false; } - void DrawBurnOrbAdditive(Projectile Projectile) + private void DrawBurnOrb() { - var texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, ProvUtils.GetProjectileColor(255), 0, texture.Size() * 0.5f, 1f, 0, 0f); - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); - } - void DrawHealOrbTrail(Projectile Projectile) - { - if (Projectile.ModProjectile is HolyLight M) - { - var tex = GeneralParticleHandler.GetTexture(GeneralParticleHandler.particleIDsByTypes[typeof(BloomParticle)]); - var len = Math.Min(Projectile.oldPos.Length, 32); - for (var i = 0; i < len; i++) - { - Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color color = M.FireCoreColorFunction(i / (float)len, Projectile.oldPos[i]); - var color2 = new Color(0, 25, 0); - float width = M.FireWidthFunction(i / (float)len, Projectile.oldPos[i]); - Main.spriteBatch.Draw(tex, drawPos, null, (color2 with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(tex, drawPos, null, (color with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width * 0.25f, SpriteEffects.None, 0f); - } - } - } - void DrawHealOrb(Projectile Projectile) - { - float vel = Projectile.velocity.Length() / 8; - Projectile.localAI[1] += vel; + float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); - Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Color brightGreen = new Color(54, 209, 54, 0); - Vector2 projDirection = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Vector2 halfTextureSize = drawTexture.Size() / 2f; - Color halfBrightGreen = brightGreen * 0.5f; - float timeLeftColorScale = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); - Projectile.rotation += MathHelper.ToRadians(timeLeftColorScale * 2f); - Vector2 timeLeftDrawEffect = new Vector2(0.5f, 1f) * timeLeftColorScale; - Vector2 timeLeftDrawEffect2 = new Vector2(0.5f, 1f) * timeLeftColorScale; - brightGreen *= timeLeftColorScale; - halfBrightGreen *= timeLeftColorScale; - - Vector2 position3 = projDirection + Projectile.velocity.SafeNormalize(Vector2.Zero) * Utils.GetLerpValue(0.5f, 1f, Projectile.localAI[0] / 60f, clamped: true) * 0; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4; + Color baseColor2 = ProvUtils.GetProjectileColor(255); + baseColor.A = 0; + baseColor *= lerpMult; + baseColor2 *= lerpMult; + Vector2 origin = texture.Size() * 0.5f; + Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult - 1) * 0.5f + 1f); SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.36f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.36f, spriteEffects, 0); + float upRight = MathHelper.PiOver4; + float up = MathHelper.PiOver2; + float upLeft = 3f * MathHelper.PiOver4; + float left = MathHelper.Pi; + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); } - void DrawHealOrbAdditive(Projectile Projectile) + private void DrawBurnOrbAdditive() { var texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, new Color(54, 209, 54), 0, texture.Size() * 0.5f, 1f, 0, 0f); - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, ProvUtils.GetProjectileColor(255) with { A = 0 }, 0, texture.Size() * 0.5f, 1f, 0, 0f); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 }, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); + } + } + + public class HolyBurnOrbDrawer : ModSystem + { + public static RenderTargetLease TrailPixelationLease { get; private set; } + + private List HolyBurnOrbs = []; + private List HolyLights = []; + + public override void Load() + { + GeneralDrawLayerSystem.OnBeforeProjectiles += DrawOrbTrails; + Main.QueueMainThreadAction(() => TrailPixelationLease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice, (w, h) => ( w / 2, h / 2))); + } + + public override void PostUpdateProjectiles() + { + foreach (var item in Main.ActiveProjectiles) + { + if (item.type == ModContent.ProjectileType() && !HolyBurnOrbs.Contains(item)) + HolyBurnOrbs.Add(item); + if (item.type == ModContent.ProjectileType() && !HolyLights.Contains(item)) + HolyLights.Add(item); + } + + HolyBurnOrbs.RemoveAll(p => !p.active || p.timeLeft <= 1); + HolyLights.RemoveAll(p => !p.active || p.timeLeft <= 1); + } + + private void DrawOrbTrails() + { + if ((HolyBurnOrbs.Count + HolyLights.Count) > 0) + { + using (Main.spriteBatch.Scope()) + { + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + using (TrailPixelationLease.Scope(clearColor: Color.Transparent)) + { + foreach (var item in HolyBurnOrbs) + DrawBurnOrbTrail(item); + + foreach (var item in HolyLights) + DrawHealOrbTrail(item); + } + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + + // Redraw at double scale to pixelate the trails. + Main.spriteBatch.Draw(TrailPixelationLease.Target, Vector2.Zero, null, Color.White with { A = 0 }, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + + Main.spriteBatch.End(); + } + } + } + + private static void DrawBurnOrbTrail(Projectile Projectile) + { + if (Projectile.ModProjectile is HolyBurnOrb orb) + { + Matrix projection = Matrix.CreateOrthographicOffCenter(0, Main.screenWidth, Main.screenHeight, 0, -200f, 200f); + Vector2 basePosition = Projectile.Center - Main.screenPosition; + Rectangle screenBounds = new Rectangle(-40, -40, Main.screenWidth + 40, Main.screenHeight + 40); + if (screenBounds.Contains(basePosition.ToPoint())) + { + List path = []; + for (var i = 0; i < Projectile.oldPos.Length; i++) + { + Vector2 trailDrawPosition = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition; + path.Add(new Vector3(trailDrawPosition.X, trailDrawPosition.Y, 0f)); + } + + if (path.Count > 2 && Projectile.ai[0] > 6) + { + Effect shader = CalamityShaders.ProvidenceHolyOrbTrailShader.Value; + shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly); + shader.Parameters["glowPower"].SetValue(1.48f); + shader.Parameters["pixelationFactor"].SetValue(Main.ScreenSize.ToVector2() * 0.25f); + + Main.graphics.GraphicsDevice.Textures[0] = HolyBurnOrb.TrailNoiseTexture.Value; + Main.graphics.GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap; + Main.graphics.GraphicsDevice.Textures[1] = HolyBurnOrb.TrailDistortionTexture.Value; + Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap; + + using var shaderScope = SanePrimitiveRenderer.BeginShaderScope(shader, Matrix.Identity, Matrix.Identity, projection); + using var trailMesh = TriangleStripBuilder.BuildStripPooled(path, progress => orb.FireWidthFunction(progress), progress => orb.FireColorFunction(progress), PrimitiveMeshCache.Shared, textured: true); + shaderScope.Draw(trailMesh.View); + } + } + } + } + + private static void DrawHealOrbTrail(Projectile Projectile) + { + if (Projectile.ModProjectile is HolyLight light) + { + Matrix projection = Matrix.CreateOrthographicOffCenter(0, Main.screenWidth, Main.screenHeight, 0, -200f, 200f); + Vector2 basePosition = Projectile.Center - Main.screenPosition; + Rectangle screenBounds = new Rectangle(-40, -40, Main.screenWidth + 40, Main.screenHeight + 40); + if (screenBounds.Contains(basePosition.ToPoint())) + { + List path = []; + for (var i = 0; i < Projectile.oldPos.Length; i++) + { + Vector2 trailDrawPosition = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition; + path.Add(new Vector3(trailDrawPosition.X, trailDrawPosition.Y, 0f)); + } + + if (path.Count > 2 && Projectile.ai[0] > 6) + { + Effect shader = CalamityShaders.ProvidenceHolyOrbTrailShader.Value; + shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly); + shader.Parameters["glowPower"].SetValue(1.22f); + shader.Parameters["pixelationFactor"].SetValue(Main.ScreenSize.ToVector2() * 0.25f); + + Main.graphics.GraphicsDevice.Textures[0] = HolyLight.TrailNoiseTexture.Value; + Main.graphics.GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap; + Main.graphics.GraphicsDevice.Textures[1] = HolyLight.TrailDistortionTexture.Value; + Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap; + + using var shaderScope = SanePrimitiveRenderer.BeginShaderScope(shader, Matrix.Identity, Matrix.Identity, projection); + using var trailMesh = TriangleStripBuilder.BuildStripPooled(path, progress => light.FireWidthFunction(progress), progress => light.FireColorFunction(progress), PrimitiveMeshCache.Shared, textured: true); + shaderScope.Draw(trailMesh.View); + } + } + } } } } diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 71fcbfaa70..67e02c7cf7 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -1,13 +1,10 @@ using System; -using System.Linq; using CalamityMod.Dusts; using CalamityMod.Enums; -using CalamityMod.NPCs.Providence; using CalamityMod.Particles; -using CalamityMod.Utilities.Daybreak; -using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -18,13 +15,27 @@ namespace CalamityMod.Projectiles.Boss { public class HolyLight : ModProjectile, ILocalizedModType { + public static Asset TrailNoiseTexture { get; private set; } + public static Asset TrailDistortionTexture { get; private set; } + public new string LocalizationCategory => "Projectiles.Boss"; public override string Texture => "CalamityMod/Projectiles/StarProj"; + + public override void Load() + { + if (!Main.dedServ) + { + TrailNoiseTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/EternityStreak"); + TrailDistortionTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise"); + } + } + public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Type] = 32; - ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 16; + ProjectileID.Sets.TrailingMode[Type] = 0; } + public override void SetDefaults() { Projectile.localAI[1] = Main.rand.NextFloat(30f); @@ -85,60 +96,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override bool PreDraw(ref Color lightColor) - { - //drawn by the HolyBurnOrbDrawer system - return false; - } - public float FireWidthFunction(float completion, Vector2 pos) - { - float width; - float maxBodyWidth = 32f * Projectile.scale; - float curveRatio = 0.2f; - var positions = Projectile.oldPos.ToList(); - positions.RemoveAll(x => x == Vector2.Zero); - // Crop the tip of the trail into a conic shape. - if (completion < curveRatio) - width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; - else - width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); - - // Pulse inwards and outwards over time. - float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; - float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); - return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; - } - - public Color FireColorFunction(float completion, Vector2 pos) - { - Color mainColor = new Color(54, 209, 54) * 1.3f; - Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); - return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; - } - - public float FireCoreWidthFunction(float completion, Vector2 pos) - { - float width; - float maxBodyWidth = Projectile.scale * 24; - float curveRatio = 0.25f; - var positions = Projectile.oldPos.ToList(); - positions.RemoveAll(x => x == Vector2.Zero); - - if (completion < curveRatio) - width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; - else - width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); - return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; - } - - public Color FireCoreColorFunction(float completion, Vector2 pos) - { - Color mainColor = new Color(54, 209, 54); - Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); - Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion); - return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; - } - public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14 with { Pitch = -0.3f, Volume = 0.7f }, Projectile.Center); @@ -162,5 +119,79 @@ namespace CalamityMod.Projectiles.Boss dust.noLightEmittence = true; } } + + public float FireWidthFunction(float completion) + { + float width; + float maxBodyWidth = 56f * Projectile.scale; + float curveRatio = 0.2f; + + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth); + } + + public Color FireColorFunction(float completion) + { + Color mainColor = new Color(54, 209, 54) * 1.3f; + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } + + public override bool PreDraw(ref Color lightColor) + { + // Trail drawn by the HolyBurnOrbDrawer system. + DrawHealOrb(); + DrawHealOrbAdditive(); + return false; + } + + private void DrawHealOrb() + { + float vel = Projectile.velocity.Length() / 8; + Projectile.localAI[1] += vel; + + Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Color brightGreen = new Color(54, 209, 54, 0); + Vector2 projDirection = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Vector2 halfTextureSize = drawTexture.Size() / 2f; + Color halfBrightGreen = brightGreen * 0.5f; + float timeLeftColorScale = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); + Projectile.rotation += MathHelper.ToRadians(timeLeftColorScale * 2f); + Vector2 timeLeftDrawEffect = new Vector2(0.5f, 1f) * timeLeftColorScale; + Vector2 timeLeftDrawEffect2 = new Vector2(0.5f, 1f) * timeLeftColorScale; + brightGreen *= timeLeftColorScale; + halfBrightGreen *= timeLeftColorScale; + + Vector2 position3 = projDirection + Projectile.velocity.SafeNormalize(Vector2.Zero) * Utils.GetLerpValue(0.5f, 1f, Projectile.localAI[0] / 60f, clamped: true) * 0; + + SpriteEffects spriteEffects = SpriteEffects.None; + if (Projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.36f, spriteEffects, 0); + } + + private void DrawHealOrbAdditive() + { + var texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, new Color(54, 209, 54) with { A = 0 }, 0, texture.Size() * 0.5f, 1f, 0, 0f); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 }, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); + } } } From 873edd1dba2ddfe9598bde27d408a61f528e5d73 Mon Sep 17 00:00:00 2001 From: sunny-raindrops Date: Mon, 29 Jun 2026 14:45:00 -0700 Subject: [PATCH 17/56] Minor cleanup --- ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 4 ++-- Projectiles/Melee/OblivionFire.cs | 11 ++++++--- Projectiles/Melee/Yoyos/OblivionYoyo.cs | 24 +++++++++---------- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 1ff605dc1c..a717d882de 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -921,8 +921,8 @@ Oblivion: { {$Common.YoyoStats} A hightly unstable yoyo that slowly releases homing brimstone hellblasts Enemy hits with the yoyo charge its power, greatly increasing the fire rate of the hellblasts - At maximum power, the yoyo bursts into brimstone darts and resets its flight duration - Striking an enemy at maximum power will overload the yoyo, causing it to release all stored up power and shatter + At maximum charge, the yoyo bursts into brimstone darts and resets its flight duration + Striking an enemy at maximum charge will overload the yoyo, causing it to release all stored up power and shatter Shattering the yoyo deals immense damage but leaves it unable to be used for several seconds [c/C61B40:'I have memories from eyes that are not my own'] ''' diff --git a/Projectiles/Melee/OblivionFire.cs b/Projectiles/Melee/OblivionFire.cs index f67af50a7f..5d0da2e33e 100644 --- a/Projectiles/Melee/OblivionFire.cs +++ b/Projectiles/Melee/OblivionFire.cs @@ -14,6 +14,11 @@ namespace CalamityMod.Projectiles.Melee public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public ref float Time => ref Projectile.ai[0]; + public override void SetStaticDefaults() + { + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + } + public override void SetDefaults() { Projectile.width = 8; @@ -31,14 +36,14 @@ namespace CalamityMod.Projectiles.Melee { Time++; if (Time >= 100f) - CalamityUtils.HomeInOnNPC(Projectile, false, 300, 2.5f, 10f, true); + CalamityUtils.HomeInOnNPC(Projectile, false, 300, 2.5f, 20f, true); CalamitasMetaball.SpawnParticle(Projectile.Center + Projectile.velocity, Main.rand.NextVector2Circular(2, 2), 16f); } public override bool? CanDamage() => Time >= 45f; - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 300); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/Projectiles/Melee/Yoyos/OblivionYoyo.cs b/Projectiles/Melee/Yoyos/OblivionYoyo.cs index 52073ed362..9be08ffd19 100644 --- a/Projectiles/Melee/Yoyos/OblivionYoyo.cs +++ b/Projectiles/Melee/Yoyos/OblivionYoyo.cs @@ -59,7 +59,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { var player = Main.player[Projectile.owner]; - //Yoyo glove is stupid and dumb and smells bad //Using yoyo glove or yoyo bag makes yoyos run out of air time 2-4x faster (randomized) when the second yoyo is out //Therefore, we set the flight to infinite, but manually set it to recall after 15 seconds and update it across both yoyos if (time >= 1800) @@ -226,6 +225,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { + target.AddBuff(ModContent.BuffType(), 300); //Only applies to the main yoyo if (!cloneYoyo) { @@ -243,9 +243,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos if (hitCounter == hitCountMax) { //Refresh duration on both yoyos - if(!cloneYoyo) - { - for (int i = 0; i < Main.maxProjectiles; i++) + for (int i = 0; i < Main.maxProjectiles; i++) { Projectile p = Main.projectile[i]; if (p.active && p.type == Type && p.owner == Projectile.owner) @@ -256,7 +254,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos } } } - } //Start a 1.5 second grace period where the yoyo cannot damage enemies. This is to avoid instant shattering after reaching max power graceTimer = 90; //Small burst and a ring of darts @@ -306,19 +303,18 @@ namespace CalamityMod.Projectiles.Melee.Yoyos //If the yoyo hits while at maximum, reset the duration of both yoyos and trigger shattering if (hitCounter > hitCountMax && !shatter) { + Player Owner = Main.player[Projectile.owner]; SoundEngine.PlaySound(SoundID.DD2_EtherianPortalDryadTouch with { Volume = 4f }, Projectile.Center); + Owner.SetScreenshake(3f); shatter = true; - if (!cloneYoyo) + for (int i = 0; i < Main.maxProjectiles; i++) { - for (int i = 0; i < Main.maxProjectiles; i++) + Projectile p = Main.projectile[i]; + if (p.active && p.type == Type && p.owner == Projectile.owner) { - Projectile p = Main.projectile[i]; - if (p.active && p.type == Type && p.owner == Projectile.owner) + if (p.ModProjectile is OblivionYoyo oblivion) { - if (p.ModProjectile is OblivionYoyo oblivion) - { - oblivion.time = 0; - } + oblivion.time = 0; } } } @@ -326,6 +322,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos } } + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); + //During the grace period after reaching max power, the yoyo cannot hit enemies for 1.5s to avoid unfair shattering public override bool? CanDamage() => graceTimer == 0; From d3d05082145e14c0a2cb0d404aba226576a6a385 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Mon, 29 Jun 2026 21:44:40 -0400 Subject: [PATCH 18/56] Teleportation Potion Abyss avoidance rewrite * Rewrote the logic for finding a new teleportation spot for the player whenever a Teleportation Potion is drank and finds a location in the Abyss. The old logic simply copy-pasted the Vanilla Teleportation Potion logic and thus still had a chance to send the player to the Abyss. This new logic actively avoids the horizontal slice of the world where the Abyss is located and should nullify any chance of being teleported there naturally. --- ILEditing/MechanicILChanges.cs | 92 ++++++++++++++++++++++++++++++---- 1 file changed, 83 insertions(+), 9 deletions(-) diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index f7466891f6..b01544e1ca 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -30,6 +30,7 @@ using CalamityMod.Tiles; using CalamityMod.Utilities.Daybreak; using CalamityMod.Walls; using CalamityMod.Walls.UnsafeWalls; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Mono.Cecil.Cil; @@ -1118,19 +1119,92 @@ namespace CalamityMod.ILEditing { // If an Abyss wall is detected, try to find another teleportation location bool canSpawn = false; - int teleportStartX = 100; + int halfWorldWidth = Main.maxTilesX / 2; + + int teleportStartX = Abyss.AtLeftSideOfWorld ? halfWorldWidth - (halfWorldWidth - 175) + 35 : halfWorldWidth + (halfWorldWidth - 175) - 35; int teleportRangeX = Main.maxTilesX - 200; int teleportStartY = 100; - int underworldLayer = Main.UnderworldLayer; - Vector2 newerPos = self.CheckForGoodTeleportationSpot(ref canSpawn, teleportStartX, teleportRangeX, teleportStartY, underworldLayer, new Player.RandomTeleportationAttemptSettings + int teleportRangeY = Main.UnderworldLayer; + + int attempts = 0; + int maxAttempts = 1000; + int teleportPositionX = 0; + int teleportPositionY = 0; + Vector2 teleportPosition = new Vector2(teleportPositionX, teleportPositionY) * 16f - new Vector2(self.width * 0.5f + 8, self.height); + while (!canSpawn && attempts < maxAttempts) { - avoidLava = true, - avoidHurtTiles = true, - maximumFallDistanceFromOrignalPoint = 100, - attemptsBeforeGivingUp = 1000 - }); + attempts++; + + if (Abyss.AtLeftSideOfWorld) + teleportPositionX = teleportStartX + Main.rand.Next(teleportRangeX); + else + teleportPositionX = teleportStartX - Main.rand.Next(teleportRangeX); + teleportPositionY = teleportStartY + Main.rand.Next(teleportRangeY); + + teleportPositionX = MathHelper.Clamp(teleportPositionX, 5, Main.maxTilesX - 5); + teleportPositionY = MathHelper.Clamp(teleportPositionY, 5, Main.maxTilesY - 5); + teleportPosition = new Vector2(teleportPositionX, teleportPositionY) * 16f - new Vector2(self.width * 0.5f + 8, self.height); + + if (Collision.SolidCollision(teleportPosition, self.width, self.height)) + continue; + + Tile tile = Framing.GetTileSafely(new Point(teleportPositionX, teleportPositionY)); + bool behindTempleWalls = tile.WallType == WallID.LihzahrdBrickUnsafe && teleportPositionY > Main.worldSurface && !NPC.downedPlantBoss; + bool behindDungeonWalls = Main.wallDungeon[tile.WallType] && teleportPositionY > Main.worldSurface && !NPC.downedBoss3; + if (behindTempleWalls || behindDungeonWalls) + continue; + + int distanceToGround = 0; + int maxFallDistance = 100; + while (distanceToGround < maxFallDistance) + { + Tile groundTile = Framing.GetTileSafely(new Point(teleportPositionX, teleportPositionY + distanceToGround)); + teleportPosition = new Vector2(teleportPositionX, teleportPositionY + distanceToGround) * 16f - new Vector2(self.width * 0.5f + 8, self.height); + Collision.SlopeCollision(teleportPosition, self.velocity, self.width, self.height, self.gravDir); + if (!Collision.SolidCollision(teleportPosition, self.width, self.height)) + { + distanceToGround++; + continue; + } + + if (groundTile.HasUnactuatedTile && Main.tileSolid[groundTile.TileType]) + break; + + distanceToGround++; + } + + teleportPosition.Y -= 16f; + bool inLava = Collision.LavaCollision(teleportPosition, self.width, self.height); + bool onHurtingTile = Collision.AnyHurtingTiles(teleportPosition, self.width, self.height); + bool insideBlocks = Collision.SolidCollision(teleportPosition, self.width, self.height); + bool reachedMaxFallDistance = distanceToGround >= maxFallDistance; + if (inLava || onHurtingTile || insideBlocks || reachedMaxFallDistance) + continue; + + Vector2 checkDirection = Vector2.UnitX * 16f; + if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) != checkDirection) + continue; + + checkDirection = Vector2.UnitX * -16f; + if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) != checkDirection) + continue; + + checkDirection = Vector2.UnitY * 16f; + if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) == checkDirection) + { + checkDirection = Vector2.UnitY * -16f; + if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) == checkDirection) + { + canSpawn = true; + teleportPositionY += distanceToGround; + teleportPosition = new Vector2(teleportPositionX, teleportPositionY) * 16f - new Vector2(self.width * 0.5f + 8, self.height); + break; + } + } + } + // Attempt teleporting again with the new location - orig(self, newerPos, Style, extraInfo); + orig(self, teleportPosition, Style, extraInfo); } else { From 2050728628ec95c5aba41d713cbd67cb24a3c333 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Mon, 29 Jun 2026 22:06:52 -0400 Subject: [PATCH 19/56] Cleanup * Removed PrimaryLease and SecondaryLease from ProvUtils as they no longer do anything * Made HolyBurnOrb load a glow texture it uses for drawing on load instead of requesting it every frame --- NPCs/Providence/Providence.cs | 8 -------- Projectiles/Boss/HolyBurnOrb.cs | 7 ++++--- Projectiles/Boss/HolyLight.cs | 2 +- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 7bbc1a0e1c..eafcbd03ef 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -2873,14 +2873,6 @@ namespace CalamityMod.NPCs.Providence // These will be used for almost every single one of her projectiles, so it's useful to have. public static class ProvUtils { - /// - /// This lease should be used to draw all of a projectile's effects onto directly, then be drawn onto the screen as one. This is for opacity reasons - /// - public static RenderTargetLease PrimaryLease { get => field ??= ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); set; } - /// - /// This should be used for secondary effects like trails, then drawn to PrimaryLease. This is for opacity reasons. - /// - public static RenderTargetLease SecondaryLease { get => field ??= ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); set; } public static bool StandardAI() => (CalamityGlobalNPC.holyBoss == -1 || !Main.npc[CalamityGlobalNPC.holyBoss].Calamity().CurrentlyEnraged) && !Main.zenithWorld; public static int CalculateProvidenceDamage(this int damage) diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 5e6bf93e07..23e4f306fa 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Boss { public static Asset TrailNoiseTexture { get; private set; } public static Asset TrailDistortionTexture { get; private set; } + public static Asset GlowOrbTexture { get; private set; } bool started = false; @@ -34,6 +35,7 @@ namespace CalamityMod.Projectiles.Boss { TrailNoiseTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise"); TrailDistortionTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2"); + GlowOrbTexture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle"); } } @@ -203,9 +205,8 @@ namespace CalamityMod.Projectiles.Boss private void DrawBurnOrbAdditive() { - var texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, ProvUtils.GetProjectileColor(255) with { A = 0 }, 0, texture.Size() * 0.5f, 1f, 0, 0f); - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 }, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); + Main.EntitySpriteDraw(GlowOrbTexture.Value, Projectile.Center - Main.screenPosition, null, ProvUtils.GetProjectileColor(255) with { A = 0 }, 0, GlowOrbTexture.Size() * 0.5f, 1f, 0, 0f); + Main.EntitySpriteDraw(GlowOrbTexture.Value, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 }, 0, GlowOrbTexture.Size() * 0.5f, 0.5f, 0, 0f); } } diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 67e02c7cf7..67efa567fa 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -189,7 +189,7 @@ namespace CalamityMod.Projectiles.Boss private void DrawHealOrbAdditive() { - var texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; + Texture2D texture = HolyBurnOrb.GlowOrbTexture.Value; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, new Color(54, 209, 54) with { A = 0 }, 0, texture.Size() * 0.5f, 1f, 0, 0f); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 }, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); } From 3848aa640049f83fedee87d05f69aa0a6fff174e Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Tue, 30 Jun 2026 01:30:05 -0500 Subject: [PATCH 20/56] the zarachard --- Items/Accessories/Wings/TiredTail.cs | 62 +----------------- Items/Accessories/Wings/TiredTail.png | Bin 557 -> 697 bytes Items/Accessories/Wings/TiredTailPallette.png | Bin 1005 -> 1106 bytes Items/Accessories/Wings/TiredTailSegment.png | Bin 520 -> 546 bytes Items/Accessories/Wings/TiredTailTail.png | Bin 564 -> 602 bytes 5 files changed, 2 insertions(+), 60 deletions(-) diff --git a/Items/Accessories/Wings/TiredTail.cs b/Items/Accessories/Wings/TiredTail.cs index fe31ed2a38..a1ffa7f8b8 100644 --- a/Items/Accessories/Wings/TiredTail.cs +++ b/Items/Accessories/Wings/TiredTail.cs @@ -165,10 +165,10 @@ namespace CalamityMod.Items.Accessories.Wings } var rotation = destinationOffset.ToRotation(); - var center = nextCent - destinationOffset.SafeNormalize(Vector2.Zero) * (12 * 1); + var center = nextCent - destinationOffset.SafeNormalize(Vector2.Zero) * (14 * 1); if (i == tailPos.Count - 1) { - center = nextCent - destinationOffset.SafeNormalize(Vector2.Zero) * (22 * 1); + center = nextCent - destinationOffset.SafeNormalize(Vector2.Zero) * (21 * 1); } tailPos[i] = new(center, rotation); } @@ -296,64 +296,6 @@ namespace CalamityMod.Items.Accessories.Wings protected override void Draw(ref PlayerDrawSet drawInfo) { - ArmorPallettes = - [ - //silva - ([ItemType(),ItemType()], - [ItemType()], - [ItemType()], - ColorPallettes[2]), - //god slayer - ([ItemType(),ItemType(),ItemType()], - [ItemType()], - [ItemType()], - ColorPallettes[3]), - //hydro - ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], - [ItemType()], - [ItemType()], - ColorPallettes[4]), - //auric - ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], - [ItemType()], - [ItemType()], - ColorPallettes[5]), - //fearmonger - ([ItemType()], - [ItemType()], - [ItemType()], - ColorPallettes[6]), - //Bloodlfare - ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], - [ItemType()], - [ItemType()], - ColorPallettes[7]), - //Tarragon - ([ItemType(),ItemType(),ItemType(),ItemType(),ItemType()], - [ItemType()], - [ItemType()], - ColorPallettes[8]), - //Omega Blue - ([ItemType()], - [ItemType()], - [ItemType()], - ColorPallettes[9]), - //Gem Tech - ([ItemType()], - [ItemType()], - [ItemType()], - ColorPallettes[10]), - //Demonshade - ([ItemType()], - [ItemType()], - [ItemType()], - ColorPallettes[11]), - //Prismatic - ([ItemType()], - [ItemType()], - [ItemType()], - ColorPallettes[12]) - ]; var player = drawInfo.drawPlayer; var modplayer = drawInfo.drawPlayer.GetModPlayer(); var tex1 = Request("CalamityMod/Items/Accessories/Wings/TiredTailSegment").Value; diff --git a/Items/Accessories/Wings/TiredTail.png b/Items/Accessories/Wings/TiredTail.png index 2f0bacd764022998fa394efd25f851832554984c..5f61600e97fc0e6f8939841ee812350517391139 100644 GIT binary patch delta 456 zcmZ3>vXga!IF}X&GXn#|Q~Q+*CMqh_+XVQ8xW)vRp56UUC%kX<%ro*bjyA?&n_pg! z$X-;IH$8d#otMkjaLFg!Nt@L*^HyZ%aam>Uf{LbHhtIqFg#!(`y0M)NNQsmL`33*S z1PuQE&jo?dgtJ#QiySR3u7`L*=Z z*1y~eE2dntp2(CuMd{Kn3x_qe+&zWoehWA;I8Jg^IUtetKDlS221|BlQj7~zkkrG^ zDn@J%Y{Vxr#1yp6H9q!xj^jPXwVm}vX=!dk&*pSKNe~d38sxQ?+2Frc5W}0jeaTzW zw#dbBrA_>?)Nt|x#tqeM%00{7A~Qr7HW#03Ji)-0YLdmYMB@JW1Y5BK&yDrWC*9F> zQD`wVxVJv>Zjeobr-9M6X-1r%WrZ6ZFBoL6&z@-h;N1+T&DnQ5Wxm9nD%~39wRY`a oCH^n>qSjXb&}F!(ugPHlSJ000X!3p^U|=zLy85}Sb4q9e0RA+>(f|Me delta 289 zcmdnVx|U^vIF}d)GXn#|wD!ERiHZuYDgizruJSUDn_pf}-hRi`IzF=Vcv;@`)icl7 z7>B)Fw&qUSteD_ZpoWxfIr2b?rzFTP_&)+L2;Dz-ZsM|T&Shnc3@?BtFPm(|7+=rI zHs#dLz^ZJZjwzlljv*SsQzr%T9Z}$L30%os_5XJsTbB9n;JcnHboZPP&@xt8So8nt z+&c_PORsn>X#K|;6};DJ?b^?`^Y{&JS}V`L&br~LQ7zYunSw9prV2*+-Bx#)cJ|I? zrGV90Z6_oz?A~2{D~0=N&+?<%3?HJVtuPca^;9@^hpCupX^NnPVgq+g*+$kM2N%w8 j%Ful!bK_r8{sH#vb%J|$`vlel9mwG6>gTe~DWM4f56peE diff --git a/Items/Accessories/Wings/TiredTailPallette.png b/Items/Accessories/Wings/TiredTailPallette.png index 9951e8cd5af02487ada4b84538e1b805f6e80fff..2b56a72cb41bd33067421486dd648ed6e3833b7e 100644 GIT binary patch delta 862 zcmV-k1EKuw2hs>3iBL{Q4GJ0x0000DNk~Le0000G0000W2m$~A0F>)*n~@=?36gdJ z0O$h%0Fsf?Uw;NRn0mT=93lV!0|7}yK~y+T?UP+>Qw0>qf49AM?d|t>@4dZkZ`YM> zySBEaD6+|d%o$)wUkF6;Wi!6{;1`LB8Xt5f7|eV!F~Q)gAw=cL_+%t8lPv_tL(w>d zu7!QTWQ8qkUFSog&-0ys&eQql_dhu&If5+9ilR6i4u3^aWLeH;vxZ^p-u)HyLiBOP z-#{or5k!kQVT@9|%YHOqxc?}uMIhkSszzP0pc zeaRWn=T`5!TX$w0mo?8?_tl%nhppVAP!s{xdh&vFt`HK{(n&Gw(}9-L3uyPf!PVY9 z)$Ylaw|^Gq-v*Q)6u{IHPcI!_{7ae8Byp`V3z&RGptd}_Wvy0R#{Kn$`T8kfK2ilD z&4HooH^#lyNPIv@M>HU*1c9-vRLI+cYvu7V>4rK7of zFbx!VaDG9@X5Z$4=(F4g6wfX|GOgGf_kzoRSLM2E)B)79USL3uPJe!_eqz&{drt^> z<<11j?r?eiVO3uKW5eXk1Cnk4&iy?f-6@{_j&r{a3J!-8I5ct?cs4qi*_S#n`ofo~ z*ME-J4gv9ZV(qL--_ela@g=?xyrF1kLQ)G`Hi_%;?WrsMW)T>Yt-xTZblyL`FYXHa z{t?_R7m$d@+e|Exkk!Q8)STM)F;HH20_8~TNM>Rqz1TgnDTJT00o&e3$2B`WPHWdn z?S@Uu11(8y_xsjb^aLXEsG$0D9Y9aN6!7P;`%eA5 z+LJm4+&cr{HuyAMYn)J1V+gPA)jGf{2Ry^2Su!8w%d>Ouehobv42gv{c0-Q-iK~yMHjgsw46LB2CzrWqq?ryuy+rw?Q+wFGe zrqj*MZJL_QS!RYcl0Z^40t<`4S0V&GyeeM=iuI}o3wv88VGkg^sPG9*B7?#gg-Xqu zq)wM&Q+K_P-uvP6;`0Z55X-VQn=SmGdqqWIfL#%U0e@NnT9w(h2!RtDOZso0GX{Vm z`@vLO=cM0U7ux!Ib(pF&06fJu0c~J-ibgBkV!}C`HIZy)MjG>m!b0K5=v^i_ZLO@v zB%uV;(IOZ*s<2d1_3F)_Pu~%Z$1n}iI;Os(t>DaNj3Uw*+LTUy068h^Hb0KPmGCbv z_CAsQnxvn!yL`xXuTKxdP`xvD{ovFQ)anD!``|`SJVDjWxmp04%J`--{^jL@^fO4$T=9BN5WRA) qEX%U2x-^w5%S5k?_Hw2I_P{@U*VLg^68f?L0000ERLtq(y*OjDs0SexL7SGEq?>(m22;#Fc>|+1}os zf#H8-WF!Ma4+Fyk28I9v)5S4FBe?eBMXm!19IOFrr%j9g_CMY_uh}r7G`>rCk?2?d zj*ery9MjSk2{ZCWdL}DYamCha z2dZ6^r!1EIrd`6WJb&V{8@qS^e*Z4mrQk#Lc}=^U|1R>{BnbGnuG2ctzzuYur>mdK II;Vst0Bojlj{pDw delta 248 zcmZ3)(!rwG8Q|y6%O%Cdz`(%k>ERLtqy>OjjDs0S{wsOoH&Ic+Q$4^Z#5Ik9!PwaN zKLf+enKRD-Nd|^9XMi+F04O6VDVdfARKoCc;q_NQink=lFZe$aV6c6m)HZR}zxr%X z7sn8d;L;0@T+W6ZECK4mrc&?g?S#bt4$8JvoX)@l3&I*7s3)z4*}QvzcX0KTkX+yDRo diff --git a/Items/Accessories/Wings/TiredTailTail.png b/Items/Accessories/Wings/TiredTailTail.png index f1f10c2e9a1c1f6d20e9f8df31b8fd39605eeba3..768b71bc8e815661dc901e7fd508d9e7f32bf982 100644 GIT binary patch delta 330 zcmdnOa*IW=Gr-TCmrII^fq{Y7)59eQNGk!c6bCbqe7d2|V4|Wzs6l{Fh${m_vc0`M z1H*p?h6fA`Jw-)D3=At4ELad38EI^6dxG@7R_o3)3POT`N0rMt%+7jkl-xSYaQE_- zOXA%Vuen6MuD!j%sJPxnEV5ldeQ&?vF(;*WXDmFf&Y78fglE0`BKNIMN})>*ma1`0 z*xc`Sko(Aqjf@&wu0@63HB3^s-KBE>@B`y}x_g|(ep}AyVBq|ta{USG1y{MVdl|Pa P26@rb)z4*}Q$iB}Nd1Rs delta 292 zcmcb`vV}#lGr-TCmrII^fq{Y7)59eQNGkxb7zZB9|G|Nnbu9p0wJud?Rc+A1vRl)CGP===SjwTVNw{jG4r(|gtC+}#f6wz_r9 zVO*7#mN;2AtG6O*4->=s)J`eo2@Ex7bPd!e1nG)2K4jW)AYDAVL0+aybH}ws=NjMY de`l*XIK#CxEVJ@O1TaS?83{1OU*ncHIB~ From 3160cdbd05a1ec05454fdbaa876e0bd17756f3bc Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Tue, 30 Jun 2026 02:18:42 -0500 Subject: [PATCH 21/56] done --- Items/Accessories/Wings/TiredTail.cs | 14 +++++++------- Items/Accessories/Wings/TiredTailPallette.png | Bin 1106 -> 1112 bytes 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Items/Accessories/Wings/TiredTail.cs b/Items/Accessories/Wings/TiredTail.cs index a1ffa7f8b8..e444e4676f 100644 --- a/Items/Accessories/Wings/TiredTail.cs +++ b/Items/Accessories/Wings/TiredTail.cs @@ -36,7 +36,6 @@ namespace CalamityMod.Items.Accessories.Wings [AutoloadEquip(EquipType.Wings)] public class TiredTail : BaseWings { - //Same stats as Starboard, but with 4 seconds flight instead of 3 public override float BonusAscentWhileFalling => 0.95f; public override float BonusAscentWhileRising => 0.15f; public override float RisingSpeedThreshold => 1f; @@ -47,9 +46,7 @@ namespace CalamityMod.Items.Accessories.Wings public override void SetStaticDefaults() { - //Same stats as Starboard, but with 4 seconds flight instead of 3 - ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = ArmorIDs.Wing.Sets.Stats[(int)VanillaWingID.LongRainbowTrailWings]; - ArmorIDs.Wing.Sets.Stats[Item.wingSlot].FlyTime = CalamityUtils.SecondsToFrames(4); + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(210, 9f, 3.25f, true, 16, 10f); } public override void SetDefaults() @@ -68,13 +65,11 @@ namespace CalamityMod.Items.Accessories.Wings player.GetModPlayer().tiredTailDraw = true; if (player.velocity.Y != 0) { - - if (player.dashDelay != -1) + if (player.dashDelay != -1) //This differs from Starboard - Starboard checks for 1 full second passing after a dash begun, while this happens as soon as the dash ends player.runSlowdown *= 6; } - ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(210, 9f, 3.25f, true, 16, 10f); } public override void UpdateVanity(Player player) @@ -313,6 +308,11 @@ namespace CalamityMod.Items.Accessories.Wings break; } } + //manual override for Empyrean's transform to work + if (player.Calamity().meldTransformationPower || player.Calamity().meldTransformationForce) + { + TargetPallette = ArmorPallettes.First(x => x.heads.Contains(ItemType())).pallette; + } using var SegmentLease = RenderTargetPool.Shared.Rent(Main.instance.GraphicsDevice, tex1.Width, tex1.Height); using var TailLease = RenderTargetPool.Shared.Rent(Main.instance.GraphicsDevice, tex2.Width, tex2.Height); using (Main.spriteBatch.Scope()) diff --git a/Items/Accessories/Wings/TiredTailPallette.png b/Items/Accessories/Wings/TiredTailPallette.png index 2b56a72cb41bd33067421486dd648ed6e3833b7e..602c4336bd0730a540c6dcbbef5c741441b25121 100644 GIT binary patch delta 833 zcmV-H1HSyy2-paa$q9{i0RZR&0051V(qDfp73(vRQwPZa00Rd}L_t(IPwkUkXj=so zfWMpErOC}t^LulDa+8}hNz?V3l4PCEwp!+9Wm_Q#vZ3>(6W@IBZy>1n;3`xm^+iFL z>{-T8_aL%I1(~kMR)tJ4`$-dB+pVtITGpni58d)y-}iBz&fz9vftr#S7P5)~q_hYyk(Y`ExAffDo@dTI`Pw8P z_l=VZ=T z+d?ML+YyFxN<5>;ru^O1?*q0qz%<=Jk$Y#aVVdqD_r##%A3*c>0+MaX-MkZ7{Hvxm zeB&OVkq-dFYV6|2R~kpx?E`NM;egtiAh|uhKq#uKi zrxC&9@g5jExFtLu8_5l&_l|!*^=bO$BlQD7;>|dKYOe&Imo0zL{6q-IvCf2)5p}GS zNG3KfT)cNI1`Y>?k6hODdiEO=jR8LPJytK#Y2rusS?;o5c z_imv)TYc+mAbt#>0*)O!OZk$5+zaMAowBII=gzfN1*be^zQ{>a~KGDDI00000 LNkvXXu0mjfKfthO delta 827 zcmV-B1H}B;2+|0U$qABn0RZR&005Ga(qDfDHkf+4d>kSG00RL@L_t(IPwkUkY*Pgk z$A7oIcJ1x=ckjKuZEx3=Zo9U&r6{t=g3K9UNnZ#=@nti<`QR6ci5eetCK$|oGBLs6 zt06??$@pX>F_SF>$3xLLgsz2sz+{CjY+dI=q0jT3f6mkS=l4H3Cpm&F%Zj2n91ed) zQDj-pX0wK2?B4wq^g{G;#os_ELJ>rZIb$PeY1+&iA+edXKQx4uq;ag@2n2*!Jn!*e zi#5xIO7DkXJBNILxW2XYXMM>T(C1d~x?6W<9G5lETKCnP$A_)lqEHk8)q3)RbgmE* z)zV2Z?9+jk(+g<#y}{MqJ=N~XmA8Ku=HCXC9~8jU5>GE3Ui?d$&?IrKF$BF%xJ>o>-|)ku6mNJlgvsRV(stW?O`rI$zczIfsJHzxoo z8wARQ&9i48W)5o4MHdCh8sf3^WWOgA33Vqg{&>Z0sw*A4;kcVg|VO5f3t;qfKD5WJyiXF^g7TQ-U7@$IQA z{bmsulC8jCsdU~yy)W(x`~DH!E*Fr9$J_}!}BfZ!? zvMGe0vH{!PN5?fgJx*)aO6`VC%L6S*ZTI`uepmHO?RrIcUDtuh-gfN6{Y4ijl z@~EKta~(iWzZCH2u=`H^yxNmG2HZOX;5PU)U2B|BQ)39P?$tWLD+fHorCBl`j z?|u)&#sMl|d4DGPS@9?48HE4)ai&iE4)p}siJkyE(SLpz)tkK`eRu!>002ovPDHLk FV1k;&n>GLd From 81585f76f7996d61bf494bdfed355dcdff3c06d9 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Tue, 30 Jun 2026 02:31:53 -0500 Subject: [PATCH 22/56] rarity comments/cleanup --- Rarities/BurnishedAuric.cs | 3 ++- Rarities/CalamityRed.cs | 3 ++- Rarities/CosmicPurple.cs | 3 ++- Rarities/DarkOrange.cs | 4 +++- Rarities/ExoticRainbow.cs | 3 ++- Rarities/HotPink.cs | 11 ++--------- Rarities/PureGreen.cs | 2 +- Rarities/Turquoise.cs | 2 +- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Rarities/BurnishedAuric.cs b/Rarities/BurnishedAuric.cs index dfbc5c0a2c..add6120cf8 100644 --- a/Rarities/BurnishedAuric.cs +++ b/Rarities/BurnishedAuric.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Rarities { public class BurnishedAuric : ModRarity { - // Burnished Auric is Rarity 15 (Once was known as Violet) + // Burnished Auric is the rarity for Post-Yharon gear + // It is a unique rarity and does not have its items rarity change on reforge. public override Color RarityColor => TextClr * 2f; public static float MaxY = 4.5f; diff --git a/Rarities/CalamityRed.cs b/Rarities/CalamityRed.cs index 9ea280216b..8b9d121ac2 100644 --- a/Rarities/CalamityRed.cs +++ b/Rarities/CalamityRed.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Rarities { public class CalamityRed : ModRarity { - // Calamity Red is Rarity 17 + // Calamity Red is the rarity for Post-SCal gear. It is considered the "same tier" as Exotic Rainbow for matters of sell value. + // It is a unique rarity and does not have its items rarity change on reforge. public override Color RarityColor => TextClr * 2f; public static float MaxY = 4.5f; diff --git a/Rarities/CosmicPurple.cs b/Rarities/CosmicPurple.cs index 1c3e382f4a..d52a15a49c 100644 --- a/Rarities/CosmicPurple.cs +++ b/Rarities/CosmicPurple.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Rarities { public class CosmicPurple : ModRarity { - // Cosmic Purple is Rarity 14 (once was known as Dark Blue) + // Cosmic Purple is the rarity for Post-DoG gear. + // It is a unique rarity and does not have its items rarity change on reforge. public override Color RarityColor => TextClr * 2f; public static float MaxY = 4.5f; diff --git a/Rarities/DarkOrange.cs b/Rarities/DarkOrange.cs index 30959e183a..6526cfa05d 100644 --- a/Rarities/DarkOrange.cs +++ b/Rarities/DarkOrange.cs @@ -3,7 +3,9 @@ using Terraria.ModLoader; namespace CalamityMod.Rarities { - // Draedon's Arsenal "Rust" / "Bronze" rarity + // Dark Orange is used for Draedon's Arsenal items. + // It is a unique rarity and does not have its items rarity change on reforge. + public class DarkOrange : ModRarity { public override Color RarityColor => new Color(204, 71, 35); diff --git a/Rarities/ExoticRainbow.cs b/Rarities/ExoticRainbow.cs index cf065cc707..af47d1a2f2 100644 --- a/Rarities/ExoticRainbow.cs +++ b/Rarities/ExoticRainbow.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Rarities { public class ExoticRainbow : ModRarity { - // Exotic Rainbow is Rarity 17 (same as Calamity Red) + // Exotic Rainbow is the rarity for Post-SCal gear. It is considered the "same tier" as Calamity Red for matters of sell value. + // It is a custom rarity and does not have its items rarity change on reforge. public override Color RarityColor => TextClr * 2f; public static float MaxY = 4.5f; diff --git a/Rarities/HotPink.cs b/Rarities/HotPink.cs index 3e39b5ac17..8896ba5ad8 100644 --- a/Rarities/HotPink.cs +++ b/Rarities/HotPink.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Rarities { public class HotPink : ModRarity { - // Hot Pink is used for developer items. Has a system built in for custom rarity effects. + // Hot Pink is used for developer items. It Has a system built in for custom rarity effects. + // It is a unique rarity and does not have its items rarity change on reforge. public override Color RarityColor => TextColor; public static Color TextColor => new Color(255, 0, 255); @@ -58,13 +59,5 @@ namespace CalamityMod.Rarities Draw(Item, line.Text, line.X, line.Y, line.Rotation, line.Origin, line.BaseScale); } - #region Custom Draw Effects - - #region Doze's Effect - - #endregion - - #endregion - } } diff --git a/Rarities/PureGreen.cs b/Rarities/PureGreen.cs index 5752ae8335..b48cf7c502 100644 --- a/Rarities/PureGreen.cs +++ b/Rarities/PureGreen.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Rarities { -2 => ItemRarityID.Purple, -1 => ModContent.RarityType(), - _ => Type, // Cannot reach Cosmic Purple or Burnished Auric + _ => Type, // All higher rarities are unique, and so it cannot go up. }; } } diff --git a/Rarities/Turquoise.cs b/Rarities/Turquoise.cs index 27428d0c1a..a0e5eda2b4 100644 --- a/Rarities/Turquoise.cs +++ b/Rarities/Turquoise.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Rarities -2 => ItemRarityID.Red, -1 => ItemRarityID.Purple, 1 => ModContent.RarityType(), - 2 => ModContent.RarityType(), // Cannot reach Cosmic Purple + 2 => ModContent.RarityType(), // All higher rarities are unique, and so it cannot go up past Pure Green _ => Type, }; } From 7d5ccd83b72da8aeec10898d8d847473d065f066 Mon Sep 17 00:00:00 2001 From: sunny-raindrops Date: Tue, 30 Jun 2026 11:29:30 -0700 Subject: [PATCH 23/56] Brimstone Fire edits --- Projectiles/Ranged/BrimstoneFireFriendly.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Projectiles/Ranged/BrimstoneFireFriendly.cs b/Projectiles/Ranged/BrimstoneFireFriendly.cs index 41f1f48bed..f342548221 100644 --- a/Projectiles/Ranged/BrimstoneFireFriendly.cs +++ b/Projectiles/Ranged/BrimstoneFireFriendly.cs @@ -16,7 +16,6 @@ namespace CalamityMod.Projectiles.Ranged public override string Texture => "CalamityMod/Projectiles/FireProj"; public static int Lifetime => 60; - public static int Fadetime => 100; public ref float Time => ref Projectile.ai[0]; public int MistType = -1; @@ -36,7 +35,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { Time++; - if (Time < Fadetime && Main.rand.NextBool(6)) + if (Main.rand.NextBool(6)) { Vector2 cinderPos = Projectile.Center + Main.rand.NextVector2Circular(60f, 60f) * Utils.Remap(Time, 0f, Lifetime, 0.5f, 1f); float cinderSize = Utils.GetLerpValue(6f, 12f, Time, true); @@ -48,14 +47,14 @@ namespace CalamityMod.Projectiles.Ranged } cinder.noGravity = true; cinder.scale *= cinderSize * 1.2f; - cinder.velocity += Projectile.velocity * Utils.Remap(Time, 0f, Fadetime * 0.75f, 1f, 0.1f) * Utils.Remap(Time, 0f, Fadetime * 0.1f, 0.1f, 1f); + cinder.velocity += Projectile.velocity * Utils.Remap(Time, 0f, Lifetime * 0.75f, 1f, 0.1f) * Utils.Remap(Time, 0f, Lifetime * 0.1f, 0.1f, 1f); } if (MistType == -1) MistType = Main.rand.Next(3); Lighting.AddLight(Projectile.Center, 0.75f, 0.15f, 0.15f); - if (Projectile.timeLeft > Lifetime - 10) + if (Projectile.timeLeft > Lifetime - 8) return; float timeRatio = Utils.GetLerpValue(0f, Lifetime, Time); float fireSize = Utils.Remap(timeRatio, 0.2f, 0.5f, 0.25f, 1f); @@ -78,11 +77,7 @@ namespace CalamityMod.Projectiles.Ranged // Expanding hitbox public override void ModifyDamageHitbox(ref Rectangle hitbox) { - int size = (int)Utils.Remap(Time, 0f, Fadetime, 10f, 40f); - - // Shrinks again after fading - if (Time > Fadetime) - size = (int)Utils.Remap(Time, Fadetime, Lifetime, 40f, 0f); + int size = (int)Utils.Remap(Time, 0f, Lifetime, 10f, 40f); hitbox.Inflate(size, size); } From 7665f82597c7899829df77fb178730a286305678 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Tue, 30 Jun 2026 17:42:01 -0400 Subject: [PATCH 24/56] More cleanup + small trail change * Moved the trail drawing functions to their respective ModProjectile classes. HolyBurnOrbDrawer is still contained within the HolyBurnOrb file * Switched to Hermite interpolation and reduced the amount of smoothing segments for the trail drawing to help boost performance more --- Projectiles/Boss/HolyBurnOrb.cs | 119 +++++++++++--------------------- Projectiles/Boss/HolyLight.cs | 58 +++++++++++++--- 2 files changed, 88 insertions(+), 89 deletions(-) diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 23e4f306fa..6978d4aa5d 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -20,9 +20,9 @@ namespace CalamityMod.Projectiles.Boss { public class HolyBurnOrb : ModProjectile, ILocalizedModType { - public static Asset TrailNoiseTexture { get; private set; } - public static Asset TrailDistortionTexture { get; private set; } - public static Asset GlowOrbTexture { get; private set; } + private static Asset TrailNoiseTexture; + private static Asset TrailDistortionTexture; + private static Asset GlowOrbTexture; bool started = false; @@ -161,6 +161,38 @@ namespace CalamityMod.Projectiles.Boss return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; } + public void DrawTrail() + { + Matrix projection = Matrix.CreateOrthographicOffCenter(0, Main.screenWidth, Main.screenHeight, 0, -200f, 200f); + Vector2 basePosition = Projectile.Center - Main.screenPosition; + Rectangle screenBounds = new Rectangle(-40, -40, Main.screenWidth + 40, Main.screenHeight + 40); + if (screenBounds.Contains(basePosition.ToPoint())) + { + List path = []; + for (var i = 0; i < Projectile.oldPos.Length; i++) + { + Vector2 trailDrawPosition = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition; + path.Add(new Vector3(trailDrawPosition.X, trailDrawPosition.Y, 0f)); + } + + if (path.Count > 2 && Projectile.ai[0] > 6) + { + Effect shader = CalamityShaders.ProvidenceHolyOrbTrailShader.Value; + shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly); + shader.Parameters["glowPower"].SetValue(1.48f); + + Main.graphics.GraphicsDevice.Textures[0] = TrailNoiseTexture.Value; + Main.graphics.GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap; + Main.graphics.GraphicsDevice.Textures[1] = TrailDistortionTexture.Value; + Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap; + + using var shaderScope = SanePrimitiveRenderer.BeginShaderScope(shader, Matrix.Identity, Matrix.Identity, projection); + using var trailMesh = TriangleStripBuilder.BuildStripPooled(path, progress => FireWidthFunction(progress), progress => FireColorFunction(progress), PrimitiveMeshCache.Shared, textured: true); + shaderScope.Draw(trailMesh.View); + } + } + } + public override bool PreDraw(ref Color lightColor) { // Trail drawn by the HolyBurnOrbDrawer system. @@ -220,7 +252,10 @@ namespace CalamityMod.Projectiles.Boss public override void Load() { GeneralDrawLayerSystem.OnBeforeProjectiles += DrawOrbTrails; - Main.QueueMainThreadAction(() => TrailPixelationLease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice, (w, h) => ( w / 2, h / 2))); + if (!Main.dedServ) + { + Main.QueueMainThreadAction(() => TrailPixelationLease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice, (w, h) => (w / 2, h / 2))); + } } public override void PostUpdateProjectiles() @@ -247,10 +282,10 @@ namespace CalamityMod.Projectiles.Boss using (TrailPixelationLease.Scope(clearColor: Color.Transparent)) { foreach (var item in HolyBurnOrbs) - DrawBurnOrbTrail(item); + item.ModProjectile().DrawTrail(); foreach (var item in HolyLights) - DrawHealOrbTrail(item); + item.ModProjectile().DrawTrail(); } Main.spriteBatch.End(); @@ -263,77 +298,5 @@ namespace CalamityMod.Projectiles.Boss } } } - - private static void DrawBurnOrbTrail(Projectile Projectile) - { - if (Projectile.ModProjectile is HolyBurnOrb orb) - { - Matrix projection = Matrix.CreateOrthographicOffCenter(0, Main.screenWidth, Main.screenHeight, 0, -200f, 200f); - Vector2 basePosition = Projectile.Center - Main.screenPosition; - Rectangle screenBounds = new Rectangle(-40, -40, Main.screenWidth + 40, Main.screenHeight + 40); - if (screenBounds.Contains(basePosition.ToPoint())) - { - List path = []; - for (var i = 0; i < Projectile.oldPos.Length; i++) - { - Vector2 trailDrawPosition = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition; - path.Add(new Vector3(trailDrawPosition.X, trailDrawPosition.Y, 0f)); - } - - if (path.Count > 2 && Projectile.ai[0] > 6) - { - Effect shader = CalamityShaders.ProvidenceHolyOrbTrailShader.Value; - shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly); - shader.Parameters["glowPower"].SetValue(1.48f); - shader.Parameters["pixelationFactor"].SetValue(Main.ScreenSize.ToVector2() * 0.25f); - - Main.graphics.GraphicsDevice.Textures[0] = HolyBurnOrb.TrailNoiseTexture.Value; - Main.graphics.GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap; - Main.graphics.GraphicsDevice.Textures[1] = HolyBurnOrb.TrailDistortionTexture.Value; - Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap; - - using var shaderScope = SanePrimitiveRenderer.BeginShaderScope(shader, Matrix.Identity, Matrix.Identity, projection); - using var trailMesh = TriangleStripBuilder.BuildStripPooled(path, progress => orb.FireWidthFunction(progress), progress => orb.FireColorFunction(progress), PrimitiveMeshCache.Shared, textured: true); - shaderScope.Draw(trailMesh.View); - } - } - } - } - - private static void DrawHealOrbTrail(Projectile Projectile) - { - if (Projectile.ModProjectile is HolyLight light) - { - Matrix projection = Matrix.CreateOrthographicOffCenter(0, Main.screenWidth, Main.screenHeight, 0, -200f, 200f); - Vector2 basePosition = Projectile.Center - Main.screenPosition; - Rectangle screenBounds = new Rectangle(-40, -40, Main.screenWidth + 40, Main.screenHeight + 40); - if (screenBounds.Contains(basePosition.ToPoint())) - { - List path = []; - for (var i = 0; i < Projectile.oldPos.Length; i++) - { - Vector2 trailDrawPosition = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition; - path.Add(new Vector3(trailDrawPosition.X, trailDrawPosition.Y, 0f)); - } - - if (path.Count > 2 && Projectile.ai[0] > 6) - { - Effect shader = CalamityShaders.ProvidenceHolyOrbTrailShader.Value; - shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly); - shader.Parameters["glowPower"].SetValue(1.22f); - shader.Parameters["pixelationFactor"].SetValue(Main.ScreenSize.ToVector2() * 0.25f); - - Main.graphics.GraphicsDevice.Textures[0] = HolyLight.TrailNoiseTexture.Value; - Main.graphics.GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap; - Main.graphics.GraphicsDevice.Textures[1] = HolyLight.TrailDistortionTexture.Value; - Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap; - - using var shaderScope = SanePrimitiveRenderer.BeginShaderScope(shader, Matrix.Identity, Matrix.Identity, projection); - using var trailMesh = TriangleStripBuilder.BuildStripPooled(path, progress => light.FireWidthFunction(progress), progress => light.FireColorFunction(progress), PrimitiveMeshCache.Shared, textured: true); - shaderScope.Draw(trailMesh.View); - } - } - } - } } } diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 67efa567fa..54fc96cc2d 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -1,6 +1,9 @@ using System; +using System.Collections.Generic; using CalamityMod.Dusts; +using CalamityMod.Effects; using CalamityMod.Enums; +using CalamityMod.Graphics.Primitives; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -15,8 +18,9 @@ namespace CalamityMod.Projectiles.Boss { public class HolyLight : ModProjectile, ILocalizedModType { - public static Asset TrailNoiseTexture { get; private set; } - public static Asset TrailDistortionTexture { get; private set; } + private static Asset TrailNoiseTexture; + private static Asset TrailDistortionTexture; + private static Asset GlowOrbTexture; public new string LocalizationCategory => "Projectiles.Boss"; public override string Texture => "CalamityMod/Projectiles/StarProj"; @@ -27,6 +31,7 @@ namespace CalamityMod.Projectiles.Boss { TrailNoiseTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/EternityStreak"); TrailDistortionTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise"); + GlowOrbTexture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle"); } } @@ -145,6 +150,38 @@ namespace CalamityMod.Projectiles.Boss return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; } + public void DrawTrail() + { + Matrix projection = Matrix.CreateOrthographicOffCenter(0, Main.screenWidth, Main.screenHeight, 0, -200f, 200f); + Vector2 basePosition = Projectile.Center - Main.screenPosition; + Rectangle screenBounds = new Rectangle(-40, -40, Main.screenWidth + 40, Main.screenHeight + 40); + if (screenBounds.Contains(basePosition.ToPoint())) + { + List path = []; + for (var i = 0; i < Projectile.oldPos.Length; i++) + { + Vector2 trailDrawPosition = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition; + path.Add(new Vector3(trailDrawPosition.X, trailDrawPosition.Y, 0f)); + } + + if (path.Count > 2 && Projectile.ai[0] > 6) + { + Effect shader = CalamityShaders.ProvidenceHolyOrbTrailShader.Value; + shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly); + shader.Parameters["glowPower"].SetValue(1.48f); + + Main.graphics.GraphicsDevice.Textures[0] = TrailNoiseTexture.Value; + Main.graphics.GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap; + Main.graphics.GraphicsDevice.Textures[1] = TrailDistortionTexture.Value; + Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap; + + using var shaderScope = SanePrimitiveRenderer.BeginShaderScope(shader, Matrix.Identity, Matrix.Identity, projection); + using var trailMesh = TriangleStripBuilder.BuildStripPooled(path, progress => FireWidthFunction(progress), progress => FireColorFunction(progress), PrimitiveMeshCache.Shared, textured: true); + shaderScope.Draw(trailMesh.View); + } + } + } + public override bool PreDraw(ref Color lightColor) { // Trail drawn by the HolyBurnOrbDrawer system. @@ -178,20 +215,19 @@ namespace CalamityMod.Projectiles.Boss Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect, spriteEffects, 0); Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3 + Vector2.UnitX * 60f, null, halfBrightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3 + Vector2.UnitX * 60f, null, halfBrightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.36f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3 - Vector2.UnitX * 60f, null, brightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3 - Vector2.UnitX * 60f, null, brightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3 - Vector2.UnitY * 60f, null, halfBrightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3 - Vector2.UnitY * 60f, null, halfBrightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.36f, spriteEffects, 0); } private void DrawHealOrbAdditive() { - Texture2D texture = HolyBurnOrb.GlowOrbTexture.Value; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, new Color(54, 209, 54) with { A = 0 }, 0, texture.Size() * 0.5f, 1f, 0, 0f); - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 }, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); + Main.spriteBatch.Draw(GlowOrbTexture.Value, Projectile.Center - Main.screenPosition, null, new Color(54, 209, 54) with { A = 0 }, 0, GlowOrbTexture.Size() * 0.5f, 1f, 0, 0f); + Main.spriteBatch.Draw(GlowOrbTexture.Value, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 }, 0, GlowOrbTexture.Size() * 0.5f, 0.5f, 0, 0f); } } } From 9746cf276fd1165c7302bc5b5f568a745193415b Mon Sep 17 00:00:00 2001 From: Critaquil Date: Wed, 1 Jul 2026 16:19:49 -0400 Subject: [PATCH 25/56] horizontal nerfs horizontal speed to 8.5 (starboard 8 lunar 9) accel to 2.88 (starboard 2.75 elysian 3) --- Items/Accessories/Wings/TiredTail.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Accessories/Wings/TiredTail.cs b/Items/Accessories/Wings/TiredTail.cs index e444e4676f..da6d82653f 100644 --- a/Items/Accessories/Wings/TiredTail.cs +++ b/Items/Accessories/Wings/TiredTail.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Accessories.Wings public override void SetStaticDefaults() { - ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(210, 9f, 3.25f, true, 16, 10f); + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(210, 8.5f, 2.88f, true, 16, 10f); } public override void SetDefaults() From 8623f66a48dd2385fd25d4d4ac2b63f2587e0f29 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Wed, 1 Jul 2026 17:23:52 -0500 Subject: [PATCH 26/56] added a recipe --- Items/Accessories/Wings/TiredTail.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Items/Accessories/Wings/TiredTail.cs b/Items/Accessories/Wings/TiredTail.cs index e444e4676f..5a39279079 100644 --- a/Items/Accessories/Wings/TiredTail.cs +++ b/Items/Accessories/Wings/TiredTail.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using CalamityMod.Enums; using CalamityMod.Items.Armor.Auric; using CalamityMod.Items.Armor.Bloodflare; using CalamityMod.Items.Armor.Demonshade; @@ -14,6 +13,7 @@ using CalamityMod.Items.Armor.OmegaBlue; using CalamityMod.Items.Armor.Prismatic; using CalamityMod.Items.Armor.Silva; using CalamityMod.Items.Armor.Tarragon; +using CalamityMod.Items.Materials; using CalamityMod.Rarities; using CalamityMod.Utilities.Daybreak; using CalamityMod.Utilities.Daybreak.Buffers; @@ -102,6 +102,16 @@ namespace CalamityMod.Items.Accessories.Wings player.wingTime -= 1; } } + + public override void AddRecipes() + { + + CreateRecipe(). + AddIngredient(3). + AddIngredient(ItemID.Sapphire). + AddTile(TileID.DemonAltar). + Register(); + } } public class TiredTailPlayer : ModPlayer @@ -410,7 +420,7 @@ namespace CalamityMod.Items.Accessories.Wings } var textToDraw = new string(textarray); - size = FontAssets.MouseText.Value.MeasureString(textToDraw)*scale; + size = FontAssets.MouseText.Value.MeasureString(textToDraw) * scale; if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) { @@ -422,18 +432,18 @@ namespace CalamityMod.Items.Accessories.Wings { using (lease.Scope(clearColor: Color.Transparent)) { - var max = FontAssets.MouseText.Value.MeasureString(text) * Math.Min(1f,expansionFactor); + var max = FontAssets.MouseText.Value.MeasureString(text) * Math.Min(1f, expansionFactor); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); foreach (var item in textarray) {//new(92,83,117) pos = position; - pos.X += Math.Min(FontAssets.MouseText.Value.MeasureString(txt).X,max.X+9999); + pos.X += Math.Min(FontAssets.MouseText.Value.MeasureString(txt).X, max.X + 9999); float sin = (MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -1.5f) + 1) * 0.5f; float sin2 = (MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -0.9f) + 1) * 0.5f; float sin3 = MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -1.5f + MathHelper.PiOver2); var c = new Color(171, 153, 204); - if (txt.Length == 0 || txt.Length == text.Length-1) + if (txt.Length == 0 || txt.Length == text.Length - 1) c = Color.Cyan; else if (txt.Length % 4 == 3) { @@ -442,7 +452,7 @@ namespace CalamityMod.Items.Accessories.Wings c = Color.Lerp(Colors.AlphaDarken(new Color(0, 255, 200)), c, MathHelper.Clamp(expansionFactor - 2, 0, 1)); float posMult = Math.Max(MathHelper.Clamp((expansionFactor - 10) * 0.5f, 0, 3), MathHelper.Clamp((expansionFactor - 2) * 0.5f, 0, 1)); var origin = FontAssets.MouseText.Value.MeasureString(item.ToString()) * 0.5f; - ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, item.ToString(), origin + pos + new Vector2(0, item == 'ɔ' ? -1 : 0) + new Vector2((-2f + 4*sin2) * posMult, (-2 + sin * 4) * posMult), c, sin3*posMult * 0.1f, origin, new Vector2(scale)); + ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, item.ToString(), origin + pos + new Vector2(0, item == 'ɔ' ? -1 : 0) + new Vector2((-2f + 4 * sin2) * posMult, (-2 + sin * 4) * posMult), c, sin3 * posMult * 0.1f, origin, new Vector2(scale)); txt += item; } spriteBatch.End(); From e6959f16cabfb2eae9cc0a5d262bbed726e6efb7 Mon Sep 17 00:00:00 2001 From: Nathanael Overton Date: Wed, 1 Jul 2026 21:19:41 -0400 Subject: [PATCH 27/56] remove unused field --- Buffs/StatDebuffs/MarkedforDeath.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Buffs/StatDebuffs/MarkedforDeath.cs b/Buffs/StatDebuffs/MarkedforDeath.cs index e7b836d7ee..0ddfe27068 100644 --- a/Buffs/StatDebuffs/MarkedforDeath.cs +++ b/Buffs/StatDebuffs/MarkedforDeath.cs @@ -5,8 +5,6 @@ namespace CalamityMod.Buffs.StatDebuffs { public class MarkedforDeath : ModBuff { - public static int DefenseReduction = 5; - public override void SetStaticDefaults() { Main.debuff[Type] = true; From 8024951077b103ff51f13712a7e35bbb96bda71e Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 3 Jul 2026 16:12:19 +0700 Subject: [PATCH 28/56] Rebalanced Cosmic Kunai --- Items/Weapons/Rogue/CosmicKunai.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Rogue/CosmicKunai.cs b/Items/Weapons/Rogue/CosmicKunai.cs index 540e906b7e..db863c5e58 100644 --- a/Items/Weapons/Rogue/CosmicKunai.cs +++ b/Items/Weapons/Rogue/CosmicKunai.cs @@ -24,13 +24,13 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 26; Item.height = 48; - Item.damage = 92; + Item.damage = 110; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = 2; - Item.useAnimation = 10; + Item.useTime = 3; + Item.useAnimation = 12; Item.reuseDelay = 1; - Item.useLimitPerAnimation = 5; + Item.useLimitPerAnimation = 4; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 5f; Item.UseSound = SoundID.Item109; @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Rogue for (float i = 0; i < 9; i++) { float angle = MathHelper.TwoPi / 9f * i; - Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType(), damage * 3, knockback, player.whoAmI, angle); + Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType(), (int)(damage * 1.5f), knockback, player.whoAmI, angle); } } else if (stealthSalvo) From dc6a4cbef0858c55e14f8d605841b74630fc663f Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 3 Jul 2026 17:18:12 +0700 Subject: [PATCH 29/56] Rebalanced Caustic Staff --- Items/Weapons/Summon/CausticStaff.cs | 2 +- ...ods.CalamityMod.Items.Weapons.Summon.hjson | 6 +++--- Projectiles/Summon/CausticStaffProjectile.cs | 20 ++++++++----------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/Items/Weapons/Summon/CausticStaff.cs b/Items/Weapons/Summon/CausticStaff.cs index 82d159fbb9..b91456d5cc 100644 --- a/Items/Weapons/Summon/CausticStaff.cs +++ b/Items/Weapons/Summon/CausticStaff.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = 26; Item.height = 28; Item.mana = 10; - Item.damage = 15; + Item.damage = 18; Item.useStyle = ItemUseStyleID.Swing; Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index ed0fa8eb78..a20ae74792 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -147,10 +147,10 @@ CausticStaff: { ''' HoldShiftTooltip: ''' - Always inflicts [cbuff:OnFire3] + Always inflicts [cbuff:OnFire3] and [cbuff:Venom] Inflicts [cbuff:CursedInferno] with 2 dragons summoned - Inflicts [cbuff:Venom] with 3 dragons summoned - Inflicts [cbuff:Ichor] and [cbuff:CalamityMod/MarkedforDeath] with 4 dragons summoned + Inflicts [cbuff:Ichor] with 3 dragons summoned + Inflicts [cbuff:CalamityMod/MarkedforDeath] with 4 dragons summoned ''' } diff --git a/Projectiles/Summon/CausticStaffProjectile.cs b/Projectiles/Summon/CausticStaffProjectile.cs index 190e23a20c..c2dfc942ed 100644 --- a/Projectiles/Summon/CausticStaffProjectile.cs +++ b/Projectiles/Summon/CausticStaffProjectile.cs @@ -48,27 +48,23 @@ namespace CalamityMod.Projectiles.Summon public static int GetDust(float type) { - if (type >= 4f && Main.rand.NextBool(5)) + if (type >= 3f && Main.rand.NextBool(5)) return DustID.IchorTorch; - if (type >= 3f && Main.rand.NextBool(4)) - return DustID.VenomStaff; - if (type >= 2f && Main.rand.NextBool(3)) + if (type >= 2f && Main.rand.NextBool(5)) return DustID.CursedTorch; - return DustID.Torch; + return Main.rand.NextBool(4) ? DustID.VenomStaff : DustID.Torch; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.OnFire3, 60); + target.AddBuff(BuffID.OnFire3, 300); + target.AddBuff(BuffID.Venom, 300); if (MinionCount >= 2f) - target.AddBuff(BuffID.CursedInferno, 60); + target.AddBuff(BuffID.CursedInferno, 300); if (MinionCount >= 3f) - target.AddBuff(BuffID.Venom, 60); + target.AddBuff(BuffID.Ichor, 300); if (MinionCount >= 4f) - { - target.AddBuff(BuffID.Ichor, 60); - target.AddBuff(ModContent.BuffType(), 60); - } + target.AddBuff(ModContent.BuffType(), 300); } } } From c6ed11703f5810339325e0f7d0acff8ab731935a Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:10:52 +0700 Subject: [PATCH 30/56] Buffed Black Hawk again also Caustic Dragon moves faster --- Projectiles/Summon/BlackHawkBullet.cs | 9 ++++++--- Projectiles/Summon/BlackHawkSummon.cs | 2 +- Projectiles/Summon/CausticStaffSummon.cs | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Projectiles/Summon/BlackHawkBullet.cs b/Projectiles/Summon/BlackHawkBullet.cs index 7d43617505..fc4e98f5c0 100644 --- a/Projectiles/Summon/BlackHawkBullet.cs +++ b/Projectiles/Summon/BlackHawkBullet.cs @@ -14,16 +14,19 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - Projectile.width = Projectile.height = 4; + Projectile.width = Projectile.height = 6; Projectile.light = 0.5f; Projectile.alpha = 0; - Projectile.extraUpdates = 4; Projectile.scale = 1.18f; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.timeLeft = 600; Projectile.tileCollide = false; + Projectile.MaxUpdates = 6; + Projectile.penetrate = 5; + Projectile.timeLeft = 60 * Projectile.MaxUpdates; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; AIType = ProjectileID.BulletHighVelocity; Projectile.DamageType = DamageClass.Summon; } diff --git a/Projectiles/Summon/BlackHawkSummon.cs b/Projectiles/Summon/BlackHawkSummon.cs index ccddc0d234..66d9de7a51 100644 --- a/Projectiles/Summon/BlackHawkSummon.cs +++ b/Projectiles/Summon/BlackHawkSummon.cs @@ -255,7 +255,7 @@ namespace CalamityMod.Projectiles.Summon //Increment attack cooldown if (Projectile.ai[1] > 0f) { - Projectile.ai[1]++; + Projectile.ai[1] += Main.rand.NextFloat(0.5f, 2f); } //Set the minion to be ready for attack if (Projectile.ai[1] > 60f) diff --git a/Projectiles/Summon/CausticStaffSummon.cs b/Projectiles/Summon/CausticStaffSummon.cs index 300d9a1f3c..3bb152d00c 100644 --- a/Projectiles/Summon/CausticStaffSummon.cs +++ b/Projectiles/Summon/CausticStaffSummon.cs @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Summon homeInVector.Normalize(); if (targetDist > 200f) { - float velocity = 6f; + float velocity = 10f; Projectile.velocity = (Projectile.velocity * 40f + homeInVector * velocity) / 41f; } else From a5a4e95ca46d9bc287da12c30a2e273da4713b11 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 3 Jul 2026 20:16:14 +0700 Subject: [PATCH 31/56] Enchanted Knife AI tweaks --- Items/Weapons/Summon/EnchantedKnifeStaff.cs | 8 ++--- Projectiles/Summon/EnchantedKnifeSummon.cs | 39 +++++++++++++++------ 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/Items/Weapons/Summon/EnchantedKnifeStaff.cs b/Items/Weapons/Summon/EnchantedKnifeStaff.cs index c2b9993bd0..a4862638f0 100644 --- a/Items/Weapons/Summon/EnchantedKnifeStaff.cs +++ b/Items/Weapons/Summon/EnchantedKnifeStaff.cs @@ -9,11 +9,11 @@ namespace CalamityMod.Items.Weapons.Summon { public class EnchantedKnifeStaff : ModItem, ILocalizedModType { - public static float SwingTime = 20f; - public static float SwingWait = 10f; + public static float SwingTime = 18f; + public static float SwingWait = 6f; public static float ProjectileSpeed = 15f; - public static float DashCooldown = 30f; - public static float DashSpeed = 16f; + public static float ChaseSpeed = 10f; + public static float RecoilSpeed = -4f; public new string LocalizationCategory => "Items.Weapons.Summon"; diff --git a/Projectiles/Summon/EnchantedKnifeSummon.cs b/Projectiles/Summon/EnchantedKnifeSummon.cs index 9aa3853d86..aef98f6ded 100644 --- a/Projectiles/Summon/EnchantedKnifeSummon.cs +++ b/Projectiles/Summon/EnchantedKnifeSummon.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Projectiles.Summon } private Action _currentState; - private ref float DashTimer => ref Projectile.ai[0]; private ref float SwingTimer => ref Projectile.ai[1]; @@ -62,14 +61,21 @@ namespace CalamityMod.Projectiles.Summon Projectile.width = Projectile.height = 32; } + public override bool? CanDamage() => SwingTimer >= SwingWait && SwingTimer <= SwingWait + SwingTime ? base.CanDamage() : false; + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + float damageMult = MathHelper.Clamp(Utils.GetLerpValue(3, 0, Projectile.numHits), 0.25f, 1); + modifiers.SourceDamage *= damageMult; + } + #region AI public override void MinionAI() { if (!HasSpawned) { + IFrames = -1; TrailCacheLength = 4; - DashTimer = Main.rand.Next(30); Projectile.velocity = Projectile.DirectionFrom(Owner.Center); CurrentState = GoToOwnerState; HasSpawned = true; @@ -157,7 +163,7 @@ namespace CalamityMod.Projectiles.Summon if (SwingTimer == SwingWait + SwingTime * 0.5f && Main.myPlayer == Projectile.owner) { Vector2 spawnPosition = SwingCenter + predictiveDirection.SafeNormalize(-Vector2.UnitY) * 40f; - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), spawnPosition, predictiveDirection, @@ -166,14 +172,30 @@ namespace CalamityMod.Projectiles.Summon Projectile.knockBack, Projectile.owner); } - - if (DashTimer >= DashCooldown) + if ((SwingTimer == SwingWait && SwingDirection == 1) || (SwingTimer == SwingWait + SwingTime && SwingDirection == -1)) { - Vector2 dashVelocity = CalamityUtils.CalculatePredictiveAimToTarget(SwingCenter, Target, DashSpeed); + Projectile.ResetLocalNPCHitImmunity(); + Projectile.numHits = 0; + } + + if (Vector2.Distance(SwingCenter, Target.Center) > 48f + MathF.Min(Target.width, Target.height) * 0.8f) + { + Vector2 dashVelocity = CalamityUtils.CalculatePredictiveAimToTarget(SwingCenter, Target, ChaseSpeed); if (!float.IsNaN(dashVelocity.X) && !float.IsNaN(dashVelocity.Y)) Projectile.velocity = dashVelocity; - DashTimer = 0f; } + else if (Vector2.Distance(SwingCenter, Target.Center) < 40f + MathF.Min(Target.width, Target.height) * 0.5f) + { + Vector2 dashVelocity = CalamityUtils.CalculatePredictiveAimToTarget(SwingCenter, Target, RecoilSpeed); + if (!float.IsNaN(dashVelocity.X) && !float.IsNaN(dashVelocity.Y)) + Projectile.velocity = dashVelocity; + } + else + Projectile.velocity *= 0.5f; + + // Cancel out choppy movement + if (Projectile.velocity.Length() < 1f) + Projectile.velocity *= 0f; SwingTimer += 1f * SwingDirection; if (SwingTimer == 0f || SwingTimer == SwingWait + SwingTime + SwingWait) @@ -183,9 +205,6 @@ namespace CalamityMod.Projectiles.Summon else HasStartedSwinging = true; } - - if (Projectile.DistanceSQ(Target.Center) > 320f * 320f) - DashTimer += Main.rand.NextBool((int)DashCooldown) ? 2 : 1; } private void OnStateChange(Action newState) From 25dd55b60c7f8d15d6b8c8dd7e709b29b86241a0 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 3 Jul 2026 23:24:06 +0700 Subject: [PATCH 32/56] Frost Blossom, Sun Spirit, Cnidarian --- Items/Weapons/Summon/FrostBlossomStaff.cs | 2 +- Items/Weapons/Summon/SunSpiritStaff.cs | 2 +- .../Summon/CnidarianJellyfishOnTheString.cs | 2 +- Projectiles/Summon/FrostBeam.cs | 46 ++++++++++--------- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/Items/Weapons/Summon/FrostBlossomStaff.cs b/Items/Weapons/Summon/FrostBlossomStaff.cs index 91a1ff43bd..798bceb466 100644 --- a/Items/Weapons/Summon/FrostBlossomStaff.cs +++ b/Items/Weapons/Summon/FrostBlossomStaff.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 34; Item.height = 24; - Item.damage = 10; + Item.damage = 15; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/SunSpiritStaff.cs b/Items/Weapons/Summon/SunSpiritStaff.cs index 0bc84b41ec..03ce24238d 100644 --- a/Items/Weapons/Summon/SunSpiritStaff.cs +++ b/Items/Weapons/Summon/SunSpiritStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 44; Item.height = 48; - Item.damage = 25; + Item.damage = 22; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Projectiles/Summon/CnidarianJellyfishOnTheString.cs b/Projectiles/Summon/CnidarianJellyfishOnTheString.cs index 14adef8764..4556370957 100644 --- a/Projectiles/Summon/CnidarianJellyfishOnTheString.cs +++ b/Projectiles/Summon/CnidarianJellyfishOnTheString.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Summon public const float SegmentDistance = 20; public static int FadeoutTime = 20; public static int ElectrifyTimer = 180; - public static float ZapDamageMultiplier = 0.5f; + public static float ZapDamageMultiplier = 1f; //Sounds public static readonly SoundStyle ZapSound = SoundID.Item94 with { Volume = SoundID.Item94.Volume * 0.5f }; diff --git a/Projectiles/Summon/FrostBeam.cs b/Projectiles/Summon/FrostBeam.cs index 115b330c06..2d7284f8ca 100644 --- a/Projectiles/Summon/FrostBeam.cs +++ b/Projectiles/Summon/FrostBeam.cs @@ -24,12 +24,15 @@ namespace CalamityMod.Projectiles.Summon Projectile.timeLeft = 200; Projectile.coldDamage = true; Projectile.DamageType = DamageClass.Summon; + Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; } public override void AI() { - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] > 5f) + Projectile.localAI[0]++; + if (Projectile.localAI[0] > 2f && Projectile.ai[0] == 0f) { for (int i = 0; i < 6; i++) { @@ -43,33 +46,32 @@ namespace CalamityMod.Projectiles.Summon } } } - public override void OnKill(int timeLeft) + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - Projectile.position = Projectile.Center; - Projectile.width = Projectile.height = 70; - Projectile.position -= Projectile.Size * 0.5f; - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.damage /= 3; - Projectile.Damage(); - int flowerPetalCount = Main.rand.Next(3, 5 + 1); - float thetaDelta = Projectile.velocity.ToRotation(); - float weaveDistanceMin = 2f; - float weaveDistanceOutwardMax = 3f; - float weaveDistanceInner = 0.5f; - for (float theta = 0f; theta < MathHelper.TwoPi; theta += 0.05f) + if (Projectile.ai[0] == 0f) { - Vector2 velocity = theta.ToRotationVector2() * + Projectile.ai[0]++; + Projectile.ExpandHitboxBy(128); + Projectile.Damage(); + int flowerPetalCount = Main.rand.Next(3, 5 + 1); + float thetaDelta = Projectile.velocity.ToRotation(); + float weaveDistanceMin = 2f; + float weaveDistanceOutwardMax = 3f; + float weaveDistanceInner = 0.5f; + for (float theta = 0f; theta < MathHelper.TwoPi; theta += 0.05f) + { + Vector2 velocity = theta.ToRotationVector2() * (weaveDistanceMin + // The 0.5 in here is to prevent the petal from looping back into itself. With a 0.5 addition, it is perfect, coming back to (0,0) // instead of weaving backwards. (float)(Math.Sin(thetaDelta + theta * flowerPetalCount) + 0.5f + weaveDistanceInner) * weaveDistanceOutwardMax); - Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.MushroomSpray, velocity); - dust.noGravity = true; - dust.scale = 1.35f; + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.MushroomSpray, velocity); + dust.noGravity = true; + dust.scale = 1.35f; + } + Projectile.Kill(); } } } From 5f75d248246b338c70068da7b34faca2a95525ee Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 4 Jul 2026 02:32:27 +0700 Subject: [PATCH 33/56] PML summoner except Void Concentration because fuck --- Items/Weapons/DraedonsArsenal/SnakeEyes.cs | 2 +- Items/Weapons/Summon/CalamarisLament.cs | 2 +- Items/Weapons/Summon/Cosmilamp.cs | 2 +- Items/Weapons/Summon/DazzlingStabberStaff.cs | 2 +- Items/Weapons/Summon/DragonbloodDisgorger.cs | 2 +- Items/Weapons/Summon/EtherealSubjugator.cs | 2 +- Items/Weapons/Summon/StellarTorusStaff.cs | 4 ++-- Items/Weapons/Summon/ViridVanguard.cs | 6 +++--- Items/Weapons/Summon/WarloksMoonFist.cs | 2 +- Projectiles/Summon/MoonFist.cs | 22 +++++++++----------- Projectiles/Summon/SkeletalDragonChild.cs | 8 +++---- Projectiles/Summon/SkeletalDragonMother.cs | 2 +- 12 files changed, 26 insertions(+), 30 deletions(-) diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index 5b65b1c0a3..3176eb58bd 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { Item.width = 38; Item.height = 24; - Item.damage = 200; + Item.damage = 160; Item.mana = 12; Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.HoldUp; diff --git a/Items/Weapons/Summon/CalamarisLament.cs b/Items/Weapons/Summon/CalamarisLament.cs index a9cd33ee10..107a687826 100644 --- a/Items/Weapons/Summon/CalamarisLament.cs +++ b/Items/Weapons/Summon/CalamarisLament.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 88; Item.height = 108; - Item.damage = 110; + Item.damage = 120; Item.DamageType = DamageClass.Summon; Item.mana = 10; Item.useAnimation = Item.useTime = 24; diff --git a/Items/Weapons/Summon/Cosmilamp.cs b/Items/Weapons/Summon/Cosmilamp.cs index 6d44a1e358..e50b70b3cb 100644 --- a/Items/Weapons/Summon/Cosmilamp.cs +++ b/Items/Weapons/Summon/Cosmilamp.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 42; Item.height = 60; - Item.damage = 97; + Item.damage = 95; Item.mana = 10; Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/DazzlingStabberStaff.cs b/Items/Weapons/Summon/DazzlingStabberStaff.cs index 581ff50223..fc4a4f5556 100644 --- a/Items/Weapons/Summon/DazzlingStabberStaff.cs +++ b/Items/Weapons/Summon/DazzlingStabberStaff.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 56; Item.height = 60; - Item.damage = 75; + Item.damage = 69; Item.useAnimation = Item.useTime = 24; Item.mana = 10; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/DragonbloodDisgorger.cs b/Items/Weapons/Summon/DragonbloodDisgorger.cs index 53a032d191..cc8c614086 100644 --- a/Items/Weapons/Summon/DragonbloodDisgorger.cs +++ b/Items/Weapons/Summon/DragonbloodDisgorger.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 64; Item.height = 62; - Item.damage = 215; + Item.damage = 222; Item.mana = 10; Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/EtherealSubjugator.cs b/Items/Weapons/Summon/EtherealSubjugator.cs index 1d95674621..e2311395fc 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 66; Item.height = 70; - Item.damage = 175; + Item.damage = 160; Item.DamageType = DamageClass.Summon; Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/StellarTorusStaff.cs b/Items/Weapons/Summon/StellarTorusStaff.cs index 6dc2fda202..d6f33e4304 100644 --- a/Items/Weapons/Summon/StellarTorusStaff.cs +++ b/Items/Weapons/Summon/StellarTorusStaff.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public static float EnemyDetectionDistance = 1200f; - public static int IFrames = 10; + public static int IFrames = 8; // In frames. public static float TimeBeforeCharging = 45f; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 42; Item.height = 42; - Item.damage = 142; + Item.damage = 132; Item.useAnimation = Item.useTime = 24; Item.knockBack = 4f; Item.mana = 10; diff --git a/Items/Weapons/Summon/ViridVanguard.cs b/Items/Weapons/Summon/ViridVanguard.cs index 9cd7b0a4d1..82968c717c 100644 --- a/Items/Weapons/Summon/ViridVanguard.cs +++ b/Items/Weapons/Summon/ViridVanguard.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Items.Weapons.Summon #region Damage Balancing Properties - //Sage Poison's damage is kept in the Sage Poison file - public static float ActiveAttackSlashDmgMult => 5f; + //Sage Poison's damage is kept in the Sage Poison file + public static float ActiveAttackSlashDmgMult => 4f; //Note: the following two only apply when not using the active attack public static float AxeDmgMult => 1.25f; @@ -77,7 +77,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 26; Item.height = 36; - Item.damage = 60; + Item.damage = 55; Item.DamageType = DamageClass.Summon; Item.mana = 10; Item.useAnimation = Item.useTime = 24; diff --git a/Items/Weapons/Summon/WarloksMoonFist.cs b/Items/Weapons/Summon/WarloksMoonFist.cs index 1adfc5491b..174bb5720a 100644 --- a/Items/Weapons/Summon/WarloksMoonFist.cs +++ b/Items/Weapons/Summon/WarloksMoonFist.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public const int SlotCount = 4; - public const int PunchCooldownTime = 36; + public const int PunchCooldownTime = 30; public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 4f; diff --git a/Projectiles/Summon/MoonFist.cs b/Projectiles/Summon/MoonFist.cs index ca9f891814..b7fb680e86 100644 --- a/Projectiles/Summon/MoonFist.cs +++ b/Projectiles/Summon/MoonFist.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.penetrate = -1; Projectile.MaxUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 10; + Projectile.localNPCHitCooldown = -1; Projectile.netImportant = true; Projectile.timeLeft = 90000; Projectile.DamageType = DamageClass.Summon; @@ -122,13 +122,13 @@ namespace CalamityMod.Projectiles.Summon public void AttackTarget(NPC target) { - int reelBackTime = 32; - int homeDelay = 27; + int reelBackTime = 30; + int homeDelay = 15; int attackTime = 150; int attackCycleInterval = reelBackTime + attackTime; // Teleport to the enemy if it's far away. - if (!Projectile.WithinRange(target.Center, 1200f)) + if (!Projectile.WithinRange(target.Center, 960f)) { Vector2 teleportDestination = target.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(250f, 300f); DoTeleport(teleportDestination); @@ -145,11 +145,11 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = (int)Math.Round(MathHelper.Lerp(6f, 11f, AttackTimer / reelBackTime)); // Reel back and look at the target. - float hoverOffset = MathHelper.Lerp(200f, 480f, AttackTimer / reelBackTime); + float hoverOffset = MathHelper.Lerp(160f, 320f, AttackTimer / reelBackTime); hoverOffset += MathHelper.Lerp(-10f, 75f, Projectile.identity % 9f / 1f); float spin = MathHelper.Lerp(-0.27f, 0.27f, Projectile.identity / 7f % 1f); Vector2 hoverDestination = target.Center - target.SafeDirectionTo(target.Center, Vector2.UnitY).RotatedBy(spin) * hoverOffset; - Vector2 idealVelocity = Projectile.SafeDirectionTo(hoverDestination) * MathHelper.Min(25f, Projectile.Distance(hoverDestination)); + Vector2 idealVelocity = Projectile.SafeDirectionTo(hoverDestination) * MathHelper.Min(12f, Projectile.Distance(hoverDestination)); Projectile.Center = Vector2.Lerp(Projectile.Center, hoverDestination, 0.02f); Projectile.velocity = Vector2.Lerp(Projectile.velocity, idealVelocity, 0.03f).MoveTowards(idealVelocity, 0.5f); @@ -164,6 +164,8 @@ namespace CalamityMod.Projectiles.Summon } else if (DelayUntilNextPunch <= 0) { + Projectile.ResetLocalNPCHitImmunity(); + // Home towards the target briefly after the initial charge. if (AttackTimer >= reelBackTime + homeDelay) Projectile.velocity = Projectile.SuperhomeTowardsTarget(target, 34f, 24f); @@ -203,14 +205,10 @@ namespace CalamityMod.Projectiles.Summon Projectile.netUpdate = true; } - public override bool MinionContactDamage() => true; + public override bool MinionContactDamage() => DelayUntilNextPunch <= 0 && AttackTimer > 0f; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - // Rebound on collision. - if (DelayUntilNextPunch > 0 || AttackTimer <= 0f) - return; - // Create some cool particles to go with the hit. Vector2 impactPoint = Vector2.Lerp(Projectile.Center, target.Hitbox.ClosestPointInRect(Projectile.Center), 0.5f); for (int i = 0; i < 7; i++) @@ -235,7 +233,7 @@ namespace CalamityMod.Projectiles.Summon SoundEngine.PlaySound(SoundID.Item74 with { Pitch = -0.36f }, Projectile.Center); DelayUntilNextPunch = WarloksMoonFist.PunchCooldownTime - 10; - Projectile.velocity = Projectile.SafeDirectionTo(target.Center, -Vector2.UnitY).RotatedBy(0.16f) * Projectile.velocity.Length() * -0.45f; + Projectile.velocity = Projectile.SafeDirectionTo(target.Center, -Vector2.UnitY).RotatedBy(0.16f) * Projectile.velocity.Length() * -0.3f; Projectile.netUpdate = true; } diff --git a/Projectiles/Summon/SkeletalDragonChild.cs b/Projectiles/Summon/SkeletalDragonChild.cs index 1c8edf6dc0..c82622f6c3 100644 --- a/Projectiles/Summon/SkeletalDragonChild.cs +++ b/Projectiles/Summon/SkeletalDragonChild.cs @@ -21,18 +21,15 @@ namespace CalamityMod.Projectiles.Summon Projectile.netImportant = true; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 7; Projectile.minionSlots = 0f; Projectile.extraUpdates = 1; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; Projectile.tileCollide = false; - Projectile.timeLeft *= 5; Projectile.minion = true; Projectile.DamageType = DamageClass.Summon; } + public override bool? CanDamage() => false; + public override void AI() { Player player = Main.player[Projectile.owner]; @@ -50,6 +47,7 @@ namespace CalamityMod.Projectiles.Summon return; } + Projectile.timeLeft = 2; NPC target = Projectile.Center.MinionHoming(SkeletalDragonMother.DistanceToCheck * 0.666f, player); if (target != null) diff --git a/Projectiles/Summon/SkeletalDragonMother.cs b/Projectiles/Summon/SkeletalDragonMother.cs index 1d93cc03e1..7779c16e44 100644 --- a/Projectiles/Summon/SkeletalDragonMother.cs +++ b/Projectiles/Summon/SkeletalDragonMother.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 6; + Projectile.localNPCHitCooldown = 20; Projectile.minionSlots = 6f; Projectile.timeLeft = 18000; Projectile.penetrate = -1; From 042657f1e1c632cc28aa31bf7546458327beefdf Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 3 Jul 2026 16:14:06 -0400 Subject: [PATCH 34/56] Fixed Hot Pink custom item colors --- Items/Accessories/AngelicAlliance.cs | 3 + Items/Accessories/ProfanedSoulCrystal.cs | 2 + Items/Armor/Demonshade/DemonshadeHelm.cs | 2 + Items/CalamityGlobalItemTooltip.cs | 104 ------------------ Items/Tools/CrystylCrusher.cs | 2 + Items/Weapons/Magic/Eternity.cs | 17 +++ Items/Weapons/Magic/StaffofBlushie.cs | 3 + Items/Weapons/Magic/Sylvestaff.cs | 2 + Items/Weapons/Melee/DraconicDestruction.cs | 2 + Items/Weapons/Melee/Earth.cs | 9 ++ Items/Weapons/Melee/IllustriousKnives.cs | 2 + Items/Weapons/Melee/RedSun.cs | 2 + ...TriactisTruePaladinianMageHammerofMight.cs | 3 + Items/Weapons/Ranged/Contagion.cs | 2 + Items/Weapons/Ranged/SomaPrime.cs | 2 + Items/Weapons/Ranged/Svantechnical.cs | 2 + Items/Weapons/Rogue/NanoblackReaper.cs | 2 + Items/Weapons/Rogue/ScarletDevil.cs | 2 + Items/Weapons/Summon/Endogenesis.cs | 2 + Items/Weapons/Summon/FlamsteedRing.cs | 10 ++ Items/Weapons/Summon/TemporalUmbrella.cs | 2 + Rarities/HotPink.cs | 45 +++++++- 22 files changed, 115 insertions(+), 107 deletions(-) diff --git a/Items/Accessories/AngelicAlliance.cs b/Items/Accessories/AngelicAlliance.cs index aca8d30b28..de51e2910f 100644 --- a/Items/Accessories/AngelicAlliance.cs +++ b/Items/Accessories/AngelicAlliance.cs @@ -3,6 +3,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -63,5 +64,7 @@ namespace CalamityMod.Items.Accessories AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly / 2f % 1f, [ new Color(255, 196, 55), new Color(255, 231, 107), new Color(255, 254, 243) ]); } } diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 2d446d05c8..89a8f45dd3 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -637,5 +637,7 @@ namespace CalamityMod.Items.Accessories AddDecraftCondition(CalamityConditions.DownedSupremeCalamitas, CalamityConditions.DownedExoMechs). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 6f); //alternates between emerald green and amber (BanditHueh) } } diff --git a/Items/Armor/Demonshade/DemonshadeHelm.cs b/Items/Armor/Demonshade/DemonshadeHelm.cs index 297a2e4bd0..1a3debbb51 100644 --- a/Items/Armor/Demonshade/DemonshadeHelm.cs +++ b/Items/Armor/Demonshade/DemonshadeHelm.cs @@ -80,5 +80,7 @@ namespace CalamityMod.Items.Armor.Demonshade public string ExtensionTexture => "CalamityMod/Items/Armor/Demonshade/DemonshadeHelm_Extension"; public Vector2 ExtensionSpriteOffset(PlayerDrawSet drawInfo) => new Vector2(0, -4f); + + public static Color DemonshadeRarityColor() => CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f); } } diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 55823811b7..ed39fe7901 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -415,110 +415,6 @@ namespace CalamityMod.Items { if (item.type == ModContent.ItemType()) nameLine.OverrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - - // Developer items - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(249, 197, 255); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(0, 0, 255); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = TheDanceofLight.GetSyncedLightColor(); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = ShatteredCommunity.GetRarityColor(); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = ShatteredCommunity.GetRarityColor(); - 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()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 4f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 4f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(129, 29, 149); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 255, 255), new Color(0xD1, 0xCC, 0x6F), 4f); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(220, 20, 60); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(207, 17, 117); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = new Color(227, 226, 180); - if (item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f); - if (item.type == ModContent.ItemType()) - { - nameLine.OverrideColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly / 2f % 1f, new Color[] - { - new Color(255, 196, 55), - new Color(255, 231, 107), - new Color(255, 254, 243) - }); - } - - // TODO -- for cleanliness, ALL color math should either be a one-line color swap or inside the item's own file - // The items that currently violate this are all below: - // Eternity, Flamsteed Ring, Earth - if (item.type == ModContent.ItemType()) - { - List colorSet = new List() - { - new Color(188, 192, 193), // white - new Color(157, 100, 183), // purple - new Color(249, 166, 77), // honey-ish orange - new Color(255, 105, 234), // pink - new Color(67, 204, 219), // sky blue - new Color(249, 245, 99), // bright yellow - new Color(236, 168, 247), // purplish pink - }; - if (nameLine != null) - { - int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 2 % colorSet.Count); - Color currentColor = colorSet[colorIndex]; - Color nextColor = colorSet[(colorIndex + 1) % colorSet.Count]; - nameLine.OverrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f); - } - } - if (item.type == ModContent.ItemType()) - { - if (Main.GlobalTimeWrappedHourly % 1f < 0.6f) - { - nameLine.OverrideColor = new Color(89, 229, 255); - } - else if (Main.GlobalTimeWrappedHourly % 1f < 0.8f) - { - nameLine.OverrideColor = Color.Lerp(new Color(89, 229, 255), Color.White, (Main.GlobalTimeWrappedHourly % 1f - 0.6f) / 0.2f); - } - else - { - nameLine.OverrideColor = Color.Lerp(Color.White, new Color(89, 229, 255), (Main.GlobalTimeWrappedHourly % 1f - 0.8f) / 0.2f); - } - } - if (item.type == ModContent.ItemType()) - { - List earthColors = new List() - { - Color.OrangeRed, - Color.MediumTurquoise, - Color.LimeGreen - }; - if (nameLine != null) - { - int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 2 % earthColors.Count); - Color currentColor = earthColors[colorIndex]; - Color nextColor = earthColors[(colorIndex + 1) % earthColors.Count]; - nameLine.OverrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f); - } - } } #endregion diff --git a/Items/Tools/CrystylCrusher.cs b/Items/Tools/CrystylCrusher.cs index 79a4fa8f1c..deeaaa7431 100644 --- a/Items/Tools/CrystylCrusher.cs +++ b/Items/Tools/CrystylCrusher.cs @@ -144,5 +144,7 @@ namespace CalamityMod.Items.Tools AddTile(). Register(); } + + public static Color RarityColor() => new Color(129, 29, 149); } } diff --git a/Items/Weapons/Magic/Eternity.cs b/Items/Weapons/Magic/Eternity.cs index 913475841f..f101f76a05 100644 --- a/Items/Weapons/Magic/Eternity.cs +++ b/Items/Weapons/Magic/Eternity.cs @@ -60,5 +60,22 @@ namespace CalamityMod.Items.Weapons.Magic AddTile(). Register(); } + + public static Color RarityColor() + { + List colorSet = [ + new Color(188, 192, 193), // white + new Color(157, 100, 183), // purple + new Color(249, 166, 77), // honey-ish orange + new Color(255, 105, 234), // pink + new Color(67, 204, 219), // sky blue + new Color(249, 245, 99), // bright yellow + new Color(236, 168, 247), // purplish pink + ]; + int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 2 % colorSet.Count); + Color currentColor = colorSet[colorIndex]; + Color nextColor = colorSet[(colorIndex + 1) % colorSet.Count]; + return Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f); + } } } diff --git a/Items/Weapons/Magic/StaffofBlushie.cs b/Items/Weapons/Magic/StaffofBlushie.cs index d89bd90aa0..6b21277e97 100644 --- a/Items/Weapons/Magic/StaffofBlushie.cs +++ b/Items/Weapons/Magic/StaffofBlushie.cs @@ -2,6 +2,7 @@ using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; @@ -44,5 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic AddTile(). Register(); } + + public static Color RarityColor() => Color.Blue; } } diff --git a/Items/Weapons/Magic/Sylvestaff.cs b/Items/Weapons/Magic/Sylvestaff.cs index 48bfd4d5f2..1e03004da4 100644 --- a/Items/Weapons/Magic/Sylvestaff.cs +++ b/Items/Weapons/Magic/Sylvestaff.cs @@ -111,5 +111,7 @@ namespace CalamityMod.Items.Weapons.Magic spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, scale, SpriteEffects.None, 0); return false; } + + public static Color RarityColor() => new Color(249, 197, 255); } } diff --git a/Items/Weapons/Melee/DraconicDestruction.cs b/Items/Weapons/Melee/DraconicDestruction.cs index b1b62226f8..035b9e70ee 100644 --- a/Items/Weapons/Melee/DraconicDestruction.cs +++ b/Items/Weapons/Melee/DraconicDestruction.cs @@ -62,5 +62,7 @@ namespace CalamityMod.Items.Weapons.Melee AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f); } } diff --git a/Items/Weapons/Melee/Earth.cs b/Items/Weapons/Melee/Earth.cs index bad5ef2a16..58cd6afbea 100644 --- a/Items/Weapons/Melee/Earth.cs +++ b/Items/Weapons/Melee/Earth.cs @@ -76,5 +76,14 @@ namespace CalamityMod.Items.Weapons.Melee AddTile(). Register(); } + + public static Color RarityColor() + { + List earthColors = [ Color.OrangeRed, Color.MediumTurquoise, Color.LimeGreen ]; + int colorIndex = (int)(Main.GlobalTimeWrappedHourly / 2 % earthColors.Count); + Color currentColor = earthColors[colorIndex]; + Color nextColor = earthColors[(colorIndex + 1) % earthColors.Count]; + return Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f); + } } } diff --git a/Items/Weapons/Melee/IllustriousKnives.cs b/Items/Weapons/Melee/IllustriousKnives.cs index fe800a7be0..2b9106d0ba 100644 --- a/Items/Weapons/Melee/IllustriousKnives.cs +++ b/Items/Weapons/Melee/IllustriousKnives.cs @@ -62,5 +62,7 @@ namespace CalamityMod.Items.Weapons.Melee AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); } } diff --git a/Items/Weapons/Melee/RedSun.cs b/Items/Weapons/Melee/RedSun.cs index cc2950afc7..b3df54f05a 100644 --- a/Items/Weapons/Melee/RedSun.cs +++ b/Items/Weapons/Melee/RedSun.cs @@ -117,5 +117,7 @@ namespace CalamityMod.Items.Weapons.Melee AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f); } } diff --git a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs index 1c3b293927..538b2cd881 100644 --- a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs +++ b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs @@ -2,6 +2,7 @@ using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -44,5 +45,7 @@ namespace CalamityMod.Items.Weapons.Melee AddTile(). Register(); } + + public static Color RarityColor() => new Color(227, 226, 180); } } diff --git a/Items/Weapons/Ranged/Contagion.cs b/Items/Weapons/Ranged/Contagion.cs index 1f941bd2dc..8db0621ddf 100644 --- a/Items/Weapons/Ranged/Contagion.cs +++ b/Items/Weapons/Ranged/Contagion.cs @@ -53,5 +53,7 @@ namespace CalamityMod.Items.Weapons.Ranged Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } + + public static Color RarityColor() => new Color(207, 17, 117); } } diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index 8e85adde27..35963d313e 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -76,5 +76,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(255, 255, 255), new Color(0xD1, 0xCC, 0x6F), 4f); } } diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs index 4a698709e7..fd621e9b44 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -82,5 +82,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddTile(). Register(); } + + public static Color RarityColor() => new Color(220, 20, 60); } } diff --git a/Items/Weapons/Rogue/NanoblackReaper.cs b/Items/Weapons/Rogue/NanoblackReaper.cs index 734bbd98e5..9dabaa5cbc 100644 --- a/Items/Weapons/Rogue/NanoblackReaper.cs +++ b/Items/Weapons/Rogue/NanoblackReaper.cs @@ -174,5 +174,7 @@ namespace CalamityMod.Items.Weapons.Rogue AddTile(). Register(); } + + public static Color RarityColor() => new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f); } } diff --git a/Items/Weapons/Rogue/ScarletDevil.cs b/Items/Weapons/Rogue/ScarletDevil.cs index e588335fb2..ddaac460be 100644 --- a/Items/Weapons/Rogue/ScarletDevil.cs +++ b/Items/Weapons/Rogue/ScarletDevil.cs @@ -53,5 +53,7 @@ namespace CalamityMod.Items.Weapons.Rogue AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f); } } diff --git a/Items/Weapons/Summon/Endogenesis.cs b/Items/Weapons/Summon/Endogenesis.cs index ef31f7934b..51a156fc22 100644 --- a/Items/Weapons/Summon/Endogenesis.cs +++ b/Items/Weapons/Summon/Endogenesis.cs @@ -101,5 +101,7 @@ namespace CalamityMod.Items.Weapons.Summon AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 4f); } } diff --git a/Items/Weapons/Summon/FlamsteedRing.cs b/Items/Weapons/Summon/FlamsteedRing.cs index 21714b2e37..8177b27702 100644 --- a/Items/Weapons/Summon/FlamsteedRing.cs +++ b/Items/Weapons/Summon/FlamsteedRing.cs @@ -204,5 +204,15 @@ namespace CalamityMod.Items.Weapons.Summon AddTile(). Register(); } + + public static Color RarityColor() + { + if (Main.GlobalTimeWrappedHourly % 1f < 0.6f) + return new Color(89, 229, 255); + else if (Main.GlobalTimeWrappedHourly % 1f < 0.8f) + return Color.Lerp(new Color(89, 229, 255), Color.White, (Main.GlobalTimeWrappedHourly % 1f - 0.6f) / 0.2f); + else + return Color.Lerp(Color.White, new Color(89, 229, 255), (Main.GlobalTimeWrappedHourly % 1f - 0.8f) / 0.2f); + } } } diff --git a/Items/Weapons/Summon/TemporalUmbrella.cs b/Items/Weapons/Summon/TemporalUmbrella.cs index 60ffc3da53..e0c75c272b 100644 --- a/Items/Weapons/Summon/TemporalUmbrella.cs +++ b/Items/Weapons/Summon/TemporalUmbrella.cs @@ -65,5 +65,7 @@ namespace CalamityMod.Items.Weapons.Summon AddTile(). Register(); } + + public static Color RarityColor() => CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 4f); } } diff --git a/Rarities/HotPink.cs b/Rarities/HotPink.cs index 8896ba5ad8..1f915e2bae 100644 --- a/Rarities/HotPink.cs +++ b/Rarities/HotPink.cs @@ -1,6 +1,14 @@ using System; using System.Collections.Generic; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Wings; +using CalamityMod.Items.Armor.Demonshade; +using CalamityMod.Items.Tools; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Graphics; @@ -23,13 +31,45 @@ namespace CalamityMod.Rarities { { ModContent.ItemType(), text => new TiredTailTextEffects(text) } }; + public static Dictionary> CustomColors = new() + { + { ModContent.ItemType(), AngelicAlliance.RarityColor }, + { ModContent.ItemType(), Contagion.RarityColor }, + { ModContent.ItemType(), CrystylCrusher.RarityColor }, + { ModContent.ItemType(), TheDanceofLight.GetSyncedLightColor }, + { ModContent.ItemType(), DemonshadeHelm.DemonshadeRarityColor }, + { ModContent.ItemType(), DemonshadeHelm.DemonshadeRarityColor }, + { ModContent.ItemType(), DemonshadeHelm.DemonshadeRarityColor }, + { ModContent.ItemType(), DraconicDestruction.RarityColor }, + { ModContent.ItemType(), Earth.RarityColor }, + { ModContent.ItemType(), Endogenesis.RarityColor }, + { ModContent.ItemType(), Eternity.RarityColor }, + { ModContent.ItemType(), FlamsteedRing.RarityColor }, + { ModContent.ItemType(), IllustriousKnives.RarityColor }, + { ModContent.ItemType(), NanoblackReaper.RarityColor }, + { ModContent.ItemType(), ShatteredCommunity.GetRarityColor }, // Yes, this reuses Shattered Community's color + { ModContent.ItemType(), ProfanedSoulCrystal.RarityColor }, + { ModContent.ItemType(), RedSun.RarityColor }, + { ModContent.ItemType(), ScarletDevil.RarityColor }, + { ModContent.ItemType(), ShatteredCommunity.GetRarityColor }, + { ModContent.ItemType(), SomaPrime.RarityColor }, + { ModContent.ItemType(), StaffofBlushie.RarityColor }, + { ModContent.ItemType(), Svantechnical.RarityColor }, + { ModContent.ItemType(), Sylvestaff.RarityColor }, + { ModContent.ItemType(), TemporalUmbrella.RarityColor }, + { ModContent.ItemType(), TriactisTruePaladinianMageHammerofMight.RarityColor } + }; + public static void Draw(Item Item, SpriteBatch spriteBatch, string text, int X, int Y, Color textColor, Color lightColor, float rotation, Vector2 origin, Vector2 baseScale, float time, bool renderTextSparkles, DynamicSpriteFont font) { + if (CustomColors.TryGetValue(Item.type, out var color)) // For items which use a custom item color, give them that custom color. + { + textColor = color.Invoke(); + } TextSnippet[] snippets = ChatManager.ParseMessage(text, textColor).ToArray(); - - if (CustomRarities.ContainsKey(Item.type)) //For items in the custom rarity table, give them custom rarity effects. + if (CustomRarities.ContainsKey(Item.type)) // For items in the custom rarity table, give them custom rarity effects. { for (int i = 0; i < snippets.Length; i++) { @@ -45,7 +85,6 @@ namespace CalamityMod.Rarities ChatManager.ConvertNormalSnippets(snippets); ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X, Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); - } public static void Draw(Item Item, string text, int X, int Y, float rotation, Vector2 origin, Vector2 baseScale, Color? textColor = null, Color? lightColor = null, bool? renderTextSparkles = null) From d7da77bc61e3f04f868758a026b15240df1199ad Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 4 Jul 2026 12:34:55 +0700 Subject: [PATCH 35/56] Orthocera/Cooper sentry nerfs --- Items/Weapons/Summon/OrthoceraShell.cs | 2 +- Projectiles/Summon/IceSentry.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Summon/OrthoceraShell.cs b/Items/Weapons/Summon/OrthoceraShell.cs index be0981aa6b..575526d69b 100644 --- a/Items/Weapons/Summon/OrthoceraShell.cs +++ b/Items/Weapons/Summon/OrthoceraShell.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 34; Item.height = 34; - Item.damage = 53; + Item.damage = 42; Item.mana = 10; Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.HoldUp; diff --git a/Projectiles/Summon/IceSentry.cs b/Projectiles/Summon/IceSentry.cs index 83cce4898f..1d5b62f0f9 100644 --- a/Projectiles/Summon/IceSentry.cs +++ b/Projectiles/Summon/IceSentry.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = 9; Projectile.localAI[1]++; - if (Projectile.localAI[1] > 2) + if (Projectile.localAI[1] > 3) { Projectile.localAI[1] = 0; @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[1] < 300f) Projectile.ai[1]++; - float delay = 60f - Projectile.ai[1] / 60f * 10f; + float delay = 60f - Projectile.ai[1] / 60f * 9f; if (Projectile.localAI[0] > delay) { Projectile.localAI[0] = 0f; From a6820c336118773cf56f8327bd5f15a3e1dac3a7 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 4 Jul 2026 12:35:52 +0700 Subject: [PATCH 36/56] Reduced Rod of Discord drop rate --- NPCs/CalamityGlobalNPCLoot.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index fc2a6c5711..1ffdf110b5 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -444,12 +444,12 @@ namespace CalamityMod.NPCs break; // Chaos Elemental - // Rod of Discord @ 1% Normal, 2% Expert+ + // Rod of Discord @ 0.8% Normal, 1% Expert+ case NPCID.ChaosElemental: // Remove the vanilla loot rule for Rod of Discord. npcLoot.RemoveWhere((rule) => rule is CommonDrop conditionalRule && conditionalRule.itemId == ItemID.RodofDiscord); // Define a replacement rule which has an increased chance. - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.RodofDiscord, 100, 50)); + npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.RodofDiscord, 125, 100)); break; // Illuminant Bat From 3ba62f38a31d6b85e2f3fec79cdf1d8c9a744d69 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 4 Jul 2026 14:27:45 +0700 Subject: [PATCH 37/56] remaining summoner i guess --- Items/Weapons/Summon/FlowersOfMortality.cs | 2 +- Items/Weapons/Summon/LegionofCelestia.cs | 2 +- Items/Weapons/Summon/TacticalPlagueEngine.cs | 4 ++-- Items/Weapons/Summon/VoidConcentrationStaff.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Summon/FlowersOfMortality.cs b/Items/Weapons/Summon/FlowersOfMortality.cs index 82327f01db..3ac9033742 100644 --- a/Items/Weapons/Summon/FlowersOfMortality.cs +++ b/Items/Weapons/Summon/FlowersOfMortality.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 36; Item.height = 36; - Item.damage = 72; + Item.damage = 70; Item.DamageType = DamageClass.Summon; Item.mana = 10; Item.useAnimation = Item.useTime = 24; diff --git a/Items/Weapons/Summon/LegionofCelestia.cs b/Items/Weapons/Summon/LegionofCelestia.cs index 761c97911c..af662a6ce2 100644 --- a/Items/Weapons/Summon/LegionofCelestia.cs +++ b/Items/Weapons/Summon/LegionofCelestia.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 100; Item.height = 128; - Item.damage = 57; + Item.damage = 50; Item.DamageType = DamageClass.Summon; Item.mana = 10; Item.useAnimation = Item.useTime = 24; diff --git a/Items/Weapons/Summon/TacticalPlagueEngine.cs b/Items/Weapons/Summon/TacticalPlagueEngine.cs index eac44d1874..85ca83d42c 100644 --- a/Items/Weapons/Summon/TacticalPlagueEngine.cs +++ b/Items/Weapons/Summon/TacticalPlagueEngine.cs @@ -13,13 +13,13 @@ namespace CalamityMod.Items.Weapons.Summon public class TacticalPlagueEngine : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - public const int BulletShootRate = 125; + public const int BulletShootRate = 120; public override void SetDefaults() { Item.width = 28; Item.height = 20; - Item.damage = 140; + Item.damage = 110; Item.mana = 10; Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.HoldUp; diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs index 1bb8e2897b..0a1cc384ab 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public static SummonTag summonTag = new SummonTag() { - MultiplicativeTagDamage = 0.3f, //Percentage of damage dealt added by the void. This is doubled by summons. This was tested - 1.5x was too weak to be worth 4 slots. + MultiplicativeTagDamage = 0.25f, //Percentage of damage dealt added by the void. This is doubled by summons. This was tested - 1.5x was too weak to be worth 4 slots. <-- (nvm) AllowsWhipStacking = true, TagOnHit = tagOnHit, TagModifyHitEffects = SummonTag.BlankTagModifyHit, From b3b3dbd5fc30eed78ad46cde30b56a585604c26d Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 4 Jul 2026 15:55:12 +0700 Subject: [PATCH 38/56] nvm phm sentries sentry balancing :///// --- Projectiles/Summon/PolypLauncherProjectile.cs | 2 +- Projectiles/Summon/PolypLauncherSentry.cs | 10 +++++----- Projectiles/Summon/RustyBeaconPulse.cs | 2 +- Projectiles/Summon/RustyDrone.cs | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Projectiles/Summon/PolypLauncherProjectile.cs b/Projectiles/Summon/PolypLauncherProjectile.cs index d73745b2f2..80dabcd0bd 100644 --- a/Projectiles/Summon/PolypLauncherProjectile.cs +++ b/Projectiles/Summon/PolypLauncherProjectile.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Summon dust_splash += 1; } int split = 0; - int shardAmt = Main.rand.Next(1, 5); + int shardAmt = Main.rand.Next(2, 4); while (split < shardAmt) { //Calculate the velocity of the projectile diff --git a/Projectiles/Summon/PolypLauncherSentry.cs b/Projectiles/Summon/PolypLauncherSentry.cs index 1c30e6c755..25e50d12c9 100644 --- a/Projectiles/Summon/PolypLauncherSentry.cs +++ b/Projectiles/Summon/PolypLauncherSentry.cs @@ -52,22 +52,22 @@ namespace CalamityMod.Projectiles.Summon Projectile.ai[0] -= 1f; return; } - Projectile.ai[1] += Main.rand.Next(1, 3); + Projectile.ai[1]++; - NPC potentialTarget = Projectile.Center.MinionHoming(800f, player, false); + NPC potentialTarget = Projectile.Center.MinionHoming(400f, player, false); if (Projectile.owner == Main.myPlayer && potentialTarget != null) { - if (Projectile.ai[1] > 40f) + if (Projectile.ai[1] > 75f) { Vector2 spawnPosition = new Vector2(Projectile.oldPosition.X + (Projectile.width / 2), Projectile.oldPosition.Y + (Projectile.height / 2)); float shootSpeed = 16f; float gravity = -PolypLauncherProjectile.Gravity; float distance = Vector2.Distance(spawnPosition, potentialTarget.Center); - float angle = 0.25f * (float)Math.Asin(MathHelper.Clamp(gravity * distance * 1.5f / (float)Math.Pow(shootSpeed, 2), -1f, 1f)); + float angle = 0.25f * MathF.Asin(MathHelper.Clamp(gravity * distance * 1.5f / MathF.Pow(shootSpeed, 2f), -1f, 1f)); - Vector2 velocity = new Vector2(0f, -shootSpeed).RotatedBy(angle).RotatedByRandom(0.1f); + Vector2 velocity = new Vector2(0f, -shootSpeed).RotatedBy(angle).RotatedByRandom(0.05f); velocity.X *= (potentialTarget.Center.X - Projectile.Center.X < 0).ToDirectionInt(); Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPosition, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); diff --git a/Projectiles/Summon/RustyBeaconPulse.cs b/Projectiles/Summon/RustyBeaconPulse.cs index c8a403f834..2256e9fa3f 100644 --- a/Projectiles/Summon/RustyBeaconPulse.cs +++ b/Projectiles/Summon/RustyBeaconPulse.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon } Projectile.Opacity = 1f - (float)Math.Pow(LifetimeCompletion, 1.56); - Projectile.scale = MathHelper.Lerp(0.5f, 7f, LifetimeCompletion); + Projectile.scale = MathHelper.Lerp(0.5f, 5f, LifetimeCompletion); Projectile.rotation += Projectile.localAI[0] * 0.012f; } diff --git a/Projectiles/Summon/RustyDrone.cs b/Projectiles/Summon/RustyDrone.cs index 4435cc6f3d..3f8d7012ba 100644 --- a/Projectiles/Summon/RustyDrone.cs +++ b/Projectiles/Summon/RustyDrone.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; // Hover in place. - Projectile.velocity = -Vector2.UnitY * (float)Math.Sin(MathHelper.TwoPi * Projectile.timeLeft / 96f) * 3f; + Projectile.velocity = -Vector2.UnitY * MathF.Sin(MathHelper.TwoPi * Projectile.timeLeft / 96f) * 3f; // Look at nearby enemies. NPC potentialTarget = Projectile.Center.MinionHoming(1000f, Owner); @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.spriteDirection = (Projectile.Center.X < potentialTarget.Center.X).ToDirectionInt(); // Release pulses of irradiated energy. - if (Projectile.timeLeft % RustyBeaconPrototype.PulseReleaseRate == RustyBeaconPrototype.PulseReleaseRate / 2) + if (Projectile.timeLeft % RustyBeaconPrototype.PulseReleaseRate == 1) { SoundEngine.PlaySound(SoundID.DD2_WitherBeastAuraPulse with { Volume = 1.6f }, Projectile.Center); From 8014df0d017ca889499ff8d1be3c8d946e1629fd Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Sat, 4 Jul 2026 21:45:14 -0500 Subject: [PATCH 39/56] shred can crit --- Buffs/DamageOverTime/Shred.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Buffs/DamageOverTime/Shred.cs b/Buffs/DamageOverTime/Shred.cs index 6b893d8bc9..885ef41cf5 100644 --- a/Buffs/DamageOverTime/Shred.cs +++ b/Buffs/DamageOverTime/Shred.cs @@ -72,6 +72,7 @@ namespace CalamityMod.Buffs.DamageOverTime Projectile tick = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), bleedTickDamage, 0f, applicator.whoAmI, target.whoAmI); tick.DamageType = DamageClass.Ranged; // Uncommon for DirectStrikes, but it needs to be able to crit. + tick.CritChance = (int)applicator.GetTotalCritChance(DamageClass.Ranged); // All ticks of Shred have a 3x base crit multiplier and have supercrits enabled. CalamityGlobalProjectile cgp = tick.Calamity(); From cce38d6ad11a7d0b62b89a1fdb265cebdfe65b9a Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sun, 5 Jul 2026 18:56:15 +0700 Subject: [PATCH 40/56] warn crunching part 1 --- Buffs/DamageOverTime/SagePoison.cs | 1 - Buffs/DamageOverTime/TrueVulnerabilityHex.cs | 1 - Buffs/DamageOverTime/Vaporfied.cs | 2 -- Buffs/DamageOverTime/VulnerabilityHex.cs | 1 - Buffs/StatDebuffs/GalvanicCorrosion.cs | 2 -- Items/Weapons/Magic/VenusianTrident.cs | 1 - Items/Weapons/Summon/SarosPossession.cs | 1 - Projectiles/Melee/AmidiasWhirlpool.cs | 1 - Projectiles/Melee/ScorpiusConstellation.cs | 2 -- Projectiles/Ranged/AbyssalFire.cs | 15 --------------- Utilities/NPCUtils.cs | 12 ------------ 11 files changed, 39 deletions(-) diff --git a/Buffs/DamageOverTime/SagePoison.cs b/Buffs/DamageOverTime/SagePoison.cs index ba20aefe40..66f26cdea1 100644 --- a/Buffs/DamageOverTime/SagePoison.cs +++ b/Buffs/DamageOverTime/SagePoison.cs @@ -3,7 +3,6 @@ using CalamityMod.Projectiles.Summon; using CalamityMod.Systems.Collections; using Terraria; using Terraria.ModLoader; -using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs index 2145aba8db..62fe6749ab 100644 --- a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs +++ b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs @@ -8,7 +8,6 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { diff --git a/Buffs/DamageOverTime/Vaporfied.cs b/Buffs/DamageOverTime/Vaporfied.cs index 47068b9b71..ebc6f14169 100644 --- a/Buffs/DamageOverTime/Vaporfied.cs +++ b/Buffs/DamageOverTime/Vaporfied.cs @@ -1,12 +1,10 @@ using CalamityMod.DataStructures; -using CalamityMod.NPCs; using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs index 2ce9745729..a0b2a92520 100644 --- a/Buffs/DamageOverTime/VulnerabilityHex.cs +++ b/Buffs/DamageOverTime/VulnerabilityHex.cs @@ -8,7 +8,6 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.DamageOverTime { diff --git a/Buffs/StatDebuffs/GalvanicCorrosion.cs b/Buffs/StatDebuffs/GalvanicCorrosion.cs index 7cafbbd2d4..7229f2502f 100644 --- a/Buffs/StatDebuffs/GalvanicCorrosion.cs +++ b/Buffs/StatDebuffs/GalvanicCorrosion.cs @@ -1,10 +1,8 @@ using CalamityMod.DataStructures; -using CalamityMod.NPCs; using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Systems.Collections; namespace CalamityMod.Buffs.StatDebuffs { diff --git a/Items/Weapons/Magic/VenusianTrident.cs b/Items/Weapons/Magic/VenusianTrident.cs index c98dcc9c6a..455b1b864c 100644 --- a/Items/Weapons/Magic/VenusianTrident.cs +++ b/Items/Weapons/Magic/VenusianTrident.cs @@ -3,7 +3,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using CalamityMod.Systems.Collections; using CalamityMod.Rarities; -using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Summon/SarosPossession.cs b/Items/Weapons/Summon/SarosPossession.cs index 85e6139d53..ab5351a978 100644 --- a/Items/Weapons/Summon/SarosPossession.cs +++ b/Items/Weapons/Summon/SarosPossession.cs @@ -90,7 +90,6 @@ namespace CalamityMod.Items.Weapons.Summon float barScale = 1/(32f/TextureAssets.Item[Type].Width()) * 0.9f; Vector2 barOrigin = barBG.Size() * 0.5f; - float yOffset = 0f; Vector2 drawPos = position + new Vector2(0, (float)TextureAssets.Item[Type].Height() * 0.5f) * scale; Rectangle frameCrop = new Rectangle(0, 0, (int)((fill) * barFG.Width), barFG.Height); Color colorBG = Color.Black; diff --git a/Projectiles/Melee/AmidiasWhirlpool.cs b/Projectiles/Melee/AmidiasWhirlpool.cs index dc4167d4af..e4bbcfa42f 100644 --- a/Projectiles/Melee/AmidiasWhirlpool.cs +++ b/Projectiles/Melee/AmidiasWhirlpool.cs @@ -69,7 +69,6 @@ namespace CalamityMod.Projectiles.Melee } else if (homeTracker == 1) { - int inc; Projectile.rotation -= MathHelper.Pi / 30f; Vector2 projCenter = Projectile.Center; float homingRange = 150f; diff --git a/Projectiles/Melee/ScorpiusConstellation.cs b/Projectiles/Melee/ScorpiusConstellation.cs index b7bc4ae366..08c3f54aa1 100644 --- a/Projectiles/Melee/ScorpiusConstellation.cs +++ b/Projectiles/Melee/ScorpiusConstellation.cs @@ -6,7 +6,6 @@ using CalamityMod.Utilities.Daybreak; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -50,7 +49,6 @@ namespace CalamityMod.Projectiles.Melee var StarScale = 0.2f; Projectile.scale = 0.75f*MathF.Min(MathF.Pow((lifetime- Projectile.timeLeft)/ 20f,2f), 1f); Projectile.Opacity = MathF.Min(Projectile.timeLeft / 20f, 1f); - Vector2 ada = default; void SpawnStar(Vector2 offset, float intensity, int flashOffset = 0, int flashMod = 60) { offset += new Vector2(5, 49.25f); //this centers the constellation diff --git a/Projectiles/Ranged/AbyssalFire.cs b/Projectiles/Ranged/AbyssalFire.cs index 039a95a092..f878da3300 100644 --- a/Projectiles/Ranged/AbyssalFire.cs +++ b/Projectiles/Ranged/AbyssalFire.cs @@ -1,20 +1,14 @@ using System; -using System.Collections.Generic; -using System.Linq; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.DataStructures; -using CalamityMod.Dusts; -using CalamityMod.Effects; using CalamityMod.Enums; -using CalamityMod.Graphics.Metaballs; using CalamityMod.Graphics.Primitives; using CalamityMod.NPCs; using CalamityMod.Packets.Entities; using CalamityMod.Particles; using CalamityMod.Utilities.Daybreak; using CalamityMod.Utilities.Daybreak.Buffers; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -22,7 +16,6 @@ using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; -using Terraria.WorldBuilding; namespace CalamityMod.Projectiles.Ranged { @@ -153,15 +146,7 @@ namespace CalamityMod.Projectiles.Ranged } private float PrimitiveWidthFunction(float completionRatio, Vector2 vertexPos) { - float width; float maxBodyWidth = Projectile.scale * MaxLaserWidth * (1 + MathF.Pow(Utils.GetLerpValue(450, 500, VoidragonHoldout.ModProjectile().beamTimer, true), 3.5f) * 4); - float shrinkRatio = 0.018f; - - //if (completionRatio < shrinkRatio) - // width = MathF.Sin(completionRatio / shrinkRatio * MathHelper.PiOver2) * maxBodyWidth + shrinkRatio; - //else - // width = Utils.Remap(completionRatio, shrinkRatio, 1f, maxBodyWidth, 0f); - return maxBodyWidth * Utils.GetLerpValue(0f, 0.05f, completionRatio, true) * Utils.GetLerpValue(LaserLength, LaserLength - 0.1f, completionRatio, true); } diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index 9b41cd6be3..a53da1a1f8 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -1,18 +1,11 @@ using System; -using System; -using System.Collections.Generic; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; -using System.Reflection; using CalamityMod.Balancing; -using CalamityMod.Balancing; -using CalamityMod.CalPlayer; using CalamityMod.DataStructures; using CalamityMod.Enums; using CalamityMod.Events; -using CalamityMod.Items.Accessories; -using CalamityMod.Items.Armor; using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.OldDuke; @@ -22,22 +15,17 @@ using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.Yharon; using CalamityMod.Packets; using CalamityMod.Systems.Collections; -using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria; using Terraria.Audio; using Terraria.Chat; using Terraria.DataStructures; using Terraria.GameContent; using Terraria.ID; -using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; using static Terraria.ModLoader.ModContent; namespace CalamityMod From d08fefbb3dbdb0432274eef349cab258ee236217 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sun, 5 Jul 2026 21:08:18 +0700 Subject: [PATCH 41/56] Fixed name rerolls on License use. thank you windy. --- ILEditing/ILChangesLoading.cs | 1 + ILEditing/MechanicILChanges.cs | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 67b5ec5794..d57155929a 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -63,6 +63,7 @@ namespace CalamityMod.ILEditing // Mechanics / features On_NPC.ApplyTileCollision += AllowFusionFeederToDigThroughSand; + On_NPC.RerollVariation += AllowPatronNameRerollsOnLicenseUse; IL_Player.ApplyEquipFunctional += ScopesRequireVisibilityToZoom; IL_Player.Hurt_PlayerDeathReason_int_int_refHurtInfo_bool_bool_int_bool_float_float_float += DodgeMechanicAdjustments; On_Player.PutHallowedArmorSetBonusOnCooldown += AddHolyProtectionCooldown; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index f7466891f6..0a75a8e37e 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -30,6 +30,7 @@ using CalamityMod.Tiles; using CalamityMod.Utilities.Daybreak; using CalamityMod.Walls; using CalamityMod.Walls.UnsafeWalls; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Mono.Cecil.Cil; @@ -326,6 +327,27 @@ namespace CalamityMod.ILEditing } #endregion + #region Allow Patron Name Rerolls on License Use + private static bool AllowPatronNameRerollsOnLicenseUse(On_NPC.orig_RerollVariation orig, NPC self) + { + bool success = orig(self); + if (success) + { + if (self.type == NPCID.TownBunny) + CalamityWorld.bunnyName = false; + if (self.type == NPCID.TownCat) + CalamityWorld.catName = false; + if (self.type == NPCID.TownDog) + CalamityWorld.dogName = false; + + if (!self.TryGetGlobalNPC(out var calGlobalTownNPC)) + return success; + calGlobalTownNPC.setNewName = true; + } + return success; + } + #endregion + #region Prevent Diabolists from Dropping Stuff in GFB Before Plantera private static void PreventDiabolistLootLogic(On_NPC.orig_NPCLoot orig, NPC self) { From 7118fb4db9f38696218fda53e63c03cb8ec946fa Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sun, 5 Jul 2026 21:30:07 +0700 Subject: [PATCH 42/56] warn crunching mini --- Items/Fishing/Spadefish.cs | 2 -- Items/Weapons/Rogue/EclipsesFall.cs | 1 - Projectiles/Rogue/CosmicScythe.cs | 2 -- Projectiles/Rogue/DuststormInABottleHoldout.cs | 2 -- 4 files changed, 7 deletions(-) diff --git a/Items/Fishing/Spadefish.cs b/Items/Fishing/Spadefish.cs index a2172c962b..5b21ce7e7a 100644 --- a/Items/Fishing/Spadefish.cs +++ b/Items/Fishing/Spadefish.cs @@ -290,8 +290,6 @@ namespace CalamityMod.Items.Fishing bool reset = false; - float oldSpin = 0; - int digDir = 0; float spinSin => MathF.Sin(spin); public override void SetDefaults() diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index b4bbba795e..e138faec61 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -495,7 +495,6 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; public static int lifetime => 1200; - Color? color = null; public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; diff --git a/Projectiles/Rogue/CosmicScythe.cs b/Projectiles/Rogue/CosmicScythe.cs index c285d8f872..76d5abf7f7 100644 --- a/Projectiles/Rogue/CosmicScythe.cs +++ b/Projectiles/Rogue/CosmicScythe.cs @@ -12,8 +12,6 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Projectiles/Boss/SignusScythe"; - private int originalDamage; - public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; diff --git a/Projectiles/Rogue/DuststormInABottleHoldout.cs b/Projectiles/Rogue/DuststormInABottleHoldout.cs index 194a525056..cac45d647a 100644 --- a/Projectiles/Rogue/DuststormInABottleHoldout.cs +++ b/Projectiles/Rogue/DuststormInABottleHoldout.cs @@ -20,8 +20,6 @@ namespace CalamityMod.Projectiles.Rogue public override int StartupTime { get; set; } public override int CooldownTime { get; set; } - bool isChannelable = false; - int explodeTimer = 0; public override void Defaults() From 13fb338873a89800b202b0db7684115e03950aa1 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sun, 5 Jul 2026 21:37:21 +0700 Subject: [PATCH 43/56] BaseWormHitboxNPC no longer counts toward Radar --- NPCs/BaseWormNPC.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NPCs/BaseWormNPC.cs b/NPCs/BaseWormNPC.cs index 94fd866295..f37a581f3d 100644 --- a/NPCs/BaseWormNPC.cs +++ b/NPCs/BaseWormNPC.cs @@ -652,6 +652,7 @@ namespace CalamityMod.NPCs NPC.lifeMax = 10000; NPC.knockBackResist = 0; NPC.noTileCollide = true; + NPC.dontCountMe = true; NPC.aiStyle = -1; } From 2287d96e38b3e1ea9eaabce561474a5cb38d5610 Mon Sep 17 00:00:00 2001 From: Nathanael Overton Date: Tue, 7 Jul 2026 17:32:57 -0400 Subject: [PATCH 44/56] correct IVDrip rarity --- Items/Accessories/IVDripOnTheRocks.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Accessories/IVDripOnTheRocks.cs b/Items/Accessories/IVDripOnTheRocks.cs index d934e91c64..d8054bf039 100644 --- a/Items/Accessories/IVDripOnTheRocks.cs +++ b/Items/Accessories/IVDripOnTheRocks.cs @@ -68,8 +68,8 @@ namespace CalamityMod.Items.Accessories { Item.width = 58; Item.height = 60; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; - Item.rare = ItemRarityID.Lime; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; Item.accessory = true; } From dcfa8ad9e18c61a8286ecd1de3e20f1c273297d1 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Wed, 1 Jul 2026 12:04:55 -0500 Subject: [PATCH 45/56] New Keybind system for accessories/held items --- CalPlayer/CalamityPlayer.cs | 27 +-- CalamityKeybinds.cs | 197 +++++++++++++++--- Items/Accessories/AngelicAlliance.cs | 3 +- Items/Accessories/AscendantInsignia.cs | 2 +- Items/Accessories/BlazingCore.cs | 3 +- Items/Accessories/BlunderBooster.cs | 7 +- Items/Accessories/DeadshotBrooch.cs | 4 +- Items/Accessories/FlameLickedShell.cs | 3 +- Items/Accessories/InterstellarStompers.cs | 2 +- Items/Accessories/PlaguedFuelPack.cs | 7 +- Items/Accessories/PlanebreakersPouch.cs | 4 +- Items/Accessories/SpectralVeil.cs | 2 +- Items/Accessories/SpringStool.cs | 14 +- Items/Accessories/ThePointer.cs | 5 +- Items/Accessories/TheTransformer.cs | 2 +- .../en-US/Mods.CalamityMod.Keybinds.hjson | 18 +- .../en-US/Mods.CalamityMod.Misc.hjson | 1 + Systems/Collections/CalamityItemSets.cs | 5 + Utilities/ItemUtils.cs | 19 ++ 19 files changed, 243 insertions(+), 82 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 4bfba5edef..0ee05b38fa 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -957,7 +957,7 @@ namespace CalamityMod.CalPlayer public bool procDodgeEffects = false; public bool nanotech = false; public int nanotechHitCooldown = 0; - public bool deadshotBrooch = false; + public Item ammoCycleItem = null; public bool shadowMinions = false; public bool statisMinions = false; public bool alchFlask = false; @@ -1068,6 +1068,7 @@ namespace CalamityMod.CalPlayer public bool thiefsDime = false; public bool dynamoStemCells = false; public bool etherealExtorter = false; + public Item AccessoryParryItem = null; public bool blazingCore = false; public int blazingCoreParry = 0; public int blazingCoreSuccessfulParry = 0; @@ -1111,7 +1112,7 @@ namespace CalamityMod.CalPlayer public bool spectralVeil = false; public int spectralVeilImmunity = 0; /// Check for if the player has Plagued Fuel Pack OR Blunder Booster equipped. - public bool hasJetpack = false; + public Item rogueDashItem = null; public bool hasEngineDash = false; public bool plaguedFuelPack = false; public bool blunderBooster = false; @@ -2396,7 +2397,7 @@ namespace CalamityMod.CalPlayer v8000Engine = false; nanotech = false; nanotechHitCooldown = 0; - deadshotBrooch = false; + ammoCycleItem = null; tesla = false; teslaVisuals = true; ascendantInsignia = false; @@ -2474,6 +2475,7 @@ namespace CalamityMod.CalPlayer thiefsDime = false; dynamoStemCells = false; etherealExtorter = false; + AccessoryParryItem = null; blazingCore = false; voltaicJelly = false; jellyChargedBattery = false; @@ -2613,7 +2615,7 @@ namespace CalamityMod.CalPlayer filthyGlove = false; sandCloak = false; spectralVeil = false; - hasJetpack = false; + rogueDashItem = null; hasEngineDash = false; plaguedFuelPack = false; blunderBooster = false; @@ -3468,7 +3470,7 @@ namespace CalamityMod.CalPlayer if (Player.dead) return; - if (ascendantInsignia && Main.myPlayer == Player.whoAmI && CalamityKeybinds.AscendantInsigniaHotKey.JustPressed && ascendantInsigniaCooldown <= 0) + if (ascendantInsignia && Main.myPlayer == Player.whoAmI && FindAccessory().JustPressedKeybind() && ascendantInsigniaCooldown <= 0) { var source = Player.GetSource_Accessory(FindAccessory()); Projectile.NewProjectile(source, Player.Center - Vector2.UnitY * 45f, Vector2.Zero, ProjectileType(), 0, 0f); @@ -3478,7 +3480,7 @@ namespace CalamityMod.CalPlayer } int numOfBlobs = Player.ownedProjectileCounts[ProjectileType()]; - if (transformer && numOfBlobs > 0 && Main.myPlayer == Player.whoAmI && CalamityKeybinds.TransformerHotKey.JustPressed && transformerCooldown <= 0 && true) // Add check if projectiles are active + if (transformer && numOfBlobs > 0 && Main.myPlayer == Player.whoAmI && FindAccessory().JustPressedKeybind() && transformerCooldown <= 0 && true) // Add check if projectiles are active { // Go fire all the blobs int cooldownTime = 300; @@ -3505,7 +3507,8 @@ namespace CalamityMod.CalPlayer } //Only increment the slam if not on ground, not mounted, not on rope, not hooked, not tongued, otherwise reset slam time to zero - if (CalamityKeybinds.GravistarSabatonHotkey.JustPressed && gSabatonHotkeyFallWindup < 0) + + if (gSabaton && FindAccessory().JustPressedKeybind() && gSabatonHotkeyFallWindup < 0) gSabatonHotkeyFallWindup = 0; if (gSabaton && gSabatonHotkeyFallWindup >= 0 && Main.myPlayer == Player.whoAmI && (Player.velocity.Y != 0) && !Player.pulley && !Player.mount.Active && Player.grappling[0] == -1 && !Player.tongued) { @@ -3551,7 +3554,7 @@ namespace CalamityMod.CalPlayer } } } - if (CalamityKeybinds.AngelicAllianceHotKey.JustPressed && angelicAlliance && Main.myPlayer == Player.whoAmI && !divineBless && !Player.HasCooldown(Cooldowns.DivineBless.ID)) + if (angelicAlliance && Main.myPlayer == Player.whoAmI && FindAccessory().JustPressedKeybind() && !divineBless && !Player.HasCooldown(Cooldowns.DivineBless.ID)) { Player.AddBuff(BuffType(), AngelicAlliance.DivineBlessDuration, false); SoundEngine.PlaySound(AngelicAlliance.ActivationSound, Player.Center); @@ -3578,7 +3581,7 @@ namespace CalamityMod.CalPlayer Player.HealPlayer(AngelicAlliance.HealPerAngelSpawned); } } - if (CalamityKeybinds.SpectralVeilHotKey.JustPressed && spectralVeil && Main.myPlayer == Player.whoAmI && rogueStealth >= rogueStealthMax * 0.25f && + if (spectralVeil && Main.myPlayer == Player.whoAmI && FindAccessory().JustPressedKeybind() && rogueStealth >= rogueStealthMax * 0.25f && wearingRogueArmor && rogueStealthMax > 0) { if (!Player.chaosState) @@ -3624,7 +3627,7 @@ namespace CalamityMod.CalPlayer } } } - if (CalamityKeybinds.BoosterDashHotKey.JustPressed && hasJetpack && Main.myPlayer == Player.whoAmI && rogueStealth >= rogueStealthMax * 0.25f && + if (rogueDashItem != null && Main.myPlayer == Player.whoAmI && rogueDashItem.JustPressedKeybind() && rogueStealth >= rogueStealthMax * 0.25f && wearingRogueArmor && rogueStealthMax > 0 && !Player.HasCooldown(RogueBooster.ID) && !Player.mount.Active) { jetPackDash = blunderBooster ? 15 : 10; @@ -3635,7 +3638,7 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(SoundID.Item34, Player.Center); } - if (CalamityKeybinds.AmmoCycleHotkey.JustPressed && deadshotBrooch) + if (ammoCycleItem != null && ammoCycleItem.JustPressedKeybind()) { SoundEngine.PlaySound(SoundID.Item149, Player.Center); @@ -3734,7 +3737,7 @@ namespace CalamityMod.CalPlayer else ArmorSetBonusKeyHeldTimer = 0; - if (CalamityKeybinds.AccessoryParryHotKey.JustPressed) + if (AccessoryParryItem != null && AccessoryParryItem.JustPressedKeybind()) { if (blazingCore && blazingCoreParry == 0 && blazingCoreSuccessfulParry == 0) { diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index 62b5f44039..56fd1f6497 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -1,72 +1,207 @@ -using Terraria.ModLoader; +using System; +using System.Linq; +using CalamityMod.Systems.Collections; +using Terraria; +using Terraria.ModLoader; namespace CalamityMod { public class CalamityKeybinds : ModSystem { - public static ModKeybind AccessoryParryHotKey { get; private set; } public static ModKeybind AdrenalineHotKey { get; private set; } - public static ModKeybind AmmoCycleHotkey { get; private set; } - public static ModKeybind AngelicAllianceHotKey { get; private set; } public static ModKeybind ArmorSetBonusHotKey { get; private set; } - public static ModKeybind AscendantInsigniaHotKey { get; private set; } - public static ModKeybind BoosterDashHotKey { get; private set; } public static ModKeybind DashHotkey { get; private set; } public static ModKeybind ExoChairSlowdownHotkey { get; private set; } public static ModKeybind GodSlayerDashHotKey { get; private set; } - public static ModKeybind GravistarSabatonHotkey { get; private set; } public static ModKeybind NormalityRelocatorHotKey { get; private set; } public static ModKeybind RageHotKey { get; private set; } - public static ModKeybind SpectralVeilHotKey { get; private set; } - public static ModKeybind SpringStoolJumpHotKey { get; private set; } - public static ModKeybind TransformerHotKey { get; private set; } - public static ModKeybind SwitchGravityHotkey {get; private set;} + public static ModKeybind SwitchGravityHotkey { get; private set; } public static ModKeybind ExpandDebuffInfo { get; private set; } - public static ModKeybind ThePointerLock {get; private set;} + + + public static ModKeybind HeldItem { get; private set; } + public static ModKeybind Accessory1 { get; private set; } + public static ModKeybind Accessory2 { get; private set; } + public static ModKeybind Accessory3 { get; private set; } + public static ModKeybind Accessory4 { get; private set; } + public static ModKeybind Accessory5 { get; private set; } + public static ModKeybind Accessory6 { get; private set; } + public static ModKeybind Accessory7 { get; private set; } + + public static ModKeybind[] AccessoryKeybinds = []; public override void Load() { // Register keybinds - AccessoryParryHotKey = KeybindLoader.RegisterKeybind(Mod, "ActivateAccessoryParry", "N"); AdrenalineHotKey = KeybindLoader.RegisterKeybind(Mod, "AdrenalineMode", "B"); - AmmoCycleHotkey = KeybindLoader.RegisterKeybind(Mod, "AmmoCycle", "Mouse3"); - AngelicAllianceHotKey = KeybindLoader.RegisterKeybind(Mod, "AngelicAllianceBlessing", "G"); ArmorSetBonusHotKey = KeybindLoader.RegisterKeybind(Mod, "ArmorSetBonus", "Y"); - AscendantInsigniaHotKey = KeybindLoader.RegisterKeybind(Mod, "AscendantInsigniaHotKey", "K"); - BoosterDashHotKey = KeybindLoader.RegisterKeybind(Mod, "BoosterDash", "Q"); DashHotkey = KeybindLoader.RegisterKeybind(Mod, "DashDoubleTapOverride", "F"); ExoChairSlowdownHotkey = KeybindLoader.RegisterKeybind(Mod, "ExoChairSlowDown", "RightShift"); GodSlayerDashHotKey = KeybindLoader.RegisterKeybind(Mod, "GodSlayerDash", "H"); - GravistarSabatonHotkey = KeybindLoader.RegisterKeybind(Mod, "GravistarSabatonHotkey", "X"); NormalityRelocatorHotKey = KeybindLoader.RegisterKeybind(Mod, "NormalityRelocator", "Z"); RageHotKey = KeybindLoader.RegisterKeybind(Mod, "RageMode", "V"); - SpectralVeilHotKey = KeybindLoader.RegisterKeybind(Mod, "SpectralVeilTeleport", "Z"); - SpringStoolJumpHotKey = KeybindLoader.RegisterKeybind(Mod, "SpringStoolJumpHotKey", "U"); - TransformerHotKey = KeybindLoader.RegisterKeybind(Mod, "TransformerHotKey", "K"); SwitchGravityHotkey = KeybindLoader.RegisterKeybind(Mod, "GravitySwapOverride", "T"); ExpandDebuffInfo = KeybindLoader.RegisterKeybind(Mod, "ExpandDebuffInfo", "LeftControl"); - ThePointerLock = KeybindLoader.RegisterKeybind(Mod, "ThePointerLock", "N"); + + HeldItem = KeybindLoader.RegisterKeybind(Mod, "HeldItem", "NumPad0"); + Accessory1 = KeybindLoader.RegisterKeybind(Mod, "Accessory1", "NumPad1"); + Accessory2 = KeybindLoader.RegisterKeybind(Mod, "Accessory2", "NumPad2"); + Accessory3 = KeybindLoader.RegisterKeybind(Mod, "Accessory3", "NumPad3"); + Accessory4 = KeybindLoader.RegisterKeybind(Mod, "Accessory4", "NumPad4"); + Accessory5 = KeybindLoader.RegisterKeybind(Mod, "Accessory5", "NumPad5"); + Accessory6 = KeybindLoader.RegisterKeybind(Mod, "Accessory6", "NumPad6"); + Accessory7 = KeybindLoader.RegisterKeybind(Mod, "Accessory7", "NumPad7"); + + AccessoryKeybinds = [ + Accessory1, + Accessory2, + Accessory3, + Accessory4, + Accessory5, + Accessory6, + Accessory7 + ]; } public override void Unload() { - AccessoryParryHotKey = null; AdrenalineHotKey = null; - AmmoCycleHotkey = null; - AngelicAllianceHotKey = null; ArmorSetBonusHotKey = null; - AscendantInsigniaHotKey = null; - BoosterDashHotKey = null; DashHotkey = null; ExoChairSlowdownHotkey = null; GodSlayerDashHotKey = null; - GravistarSabatonHotkey = null; NormalityRelocatorHotKey = null; RageHotKey = null; - SpectralVeilHotKey = null; - SpringStoolJumpHotKey = null; - TransformerHotKey = null; ExpandDebuffInfo = null; + + Accessory1 = null; + Accessory2 = null; + Accessory3 = null; + Accessory4 = null; + Accessory5 = null; + Accessory6 = null; + Accessory1 = null; + Accessory7 = null; + + AccessoryKeybinds = null; + } + } + + public static class CalamityKeybindsExtensions + { + /// + /// Gets if the Calamity keybind for the given item was just pressed.
+ /// Automatically adjusts between Held Item and Accessory Ability keybinds based on if the item is held and equip order of accessories + ///
+ /// + /// + /// + public static bool JustPressedKeybind(this Item item) + { + if (item == Main.LocalPlayer.HeldItem) + return CalamityKeybinds.HeldItem.JustPressed; + + if (!CalamityItemSets.HasAccessoryKeybind[item.type]) + throw new InvalidOperationException("Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set"); + + int keybindToUse = 0; + + for (var i = 0; i < Main.LocalPlayer.armor.Length; i++) + { + if (Main.LocalPlayer.armor[i].type == item.type) + break; + if (CalamityItemSets.HasAccessoryKeybind[Main.LocalPlayer.armor[i].type]) + keybindToUse++; + } + return CalamityKeybinds.AccessoryKeybinds[keybindToUse].JustPressed; + } + + /// + /// Gets if the Calamity keybind for the given item was just released.
+ /// Automatically adjusts between Held Item and Accessory Ability keybinds based on if the item is held and equip order of accessories + ///
+ /// + /// + /// + public static bool JustReleasedKeybind(this Item item) + { + + if (item == Main.LocalPlayer.HeldItem) + return CalamityKeybinds.HeldItem.JustReleased; + + if (!CalamityItemSets.HasAccessoryKeybind[item.type]) + throw new InvalidOperationException("Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set"); + + int keybindToUse = 0; + + for (var i = 0; i < Main.LocalPlayer.armor.Length; i++) + { + if (Main.LocalPlayer.armor[i].type == item.type) + break; + if (CalamityItemSets.HasAccessoryKeybind[Main.LocalPlayer.armor[i].type]) + keybindToUse++; + } + + return CalamityKeybinds.AccessoryKeybinds[keybindToUse].JustReleased; + } + + + /// + /// Gets if the Calamity keybind for the given item is currently held down.
+ /// Automatically adjusts between Held Item and Accessory Ability keybinds based on if the item is held and equip order of accessories + ///
+ /// + /// + /// + public static bool CurrentlyPressingKeybind(this Item item) + { + if (item == Main.LocalPlayer.HeldItem) + return CalamityKeybinds.HeldItem.Current; + + if (!CalamityItemSets.HasAccessoryKeybind[item.type]) + throw new InvalidOperationException("Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set"); + + int keybindToUse = 0; + + for (var i = 0; i < Main.LocalPlayer.armor.Length; i++) + { + if (Main.LocalPlayer.armor[i].type == item.type) + break; + if (CalamityItemSets.HasAccessoryKeybind[Main.LocalPlayer.armor[i].type]) + keybindToUse++; + } + + return CalamityKeybinds.AccessoryKeybinds[keybindToUse].Current; + } + + + /// + /// Gets the Calamity keybind for the given item.
+ /// Automatically adjusts between Held Item and Accessory Ability keybinds based on if the item is held and equip order of accessories + ///
+ /// + /// + /// + public static ModKeybind? GetDynamicModHotkey(this Item item) + { + + if (!CalamityItemSets.HasAccessoryKeybind[item.type]) + return CalamityKeybinds.HeldItem; + + if (!Main.LocalPlayer.armor.Any(x => x.type == item.type)) + return null; + + int keybindToUse = 0; + + for (var i = 0; i < Main.LocalPlayer.armor.Length; i++) + { + if (Main.LocalPlayer.armor[i].type == item.type) + break; + if (CalamityItemSets.HasAccessoryKeybind[Main.LocalPlayer.armor[i].type]) + keybindToUse++; + } + + return CalamityKeybinds.AccessoryKeybinds[keybindToUse]; } } } diff --git a/Items/Accessories/AngelicAlliance.cs b/Items/Accessories/AngelicAlliance.cs index de51e2910f..054a6893af 100644 --- a/Items/Accessories/AngelicAlliance.cs +++ b/Items/Accessories/AngelicAlliance.cs @@ -2,6 +2,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Rarities; +using CalamityMod.Systems.Collections; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; @@ -40,7 +41,7 @@ namespace CalamityMod.Items.Accessories Item.Calamity().devItem = true; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.AngelicAllianceHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/AscendantInsignia.cs b/Items/Accessories/AscendantInsignia.cs index cd3b024632..9a38c4ae96 100644 --- a/Items/Accessories/AscendantInsignia.cs +++ b/Items/Accessories/AscendantInsignia.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories 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 ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void SetDefaults() { Item.width = 46; diff --git a/Items/Accessories/BlazingCore.cs b/Items/Accessories/BlazingCore.cs index 87edf334c1..6082a7d1ae 100644 --- a/Items/Accessories/BlazingCore.cs +++ b/Items/Accessories/BlazingCore.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories ItemID.Sets.AnimatesAsSoul[Type] = true; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.AccessoryParryHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Main.LocalPlayer.Calamity().AccessoryParryItem != null ? Main.LocalPlayer.Calamity().AccessoryParryItem : Item); public override void SetDefaults() { Item.width = 42; @@ -43,6 +43,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().blazingCore = true; + player.Calamity().AccessoryParryItem = Item; player.noKnockback = true; } diff --git a/Items/Accessories/BlunderBooster.cs b/Items/Accessories/BlunderBooster.cs index 1a1b2bac13..19e94e34f6 100644 --- a/Items/Accessories/BlunderBooster.cs +++ b/Items/Accessories/BlunderBooster.cs @@ -18,12 +18,9 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - // TODO -- Check if its trying to replace the other rogue jetpack. If its the case, return true. - public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().hasJetpack; - public override void UpdateAccessory(Player player, bool hideVisual) { - player.Calamity().hasJetpack = true; + player.Calamity().rogueDashItem = Item; player.GetDamage() += 0.12f; player.Calamity().rogueVelocity += 0.15f; player.Calamity().blunderBooster = true; @@ -32,7 +29,7 @@ namespace CalamityMod.Items.Accessories player.Calamity().stealthGenMoving += 0.1f; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.BoosterDashHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void AddRecipes() { diff --git a/Items/Accessories/DeadshotBrooch.cs b/Items/Accessories/DeadshotBrooch.cs index 16e3459913..5c3497351d 100644 --- a/Items/Accessories/DeadshotBrooch.cs +++ b/Items/Accessories/DeadshotBrooch.cs @@ -21,13 +21,13 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.Calamity().deadshotBrooch = true; + player.Calamity().ammoCycleItem = Item; player.Calamity().ammoCost *= 0.8f; player.GetDamage() += 0.12f; player.GetCritChance() += 7; } - public override void ModifyTooltips(List tooltips) => tooltips.IntegrateHotkey(CalamityKeybinds.AmmoCycleHotkey); + public override void ModifyTooltips(List tooltips) => tooltips.IntegrateDynamicHotkey(Item); public override void AddRecipes() { diff --git a/Items/Accessories/FlameLickedShell.cs b/Items/Accessories/FlameLickedShell.cs index 53f57e9697..244eddd3d0 100644 --- a/Items/Accessories/FlameLickedShell.cs +++ b/Items/Accessories/FlameLickedShell.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; internal const int flameLickedParry = 30; - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.AccessoryParryHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Main.LocalPlayer.Calamity().AccessoryParryItem != null ? Main.LocalPlayer.Calamity().AccessoryParryItem : Item); public override void SetStaticDefaults() { CalamityItemSets.ExtraDebuffTooltip_Enemy[Type] = [ModContent.BuffType()]; @@ -36,6 +36,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.flameLickedShell = true; + modPlayer.AccessoryParryItem = Item; player.noKnockback = true; } diff --git a/Items/Accessories/InterstellarStompers.cs b/Items/Accessories/InterstellarStompers.cs index 2f82b292fb..0991544716 100644 --- a/Items/Accessories/InterstellarStompers.cs +++ b/Items/Accessories/InterstellarStompers.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Accessories Item.expert = true; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.GravistarSabatonHotkey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/PlaguedFuelPack.cs b/Items/Accessories/PlaguedFuelPack.cs index 7ba1dcb02f..6af7b7c0ad 100644 --- a/Items/Accessories/PlaguedFuelPack.cs +++ b/Items/Accessories/PlaguedFuelPack.cs @@ -17,12 +17,9 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - // TODO -- Check if the slot contains the other rogue jetpack, in which case, let the player swap accs - public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().hasJetpack; - public override void UpdateAccessory(Player player, bool hideVisual) { - player.Calamity().hasJetpack = true; + player.Calamity().rogueDashItem = Item; player.GetDamage() += 0.08f; player.Calamity().rogueVelocity += 0.15f; player.Calamity().plaguedFuelPack = true; @@ -30,6 +27,6 @@ namespace CalamityMod.Items.Accessories player.Calamity().stealthGenMoving += 0.1f; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.BoosterDashHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); } } diff --git a/Items/Accessories/PlanebreakersPouch.cs b/Items/Accessories/PlanebreakersPouch.cs index 30445b7dcc..3d14c9d991 100644 --- a/Items/Accessories/PlanebreakersPouch.cs +++ b/Items/Accessories/PlanebreakersPouch.cs @@ -27,11 +27,11 @@ namespace CalamityMod.Items.Accessories player.GetCritChance() += 7; player.magicQuiver = true; CalamityPlayer modPlayer = player.Calamity(); - modPlayer.deadshotBrooch = true; + modPlayer.ammoCycleItem = Item; modPlayer.ammoCost *= 0.8f; } - public override void ModifyTooltips(List tooltips) => tooltips.IntegrateHotkey(CalamityKeybinds.AmmoCycleHotkey); + public override void ModifyTooltips(List tooltips) => tooltips.IntegrateDynamicHotkey(Item); public override void AddRecipes() { diff --git a/Items/Accessories/SpectralVeil.cs b/Items/Accessories/SpectralVeil.cs index 3cc01929cb..d0d9b60bef 100644 --- a/Items/Accessories/SpectralVeil.cs +++ b/Items/Accessories/SpectralVeil.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Accessories Item.expert = true; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.SpectralVeilHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/SpringStool.cs b/Items/Accessories/SpringStool.cs index b3c39d4ca4..9d9ac064f9 100644 --- a/Items/Accessories/SpringStool.cs +++ b/Items/Accessories/SpringStool.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using CalamityMod.CalPlayer; using CalamityMod.Cooldowns; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; @@ -15,7 +16,7 @@ namespace CalamityMod.Items.Accessories public class SpringStool : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.SpringStoolJumpHotKey); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((JumpCooldown).FramesToSeconds(), (CritRateBoostAboveTargets)); public static int JumpCooldown = CalamityUtils.SecondsToFrames(20); @@ -32,7 +33,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.GetModPlayer().springStool = true; + player.GetModPlayer().springStoolItem = Item; } public override void AddRecipes() @@ -48,7 +49,8 @@ namespace CalamityMod.Items.Accessories public class SpringStoolPlayer : ModPlayer { - public bool springStool = false; + public bool springStool { get => springStoolItem != null; } + public Item springStoolItem = null; public int springStoolTimer = 0; public bool hasGroundedSinceJump = true; @@ -73,7 +75,7 @@ namespace CalamityMod.Items.Accessories public override void PostUpdateEquips() { // Ensures the special jump initiates only works when unmounted, not grappled to a surface, and the ability is off cooldown - if (CalamityKeybinds.SpringStoolJumpHotKey.JustPressed && springStool && Main.myPlayer == Player.whoAmI && !Player.HasCooldown(Stooldown.ID) && !Player.mount.Active && hasGroundedSinceJump && !(Player.grappling[0] >= 0)) + if (springStool && Main.myPlayer == Player.whoAmI && !Player.HasCooldown(Stooldown.ID) && springStoolItem.JustPressedKeybind() && !Player.mount.Active && hasGroundedSinceJump && !(Player.grappling[0] >= 0)) { springStoolTimer = 12; @@ -214,13 +216,13 @@ namespace CalamityMod.Items.Accessories public override void ResetEffects() { - springStool = false; + springStoolItem = null; springStoolTimer = 0; } public override void UpdateDead() { - springStool = false; + springStoolItem = null; springStoolTimer = 0; hasGroundedSinceJump = true; } diff --git a/Items/Accessories/ThePointer.cs b/Items/Accessories/ThePointer.cs index cbf05e1b17..7d09678505 100644 --- a/Items/Accessories/ThePointer.cs +++ b/Items/Accessories/ThePointer.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using CalamityMod.Particles; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -23,12 +24,12 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.ThePointerLock); + public override void ModifyTooltips(List list) => list.IntegrateDynamicHotkey(Item); public override void UpdateAccessory(Player player, bool hideVisual) { LockOnHelper.ForceUsability = true; - if (CalamityKeybinds.ThePointerLock.JustPressed) + if (Item.JustPressedKeybind()) { LockOnHelper.Toggle(); if (LockOnHelper.AimedTarget != null) diff --git a/Items/Accessories/TheTransformer.cs b/Items/Accessories/TheTransformer.cs index fb3ba3f541..9491464ebb 100644 --- a/Items/Accessories/TheTransformer.cs +++ b/Items/Accessories/TheTransformer.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories public override void ModifyTooltips(List list) { list.FindAndReplace("[GFB]", Lang.SupportGlyphs(this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal"))); - list.IntegrateHotkey(CalamityKeybinds.TransformerHotKey); + list.IntegrateDynamicHotkey(Item); } public override void SetStaticDefaults() { diff --git a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson index b139893fdb..1d7f6b5baf 100644 --- a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson +++ b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson @@ -1,19 +1,17 @@ -ActivateAccessoryParry.DisplayName: Activate Accessory Parry AdrenalineMode.DisplayName: Adrenaline Mode -AmmoCycle.DisplayName: Ammo Cycle Hotkey -AngelicAllianceBlessing.DisplayName: Angelic Alliance Blessing ArmorSetBonus.DisplayName: Armor Set Bonus -AscendantInsigniaHotKey.DisplayName: Ascendant Insignia Flight -BoosterDash.DisplayName: Booster Dash DashDoubleTapOverride.DisplayName: Dash Double Tap Override ExoChairSlowDown.DisplayName: Exo Chair Slow Down GodSlayerDash.DisplayName: Dimensional Drive -GravistarSabatonHotkey.DisplayName: Interstellar Stompers Slam NormalityRelocator.DisplayName: Normality Relocator RageMode.DisplayName: Rage Mode -SpectralVeilTeleport.DisplayName: Spectral Veil Teleport -TransformerHotKey.DisplayName: Transformer Hot Key GravitySwapOverride.DisplayName: Gravity Swap Override ExpandDebuffInfo.DisplayName: See Debuff Information -ThePointerLock.DisplayName: The Pointer Lock On -SpringStoolJumpHotKey.DisplayName: Spring Stool Jump Hotkey +HeldItem.DisplayName: Held Item Ability +Accessory1.DisplayName: Accessory Ability 1 +Accessory2.DisplayName: Accessory Ability 2 +Accessory3.DisplayName: Accessory Ability 3 +Accessory4.DisplayName: Accessory Ability 4 +Accessory5.DisplayName: Accessory Ability 5 +Accessory6.DisplayName: Accessory Ability 6 +Accessory7.DisplayName: Accessory Ability 7 diff --git a/Localization/en-US/Mods.CalamityMod.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Misc.hjson index 873189767c..a7c5075c8c 100644 --- a/Localization/en-US/Mods.CalamityMod.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Misc.hjson @@ -128,3 +128,4 @@ GFBRougeUppercase: Rouge GFBRogueLowercase: rogue GFBRougeLowercase: rouge HotkeyNotBound: "[None]" +HotkeyNotEquipped: an Accessory Ability hotkey diff --git a/Systems/Collections/CalamityItemSets.cs b/Systems/Collections/CalamityItemSets.cs index 5abf9646f5..43d08c5de4 100644 --- a/Systems/Collections/CalamityItemSets.cs +++ b/Systems/Collections/CalamityItemSets.cs @@ -168,5 +168,10 @@ namespace CalamityMod.Systems.Collections .RegisterBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); + + public static bool[] HasAccessoryKeybind = Factory.CreateNamedSet("HasAccessoryKeybind") + .Description("Counts this item as having an accessory keybind. Used to detect which keybind goes to which accessory") + .RegisterBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(),ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); } } diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index 848c00118a..d04a35ceae 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -109,6 +109,25 @@ namespace CalamityMod tooltips.FindAndReplace("[KEY]", finalKey); } + /// + /// Shortcut for automatically placing one keybind within a tooltip. Requires the "[KEY]" string to be replaced. + /// + /// The tooltip list provided to a ModifyTooltips TML hook. + /// The ModKeybind to integrate into the tooltip. + public static void IntegrateDynamicHotkey(this List tooltips, Item item) + { + if (Main.dedServ) + return; + + var mhk = item.GetDynamicModHotkey(); + + string finalKey = GetText("Misc.HotkeyNotEquipped").Value; + if (mhk is not null) + finalKey = mhk.TooltipHotkeyString(); + + tooltips.FindAndReplace("[KEY]", finalKey); + } + /// /// Shortcut method for adding "You have already consumed this item" tooltip /// From 5c18d427babf9b7ed0f1b49476c816ad8f157054 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Wed, 1 Jul 2026 12:07:01 -0500 Subject: [PATCH 46/56] won't break with extra slot mods --- CalamityKeybinds.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index 56fd1f6497..a12d354a07 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -113,6 +113,8 @@ namespace CalamityMod if (CalamityItemSets.HasAccessoryKeybind[Main.LocalPlayer.armor[i].type]) keybindToUse++; } + if (keybindToUse > 6) + return false; return CalamityKeybinds.AccessoryKeybinds[keybindToUse].JustPressed; } @@ -142,6 +144,8 @@ namespace CalamityMod keybindToUse++; } + if (keybindToUse > 6) + return false; return CalamityKeybinds.AccessoryKeybinds[keybindToUse].JustReleased; } @@ -170,6 +174,8 @@ namespace CalamityMod if (CalamityItemSets.HasAccessoryKeybind[Main.LocalPlayer.armor[i].type]) keybindToUse++; } + if (keybindToUse > 6) + return false; return CalamityKeybinds.AccessoryKeybinds[keybindToUse].Current; } @@ -201,6 +207,9 @@ namespace CalamityMod keybindToUse++; } + if (keybindToUse > 6) + return null; + return CalamityKeybinds.AccessoryKeybinds[keybindToUse]; } } From 193a1e3593a4216487e0889ab77b2b50c7ad796e Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Wed, 1 Jul 2026 12:49:25 -0500 Subject: [PATCH 47/56] Dash Hotkey + Hotkey Tooltips now support controller --- ILEditing/MechanicILChanges.cs | 2 +- Utilities/ItemUtils.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index bab9586447..f621447cce 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -252,7 +252,7 @@ namespace CalamityMod.ILEditing return; } - if (CalamityKeybinds.DashHotkey.GetAssignedKeysOrEmpty().Count == 0) + if (CalamityKeybinds.DashHotkey.GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode).Count == 0) orig(self, out dir, out dashing, dashStartAction); else { diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index d04a35ceae..de041faf9f 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -12,6 +12,7 @@ using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Systems.Collections; +using Terraria.GameInput; namespace CalamityMod { @@ -54,7 +55,7 @@ namespace CalamityMod if (Main.dedServ || mhk is null) return ""; - List keys = mhk.GetAssignedKeysOrEmpty(); + List keys = mhk.GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode); if (keys.Count == 0) return GetText("Misc.HotkeyNotBound").Value; else From 6bd8325bde8dd35e00d5a8f5f84b24a41d4415f6 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Wed, 1 Jul 2026 13:24:40 -0500 Subject: [PATCH 48/56] small fixes + new util --- CalamityKeybinds.cs | 11 +++++++++++ Utilities/MiscUtils.cs | 2 ++ 2 files changed, 13 insertions(+) diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index a12d354a07..7e5079007d 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -1,7 +1,9 @@ using System; using System.Linq; using CalamityMod.Systems.Collections; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.GameInput; using Terraria.ModLoader; namespace CalamityMod @@ -212,5 +214,14 @@ namespace CalamityMod return CalamityKeybinds.AccessoryKeybinds[keybindToUse]; } + + public static bool HasBoundDynamicHotkey(this Item item) + { + var h = item.GetDynamicModHotkey(); + if (h == null) return false; + if (h?.GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode).Count() == 0) + return false; + return true; + } } } diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index d1eab75448..40cebbd5b7 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -314,6 +314,8 @@ namespace CalamityMod try { + if (mode == InputMode.Mouse) + mode = InputMode.Keyboard; return keybind.GetAssignedKeys(mode); } catch From 5fa395e07b1026ad0ff9b56ed3f833668846e47f Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 7 Jul 2026 15:31:31 -0400 Subject: [PATCH 49/56] ID set description --- Systems/Collections/CalamityItemSets.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Systems/Collections/CalamityItemSets.cs b/Systems/Collections/CalamityItemSets.cs index 43d08c5de4..10c647a42b 100644 --- a/Systems/Collections/CalamityItemSets.cs +++ b/Systems/Collections/CalamityItemSets.cs @@ -169,8 +169,13 @@ namespace CalamityMod.Systems.Collections ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); + /// + /// If for an item type, this item is an accessory which uses a keybind for an active ability.
+ /// Used for assigning it one of the dedicated keybind slots based on slot order with other accessories that use keybinds.
+ /// Defaults to . Note that an error will be thrown if attempting to give an accessory a keybind without assigning it to this set! + ///
public static bool[] HasAccessoryKeybind = Factory.CreateNamedSet("HasAccessoryKeybind") - .Description("Counts this item as having an accessory keybind. Used to detect which keybind goes to which accessory") + .Description("Counts this item as having an accessory keybind. Used for assigning which keybind goes to which accessory.") .RegisterBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(),ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); } From 1737c3f4cfede20c7eec95c676214c084cd21f56 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Tue, 7 Jul 2026 18:31:40 -0500 Subject: [PATCH 50/56] requested fixes + uses Debug.Assert instead of throwing an error --- CalamityKeybinds.cs | 104 ++++++++++++------------ Systems/Collections/CalamityItemSets.cs | 2 +- 2 files changed, 55 insertions(+), 51 deletions(-) diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index 7e5079007d..5f92b8b1de 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; @@ -32,6 +34,14 @@ namespace CalamityMod public static ModKeybind[] AccessoryKeybinds = []; + public static List RentedKeybinds = []; + /// + /// We store the keybind then move it to the main list at the end of the frame + /// This ensures that between frames has keybinds in the values needed for drawing + /// This does means there's a 1 frame delay when switching slots for item tooltips to update, but that's never important + /// + public static List KeybindRentalQueue = []; + public override void Load() { // Register keybinds @@ -87,6 +97,24 @@ namespace CalamityMod AccessoryKeybinds = null; } + public override void PostUpdateEverything() + { + RentedKeybinds = KeybindRentalQueue.ToList(); + KeybindRentalQueue.Clear(); + } + } + + public class AccessoryKeybindManager : GlobalItem + { + public override bool InstancePerEntity => true; + + internal int KeybindId { get; set; } + + public override void UpdateEquip(Item item, Player player) + { + if (CalamityItemSets.HasAccessoryKeybind[item.type]) + CalamityKeybinds.KeybindRentalQueue.Add(item.type); + } } public static class CalamityKeybindsExtensions @@ -104,20 +132,16 @@ namespace CalamityMod return CalamityKeybinds.HeldItem.JustPressed; if (!CalamityItemSets.HasAccessoryKeybind[item.type]) - throw new InvalidOperationException("Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set"); + Debug.Assert(false, "Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set, but is requesting an accessory keybind"); - int keybindToUse = 0; - - for (var i = 0; i < Main.LocalPlayer.armor.Length; i++) + if (CalamityKeybinds.RentedKeybinds.Contains(item.type)) { - if (Main.LocalPlayer.armor[i].type == item.type) - break; - if (CalamityItemSets.HasAccessoryKeybind[Main.LocalPlayer.armor[i].type]) - keybindToUse++; + int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type); + CalamityKeybinds.AccessoryKeybinds.IndexInRange(index); + return CalamityKeybinds.AccessoryKeybinds[index].JustPressed; } - if (keybindToUse > 6) - return false; - return CalamityKeybinds.AccessoryKeybinds[keybindToUse].JustPressed; + + return false; } /// @@ -134,21 +158,16 @@ namespace CalamityMod return CalamityKeybinds.HeldItem.JustReleased; if (!CalamityItemSets.HasAccessoryKeybind[item.type]) - throw new InvalidOperationException("Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set"); + Debug.Assert(false, "Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set, but is requesting an accessory keybind"); - int keybindToUse = 0; - - for (var i = 0; i < Main.LocalPlayer.armor.Length; i++) + if (CalamityKeybinds.RentedKeybinds.Contains(item.type)) { - if (Main.LocalPlayer.armor[i].type == item.type) - break; - if (CalamityItemSets.HasAccessoryKeybind[Main.LocalPlayer.armor[i].type]) - keybindToUse++; + int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type); + CalamityKeybinds.AccessoryKeybinds.IndexInRange(index); + return CalamityKeybinds.AccessoryKeybinds[index].JustReleased; } - if (keybindToUse > 6) - return false; - return CalamityKeybinds.AccessoryKeybinds[keybindToUse].JustReleased; + return false; } @@ -165,21 +184,16 @@ namespace CalamityMod return CalamityKeybinds.HeldItem.Current; if (!CalamityItemSets.HasAccessoryKeybind[item.type]) - throw new InvalidOperationException("Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set"); + Debug.Assert(false, "Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set, but is requesting an accessory keybind"); - int keybindToUse = 0; - - for (var i = 0; i < Main.LocalPlayer.armor.Length; i++) + if (CalamityKeybinds.RentedKeybinds.Contains(item.type)) { - if (Main.LocalPlayer.armor[i].type == item.type) - break; - if (CalamityItemSets.HasAccessoryKeybind[Main.LocalPlayer.armor[i].type]) - keybindToUse++; + int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type); + CalamityKeybinds.AccessoryKeybinds.IndexInRange(index); + return CalamityKeybinds.AccessoryKeybinds[index].Current; } - if (keybindToUse > 6) - return false; - return CalamityKeybinds.AccessoryKeybinds[keybindToUse].Current; + return false; } @@ -196,30 +210,20 @@ namespace CalamityMod if (!CalamityItemSets.HasAccessoryKeybind[item.type]) return CalamityKeybinds.HeldItem; - if (!Main.LocalPlayer.armor.Any(x => x.type == item.type)) - return null; - - int keybindToUse = 0; - - for (var i = 0; i < Main.LocalPlayer.armor.Length; i++) + if (CalamityKeybinds.RentedKeybinds.Contains(item.type)) { - if (Main.LocalPlayer.armor[i].type == item.type) - break; - if (CalamityItemSets.HasAccessoryKeybind[Main.LocalPlayer.armor[i].type]) - keybindToUse++; + int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type); + CalamityKeybinds.AccessoryKeybinds.IndexInRange(index); + return CalamityKeybinds.AccessoryKeybinds[index]; } - - if (keybindToUse > 6) - return null; - - return CalamityKeybinds.AccessoryKeybinds[keybindToUse]; + return null; } - + public static bool HasBoundDynamicHotkey(this Item item) { var h = item.GetDynamicModHotkey(); if (h == null) return false; - if (h?.GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode).Count() == 0) + if (h?.GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode).Count == 0) return false; return true; } diff --git a/Systems/Collections/CalamityItemSets.cs b/Systems/Collections/CalamityItemSets.cs index 10c647a42b..8dc2c08734 100644 --- a/Systems/Collections/CalamityItemSets.cs +++ b/Systems/Collections/CalamityItemSets.cs @@ -172,7 +172,7 @@ namespace CalamityMod.Systems.Collections /// /// If for an item type, this item is an accessory which uses a keybind for an active ability.
/// Used for assigning it one of the dedicated keybind slots based on slot order with other accessories that use keybinds.
- /// Defaults to . Note that an error will be thrown if attempting to give an accessory a keybind without assigning it to this set! + /// Defaults to . ///
public static bool[] HasAccessoryKeybind = Factory.CreateNamedSet("HasAccessoryKeybind") .Description("Counts this item as having an accessory keybind. Used for assigning which keybind goes to which accessory.") From a20204d47fc5b2ee9cfd8d871ccb07ef4a14105b Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Tue, 7 Jul 2026 18:33:57 -0500 Subject: [PATCH 51/56] missed some ifs --- CalamityKeybinds.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index 5f92b8b1de..8ed529182e 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -137,8 +137,8 @@ namespace CalamityMod if (CalamityKeybinds.RentedKeybinds.Contains(item.type)) { int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type); - CalamityKeybinds.AccessoryKeybinds.IndexInRange(index); - return CalamityKeybinds.AccessoryKeybinds[index].JustPressed; + if (CalamityKeybinds.AccessoryKeybinds.IndexInRange(index)) + return CalamityKeybinds.AccessoryKeybinds[index].JustPressed; } return false; @@ -163,8 +163,8 @@ namespace CalamityMod if (CalamityKeybinds.RentedKeybinds.Contains(item.type)) { int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type); - CalamityKeybinds.AccessoryKeybinds.IndexInRange(index); - return CalamityKeybinds.AccessoryKeybinds[index].JustReleased; + if (CalamityKeybinds.AccessoryKeybinds.IndexInRange(index)) + return CalamityKeybinds.AccessoryKeybinds[index].JustReleased; } return false; @@ -189,8 +189,8 @@ namespace CalamityMod if (CalamityKeybinds.RentedKeybinds.Contains(item.type)) { int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type); - CalamityKeybinds.AccessoryKeybinds.IndexInRange(index); - return CalamityKeybinds.AccessoryKeybinds[index].Current; + if (CalamityKeybinds.AccessoryKeybinds.IndexInRange(index)) + return CalamityKeybinds.AccessoryKeybinds[index].Current; } return false; @@ -213,8 +213,8 @@ namespace CalamityMod if (CalamityKeybinds.RentedKeybinds.Contains(item.type)) { int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type); - CalamityKeybinds.AccessoryKeybinds.IndexInRange(index); - return CalamityKeybinds.AccessoryKeybinds[index]; + if (CalamityKeybinds.AccessoryKeybinds.IndexInRange(index)) + return CalamityKeybinds.AccessoryKeybinds[index]; } return null; } From ea5e68d93f20ca03446e70c6d17167df90fe84a1 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Sat, 11 Jul 2026 13:59:35 -0500 Subject: [PATCH 52/56] fixed access on some BaseSwordHoldoutProjectile fields --- Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs index 81a55e025a..5b92d10539 100644 --- a/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs @@ -200,7 +200,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// /// Internal timer for the projectile's swing animation /// - internal int swingTimer = 0; + public int swingTimer = 0; public static Asset TrailTexture; @@ -212,7 +212,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles List oldProjectileRot = new List { }; List oldProjectilePos = new List { }; - internal int ExistsTime = 20; + public int ExistsTime = 20; public bool inStartup => timer < StartupTime; public bool inCooldown => timer > CooldownStartFrame; From 2e1ee4c40bb521da1d532e5e3b1601e5253b69bf Mon Sep 17 00:00:00 2001 From: Karina Date: Sun, 12 Jul 2026 00:35:03 -0500 Subject: [PATCH 53/56] nerfs horrible --- Prefixes/HorribleWeaponPrefix.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Prefixes/HorribleWeaponPrefix.cs b/Prefixes/HorribleWeaponPrefix.cs index 8484b58f4f..101edf2f21 100644 --- a/Prefixes/HorribleWeaponPrefix.cs +++ b/Prefixes/HorribleWeaponPrefix.cs @@ -10,7 +10,8 @@ namespace CalamityMod.Prefixes public class Horrible : HorribleWeaponPrefix { public override float damageMult => 0.66f; - public override float sizeMult => 2f; + public override float sizeMult => 1.66f; + public override float knockbackMult => 0.01f; } public abstract class HorribleWeaponPrefix : ModPrefix, ILocalizedModType { @@ -19,6 +20,7 @@ namespace CalamityMod.Prefixes // Stats public virtual float damageMult => 1f; public virtual float sizeMult => 1f; + public virtual float knockbackMult => 1f; public override PrefixCategory Category => PrefixCategory.AnyWeapon; public override float RollChance(Item item) => 0; // Is manually applied by an item, can't be rerolled normally @@ -31,6 +33,7 @@ namespace CalamityMod.Prefixes { damageMult = this.damageMult; scaleMult = this.sizeMult; + knockbackMult = this.knockbackMult; } public override void ModifyValue(ref float valueMult) { From 74414464578cb79acb620c1af32a584ed7413f00 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Sun, 12 Jul 2026 16:40:42 -0500 Subject: [PATCH 54/56] shellfish claps no longer has a cap, thank you fix, weaver tail no longer epxlodes --- Buffs/DamageOverTime/ShellfishClaps.cs | 5 ----- Items/Accessories/Wings/TiredTail.cs | 1 + Items/Placeables/Furniture/Paintings/ThankYouPainting.cs | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Buffs/DamageOverTime/ShellfishClaps.cs b/Buffs/DamageOverTime/ShellfishClaps.cs index 32c4224576..960f716168 100644 --- a/Buffs/DamageOverTime/ShellfishClaps.cs +++ b/Buffs/DamageOverTime/ShellfishClaps.cs @@ -30,11 +30,6 @@ namespace CalamityMod.Buffs.DamageOverTime { owner = p.owner; projectileCount++; - if (projectileCount >= 5) - { - projectileCount = 5; - break; - } } } diff --git a/Items/Accessories/Wings/TiredTail.cs b/Items/Accessories/Wings/TiredTail.cs index f98d395f7a..2620f80d32 100644 --- a/Items/Accessories/Wings/TiredTail.cs +++ b/Items/Accessories/Wings/TiredTail.cs @@ -189,6 +189,7 @@ namespace CalamityMod.Items.Accessories.Wings List ColorPallettes = new(); public override void SetStaticDefaults() { + if (Main.netMode != NetmodeID.Server) Main.QueueMainThreadAction(() => { //Load palettes automatically diff --git a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs index e9d47d8eef..070ee4c774 100644 --- a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs @@ -189,7 +189,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "Runefield", "Sargassum", "sentri", - "Shade", + "ClockworkShade", "SharZz", "Shucks", "Silver-Lord of Ash", From df6064e11ff37af6ab094b17bee0d46649fe1989 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Sun, 12 Jul 2026 22:01:50 -0400 Subject: [PATCH 55/56] Moved ClockworkShade to the correct alphabetical location --- 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 070ee4c774..c846aef56f 100644 --- a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs @@ -117,6 +117,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "Cei", "Chetto", "Chill Dude", + "ClockworkShade", "Cobalion", "Daim", "DarkTiny", @@ -189,7 +190,6 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "Runefield", "Sargassum", "sentri", - "ClockworkShade", "SharZz", "Shucks", "Silver-Lord of Ash", From 853930977cd91be3dfcac865152090baf4d2e2fd Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 14 Jul 2026 17:45:51 -0400 Subject: [PATCH 56/56] Slime God despawn bug fix!!!!!!!! --- NPCs/SlimeGod/SlimeGodCore.cs | 5 ++++- NPCs/SlimeGod/SplitCrimulanPaladin.cs | 2 ++ NPCs/SlimeGod/SplitEbonianPaladin.cs | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 4981b94c3f..7b0da70ac2 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -201,11 +201,14 @@ namespace CalamityMod.NPCs.SlimeGod // Make sure Opacity is set to 0.8f if it's below that when the vanish phase starts if (NPC.ai[3] == 0f) { - if (!NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType())) + if (!NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()) && + !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType())) { NPC.ai[3] = 1f; NPC.Opacity = 0.8f; } + else + NPC.Opacity = 0.01f; // This line ensures the core doesn't immediately explode into loot if it's currently possessing a paladin } // Emit dust diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index 7d30a48077..af132c16ec 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -712,6 +712,8 @@ namespace CalamityMod.NPCs.SlimeGod } } + public override bool CheckActive() => false; + public override Color? GetAlpha(Color drawColor) { Color lightColor = new Color(Main.DiscoR, 100, 150, NPC.alpha); diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index 20e145acd2..880c170ceb 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -753,6 +753,8 @@ namespace CalamityMod.NPCs.SlimeGod } } + public override bool CheckActive() => false; + public override Color? GetAlpha(Color drawColor) { Color lightColor = new Color(200, 150, Main.DiscoB, NPC.alpha);