From aefd3a40466a3f3a2660419155ace063660b09da Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Wed, 4 Dec 2024 01:55:36 +0700 Subject: [PATCH] alcohols make you look drunk ...and apparently better at fishing --- Buffs/CalamityGlobalBuff.cs | 6 ++++++ CalPlayer/CalamityPlayerLifeRegen.cs | 11 +++++++++++ CalPlayer/CalamityPlayerMiscEffects.cs | 10 +--------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 0d4b39fe67..4d17ef4b27 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -48,6 +48,12 @@ namespace CalamityMod.Buffs { player.moveSpeed -= 0.1f; } + else if (type == BuffID.Tipsy) + { + player.statDefense += 4; + player.GetCritChance() -= 2; + player.GetAttackSpeed() -= 0.1f; + } else if (type == BuffID.WellFed) { player.moveSpeed -= 0.15f; diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index f14255bf37..0dbf90f24b 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -216,6 +216,17 @@ namespace CalamityMod.CalPlayer if (evergreenGin) totalNegativeLifeRegen += EvergreenGin.RegenLoss; + // Blanket effect for all alcohols + if (alcoholPoisonLevel > 0) + { + // This applies the tipsy eyes effect + Player.tipsy = true; + + // This one is checked through a buff so we have to counter that + if (!Player.HasBuff(BuffID.Tipsy)) + Player.fishingSkill += 5; + + } if (alcoholPoisonLevel > (cirrusDress ? 5 : 3)) { // Independently of Calamity's nerfs to Nebula life regen, it is disabled entirely by alcohol poisoning. diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 3c6b9ea86b..081398fa07 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3133,14 +3133,6 @@ namespace CalamityMod.CalPlayer if (whiteWine) Player.GetDamage() += WhiteWine.MagicDamageBoost; - // Adjustment to the Tipsy debuff - if (Player.tipsy) - { - Player.statDefense += 4; - Player.GetCritChance() -= 2; - Player.GetAttackSpeed() -= 0.1f; - } - if (giantPearl) { if (Main.netMode != NetmodeID.MultiplayerClient) @@ -4413,7 +4405,7 @@ namespace CalamityMod.CalPlayer Player.statDefense -= (int)(Player.statDefense * WhiteWine.DefenseLossPercent); } - if (Player.tipsy) + if (Player.HasBuff(BuffID.Tipsy)) { if (Player.statDefense > 0) Player.statDefense -= (int)(Player.statDefense * 0.05);