From 60ff7b44a1dc9e359a4b0fef601cfb44ac7cb586 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sun, 18 Dec 2022 22:59:08 -0600 Subject: [PATCH] Reworked Trinket of Chi. --- Buffs/StatBuffs/ChiBuff.cs | 4 +-- CalPlayer/CalamityPlayer.cs | 7 ++++-- CalPlayer/CalamityPlayerMiscEffects.cs | 34 +++++++++----------------- Items/Accessories/TrinketofChi.cs | 14 ++++++++--- 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/Buffs/StatBuffs/ChiBuff.cs b/Buffs/StatBuffs/ChiBuff.cs index 2fe1aadb81..7e65cdb5f5 100644 --- a/Buffs/StatBuffs/ChiBuff.cs +++ b/Buffs/StatBuffs/ChiBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs @@ -8,7 +8,7 @@ namespace CalamityMod.Buffs.StatBuffs public override void SetStaticDefaults() { DisplayName.SetDefault("Chi"); - Description.SetDefault("Your next attack is boosted and you are more resilient"); + Description.SetDefault("You are more resilient"); Main.buffNoTimeDisplay[Type] = true; Main.debuff[Type] = false; Main.pvpBuff[Type] = true; diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index a01305356c..c273c1f88c 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4590,7 +4590,7 @@ namespace CalamityMod.CalPlayer } if (trinketOfChiBuff) - contactDamageReduction += 0.15; + contactDamageReduction += 0.1; // Fearmonger set provides 15% multiplicative DR that ignores caps during the Holiday Moons. // To prevent abuse, this effect does not work if there are any bosses alive. @@ -4865,7 +4865,7 @@ namespace CalamityMod.CalPlayer } if (trinketOfChiBuff) - projectileDamageReduction += 0.15; + projectileDamageReduction += 0.1; // Fearmonger set provides 15% multiplicative DR that ignores caps during the Holiday Moons. // To prevent abuse, this effect does not work if there are any bosses alive. @@ -5709,6 +5709,9 @@ namespace CalamityMod.CalPlayer hellbornBoost = 0; + if (trinketOfChi) + chiBuffTimer = 0; + if (amidiasBlessing && damage > 50) { Player.ClearBuff(ModContent.BuffType()); diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index f076fe94cd..24c424111a 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2049,29 +2049,6 @@ namespace CalamityMod.CalPlayer // Rogue Stealth UpdateRogueStealth(); - // Trinket of Chi bonus - if (trinketOfChi) - { - if (trinketOfChiBuff) - { - Player.GetDamage() += 0.5f; - if (Player.itemAnimation > 0) - chiBuffTimer = 0; - } - - if (Player.StandingStill(0.1f) && !Player.mount.Active) - { - if (chiBuffTimer < 60) - chiBuffTimer++; - else - Player.AddBuff(ModContent.BuffType(), 6); - } - else - chiBuffTimer--; - } - else - chiBuffTimer = 0; - // Aquatic Emblem bonus if (aquaticEmblem) { @@ -2376,6 +2353,17 @@ namespace CalamityMod.CalPlayer else titanBoost = 0; + // Trinket of Chi bonus + if (trinketOfChi) + { + if (chiBuffTimer < TrinketofChi.ChiBuffTimerMax) + chiBuffTimer++; + else + Player.AddBuff(ModContent.BuffType(), 6); + } + else + chiBuffTimer = 0; + if (darkSunRing) { Player.maxMinions += 2; diff --git a/Items/Accessories/TrinketofChi.cs b/Items/Accessories/TrinketofChi.cs index 2e206ce1f0..da4fc4c9fe 100644 --- a/Items/Accessories/TrinketofChi.cs +++ b/Items/Accessories/TrinketofChi.cs @@ -2,18 +2,20 @@ using Terraria; using Terraria.ModLoader; using Terraria.ID; +using CalamityMod.Buffs.StatBuffs; namespace CalamityMod.Items.Accessories { public class TrinketofChi : ModItem { + internal const int ChiBuffTimerMax = 900; + public override void SetStaticDefaults() { SacrificeTotal = 1; DisplayName.SetDefault("Trinket of Chi"); - Tooltip.SetDefault("After 1 second of standing still and not attacking you gain a buff\n" + - "This buff boosts your damage by 50% and decreases damage taken by 15%\n" + - "The buff deactivates after you move or attack once"); + Tooltip.SetDefault("Provides 10% damage reduction after not being hit for 15 seconds, this is removed when you are hit\n" + + "Provides 2 life regen for you and everyone on your team"); } public override void SetDefaults() @@ -29,6 +31,12 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.trinketOfChi = true; + player.lifeRegen += 2; + if (player.whoAmI != Main.myPlayer && player.miscCounter % 10 == 0) + { + if (Main.LocalPlayer.team == player.team && player.team != 0) + Main.LocalPlayer.lifeRegen += 2; + } } } }