From c0d47da20188fdeb37c762cdc74aef52a054109f Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Mon, 15 Dec 2025 23:50:41 -0800 Subject: [PATCH] also Ilmeris' Spark ig the rename can stay --- CalPlayer/CalamityPlayerHitHurt.cs | 48 +++++++++++++------ CalPlayer/CalamityPlayerOnHit.cs | 5 -- .../Mods.CalamityMod.Items.Accessories.hjson | 7 +-- .../Mods.CalamityMod.Projectiles.Melee.hjson | 1 - NPCs/CalamityGlobalNPC.cs | 3 -- 5 files changed, 34 insertions(+), 30 deletions(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 61af03ad9a..a18bb89a81 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -40,6 +40,7 @@ using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using CalamityMod.Particles; +using CalamityMod.Projectiles.Pets; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Typeless; @@ -51,8 +52,8 @@ using Terraria; using Terraria.Audio; using Terraria.Chat; using Terraria.DataStructures; -using Terraria.Graphics.Shaders; using Terraria.GameContent.Creative; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -1231,8 +1232,6 @@ namespace CalamityMod.CalPlayer { if (sulphurSet) Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration); - if (ilSpark) - Main.npc[proj.Calamity().ParentNPCIndex].Calamity().shocked = 120; } } @@ -2457,19 +2456,38 @@ namespace CalamityMod.CalPlayer } if (ilSpark) { - SoundEngine.PlaySound(SoundID.Item93, Player.Center); - - // Only visual effects are done here - // The actual spark spawning is now handled with the shocked variable in CalamityGlobalNPC - - SeaFoamParticle boom = new(Player.Center, Vector2.Zero, new Color(89, 239, 247), new Color(56, 158, 209), 1f, 200f, Main.rand.NextBool() ? -1f : 1f); - GeneralParticleHandler.SpawnParticle(boom); - - for (int e = 0; e < 6; e++) + var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); + if (hurtInfo.Damage > 0) { - Vector2 dustVel = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(4.5f, 5.25f); - Dust electric = Dust.NewDustPerfect(Player.Center, DustID.Electric, dustVel, Scale: 0.75f); - electric.noGravity = true; + SoundEngine.PlaySound(SoundID.Item93, Player.Center); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + + // Start with base damage, then apply the best damage class you can + int sDamage = 6; + if (transformer) + sDamage += 42; + sDamage = (int)Player.GetBestClassDamage().ApplyTo(sDamage); + + if (Player.whoAmI == Main.myPlayer) + { + for (int i = 0; i < 4; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + int spark1 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), sDamage, 1.25f, Player.whoAmI, 0f, 1); + int spark2 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), sDamage, 1.25f, Player.whoAmI, 0f, 1); + if (spark1.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[spark1].timeLeft = 120; + } + if (spark2.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[spark2].timeLeft = 120; + } + } + } } } if (rBrain) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index ab94f3adb8..cdb78ea3f5 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1258,11 +1258,6 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), 180); if (sulphurSet) target.AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration); - if (ilSpark && Player.Calamity().countsAsAnyWet) - { - int duration = 60; - target.AddBuff(BuffType(), duration); - } if (corrosiveSpine) { target.AddBuff(BuffType(), 120); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 6fde1df8e4..ff36edad2f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -978,12 +978,7 @@ HowlsHeart: { IlmerisSpark: { DisplayName: Ilmeris' Spark - Tooltip: - ''' - Attacks inflict Static Discharge while underwater - Taking damage causes the enemy to be shocked - Shocked enemies constantly release sparks - ''' + Tooltip: Taking damage releases a blast of sparks } InfectedJewel: { diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 25d53c122c..d6fdfb3ee0 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -4,7 +4,6 @@ AegisBeam.DisplayName: Aegis Beam AegisBlast.DisplayName: Aegis Blast AegisBlast2.DisplayName: Aegis Blast AegisFlame.DisplayName: Aegis Flame -AmidiasTridentBoltProj.DisplayName: Trident Bolt AmidiasWhirlpool.DisplayName: Whirlpool AncientBeam.DisplayName: Ancient Beam AncientStar.DisplayName: Ancient Star diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 921e40b4ca..64d349a383 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3866,9 +3866,6 @@ namespace CalamityMod.NPCs if (target.Calamity().sulphurSet) npc.AddBuff(BuffID.Poisoned, 60); - if (target.Calamity().ilSpark) - shocked = 120; - if (target.Transformation().Type == ItemType()) { if (npc.type == NPCID.Demon || npc.type == NPCID.VoodooDemon || npc.type == NPCID.RedDevil)