From f8edd7d4c3618c5872206994ffa08a404511ef7f Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Wed, 15 Jun 2022 13:11:39 -0400 Subject: [PATCH] 1 - Stress Pills rework. They now make Adrenaline generate 20% faster. 2 - Occult Skull Crown inherits this change 3 - Buffed DH Nanomachines healing by 50% and improved tooltip As a note, Stress Pills works with DH and during SCal fight. --- CalPlayer/CalamityPlayer.cs | 6 +----- CalPlayer/CalamityPlayerMiscEffects.cs | 17 +++++++++++++---- Items/Accessories/DraedonsHeart.cs | 25 +++++++++++++++---------- Items/Accessories/OccultSkullCrown.cs | 2 +- Items/Accessories/StressPills.cs | 8 ++++---- 5 files changed, 34 insertions(+), 24 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 38d3a68ee8..2e565380e5 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -6034,11 +6034,7 @@ namespace CalamityMod.CalPlayer // Being hit for zero from Paladin's Shield damage share does not cancel Adrenaline. // Adrenaline is not lost when hit if using Draedon's Heart. if (!draedonsHeart && !adrenalineModeActive && damage > 0) - { - adrenaline -= stressPills ? adrenalineMax / 2 : adrenalineMax; - if (adrenaline < 0) - adrenaline = 0; - } + adrenaline = 0f; // If using Draedon's Heart and not actively healing with Nanomachines, pause generation briefly. if (draedonsHeart && !adrenalineModeActive) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 82f50c6dae..656c8b2bbc 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -420,7 +420,7 @@ namespace CalamityMod.CalPlayer // If using Draedon's Heart, you get healing instead of damage. if (draedonsHeart) { - Player.statLife += DraedonsHeart.NanomachinesHeal / DraedonsHeart.NanomachinesDuration; + Player.statLife += DraedonsHeart.NanomachinesHealPerFrame; if (Player.statLife >= Player.statLifeMax2) Player.statLife = Player.statLifeMax2; @@ -450,9 +450,18 @@ namespace CalamityMod.CalPlayer adrenalineDiff = -adrenalineMax / AdrenalineFadeTime; } - // In the SCal fight, adrenaline charges 33% slower (meaning it takes 50% longer to fully charge it). - if (SCalAlive && adrenalineDiff > 0f) - adrenalineDiff *= 0.67f; + // Adjustments to how fast Adrenaline charges + if (adrenalineDiff > 0f) + { + // Stress Pills make Adrenaline charge 20% faster (meaning it takes 83.333% standard time to charge it). + if (stressPills) + adrenalineDiff *= 1.2f; + + // In the SCal fight, adrenaline charges 33% slower (meaning it takes 50% longer to fully charge it). + if (SCalAlive) + adrenalineDiff *= 0.67f; + } + // Apply the adrenaline change and cap adrenaline in both directions. // Changes are only applied if the Adrenaline mechanic is available. diff --git a/Items/Accessories/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index c27d0088c6..090f785df7 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -16,24 +16,29 @@ namespace CalamityMod.Items.Accessories // Duration of Nanomachines in frames. internal static readonly int NanomachinesDuration = 120; - + // Health gained per frame while using Nanomachines. + internal static readonly int NanomachinesHealPerFrame = 3; // Duration of time where Nanomachines won't accumulate after taking damage, in frames. - internal static readonly int NanomachinePauseAfterDamage = 240; - - internal static readonly int NanomachinesHeal = 240; + internal static readonly int NanomachinePauseAfterDamage = 60; public override void SetStaticDefaults() { SacrificeTotal = 1; DisplayName.SetDefault("Draedon's Heart"); - Tooltip.SetDefault("15% reduced contact damage from enemies\n" + - "Reduces defense damage taken by 50%\n" + "Replaces Adrenaline with the Nanomachines meter\n" + - $"Unlike Adrenaline, you lose no Nanomachines when you take damage, but they stop accumulating for {NanomachinePauseAfterDamage / 60} seconds\n" + - $"With full Nanomachines, press & to heal {NanomachinesHeal} health over {NanomachinesDuration / 60} seconds\n" + - "While healing, you take &% less damage\n" + - "'Nanomachines, son.'"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 11)); ItemID.Sets.AnimatesAsSoul[Type] = true; + + string seconds = NanomachinePauseAfterDamage == 60 ? "second" : "seconds"; + string pauseDurationTooltip = $"{NanomachinePauseAfterDamage / 60} {seconds}"; + string totalHealTooltip = $"{NanomachinesHealPerFrame * NanomachinesDuration}"; + string healDurationTooltip = $"{NanomachinesDuration / 60}"; + + Tooltip.SetDefault("15% reduced contact damage from enemies\n" + + "Reduces defense damage taken by 50%\n" + "Replaces Adrenaline with the Nanomachines meter\n" + + $"Unlike Adrenaline, you lose no Nanomachines when you take damage, but they stop accumulating for {pauseDurationTooltip}\n" + + $"With full Nanomachines, press & to heal {totalHealTooltip} health over {healDurationTooltip} seconds\n" + + "While healing, you take &% less damage\n" + + "'Nanomachines, son.'"); } public override void SetDefaults() diff --git a/Items/Accessories/OccultSkullCrown.cs b/Items/Accessories/OccultSkullCrown.cs index bea0866221..1afc0b3e2b 100644 --- a/Items/Accessories/OccultSkullCrown.cs +++ b/Items/Accessories/OccultSkullCrown.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories "Converts certain debuffs into buffs and extends their durations\n" + "Debuffs affected: Darkness, Blackout, Confused, Slow, Weak, Broken Armor,\n" + "Armor Crunch, War Cleave, Chilled, Ichor and Obstructed\n" + - "Getting hit causes you to only lose half of your max adrenaline rather than all of it\n" + + "Adrenaline charges 20% faster\n" + "Increases your max movement speed and acceleration by 5%\n" + "Can also be worn as a helmet\n" + "Revengeance item"); diff --git a/Items/Accessories/StressPills.cs b/Items/Accessories/StressPills.cs index d241a6cd15..7fbc8f4c7a 100644 --- a/Items/Accessories/StressPills.cs +++ b/Items/Accessories/StressPills.cs @@ -11,15 +11,16 @@ namespace CalamityMod.Items.Accessories { SacrificeTotal = 1; DisplayName.SetDefault("Stress Pills"); - Tooltip.SetDefault("Boosts your defense by 4 and max movement speed and acceleration by 5%\n" + - "Receiving a hit causes you to only lose 50% of your max adrenaline rather than all of it\n" + - "Revengeance drop"); + Tooltip.SetDefault("Adrenaline charges 20% faster\n" + + "Increases your max movement speed and acceleration by 5%\n" + + "Revengeance drop"); } public override void SetDefaults() { Item.width = 26; Item.height = 26; + Item.defense = 4; Item.value = CalamityGlobalItem.Rarity3BuyPrice; Item.rare = ItemRarityID.Orange; Item.accessory = true; @@ -27,7 +28,6 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.statDefense += 4; CalamityPlayer modPlayer = player.Calamity(); modPlayer.stressPills = true; }