From a581506930485611111f05107e665c60a23b136c Mon Sep 17 00:00:00 2001 From: Xyk Date: Tue, 6 Jan 2026 02:58:51 -0800 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 fefcf58aac1891e39ce7c87f35bdb3bdce4e01dc Mon Sep 17 00:00:00 2001 From: Xyk Date: Wed, 11 Feb 2026 22:07:18 -0800 Subject: [PATCH 4/9] 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 5/9] 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 zcmV-v43_hWP)f6 zXi@@54ZTQ_E-Enz5K6$103tR-RB%L5k){YTDBysjLy@r}iiH7DvFijGMAUI`6dRUF zWUU$Bym{}eS9UO(Z2>7`&z9wUXbV-Il#&6`Y8GKGQ04S2&F6MJnW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|*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 zcmV-&3yt)NP)f6 zXi@@54ZTQ_E-Enz5K6$103tR-RB%L5k){YTDBysjLy@r}iiH7DvFijGMAUI`6dRUF zWUU$Bym{}eS9UO(Z2>7`&z9wUXbV-Il#&6`Y8GKGQ04S2&F6MJnWNa;Ck|;8QE#r9r;7G||@X{|> z%+C|c55>;RS}qbKr-&IQTvLXPlM{>K&(BTgi^a?^4mXV>;xX8n8Ce|RasXz}{8imI52H3ZN4bfe_i~WlJ|C&UW9+{8AKoW!}eExnGFE2re(F+`iE_46#!l9 z0Z_aBhs|Iw0E)7{bq;-T9=d#9QpDmcXDh4R++0fmpKB>E=%Ld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Jp-4Km~m7{5vB?IGPN`FGKaIwvx>8%%bb_(Ts9>N z5;bK**^9Ef#WdN^)PTf9vR*Qp{o-l7 zTcBI8wqSIn=gRt3(5j`YdRObOE?Pal#&6AmwS={4Ykw%TE-Wv6xh`g1Pmxy9nxe7w ze(PI{6^cd0H#WFzsN0CzDA+i-Y3`<~O&?2mB^OJrODjs>Z{}{k_?699m0x|@lC)*8 z%%N=0R?Jr6*6Z8cw;d=~F3&F?+a9vLa|dHb$&Qyhm+ZVyVOLSNi?B>BD~Ee(8aT1AWbo&CM;EEoH56tE6@EV8X%6-*|u1-NtOIZ>P7H z9s-9XhaP{M`0e$>L5F*fu#U8SXZT%h2eqT56Y5;vIn|ZYCGC#u9zGg)w718lr{jCe z@An_mJyvsE<#^c%!il02pHAkVoIaIx>gnm^(__6$dheWxJ#(!uyl?Pq(Ao3ne9xWf z_v}A;-u3*k3(gmgUSwVDy5w-FbHIL};|Kd6ItCpEJBJ*Hx-UCj?irppeBz4xmD5+f zub#UWaP88_{E^}7QP*$YNVp-r$-DXJR{E{yw{vdK+*xxMeYfPE(!GlNn)e%iH2tw% z>L5Kn>ODH}V8MesW8ASPKV|>)e!S=*`C-L`&P4Mg+egPHeJ3wJUif(YN!F8@r^P=j z|6Kdbc>FRj6+1QlT=e|YubW?}zu5oM?q%0Dy!50Qvv` z0D$NK0Cg|`0P0`>06Lfe02gqax=}m;000SaNLh0L01FZT01FZU(%pXi0000RbVXQn zQ*UN;cVTj607GSLb9r+hQ*?D?X>TA@Z*OeDr{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..afbabdf11cafd7bbcafb26b5dea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v` 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 zcmeHt=UWqBv^7=~6{Jg7Kzb2GkgoLJ2|Y*&(n7BZMWsnqx^zQF2pAvOiE+&9|?0Uz3p`KHWRFyG2GuA?2d1Y~X98uJl+_RasI@T2fM2TttkFOd~cg zBhbVc&k!?!k-`|HJd8^lbaOVkuJHh)kt`x0cK4yykI!VBk}4)%Du&6Wcf|Sryem>p zMsUVOT{A?i-(*r5_4cA;$>lH-nHYOs%A4grMeFx`K}qQLKhx^xwD=$nNcG(nvI;rO0#Qlt ziATyY;e7l5g0>f@c^49;X<8GK-!L(*+&OL(Z{=}_@Y9Tb)#bT}U<%QbB;!k&7FqT+ zc61kZNZ}LzAiNMv_D7?~c6(UV{PzGYj;gc&x1|UTciBfK9&6+1#8le&`GEo5mH5uz z&nTr5x&DexW-(c?&ijx#4V+uh1%sJtIb|nbO22#t76!NSjfUHt=cF73WB?<>HWfJPmEh29EQPET8F zUn_9q7yY+&T0j}DY#TCQ)H<`ZWEZrT`ZC2&Oc^NU;RGpF>FDn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.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 6/9] 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 7/9] 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 8/9] 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 0ef95193f4e71c9920c28e584f57673123af8753 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 2 Mar 2026 01:48:21 -0800 Subject: [PATCH 9/9] 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); } }