From d4f227078736710f799aa35027fd2da127d6a5cc Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 1 Jun 2024 16:49:55 -0400 Subject: [PATCH] 1 - Nerfed Yellow Candle from 1.07x to 1.04x but it ignores DR again as intended. 2 - Fixed Yellow Candle being placebo, for real this time. --- Buffs/Placeables/CirrusYellowCandleBuff.cs | 10 +++++++++- CalPlayer/CalamityPlayerHitHurt.cs | 18 ++++++++---------- .../Mods.CalamityMod.Items.Placeables.hjson | 4 ++-- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Buffs/Placeables/CirrusYellowCandleBuff.cs b/Buffs/Placeables/CirrusYellowCandleBuff.cs index 69a60673c7..69fd6f35c9 100644 --- a/Buffs/Placeables/CirrusYellowCandleBuff.cs +++ b/Buffs/Placeables/CirrusYellowCandleBuff.cs @@ -1,12 +1,13 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; +using static Terraria.NPC; namespace CalamityMod.Buffs.Placeables { public class CirrusYellowCandleBuff : ModBuff { - public static float ExtraChipDamageRatio = 0.07f; + public static float ExtraChipDamageRatio = 0.04f; public override void SetStaticDefaults() { @@ -25,5 +26,12 @@ namespace CalamityMod.Buffs.Placeables // Implementation is performed elsewhere using the yellowCandle bool. public override void Update(Player player, ref int buffIndex) => player.Calamity().yellowCandle = true; + + // Yellow Candle is implemented as a dirty modifier. + internal static void ModifyHitInfo_Spite(ref HitInfo info) + { + int damageBoost = (int)(info.SourceDamage * ExtraChipDamageRatio); + info.Damage += damageBoost; + } } } diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 456ca387b0..aca930da03 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -525,14 +525,13 @@ namespace CalamityMod.CalPlayer // Apply all Calamity multipliers as a sum total to TML New Damage in a single step modifiers.SourceDamage *= totalDamageMult; - // 31MAY2024: Ozzatron: apply Yellow Candle "chip damage" in a different way, by adjusting FinalDamage.Base - // This is still gated by the old conditionals to ensure it doesn't apply to "near invincible" targets - // Calamity's DR is also implemented at the FinalDamage step as a multiplier so Yellow Candle doesn't ignore DR anymore (and has been buffed to compensate) + // 01JUN2024: Ozzatron: apply Yellow Candle "chip damage" as a dirty modifier + // The registration of the dirty modifier is conditional to ensure it doesn't apply to "near invincible" targets // - // FinalDamage.Flat would technically be closer to the intended implementation, but is heavily discouraged from use and would cause huge cross-mod issues + // FinalDamage cannot be used for the intended effect because there is no way to access the actual damage of the hit CalamityGlobalNPC cgn = target.Calamity(); if (yellowCandle && cgn.DR < 0.99f && target.takenDamageMultiplier > 0.05f) - modifiers.FinalDamage.Base *= 1f + CirrusYellowCandleBuff.ExtraChipDamageRatio; + modifiers.ModifyHitInfo += CirrusYellowCandleBuff.ModifyHitInfo_Spite; // Excalibur and True Excalibur deal +100% damage to targets above 75% HP. if (item.type == ItemID.Excalibur || item.type == ItemID.TrueExcalibur) @@ -600,14 +599,13 @@ namespace CalamityMod.CalPlayer // Apply all Calamity multipliers as a sum total to TML New Damage in a single step modifiers.SourceDamage *= totalDamageMult; - // 31MAY2024: Ozzatron: apply Yellow Candle "chip damage" in a different way, by adjusting FinalDamage.Base - // This is still gated by the old conditionals to ensure it doesn't apply to "near invincible" targets - // Calamity's DR is also implemented at the FinalDamage step as a multiplier so Yellow Candle doesn't ignore DR anymore (and has been buffed to compensate) + // 01JUN2024: Ozzatron: apply Yellow Candle "chip damage" as a dirty modifier + // The registration of the dirty modifier is conditional to ensure it doesn't apply to "near invincible" targets // - // FinalDamage.Flat would technically be closer to the intended implementation, but is heavily discouraged from use and would cause huge cross-mod issues + // FinalDamage cannot be used for the intended effect because there is no way to access the actual damage of the hit CalamityGlobalNPC cgn = target.Calamity(); if (yellowCandle && cgn.DR < 0.99f && target.takenDamageMultiplier > 0.05f) - modifiers.FinalDamage.Base *= 1f + CirrusYellowCandleBuff.ExtraChipDamageRatio; + modifiers.ModifyHitInfo += CirrusYellowCandleBuff.ModifyHitInfo_Spite; // Stealth strike damage multipliers are applied here. // TODO -- stealth should be its own damage class and this should be applied as player StealthDamage *= XYZ diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 11eecccc2e..8f64b995fd 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -750,8 +750,8 @@ SpitefulCandle: { DisplayName: Spiteful Candle Tooltip: ''' - when placed to deal 1.07x damage to all enemies - The extra 0.07x damage bypasses enemy defense + when placed to deal 1.04x damage to all enemies + The extra 0.04x damage bypasses enemy defense and damage reduction This cannot be stacked with other Cirrus Candle buffs 'Its hateful glow flickers with ire' '''