From bf9abcb4f4542306e1297442e46b18c7539b5e34 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Fri, 7 Aug 2026 16:39:55 -0500 Subject: [PATCH 1/2] finally giving the public what they want - Calamity now scales off crit chance while being generic - Gilded Proboscis sfx and vfx changes --- CalPlayer/CalamityPlayerMiscEffects.cs | 6 +- .../Melee/Spears/GildedProboscisProj.cs | 96 +++++++++++++++++++ 2 files changed, 99 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 62396bcd18..124abee89b 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1060,9 +1060,9 @@ namespace CalamityMod.CalPlayer // Create a direct strike to hit this specific NPC. var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); Projectile sigilStrike = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), sigilDamage, 0f, Player.whoAmI, target.whoAmI, 255f); - - // Enable crits by setting the sigil's damage class to be whatever the player's strongest damage class is. - sigilStrike.DamageType = Player.GetBestClass(); + //Set crit chance so Calamtiy can crit with the proper chance, but don't make it count as those classes. + sigilStrike.CritChance = (int)Player.GetTotalCritChance(Player.GetBestClass()); + sigilStrike.DamageType = AverageDamageClass.Instance; // Incinerate the target with either Vulnerability Hex or True Vulnerability Hex, depending on current cursor focus. // This adds 8 to the buff duration, which results in a net increase of 3 frames every time damage is dealt, due to damage occurring every 5 frames. diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 1293a2915c..96b783ab1d 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -1,12 +1,20 @@ using System; +using System.Linq; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Summon; using CalamityMod.Utilities; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -85,7 +93,20 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.timeLeft++; } if (Projectile.FinalExtraUpdate() && channelCharge < CalamityUtils.SecondsToFrames(5)) + { channelCharge++; + + + if (channelCharge == 300) + { + + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ChainLightning1") with { Volume = 1f, Pitch = 0.5f }); + } + else if (channelCharge % 10 == 0 && channelCharge < 2000) + { + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/ElectricHit") with { Volume = channelCharge/300f * 0.25f, Pitch = -1 + channelCharge/300f}); + } + } } //Once not channeling, set the damage at the end of the startup else @@ -195,6 +216,12 @@ namespace CalamityMod.Projectiles.Melee.Spears } else { + + if (swingTimer == 1) + { + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ChainLightning1") with { Volume = 0.2f, Pitch = -0.25f }); + } + //scale & offset for the damaging swing part of the anim //This keeps "am" (short for animation) at 0 or 1 most of the time, with a quick but smooth transition float am = MathHelper.Clamp(MathF.Pow((SwingCompletion - (0.5f - (1 / 3f))) * 3f, 3f), 0, 1); @@ -267,8 +294,77 @@ namespace CalamityMod.Projectiles.Melee.Spears Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.0015), 0.5f); Projectile.originalDamage = (int)(Projectile.originalDamage * 0.925f); Projectile.damage = (int)(Projectile.damage * 0.925f); //Both are needed as it doesn't recalculate till next frame + + + if (!isChannelable) + { + + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/ElectricBurst") with { Volume = 0.25f, Pitch = 0 }); + } + else + { + + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/ElectricBurst") with { Volume = channelCharge / 300f * 0.25f, Pitch = -1 + channelCharge / 300f }); + if (channelCharge >= CalamityUtils.SecondsToFrames(5)) + { + SoundEngine.PlaySound(SoundID.Item172 with { Volume = 1 }); + } + } } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.ApplyScalingForcedCrit(Projectile); + + public override bool PreDraw(ref Color lightColor) + { + + var player = Main.player[Projectile.owner]; + var modplayer = player.GetModPlayer(); + var tex = TextureAssets.Projectile[Type]; + var frame = tex.Frame(); + + float intensity = MathF.Pow(Math.Clamp((channelCharge-150) / 150f,0,1),2); + + if (!isChannelable) + { + intensity = Math.Clamp(StartupCompletion*2 - 1,0,1) - Math.Clamp(CooldownCompletion*2, 0, 1); + } + if (isChannelable && SwingCompletion >= 1) + intensity = 0; + + Color color = isChannelable ? Color.Crimson : Color.Goldenrod; + if (intensity > 0) + for (float i = 0; i < MathHelper.TwoPi; i += MathHelper.PiOver2) + { + Main.EntitySpriteDraw(OutlineTex, Projectile.Center - Main.screenPosition + new Vector2(2 * intensity, 0).RotatedBy(i), frame, color, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : 0); + } + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : 0); + + return false; + } + + private static Texture2D OutlineTex + { + get + { + + if (field == null) + { + var texture = TextureAssets.Projectile[ModContent.ProjectileType()].Value; + field = new Texture2D(Main.graphics.GraphicsDevice, texture.Width, texture.Height); + + var BaseArray = new Color[field.Width * field.Height]; + var ColorArray = new Color[field.Width * field.Height]; + texture.GetData(BaseArray); + for (var i = 0; i < BaseArray.Length; i++) + { + ColorArray[i] = new Color(255, 255, 255) * (((float)BaseArray[i].A) / 255f); + } + field.SetData(ColorArray); + } + return field; + } + } + + } } From eb3ea6bdb61861d8d1f5f3601b6b489e4c2878d6 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Fri, 7 Aug 2026 20:38:12 -0400 Subject: [PATCH 2/2] Minor spelling mistaek --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 124abee89b..e84f3c932e 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1060,7 +1060,7 @@ namespace CalamityMod.CalPlayer // Create a direct strike to hit this specific NPC. var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); Projectile sigilStrike = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), sigilDamage, 0f, Player.whoAmI, target.whoAmI, 255f); - //Set crit chance so Calamtiy can crit with the proper chance, but don't make it count as those classes. + //Set crit chance so Calamity can crit with the proper chance, but don't make it count as those classes. sigilStrike.CritChance = (int)Player.GetTotalCritChance(Player.GetBestClass()); sigilStrike.DamageType = AverageDamageClass.Instance;