From 777a4d77d25f1e25c2f52daae623d9787985a11d Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Fri, 22 Aug 2025 17:45:30 -0500 Subject: [PATCH 01/22] part 1 --- Buffs/StatBuffs/SmashedEvil.cs | 64 ++++++ Buffs/StatBuffs/SmashedEvil.png | Bin 0 -> 607 bytes Buffs/StatBuffs/SmashedEvilDebuff.png | Bin 0 -> 607 bytes CalPlayer/CalamityPlayer.cs | 7 + CalPlayer/CalamityPlayerHitHurt.cs | 10 +- CalPlayer/CalamityPlayerMiscEffects.cs | 28 +++ Items/Weapons/Melee/EvilSmasher.cs | 166 ++++++++++++-- Items/Weapons/Melee/EvilSmasherGlow.png | Bin 0 -> 575 bytes .../en-US/Mods.CalamityMod.Buffs.hjson | 5 + ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 22 +- .../Mods.CalamityMod.Projectiles.Melee.hjson | 1 + NPCs/CalamityGlobalNPC.cs | 1 + Projectiles/Melee/EvilSmasherProjectile.cs | 208 ++++++++++++++++++ 13 files changed, 490 insertions(+), 22 deletions(-) create mode 100644 Buffs/StatBuffs/SmashedEvil.cs create mode 100644 Buffs/StatBuffs/SmashedEvil.png create mode 100644 Buffs/StatBuffs/SmashedEvilDebuff.png create mode 100644 Items/Weapons/Melee/EvilSmasherGlow.png create mode 100644 Projectiles/Melee/EvilSmasherProjectile.cs diff --git a/Buffs/StatBuffs/SmashedEvil.cs b/Buffs/StatBuffs/SmashedEvil.cs new file mode 100644 index 0000000000..9991a19dad --- /dev/null +++ b/Buffs/StatBuffs/SmashedEvil.cs @@ -0,0 +1,64 @@ +using System; +using CalamityMod.DataStructures; +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatBuffs +{ + public class SmashedEvil : ModBuff + { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 40, + SicknessDebuffScaling = 1, + HeatDebuffScaling = 1, + ColdDebuffScaling = 1, + ElectricDebuffScaling = 1, + WaterDebuffScaling = 1, + NPCLifeRegenMethod = SmashedEvilNPCRegen + + }; + + public static void SmashedEvilNPCRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + float totalDPS = debuffData.EnemyLostRegen; + + var heat = cnpc.ActiveHeatDebuffMultiplier; + var cold = cnpc.ActiveColdDebuffMultiplier; + var sick = cnpc.ActiveSicknessDebuffMultiplier; + var elec = cnpc.ActiveElectricDebuffMultiplier; + var water = cnpc.ActiveWaterDebuffMultiplier; + StatModifier totalScaling = + DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveHeatDebuffMultiplier, debuffData.HeatDebuffScaling) + .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveColdDebuffMultiplier, debuffData.ColdDebuffScaling) + .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveSicknessDebuffMultiplier, debuffData.SicknessDebuffScaling) + .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveWaterDebuffMultiplier, debuffData.WaterDebuffScaling) + .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveElectricDebuffMultiplier, debuffData.ElectricDebuffScaling) + )))); + totalDPS = totalScaling.ApplyTo(totalDPS); + var totalDPSAdjusted = totalDPS - debuffData.EnemyVanillaRegenToCancelOut; + npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS * debuffData.MultiplierDamageTickSize, debuffData.MinimumDamageTickSize), ref npc.lifeRegen, ref damage); + } + public override void SetStaticDefaults() + { + Main.debuff[Type] = false; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; + } + + public override void Update(Player player, ref int buffIndex) + { + player.lifeRegenTime += 2; + player.GetDamage() += 0.1f; + player.moveSpeed += 0.2f; + } + + public override void Update(NPC npc, ref int buffIndex) + { + } + } +} diff --git a/Buffs/StatBuffs/SmashedEvil.png b/Buffs/StatBuffs/SmashedEvil.png new file mode 100644 index 0000000000000000000000000000000000000000..ee597d4cce00dc21f0edf6331a49bf873c5a6707 GIT binary patch literal 607 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCilI0(?STf%Mt8|7P9#$JBkxW%u93Gb$U3gT#b|&CJYd8)}mx92S4FKE>?= zR90A{>j|XzN`m}?|04qi*8_J>0A)A}JR*yM3J!xX*AN9$JwrVU>C9IvfNHj-MtG)qdTKFn06DA-QjDw&j6jwb5KBYZAm3>) zGK0mLfNVoXCI$f@9RM5`Y+_A4a2D$^ZGgtf{A^Bp7pm(A|n_2;M1& literal 0 HcmV?d00001 diff --git a/Buffs/StatBuffs/SmashedEvilDebuff.png b/Buffs/StatBuffs/SmashedEvilDebuff.png new file mode 100644 index 0000000000000000000000000000000000000000..bbc9b3974ac9b7d04d028dd0b83f8e056cf6da82 GIT binary patch literal 607 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCilI0(?STf%N~S9si5Mp92}vtczzcG@7Lh!0?&C&cFgxVPIrzz_dA`QTIO!?}=Y z8?^MeBDa2DDIVQ$vqgY$2mcMlyU(V?>?gTe~DWM4f{PeKa literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 494571a099..f240ea4be6 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -399,6 +399,9 @@ namespace CalamityMod.CalPlayer public float WeakTimeFreezeUseTimer = 0; public bool WeakTimeFreezeInUse = false; + + public int DemonAltarDialogueCounter = 0; + public int DemonAltarDialogueCooldown = 0; #endregion #region Sound @@ -1993,6 +1996,7 @@ namespace CalamityMod.CalPlayer #region ResetEffects public override void ResetEffects() { + if (fleshKnuckles) Player.statLifeMax2 += 25; @@ -2448,6 +2452,9 @@ namespace CalamityMod.CalPlayer blunderBoosterVisibility = true; veneratedLocket = false; + if (DemonAltarDialogueCooldown > 0) + DemonAltarDialogueCooldown--; + alcoholPoisoning = false; shadowflame = false; daybroken = false; diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index e14556cf47..473acab815 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using CalamityMod.Balancing; using CalamityMod.Buffs.Cooldowns; @@ -517,6 +517,14 @@ namespace CalamityMod.CalPlayer #endregion #region Modify Hit NPC + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (target.HasBuff()) + { + //This is essentially 10 AP, but independent of armor amount + modifiers.FlatBonusDamage += 5; + } + } public override void ModifyHitNPCWithItem(Item item, NPC target, ref NPC.HitModifiers modifiers) { modifiers.CritDamage += critDamage; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ce3b888ff0..fb8f26b4b3 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -972,8 +972,36 @@ namespace CalamityMod.CalPlayer } } + private void DemonAltarTalking() + { + + for (var h = -15; h < 15; h++) + { + for (var j = -15; j < 15; j++) + { + var tilePos = Player.Center.ToTileCoordinates() + new Point(h, j); + if (Main.tile[tilePos.X, tilePos.Y].TileType == TileID.DemonAltar) + { + CombatText.NewText(new Rectangle(tilePos.X * 16, tilePos.Y * 16, 16, 16), WorldGen.crimson ? Color.Red : Color.Purple, CalamityUtils.GetTextValue("Items.Weapons.Melee.EvilSmasher.AltarDialogue" + DemonAltarDialogueCounter), true); + DemonAltarDialogueCounter++; + DemonAltarDialogueCooldown = 240; + if (DemonAltarDialogueCounter >= 6) + { + DemonAltarDialogueCooldown = 1200; + DemonAltarDialogueCounter = 0; + } + return; + } + } + } + } private void MiscEffects() { + if (Player.inventory.Any(x => x.type == ItemID.Pwnhammer) && !Player.inventory.Any(x => x.type == ModContent.ItemType()) && Player.adjTile[TileID.DemonAltar] && DemonAltarDialogueCooldown <= 0 && Player.miscCounter % 30 == 0) + { + DemonAltarTalking(); + } + //Mana Burn update if (ManaBurnFireDrawer != null) { diff --git a/Items/Weapons/Melee/EvilSmasher.cs b/Items/Weapons/Melee/EvilSmasher.cs index 27abbe6fa8..9f45b2147e 100644 --- a/Items/Weapons/Melee/EvilSmasher.cs +++ b/Items/Weapons/Melee/EvilSmasher.cs @@ -1,38 +1,170 @@ -using Terraria; +using System; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class EvilSmasher : ModItem, ILocalizedModType + public class EvilSmasher : BaseSwordHoldoutItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override int ProjectileType => ModContent.ProjectileType(); + + public bool IsAnimating = false; + public int AnimationTime = 0; public override void SetDefaults() { + base.SetDefaults(); Item.width = 64; Item.height = 66; - Item.damage = 120; - Item.DamageType = DamageClass.Melee; - Item.useAnimation = Item.useTime = 38; - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; + Item.damage = 750; + Item.DamageType = TrueMeleeDamageClass.Instance; + Item.useAnimation = Item.useTime = 120; + Item.channel = true; Item.knockBack = 6f; - Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; } - public override float UseSpeedMultiplier(Player player) => 1f + (player.Calamity().evilSmasherBoost * 0.1f); - - public override void ModifyWeaponDamage(Player player, ref StatModifier damage) => damage *= 1f + player.Calamity().evilSmasherBoost * 0.1f; - - public override void ModifyWeaponKnockback(Player player, ref StatModifier knockback) => knockback *= 1f + (player.Calamity().evilSmasherBoost * 0.1f); - - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) + public override void Update(ref float gravity, ref float maxFallSpeed) { - if (target.life <= 0 && player.Calamity().evilSmasherBoost < 10) - player.Calamity().evilSmasherBoost += 1; + if (!IsAnimating) + { + if (AnimationTime < 300) + AnimationTime++; + return; + } + float completion = AnimationTime / 240f; + Item.noGrabDelay = 120; + Item.velocity = new Vector2(0, -1f); + int dotAmount = 0; + for (var i = 0; i < dotAmount; i++) + { + var ringDir = getRingOffset(i / (float)dotAmount * -MathHelper.TwoPi + MathHelper.TwoPi * completion * 3, ySquish: 3f); + Dust.NewDustPerfect(Item.Center + (ringDir * (completion - MathF.Pow(completion, 2)) * 256), i % 2 == 0 ? DustID.Crimson : DustID.Corruption, ringDir); + } + if (Main.rand.NextFloat() < completion) + Dust.NewDustPerfect(Item.Center, Main.rand.NextBool() ? DustID.CursedTorch : DustID.IchorTorch,Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * 5); + if (completion >= 1) + { + for (var i = 0; i < 50; i++) + { + Dust.NewDustPerfect(Item.Center, Main.rand.NextBool() ? DustID.CursedTorch : DustID.IchorTorch, Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * 5); + Dust.NewDustPerfect(Item.Center, Main.rand.NextBool() ? DustID.Crimson : DustID.Corruption, Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * 5); + } + IsAnimating = false; + Item.velocity = new Vector2(0, -5); + } + AnimationTime++; + } + + #region Textures + private static Asset GlowTex = null; + private static Texture2D GetGlowTex() + { + if (GlowTex == null) + { + GlowTex = ModContent.Request("CalamityMod/Particles/BloomCircle"); + } + return GlowTex.Value; + } + + private static Asset GlowBeamTex = null; + private static Texture2D GetGlowBeamTex() + { + if (GlowBeamTex == null) + { + GlowBeamTex = ModContent.Request("CalamityMod/Particles/BloomLineFade"); + } + return GlowBeamTex.Value; + } + private static Asset GlowBeamCapTex = null; + private static Texture2D GetGlowBeamCapTex() + { + if (GlowBeamCapTex == null) + { + GlowBeamCapTex = ModContent.Request("CalamityMod/Particles/BloomLineCap"); + } + return GlowBeamCapTex.Value; + } + #endregion + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + if (IsAnimating) + { + var color = Color.Lerp(Color.Purple, Color.Red, MathF.Sin(Main.GlobalTimeWrappedHourly * 6) * 0.5f + 0.5f); + Main.spriteBatch.SafeBegin(SpriteSortMode.Immediate, BatchSetting.Additive, null, Main.GameViewMatrix.TransformationMatrix, () => + { + Main.spriteBatch.Draw(GetGlowTex(), Item.Center - Main.screenPosition, null, color, 0, GetGlowTex().Size() * 0.5f, 0.1f + 0.7f * (AnimationTime / 240f), SpriteEffects.None, 0); + int rep = 0; + for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.166f) + { + Main.spriteBatch.Draw(GetGlowBeamTex(), Item.Center - Main.screenPosition, null, color, MathHelper.WrapAngle(Main.GlobalTimeWrappedHourly) + i, new(GetGlowBeamTex().Size().X * 0.5f, 0), 0f + 0.06f * (AnimationTime / 240f) * (rep == 0 ? 1 : 0.75f), SpriteEffects.None, 0); + rep = (rep + 1) % 2; + } + }); + var tex = TextureAssets.Item[ItemID.Pwnhammer].Value; + Main.spriteBatch.Draw(tex, Item.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.Black,AnimationTime / 240f), 0, tex.Size() * 0.5f,MathHelper.Lerp(1,1.75f, AnimationTime / 240f), SpriteEffects.None, 0); + return false; + } else if (AnimationTime < 300) + { + float completion = 1 - (AnimationTime - 240) / 60f; + var color = Color.Lerp(Color.Purple, Color.Red, MathF.Sin(Main.GlobalTimeWrappedHourly * 6) * 0.5f + 0.5f); + Main.spriteBatch.SafeBegin(SpriteSortMode.Immediate, BatchSetting.Additive, null, Main.GameViewMatrix.TransformationMatrix, () => + { + Main.spriteBatch.Draw(GetGlowTex(), Item.Center - Main.screenPosition, null, color, 0, GetGlowTex().Size() * 0.5f, 0.1f + 0.7f * completion, SpriteEffects.None, 0); + int rep = 0; + for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.166f) + { + Main.spriteBatch.Draw(GetGlowBeamTex(), Item.Center - Main.screenPosition, null, color, MathHelper.WrapAngle(Main.GlobalTimeWrappedHourly) + i, new(GetGlowBeamTex().Size().X * 0.5f, 0), 0f + 0.06f * completion * (rep == 0 ? 1 : 0.75f), SpriteEffects.None, 0); + rep = (rep + 1) % 2; + } + }); + } + return base.PreDrawInWorld(spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI); + } + + private Vector2 getRingOffset(float rad, float xSquish = 1, float ySquish = 1) + { + return new Vector2((1 / xSquish) * MathF.Cos(rad), (1 / ySquish) * MathF.Sin(rad)); + } + } + + public class EvilSmasherSacrifice : GlobalItem + { + public override bool AppliesToEntity(Item entity, bool lateInstantiation) + { + return entity.type == ItemID.Pwnhammer; + } + + public override void Update(Item item, ref float gravity, ref float maxFallSpeed) + { + if (item.noGrabDelay > 0) return; //Only run once the item is fully settled + for (var i = 0; i < 5; i++) //Loop a couple times to check different vertical positions for the altar, improving accuracy. + { + var tileCheckPos = item.Center.ToTileCoordinates() + new Point(0, i); + if (Main.tile[tileCheckPos.X, tileCheckPos.Y].TileType == TileID.DemonAltar) + { + if (!(Main.netMode == NetmodeID.MultiplayerClient)) + { + var newItem = Main.item[Item.NewItem(item.GetSource_FromThis(), item.Hitbox, ModContent.ItemType())]; + newItem.noGrabDelay = 120; + newItem.prefix = item.prefix; + (newItem.ModItem as EvilSmasher).IsAnimating = true; + } + item.stack -= 1; + if (item.stack <= 0) + item.active = false; + return; + } + } } } } diff --git a/Items/Weapons/Melee/EvilSmasherGlow.png b/Items/Weapons/Melee/EvilSmasherGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..a42c9964b66b78c6be9659186f239691d1acf1af GIT binary patch literal 575 zcmeAS@N?(olHy`uVBq!ia0vp^4nXY0!3-oX)GIs(QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`*#dk*T>t<74`hZOx?BgOm`Z~Dg8wr--EQCo4nJ@ErzW#^d=b zQhzyvgh39K^6(gMhW>M}Gi0LiXyP!tZHXQ2UP zp7V5Z42f`mJMkdjVFjL}yZ--wsktHNNQ+2ktEccjQ=8wHUJDlOeel=$gNhDoNT2ZG z_NNV3zq7A+&le!JBk&IUDJJu--wu^)p0j9Z-wB;#?Ap4!t9aRsLvQ~%%zwf6l2Ofw zshl(CZF*}LYxM7x0h?Y_M+U78*yzK;k|npZai>dOf|ldaLtB|e57n}>0&%OHl&<;y zjZQ05wFFelSXov%?JTxv+7$3krtjmIc(!}t)?Gic7VO+MdB)QQwSvv_4No)n3tKQg fWbt$O(R@Id?=MfN`tORnAYXdA`njxgN@xNAd55CZ literal 0 HcmV?d00001 diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index ed14a54750..41df5987e4 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1590,3 +1590,8 @@ ForbiddenStealthSummonTagBuff: { DisplayName: Forbidden Stealth Summon Tag Buff Description: If you're seeing this, something went horribly wrong } + +SmashedEvil: { + DisplayName: Smashed Evil + Description: Increased damage, movement speed, and regeneration +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 12dfdc08ba..99a26e0c33 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -458,12 +458,26 @@ EvilSmasher: { DisplayName: Evil Smasher Tooltip: ''' - For every enemy you kill this hammer gains stat bonuses - These bonuses stack until a cap is reached - The bonus stacks will reset if you select a different item - The bonus stacks will be reduced by 1 every time you get hit + Channels a powerful hammer strike with the capability to crush all evil + Striking a tile with the hammer strike will cause an explosion and push you back + Striking enemies provides inflicts Smashed Evil on both the user and target + Smashed Evil strengthens players and weakens enemies + Charging strikes increases damage, explosion radius, and Smashed Evil duration 'EViL! sMaSH eVIl! SmAsh... ER!' ''' + AltarDialogue0: Bearer of the Holy Hammer... + AltarDialogue1: Desirest thou to taste true power? + AltarDialogue2: Your eyes shall be opened... + AltarDialogue3: Ye shall be even as the gods! + AltarDialogue4: Yield the hammer unto us upon the altar + AltarDialogue5: Surrender, and thou shalt surely recieve our might + //All damage and kill dialogue has the capitalization randomized when said + DamageDialogue0: smash! + DamageDialogue1: evil! + DamageDialogue2: crush! + DamageDialogue3: des.. troy! + KillDialogue0: smash evil! + KillDialogue1: smash.. er! } ExaltedOathblade: { diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index cf9b90ba21..f52e680511 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -306,3 +306,4 @@ MirrorBladeProjectile.DisplayName: Mirror Blade MirrorBladeSlash.DisplayName: Mirror Blade Slash MirrorBladeSlashCreator.DisplayName: Mirror Blade Slash Creator GildedProboscisProj.DisplayName: Gilded Proboscis +EvilSmasherProjectile.DisplayName: Evil Smasher Projectile diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 502a33b798..06c659f910 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -6703,6 +6703,7 @@ namespace CalamityMod.NPCs ("CalamityMod/Buffs/StatDebuffs/MarkedforDeath", NPC => NPC.Calamity().markedForDeath), ("CalamityMod/Buffs/StatDebuffs/PearlAura", NPC => NPC.Calamity().pearlAura), ("CalamityMod/Buffs/StatDebuffs/ProfanedWeakness", NPC => NPC.Calamity().relicOfResilienceWeakness), + ("CalamityMod/Buffs/StatBuffs/SmashedEvilDebuff", NPC => NPC.HasBuff()), ("CalamityMod/Buffs/StatDebuffs/TemporalSadness", NPC => NPC.Calamity().temporalSadness), ("CalamityMod/Buffs/StatDebuffs/TimeDistortion", NPC => NPC.Calamity().timeDistortion), ("CalamityMod/Buffs/StatDebuffs/WhisperingDeath", NPC => NPC.Calamity().whisperingDeath), diff --git a/Projectiles/Melee/EvilSmasherProjectile.cs b/Projectiles/Melee/EvilSmasherProjectile.cs new file mode 100644 index 0000000000..a097f60a53 --- /dev/null +++ b/Projectiles/Melee/EvilSmasherProjectile.cs @@ -0,0 +1,208 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Sounds; +using Humanizer; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + + public class EvilSmasherProjectile : BaseSwordHoldoutProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public Player Owner => Main.player[Projectile.owner]; + public override Item BaseItem => ModContent.GetModItem(ModContent.ItemType()).Item; + + public override string Texture => BaseItem.ModItem.Texture; + public override int AfterImageLength => 10; + public override int OffsetDistance => 50; + public override int CooldownTime { get; set; } + public override bool AlternateSwings => false; + public override bool useMeleeSpeed => false; + public override SoundStyle? UseSound => SoundID.DD2_MonkStaffSwing with {Volume = 1f}; + + bool hasSmashedTile = false; + bool playedChargeSound = false; + bool firstEnemyHit = true; + + public override void Defaults() + { + Projectile.extraUpdates = 3; + swingWidth = 200; + RotateInCooldown = 0; + RotateInStartup = 0; + Projectile.width = 64; + Projectile.height = 66; + } + + public override void Spawn(IEntitySource source) + { + angle = new Vector2(angle.X.DirectionalSign(), 0); + var player = Main.player[Projectile.owner]; + var modplayer = player.GetModPlayer(); + StartupTime = 80; + CooldownTime = 30; + swingTime = 10; + modplayer.swingNum = 0; + Projectile.timeLeft = 600; + Projectile.scale *= 1.25f; + Projectile.originalDamage = Projectile.damage; + } + + public override void AdditionalAI() + { + if (inStartup) + { + Projectile.damage = (int)(Projectile.originalDamage * (timer / (float)(StartupTime-1))); + Owner.velocity.X *= 0.95f; + } + if (inStartup && !Owner.channel && timer > 30) + { + timer = StartupTime - 1; + } + if (Owner.channel && timer == StartupTime - 1) + { + Projectile.timeLeft++; + timer--; + if (!playedChargeSound) { + SoundEngine.PlaySound(SoundID.Item178,Projectile.Center); + playedChargeSound = true; + } + } + if (!hasSmashedTile && inSwing && SwingCompletion > 0.275f) + { + var adjustedAngle = angle.RotatedBy(Projectile.spriteDirection * SwingFunction()); + Vector2 HammerFrontPos = Projectile.Center + adjustedAngle * -16 * Projectile.scale + (adjustedAngle.RotatedBy(MathHelper.PiOver2) * 20 * Projectile.scale * angle.X); + if (Collision.SolidCollision(HammerFrontPos, 1, 1)) + { + + Owner.velocity *= 0.15f; + Owner.velocity -= adjustedAngle.RotatedBy(MathHelper.PiOver2) * angle.X * MathHelper.Lerp(7.5f,16f,Projectile.damage / (float)Projectile.originalDamage); + float ringRot = SwingCompletion < 0.5f ? 0 : MathHelper.PiOver2; + GeneralParticleHandler.SpawnParticle(new CustomPulse(HammerFrontPos, Vector2.Zero, Color.Red, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloatDirection(), 0.03f, 0.04f * (2 + Projectile.damage / (float)Projectile.originalDamage), 15)); + GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.2f, 0.75f * (2 + Projectile.damage / (float)Projectile.originalDamage), 30)); + GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.1f, 0.5f * (2 + Projectile.damage / (float)Projectile.originalDamage), 30)); + int radius = (int)(4 * Projectile.damage / (float)Projectile.originalDamage); + Point scanAreaStart = HammerFrontPos.ToTileCoordinates() + new Point(-radius, -radius); + Point scanAreaEnd = HammerFrontPos.ToTileCoordinates() + new Point(radius, radius); + Projectile.CreateImpactExplosion((int)(10 * Projectile.damage / (float)Projectile.originalDamage), Projectile.Center, ref scanAreaStart, ref scanAreaEnd, Projectile.width, out bool causedShockwaves); + + hasSmashedTile = true; + timer = StartupTime + swingTime; + angle = adjustedAngle; + var pos = Projectile.Center; + Projectile.Size *= 2 + Projectile.damage / (float)Projectile.originalDamage; + Projectile.Center = HammerFrontPos; + Projectile.Damage(); + Projectile.Size /= 2 + Projectile.damage / (float)Projectile.originalDamage; + Projectile.Center = pos; + + if ((Projectile.damage / (float)Projectile.originalDamage) >= 1) + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with {VariantsWeights = new ReadOnlySpan(new float[] { 1, 0, 0 })}); + SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact); + } + } + Owner.heldProj = Projectile.whoAmI; + } + + public override float SwingFunction() + { + if (hasSmashedTile) + return MathHelper.ToRadians(MathHelper.Lerp(0, -swingWidth * 0.4f, MathF.Pow(CooldownCompletion, 0.5f))); + if (inStartup) + return MathHelper.ToRadians(MathHelper.SmoothStep(-swingWidth * 0.8f, -swingWidth * 0.66f, 1 - MathF.Pow(StartupCompletion, 0.5f))); + if (inCooldown) + return MathHelper.ToRadians(MathHelper.SmoothStep(swingWidth * 0.33f, swingWidth * 0.45f, MathF.Pow(CooldownCompletion, 0.5f))); + return MathHelper.ToRadians(MathHelper.SmoothStep(-swingWidth * .66f, (swingWidth * 0.33f), SwingCompletion)); + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (firstEnemyHit && Main.rand.NextFloat() < (Projectile.damage / (float)Projectile.originalDamage)) + { + string text = ""; + if (target.life > 0) + text = CalamityUtils.GetTextValue("Items.Weapons.Melee.EvilSmasher.DamageDialogue" + Main.rand.Next(4)); + else + text = CalamityUtils.GetTextValue("Items.Weapons.Melee.EvilSmasher.KillDialogue" + Main.rand.Next(2)); + char[] textToFormat = text.ToCharArray(); + for (var i = 0; i < textToFormat.Length; i++) + { + if (Main.rand.NextBool()) + textToFormat[i] = char.ToUpper(textToFormat[i]); + } + text = new string(textToFormat); + bool intense = target.life <= 0; + CombatText.NewText(Projectile.Hitbox, Color.Lerp(Color.DarkGray,Color.Gold, intense ? 0.25f: 0.1f), text, intense); + firstEnemyHit = false; + } + if (!hasSmashedTile && (Projectile.damage / (float)Projectile.originalDamage) >= 1) + { + for (int i = 0; i < 16; i++) + { + int sparkLifetime = Main.rand.Next(10, 15); + float sparkScale = Main.rand.NextFloat(1f, 2f); + var sparkColor = Main.rand.NextBool() ? Color.Purple : Color.Red; + + if (Main.rand.NextBool(5)) + sparkScale *= 1.4f; + + Vector2 sparkVelocity = Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * MathHelper.Lerp(10, 30, Main.rand.NextFloat()); + SparkParticle spark = new SparkParticle(target.Center, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + + SoundEngine.PlaySound(SoundID.DeerclopsRubbleAttack with {Volume = 0.5f,LimitsArePerVariant = false, MaxInstances = 1}); + } + } + else if (!hasSmashedTile) + { + + SoundEngine.PlaySound(SoundID.Item69 with { Volume = 1f, LimitsArePerVariant = false, MaxInstances = 1 }); + } + target.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 600, Projectile.damage / (float)Projectile.originalDamage)); + Owner.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 600, Projectile.damage / (float)Projectile.originalDamage)); + } + + public override bool PreDraw(ref Color lightColor) + { + if (!inCooldown) + { + var tex = ModContent.Request(Texture + "Glow").Value; + float outlineWidth = (int)(4 * (Projectile.damage / (float)Projectile.originalDamage)) * 0.5f; + if (inSwing) + { + outlineWidth *= 1 - SwingCompletion; + } + for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.25f) + { + Main.spriteBatch.Draw( + tex, + Projectile.Center + new Vector2(0, Projectile.gfxOffY) + Vector2.UnitX.RotatedBy(i + Projectile.rotation) * outlineWidth * Projectile.scale - Main.screenPosition, + null, + Color.Lerp(Color.Purple,Color.Red,MathF.Sin(Main.GlobalTimeWrappedHourly * 6)* 0.5f + 0.5f), + Projectile.rotation, + tex.Size() * 0.5f, + Projectile.scale, + Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, + 0 + ); + } + } + if (inSwing) + return base.PreDraw(ref lightColor); + return true; + } + } +} From a581506930485611111f05107e665c60a23b136c Mon Sep 17 00:00:00 2001 From: Xyk Date: Tue, 6 Jan 2026 02:58:51 -0800 Subject: [PATCH 02/22] Properly Implemented Abaddon and VoE functionality --- Buffs/DamageOverTime/BrimstoneFlames.cs | 28 +++- CalPlayer/CalamityPlayer.cs | 16 +- CalPlayer/CalamityPlayerDrawEffects.cs | 2 +- CalPlayer/CalamityPlayerHitHurt.cs | 152 +++++++++++++++++- CalPlayer/CalamityPlayerLifeRegen.cs | 4 +- CalPlayer/CalamityPlayerOnHit.cs | 14 -- Items/Accessories/Abaddon.cs | 13 +- Items/Accessories/VoidofExtinction.cs | 16 +- .../Mods.CalamityMod.Items.Accessories.hjson | 9 +- ...ods.CalamityMod.Projectiles.Typeless.hjson | 2 - NPCs/CalamityGlobalNPC.cs | 5 +- Projectiles/Typeless/AbaddonCrit.cs | 53 ------ Projectiles/Typeless/VoidofExtinctionCrit.cs | 53 ------ 13 files changed, 227 insertions(+), 140 deletions(-) delete mode 100644 Projectiles/Typeless/AbaddonCrit.cs delete mode 100644 Projectiles/Typeless/VoidofExtinctionCrit.cs diff --git a/Buffs/DamageOverTime/BrimstoneFlames.cs b/Buffs/DamageOverTime/BrimstoneFlames.cs index b05c42232b..8fcf454bbf 100644 --- a/Buffs/DamageOverTime/BrimstoneFlames.cs +++ b/Buffs/DamageOverTime/BrimstoneFlames.cs @@ -12,8 +12,9 @@ namespace CalamityMod.Buffs.DamageOverTime { public static DebuffData debuffData = new DebuffData() { - EnemyLostRegen = 60, - HeatDebuffScaling = 1 + EnemyLostRegen = 60, // This can be adjusted by a few sources + HeatDebuffScaling = 1, + NPCLifeRegenMethod = BrimstoneFlamesNPCLifeRegen }; public override void SetStaticDefaults() { @@ -23,6 +24,29 @@ namespace CalamityMod.Buffs.DamageOverTime BuffID.Sets.LongerExpertDebuff[Type] = true; BuffDatasets.DebuffDataset[Type] = debuffData; } + public static void BrimstoneFlamesNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + bool effected = (cnpc.abaddonEffected || cnpc.voidOfExtinctionEffected); + bool strong = cnpc.voidOfExtinctionEffected; + int baseBrimstoneFlamesDoTValue = (int)debuffData.EnemyLostRegen; + if (effected) + { + for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + { + Player player = Main.player[playerIndex]; + if (player.active) + { + float improvedDamage = baseBrimstoneFlamesDoTValue * player.Calamity().abaddonFlameDamage; + if (improvedDamage > baseBrimstoneFlamesDoTValue && (player.Calamity().abaddon || player.Calamity().voidOfExtinction)) + { + baseBrimstoneFlamesDoTValue = (int)improvedDamage; + } + } + } + } + cnpc.ApplyDPSDebuff(baseBrimstoneFlamesDoTValue, baseBrimstoneFlamesDoTValue / 20, ref npc.lifeRegen, ref damage); + } public override void Update(Player player, ref int buffIndex) { diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index a371bdef12..191cf6516c 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -944,6 +944,9 @@ namespace CalamityMod.CalPlayer public bool toxicHeart = false; public bool toxicHeartVisuals = false; public bool abaddon = false; + public int abaddonCooldown = 0; + public bool abaddonEffectVisual = false; + public float abaddonFlameDamage = 0; public bool aeroStone = false; public bool lifejelly = false; @@ -1236,7 +1239,6 @@ namespace CalamityMod.CalPlayer public int tailFrame = 0; public bool astralStarRain = false; public int astralStarRainCooldown = 0; - public int AbaddonCooldown = 0; public int VoidCooldown = 0; public int ursaSergeantCooldown = 0; public int AlchFlaskCooldown = 0; @@ -2509,6 +2511,8 @@ namespace CalamityMod.CalPlayer spiritOrigin = false; spiritOriginVanity = false; critDamage = 0; + if (abaddonCooldown > 0) + abaddonCooldown--; astralStarRain = false; @@ -3047,7 +3051,6 @@ namespace CalamityMod.CalPlayer gSabatonTempJumpSpeed = 0; rOfDelivarenceRam = false; astralStarRainCooldown = 0; - AbaddonCooldown = 0; VoidCooldown = 0; AlchFlaskCooldown = 0; ascendantInsigniaCooldown = 0; @@ -4916,9 +4919,16 @@ namespace CalamityMod.CalPlayer } } + if (Player.Calamity().abaddon || Player.Calamity().voidOfExtinction) + { + Player.Calamity().abaddonFlameDamage = (1 + Player.GetTotalCritChance(Player.GetBestClass()) * 0.01f * (Player.Calamity().voidOfExtinction ? VoidofExtinction.critScaling : Abaddon.critScaling)); + } + else + Player.Calamity().abaddonFlameDamage = 0; + // True melee damage from various vanilla equipment placed here. - // Titan Glove and ALL upgrades. + // Titan Glove and ALL upgrades. if (Player.kbGlove) Player.GetDamage() += 0.1f; diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index ab25f12f25..307326d13e 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -443,7 +443,7 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.brimstoneFlames && drawInfo.shadow == 0f) { - bool resistsBrimstoneFlames = abaddon; // Looks weaker if you have Abaddon equipped + bool resistsBrimstoneFlames = (abaddon || voidOfExtinction); // Looks weaker if you have Abaddon or VoE equipped BrimstoneFlames.DrawEffects(drawInfo, resistsBrimstoneFlames); } diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index f8291c3f03..3213c0103a 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -8,6 +8,7 @@ using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer.Dashes; using CalamityMod.Cooldowns; +using CalamityMod.DataStructures; using CalamityMod.Dusts; using CalamityMod.Enums; using CalamityMod.Events; @@ -51,11 +52,12 @@ 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; +using static System.Net.Mime.MediaTypeNames; namespace CalamityMod.CalPlayer { @@ -728,7 +730,155 @@ namespace CalamityMod.CalPlayer modifiers.FinalDamage *= BalancingConstants.SummonerCrossClassNerf; } } + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + #region Abaddon and VoE effects + if (Player.Calamity().abaddon) + target.Calamity().abaddonEffected = true; + else if (target.Calamity().abaddonEffected) + target.Calamity().abaddonEffected = false; + + if (Player.Calamity().voidOfExtinction) + { + target.Calamity().voidOfExtinctionEffected = true; + // Check here for the amount of debuffs on enemy + int numOfDebuffs = 0; + for (int index = 0; index < target.buffType.Length; index++) + { + int type = target.buffType[index]; + var debuffData = BuffDatasets.DebuffDataset[type]; + if (debuffData != null) + numOfDebuffs++; + } + modifiers.CritDamage += VoidofExtinction.critDamageBoostPerDebuff * numOfDebuffs; + } + else if (target.Calamity().voidOfExtinctionEffected) + target.Calamity().voidOfExtinctionEffected = false; + + #endregion + } #endregion + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + NPC npc = target; + if ((target.Calamity().abaddonEffected || target.Calamity().voidOfExtinctionEffected) && hit.Crit && abaddonCooldown == 0) + { + bool strong = target.Calamity().voidOfExtinctionEffected; + abaddonCooldown = 60; + float areaOfEffect = (strong ? 1000 : 500); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Color color1 = Color.Crimson; + Color color2 = Color.OrangeRed; + int targetNum = 0; + int maxTargetNum = strong ? 12 : 8; + int startDir = Main.rand.NextBool() ? 1 : -1; + for (int r = 0; r < Main.maxNPCs; r++) + { + NPC targeted = Main.npc[r]; + + if (targeted != null && targeted.CanBeChasedBy() && Vector2.Distance(targeted.Center, npc.Center) <= areaOfEffect && targetNum < maxTargetNum) + { + Vector2 start = npc.Center; + Vector2 end = targeted.Center; + Color color = Main.rand.NextBool() ? color2 : color1; + + if (Player.Calamity().abaddonEffectVisual) + { + Vector2 lerpVel = Vector2.Lerp(start, end, 0.5f); + float scale = 0.015f; + Particle spark = new CustomSpark(lerpVel, npc.SafeDirectionTo(targeted.Center), "CalamityMod/Particles/BloomLineThick", false, 18, scale, color, new Vector2(1.2f, (Utils.Distance(start, end) * 0.034f)), true, true, shrinkSpeed: 0.25f, glowOpacity: 0.75f); + GeneralParticleHandler.SpawnParticle(spark); + + for (int g = 0; g < 7; g++) + { + int DustID = ModContent.DustType(); + Dust dust2 = Dust.NewDustDirect(targeted.Center, targeted.width, targeted.height, DustID); + dust2.scale = Main.rand.NextFloat(0.6f, 0.75f); + dust2.velocity = new Vector2(4, 4).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 0.8f); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? color2 : color1; + } + + float distance = Vector2.Distance(targeted.Center, npc.Center); + int maxDusts = (int)distance; + int dustCaper = 60; + int dustDivisor = maxDusts / dustCaper; + if (dustDivisor < 2) + dustDivisor = 2; + + Vector2 dustLineStart = targeted.Center; + Vector2 dustLineEnd = npc.Center; + Vector2 currentDustPos = default; + Vector2 dustVel = npc.Center.DirectionTo(targeted.Center); + int startingPoint = Main.rand.Next(0, 400 + 1); + Vector2 lastDustPos = default; + for (int i = 0; i < maxDusts; i++) + { + float sine = (float)Math.Sin((i + startingPoint) * 0.425f / MathHelper.Pi) * startDir; + float endStartFade = Math.Min(Utils.GetLerpValue(maxDusts * 0.8f, 0, i), Utils.GetLerpValue(0 + maxDusts * 0.2f, maxDusts, i)); + currentDustPos = Vector2.Lerp(dustLineStart, dustLineEnd, i / (float)maxDusts) + dustVel.RotatedBy(MathHelper.PiOver2) * 6 * sine * endStartFade; + if (i == 0) + lastDustPos = currentDustPos; + + currentDustPos = Vector2.Lerp(dustLineStart, dustLineEnd, i / (float)maxDusts) + dustVel.RotatedBy(MathHelper.PiOver2) * 55 * sine * endStartFade; + Dust dustLinger = Dust.NewDustPerfect(currentDustPos, ModContent.DustType()); + dustLinger.position = currentDustPos; + dustLinger.velocity = currentDustPos.DirectionTo(lastDustPos) * (Main.rand.NextBool(5) ? 4f : Main.rand.NextFloat(0.2f, 0.8f)); + dustLinger.noGravity = true; + dustLinger.scale = Main.rand.NextFloat(0.8f, 1f) * 1.5f; + dustLinger.fadeIn = Main.rand.NextFloat(0.6f, 1f) * 4; + dustLinger.color = Color.Lerp(color1, color2, Utils.GetLerpValue(0, maxDusts, i)); + + lastDustPos = currentDustPos; + } + } + for (int u = 0; u < 2; u++) + { + Vector2 pos = start; + if (u == 0) pos = end; + Particle spark2 = new CustomSpark(pos, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, u != 0 ? 0.7f : 0.55f, color * (Player.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f); + GeneralParticleHandler.SpawnParticle(spark2); + if (targetNum > 0) // Only spawn the bloom on start position for the first arc + u++; + } + + int debuffTime = (strong ? 180 : 90); + npc.AddBuff(ModContent.BuffType(), debuffTime); + + + float bestDamage = 0; + // Find all the debuffs on the enemy + for (int index = 0; index < npc.buffType.Length; index++) + { + int type = npc.buffType[index]; + var debuffData = BuffDatasets.DebuffDataset[type]; + if (debuffData != null) + { + // Find the player who has the accessory + for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + { + Player player = Main.player[playerIndex]; + if (player.active) + { + if (player.Calamity().abaddonFlameDamage > bestDamage) + bestDamage = player.Calamity().abaddonFlameDamage; + } + } + // Calculate the brimstone flames damage to see if the debuffs can be transfered + int bFlamesDamage = Math.Max((int)(60 * bestDamage), 60); + if (debuffData.EnemyLostRegen <= bFlamesDamage) + targeted.AddBuff(type, debuffTime); + } + } + + targetNum++; + } + } + } + } + } #region Modify Hit By NPC public override void ModifyHitByNPC(NPC npc, ref Player.HurtModifiers modifiers) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 2bc5d07102..ba2a91496f 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -115,8 +115,8 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(crushDepth, 18, purity); ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity); ApplyDoTDebuff(shadowflame, 30, purity); - ApplyDoTDebuff(brimstoneFlames, (int)MathF.Round(30 * (abaddon ? (1f - Abaddon.BrimstoneFlamesReduction) : 1f)), purity); - ApplyDoTDebuff(plague, (int)MathF.Round(30 * (abaddon ? (1f - AlchemicalFlask.PlagueReduction) : 1f)), purity); + ApplyDoTDebuff(brimstoneFlames, (int)MathF.Round(30 * ((abaddon || voidOfExtinction) ? (1f - Abaddon.BrimstoneFlamesReduction) : 1f)), purity); + ApplyDoTDebuff(plague, (int)MathF.Round(30 * (alchFlask ? (1f - AlchemicalFlask.PlagueReduction) : 1f)), purity); ApplyDoTDebuff(vHex, 30); // Has other effects ApplyDoTDebuff(searingLava, 30); ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 60fe2b408a..9b08695048 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -732,20 +732,6 @@ namespace CalamityMod.CalPlayer } } - if (abaddon && crit && AbaddonCooldown <= 0 && !voidOfExtinction) - { - AbaddonCooldown = 15; - int AbaddonExploDamage = (int)Player.GetBestClassDamage().ApplyTo(Abaddon.AbaddonExploDamage); - Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), AbaddonExploDamage, 0f, Player.whoAmI); - } - - if (voidOfExtinction && crit && VoidCooldown <= 0) - { - VoidCooldown = 15; - int VoidExploDamage = (int)Player.GetBestClassDamage().ApplyTo(VoidofExtinction.VoidExploDamage); - Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), VoidExploDamage, 0f, Player.whoAmI); - } - if (ursaSergeant && ursaSergeantCooldown <= 0) { ursaSergeantCooldown = UrsaSergeant.MaxCooldown; diff --git a/Items/Accessories/Abaddon.cs b/Items/Accessories/Abaddon.cs index 6f3dfd0ba5..e8bd8878c7 100644 --- a/Items/Accessories/Abaddon.cs +++ b/Items/Accessories/Abaddon.cs @@ -1,4 +1,6 @@ -using Terraria; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; +using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Accessories public static int CritBoost = 8; public static float BrimstoneFlamesReduction = 0.5f; - public static int AbaddonExploDamage = 25; + public static float critScaling = 2; // How effective crit chance is at increasing debuff damage public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, BrimstoneFlamesReduction.ToPercent()); public override void SetDefaults() @@ -27,7 +29,14 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().abaddon = true; + player.Calamity().abaddonEffectVisual = !hideVisual; player.GetCritChance() += CritBoost; } + public override void ModifyTooltips(List list) + { + Player player = Main.LocalPlayer; + if (Main.LocalPlayer != null) + list.FindAndReplace("[DAMAGE]", ((int)(BrimstoneFlames.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonFlameDamage)).ToString() + " DPS"); + } } } diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index 7be242b9da..bd654b064d 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -1,4 +1,6 @@ -using CalamityMod.CalPlayer; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -12,7 +14,8 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public static int CritBoost = 13; - public static int VoidExploDamage = 40; + public static float critScaling = 7; // How effective crit chance is at increasing debuff damage + public static float critDamageBoostPerDebuff = 0.03f; // 3% increased crit damage per debuff public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, Abaddon.BrimstoneFlamesReduction.ToPercent()); public override void SetDefaults() @@ -38,9 +41,14 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.voidOfExtinction = true; - modPlayer.abaddon = true; + modPlayer.abaddonEffectVisual = !hideVisual; player.GetCritChance() += CritBoost; - + } + public override void ModifyTooltips(List list) + { + Player player = Main.LocalPlayer; + if (Main.LocalPlayer != null) + list.FindAndReplace("[DAMAGE]", ((int)(BrimstoneFlames.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonFlameDamage)).ToString()); } } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index f85719aee0..3b99ef822c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -3,8 +3,10 @@ Abaddon: { Tooltip: ''' {$CommonItemTooltip.PercentIncreasedCritChance} - Critical strikes explode, igniting nearby foes with [cbuff:CalamityMod/BrimstoneFlames] + Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that scales off of your crit chance + When crit, enemies spread all debuffs thay are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}% + Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE] ''' } @@ -2061,8 +2063,11 @@ VoidofExtinction: { Tooltip: ''' {$CommonItemTooltip.PercentIncreasedCritChance} - Critical strikes explode, igniting nearby foes with [cbuff:CalamityMod/BrimstoneFlames] + Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that greatly scales off of your crit chance + When crit, enemies spread all debuffs thay are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies + Crits deal an additional 2% damage per debuff on the enemy Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}% + Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 4521bdd13e..236a11de6b 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -1,4 +1,3 @@ -AbaddonCrit.DisplayName: Brimstone Blast AeroExplosive.DisplayName: Aeroboom AllianceTriangle.DisplayName: Alliance Triangle AmuletEnergy.DisplayName: Sea Spirit @@ -169,7 +168,6 @@ WulfrumDiggingTurtleProjectile.DisplayName: Digging Turtle WulfrumHook.DisplayName: Wulfrum Slingshot WulfrumLureSignal.DisplayName: Signal YellowLabSeeker.DisplayName: Seeking Mechanism -VoidofExtinctionCrit.DisplayName: Void of Extinction Crit XykDeathAnim.DisplayName: Xyk Death Animation XykWings.DisplayName: Xyk Wings StratusBlackHole.DisplayName: Stratus Singularity diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 32c967dc5f..8cf0e437db 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -299,6 +299,8 @@ namespace CalamityMod.NPCs public int antlionCloudDebuffTimer = 0; public bool scionsCurioEffected = false; + public bool abaddonEffected = false; + public bool voidOfExtinctionEffected = false; public int warbannerBurnTime = 0; // Determines the rate that the enemy is damaged public int warbannerBurnTimer = 0; // The duration of the debuff public int warbannerBurnStacks = 0; // The stacks increase how fast the debuff hits @@ -575,6 +577,8 @@ namespace CalamityMod.NPCs myClone.antlionCloudDebuffTimer = antlionCloudDebuffTimer; myClone.scionsCurioEffected = scionsCurioEffected; + myClone.abaddonEffected = abaddonEffected; + myClone.voidOfExtinctionEffected = voidOfExtinctionEffected; myClone.warbannerBurnTime = warbannerBurnTime; myClone.warbannerBurnTimer = warbannerBurnTimer; myClone.warbannerBurnStacks = warbannerBurnStacks; @@ -3373,7 +3377,6 @@ namespace CalamityMod.NPCs if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].head)) npc.ai[3] = 0f; } - if (warbannerBurnTimer > 0) warbannerBurnTimer--; if (warbannerBurnTimer == 0 && warbannerBurnMarked) diff --git a/Projectiles/Typeless/AbaddonCrit.cs b/Projectiles/Typeless/AbaddonCrit.cs deleted file mode 100644 index d77d440a3c..0000000000 --- a/Projectiles/Typeless/AbaddonCrit.cs +++ /dev/null @@ -1,53 +0,0 @@ -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class AbaddonCrit : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public Player Owner => Main.player[Projectile.owner]; - private static float ExplosionRadius = 300f; - - public override void SetDefaults() - { - //These shouldn't matter because its circular - Projectile.width = 300; - Projectile.height = 300; - Projectile.friendly = true; - Projectile.DamageType = AverageDamageClass.Instance; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.penetrate = -1; - Projectile.timeLeft = 2; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - } - public override void AI() - { - Player player = Main.player[Projectile.owner]; - for (int i = 0; i <= 30; i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(4) ? 218 : ModContent.DustType(), new Vector2(5, 5).RotatedByRandom(MathHelper.ToRadians(360)) * Main.rand.NextFloat(1.1f, 2.2f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); - dust.shader = GameShaders.Armor.GetSecondaryShader(player.cFace, player); - dust.noGravity = true; - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 360); - SoundEngine.PlaySound(SoundID.Item89 with { Volume = 0.5f, PitchVariance = 0.4f }, Projectile.Center); - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); - public override bool? CanDamage() => base.CanDamage(); - public override bool? CanCutTiles() => false; - } -} diff --git a/Projectiles/Typeless/VoidofExtinctionCrit.cs b/Projectiles/Typeless/VoidofExtinctionCrit.cs deleted file mode 100644 index 9f56c8349e..0000000000 --- a/Projectiles/Typeless/VoidofExtinctionCrit.cs +++ /dev/null @@ -1,53 +0,0 @@ -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class VoidofExtinctionCrit : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public Player Owner => Main.player[Projectile.owner]; - private static float ExplosionRadius = 300f; - - public override void SetDefaults() - { - //These shouldn't matter because its circular - Projectile.width = 300; - Projectile.height = 300; - Projectile.friendly = true; - Projectile.DamageType = AverageDamageClass.Instance; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.penetrate = -1; - Projectile.timeLeft = 2; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - } - public override void AI() - { - Player player = Main.player[Projectile.owner]; - for (int i = 0; i <= 30; i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(4) ? 218 : ModContent.DustType(), new Vector2(5, 5).RotatedByRandom(MathHelper.ToRadians(360)) * Main.rand.NextFloat(1.1f, 2.2f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); - dust.shader = GameShaders.Armor.GetSecondaryShader(player.cFace, player); - dust.noGravity = true; - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 360); - SoundEngine.PlaySound(SoundID.Item89 with { Volume = 0.5f, PitchVariance = 0.4f }, Projectile.Center); - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); - public override bool? CanDamage() => base.CanDamage(); - public override bool? CanCutTiles() => false; - } -} From a9b122b11b05f93cdc8a4097b3dc98e75f43ac22 Mon Sep 17 00:00:00 2001 From: Xyk Date: Tue, 6 Jan 2026 18:17:54 -0800 Subject: [PATCH 03/22] Finished and Polished Fixed many issues and made Demon Flames work again --- Buffs/DamageOverTime/DemonicFlames.cs | 7 +-- Buffs/DamageOverTime/Shred.cs | 6 ++- CalPlayer/CalamityPlayerHitHurt.cs | 52 +++++++++++++------ CalPlayer/CalamityPlayerMiscEffects.cs | 2 - Items/Accessories/Abaddon.cs | 2 +- Items/Accessories/VoidofExtinction.cs | 4 +- .../Mods.CalamityMod.Items.Accessories.hjson | 8 +-- NPCs/CalamityGlobalNPC.cs | 12 ++++- Systems/Collections/CalamityBuffSets.cs | 5 +- 9 files changed, 64 insertions(+), 34 deletions(-) diff --git a/Buffs/DamageOverTime/DemonicFlames.cs b/Buffs/DamageOverTime/DemonicFlames.cs index 82b6e11979..607e4abaed 100644 --- a/Buffs/DamageOverTime/DemonicFlames.cs +++ b/Buffs/DamageOverTime/DemonicFlames.cs @@ -16,11 +16,11 @@ namespace CalamityMod.Buffs.DamageOverTime { EnemyLostRegen = 60, //Unused in the method, this is the amount of DoT from Forbidden Oathblade demon flames HeatDebuffScaling = 1, //Unused in the method, but kept so other things can know this is a heat debuff - NPCLifeRegenMethod = DemonFlamesNPCLifeRegen + NPCLifeRegenMethod = DemonicFlamesNPCLifeRegen }; - public static void DemonFlamesNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + public static void DemonicFlamesNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) { - int baseDemonicFlamesDoTValue = (int)Math.Max(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(npc.Calamity().demonicFlamesBonusDamage), npc.Calamity().demonicFlamesBonusDamage); + int baseDemonicFlamesDoTValue = (int)Math.Max(Math.Max(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(npc.Calamity().demonicFlamesBonusDamage), npc.Calamity().demonicFlamesBonusDamage), (int)debuffData.EnemyLostRegen); npc.Calamity().ApplyDPSDebuff(baseDemonicFlamesDoTValue, baseDemonicFlamesDoTValue / 15, ref npc.lifeRegen, ref damage); } public override void SetStaticDefaults() @@ -29,6 +29,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/Shred.cs b/Buffs/DamageOverTime/Shred.cs index bd168fd492..422fe65db8 100644 --- a/Buffs/DamageOverTime/Shred.cs +++ b/Buffs/DamageOverTime/Shred.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.DataStructures; using CalamityMod.NPCs; using CalamityMod.Particles; using CalamityMod.Projectiles; @@ -18,7 +19,10 @@ namespace CalamityMod.Buffs.DamageOverTime // This deals 600 DPS per stack, is boosted by ranged stats and can supercrit. internal static int BaseDamage = 120; internal static int FramesPerDamageTick = 12; - + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = BaseDamage + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 3213c0103a..a4ad4ec957 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -762,25 +762,28 @@ namespace CalamityMod.CalPlayer public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { NPC npc = target; - if ((target.Calamity().abaddonEffected || target.Calamity().voidOfExtinctionEffected) && hit.Crit && abaddonCooldown == 0) + if ((npc.Calamity().abaddonEffected || npc.Calamity().voidOfExtinctionEffected) && hit.Crit && abaddonCooldown == 0) { - bool strong = target.Calamity().voidOfExtinctionEffected; - abaddonCooldown = 60; - float areaOfEffect = (strong ? 1000 : 500); + bool strong = npc.Calamity().voidOfExtinctionEffected; + float areaOfEffect = (strong ? 1200 : 600); if (Main.netMode != NetmodeID.MultiplayerClient) { Color color1 = Color.Crimson; Color color2 = Color.OrangeRed; + int debuffTime = (strong ? 180 : 90); int targetNum = 0; - int maxTargetNum = strong ? 12 : 8; + int maxTargetNum = strong ? 8 : 5; int startDir = Main.rand.NextBool() ? 1 : -1; for (int r = 0; r < Main.maxNPCs; r++) { NPC targeted = Main.npc[r]; - if (targeted != null && targeted.CanBeChasedBy() && Vector2.Distance(targeted.Center, npc.Center) <= areaOfEffect && targetNum < maxTargetNum) + if (targeted != null && targeted != npc && targeted.CanBeChasedBy() && Vector2.Distance(targeted.Center, npc.Center) <= areaOfEffect && targetNum < maxTargetNum) { - Vector2 start = npc.Center; + targeted.Calamity().voidOfExtinctionEffected = npc.Calamity().voidOfExtinctionEffected; + targeted.Calamity().abaddonEffected = npc.Calamity().abaddonEffected; + + Vector2 start = npc.Center + Main.rand.NextVector2Circular(npc.width / 2, npc.height / 2); Vector2 end = targeted.Center; Color color = Main.rand.NextBool() ? color2 : color1; @@ -808,10 +811,10 @@ namespace CalamityMod.CalPlayer if (dustDivisor < 2) dustDivisor = 2; - Vector2 dustLineStart = targeted.Center; - Vector2 dustLineEnd = npc.Center; + Vector2 dustLineStart = start; + Vector2 dustLineEnd = end; Vector2 currentDustPos = default; - Vector2 dustVel = npc.Center.DirectionTo(targeted.Center); + Vector2 dustVel = start.DirectionTo(end); int startingPoint = Main.rand.Next(0, 400 + 1); Vector2 lastDustPos = default; for (int i = 0; i < maxDusts; i++) @@ -844,9 +847,7 @@ namespace CalamityMod.CalPlayer u++; } - int debuffTime = (strong ? 180 : 90); npc.AddBuff(ModContent.BuffType(), debuffTime); - float bestDamage = 0; // Find all the debuffs on the enemy @@ -854,7 +855,11 @@ namespace CalamityMod.CalPlayer { int type = npc.buffType[index]; var debuffData = BuffDatasets.DebuffDataset[type]; - if (debuffData != null) + + // Calculate the brimstone flames damage to see if the debuffs can be transfered + int bFlamesDamage = Math.Max((int)(BrimstoneFlames.debuffData.EnemyLostRegen * bestDamage), (int)BrimstoneFlames.debuffData.EnemyLostRegen); + + if (CalamityBuffSets.IsDebuff[type]) { // Find the player who has the accessory for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) @@ -866,16 +871,29 @@ namespace CalamityMod.CalPlayer bestDamage = player.Calamity().abaddonFlameDamage; } } - // Calculate the brimstone flames damage to see if the debuffs can be transfered - int bFlamesDamage = Math.Max((int)(60 * bestDamage), 60); - if (debuffData.EnemyLostRegen <= bFlamesDamage) + + if (debuffData == null || debuffData.EnemyLostRegen <= bFlamesDamage) targeted.AddBuff(type, debuffTime); } + // Edge case fixes for Shred and Demonic Flames + if (npc.Calamity().somaShredStacks > 0 && Shred.BaseDamage <= bFlamesDamage) + targeted.AddBuff(ModContent.BuffType(), debuffTime); + int demonicFlames = ModContent.GetModBuff(ModContent.BuffType()).Type; + if (npc.HasBuff(demonicFlames)) + targeted.Calamity().demonicFlamesBonusDamage = npc.Calamity().demonicFlamesBonusDamage; } - targetNum++; } } + if (targetNum == 0) + { + npc.AddBuff(ModContent.BuffType(), debuffTime); + Color color = Main.rand.NextBool() ? color2 : color1; + Particle spark2 = new CustomSpark(npc.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, 0.55f, color * (Player.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f); + GeneralParticleHandler.SpawnParticle(spark2); + + } + abaddonCooldown = targetNum * 12; } } } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 35f572c889..46fa49ed2b 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2237,8 +2237,6 @@ namespace CalamityMod.CalPlayer raiderSoundCooldown--; if (astralStarRainCooldown > 0) astralStarRainCooldown--; - if (AbaddonCooldown > 0) - AbaddonCooldown--; if (VoidCooldown > 0) VoidCooldown--; if (ursaSergeantCooldown > 0) diff --git a/Items/Accessories/Abaddon.cs b/Items/Accessories/Abaddon.cs index e8bd8878c7..5a92b845c2 100644 --- a/Items/Accessories/Abaddon.cs +++ b/Items/Accessories/Abaddon.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Accessories { Player player = Main.LocalPlayer; if (Main.LocalPlayer != null) - list.FindAndReplace("[DAMAGE]", ((int)(BrimstoneFlames.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonFlameDamage)).ToString() + " DPS"); + list.FindAndReplace("[DAMAGE]", ((int)(BrimstoneFlames.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonFlameDamage)).ToString()); } } } diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index bd654b064d..82fe55b61d 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int CritBoost = 13; + public static int CritBoost = 8; public static float critScaling = 7; // How effective crit chance is at increasing debuff damage - public static float critDamageBoostPerDebuff = 0.03f; // 3% increased crit damage per debuff + public static float critDamageBoostPerDebuff = 0.02f; // 2% increased crit damage per debuff public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, Abaddon.BrimstoneFlamesReduction.ToPercent()); public override void SetDefaults() diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 3b99ef822c..134015fb78 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -4,9 +4,9 @@ Abaddon: { ''' {$CommonItemTooltip.PercentIncreasedCritChance} Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that scales off of your crit chance - When crit, enemies spread all debuffs thay are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies + When crit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}% - Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE] + Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE] DPS ''' } @@ -2064,10 +2064,10 @@ VoidofExtinction: { ''' {$CommonItemTooltip.PercentIncreasedCritChance} Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that greatly scales off of your crit chance - When crit, enemies spread all debuffs thay are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies + When crit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies Crits deal an additional 2% damage per debuff on the enemy Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}% - Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE] + Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE] DPS ''' } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 8cf0e437db..850ccbb3ec 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -292,6 +292,7 @@ namespace CalamityMod.NPCs public bool brimstoneFlames = false; public bool demonicFlames = false; public int demonicFlamesBonusDamage = 0; + public int demonicFlamesClearTimer = 0; public bool holyFlames = false; public bool plague = false; public bool armorCrunch = false; @@ -570,6 +571,7 @@ namespace CalamityMod.NPCs myClone.brimstoneFlames = brimstoneFlames; myClone.demonicFlames = demonicFlames; myClone.demonicFlamesBonusDamage = demonicFlamesBonusDamage; + myClone.demonicFlamesClearTimer = demonicFlamesClearTimer; myClone.holyFlames = holyFlames; myClone.plague = plague; myClone.armorCrunch = armorCrunch; @@ -773,8 +775,6 @@ namespace CalamityMod.NPCs if (scionsCurioEffected) irradiatedContactBoost = 2f; brimstoneFlames = false; - if (!demonicFlames) - demonicFlamesBonusDamage = 0; demonicFlames = false; holyFlames = false; plague = false; @@ -3377,6 +3377,14 @@ namespace CalamityMod.NPCs if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].head)) npc.ai[3] = 0f; } + + if (demonicFlames) + demonicFlamesClearTimer = 0; + else + demonicFlamesClearTimer++; + if (demonicFlamesClearTimer >= 2) + demonicFlamesBonusDamage = 0; + if (warbannerBurnTimer > 0) warbannerBurnTimer--; if (warbannerBurnTimer == 0 && warbannerBurnMarked) diff --git a/Systems/Collections/CalamityBuffSets.cs b/Systems/Collections/CalamityBuffSets.cs index 4a1b8a821d..243ca41c5b 100644 --- a/Systems/Collections/CalamityBuffSets.cs +++ b/Systems/Collections/CalamityBuffSets.cs @@ -57,13 +57,14 @@ namespace CalamityMod.Systems.Collections public static bool[] IsDebuff = Factory.CreateBoolSet(BuffID.Poisoned, BuffID.Darkness, BuffID.Cursed, BuffID.OnFire, BuffID.Bleeding, BuffID.Confused, BuffID.Slow, BuffID.Weak, BuffID.Silenced, BuffID.BrokenArmor, BuffID.CursedInferno, BuffID.Frostburn, BuffID.Chilled, BuffID.Frozen, BuffID.Burning, BuffID.Suffocation, BuffID.Ichor, BuffID.Venom, BuffID.Blackout, BuffID.Electrified, BuffID.Rabies, BuffID.Webbed, BuffID.Stoned, BuffID.Dazed, BuffID.VortexDebuff, BuffID.WitheredArmor, BuffID.WitheredWeapon, - BuffID.OgreSpit, BuffID.BetsysCurse, BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffID.OgreSpit, BuffID.BetsysCurse, BuffID.Wet, BuffID.Slimed, BuffID.OnFire3, BuffID.Frostburn2, BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType()); + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType()); /// /// If for a buff type, then that buff is a whip tag buff on the player.
From aed3d2cc725d6541575dedb97bf2741441d53e2e Mon Sep 17 00:00:00 2001 From: Xyk Date: Thu, 8 Jan 2026 02:40:37 -0800 Subject: [PATCH 04/22] Localization fixes --- .../en-US/Mods.CalamityMod.Items.Accessories.hjson | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 134015fb78..bda8a094a9 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -3,8 +3,8 @@ Abaddon: { Tooltip: ''' {$CommonItemTooltip.PercentIncreasedCritChance} - Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that scales off of your crit chance - When crit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies + Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that scales off of your critical strike chance + When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}% Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE] DPS ''' @@ -2063,9 +2063,9 @@ VoidofExtinction: { Tooltip: ''' {$CommonItemTooltip.PercentIncreasedCritChance} - Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that greatly scales off of your crit chance - When crit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies - Crits deal an additional 2% damage per debuff on the enemy + Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that greatly scales off of your critical strike chance + When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies + Critical strikes deal an additional 2% damage per debuff on the enemy Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}% Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE] DPS ''' From 2ed8a81b287104cb9f99de596b6fce5e6152b173 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Sun, 8 Feb 2026 19:27:47 -0600 Subject: [PATCH 05/22] evil speaker --- CalPlayer/CalamityPlayerMiscEffects.cs | 9 +++- ....CalamityMod.EvilSmasher.CrimsonAltar.json | 47 +++++++++++++++++++ ...ds.CalamityMod.EvilSmasher.DemonAltar.json | 47 +++++++++++++++++++ ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 12 ++--- .../Mods.CalamityMod.Projectiles.Melee.hjson | 1 + Projectiles/Melee/EvilSmasherProjectile.cs | 2 +- .../DisplayEffects/AltarText.cs | 43 +++++++++++++++++ 7 files changed, 149 insertions(+), 12 deletions(-) create mode 100644 Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json create mode 100644 Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json create mode 100644 UI/DialogueDisplay/DisplayEffects/AltarText.cs diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 787aed037f..ba49183932 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -68,6 +68,8 @@ using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.Tiles.FurnitureAuric; using CalamityMod.Tiles.Ores; using CalamityMod.UI; +using CalamityMod.UI.DialogueDisplay; +using CalamityMod.UI.DialogueDisplay.DisplayEffects; using CalamityMod.Utilities; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -1139,10 +1141,13 @@ namespace CalamityMod.CalPlayer var tilePos = Player.Center.ToTileCoordinates() + new Point(h, j); if (Main.tile[tilePos.X, tilePos.Y].TileType == TileID.DemonAltar) { - CombatText.NewText(new Rectangle(tilePos.X * 16, tilePos.Y * 16, 16, 16), WorldGen.crimson ? Color.Red : Color.Purple, CalamityUtils.GetTextValue("Items.Weapons.Melee.EvilSmasher.AltarDialogue" + DemonAltarDialogueCounter), true); + string type = WorldGen.crimson ? "Mods.CalamityMod.EvilSmasher.CrimsonAltar" : "Mods.CalamityMod.EvilSmasher.DemonAltar"; + if (DialogueDisplaySystem.ContainsDialogueKey(type)) + DialogueDisplaySystem.RemoveDialogue(DialogueDisplaySystem.GetSlot(type)); + DialogueDisplaySystem.StartDialogueOnClient(type, new Vector2(tilePos.X * 16 + 16, tilePos.Y * 16), DemonAltarDialogueCounter, 180, false, new AltarText()); DemonAltarDialogueCounter++; DemonAltarDialogueCooldown = 240; - if (DemonAltarDialogueCounter >= 6) + if (DemonAltarDialogueCounter >= 4) { DemonAltarDialogueCooldown = 1200; DemonAltarDialogueCounter = 0; diff --git a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json new file mode 100644 index 0000000000..1242c8d8f7 --- /dev/null +++ b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json @@ -0,0 +1,47 @@ +{ + "Revision": 1, + "DefaultColor": "FF0000", + "DefaultSpeaker": "DemonAltar", + "AlignType": 1, + "TextDelay": 2, + "BasePunctuationDelay": { + "Delay": 10, + "ForceSet": false, + "Locks": false + }, + "PunctuationDelayCap": 30, + "PunctuationDelays": { + "!": { + "Delay": 20, + "ForceSet": true, + "Locks": true + }, + "?": { + "Delay": 20, + "ForceSet": true, + "Locks": true + } + }, + "Pages": [ + { + "Lines": [ + "Bearer of the Holy Hammer...[Pause(0.25)] [Wavy:Desirest thou to taste true power?]" + ] + }, + { + "Lines": [ + "Your eyes shall be opened...[Pause(0.25)] [Shaking:Ye shall be even as the gods!]" + ] + }, + { + "Lines": [ + "Yield the hammer unto us upon the altar" + ] + }, + { + "Lines": [ + "Surrender, and thou shalt surely recieve our might" + ] + } + ] +} diff --git a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json new file mode 100644 index 0000000000..f49c9b9296 --- /dev/null +++ b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json @@ -0,0 +1,47 @@ +{ + "Revision": 1, + "DefaultColor": "FF00FF", + "DefaultSpeaker": "DemonAltar", + "AlignType": 1, + "TextDelay": 2, + "BasePunctuationDelay": { + "Delay": 10, + "ForceSet": false, + "Locks": false + }, + "PunctuationDelayCap": 30, + "PunctuationDelays": { + "!": { + "Delay": 20, + "ForceSet": true, + "Locks": true + }, + "?": { + "Delay": 20, + "ForceSet": true, + "Locks": true + } + }, + "Pages": [ + { + "Lines": [ + "Bearer of the Holy Hammer...[Pause(0.25)] [Wavy:Desirest thou to taste true power?]" + ] + }, + { + "Lines": [ + "Your eyes shall be opened...[Pause(0.25)] [Shaking:Ye shall be even as the gods!]" + ] + }, + { + "Lines": [ + "Yield the hammer unto us upon the altar" + ] + }, + { + "Lines": [ + "Surrender, and thou shalt surely recieve our might" + ] + } + ] +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 17062e9837..d822c987a8 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -460,17 +460,11 @@ EvilSmasher: { ''' Channels a powerful hammer strike with the capability to crush all evil Striking a tile with the hammer strike will cause an explosion and push you back - Striking enemies provides inflicts Smashed Evil on both the user and target - Smashed Evil strengthens players and weakens enemies - Charging strikes increases damage, explosion radius, and Smashed Evil duration + Striking enemies provides inflicts [cbuff:CalamityMod/SmashedEvil] on both the user and target + [cbuff:CalamityMod/SmashedEvil] strengthens players and weakens enemies + Charging strikes increases damage, explosion radius, and [cbuff:CalamityMod/SmashedEvil] duration 'EViL! sMaSH eVIl! SmAsh... ER!' ''' - AltarDialogue0: Bearer of the Holy Hammer... - AltarDialogue1: Desirest thou to taste true power? - AltarDialogue2: Your eyes shall be opened... - AltarDialogue3: Ye shall be even as the gods! - AltarDialogue4: Yield the hammer unto us upon the altar - AltarDialogue5: Surrender, and thou shalt surely recieve our might //All damage and kill dialogue has the capitalization randomized when said DamageDialogue0: smash! DamageDialogue1: evil! diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index bb4a5def16..7586da81d3 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -311,3 +311,4 @@ WulfrumScrew.DisplayName: Wulfrum Screw WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YinYoDark.DisplayName: Dark Shard YinYoLight.DisplayName: Light Shard +EvilSmasherProjectile.DisplayName: Evil Smasher diff --git a/Projectiles/Melee/EvilSmasherProjectile.cs b/Projectiles/Melee/EvilSmasherProjectile.cs index a097f60a53..8dd82aae7c 100644 --- a/Projectiles/Melee/EvilSmasherProjectile.cs +++ b/Projectiles/Melee/EvilSmasherProjectile.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 66; } - public override void Spawn(IEntitySource source) + public override void Spawn() { angle = new Vector2(angle.X.DirectionalSign(), 0); var player = Main.player[Projectile.owner]; diff --git a/UI/DialogueDisplay/DisplayEffects/AltarText.cs b/UI/DialogueDisplay/DisplayEffects/AltarText.cs new file mode 100644 index 0000000000..e04228bf16 --- /dev/null +++ b/UI/DialogueDisplay/DisplayEffects/AltarText.cs @@ -0,0 +1,43 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.UI.DialogueDisplay.DisplayEffects +{ + public class AltarText : DisplayEffect + { + public override bool FadeWhenTooFar => false; + + public override bool DespawnWithAttachedNPC => false; + + public override Vector2 TextOffsetFromStart(Vector2 startPos, Vector2 textSize) + { + Vector2 halfSize = textSize * 0.5f; + return startPos - halfSize + (Vector2.UnitY * (textSize.Y - 60)); + } + float OffsetDisappearTime(float time, float ratio) => MathHelper.Clamp((time - (ratio * TimeToDisappear / 2f)) / (TimeToDisappear / 2f), 0f, 1f); + + public override Vector2 DisappearPositioning(Vector2 startPos, float time, DialogueCharacterData charData) => Vector2.Lerp(startPos, startPos + (Vector2.unitXVector * 12 * charData.Scale), CalamityUtils.SineOutEasing(OffsetDisappearTime(time, charData.CompletionRatio), 1)); + + public override float DisappearOpacity(float startOpacity, float time, DialogueCharacterData charData) => 1 - CalamityUtils.SineOutEasing(OffsetDisappearTime(time, charData.CompletionRatio), 1); + + public override Vector2 DisappearScale(Vector2 startScale, float time, DialogueCharacterData charData) => Vector2.Lerp(startScale, startScale * 0.75f, CalamityUtils.ExpOutEasing(OffsetDisappearTime(time, charData.CompletionRatio), 1)); + + public override void PreDraw(SpriteBatch spriteBatch, Vector2 textStart, Vector2 textSize, int textTimer, int switchTimer) + { + if (textTimer < 0) + return; + + float Opacity = 1f; + if (textTimer < 30f) + Opacity = MathHelper.Lerp(0f, 1f, CalamityUtils.CircOutEasing(textTimer / 30f, 1)); + + if (switchTimer > 0) + Opacity *= 1 - CalamityUtils.CircOutEasing(switchTimer / 60f, 1); + + Texture2D tex = ModContent.Request("CalamityMod/Particles/SmallBloom").Value; + spriteBatch.Draw(tex, textStart + textSize * 0.5f - Main.screenPosition, null, Color.Black * 0.6f * Opacity, 0f, tex.Size() * 0.5f, new Vector2(textSize.X / 160f, textSize.Y / 120f), 0, 0); + } + } +} From a399a3721291c069e0c22cde1276c0ff299d65b9 Mon Sep 17 00:00:00 2001 From: mayli4 Date: Mon, 9 Feb 2026 16:20:12 -0500 Subject: [PATCH 06/22] feat: make evilsmasher use spritebatch scopes --- Items/Weapons/Melee/EvilSmasher.cs | 40 +++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/Items/Weapons/Melee/EvilSmasher.cs b/Items/Weapons/Melee/EvilSmasher.cs index 9f45b2147e..63b8caf504 100644 --- a/Items/Weapons/Melee/EvilSmasher.cs +++ b/Items/Weapons/Melee/EvilSmasher.cs @@ -1,6 +1,7 @@ using System; using CalamityMod.Projectiles.BaseProjectiles; using CalamityMod.Projectiles.Melee; +using CalamityMod.Utilities.Daybreak; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -100,8 +101,18 @@ namespace CalamityMod.Items.Weapons.Melee if (IsAnimating) { var color = Color.Lerp(Color.Purple, Color.Red, MathF.Sin(Main.GlobalTimeWrappedHourly * 6) * 0.5f + 0.5f); - Main.spriteBatch.SafeBegin(SpriteSortMode.Immediate, BatchSetting.Additive, null, Main.GameViewMatrix.TransformationMatrix, () => + + using (Main.spriteBatch.Scope()) { + Main.spriteBatch.Begin(SpriteSortMode.Immediate, + BlendState.Additive, + SamplerState.PointClamp, + DepthStencilState.None, + Main.Rasterizer, + null, + Main.GameViewMatrix.TransformationMatrix + ); + Main.spriteBatch.Draw(GetGlowTex(), Item.Center - Main.screenPosition, null, color, 0, GetGlowTex().Size() * 0.5f, 0.1f + 0.7f * (AnimationTime / 240f), SpriteEffects.None, 0); int rep = 0; for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.166f) @@ -109,16 +120,31 @@ namespace CalamityMod.Items.Weapons.Melee Main.spriteBatch.Draw(GetGlowBeamTex(), Item.Center - Main.screenPosition, null, color, MathHelper.WrapAngle(Main.GlobalTimeWrappedHourly) + i, new(GetGlowBeamTex().Size().X * 0.5f, 0), 0f + 0.06f * (AnimationTime / 240f) * (rep == 0 ? 1 : 0.75f), SpriteEffects.None, 0); rep = (rep + 1) % 2; } - }); + + Main.spriteBatch.End(); + } + var tex = TextureAssets.Item[ItemID.Pwnhammer].Value; - Main.spriteBatch.Draw(tex, Item.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.Black,AnimationTime / 240f), 0, tex.Size() * 0.5f,MathHelper.Lerp(1,1.75f, AnimationTime / 240f), SpriteEffects.None, 0); + Main.spriteBatch.Draw(tex, Item.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.Black, AnimationTime / 240f), 0, tex.Size() * 0.5f, MathHelper.Lerp(1, 1.75f, AnimationTime / 240f), SpriteEffects.None, 0); return false; - } else if (AnimationTime < 300) + + } + else if (AnimationTime < 300) { float completion = 1 - (AnimationTime - 240) / 60f; var color = Color.Lerp(Color.Purple, Color.Red, MathF.Sin(Main.GlobalTimeWrappedHourly * 6) * 0.5f + 0.5f); - Main.spriteBatch.SafeBegin(SpriteSortMode.Immediate, BatchSetting.Additive, null, Main.GameViewMatrix.TransformationMatrix, () => + + using (Main.spriteBatch.Scope()) { + Main.spriteBatch.Begin(SpriteSortMode.Immediate, + BlendState.Additive, + SamplerState.PointClamp, + DepthStencilState.None, + Main.Rasterizer, + null, + Main.GameViewMatrix.TransformationMatrix + ); + Main.spriteBatch.Draw(GetGlowTex(), Item.Center - Main.screenPosition, null, color, 0, GetGlowTex().Size() * 0.5f, 0.1f + 0.7f * completion, SpriteEffects.None, 0); int rep = 0; for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.166f) @@ -126,7 +152,9 @@ namespace CalamityMod.Items.Weapons.Melee Main.spriteBatch.Draw(GetGlowBeamTex(), Item.Center - Main.screenPosition, null, color, MathHelper.WrapAngle(Main.GlobalTimeWrappedHourly) + i, new(GetGlowBeamTex().Size().X * 0.5f, 0), 0f + 0.06f * completion * (rep == 0 ? 1 : 0.75f), SpriteEffects.None, 0); rep = (rep + 1) % 2; } - }); + + Main.spriteBatch.End(); + } } return base.PreDrawInWorld(spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI); } From fefcf58aac1891e39ce7c87f35bdb3bdce4e01dc Mon Sep 17 00:00:00 2001 From: Xyk Date: Wed, 11 Feb 2026 22:07:18 -0800 Subject: [PATCH 07/22] Better Spread Next up, replacing brimstone flames with it's own debuff for the accs --- Buffs/DamageOverTime/BrimstoneFlames.cs | 3 +- CalPlayer/CalamityPlayerHitHurt.cs | 137 +-------- Dusts/SquashDust.cs | 12 +- ...ods.CalamityMod.Projectiles.Typeless.hjson | 1 + NPCs/CalamityGlobalNPC.cs | 5 +- Projectiles/Typeless/DebuffSpreadEffect.cs | 259 ++++++++++++++++++ 6 files changed, 281 insertions(+), 136 deletions(-) create mode 100644 Projectiles/Typeless/DebuffSpreadEffect.cs diff --git a/Buffs/DamageOverTime/BrimstoneFlames.cs b/Buffs/DamageOverTime/BrimstoneFlames.cs index 8fcf454bbf..3db751ccae 100644 --- a/Buffs/DamageOverTime/BrimstoneFlames.cs +++ b/Buffs/DamageOverTime/BrimstoneFlames.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Buffs.DamageOverTime bool effected = (cnpc.abaddonEffected || cnpc.voidOfExtinctionEffected); bool strong = cnpc.voidOfExtinctionEffected; int baseBrimstoneFlamesDoTValue = (int)debuffData.EnemyLostRegen; - if (effected) + if (effected && cnpc.checkPlayerBflameDamage) { for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) { @@ -44,6 +44,7 @@ namespace CalamityMod.Buffs.DamageOverTime } } } + cnpc.checkPlayerBflameDamage = false; } cnpc.ApplyDPSDebuff(baseBrimstoneFlamesDoTValue, baseBrimstoneFlamesDoTValue / 20, ref npc.lifeRegen, ref damage); } diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index d597da152c..242213e8b2 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -51,6 +51,7 @@ using CalamityMod.UI; using CalamityMod.Utilities; using CalamityMod.World; using Microsoft.Xna.Framework; +using Mono.Cecil; using Terraria; using Terraria.Audio; using Terraria.Chat; @@ -685,139 +686,11 @@ namespace CalamityMod.CalPlayer public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { NPC npc = target; - if ((npc.Calamity().abaddonEffected || npc.Calamity().voidOfExtinctionEffected) && hit.Crit && abaddonCooldown == 0) + int debuffSpreadProj = ModContent.ProjectileType(); + if ((Player.Calamity().abaddon || Player.Calamity().voidOfExtinction) && (npc.Calamity().abaddonEffected || npc.Calamity().voidOfExtinctionEffected) && hit.Crit && abaddonCooldown == 0 && Player.ownedProjectileCounts[debuffSpreadProj] == 0) { - bool strong = npc.Calamity().voidOfExtinctionEffected; - float areaOfEffect = (strong ? 1200 : 600); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Color color1 = Color.Crimson; - Color color2 = Color.OrangeRed; - int debuffTime = (strong ? 180 : 90); - int targetNum = 0; - int maxTargetNum = strong ? 8 : 5; - int startDir = Main.rand.NextBool() ? 1 : -1; - for (int r = 0; r < Main.maxNPCs; r++) - { - NPC targeted = Main.npc[r]; - - if (targeted != null && targeted != npc && targeted.CanBeChasedBy() && Vector2.Distance(targeted.Center, npc.Center) <= areaOfEffect && targetNum < maxTargetNum) - { - targeted.Calamity().voidOfExtinctionEffected = npc.Calamity().voidOfExtinctionEffected; - targeted.Calamity().abaddonEffected = npc.Calamity().abaddonEffected; - - Vector2 start = npc.Center + Main.rand.NextVector2Circular(npc.width / 2, npc.height / 2); - Vector2 end = targeted.Center; - Color color = Main.rand.NextBool() ? color2 : color1; - - if (Player.Calamity().abaddonEffectVisual) - { - Vector2 lerpVel = Vector2.Lerp(start, end, 0.5f); - float scale = 0.015f; - Particle spark = new CustomSpark(lerpVel, npc.SafeDirectionTo(targeted.Center), "CalamityMod/Particles/BloomLineThick", false, 18, scale, color, new Vector2(1.2f, (Utils.Distance(start, end) * 0.034f)), true, true, shrinkSpeed: 0.25f, glowOpacity: 0.75f); - GeneralParticleHandler.SpawnParticle(spark); - - for (int g = 0; g < 7; g++) - { - int DustID = ModContent.DustType(); - Dust dust2 = Dust.NewDustDirect(targeted.Center, targeted.width, targeted.height, DustID); - dust2.scale = Main.rand.NextFloat(0.6f, 0.75f); - dust2.velocity = new Vector2(4, 4).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 0.8f); - dust2.noGravity = true; - dust2.color = Main.rand.NextBool() ? color2 : color1; - } - - float distance = Vector2.Distance(targeted.Center, npc.Center); - int maxDusts = (int)distance; - int dustCaper = 60; - int dustDivisor = maxDusts / dustCaper; - if (dustDivisor < 2) - dustDivisor = 2; - - Vector2 dustLineStart = start; - Vector2 dustLineEnd = end; - Vector2 currentDustPos = default; - Vector2 dustVel = start.DirectionTo(end); - int startingPoint = Main.rand.Next(0, 400 + 1); - Vector2 lastDustPos = default; - for (int i = 0; i < maxDusts; i++) - { - float sine = (float)Math.Sin((i + startingPoint) * 0.425f / MathHelper.Pi) * startDir; - float endStartFade = Math.Min(Utils.GetLerpValue(maxDusts * 0.8f, 0, i), Utils.GetLerpValue(0 + maxDusts * 0.2f, maxDusts, i)); - currentDustPos = Vector2.Lerp(dustLineStart, dustLineEnd, i / (float)maxDusts) + dustVel.RotatedBy(MathHelper.PiOver2) * 6 * sine * endStartFade; - if (i == 0) - lastDustPos = currentDustPos; - - currentDustPos = Vector2.Lerp(dustLineStart, dustLineEnd, i / (float)maxDusts) + dustVel.RotatedBy(MathHelper.PiOver2) * 55 * sine * endStartFade; - Dust dustLinger = Dust.NewDustPerfect(currentDustPos, ModContent.DustType()); - dustLinger.position = currentDustPos; - dustLinger.velocity = currentDustPos.DirectionTo(lastDustPos) * (Main.rand.NextBool(5) ? 4f : Main.rand.NextFloat(0.2f, 0.8f)); - dustLinger.noGravity = true; - dustLinger.scale = Main.rand.NextFloat(0.8f, 1f) * 1.5f; - dustLinger.fadeIn = Main.rand.NextFloat(0.6f, 1f) * 4; - dustLinger.color = Color.Lerp(color1, color2, Utils.GetLerpValue(0, maxDusts, i)); - - lastDustPos = currentDustPos; - } - } - for (int u = 0; u < 2; u++) - { - Vector2 pos = start; - if (u == 0) pos = end; - Particle spark2 = new CustomSpark(pos, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, u != 0 ? 0.7f : 0.55f, color * (Player.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f); - GeneralParticleHandler.SpawnParticle(spark2); - if (targetNum > 0) // Only spawn the bloom on start position for the first arc - u++; - } - - npc.AddBuff(ModContent.BuffType(), debuffTime); - - float bestDamage = 0; - // Find all the debuffs on the enemy - for (int index = 0; index < npc.buffType.Length; index++) - { - int type = npc.buffType[index]; - var debuffData = BuffDatasets.DebuffDataset[type]; - - // Calculate the brimstone flames damage to see if the debuffs can be transfered - int bFlamesDamage = Math.Max((int)(BrimstoneFlames.debuffData.EnemyLostRegen * bestDamage), (int)BrimstoneFlames.debuffData.EnemyLostRegen); - - if (CalamityBuffSets.IsDebuff[type]) - { - // Find the player who has the accessory - for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) - { - Player player = Main.player[playerIndex]; - if (player.active) - { - if (player.Calamity().abaddonFlameDamage > bestDamage) - bestDamage = player.Calamity().abaddonFlameDamage; - } - } - - if (debuffData == null || debuffData.EnemyLostRegen <= bFlamesDamage) - targeted.AddBuff(type, debuffTime); - } - // Edge case fixes for Shred and Demonic Flames - if (npc.Calamity().somaShredStacks > 0 && Shred.BaseDamage <= bFlamesDamage) - targeted.AddBuff(ModContent.BuffType(), debuffTime); - int demonicFlames = ModContent.GetModBuff(ModContent.BuffType()).Type; - if (npc.HasBuff(demonicFlames)) - targeted.Calamity().demonicFlamesBonusDamage = npc.Calamity().demonicFlamesBonusDamage; - } - targetNum++; - } - } - if (targetNum == 0) - { - npc.AddBuff(ModContent.BuffType(), debuffTime); - Color color = Main.rand.NextBool() ? color2 : color1; - Particle spark2 = new CustomSpark(npc.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, 0.55f, color * (Player.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f); - GeneralParticleHandler.SpawnParticle(spark2); - - } - abaddonCooldown = targetNum * 12; - } + int maxTargetNum = npc.Calamity().voidOfExtinctionEffected ? 10 : 6; + Projectile.NewProjectile(Player.GetSource_FromThis(), npc.Center, Vector2.Zero, debuffSpreadProj, 0, 0, Player.whoAmI, 0, npc.whoAmI, maxTargetNum); } } diff --git a/Dusts/SquashDust.cs b/Dusts/SquashDust.cs index 8adfb2beaa..a0d5160f88 100644 --- a/Dusts/SquashDust.cs +++ b/Dusts/SquashDust.cs @@ -56,7 +56,11 @@ namespace CalamityMod.Dusts public override bool PreDraw(Dust dust) { - Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f)); + Vector2 baseSize = Vector2.One; + if (dust.customData != null) + baseSize = (Vector2)dust.customData; + + Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.Y, 2.5f * baseSize.Y)); // Glow Orb Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); @@ -82,7 +86,11 @@ namespace CalamityMod.Dusts private static void DrawPixelated(Dust dust) { - Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f)); + Vector2 baseSize = Vector2.One; + if (dust.customData != null) + baseSize = (Vector2)dust.customData; + + Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.Y, 2.5f * baseSize.Y)); // Glow Orb Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 236a11de6b..fd7feb6519 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -171,3 +171,4 @@ YellowLabSeeker.DisplayName: Seeking Mechanism XykDeathAnim.DisplayName: Xyk Death Animation XykWings.DisplayName: Xyk Wings StratusBlackHole.DisplayName: Stratus Singularity +DebuffSpreadEffect.DisplayName: Debuff Spread Effect diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 5765aa31dc..f8dfdaa878 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -303,6 +303,7 @@ namespace CalamityMod.NPCs public bool scionsCurioEffected = false; public bool abaddonEffected = false; public bool voidOfExtinctionEffected = false; + public bool checkPlayerBflameDamage = false; public int warbannerBurnTime = 0; // Determines the rate that the enemy is damaged public int warbannerBurnTimer = 0; // The duration of the debuff public int warbannerBurnStacks = 0; // The stacks increase how fast the debuff hits @@ -582,6 +583,7 @@ namespace CalamityMod.NPCs myClone.scionsCurioEffected = scionsCurioEffected; myClone.abaddonEffected = abaddonEffected; myClone.voidOfExtinctionEffected = voidOfExtinctionEffected; + myClone.checkPlayerBflameDamage = checkPlayerBflameDamage; myClone.warbannerBurnTime = warbannerBurnTime; myClone.warbannerBurnTimer = warbannerBurnTimer; myClone.warbannerBurnStacks = warbannerBurnStacks; @@ -3136,7 +3138,8 @@ namespace CalamityMod.NPCs if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].head)) npc.ai[3] = 0f; } - + if (!brimstoneFlames && !checkPlayerBflameDamage) + checkPlayerBflameDamage = true; if (demonicFlames) demonicFlamesClearTimer = 0; else diff --git a/Projectiles/Typeless/DebuffSpreadEffect.cs b/Projectiles/Typeless/DebuffSpreadEffect.cs new file mode 100644 index 0000000000..2d347ca7f0 --- /dev/null +++ b/Projectiles/Typeless/DebuffSpreadEffect.cs @@ -0,0 +1,259 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.CalPlayer; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using CalamityMod.Systems.Collections; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using MonoMod.Core.Platforms; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class DebuffSpreadEffect : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + public List listNPCs = new List(); + public NPC lastNPC; + public int minCooldown = 48; + public Color mainColor = Color.White; + public Color subColor = Color.White; + public Color extraColor = Color.White; + public ref float spreadCount => ref Projectile.ai[2]; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 1; + Projectile.ignoreWater = true; + Projectile.timeLeft = 9000; + Projectile.tileCollide = false; + Projectile.friendly = true; + Projectile.penetrate = -1; + } + + public override void AI() + { + NPC npc = (lastNPC == null ? Main.npc[(int)Projectile.ai[1]] : lastNPC); + + if (npc != null && spreadCount != 0) + { + if (Owner.Calamity().abaddonCooldown % 9 == 0) + { + listNPCs.Add(npc.whoAmI); + Projectile.Center = npc.Center; + + bool strong = npc.Calamity().voidOfExtinctionEffected; + float areaOfEffect = (strong ? 1400 : 800); + Color color1 = Color.Crimson; + Color color2 = Color.OrangeRed; + Color color3 = Color.Red; + int debuffTime = (strong ? 120 : 90); + int startDir = Main.rand.NextBool() ? 1 : -1; + + float distanceFromCenter = areaOfEffect; + NPC targeted = null; + // Get closest valid target + for (int index = 0; index < Main.npc.Length; index++) + { + NPC closestTarget = Main.npc[index]; + if (closestTarget.CanBeChasedBy(null, false) && closestTarget != npc && !listNPCs.Contains(closestTarget.whoAmI) && closestTarget.life > 0) + { + float extraDistance = (closestTarget.width / 2) + (closestTarget.height / 2); + if (Vector2.Distance(Projectile.Center, closestTarget.Center) < distanceFromCenter) + { + distanceFromCenter = Vector2.Distance(Projectile.Center, closestTarget.Center); + targeted = closestTarget; + } + } + } + + if (targeted != null) + { + targeted.Calamity().voidOfExtinctionEffected = npc.Calamity().voidOfExtinctionEffected; + targeted.Calamity().abaddonEffected = npc.Calamity().abaddonEffected; + + //npc.AddBuff(ModContent.BuffType(), debuffTime); + + float bestDamage = Owner.Calamity().abaddonFlameDamage; + int heat = 0; + Color heatClr = Color.OrangeRed; + int sick = 0; + Color sickClr = Color.Lime; + int cold = 0; + Color coldClr = Color.RoyalBlue; + int shock = 0; + Color shockClr = Color.Gold; + int water = 0; + Color waterClr = Color.DarkTurquoise; + // Find all the debuffs on the enemy + int debuffNum = 0; + for (int index = 0; index < npc.buffType.Length; index++) + { + int type = npc.buffType[index]; + var debuffData = BuffDatasets.DebuffDataset[type]; + + // Calculate the brimstone flames damage to see if the debuffs can be transfered + int bFlamesDamage = Math.Max((int)(BrimstoneFlames.debuffData.EnemyLostRegen * bestDamage), (int)BrimstoneFlames.debuffData.EnemyLostRegen); + + if (CalamityBuffSets.IsDebuff[type]) + { + if (debuffData == null || debuffData.EnemyLostRegen <= bFlamesDamage) + { + debuffNum++; + targeted.AddBuff(type, debuffTime); + } + if (debuffData != null && debuffData != BrimstoneFlames.debuffData) + { + if (debuffData.HeatDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, heatClr, 0.65f); heat++; } + if (debuffData.SicknessDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, sickClr, 0.65f); sick++; } + if (debuffData.ColdDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, coldClr, 0.65f); cold++; } + if (debuffData.ElectricDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, shockClr, 0.65f); shock++; } + if (debuffData.WaterDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, waterClr, 0.65f); water++; } + } + } + // Edge case fixes for Shred and Demonic Flames + // Not ideal but not sure how else to do it + if (npc.Calamity().somaShredStacks > 0 && Shred.BaseDamage <= bFlamesDamage) + targeted.AddBuff(ModContent.BuffType(), debuffTime); + int demonicFlames = ModContent.GetModBuff(ModContent.BuffType()).Type; + if (npc.HasBuff(demonicFlames)) + targeted.Calamity().demonicFlamesBonusDamage = npc.Calamity().demonicFlamesBonusDamage; + } + if (debuffNum == 0) + { + KillSelf(); + return; + } + + List best = new List { heat, sick, cold, shock, water }; + int highest = best.Max(); + if (highest != 0) + { + // Ideally these lines would run in a random order, so that fire isn't prioritsed as an extra color, but I don't know how to do that! + if (heat == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = heatClr; } else { subColor = heatClr; } } + if (sick == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = sickClr; } else { subColor = sickClr; } } + if (cold == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = coldClr; } else { subColor = coldClr; } } + if (shock == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = shockClr; } else { subColor = shockClr; } } + if (water == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = waterClr; } else { subColor = waterClr; } } + } + + VisualEffects(npc, targeted, startDir, 1 + (best.Sum() * 0.12f)); + + Projectile.ForceNetUpdate(); + targeted.ForceNetUpdate(); + lastNPC = targeted; + } + else + { + KillSelf(); + return; + } + + //npc.AddBuff(ModContent.BuffType(), debuffTime); + Color colorAgain = Main.rand.NextBool() ? color2 : color1; + Particle spark2 = new CustomSpark(npc.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, 0.55f, colorAgain * (Owner.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f); + GeneralParticleHandler.SpawnParticle(spark2); + + if (Owner.Calamity().abaddonCooldown == 0) + Owner.Calamity().abaddonCooldown = minCooldown * 2; + spreadCount--; + } + } + else + { + KillSelf(); + return; + } + } + public void KillSelf() + { + if (Owner.Calamity().abaddonCooldown > minCooldown) + Owner.Calamity().abaddonCooldown = minCooldown; + Projectile.Kill(); + } + public void VisualEffects(NPC npc, NPC targeted, int startDirection, float effectPower) + { + Vector2 start = npc.Center + Main.rand.NextVector2Circular(npc.width / 2, npc.height / 2); + Vector2 end = targeted.Center; + if (Owner.Calamity().abaddonEffectVisual) + { + // Spawn a single particle line between the first target and the new target + Vector2 lerpVel = Vector2.Lerp(start, end, 0.5f); + float scale = 0.015f; + Particle spark = new CustomSpark(lerpVel, npc.SafeDirectionTo(targeted.Center), "CalamityMod/Particles/BloomLineSoftEdge", false, 18, scale, mainColor, new Vector2(1.2f * effectPower, (Utils.Distance(start, end) * 0.038f)), true, true, shrinkSpeed: 0.25f, glowOpacity: 0.75f); + GeneralParticleHandler.SpawnParticle(spark); + + for (int g = 0; g < 7; g++) + { + int DustID = ModContent.DustType(); + Dust dust2 = Dust.NewDustDirect(targeted.Center, targeted.width, targeted.height, DustID); + dust2.scale = Main.rand.NextFloat(0.6f, 0.75f); + dust2.velocity = new Vector2(4, 4).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 0.8f); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? subColor : (extraColor != Color.White ? extraColor : mainColor); + } + + float distance = Vector2.Distance(targeted.Center, npc.Center); + + // This might look like a lot of dust for a thing that can happen to at few enemies in succession, but it + // does get reduced significantly based on distance and lasts only a few frames. + int averageDusts = (int)(65 * (float)Math.Pow(effectPower, 0.3f)); + int maxDusts = (int)((float)Math.Pow(Math.Max(distance, 1) / 1000, 0.65f) * averageDusts); + + Vector2 dustLineStart = start; + Vector2 dustLineEnd = end; + Vector2 currentDustPos = default; + Vector2 dustVel = start.DirectionTo(end); + int startingPoint = Main.rand.Next(0, 400 + 1); + Vector2 lastDustPos = default; + for (int i = 0; i < maxDusts; i++) + { + float sineSpeed = Utils.Remap(startingPoint, 0, 400, 1.6f, 0.7f); + float sine = (float)Math.Sin((i + startingPoint) * sineSpeed / MathHelper.Pi) * startDirection; + float endStartFade = Math.Min(Utils.GetLerpValue(maxDusts * 0.9f, maxDusts * 0.1f, i, true), Utils.GetLerpValue(maxDusts * 0.1f, maxDusts * 0.9f, i, true)); + currentDustPos = Vector2.Lerp(dustLineStart, dustLineEnd, i / (float)maxDusts) + dustVel.RotatedBy(MathHelper.PiOver2) * 6 * sine * endStartFade; + if (i == 0) + lastDustPos = currentDustPos; + + bool wildDust = Main.rand.NextBool(5); + currentDustPos = Vector2.Lerp(dustLineStart, dustLineEnd, i / (float)maxDusts) + dustVel.RotatedBy(MathHelper.PiOver2) * 55 * sine * endStartFade * effectPower; + Dust dustLinger = Dust.NewDustPerfect(currentDustPos, ModContent.DustType()); + dustLinger.position = currentDustPos; + dustLinger.velocity = currentDustPos.DirectionTo(lastDustPos) * (wildDust ? 6.5f : Main.rand.NextFloat(0.2f, 0.8f)); + dustLinger.noGravity = true; + dustLinger.scale = Main.rand.NextFloat(0.8f, 1f) * (wildDust ? 1.7f : 1.5f) * effectPower; + dustLinger.fadeIn = Main.rand.NextFloat(0.6f, 1f) * 4 * effectPower * (wildDust ? 0.35f : 1); + dustLinger.color = Color.Lerp((extraColor != Color.White ? extraColor : mainColor), subColor, Utils.GetLerpValue(0, maxDusts, i)); + if (wildDust) + dustLinger.color = !Main.rand.NextBool(4) ? subColor : (extraColor != Color.White ? extraColor : mainColor); + if (!wildDust) + { + dustLinger.noLightEmittence = true; + dustLinger.customData = new Vector2(0.8f, 3); + } + else + dustLinger.customData = new Vector2(0.6f, 1.5f); + + lastDustPos = currentDustPos; + } + } + for (int u = 0; u < 2; u++) + { + Vector2 pos = start; + if (u == 0) pos = end; + Particle spark3 = new CustomSpark(pos, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, u != 0 ? 0.7f : 0.55f, mainColor * (Owner.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f); + GeneralParticleHandler.SpawnParticle(spark3); + } + } + public override bool? CanDamage() => false; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => false; + } +} From e00b40cd993730c075d009dd013b18212c894a54 Mon Sep 17 00:00:00 2001 From: Xyk Date: Sat, 14 Feb 2026 16:52:45 -0800 Subject: [PATCH 08/22] Bane --- Buffs/DamageOverTime/Bane.cs | 105 ++++++++++++++++ Buffs/DamageOverTime/Bane.png | Bin 0 -> 3177 bytes Buffs/DamageOverTime/BrimstoneFlames.cs | 29 +---- CalPlayer/CalamityPlayer.cs | 7 +- CalPlayer/CalamityPlayerDrawEffects.cs | 3 +- CalPlayer/CalamityPlayerLifeRegen.cs | 2 +- Items/Accessories/Abaddon.cs | 6 +- Items/Accessories/VoidofExtinction.cs | 10 +- .../en-US/Mods.CalamityMod.Buffs.hjson | 5 + .../Mods.CalamityMod.Items.Accessories.hjson | 18 ++- NPCs/CalamityGlobalNPC.cs | 15 ++- Particles/BaneParticle.cs | 114 ++++++++++++++++++ Particles/BaneParticle.png | Bin 0 -> 2930 bytes Particles/BaneParticleGlow.png | Bin 0 -> 3067 bytes Particles/BloomRingAngled.png | Bin 0 -> 11339 bytes Projectiles/Typeless/DebuffSpreadEffect.cs | 42 +++---- Systems/Collections/CalamityBuffSets.cs | 4 +- 17 files changed, 276 insertions(+), 84 deletions(-) create mode 100644 Buffs/DamageOverTime/Bane.cs create mode 100644 Buffs/DamageOverTime/Bane.png create mode 100644 Particles/BaneParticle.cs create mode 100644 Particles/BaneParticle.png create mode 100644 Particles/BaneParticleGlow.png create mode 100644 Particles/BloomRingAngled.png diff --git a/Buffs/DamageOverTime/Bane.cs b/Buffs/DamageOverTime/Bane.cs new file mode 100644 index 0000000000..a7a89a8dd4 --- /dev/null +++ b/Buffs/DamageOverTime/Bane.cs @@ -0,0 +1,105 @@ +using System; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Utilities.Terraria.Utilities; + +namespace CalamityMod.Buffs.DamageOverTime +{ + public class Bane : ModBuff + { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 90, + NPCLifeRegenMethod = BaneNPCLifeRegen + }; + public override void SetStaticDefaults() + { + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; + } + public static void BaneNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + bool effected = (cnpc.abaddonEffected || cnpc.voidOfExtinctionEffected); + bool strong = cnpc.voidOfExtinctionEffected; + int baseDoTValue = (int)debuffData.EnemyLostRegen; + if (effected && cnpc.checkPlayerBaneDamage) + { + for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + { + Player player = Main.player[playerIndex]; + if (player.active) + { + float improvedDamage = baseDoTValue * player.Calamity().abaddonDebuffDamage; + if (improvedDamage > baseDoTValue && (player.Calamity().abaddon || player.Calamity().voidOfExtinction)) + { + baseDoTValue = (int)improvedDamage; + } + } + } + cnpc.checkPlayerBaneDamage = false; + } + cnpc.ApplyDPSDebuff(baseDoTValue, baseDoTValue / 20, ref npc.lifeRegen, ref damage); + } + + public override void Update(Player player, ref int buffIndex) + { + player.Calamity().bane = true; + } + + public override void Update(NPC npc, ref int buffIndex) + { + npc.Calamity().bane = true; + } + + internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false) + { + // This shouldn't be on players, like ever + Player Player = drawInfo.drawPlayer; + Vector3 light = Color.Lavender.ToVector3(); + Lighting.AddLight(Player.Center, light * 2); + + if (Main.rand.NextBool(6)) + { + Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot, ModContent.DustType(), new Vector2(0, Main.rand.NextFloat(-3f, -5f)) + Player.velocity, 0, default, hasDebuffResistance ? 1.1f : 1.6f); + dust.noGravity = true; + dust.color = Color.PaleTurquoise; + } + } + + internal static void DrawEffects(NPC npc, ref Color drawColor) + { + Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomRingAngled").Value; + Texture2D center = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Vector2 drawPosition = npc.Center - Main.screenPosition; + Color color = Color.PaleTurquoise; + Color color2 = Color.Khaki; + float maxSizeMult = 10f; + float widthMult = MathF.Pow(Utils.Remap(npc.width, 10, 500, 1f, maxSizeMult), 0.8f); + float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 9.0f) / MathHelper.Pi); + float sine2 = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 11.0f) / MathHelper.Pi); + float randSize = Main.rand.NextFloat(0.82f, 1.08f); + + Main.EntitySpriteDraw(bloom, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine) * 2.3f), null, color with { A = 0 }, 0, bloom.Size() / 2, new Vector2((sine * 0.09f + 1.2f) * widthMult, 0.9f) * 0.18f * MathF.Pow(randSize, 0.3f), SpriteEffects.None); + Main.EntitySpriteDraw(center, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine2) * 3.3f), null, Color.Lerp(color, color2, 0.7f) with { A = 0 }, 0, center.Size() / 2, new Vector2((sine2 * 0.09f + 1.2f) * widthMult, 0.6f) * 0.18f * randSize, SpriteEffects.None); + + if (Main.rand.NextBool(9)) + { + bool start = Main.rand.NextBool(); + Particle baneRunes = new BaneParticle(npc.Center + Main.rand.NextVector2Circular(18 * widthMult, 8) + (Vector2.UnitY * npc.height / 3f) + Vector2.UnitY * ((1 - sine) * 2.3f), Vector2.UnitY * Main.rand.NextFloat(-2.5f, -4.5f) * widthMult, false, 30, 1f, start ? color : color2, start ? color2 : color, Vector2.One, true, Main.rand.NextBool(3) ? Main.rand.NextFloat(-0.2f, 0.2f) : 0, 0.85f, MathHelper.PiOver2 * Main.rand.Next(4 + 1)); + GeneralParticleHandler.SpawnParticle(baneRunes); + } + Lighting.AddLight(npc.Center, color.ToVector3() * 0.6f); + } + } +} diff --git a/Buffs/DamageOverTime/Bane.png b/Buffs/DamageOverTime/Bane.png new file mode 100644 index 0000000000000000000000000000000000000000..bec1b0443a8d2ce34093a0d82357b3db4962d76f GIT binary patch literal 3177 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%0Dy!50Qvv` z0D$NK0Cg|`0P0`>06Lfe02gqax=}m;000SaNLh0L01m?d01m?e$8V@)0000RbVXQn zQ*UN;cVTj607GSLb9r+hQ*?D?X>TA@Z*OeDr{R1600DJLL_t(oh1HiaNW(xBhQBNh zLUGC@h=@2irh}k3szt#`=-|*fP<2!XCkJ&@3!OVS6gmk?)ln22n$bZ-L~zO^1qYXN zC=bb*OCm~h{!@;;y#LF4?=HkqN&(^nelrnfzsja2|1?k^KTBypO=cw%xMfU19IDS)&fe1D7uk~>Qj-m0GT9)A~DwU8fPFk0BJ#*bRb baseBrimstoneFlamesDoTValue && (player.Calamity().abaddon || player.Calamity().voidOfExtinction)) - { - baseBrimstoneFlamesDoTValue = (int)improvedDamage; - } - } - } - cnpc.checkPlayerBflameDamage = false; - } - cnpc.ApplyDPSDebuff(baseBrimstoneFlamesDoTValue, baseBrimstoneFlamesDoTValue / 20, ref npc.lifeRegen, ref damage); - } public override void Update(Player player, ref int buffIndex) { diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index e7bce89bbb..2839fd2172 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -960,7 +960,7 @@ namespace CalamityMod.CalPlayer public bool abaddon = false; public int abaddonCooldown = 0; public bool abaddonEffectVisual = false; - public float abaddonFlameDamage = 0; + public float abaddonDebuffDamage = 0; public bool aeroStone = false; public bool lifejelly = false; @@ -1362,6 +1362,7 @@ namespace CalamityMod.CalPlayer public bool armorCrunch = false; public bool crumble = false; public bool irradiated = false; + public bool bane = false; public bool brimstoneFlames = false; public bool weakBrimstoneFlames = false; public bool demonicFlames = false; @@ -4987,10 +4988,10 @@ namespace CalamityMod.CalPlayer if (Player.Calamity().abaddon || Player.Calamity().voidOfExtinction) { - Player.Calamity().abaddonFlameDamage = (1 + Player.GetTotalCritChance(Player.GetBestClass()) * 0.01f * (Player.Calamity().voidOfExtinction ? VoidofExtinction.critScaling : Abaddon.critScaling)); + Player.Calamity().abaddonDebuffDamage = (1 + Player.GetTotalCritChance(Player.GetBestClass()) * 0.01f * (Player.Calamity().voidOfExtinction ? VoidofExtinction.critScaling : Abaddon.critScaling)); } else - Player.Calamity().abaddonFlameDamage = 0; + Player.Calamity().abaddonDebuffDamage = 0; // True melee damage from various vanilla equipment placed here. diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index c8ce645b8c..c00ca129b2 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -497,8 +497,7 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.brimstoneFlames && drawInfo.shadow == 0f) { - bool resistsBrimstoneFlames = (abaddon || voidOfExtinction); // Looks weaker if you have Abaddon or VoE equipped - BrimstoneFlames.DrawEffects(drawInfo, resistsBrimstoneFlames); + BrimstoneFlames.DrawEffects(drawInfo); } if (calamityPlayer.brainRot && drawInfo.shadow == 0f) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 2ac1e559ee..07d1553f5a 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -115,7 +115,7 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(crushDepth, 18, purity); ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity); ApplyDoTDebuff(shadowflame, 30, purity); - ApplyDoTDebuff(brimstoneFlames, (int)MathF.Round(30 * ((abaddon || voidOfExtinction) ? (1f - Abaddon.BrimstoneFlamesReduction) : 1f)), purity); + ApplyDoTDebuff(brimstoneFlames, 30, purity); ApplyDoTDebuff(plague, (int)MathF.Round(30 * (alchFlask ? (1f - AlchemicalDecanter.PlagueReduction) : 1f)), purity); ApplyDoTDebuff(vHex, 30); // Has other effects ApplyDoTDebuff(searingLava, 30); diff --git a/Items/Accessories/Abaddon.cs b/Items/Accessories/Abaddon.cs index 5a92b845c2..08b23929ab 100644 --- a/Items/Accessories/Abaddon.cs +++ b/Items/Accessories/Abaddon.cs @@ -12,11 +12,8 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int CritBoost = 8; public static float BrimstoneFlamesReduction = 0.5f; public static float critScaling = 2; // How effective crit chance is at increasing debuff damage - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, BrimstoneFlamesReduction.ToPercent()); - public override void SetDefaults() { Item.width = 26; @@ -30,13 +27,12 @@ namespace CalamityMod.Items.Accessories { player.Calamity().abaddon = true; player.Calamity().abaddonEffectVisual = !hideVisual; - player.GetCritChance() += CritBoost; } public override void ModifyTooltips(List list) { Player player = Main.LocalPlayer; if (Main.LocalPlayer != null) - list.FindAndReplace("[DAMAGE]", ((int)(BrimstoneFlames.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonFlameDamage)).ToString()); + list.FindAndReplace("[DAMAGE]", ((int)(Bane.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonDebuffDamage)).ToString()); } } } diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index 82fe55b61d..d1731e0861 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -13,11 +13,8 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int CritBoost = 8; - public static float critScaling = 7; // How effective crit chance is at increasing debuff damage - public static float critDamageBoostPerDebuff = 0.02f; // 2% increased crit damage per debuff - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, Abaddon.BrimstoneFlamesReduction.ToPercent()); - + public static float critScaling = 6; // How effective crit chance is at increasing debuff damage + public static float critDamageBoostPerDebuff = 0.03f; // 3% increased crit damage per debuff public override void SetDefaults() { Item.width = 26; @@ -42,13 +39,12 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.voidOfExtinction = true; modPlayer.abaddonEffectVisual = !hideVisual; - player.GetCritChance() += CritBoost; } public override void ModifyTooltips(List list) { Player player = Main.LocalPlayer; if (Main.LocalPlayer != null) - list.FindAndReplace("[DAMAGE]", ((int)(BrimstoneFlames.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonFlameDamage)).ToString()); + list.FindAndReplace("[DAMAGE]", ((int)(Bane.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonDebuffDamage)).ToString()); } } } diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 9519a9149b..19654e61d5 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1691,3 +1691,8 @@ CnidarianSummonTagBuff: { DisplayName: Cnidarian Summon Tag Buff Description: you are not seeing this } + +Bane: { + DisplayName: Bane + Description: Mods.CalamityMod.Buffs.Bane.Description +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 5b88732d69..3865abc3ab 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -2,11 +2,9 @@ Abaddon: { DisplayName: Abaddon Tooltip: ''' - {$CommonItemTooltip.PercentIncreasedCritChance} - Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that scales off of your critical strike chance - When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies - Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}% - Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE] DPS + Critical strikes curse enemies with [cbuff:CalamityMod/Bane] that scales off of your critical strike chance + When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/Bane] to nearby enemies + Current [cbuff:CalamityMod/Bane] damage: [DAMAGE] DPS ''' } @@ -2064,12 +2062,10 @@ VoidofExtinction: { DisplayName: Void of Extinction Tooltip: ''' - {$CommonItemTooltip.PercentIncreasedCritChance} - Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that greatly scales off of your critical strike chance - When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies - Critical strikes deal an additional 2% damage per debuff on the enemy - Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}% - Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE] DPS + Critical strikes curse enemies with [cbuff:CalamityMod/Bane] that greatly scales off of your critical strike chance + When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/Bane] to nearby enemies + Critical strikes deal an additional 3% damage per debuff on the enemy + Current [cbuff:CalamityMod/Bane] damage: [DAMAGE] DPS ''' } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index f8dfdaa878..3b705d812c 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -290,6 +290,7 @@ namespace CalamityMod.NPCs public bool absorberAffliction = false; public bool irradiated = false; public double irradiatedContactBoost = 1.5; + public bool bane = false; public bool brimstoneFlames = false; public bool demonicFlames = false; public int demonicFlamesBonusDamage = 0; @@ -303,7 +304,7 @@ namespace CalamityMod.NPCs public bool scionsCurioEffected = false; public bool abaddonEffected = false; public bool voidOfExtinctionEffected = false; - public bool checkPlayerBflameDamage = false; + public bool checkPlayerBaneDamage = false; public int warbannerBurnTime = 0; // Determines the rate that the enemy is damaged public int warbannerBurnTimer = 0; // The duration of the debuff public int warbannerBurnStacks = 0; // The stacks increase how fast the debuff hits @@ -570,6 +571,7 @@ namespace CalamityMod.NPCs myClone.absorberAffliction = absorberAffliction; myClone.irradiated = irradiated; myClone.irradiatedContactBoost = irradiatedContactBoost; + myClone.bane = bane; myClone.brimstoneFlames = brimstoneFlames; myClone.demonicFlames = demonicFlames; myClone.demonicFlamesBonusDamage = demonicFlamesBonusDamage; @@ -583,7 +585,7 @@ namespace CalamityMod.NPCs myClone.scionsCurioEffected = scionsCurioEffected; myClone.abaddonEffected = abaddonEffected; myClone.voidOfExtinctionEffected = voidOfExtinctionEffected; - myClone.checkPlayerBflameDamage = checkPlayerBflameDamage; + myClone.checkPlayerBaneDamage = checkPlayerBaneDamage; myClone.warbannerBurnTime = warbannerBurnTime; myClone.warbannerBurnTimer = warbannerBurnTimer; myClone.warbannerBurnStacks = warbannerBurnStacks; @@ -777,6 +779,7 @@ namespace CalamityMod.NPCs irradiated = false; if (scionsCurioEffected) irradiatedContactBoost = 2f; + bane = false; brimstoneFlames = false; demonicFlames = false; holyFlames = false; @@ -3138,8 +3141,8 @@ namespace CalamityMod.NPCs if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].head)) npc.ai[3] = 0f; } - if (!brimstoneFlames && !checkPlayerBflameDamage) - checkPlayerBflameDamage = true; + if (!bane && !checkPlayerBaneDamage) + checkPlayerBaneDamage = true; if (demonicFlames) demonicFlamesClearTimer = 0; else @@ -4676,6 +4679,9 @@ namespace CalamityMod.NPCs if (astralInfection) AstralInfectionDebuff.DrawEffects(npc, ref drawColor); + if (bane) + Bane.DrawEffects(npc, ref drawColor); + // Brimstone Flames and Demonshade Enrage set bonus share the same visual effects // TODO -- change this when Demonshade is reworked if (brimstoneFlames || npc.HasBuff()) @@ -4943,6 +4949,7 @@ namespace CalamityMod.NPCs // All Calamity DoTs in alphabetical order ("CalamityMod/Buffs/DamageOverTime/AstralInfectionDebuff", NPC => NPC.Calamity().astralInfection), ("CalamityMod/Buffs/DamageOverTime/AuricRebuke", NPC => NPC.Calamity().auricRebuke), + ("CalamityMod/Buffs/DamageOverTime/Bane", NPC => NPC.Calamity().bane), ("CalamityMod/Buffs/DamageOverTime/BanishingFire", NPC => NPC.Calamity().banishingFire), ("CalamityMod/Buffs/DamageOverTime/BrainRot", NPC => NPC.Calamity().brainRot), ("CalamityMod/Buffs/DamageOverTime/BrimstoneFlames", NPC => NPC.Calamity().brimstoneFlames), diff --git a/Particles/BaneParticle.cs b/Particles/BaneParticle.cs new file mode 100644 index 0000000000..b24f40c2d3 --- /dev/null +++ b/Particles/BaneParticle.cs @@ -0,0 +1,114 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class BaneParticle : Particle + { + public override string Texture => "CalamityMod/Particles/BaneParticle"; + public Color InitialColor; + public Color EndColor; + public bool AffectedByGravity; + public bool FadeIn = false; + public float FadeInScale = 0f; + + public string NewTexture; + public float ActiveRotation; + public float AddedRotation = 0; + public float SpeedReduction = 0.95f; + public float ExtraRotation = 0; + + public Vector2 Stretch = Vector2.One; + public float ShrinkSpeed = 0; + public bool AltVisual = false; + public override bool UseAdditiveBlend => AltVisual; + public override bool SetLifetime => true; + public override bool UseCustomDraw => true; + + public override int FrameVariants => 5; + + public BaneParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color, Color colorEnd, Vector2 stretch, bool useAddativeBlend = false, float activeRotation = 0, float speedReduction = 0.95f, float extraRotation = 0, bool fadeIn = false, bool affectedByLight = true, float shrinkSpeed = 0) + { + Position = relativePosition; + Velocity = velocity; + ActiveRotation = activeRotation; + AffectedByGravity = affectedByGravity; + AffectedByLight = affectedByLight; + Scale = scale; + Stretch = stretch; + FadeInScale = scale; + Lifetime = lifetime; + Color = InitialColor = color; + EndColor = colorEnd; + ShrinkSpeed = shrinkSpeed; + SpeedReduction = speedReduction; + ExtraRotation = extraRotation; + + AltVisual = useAddativeBlend; + + FadeIn = fadeIn; + + if (FadeIn) + Scale = 0f; + + Variant = Main.rand.Next(FrameVariants); + } + + public override void Update() + { + if (!FadeIn) + { + Scale *= 0.95f; + InitialColor = Color.Lerp(InitialColor, EndColor, (float)Math.Pow(LifetimeCompletion, 3D)); + Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)); + } + else + { + if ((float)Time / (float)Lifetime < 0.5f) + { + Scale = MathHelper.Lerp(Scale, FadeInScale, 0.2f); + } + else + { + Scale = MathHelper.Lerp(Scale, FadeInScale, -0.21f); + } + } + Velocity *= SpeedReduction; + if (Velocity.Length() < 12f && AffectedByGravity) + { + Velocity.X *= 0.94f; + Velocity.Y += 0.25f; + } + + float velRot = ActiveRotation == 0 ? (Velocity.ToRotation() + MathHelper.PiOver2) : ActiveRotation; + Rotation = velRot + AddedRotation; + AddedRotation += ActiveRotation; + ActiveRotation *= 0.975f; + + Stretch.X *= (1 - 0.2f * ShrinkSpeed); + Stretch.Y *= (1 + 0.2f * ShrinkSpeed); + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Texture2D texture = ModContent.Request("CalamityMod/Particles/BaneParticleGlow").Value; + int frameWidth = 18; + int frameHeight = 18; + int frameSpacing = frameHeight + 2; + Rectangle frame = new Rectangle(0, frameSpacing * Variant, frameWidth, frameHeight); + Vector2 scale = Stretch * Scale; + + Color col = Color; + + if (AffectedByLight) + { + col = Lighting.GetColor((Position / 16).ToPoint()).MultiplyRGB(Color); + } + + spriteBatch.Draw(texture, Position - Main.screenPosition, frame, col, Rotation + ExtraRotation, frame.Size() * 0.5f, scale, 0, 0f); + } + } +} diff --git a/Particles/BaneParticle.png b/Particles/BaneParticle.png new file mode 100644 index 0000000000000000000000000000000000000000..89703f1e164c05d4f334a3b9ca6a77747f445c8d GIT binary patch literal 2930 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%0Dy!50Qvv` z0D$NK0Cg|`0P0`>06Lfe02gqax=}m;000SaNLh0L01FZT01FZU(%pXi0000RbVXQn zQ*UN;cVTj607GSLb9r+hQ*?D?X>TA@Z*OeDr{R16004eTL_t(YiS3qA3V-$Cg;rlDKA{t{)W!K( z?f)OM=vH-S^)^9SoS#*u-@e+~7Q>~M#hulPxN=teCuiI@@(T=4s1u`n`LtR|Wd3j` c&+=M40Ica;5O9^B)Bpeg07*qoM6N<$f-GHvkpKVy literal 0 HcmV?d00001 diff --git a/Particles/BaneParticleGlow.png b/Particles/BaneParticleGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..afbabdf11cafd7bbcafb26b5dea8c334d70d84e9 GIT binary patch literal 3067 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%0Dy!50Qvv` z0D$NK0Cg|`0P0`>06Lfe02gqax=}m;000SaNLh0L01FZT01FZU(%pXi0000RbVXQn zQ*UN;cVTj607GSLb9r+hQ*?D?X>TA@Z*OeDr{R16009R{L_t(oh3%L@4uv2LM9Vo? zco5F-L0ota{;G+Nk^<82nDBNr<|RNoL4$~7IS^x%8uooZ)nT|u17*R@KNQaTC!MInS+LC*Olk)lEsG%szK2nAUGUu5AY61rIv+B|xSpNMCVc>0KM z*7)*BV6*X9OW^zCM0|V1*GED(YeJhxPnns0Wo9JjdklF7iK0g@!D(0Se5{?iMN5sGvac6QK|(eTMmqTJg_pU4m8niSXF}JvT@@R?}Gn?<9zZlmV91VP4eLrdzDHyRBANXAH6ZJAo^aB7-47|Ku$JYP=002ov JPDHLkV1lfg#nu1- literal 0 HcmV?d00001 diff --git a/Particles/BloomRingAngled.png b/Particles/BloomRingAngled.png new file mode 100644 index 0000000000000000000000000000000000000000..fa6506a99255038484441b48c0138fc0cf1f8926 GIT binary patch literal 11339 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 listNPCs = new List(); public NPC lastNPC; public int minCooldown = 48; + public Color startingColor = Color.PaleTurquoise; public Color mainColor = Color.White; - public Color subColor = Color.White; + public Color subColor = Color.PaleTurquoise; // Once static, set to staring color public Color extraColor = Color.White; public ref float spreadCount => ref Projectile.ai[2]; public override void SetDefaults() @@ -55,9 +51,12 @@ namespace CalamityMod.Projectiles.Typeless Color color1 = Color.Crimson; Color color2 = Color.OrangeRed; Color color3 = Color.Red; - int debuffTime = (strong ? 120 : 90); + int debuffTime = (strong ? 180 : 120); int startDir = Main.rand.NextBool() ? 1 : -1; + // Initial infliction lasts longer, hopefully reduces the power imbalance between this accessory with fast weapons vs slow weapons + npc.AddBuff(ModContent.BuffType(), debuffTime * 2); + float distanceFromCenter = areaOfEffect; NPC targeted = null; // Get closest valid target @@ -80,9 +79,7 @@ namespace CalamityMod.Projectiles.Typeless targeted.Calamity().voidOfExtinctionEffected = npc.Calamity().voidOfExtinctionEffected; targeted.Calamity().abaddonEffected = npc.Calamity().abaddonEffected; - //npc.AddBuff(ModContent.BuffType(), debuffTime); - - float bestDamage = Owner.Calamity().abaddonFlameDamage; + float bestDamage = Owner.Calamity().abaddonDebuffDamage; int heat = 0; Color heatClr = Color.OrangeRed; int sick = 0; @@ -95,22 +92,24 @@ namespace CalamityMod.Projectiles.Typeless Color waterClr = Color.DarkTurquoise; // Find all the debuffs on the enemy int debuffNum = 0; + for (int index = 0; index < npc.buffType.Length; index++) { int type = npc.buffType[index]; var debuffData = BuffDatasets.DebuffDataset[type]; - // Calculate the brimstone flames damage to see if the debuffs can be transfered - int bFlamesDamage = Math.Max((int)(BrimstoneFlames.debuffData.EnemyLostRegen * bestDamage), (int)BrimstoneFlames.debuffData.EnemyLostRegen); + // Calculate the Bane damage to see if the debuffs can be transfered + int bDamage = Math.Max((int)(Bane.debuffData.EnemyLostRegen * bestDamage), (int)Bane.debuffData.EnemyLostRegen); if (CalamityBuffSets.IsDebuff[type]) { - if (debuffData == null || debuffData.EnemyLostRegen <= bFlamesDamage) + if (debuffData == null || debuffData.EnemyLostRegen <= bDamage) { debuffNum++; - targeted.AddBuff(type, debuffTime); + float timeMult = debuffData == null ? 1 : Utils.Remap(debuffData.EnemyLostRegen, 0, bDamage, 5, 1); + targeted.AddBuff(type, (int)(debuffTime * timeMult)); } - if (debuffData != null && debuffData != BrimstoneFlames.debuffData) + if (debuffData != null) { if (debuffData.HeatDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, heatClr, 0.65f); heat++; } if (debuffData.SicknessDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, sickClr, 0.65f); sick++; } @@ -121,7 +120,7 @@ namespace CalamityMod.Projectiles.Typeless } // Edge case fixes for Shred and Demonic Flames // Not ideal but not sure how else to do it - if (npc.Calamity().somaShredStacks > 0 && Shred.BaseDamage <= bFlamesDamage) + if (npc.Calamity().somaShredStacks > 0 && Shred.BaseDamage <= bDamage) targeted.AddBuff(ModContent.BuffType(), debuffTime); int demonicFlames = ModContent.GetModBuff(ModContent.BuffType()).Type; if (npc.HasBuff(demonicFlames)) @@ -138,11 +137,11 @@ namespace CalamityMod.Projectiles.Typeless if (highest != 0) { // Ideally these lines would run in a random order, so that fire isn't prioritsed as an extra color, but I don't know how to do that! - if (heat == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = heatClr; } else { subColor = heatClr; } } - if (sick == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = sickClr; } else { subColor = sickClr; } } - if (cold == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = coldClr; } else { subColor = coldClr; } } - if (shock == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = shockClr; } else { subColor = shockClr; } } - if (water == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = waterClr; } else { subColor = waterClr; } } + if (heat == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = heatClr; } else { subColor = heatClr; } } + if (sick == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = sickClr; } else { subColor = sickClr; } } + if (cold == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = coldClr; } else { subColor = coldClr; } } + if (shock == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = shockClr; } else { subColor = shockClr; } } + if (water == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = waterClr; } else { subColor = waterClr; } } } VisualEffects(npc, targeted, startDir, 1 + (best.Sum() * 0.12f)); @@ -157,7 +156,6 @@ namespace CalamityMod.Projectiles.Typeless return; } - //npc.AddBuff(ModContent.BuffType(), debuffTime); Color colorAgain = Main.rand.NextBool() ? color2 : color1; Particle spark2 = new CustomSpark(npc.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, 0.55f, colorAgain * (Owner.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f); GeneralParticleHandler.SpawnParticle(spark2); diff --git a/Systems/Collections/CalamityBuffSets.cs b/Systems/Collections/CalamityBuffSets.cs index 5662049cef..5534e9ee7a 100644 --- a/Systems/Collections/CalamityBuffSets.cs +++ b/Systems/Collections/CalamityBuffSets.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Systems.Collections ///
public static bool[] IsDebuff = Factory.CreateBoolSet(BuffID.Poisoned, BuffID.Darkness, BuffID.Cursed, BuffID.OnFire, BuffID.Bleeding, BuffID.Confused, BuffID.Slow, BuffID.Weak, BuffID.Silenced, BuffID.BrokenArmor, BuffID.CursedInferno, BuffID.Frostburn, BuffID.Chilled, BuffID.Frozen, BuffID.Burning, BuffID.Suffocation, BuffID.Ichor, - BuffID.Venom, BuffID.Blackout, BuffID.Electrified, BuffID.Rabies, BuffID.Webbed, BuffID.Stoned, BuffID.Dazed, BuffID.VortexDebuff, BuffID.WitheredArmor, BuffID.WitheredWeapon, + BuffID.Venom, BuffID.Blackout, BuffID.Electrified, BuffID.Rabies, BuffID.Webbed, BuffID.Stoned, BuffID.Dazed, BuffID.VortexDebuff, BuffID.WitheredArmor, BuffID.WitheredWeapon, BuffID.ShadowFlame, BuffID.OgreSpit, BuffID.BetsysCurse, BuffID.Wet, BuffID.Slimed, BuffID.OnFire3, BuffID.Frostburn2, BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), @@ -67,7 +67,7 @@ namespace CalamityMod.Systems.Collections BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType()); + BuffType(), BuffType(), BuffType()); /// /// If for a buff type, then that buff is a whip tag buff on the player.
From f169462db240916e31365721f0c0bf9130a5806c Mon Sep 17 00:00:00 2001 From: Xyk Date: Sun, 15 Feb 2026 22:40:30 -0800 Subject: [PATCH 09/22] More Balance and Fixes Fixed Sage poison not being in the debuff section more balance and fixes --- Buffs/DamageOverTime/Bane.cs | 15 +++++++++------ Items/Accessories/Abaddon.cs | 2 +- Items/Accessories/VoidofExtinction.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 4 ---- Projectiles/Typeless/DebuffSpreadEffect.cs | 4 ++-- Systems/Collections/CalamityBuffSets.cs | 2 +- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Buffs/DamageOverTime/Bane.cs b/Buffs/DamageOverTime/Bane.cs index a7a89a8dd4..56762e49ef 100644 --- a/Buffs/DamageOverTime/Bane.cs +++ b/Buffs/DamageOverTime/Bane.cs @@ -8,7 +8,6 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Utilities.Terraria.Utilities; namespace CalamityMod.Buffs.DamageOverTime { @@ -27,18 +26,23 @@ namespace CalamityMod.Buffs.DamageOverTime BuffID.Sets.LongerExpertDebuff[Type] = true; BuffDatasets.DebuffDataset[Type] = debuffData; } + public static ActiveEntityIterator ActivePlayers + { + get + { + return new ActiveEntityIterator((ReadOnlySpan)Main.player.AsSpan(0, (int)byte.MaxValue)); + } + } public static void BaneNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) { var cnpc = npc.Calamity(); bool effected = (cnpc.abaddonEffected || cnpc.voidOfExtinctionEffected); bool strong = cnpc.voidOfExtinctionEffected; int baseDoTValue = (int)debuffData.EnemyLostRegen; - if (effected && cnpc.checkPlayerBaneDamage) + if (effected) { - for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + foreach (var player in Main.ActivePlayers) { - Player player = Main.player[playerIndex]; - if (player.active) { float improvedDamage = baseDoTValue * player.Calamity().abaddonDebuffDamage; if (improvedDamage > baseDoTValue && (player.Calamity().abaddon || player.Calamity().voidOfExtinction)) @@ -47,7 +51,6 @@ namespace CalamityMod.Buffs.DamageOverTime } } } - cnpc.checkPlayerBaneDamage = false; } cnpc.ApplyDPSDebuff(baseDoTValue, baseDoTValue / 20, ref npc.lifeRegen, ref damage); } diff --git a/Items/Accessories/Abaddon.cs b/Items/Accessories/Abaddon.cs index 08b23929ab..70b9051daf 100644 --- a/Items/Accessories/Abaddon.cs +++ b/Items/Accessories/Abaddon.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public static float BrimstoneFlamesReduction = 0.5f; - public static float critScaling = 2; // How effective crit chance is at increasing debuff damage + public static float critScaling = 3.5f; // How effective crit chance is at increasing debuff damage public override void SetDefaults() { Item.width = 26; diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index d1731e0861..76ee843ab2 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static float critScaling = 6; // How effective crit chance is at increasing debuff damage + public static float critScaling = 7.5f; // How effective crit chance is at increasing debuff damage public static float critDamageBoostPerDebuff = 0.03f; // 3% increased crit damage per debuff public override void SetDefaults() { diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 3b705d812c..1c4ff571fa 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -304,7 +304,6 @@ namespace CalamityMod.NPCs public bool scionsCurioEffected = false; public bool abaddonEffected = false; public bool voidOfExtinctionEffected = false; - public bool checkPlayerBaneDamage = false; public int warbannerBurnTime = 0; // Determines the rate that the enemy is damaged public int warbannerBurnTimer = 0; // The duration of the debuff public int warbannerBurnStacks = 0; // The stacks increase how fast the debuff hits @@ -585,7 +584,6 @@ namespace CalamityMod.NPCs myClone.scionsCurioEffected = scionsCurioEffected; myClone.abaddonEffected = abaddonEffected; myClone.voidOfExtinctionEffected = voidOfExtinctionEffected; - myClone.checkPlayerBaneDamage = checkPlayerBaneDamage; myClone.warbannerBurnTime = warbannerBurnTime; myClone.warbannerBurnTimer = warbannerBurnTimer; myClone.warbannerBurnStacks = warbannerBurnStacks; @@ -3141,8 +3139,6 @@ namespace CalamityMod.NPCs if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].head)) npc.ai[3] = 0f; } - if (!bane && !checkPlayerBaneDamage) - checkPlayerBaneDamage = true; if (demonicFlames) demonicFlamesClearTimer = 0; else diff --git a/Projectiles/Typeless/DebuffSpreadEffect.cs b/Projectiles/Typeless/DebuffSpreadEffect.cs index e9f9781ee5..a788ef8b85 100644 --- a/Projectiles/Typeless/DebuffSpreadEffect.cs +++ b/Projectiles/Typeless/DebuffSpreadEffect.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Typeless if (debuffData == null || debuffData.EnemyLostRegen <= bDamage) { debuffNum++; - float timeMult = debuffData == null ? 1 : Utils.Remap(debuffData.EnemyLostRegen, 0, bDamage, 5, 1); + float timeMult = (debuffData == null || (debuffData != null && debuffData == Bane.debuffData)) ? 1 : Utils.Remap(debuffData.EnemyLostRegen, 0, bDamage, 5, 1); targeted.AddBuff(type, (int)(debuffTime * timeMult)); } if (debuffData != null) @@ -179,7 +179,7 @@ namespace CalamityMod.Projectiles.Typeless } public void VisualEffects(NPC npc, NPC targeted, int startDirection, float effectPower) { - Vector2 start = npc.Center + Main.rand.NextVector2Circular(npc.width / 2, npc.height / 2); + Vector2 start = npc.Center; Vector2 end = targeted.Center; if (Owner.Calamity().abaddonEffectVisual) { diff --git a/Systems/Collections/CalamityBuffSets.cs b/Systems/Collections/CalamityBuffSets.cs index 5534e9ee7a..48c092ed60 100644 --- a/Systems/Collections/CalamityBuffSets.cs +++ b/Systems/Collections/CalamityBuffSets.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Systems.Collections BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType()); /// From 71a5854c3643a69cb9355af24752c4b4ff7a1d81 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 16 Feb 2026 13:37:00 -0800 Subject: [PATCH 10/22] Fixed multispawns --- CalPlayer/CalamityPlayerHitHurt.cs | 3 +-- Projectiles/Typeless/DebuffSpreadEffect.cs | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 242213e8b2..9df6e8a52c 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -28,7 +28,6 @@ using CalamityMod.Items.Armor.Tarragon; using CalamityMod.Items.Armor.Victide; using CalamityMod.Items.Armor.Wulfrum; using CalamityMod.Items.Potions; -using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.Tools; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Melee; @@ -51,7 +50,6 @@ using CalamityMod.UI; using CalamityMod.Utilities; using CalamityMod.World; using Microsoft.Xna.Framework; -using Mono.Cecil; using Terraria; using Terraria.Audio; using Terraria.Chat; @@ -691,6 +689,7 @@ namespace CalamityMod.CalPlayer { int maxTargetNum = npc.Calamity().voidOfExtinctionEffected ? 10 : 6; Projectile.NewProjectile(Player.GetSource_FromThis(), npc.Center, Vector2.Zero, debuffSpreadProj, 0, 0, Player.whoAmI, 0, npc.whoAmI, maxTargetNum); + abaddonCooldown = -1; // Prevents multiple projectiles hitting on the same frame from spawning multiple of these } } diff --git a/Projectiles/Typeless/DebuffSpreadEffect.cs b/Projectiles/Typeless/DebuffSpreadEffect.cs index a788ef8b85..1682df9d3b 100644 --- a/Projectiles/Typeless/DebuffSpreadEffect.cs +++ b/Projectiles/Typeless/DebuffSpreadEffect.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Typeless public Color subColor = Color.PaleTurquoise; // Once static, set to staring color public Color extraColor = Color.White; public ref float spreadCount => ref Projectile.ai[2]; + public ref float time => ref Projectile.ai[0]; public override void SetDefaults() { Projectile.width = Projectile.height = 1; @@ -41,7 +42,7 @@ namespace CalamityMod.Projectiles.Typeless if (npc != null && spreadCount != 0) { - if (Owner.Calamity().abaddonCooldown % 9 == 0) + if (time % 9 == 0) { listNPCs.Add(npc.whoAmI); Projectile.Center = npc.Center; @@ -160,7 +161,7 @@ namespace CalamityMod.Projectiles.Typeless Particle spark2 = new CustomSpark(npc.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, 0.55f, colorAgain * (Owner.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f); GeneralParticleHandler.SpawnParticle(spark2); - if (Owner.Calamity().abaddonCooldown == 0) + if (Owner.Calamity().abaddonCooldown <= 0) Owner.Calamity().abaddonCooldown = minCooldown * 2; spreadCount--; } @@ -170,6 +171,7 @@ namespace CalamityMod.Projectiles.Typeless KillSelf(); return; } + time++; } public void KillSelf() { From 9d550bc59ece519b7210488668124aa101f856ab Mon Sep 17 00:00:00 2001 From: Xyk Date: Wed, 18 Feb 2026 11:04:26 -0800 Subject: [PATCH 11/22] Colors and fixes --- Buffs/DamageOverTime/Bane.cs | 28 ++++++++++--------- Particles/BaneParticle.cs | 32 ++++++++++++++++++---- Projectiles/Typeless/DebuffSpreadEffect.cs | 11 ++++++-- 3 files changed, 50 insertions(+), 21 deletions(-) diff --git a/Buffs/DamageOverTime/Bane.cs b/Buffs/DamageOverTime/Bane.cs index 56762e49ef..3c571ed8ed 100644 --- a/Buffs/DamageOverTime/Bane.cs +++ b/Buffs/DamageOverTime/Bane.cs @@ -26,13 +26,6 @@ namespace CalamityMod.Buffs.DamageOverTime BuffID.Sets.LongerExpertDebuff[Type] = true; BuffDatasets.DebuffDataset[Type] = debuffData; } - public static ActiveEntityIterator ActivePlayers - { - get - { - return new ActiveEntityIterator((ReadOnlySpan)Main.player.AsSpan(0, (int)byte.MaxValue)); - } - } public static void BaneNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) { var cnpc = npc.Calamity(); @@ -85,22 +78,31 @@ namespace CalamityMod.Buffs.DamageOverTime Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomRingAngled").Value; Texture2D center = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; Vector2 drawPosition = npc.Center - Main.screenPosition; - Color color = Color.PaleTurquoise; - Color color2 = Color.Khaki; + Color color = Color.Turquoise; + Color color2 = Color.Orange; float maxSizeMult = 10f; float widthMult = MathF.Pow(Utils.Remap(npc.width, 10, 500, 1f, maxSizeMult), 0.8f); float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 9.0f) / MathHelper.Pi); float sine2 = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 11.0f) / MathHelper.Pi); float randSize = Main.rand.NextFloat(0.82f, 1.08f); - Main.EntitySpriteDraw(bloom, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine) * 2.3f), null, color with { A = 0 }, 0, bloom.Size() / 2, new Vector2((sine * 0.09f + 1.2f) * widthMult, 0.9f) * 0.18f * MathF.Pow(randSize, 0.3f), SpriteEffects.None); - Main.EntitySpriteDraw(center, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine2) * 3.3f), null, Color.Lerp(color, color2, 0.7f) with { A = 0 }, 0, center.Size() / 2, new Vector2((sine2 * 0.09f + 1.2f) * widthMult, 0.6f) * 0.18f * randSize, SpriteEffects.None); + for (int i = 0; i < 2; i++) + { + float sizeMult = (i == 0 ? 1 : 0.8f); + float colorMult = (i == 0 ? 1 : 0.7f); + Main.EntitySpriteDraw(bloom, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine) * 2.3f), null, Color.Lerp(color, Color.White, i * 0.7f) with { A = 0 } * colorMult, 0, bloom.Size() / 2, new Vector2((sine * 0.09f + 1.2f) * widthMult, 0.9f) * 0.18f * MathF.Pow(randSize, 0.3f), SpriteEffects.None); + Main.EntitySpriteDraw(center, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine2) * 3.3f), null, Color.Lerp(color2, Color.White, i * 0.7f) with { A = 0 } * colorMult, 0, center.Size() / 2, new Vector2((sine2 * 0.09f + 1.2f) * widthMult, 0.6f) * 0.18f * randSize, SpriteEffects.None); + } - if (Main.rand.NextBool(9)) + if (Main.rand.NextBool(13)) { bool start = Main.rand.NextBool(); - Particle baneRunes = new BaneParticle(npc.Center + Main.rand.NextVector2Circular(18 * widthMult, 8) + (Vector2.UnitY * npc.height / 3f) + Vector2.UnitY * ((1 - sine) * 2.3f), Vector2.UnitY * Main.rand.NextFloat(-2.5f, -4.5f) * widthMult, false, 30, 1f, start ? color : color2, start ? color2 : color, Vector2.One, true, Main.rand.NextBool(3) ? Main.rand.NextFloat(-0.2f, 0.2f) : 0, 0.85f, MathHelper.PiOver2 * Main.rand.Next(4 + 1)); + Vector2 baneVel = Vector2.UnitY * Main.rand.NextFloat(-0.5f, -1.5f) * widthMult * (Main.rand.NextBool(5) ? 2 : 1) + npc.velocity * 0.35f; + Vector2 banePos = npc.Center + Main.rand.NextVector2Circular(3 * widthMult, 8) + (Vector2.UnitY * npc.height / 3f) + Vector2.UnitY * ((1 - sine) * 2.3f); + Particle baneRunes = new BaneParticle(banePos, baneVel, false, 55, 1f * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color, Vector2.One, true, Main.rand.NextBool(3) ? Main.rand.NextFloat(-0.2f, 0.2f) : 0, 0.95f, MathHelper.PiOver2 * Main.rand.Next(4 + 1), sineRate: Main.rand.NextFloat(0.2f, 1f), sineIntensity: Main.rand.Next(14, 19 + 1) * widthMult); GeneralParticleHandler.SpawnParticle(baneRunes); + if (Main.rand.NextBool()) + baneRunes.DrawLayer = Enums.GeneralDrawLayer.BeforeNPCs; } Lighting.AddLight(npc.Center, color.ToVector3() * 0.6f); } diff --git a/Particles/BaneParticle.cs b/Particles/BaneParticle.cs index b24f40c2d3..6452500cb4 100644 --- a/Particles/BaneParticle.cs +++ b/Particles/BaneParticle.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -11,9 +12,14 @@ namespace CalamityMod.Particles public override string Texture => "CalamityMod/Particles/BaneParticle"; public Color InitialColor; public Color EndColor; + public Color glowColor = Color.White; public bool AffectedByGravity; public bool FadeIn = false; public float FadeInScale = 0f; + public float SineRate = 0; + public float SineIntensity = 0; + public float Sine = 0; + public int sineTime = 0; public string NewTexture; public float ActiveRotation; @@ -30,7 +36,7 @@ namespace CalamityMod.Particles public override int FrameVariants => 5; - public BaneParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color, Color colorEnd, Vector2 stretch, bool useAddativeBlend = false, float activeRotation = 0, float speedReduction = 0.95f, float extraRotation = 0, bool fadeIn = false, bool affectedByLight = true, float shrinkSpeed = 0) + public BaneParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color, Color colorEnd, Vector2 stretch, bool useAddativeBlend = false, float activeRotation = 0, float speedReduction = 0.95f, float extraRotation = 0, float sineRate = 1, float sineIntensity = 0, bool fadeIn = false, bool affectedByLight = false, float shrinkSpeed = 0) { Position = relativePosition; Velocity = velocity; @@ -46,6 +52,10 @@ namespace CalamityMod.Particles ShrinkSpeed = shrinkSpeed; SpeedReduction = speedReduction; ExtraRotation = extraRotation; + SineRate = sineRate; + SineIntensity = sineIntensity; + sineTime = Main.rand.Next(0, 400 + 1); + AltVisual = useAddativeBlend; @@ -62,8 +72,7 @@ namespace CalamityMod.Particles if (!FadeIn) { Scale *= 0.95f; - InitialColor = Color.Lerp(InitialColor, EndColor, (float)Math.Pow(LifetimeCompletion, 3D)); - Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)); + Color = Color.Lerp(InitialColor, EndColor, LifetimeCompletion); } else { @@ -90,15 +99,25 @@ namespace CalamityMod.Particles Stretch.X *= (1 - 0.2f * ShrinkSpeed); Stretch.Y *= (1 + 0.2f * ShrinkSpeed); - } + Sine = (float)Math.Sin((sineTime * SineRate) / MathHelper.Pi) * SineIntensity; + sineTime++; + } public override void CustomDraw(SpriteBatch spriteBatch) { + Texture2D texture = ModContent.Request("CalamityMod/Particles/BaneParticleGlow").Value; int frameWidth = 18; int frameHeight = 18; int frameSpacing = frameHeight + 2; Rectangle frame = new Rectangle(0, frameSpacing * Variant, frameWidth, frameHeight); + + Texture2D texture2 = ModContent.Request("CalamityMod/Particles/BaneParticle").Value; + int frameWidth2 = 14; + int frameHeight2 = 10; + int frameSpacing2 = frameHeight2 + 2; + Rectangle frame2 = new Rectangle(0, frameSpacing2 * Variant, frameWidth2, frameHeight2); + Vector2 scale = Stretch * Scale; Color col = Color; @@ -107,8 +126,9 @@ namespace CalamityMod.Particles { col = Lighting.GetColor((Position / 16).ToPoint()).MultiplyRGB(Color); } - - spriteBatch.Draw(texture, Position - Main.screenPosition, frame, col, Rotation + ExtraRotation, frame.Size() * 0.5f, scale, 0, 0f); + float fadeOut = (1 - (float)Math.Pow(LifetimeCompletion, 3D)); + spriteBatch.Draw(texture, Position - Main.screenPosition + Vector2.UnitX * Sine, frame, col * fadeOut, Rotation + ExtraRotation, frame.Size() * 0.5f, scale, 0, 0f); + spriteBatch.Draw(texture2, Position - Main.screenPosition + Vector2.UnitX * Sine, frame2, Color.Lerp(glowColor, col, 0.2f) * 0.75f * fadeOut, Rotation + ExtraRotation, frame2.Size() * 0.5f, scale * 0.95f, 0, 0f); } } } diff --git a/Projectiles/Typeless/DebuffSpreadEffect.cs b/Projectiles/Typeless/DebuffSpreadEffect.cs index 1682df9d3b..69c857b6d4 100644 --- a/Projectiles/Typeless/DebuffSpreadEffect.cs +++ b/Projectiles/Typeless/DebuffSpreadEffect.cs @@ -20,9 +20,9 @@ namespace CalamityMod.Projectiles.Typeless public List listNPCs = new List(); public NPC lastNPC; public int minCooldown = 48; - public Color startingColor = Color.PaleTurquoise; + public static Color startingColor = Color.Turquoise; public Color mainColor = Color.White; - public Color subColor = Color.PaleTurquoise; // Once static, set to staring color + public Color subColor = startingColor; public Color extraColor = Color.White; public ref float spreadCount => ref Projectile.ai[2]; public ref float time => ref Projectile.ai[0]; @@ -46,6 +46,7 @@ namespace CalamityMod.Projectiles.Typeless { listNPCs.Add(npc.whoAmI); Projectile.Center = npc.Center; + mainColor = Color.White; bool strong = npc.Calamity().voidOfExtinctionEffected; float areaOfEffect = (strong ? 1400 : 800); @@ -117,6 +118,10 @@ namespace CalamityMod.Projectiles.Typeless if (debuffData.ColdDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, coldClr, 0.65f); cold++; } if (debuffData.ElectricDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, shockClr, 0.65f); shock++; } if (debuffData.WaterDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, waterClr, 0.65f); water++; } + if (new List { heat, sick, cold, shock, water }.Max() == 0) + { + mainColor = Color.Orange; + } } } // Edge case fixes for Shred and Demonic Flames @@ -177,6 +182,8 @@ namespace CalamityMod.Projectiles.Typeless { if (Owner.Calamity().abaddonCooldown > minCooldown) Owner.Calamity().abaddonCooldown = minCooldown; + if (Owner.Calamity().abaddonCooldown < 0) + Owner.Calamity().abaddonCooldown = 0; Projectile.Kill(); } public void VisualEffects(NPC npc, NPC targeted, int startDirection, float effectPower) From b97d0e43d290593e5314bd1a990a97d839a7ced6 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Wed, 18 Feb 2026 23:03:03 -0600 Subject: [PATCH 12/22] cleanups and fixes --- Items/Weapons/Melee/EvilSmasher.cs | 9 +++++++-- Localization/en-US/Mods.CalamityMod.Buffs.hjson | 10 ++++++++++ .../en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson | 1 - Projectiles/Melee/EvilSmasherProjectile.cs | 6 +++--- build.txt | 2 +- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Items/Weapons/Melee/EvilSmasher.cs b/Items/Weapons/Melee/EvilSmasher.cs index 63b8caf504..596829a8c7 100644 --- a/Items/Weapons/Melee/EvilSmasher.cs +++ b/Items/Weapons/Melee/EvilSmasher.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Weapons.Melee base.SetDefaults(); Item.width = 64; Item.height = 66; - Item.damage = 750; - Item.DamageType = TrueMeleeDamageClass.Instance; + Item.damage = 200; + Item.DamageType = AverageDamageClass.Instance; Item.useAnimation = Item.useTime = 120; Item.channel = true; Item.knockBack = 6f; @@ -33,6 +33,11 @@ namespace CalamityMod.Items.Weapons.Melee Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; } + public override void UpdateInventory(Player player) + { + AnimationTime = 300; + base.UpdateInventory(player); + } public override void Update(ref float gravity, ref float maxFallSpeed) { diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 64902d8d5b..8f8eab0ad2 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1695,4 +1695,14 @@ CnidarianSummonTagBuff: { SmashedEvil: { DisplayName: Smashed Evil Description: Increased damage, movement speed, and regeneration + ItemTooltip: + ''' + - On Enemies - + All Types - 20 DPS + +5 damage taken + - On Players - + Regen returns to full strength 200% faster + 10% increased damage + 20% increased movement speed + ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index d822c987a8..f3d1a517f0 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -461,7 +461,6 @@ EvilSmasher: { Channels a powerful hammer strike with the capability to crush all evil Striking a tile with the hammer strike will cause an explosion and push you back Striking enemies provides inflicts [cbuff:CalamityMod/SmashedEvil] on both the user and target - [cbuff:CalamityMod/SmashedEvil] strengthens players and weakens enemies Charging strikes increases damage, explosion radius, and [cbuff:CalamityMod/SmashedEvil] duration 'EViL! sMaSH eVIl! SmAsh... ER!' ''' diff --git a/Projectiles/Melee/EvilSmasherProjectile.cs b/Projectiles/Melee/EvilSmasherProjectile.cs index 8dd82aae7c..d8a5f86ab3 100644 --- a/Projectiles/Melee/EvilSmasherProjectile.cs +++ b/Projectiles/Melee/EvilSmasherProjectile.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Melee if (inStartup) { Projectile.damage = (int)(Projectile.originalDamage * (timer / (float)(StartupTime-1))); - Owner.velocity.X *= 0.95f; + Owner.velocity.X *= 0.97f; } if (inStartup && !Owner.channel && timer > 30) { @@ -171,8 +171,8 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.Item69 with { Volume = 1f, LimitsArePerVariant = false, MaxInstances = 1 }); } - target.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 600, Projectile.damage / (float)Projectile.originalDamage)); - Owner.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 600, Projectile.damage / (float)Projectile.originalDamage)); + target.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, Projectile.damage / (float)Projectile.originalDamage)); + Owner.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, Projectile.damage / (float)Projectile.originalDamage)); } public override bool PreDraw(ref Color lightColor) diff --git a/build.txt b/build.txt index 5d37989673..047b87641a 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = The Calamity Dev Team -version = 2.1 +version = 2.1.1 displayName = Calamity Mod modReferences = CalamityModMusic homepage = https://calamitymod.com From 666b21b64107fd9cd10c65c057526f4fefb80952 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Wed, 18 Feb 2026 23:19:54 -0600 Subject: [PATCH 13/22] fixed sound being in loop, added charge particles --- Projectiles/Melee/EvilSmasherProjectile.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Projectiles/Melee/EvilSmasherProjectile.cs b/Projectiles/Melee/EvilSmasherProjectile.cs index d8a5f86ab3..f7182884f2 100644 --- a/Projectiles/Melee/EvilSmasherProjectile.cs +++ b/Projectiles/Melee/EvilSmasherProjectile.cs @@ -78,7 +78,20 @@ namespace CalamityMod.Projectiles.Melee timer--; if (!playedChargeSound) { SoundEngine.PlaySound(SoundID.Item178,Projectile.Center); - playedChargeSound = true; + playedChargeSound = true; + for (int i = 0; i < 5; i++) + { + int sparkLifetime = Main.rand.Next(8, 12); + float sparkScale = Main.rand.NextFloat(0.5f, 1f); + var sparkColor = Main.rand.NextBool() ? Color.Purple : Color.Red; + + if (Main.rand.NextBool(5)) + sparkScale *= 1.4f; + + Vector2 sparkVelocity = Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * MathHelper.Lerp(10, 30, Main.rand.NextFloat()); + SparkParticle spark = new SparkParticle(Projectile.Center + angle * 30, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + } } } if (!hasSmashedTile && inSwing && SwingCompletion > 0.275f) @@ -163,8 +176,8 @@ namespace CalamityMod.Projectiles.Melee SparkParticle spark = new SparkParticle(target.Center, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor); GeneralParticleHandler.SpawnParticle(spark); - SoundEngine.PlaySound(SoundID.DeerclopsRubbleAttack with {Volume = 0.5f,LimitsArePerVariant = false, MaxInstances = 1}); } + SoundEngine.PlaySound(SoundID.DeerclopsRubbleAttack with { Volume = 0.5f, LimitsArePerVariant = false, MaxInstances = 1 }); } else if (!hasSmashedTile) { From 90aa898a586da597e0d06c5c984abf9129c12625 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Wed, 18 Feb 2026 23:34:49 -0600 Subject: [PATCH 14/22] tooltip fix --- Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index f3d1a517f0..24fe6b7cd1 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -460,7 +460,7 @@ EvilSmasher: { ''' Channels a powerful hammer strike with the capability to crush all evil Striking a tile with the hammer strike will cause an explosion and push you back - Striking enemies provides inflicts [cbuff:CalamityMod/SmashedEvil] on both the user and target + Striking enemies inflicts [cbuff:CalamityMod/SmashedEvil] on both the user and target Charging strikes increases damage, explosion radius, and [cbuff:CalamityMod/SmashedEvil] duration 'EViL! sMaSH eVIl! SmAsh... ER!' ''' From abfa85fbc14b159db8eab6eccaab73a869f4e791 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Thu, 19 Feb 2026 15:43:07 -0600 Subject: [PATCH 15/22] smashed evil text and icon colors --- Buffs/StatBuffs/SmashedEvil.png | Bin 607 -> 665 bytes Buffs/StatBuffs/SmashedEvilDebuff.png | Bin 607 -> 0 bytes NPCs/CalamityGlobalNPC.cs | 2 +- Utilities/ItemUtils.cs | 7 +++++++ 4 files changed, 8 insertions(+), 1 deletion(-) delete mode 100644 Buffs/StatBuffs/SmashedEvilDebuff.png diff --git a/Buffs/StatBuffs/SmashedEvil.png b/Buffs/StatBuffs/SmashedEvil.png index ee597d4cce00dc21f0edf6331a49bf873c5a6707..a75b74f944f386e2ab62ed7f8ff4aafc1ea81eee 100644 GIT binary patch delta 463 zcmcc5GLvTArAD-|rrRPbD+UIJLWOG<78dalF0xXRbEj2Z zIJqV{CZ@VLtfsDd!`qnu|Nq~)duQ&v*)|$UK*gL_&jtc1v63LaV4xHxU|_s-;0Z`! zfk$L90|Vb75M~rr*YIipib|BYMwA5SrRIOG-Lji_ zJV^di86(3BW(Ecrjizj}1*2!Zw&Hhn8z=TDKr?T6x;Tbd_)oojU94Gwhb_UKQ=*Og z-v7|*y2lx-Se6;@oCv}i_ca6iTusd((rI?YMR-xo%_^_-f$^6;E zPxzvR9pj8czXdjUJ`;HMGl@5{AvdWqku!P2#bDVk29^x%@5T*mjAw!}UY5wq96#G* zG{4W9`^l+?yB0+pV>lx5`25^64R3F8-?$|Hei26t#}6;@1K%oI6NDBm{(k)RKlXb9 Xa*~Z4)#eL;o@DTJ^>bP0l+XkK>kGmP delta 405 zcmbQqdY@&2W4%^@Plzi61H;+3|7P9#$JBkxW%u93Gb$U3gT#b|&CJYd8)}mx92S4F zKE>?=R90A{>j|XzN`m}?|04qi*8_J>0A)A}JR*yM3J!xX*AN9$J$6Gq3+c>PD<(b8%5K~I*KF4izVYC2{wAAR@bqB2W?#1pwa*U diff --git a/Buffs/StatBuffs/SmashedEvilDebuff.png b/Buffs/StatBuffs/SmashedEvilDebuff.png deleted file mode 100644 index bbc9b3974ac9b7d04d028dd0b83f8e056cf6da82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 607 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCilI0(?STf%N~S9si5Mp92}vtczzcG@7Lh!0?&C&cFgxVPIrzz_dA`QTIO!?}=Y z8?^MeBDa2DDIVQ$vqgY$2mcMlyU(V?>?gTe~DWM4f{PeKa diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index ca833ac265..d187218984 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4968,7 +4968,7 @@ namespace CalamityMod.NPCs ("CalamityMod/Buffs/StatDebuffs/MarkedforDeath", NPC => NPC.Calamity().markedForDeath), ("CalamityMod/Buffs/StatDebuffs/PearlAura", NPC => NPC.Calamity().pearlAura), ("CalamityMod/Buffs/StatDebuffs/ProfanedWeakness", NPC => NPC.Calamity().relicOfResilienceWeakness), - ("CalamityMod/Buffs/StatBuffs/SmashedEvilDebuff", NPC => NPC.HasBuff()), + ("CalamityMod/Buffs/StatBuffs/SmashedEvil", NPC => NPC.HasBuff()), ("CalamityMod/Buffs/StatDebuffs/TemporalSadness", NPC => NPC.Calamity().temporalSadness), ("CalamityMod/Buffs/StatDebuffs/TimeDistortion", NPC => NPC.Calamity().timeDistortion), ("CalamityMod/Buffs/StatDebuffs/WhisperingDeath", NPC => NPC.Calamity().whisperingDeath), diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index 3c29818724..4efddb7d89 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatBuffs; using CalamityMod.DataStructures; using CalamityMod.UI.CalamitasEnchants; using Microsoft.Xna.Framework; @@ -129,6 +130,7 @@ namespace CalamityMod public static Color TypelessDebuffColor => new(230, 202, 250); public static Color VulnHexDebuffColor => new(196, 35, 43); public static Color MiracleBlightDebuffColor => Main.DiscoColor; + public static Color SmashedEvilDebuffColor => Color.Lerp(new Color(162, 88, 231), new Color(221, 66, 97), MathHelper.SmoothStep(0, 1, (MathF.Sin(Main.GlobalTimeWrappedHourly * 2) + 1) * 0.5f)); private static readonly Dictionary> debuffColorWeightsCache = []; @@ -144,6 +146,11 @@ namespace CalamityMod { color = MiracleBlightDebuffColor; } + + else if (debuffId == ModContent.BuffType() && CalamityClientConfig.Instance.TextEffects) + { + color = SmashedEvilDebuffColor; + } else if (BuffDatasets.DebuffDataset[debuffId] is not null) { if (!debuffColorWeightsCache.TryGetValue(debuffId, out var weights)) From fa4d86df538f03a805e57f36aa66e384f7861a6d Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Thu, 19 Feb 2026 16:16:52 -0600 Subject: [PATCH 16/22] slowed dialogue --- CalPlayer/CalamityPlayerMiscEffects.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ba49183932..48d11a0295 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1146,10 +1146,10 @@ namespace CalamityMod.CalPlayer DialogueDisplaySystem.RemoveDialogue(DialogueDisplaySystem.GetSlot(type)); DialogueDisplaySystem.StartDialogueOnClient(type, new Vector2(tilePos.X * 16 + 16, tilePos.Y * 16), DemonAltarDialogueCounter, 180, false, new AltarText()); DemonAltarDialogueCounter++; - DemonAltarDialogueCooldown = 240; + DemonAltarDialogueCooldown = 300; if (DemonAltarDialogueCounter >= 4) { - DemonAltarDialogueCooldown = 1200; + DemonAltarDialogueCooldown = 3600; DemonAltarDialogueCounter = 0; } return; From f718fb8ea83ad9b5b1e986c79037c63d92f23b72 Mon Sep 17 00:00:00 2001 From: HaguriHat <141063931+HaguriHat@users.noreply.github.com> Date: Wed, 25 Feb 2026 02:17:29 -0300 Subject: [PATCH 17/22] Updated dialogue for the altar Self-explanatory. --- ...ialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json | 8 ++++---- .../Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json index 1242c8d8f7..3d667346b9 100644 --- a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json +++ b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json @@ -25,22 +25,22 @@ "Pages": [ { "Lines": [ - "Bearer of the Holy Hammer...[Pause(0.25)] [Wavy:Desirest thou to taste true power?]" + "You, slayer of the flesh tower...[Pause(0.25)] we have an offer fitting of your deeds." ] }, { "Lines": [ - "Your eyes shall be opened...[Pause(0.25)] [Shaking:Ye shall be even as the gods!]" + "We can bestow you might untold...[Pause(0.25)] [Shaking:to grind your enemies to dust!]" ] }, { "Lines": [ - "Yield the hammer unto us upon the altar" + "Simply yield the hammer unto the altar." ] }, { "Lines": [ - "Surrender, and thou shalt surely recieve our might" + "Kneel, and we shall render you the strength." ] } ] diff --git a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json index f49c9b9296..3f632532a3 100644 --- a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json +++ b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json @@ -25,22 +25,22 @@ "Pages": [ { "Lines": [ - "Bearer of the Holy Hammer...[Pause(0.25)] [Wavy:Desirest thou to taste true power?]" + "Bearer of the Holy Hammer...[Pause(0.25)] [Wavy:desirest thou to taste true power?]" ] }, { "Lines": [ - "Your eyes shall be opened...[Pause(0.25)] [Shaking:Ye shall be even as the gods!]" + "Your eyes will be opened...[Pause(0.25)] [Shaking:ye shall be even as the gods!]" ] }, { "Lines": [ - "Yield the hammer unto us upon the altar" + "Yield the hammer unto us upon the altar." ] }, { "Lines": [ - "Surrender, and thou shalt surely recieve our might" + "Surrender, and thou shalt surely receive our might." ] } ] From 4d56f62828f13b4195758eaaf978c4bafe68a145 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Tue, 24 Feb 2026 23:45:50 -0600 Subject: [PATCH 18/22] minor dialogue touchups --- .../Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json | 2 +- .../en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json index 3d667346b9..2b0ab25d50 100644 --- a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json +++ b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json @@ -35,7 +35,7 @@ }, { "Lines": [ - "Simply yield the hammer unto the altar." + "Simply yield the holy hammer unto the altar." ] }, { diff --git a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json index 3f632532a3..bfdd7ae10c 100644 --- a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json +++ b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json @@ -30,7 +30,7 @@ }, { "Lines": [ - "Your eyes will be opened...[Pause(0.25)] [Shaking:ye shall be even as the gods!]" + "Thine eyes shall be opened...[Pause(0.25)] [Shaking:thou shalt be even as the gods!]" ] }, { From 4fd5000ef885b2185364e874103bcdb156eb22c6 Mon Sep 17 00:00:00 2001 From: Doze-Zoze <43045606+Doze-Zoze@users.noreply.github.com> Date: Wed, 25 Feb 2026 10:35:14 -0600 Subject: [PATCH 19/22] Removed build.txt change --- build.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.txt b/build.txt index 047b87641a..5d37989673 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = The Calamity Dev Team -version = 2.1.1 +version = 2.1 displayName = Calamity Mod modReferences = CalamityModMusic homepage = https://calamitymod.com From 0ef95193f4e71c9920c28e584f57673123af8753 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 2 Mar 2026 01:48:21 -0800 Subject: [PATCH 20/22] Final Touches --- Buffs/DamageOverTime/Bane.cs | 50 ++++++++++-------- Buffs/DamageOverTime/Bane.png | Bin 3177 -> 3186 bytes CalPlayer/CalamityPlayer.cs | 15 ++++-- CalPlayer/CalamityPlayerHitHurt.cs | 25 +++++---- CalPlayer/CalamityPlayerLifeRegen.cs | 1 + CalPlayer/CalamityPlayerMiscEffects.cs | 2 - DataStructures/DebuffData.cs | 8 +-- Items/Accessories/Abaddon.cs | 2 +- .../{VoidofExtinction.cs => Apollyon.cs} | 8 +-- .../{VoidofExtinction.png => Apollyon.png} | Bin .../en-US/Mods.CalamityMod.Buffs.hjson | 15 ++++-- .../Mods.CalamityMod.Items.Accessories.hjson | 22 ++++---- NPCs/CalamityGlobalNPC.cs | 13 +++-- Particles/BaneParticle.cs | 2 - Projectiles/Typeless/DebuffSpreadEffect.cs | 19 +++---- 15 files changed, 101 insertions(+), 81 deletions(-) rename Items/Accessories/{VoidofExtinction.cs => Apollyon.cs} (87%) rename Items/Accessories/{VoidofExtinction.png => Apollyon.png} (100%) diff --git a/Buffs/DamageOverTime/Bane.cs b/Buffs/DamageOverTime/Bane.cs index 3c571ed8ed..a31e16ea46 100644 --- a/Buffs/DamageOverTime/Bane.cs +++ b/Buffs/DamageOverTime/Bane.cs @@ -1,6 +1,5 @@ using System; using CalamityMod.DataStructures; -using CalamityMod.Dusts; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -13,6 +12,8 @@ namespace CalamityMod.Buffs.DamageOverTime { public class Bane : ModBuff { + public static Color baneColor1 = new Color(217, 115, 0); + public static Color baneColor2 = new Color(0, 232, 146); public static DebuffData debuffData = new DebuffData() { EnemyLostRegen = 90, @@ -29,16 +30,16 @@ namespace CalamityMod.Buffs.DamageOverTime public static void BaneNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) { var cnpc = npc.Calamity(); - bool effected = (cnpc.abaddonEffected || cnpc.voidOfExtinctionEffected); - bool strong = cnpc.voidOfExtinctionEffected; + bool effected = (cnpc.abaddonEffected || cnpc.apollyonEffected); + bool strong = cnpc.apollyonEffected; int baseDoTValue = (int)debuffData.EnemyLostRegen; if (effected) { foreach (var player in Main.ActivePlayers) { { - float improvedDamage = baseDoTValue * player.Calamity().abaddonDebuffDamage; - if (improvedDamage > baseDoTValue && (player.Calamity().abaddon || player.Calamity().voidOfExtinction)) + float improvedDamage = baseDoTValue * player.Calamity().playerBaneDebuffDamage; + if (improvedDamage > baseDoTValue && (player.Calamity().abaddon || player.Calamity().apollyon)) { baseDoTValue = (int)improvedDamage; } @@ -60,16 +61,20 @@ namespace CalamityMod.Buffs.DamageOverTime internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false) { - // This shouldn't be on players, like ever - Player Player = drawInfo.drawPlayer; - Vector3 light = Color.Lavender.ToVector3(); - Lighting.AddLight(Player.Center, light * 2); + Player player = drawInfo.drawPlayer; + Vector3 light = baneColor1.ToVector3(); + Lighting.AddLight(player.Center, light); - if (Main.rand.NextBool(6)) + float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 9.0f) / MathHelper.Pi); + if (Main.rand.NextBool(20)) { - Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot, ModContent.DustType(), new Vector2(0, Main.rand.NextFloat(-3f, -5f)) + Player.velocity, 0, default, hasDebuffResistance ? 1.1f : 1.6f); - dust.noGravity = true; - dust.color = Color.PaleTurquoise; + bool start = !Main.rand.NextBool(4); + Vector2 baneVel = Vector2.UnitY * Main.rand.NextFloat(-0.5f, -1.5f) * (Main.rand.NextBool(5) ? 2 : 1) + player.velocity * 0.35f; + Vector2 banePos = player.Center + Main.rand.NextVector2Circular(3, 8) + (Vector2.UnitY * 14) + Vector2.UnitY * ((1 - sine) * 2.3f); + Particle baneRunes = new BaneParticle(banePos, baneVel, false, 55, 1f, start ? baneColor1 : baneColor2, start ? baneColor2 : baneColor1, Vector2.One, true, Main.rand.NextBool(3) ? Main.rand.NextFloat(-0.2f, 0.2f) : 0, 0.95f, MathHelper.PiOver2 * Main.rand.Next(4 + 1), sineRate: Main.rand.NextFloat(0.2f, 1f), sineIntensity: Main.rand.Next(14, 19 + 1)); + GeneralParticleHandler.SpawnParticle(baneRunes); + if (Main.rand.NextBool()) + baneRunes.DrawLayer = Enums.GeneralDrawLayer.BeforeNPCs; } } @@ -78,25 +83,28 @@ namespace CalamityMod.Buffs.DamageOverTime Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomRingAngled").Value; Texture2D center = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; Vector2 drawPosition = npc.Center - Main.screenPosition; - Color color = Color.Turquoise; - Color color2 = Color.Orange; + Color color = baneColor1; + Color color2 = baneColor2; float maxSizeMult = 10f; - float widthMult = MathF.Pow(Utils.Remap(npc.width, 10, 500, 1f, maxSizeMult), 0.8f); + float widthMult = MathF.Pow(Utils.Remap(npc.width, 10, 500, 1f, maxSizeMult, false), 0.8f); float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 9.0f) / MathHelper.Pi); float sine2 = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 11.0f) / MathHelper.Pi); float randSize = Main.rand.NextFloat(0.82f, 1.08f); + float clockSine = (float)Math.Sin((float)Math.Pow(Utils.GetLerpValue(0, 110, ((int)(Main.GlobalTimeWrappedHourly * 60) % 120)), 5)); + for (int i = 0; i < 2; i++) { float sizeMult = (i == 0 ? 1 : 0.8f); float colorMult = (i == 0 ? 1 : 0.7f); - Main.EntitySpriteDraw(bloom, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine) * 2.3f), null, Color.Lerp(color, Color.White, i * 0.7f) with { A = 0 } * colorMult, 0, bloom.Size() / 2, new Vector2((sine * 0.09f + 1.2f) * widthMult, 0.9f) * 0.18f * MathF.Pow(randSize, 0.3f), SpriteEffects.None); - Main.EntitySpriteDraw(center, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine2) * 3.3f), null, Color.Lerp(color2, Color.White, i * 0.7f) with { A = 0 } * colorMult, 0, center.Size() / 2, new Vector2((sine2 * 0.09f + 1.2f) * widthMult, 0.6f) * 0.18f * randSize, SpriteEffects.None); + Main.EntitySpriteDraw(bloom, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine) * 2.3f * MathF.Pow(widthMult, 0.55f)), null, Color.Lerp(color2, Color.White, i * 0.7f) with { A = 0 } * colorMult, 0, bloom.Size() / 2, new Vector2((sine * 0.09f + 1.2f) * widthMult, 0.9f) * 0.18f * MathF.Pow(randSize, 0.3f) * npc.Calamity().baneVisual, SpriteEffects.None); + Main.EntitySpriteDraw(center, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine2) * 3.3f * MathF.Pow(widthMult, 0.55f)), null, Color.Lerp(color, Color.White, i * 0.7f) with { A = 0 } * colorMult, 0, center.Size() / 2, new Vector2((sine2 * 0.09f + 1.2f) * widthMult, 0.6f) * 0.18f * randSize * npc.Calamity().baneVisual, SpriteEffects.None); } - - if (Main.rand.NextBool(13)) + + int chance = (int)(13 + 40 * (1 - npc.Calamity().baneVisual)); + if (Main.rand.NextBool(chance)) { - bool start = Main.rand.NextBool(); + bool start = !Main.rand.NextBool(4); Vector2 baneVel = Vector2.UnitY * Main.rand.NextFloat(-0.5f, -1.5f) * widthMult * (Main.rand.NextBool(5) ? 2 : 1) + npc.velocity * 0.35f; Vector2 banePos = npc.Center + Main.rand.NextVector2Circular(3 * widthMult, 8) + (Vector2.UnitY * npc.height / 3f) + Vector2.UnitY * ((1 - sine) * 2.3f); Particle baneRunes = new BaneParticle(banePos, baneVel, false, 55, 1f * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color, Vector2.One, true, Main.rand.NextBool(3) ? Main.rand.NextFloat(-0.2f, 0.2f) : 0, 0.95f, MathHelper.PiOver2 * Main.rand.Next(4 + 1), sineRate: Main.rand.NextFloat(0.2f, 1f), sineIntensity: Main.rand.Next(14, 19 + 1) * widthMult); diff --git a/Buffs/DamageOverTime/Bane.png b/Buffs/DamageOverTime/Bane.png index bec1b0443a8d2ce34093a0d82357b3db4962d76f..f793baae8e587642476934a30959275dfeda3ba3 100644 GIT binary patch delta 430 zcmV;f0a5tneY3~XS~nzyw7Xdwhcfu(&F6wkV@rO3&5&7Kv!q84KUE-HuS|>0k|tx z0Jwj7aGuNO_ukY?-(3KvU01IRZv zWQ7c1G}#2e^mwEu02P=_*8ZgcW~uc9P=SAu!VeJdZFDA>T>z?^k|Y3Wa<$|Ms2`BR z3y@mh1*++GaCzknC>*%}2V)<=_azK3fC`ctl+5A2bIrPYSo6aQP6c1^0n|JyZ6p(b z_zVE4`C;J8lI$!3@OXO?asW-_s~Q3Pq;w4)fO+6Br67~c7R+y)*`P?l0jT@owB8l~ YpTOcalaS(|>Hq)$07*qoM6N<$f)yOkj{pDw delta 421 zcmV;W0b2g@80i?WstOAZ!vFvd!vV){sAQA13MzkfNklF-XHe6o$Vn4nlFt zB#4MOIHrT3II2a#N$B9vIZ$;}2PX%0R12LuI21YwO4U&m9GcNVL_~1PBn1bTb0`nV znM)!{bN*9~yuAO*d+#p9QAz>eI8N`PPf|)b08Z`zfC6xb#}XeH8T9}-YnBq@mdb4a zUY>u0#JKSF3A+JIhC$FtOze5ZOhEPmq#0K?T8RL)!<9@R_5w8O3y}oVv)i#o-H$?K zT^Q)b#@$};MP8udUswuIn%e?keeDhSUTWPiO*)XY=ID3`fcDkCWdP@={+}3U1zB9K zTMqDBV-tw|06Pa^Y=X3pOPb_>+ud~kDS&@TCNMD+xr5`t*EY8gKtG6n3SyFOocSc| zJ3w)!w>_GTRRA9DFB3r|ahk+(); - if ((Player.Calamity().abaddon || Player.Calamity().voidOfExtinction) && (npc.Calamity().abaddonEffected || npc.Calamity().voidOfExtinctionEffected) && hit.Crit && abaddonCooldown == 0 && Player.ownedProjectileCounts[debuffSpreadProj] == 0) + if ((Player.Calamity().abaddon || Player.Calamity().apollyon) && (npc.Calamity().abaddonEffected || npc.Calamity().apollyonEffected) && hit.Crit && abaddonCooldown == 0 && Player.ownedProjectileCounts[debuffSpreadProj] == 0) { - int maxTargetNum = npc.Calamity().voidOfExtinctionEffected ? 10 : 6; + int maxTargetNum = npc.Calamity().apollyonEffected ? 10 : 6; Projectile.NewProjectile(Player.GetSource_FromThis(), npc.Center, Vector2.Zero, debuffSpreadProj, 0, 0, Player.whoAmI, 0, npc.whoAmI, maxTargetNum); abaddonCooldown = -1; // Prevents multiple projectiles hitting on the same frame from spawning multiple of these } diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 07d1553f5a..b181b14c72 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -122,6 +122,7 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player ApplyDoTDebuff(laceration, 36, purity); ApplyDoTDebuff(daybroken, 40, purity); + ApplyDoTDebuff(bane, 40, purity); ApplyDoTDebuff(nightwither, 40, purity); ApplyDoTDebuff(holyFlames, 40, purity); ApplyDoTDebuff(voidfrost, 40, purity); diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ddb7152309..ca31f69ef6 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2241,8 +2241,6 @@ namespace CalamityMod.CalPlayer raiderSoundCooldown--; if (astralStarRainCooldown > 0) astralStarRainCooldown--; - if (AbaddonCooldown > 0) - AbaddonCooldown--; if (VoidCooldown > 0) VoidCooldown--; if (ursaSergeantCooldown > 0) diff --git a/DataStructures/DebuffData.cs b/DataStructures/DebuffData.cs index 743b703740..f988a4dff5 100644 --- a/DataStructures/DebuffData.cs +++ b/DataStructures/DebuffData.cs @@ -1,9 +1,9 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.WorldBuilding; namespace CalamityMod.DataStructures { @@ -224,7 +224,8 @@ namespace CalamityMod.DataStructures .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveElectricDebuffMultiplier, ElectricDebuffScaling) )))) : - cnpc.ActiveTypelessDebuffMultiplier; + // Bane doesn't scale with debuff multipliers. This should be implemented as a default feature you can apply to debuffs at some point. + buffType == ModContent.BuffType() ? cnpc.ActiveTypelessDebuffMultiplier : StatModifier.Default; //Ensure at least 25% effectiveness if (totalScaling.Multiplicative <= 0.25f) @@ -257,7 +258,8 @@ namespace CalamityMod.DataStructures .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveElectricDebuffMultiplier, ElectricDebuffScaling) )))) : - cnpc.ActiveTypelessDebuffMultiplier; + // Bane doesn't scale with debuff multipliers. This should be implemented as a default feature you can apply to debuffs at some point. + buffType == ModContent.BuffType() ? cnpc.ActiveTypelessDebuffMultiplier : StatModifier.Default; //Ensure at least 25% effectiveness if (totalScaling.Multiplicative <= 0.25f) diff --git a/Items/Accessories/Abaddon.cs b/Items/Accessories/Abaddon.cs index 70b9051daf..75eaac9461 100644 --- a/Items/Accessories/Abaddon.cs +++ b/Items/Accessories/Abaddon.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Accessories { Player player = Main.LocalPlayer; if (Main.LocalPlayer != null) - list.FindAndReplace("[DAMAGE]", ((int)(Bane.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonDebuffDamage)).ToString()); + list.FindAndReplace("[DAMAGE]", ((int)(Bane.debuffData.EnemyLostRegen / 2 * player.Calamity().playerBaneDebuffDamage)).ToString()); } } } diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/Apollyon.cs similarity index 87% rename from Items/Accessories/VoidofExtinction.cs rename to Items/Accessories/Apollyon.cs index 76ee843ab2..1003190c09 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/Apollyon.cs @@ -4,12 +4,12 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class VoidofExtinction : ModItem, ILocalizedModType + [LegacyName("VoidofExtinction")] + public class Apollyon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; @@ -37,14 +37,14 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.voidOfExtinction = true; + modPlayer.apollyon = true; modPlayer.abaddonEffectVisual = !hideVisual; } public override void ModifyTooltips(List list) { Player player = Main.LocalPlayer; if (Main.LocalPlayer != null) - list.FindAndReplace("[DAMAGE]", ((int)(Bane.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonDebuffDamage)).ToString()); + list.FindAndReplace("[DAMAGE]", ((int)(Bane.debuffData.EnemyLostRegen / 2 * player.Calamity().playerBaneDebuffDamage)).ToString()); } } } diff --git a/Items/Accessories/VoidofExtinction.png b/Items/Accessories/Apollyon.png similarity index 100% rename from Items/Accessories/VoidofExtinction.png rename to Items/Accessories/Apollyon.png diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 16abe2e012..12ad3c9cbb 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1007,6 +1007,16 @@ ArmorCrunch: { ItemTooltip: Damage Reduction is 15% less effective } +Bane: { + DisplayName: Bane + Description: An ancient curse envelops you + ItemTooltip: + ''' + Typeless - Variable DPS + Does not scale with debuff multipliers + ''' +} + Crumbling: { DisplayName: Crumbling Description: Your armor is damaged @@ -1701,8 +1711,3 @@ CnidarianSummonTagBuff: { DisplayName: Cnidarian Summon Tag Buff Description: you are not seeing this } - -Bane: { - DisplayName: Bane - Description: Mods.CalamityMod.Buffs.Bane.Description -} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index b3abe98aae..199439a01e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -152,6 +152,17 @@ AngelTreads: { ''' } +Apollyon: { + DisplayName: Apollyon + Tooltip: + ''' + Critical strikes curse enemies with [cbuff:CalamityMod/Bane] that greatly scales off of your critical strike chance + When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/Bane] to nearby enemies + Critical strikes deal an additional 3% damage per debuff on the enemy + Current [cbuff:CalamityMod/Bane] damage: [DAMAGE] DPS + ''' +} + AquaticEmblem: { DisplayName: Aquatic Emblem Tooltip: @@ -2058,17 +2069,6 @@ VoidofCalamity: { ''' } -VoidofExtinction: { - DisplayName: Void of Extinction - Tooltip: - ''' - Critical strikes curse enemies with [cbuff:CalamityMod/Bane] that greatly scales off of your critical strike chance - When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/Bane] to nearby enemies - Critical strikes deal an additional 3% damage per debuff on the enemy - Current [cbuff:CalamityMod/Bane] damage: [DAMAGE] DPS - ''' -} - VoltaicJelly: { DisplayName: Voltaic Jelly Tooltip: diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 53e6d80c23..b99e09f691 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -291,6 +291,7 @@ namespace CalamityMod.NPCs public bool irradiated = false; public double irradiatedContactBoost = 1.5; public bool bane = false; + public float baneVisual = 0; public bool brimstoneFlames = false; public bool demonicFlames = false; public int demonicFlamesBonusDamage = 0; @@ -303,7 +304,7 @@ namespace CalamityMod.NPCs public int antlionCloudDebuffTimer = 0; public bool scionsCurioEffected = false; public bool abaddonEffected = false; - public bool voidOfExtinctionEffected = false; + public bool apollyonEffected = false; public int warbannerBurnTime = 0; // Determines the rate that the enemy is damaged public int warbannerBurnTimer = 0; // The duration of the debuff public int warbannerBurnStacks = 0; // The stacks increase how fast the debuff hits @@ -571,6 +572,7 @@ namespace CalamityMod.NPCs myClone.irradiated = irradiated; myClone.irradiatedContactBoost = irradiatedContactBoost; myClone.bane = bane; + myClone.baneVisual = baneVisual; myClone.brimstoneFlames = brimstoneFlames; myClone.demonicFlames = demonicFlames; myClone.demonicFlamesBonusDamage = demonicFlamesBonusDamage; @@ -583,7 +585,7 @@ namespace CalamityMod.NPCs myClone.antlionCloudDebuffTimer = antlionCloudDebuffTimer; myClone.scionsCurioEffected = scionsCurioEffected; myClone.abaddonEffected = abaddonEffected; - myClone.voidOfExtinctionEffected = voidOfExtinctionEffected; + myClone.apollyonEffected = apollyonEffected; myClone.warbannerBurnTime = warbannerBurnTime; myClone.warbannerBurnTimer = warbannerBurnTimer; myClone.warbannerBurnStacks = warbannerBurnStacks; @@ -3215,6 +3217,11 @@ namespace CalamityMod.NPCs } warbannerBurnTime--; } + float fadeSpeed = 0.15f; + if (bane) + baneVisual = MathHelper.Lerp(baneVisual, 1, fadeSpeed); + else if (baneVisual > 0) + baneVisual = MathHelper.Lerp(baneVisual, 0, fadeSpeed); if (veriumDoomTimer > 0) veriumDoomTimer--; @@ -4670,7 +4677,7 @@ namespace CalamityMod.NPCs if (astralInfection) AstralInfectionDebuff.DrawEffects(npc, ref drawColor); - if (bane) + if (bane || baneVisual > 0.05f) Bane.DrawEffects(npc, ref drawColor); // Brimstone Flames and Demonshade Enrage set bonus share the same visual effects diff --git a/Particles/BaneParticle.cs b/Particles/BaneParticle.cs index 6452500cb4..f688eef51e 100644 --- a/Particles/BaneParticle.cs +++ b/Particles/BaneParticle.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -105,7 +104,6 @@ namespace CalamityMod.Particles } public override void CustomDraw(SpriteBatch spriteBatch) { - Texture2D texture = ModContent.Request("CalamityMod/Particles/BaneParticleGlow").Value; int frameWidth = 18; int frameHeight = 18; diff --git a/Projectiles/Typeless/DebuffSpreadEffect.cs b/Projectiles/Typeless/DebuffSpreadEffect.cs index 69c857b6d4..8ab5c80f30 100644 --- a/Projectiles/Typeless/DebuffSpreadEffect.cs +++ b/Projectiles/Typeless/DebuffSpreadEffect.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Typeless public List listNPCs = new List(); public NPC lastNPC; public int minCooldown = 48; - public static Color startingColor = Color.Turquoise; + public static Color startingColor = Bane.baneColor2; public Color mainColor = Color.White; public Color subColor = startingColor; public Color extraColor = Color.White; @@ -48,11 +48,8 @@ namespace CalamityMod.Projectiles.Typeless Projectile.Center = npc.Center; mainColor = Color.White; - bool strong = npc.Calamity().voidOfExtinctionEffected; + bool strong = npc.Calamity().apollyonEffected; float areaOfEffect = (strong ? 1400 : 800); - Color color1 = Color.Crimson; - Color color2 = Color.OrangeRed; - Color color3 = Color.Red; int debuffTime = (strong ? 180 : 120); int startDir = Main.rand.NextBool() ? 1 : -1; @@ -78,10 +75,10 @@ namespace CalamityMod.Projectiles.Typeless if (targeted != null) { - targeted.Calamity().voidOfExtinctionEffected = npc.Calamity().voidOfExtinctionEffected; + targeted.Calamity().apollyonEffected = npc.Calamity().apollyonEffected; targeted.Calamity().abaddonEffected = npc.Calamity().abaddonEffected; - float bestDamage = Owner.Calamity().abaddonDebuffDamage; + float bestDamage = Owner.Calamity().playerBaneDebuffDamage; int heat = 0; Color heatClr = Color.OrangeRed; int sick = 0; @@ -120,7 +117,7 @@ namespace CalamityMod.Projectiles.Typeless if (debuffData.WaterDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, waterClr, 0.65f); water++; } if (new List { heat, sick, cold, shock, water }.Max() == 0) { - mainColor = Color.Orange; + mainColor = Bane.baneColor1; } } } @@ -162,10 +159,6 @@ namespace CalamityMod.Projectiles.Typeless return; } - Color colorAgain = Main.rand.NextBool() ? color2 : color1; - Particle spark2 = new CustomSpark(npc.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, 0.55f, colorAgain * (Owner.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f); - GeneralParticleHandler.SpawnParticle(spark2); - if (Owner.Calamity().abaddonCooldown <= 0) Owner.Calamity().abaddonCooldown = minCooldown * 2; spreadCount--; @@ -256,7 +249,7 @@ namespace CalamityMod.Projectiles.Typeless { Vector2 pos = start; if (u == 0) pos = end; - Particle spark3 = new CustomSpark(pos, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, u != 0 ? 0.7f : 0.55f, mainColor * (Owner.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f); + Particle spark3 = new CustomSpark(pos, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, u != 0 ? 0.7f : 0.55f, (u == 0 ? subColor : mainColor) * (Owner.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f); GeneralParticleHandler.SpawnParticle(spark3); } } From 0ebc653ac43c598d48f7f463e3f9c9cbdcbb291d Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 6 Mar 2026 21:07:59 -0500 Subject: [PATCH 21/22] removed TODO: CooldownRegistry already is a ModSystem --- Cooldowns/CooldownRegistry.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Cooldowns/CooldownRegistry.cs b/Cooldowns/CooldownRegistry.cs index b697488611..e22fb8fb3a 100644 --- a/Cooldowns/CooldownRegistry.cs +++ b/Cooldowns/CooldownRegistry.cs @@ -6,7 +6,6 @@ using Terraria.ModLoader; namespace CalamityMod.Cooldowns { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. public sealed class CooldownRegistry : ModSystem { // Indexed by ushort netID. Contains every registered cooldown. From 8c16eedea5922fccb542c68c8d7560c1469dcd6f Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 7 Mar 2026 12:48:44 -0500 Subject: [PATCH 22/22] Fixed compile error from Abaddon branch merge --- CalPlayer/CalamityPlayerHitHurt.cs | 68 +++++++++++++----------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 878c6651be..38b829bd1e 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -465,6 +465,14 @@ namespace CalamityMod.CalPlayer { if (Player.Calamity().yharimsGift) target.AddBuff(ModContent.BuffType(),120); + + int debuffSpreadProj = ModContent.ProjectileType(); + if ((Player.Calamity().abaddon || Player.Calamity().apollyon) && (target.Calamity().abaddonEffected || target.Calamity().apollyonEffected) && hit.Crit && abaddonCooldown == 0 && Player.ownedProjectileCounts[debuffSpreadProj] == 0) + { + int maxTargetNum = target.Calamity().apollyonEffected ? 10 : 6; + Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, Vector2.Zero, debuffSpreadProj, 0, 0, Player.whoAmI, 0, target.whoAmI, maxTargetNum); + abaddonCooldown = -1; // Prevents multiple projectiles hitting on the same frame from spawning multiple of these + } } #endregion @@ -476,6 +484,28 @@ namespace CalamityMod.CalPlayer //This is essentially 10 AP, but independent of armor amount modifiers.FlatBonusDamage += 5; } + + if (Player.Calamity().apollyon) + { + target.Calamity().apollyonEffected = true; + // Check here for the amount of debuffs on enemy + int numOfDebuffs = 0; + for (int index = 0; index < target.buffType.Length; index++) + { + int type = target.buffType[index]; + var debuffData = BuffDatasets.DebuffDataset[type]; + if (debuffData != null) + numOfDebuffs++; + } + modifiers.CritDamage += Apollyon.critDamageBoostPerDebuff * numOfDebuffs; + } + else if (Player.Calamity().abaddon) + target.Calamity().abaddonEffected = true; + else + { + target.Calamity().abaddonEffected = false; + target.Calamity().apollyonEffected = false; + } } public override void ModifyHitNPCWithItem(Item item, NPC target, ref NPC.HitModifiers modifiers) { @@ -668,45 +698,7 @@ namespace CalamityMod.CalPlayer modifiers.FinalDamage *= BalancingConstants.SummonerCrossClassNerf; } } - - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - #region Abaddon and VoE effects - if (Player.Calamity().apollyon) - { - target.Calamity().apollyonEffected = true; - // Check here for the amount of debuffs on enemy - int numOfDebuffs = 0; - for (int index = 0; index < target.buffType.Length; index++) - { - int type = target.buffType[index]; - var debuffData = BuffDatasets.DebuffDataset[type]; - if (debuffData != null) - numOfDebuffs++; - } - modifiers.CritDamage += Apollyon.critDamageBoostPerDebuff * numOfDebuffs; - } - else if (Player.Calamity().abaddon) - target.Calamity().abaddonEffected = true; - else - { - target.Calamity().abaddonEffected = false; - target.Calamity().apollyonEffected = false; - } - #endregion - } #endregion - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - NPC npc = target; - int debuffSpreadProj = ModContent.ProjectileType(); - if ((Player.Calamity().abaddon || Player.Calamity().apollyon) && (npc.Calamity().abaddonEffected || npc.Calamity().apollyonEffected) && hit.Crit && abaddonCooldown == 0 && Player.ownedProjectileCounts[debuffSpreadProj] == 0) - { - int maxTargetNum = npc.Calamity().apollyonEffected ? 10 : 6; - Projectile.NewProjectile(Player.GetSource_FromThis(), npc.Center, Vector2.Zero, debuffSpreadProj, 0, 0, Player.whoAmI, 0, npc.whoAmI, maxTargetNum); - abaddonCooldown = -1; // Prevents multiple projectiles hitting on the same frame from spawning multiple of these - } - } #region Modify Hit By NPC public override void ModifyHitByNPC(NPC npc, ref Player.HurtModifiers modifiers)