From cc1044a468b0da7bdf0b9837be6f99aede3c4b63 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Mon, 2 Jun 2025 21:14:44 -0500 Subject: [PATCH 01/12] Grape Beer, Evergreen Gin, Fireball, Vodka, Screwdriver, Tequila, Purple Haze --- Buffs/Alcohol/EvergreenGinBuff.cs | 9 +- Buffs/Alcohol/FireballBuff.cs | 6 +- Buffs/Alcohol/GrapeBeerBuff.cs | 4 +- Buffs/Alcohol/PurpleHazeBuff.cs | 2 +- Buffs/Alcohol/ScrewdriverBuff.cs | 5 +- Buffs/Alcohol/TequilaBuff.cs | 6 +- Buffs/Alcohol/VodkaBuff.cs | 9 +- CalPlayer/CalamityPlayer.cs | 23 +++-- CalPlayer/CalamityPlayerHitHurt.cs | 7 -- CalPlayer/CalamityPlayerLifeRegen.cs | 26 ----- CalPlayer/CalamityPlayerMiscEffects.cs | 97 +------------------ Items/Potions/Alcohol/EvergreenGin.cs | 6 +- Items/Potions/Alcohol/Fireball.cs | 6 +- Items/Potions/Alcohol/GrapeBeer.cs | 9 +- Items/Potions/Alcohol/PurpleHaze.cs | 7 +- Items/Potions/Alcohol/Rum.cs | 7 +- Items/Potions/Alcohol/Screwdriver.cs | 6 +- Items/Potions/Alcohol/Tequila.cs | 9 +- Items/Potions/Alcohol/Vodka.cs | 8 +- .../Mods.CalamityMod.Items.Potions.hjson | 79 ++++++++------- Projectiles/CalamityGlobalProjectile.cs | 11 +++ Utilities/PlayerUtils.cs | 9 -- Utilities/ProjectileUtils.cs | 2 +- 23 files changed, 125 insertions(+), 228 deletions(-) diff --git a/Buffs/Alcohol/EvergreenGinBuff.cs b/Buffs/Alcohol/EvergreenGinBuff.cs index 78f79db5cb..cf6a11e6b6 100644 --- a/Buffs/Alcohol/EvergreenGinBuff.cs +++ b/Buffs/Alcohol/EvergreenGinBuff.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Potions.Alcohol; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,8 +18,10 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { player.Calamity().evergreenGin = true; - player.Calamity().SicknessDebuffMultiplier += 0.25f; - player.Calamity().WaterDebuffMultiplier += 0.25f; + player.Calamity().SicknessDebuffMultiplier += EvergreenGin.DebuffBoost; + player.Calamity().WaterDebuffMultiplier += EvergreenGin.DebuffBoost; + player.Calamity().ElectricDebuffMultiplier -= EvergreenGin.DebuffLoss; + player.Calamity().HeatDebuffMultiplier -= EvergreenGin.DebuffLoss; } } } diff --git a/Buffs/Alcohol/FireballBuff.cs b/Buffs/Alcohol/FireballBuff.cs index 47f5bfbf06..7f4f22cf9b 100644 --- a/Buffs/Alcohol/FireballBuff.cs +++ b/Buffs/Alcohol/FireballBuff.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Potions.Alcohol; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,7 +18,8 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { player.Calamity().fireball = true; - player.Calamity().HeatDebuffMultiplier += 0.25f; + player.Calamity().HeatDebuffMultiplier += Fireball.DebuffBoost; + player.Calamity().SicknessDebuffMultiplier -= Fireball.DebuffLoss; } } } diff --git a/Buffs/Alcohol/GrapeBeerBuff.cs b/Buffs/Alcohol/GrapeBeerBuff.cs index bc2c68c76f..433d86a78c 100644 --- a/Buffs/Alcohol/GrapeBeerBuff.cs +++ b/Buffs/Alcohol/GrapeBeerBuff.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Potions.Alcohol; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,6 +18,7 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { player.Calamity().grapeBeer = true; + player.GetCritChance() -= GrapeBeer.CritLoss; } } } diff --git a/Buffs/Alcohol/PurpleHazeBuff.cs b/Buffs/Alcohol/PurpleHazeBuff.cs index 9ef31ce2b1..95aa4b7330 100644 --- a/Buffs/Alcohol/PurpleHazeBuff.cs +++ b/Buffs/Alcohol/PurpleHazeBuff.cs @@ -4,7 +4,7 @@ using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol { - public class PurpleHazeBuff : ModBuff + public class PurpleHazeBuff : ModBuff //FIX THIS DOZE - Hybrid Stealth { public override void SetStaticDefaults() { diff --git a/Buffs/Alcohol/ScrewdriverBuff.cs b/Buffs/Alcohol/ScrewdriverBuff.cs index 1487717507..e0e58f9ecf 100644 --- a/Buffs/Alcohol/ScrewdriverBuff.cs +++ b/Buffs/Alcohol/ScrewdriverBuff.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Potions.Alcohol; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,6 +18,8 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { player.Calamity().screwdriver = true; + player.Calamity().ColdDebuffMultiplier += Screwdriver.DebuffBoost; + player.Calamity().WaterDebuffMultiplier -= Screwdriver.DebuffLoss; } } } diff --git a/Buffs/Alcohol/TequilaBuff.cs b/Buffs/Alcohol/TequilaBuff.cs index ac8b8cb4c0..c8652b5fb7 100644 --- a/Buffs/Alcohol/TequilaBuff.cs +++ b/Buffs/Alcohol/TequilaBuff.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Potions.Alcohol; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,6 +18,9 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { player.Calamity().tequila = true; + + player.Calamity().ElectricDebuffMultiplier += Tequila.DebuffBoost; + player.Calamity().ColdDebuffMultiplier -= Tequila.DebuffLoss; } } } diff --git a/Buffs/Alcohol/VodkaBuff.cs b/Buffs/Alcohol/VodkaBuff.cs index 851c0cecca..fee30c6753 100644 --- a/Buffs/Alcohol/VodkaBuff.cs +++ b/Buffs/Alcohol/VodkaBuff.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Potions.Alcohol; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,6 +18,12 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { player.Calamity().vodka = true; + player.Calamity().TypelessDebuffMultiplier += Vodka.DebuffBoost; + player.Calamity().HeatDebuffMultiplier -= Vodka.DebuffLoss; + player.Calamity().ColdDebuffMultiplier -= Vodka.DebuffLoss; + player.Calamity().SicknessDebuffMultiplier -= Vodka.DebuffLoss; + player.Calamity().WaterDebuffMultiplier -= Vodka.DebuffLoss; + player.Calamity().ElectricDebuffMultiplier -= Vodka.DebuffLoss; } } } diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 4d385ddeb0..b29f87659e 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1333,6 +1333,7 @@ namespace CalamityMod.CalPlayer public bool isNearbyBoss = false; public bool flaskBrimstone = false; public bool purpleHaze = false; + public int purpleHazeStealthTimer = 0; public bool mushy = false; public bool PinkJellyRegen = false; public bool GreenJellyRegen = false; @@ -1359,6 +1360,7 @@ namespace CalamityMod.CalPlayer public bool vodka = false; public bool redWine = false; public bool grapeBeer = false; + public int grapeBeerTimer = 0; public bool moonshine = false; public bool rum = false; public bool whiskey = false; @@ -2557,6 +2559,8 @@ namespace CalamityMod.CalPlayer amidiasBlessing = false; flaskBrimstone = false; purpleHaze = false; + if (purpleHazeStealthTimer > 0) + purpleHazeStealthTimer--; shine = false; anechoicCoating = false; mushy = false; @@ -2573,6 +2577,8 @@ namespace CalamityMod.CalPlayer vodka = false; redWine = false; grapeBeer = false; + if (grapeBeerTimer > 0) + grapeBeerTimer--; moonshine = false; rum = false; whiskey = false; @@ -4598,15 +4604,6 @@ namespace CalamityMod.CalPlayer // Adding to StatModifier adds to the additive multiplier bool rogue = item.CountsAsClass(); - if (whiskey) - knockback += Whiskey.KnockbackBoost; - - if (tequila && Main.dayTime) - knockback += Tequila.KnockbackBoost; - - if (tequilaSunrise && Main.dayTime) - knockback += TequilaSunrise.KnockbackBoost; - if (moscowMule) knockback += MoscowMule.KnockbackBoost; @@ -4796,7 +4793,13 @@ namespace CalamityMod.CalPlayer { if (bladeArmEnchant) return false; - + if (purpleHaze) + { + if (item.CountsAsClass() && StealthStrikeAvailable()) + { + purpleHazeStealthTimer = 300; + } + } if (veneratedLocket) { var LocketSource = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index cbf460a587..3e66416f5b 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -628,13 +628,6 @@ namespace CalamityMod.CalPlayer if (proj.Calamity().stealthStrike && proj.CountsAsClass()) modifiers.SourceDamage *= (float)bonusStealthDamage + 1; // Default bonusStealthDamage is 0, a 1 has to be added to take the damage of the weapon. - // Screwdriver adds 5% bonus damage to all piercing projectiles. - if (screwdriver) - { - if (proj.penetrate > 1 || proj.penetrate == -1) - modifiers.ScalingBonusDamage += Screwdriver.PiercingDamageBuff; - } - // Calamity buffs Inferno Fork by 20%. This is multiplicative because it's supposed to be a buff to the weapon's base damage. // However, because the weapon is coded like spaghetti, you have to multiply the explosion's damage too. if (proj.type == ProjectileID.InfernoFriendlyBlast) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 48515d1261..aa2b2cbbe1 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -194,34 +194,10 @@ namespace CalamityMod.CalPlayer if (AlcoholsDict.TryGet(buff, out var level)) alcoholPoisonLevel += level; } - if (vodka) - totalNegativeLifeRegen += Vodka.RegenLoss; - if (redWine) - totalNegativeLifeRegen += baguette ? Baguette.RedWineBuffedRegenLoss : RedWine.RegenLoss; if (moonshine) totalNegativeLifeRegen += Moonshine.RegenLoss; - if (fireball) - totalNegativeLifeRegen += Fireball.RegenLoss; if (everclear) totalNegativeLifeRegen += Everclear.RegenLoss; - if (bloodyMary) - totalNegativeLifeRegen += BloodyMary.RegenLoss; - if (tequila) - totalNegativeLifeRegen += Tequila.RegenLoss; - if (tequilaSunrise) - totalNegativeLifeRegen += TequilaSunrise.RegenLoss; - if (screwdriver) - totalNegativeLifeRegen += Screwdriver.RegenLoss; - if (margarita) - totalNegativeLifeRegen += Margarita.RegenLoss; - if (starBeamRye) - totalNegativeLifeRegen += StarBeamRye.RegenLoss; - if (moscowMule) - totalNegativeLifeRegen += MoscowMule.RegenLoss; - if (whiteWine) - totalNegativeLifeRegen += WhiteWine.RegenLoss; - if (evergreenGin) - totalNegativeLifeRegen += EvergreenGin.RegenLoss; // Blanket effect for all alcohols if (alcoholPoisonLevel > 0) @@ -570,8 +546,6 @@ namespace CalamityMod.CalPlayer #region Update Life Regen public override void UpdateLifeRegen() { - if (rum) - Player.lifeRegen += Rum.RegenBoost; if (caribbeanRum) Player.lifeRegen += CaribbeanRum.RegenBoost; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 78d6383086..b2dc65cee0 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3509,13 +3509,10 @@ namespace CalamityMod.CalPlayer if (Player.chilled) Player.moveSpeed *= 1f + (1f / 6f); - if (purpleHaze) - Player.GetDamage() += PurpleHaze.DamageBoost; - - if (vodka) + if (purpleHazeStealthTimer > 0) { - Player.GetDamage() += Vodka.DamageBoost; - Player.GetCritChance() += Vodka.CritBoost; + Player.GetDamage() += PurpleHaze.DamageBoost; + stealthDamage -= PurpleHaze.StealthDamageLoss; } if (moonshine) @@ -3524,9 +3521,6 @@ namespace CalamityMod.CalPlayer Player.endurance += Moonshine.DamageReductionBoost; } - if (rum) - Player.moveSpeed += Rum.MoveSpeedBoost; - if (whiskey) { Player.GetDamage() += Whiskey.DamageBoost; @@ -3545,15 +3539,6 @@ namespace CalamityMod.CalPlayer } } - if (tequila) - { - if (Main.dayTime) - { - Player.statDefense += Tequila.DefenseBoost; - Player.GetCritChance() += Tequila.CritBoost; - } - } - if (tequilaSunrise) { if (Main.dayTime) @@ -4816,87 +4801,11 @@ namespace CalamityMod.CalPlayer // Multiplicative defense reductions. // These are done last because they need to be after the defense lower cap at 0. - if (purpleHaze) - { - if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * PurpleHaze.DefenseLossPercent); - } - - if (vodka) - { - if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * Vodka.DefenseLossPercent); - } - - if (grapeBeer) - { - if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * GrapeBeer.DefenseLossPercent); - } - - if (rum) - { - if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * Rum.DefenseLossPercent); - } - - if (whiskey) - { - if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * Whiskey.DefenseLossPercent); - } - if (everclear) { if (Player.statDefense > 0) Player.statDefense -= (int)(Player.statDefense * Everclear.DefenseLossPercent); } - - if (bloodyMary) - { - if (Main.bloodMoon) - { - if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * BloodyMary.DefenseLossPercent); - } - } - - if (caribbeanRum) - { - if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * CaribbeanRum.DefenseLossPercent); - } - - if (cinnamonRoll) - { - if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * CinnamonRoll.DefenseLossPercent); - } - - if (margarita) - { - if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * Margarita.DefenseLossPercent); - } - - if (starBeamRye) - { - if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * StarBeamRye.DefenseLossPercent); - } - - if (whiteWine) - { - if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * WhiteWine.DefenseLossPercent); - } - - if (Player.HasBuff(BuffID.Tipsy)) - { - if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.05); - } - if (DesertProwlerHat.ShroudedInSmoke(Player, out _)) Player.statDefense -= (int)(Player.statDefense * 0.75); } diff --git a/Items/Potions/Alcohol/EvergreenGin.cs b/Items/Potions/Alcohol/EvergreenGin.cs index 50a3593439..75ee4737ed 100644 --- a/Items/Potions/Alcohol/EvergreenGin.cs +++ b/Items/Potions/Alcohol/EvergreenGin.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float SicknessWaterDebuffBoost = 0.25f; - public static int RegenLoss = 1; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f + SicknessWaterDebuffBoost).ToString(), RegenLoss.ToRegenPerSecond()); + public static float DebuffBoost = 0.5f; + public static float DebuffLoss = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent()); public override void SetStaticDefaults() { diff --git a/Items/Potions/Alcohol/Fireball.cs b/Items/Potions/Alcohol/Fireball.cs index 8b8aac8cfc..b9f08dd030 100644 --- a/Items/Potions/Alcohol/Fireball.cs +++ b/Items/Potions/Alcohol/Fireball.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float HeatDebuffBoost = 0.25f; - public static int RegenLoss = 1; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f + HeatDebuffBoost).ToString(), RegenLoss.ToRegenPerSecond()); + public static float DebuffBoost = 0.5f; + public static float DebuffLoss = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent()); public override void SetStaticDefaults() { diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index 3326c62a28..9fb604e4c8 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -12,9 +12,8 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float DefenseLossPercent = 0.03f; - public static int SecondDuration = 15; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseLossPercent.ToPercent(), SecondDuration); + public static float CritLoss = 10; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritLoss); public override void SetStaticDefaults() { @@ -28,7 +27,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToHealingPotion(12, 28, 100); + Item.DefaultToFood(12, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(2), true); Item.value = Item.sellPrice(silver: 3); Item.rare = ItemRarityID.LightRed; @@ -36,7 +35,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void OnConsumeItem(Player player) { - player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(SecondDuration)); + //player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(SecondDuration)); } public override void AddRecipes() diff --git a/Items/Potions/Alcohol/PurpleHaze.cs b/Items/Potions/Alcohol/PurpleHaze.cs index 16b2e0d0ab..ea34ee77ed 100644 --- a/Items/Potions/Alcohol/PurpleHaze.cs +++ b/Items/Potions/Alcohol/PurpleHaze.cs @@ -14,9 +14,10 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float DamageBoost = 0.08f; - public static float DefenseLossPercent = 0.05f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), DefenseLossPercent.ToPercent()); + public static float DamageBoost = 0.25f; + public static float StealthDamageLoss = 0.15f; + + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(),StealthDamageLoss.ToPercent()); public override void SetStaticDefaults() { diff --git a/Items/Potions/Alcohol/Rum.cs b/Items/Potions/Alcohol/Rum.cs index 157feb9e2b..f6db87412a 100644 --- a/Items/Potions/Alcohol/Rum.cs +++ b/Items/Potions/Alcohol/Rum.cs @@ -12,10 +12,9 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static int RegenBoost = 2; - public static float MoveSpeedBoost = 0.1f; - public static float DefenseLossPercent = 0.05f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), MoveSpeedBoost.ToPercent(), DefenseLossPercent.ToPercent()); + public static float NonMinionBoost = 1.15f; + public static float MinionBoost = 0.85f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NonMinionBoost-1).ToPercent(), (MinionBoost - 1).ToPercent()); public override void SetStaticDefaults() { diff --git a/Items/Potions/Alcohol/Screwdriver.cs b/Items/Potions/Alcohol/Screwdriver.cs index 84111eb272..400e7932ce 100644 --- a/Items/Potions/Alcohol/Screwdriver.cs +++ b/Items/Potions/Alcohol/Screwdriver.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float PiercingDamageBuff = 0.05f; - public static int RegenLoss = 1; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f + PiercingDamageBuff).ToString(), RegenLoss.ToRegenPerSecond()); + public static float DebuffBoost = 0.5f; + public static float DebuffLoss = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent()); public override void SetStaticDefaults() { diff --git a/Items/Potions/Alcohol/Tequila.cs b/Items/Potions/Alcohol/Tequila.cs index a458e21c69..06742c7012 100644 --- a/Items/Potions/Alcohol/Tequila.cs +++ b/Items/Potions/Alcohol/Tequila.cs @@ -12,11 +12,10 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float KnockbackBoost = 0.1f; - public static int CritBoost = 4; - public static int DefenseBoost = 5; - public static int RegenLoss = 1; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(KnockbackBoost.ToPercent(), CritBoost, DefenseBoost, RegenLoss.ToRegenPerSecond()); + + public static float DebuffBoost = 0.5f; + public static float DebuffLoss = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent()); public override void SetStaticDefaults() { diff --git a/Items/Potions/Alcohol/Vodka.cs b/Items/Potions/Alcohol/Vodka.cs index 81f53c8799..6a66d4e344 100644 --- a/Items/Potions/Alcohol/Vodka.cs +++ b/Items/Potions/Alcohol/Vodka.cs @@ -13,11 +13,9 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float DamageBoost = 0.06f; - public static int CritBoost = 2; - public static int RegenLoss = 1; - public static float DefenseLossPercent = 0.05f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost, RegenLoss.ToRegenPerSecond(), DefenseLossPercent.ToPercent()); + public static float DebuffBoost = 0.25f; + public static float DebuffLoss = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent()); public override void SetStaticDefaults() { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 52367ac720..33fa01ce93 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -163,8 +163,8 @@ BloodyMary: { DisplayName: Bloody Mary Tooltip: ''' - {0}% increased damage and movement speed during a Blood Moon - Reduces life regen by {1} HP/s and defense by {2}% + Increased enemy spawn rates increased by {0} + Piercing attacks lose {1} of their damage for each enemy hit {$Common.AlcoholWarning} ''' } @@ -173,8 +173,8 @@ CaribbeanRum: { DisplayName: Caribbean Rum Tooltip: ''' - Increases life regen by {0} HP/s, movement speed by {1}% - Makes you floaty and reduces defense by {2}% + Increases move speed by {0} + Reduces your gravity by {1} {$Common.AlcoholWarning} ''' } @@ -183,8 +183,8 @@ CinnamonRoll: { DisplayName: Cinnamon Roll Tooltip: ''' - Multiplies all fire-based debuff damage by {0}x and increases mana regeneration - Reduces defense by {1}% + {0} increased maximum Mana + {1} increased mana consumption {$Common.AlcoholWarning} ''' } @@ -193,8 +193,8 @@ PurpleHaze: { DisplayName: purpleHaze Tooltip: ''' - {0}% increased damage, but lowers defense by {1}% - Increases immune time after being struck + Damage increased by {0} for a short time after a stealth strike + Stealth Strike damage reduced by {1} {$Common.AlcoholWarning} ''' } @@ -214,9 +214,8 @@ EvergreenGin: { DisplayName: Evergreen Gin Tooltip: ''' - Multiplies all sickness and water-related debuff damage by {0}x - Reduces life regen by {1} HP/s - {$Common.AlcoholWarning} + {0} increased Water and Sickness debuff damage + {1} decreased Electric and Heat debuff damage ''' } @@ -224,8 +223,8 @@ Fireball: { DisplayName: Fireball Tooltip: ''' - Multiplies all fire-based debuff damage by {0}x - Reduces life regen by {1} HP/s + {0} increased Heat debuff damage + {1} decreased Sickness debuff damage {$Common.AlcoholWarning} ''' } @@ -234,7 +233,8 @@ GrapeBeer: { DisplayName: Grape Beer Tooltip: ''' - Reduces defense by {0}% for {1} seconds + Bullets, Arrows, Darts, and Rockets gain homing + {0} reduced critical strike chance {$Common.AlcoholWarning} ''' } @@ -243,10 +243,9 @@ Margarita: { DisplayName: Margarita Tooltip: ''' - Halves the duration of most harmful debuffs - Reduces defense by {0}% and life regen by {1} HP/s + Reduces duration of harmful debuffs by {0} + Reduces damage of debuffs you inflict by {1} {$Common.AlcoholWarning} - {$CommonItemTooltip.MinuteDuration@2} ''' } @@ -255,7 +254,7 @@ Moonshine: { Tooltip: ''' Increases defense by {0} and damage reduction by {1}% - Reduces life regen by {2} HP/s + Reduces flight time by {2} {$Common.AlcoholWarning} ''' } @@ -264,8 +263,8 @@ MoscowMule: { DisplayName: Moscow Mule Tooltip: ''' - Increases damage by {0}%, knockback by {1}% and critical strike chance by {2}% - Reduces life regen by {3} HP/s + {0} increased knockback, all attacks infict Heavy Knockback + Piercing attacks lose {1} of their damage for each enemy hit {$Common.AlcoholWarning} ''' } @@ -285,8 +284,8 @@ OldFashioned: { DisplayName: Old Fashioned Tooltip: ''' - Multiplies most non-weapon, non-debuff damage by {0}x - Multiplies all weapon damage by {1}x + {0} increase to most non-weapon, non-debuff damage + {1} decreased weapon damage {$Common.AlcoholWarning} ''' } @@ -295,7 +294,8 @@ RedWine: { DisplayName: Red Wine Tooltip: ''' - Reduces life regen by {0} HP/s for {1} seconds + {0} increased vertical speed + {1} reduced flight time {$Common.AlcoholWarning} ''' } @@ -304,8 +304,8 @@ Rum: { DisplayName: Rum Tooltip: ''' - Increases life regen by {0} HP/s and movement speed by {1}% - Reduces defense by {2}% + {0} increased non-minion Summon damage + {1} decreased minion damage {$Common.AlcoholWarning} ''' } @@ -314,8 +314,8 @@ Screwdriver: { DisplayName: Screwdriver Tooltip: ''' - Multiplies piercing projectile damage by {0}x - Reduces life regen by {1} HP/s + {0} increased Cold debuff damage + {1} decreased Water debuff damage {$Common.AlcoholWarning} ''' } @@ -324,9 +324,8 @@ StarBeamRye: { DisplayName: Star Beam Rye Tooltip: ''' - Increases max mana by {0}, magic damage by {1}%, - and reduces mana usage by {2}% - Reduces defense by {3}% and life regen by {4} HP/s + {0} increased Mana regeneration + {1} decreased maximum Mana {$Common.AlcoholWarning} ''' } @@ -335,8 +334,8 @@ Tequila: { DisplayName: Tequila Tooltip: ''' - Increases knockback by {0}%, crit chance by {1}% and defense by {2} during daytime - Reduces life regen by {3} HP/s + {0} increased Electric debuff damage + {1} decreased Cold debuff damage {$Common.AlcoholWarning} ''' } @@ -345,8 +344,8 @@ TequilaSunrise: { DisplayName: Tequila Sunrise Tooltip: ''' - Increases knockback by {0}%, crit chance by {1}% and defense by {2} during daytime - Reduces life regen by {3} HP/s + Greatly increases natural regeneration after suffering a damaging debuff + {0} increased damage taken from debuffs {$Common.AlcoholWarning} ''' } @@ -355,8 +354,8 @@ Vodka: { DisplayName: Vodka Tooltip: ''' - Increases damage by {0}% and critical strike chance by {1}% - Reduces life regen by {2} HP/s and defense by {3}% + {0} increased Typeless debuff damage + {1} decreased other debuff damage {$Common.AlcoholWarning} ''' } @@ -365,8 +364,8 @@ Whiskey: { DisplayName: Whiskey Tooltip: ''' - Increases damage by {0}%, knockback by {1}% and critical strike chance by {2}% - Reduces defense by {3}% + {0} increased damage, which decays to {1} decreased damage the longer you hold the same class weapon + This does not apply when not holding a weapon {$Common.AlcoholWarning} ''' } @@ -375,8 +374,8 @@ WhiteWine: { DisplayName: White Wine Tooltip: ''' - Increases magic damage by {0}% - Reduces defense by {1}% and life regen by {2} HP/s + {0} reduced mana consumption + {1} reduced maximum mana {$Common.AlcoholWarning} ''' } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index da046e41d1..f893cf45d7 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -3319,6 +3319,17 @@ namespace CalamityMod.Projectiles if (modPlayer.filthyGlove || modPlayer.bloodyGlove) projectile.ArmorPenetration += gloveArmorPenAmt; } + if (player.Calamity().grapeBeer && player.heldProj != projectile.whoAmI && projectile.damage > 0 && projectile.DamageType == DamageClass.Ranged && projectile.Distance(player.Center) < 80) + { + var item = player.ActiveItem(); + if (item != null && (item.useAmmo == AmmoID.Bullet || item.useAmmo == AmmoID.Arrow || item.useAmmo == AmmoID.Dart || item.useAmmo == AmmoID.Rocket) && player.Calamity().grapeBeerTimer < 5) + { + conditionalHomingRange += 600; + player.Calamity().grapeBeerTimer += 1; + if (projectile.usesLocalNPCImmunity) + projectile.localNPCHitCooldown = -1; + } + } } if (NPC.downedMoonlord) diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 81e4aecbd5..87ba6a87f3 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -461,15 +461,6 @@ namespace CalamityMod // This stacks with the above Deific Amulet effect if (modPlayer.rampartOfDeities && hurtInfo.Damage > 200) extraIFrames += 30; - - if (modPlayer.purpleHaze) - { - if (hurtInfo.Damage == 1) - extraIFrames += 5; - else - extraIFrames += 10; - } - return extraIFrames; } diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index e8b9ab486f..04d92752db 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -184,7 +184,7 @@ namespace CalamityMod foreach (NPC n in Main.ActiveNPCs) { float extraDistance = (n.width / 2) + (n.height / 2); - if (!n.CanBeChasedBy(projectile, false) || !projectile.WithinRange(n.Center, maxDistance + extraDistance)) + if (!n.CanBeChasedBy(projectile, false) || projectile.localNPCImmunity[n.whoAmI] != 0 || !projectile.WithinRange(n.Center, maxDistance + extraDistance)) continue; float currentNPCDist = Vector2.Distance(n.Center, projectile.Center); From 3bd33b5fa5b289cfef3c916ba471542261cec466 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Wed, 4 Jun 2025 09:12:12 -0500 Subject: [PATCH 02/12] fixes, wines, rum, whiskey --- CalPlayer/CalamityPlayer.cs | 131 +++++++++++++++++- CalPlayer/CalamityPlayerMiscEffects.cs | 40 ++++-- Items/Potions/Alcohol/PurpleHaze.cs | 2 +- Items/Potions/Alcohol/RedWine.cs | 19 +-- Items/Potions/Alcohol/Rum.cs | 4 +- Items/Potions/Alcohol/Whiskey.cs | 10 +- Items/Potions/Alcohol/WhiteWine.cs | 9 +- .../Mods.CalamityMod.Items.Potions.hjson | 80 ++++++----- Projectiles/CalamityGlobalProjectile.cs | 10 ++ 9 files changed, 227 insertions(+), 78 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index b29f87659e..3ddd7091d4 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -182,6 +182,14 @@ namespace CalamityMod.CalPlayer public float SicknessDebuffMultiplier = 1; public float WaterDebuffMultiplier = 1; public float ElectricDebuffMultiplier = 1; + + public int TimeHoldingMelee = 0; + public int TimeHoldingRanged = 0; + public int TimeHoldingMagic = 0; + public int TimeHoldingSummon = 0; + public int TimeHoldingRogue = 0; + public int TimeHoldingClassless = 0; + #endregion #region Speedrun Timer @@ -1359,6 +1367,7 @@ namespace CalamityMod.CalPlayer public bool baguette = false; public bool vodka = false; public bool redWine = false; + public float redWineStoredY = 0; public bool grapeBeer = false; public int grapeBeerTimer = 0; public bool moonshine = false; @@ -1377,6 +1386,7 @@ namespace CalamityMod.CalPlayer public bool screwdriver = false; public bool moscowMule = false; public bool whiteWine = false; + public float whiteWineTimer = 0; public bool evergreenGin = false; public bool tranquilityCandle = false; public bool chaosCandle = false; @@ -4221,7 +4231,7 @@ namespace CalamityMod.CalPlayer // Reset The Evolution's same projectile DR if unequipped or the cooldown ends if (!evolution || !Player.HasCooldown(GlobalDodge.ID)) projTypeJustHitBy = -1; - } + } #endregion #region PreUpdate @@ -4304,6 +4314,19 @@ namespace CalamityMod.CalPlayer #region PreUpdateMovement public override void PreUpdateMovement() { + //Multiply vertical speed + if (redWine) + { + if (Player.velocity.Y > 0.2f || Player.velocity.Y < -0.2f) + { + redWineStoredY = Player.velocity.Y; + Player.velocity.Y *= 1 + RedWine.VerticalSpeedBoost; + } + else + { + redWineStoredY = 0; + } + } // Remove acceleration when using the exo chair. if (Player.whoAmI == Main.myPlayer && ExoChair) { @@ -4424,6 +4447,104 @@ namespace CalamityMod.CalPlayer #region PostUpdateEquips public override void PostUpdateEquips() { + + var item = Player.HeldItem; + if (!(item.IsAir || item.damage <= 0)) + { + if (item.DamageType.CountsAsClass(DamageClass.Melee)) + { + TimeHoldingMelee++; + if (TimeHoldingMelee > Whiskey.TimeToDischarge) + TimeHoldingMelee = (int)Whiskey.TimeToDischarge; + if (whiskey) + { + Player.GetDamage(DamageClass.Melee) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingMelee / Whiskey.TimeToDischarge); + } + } else + { + TimeHoldingMelee -= 2; + if (TimeHoldingMelee < 0) + TimeHoldingMelee = 0; + } + if (item.DamageType.CountsAsClass(DamageClass.Ranged)) + { + TimeHoldingRanged++; + if (TimeHoldingRanged > Whiskey.TimeToDischarge) + TimeHoldingRanged = (int)Whiskey.TimeToDischarge; + if (whiskey) + { + Player.GetDamage(DamageClass.Ranged) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingRanged / Whiskey.TimeToDischarge); + } + } + else + { + TimeHoldingRanged -= 2; + if (TimeHoldingRanged < 0) + TimeHoldingRanged = 0; + } + if (item.DamageType.CountsAsClass(DamageClass.Magic)) + { + TimeHoldingMagic++; + if (TimeHoldingMagic > Whiskey.TimeToDischarge) + TimeHoldingMagic = (int)Whiskey.TimeToDischarge; + if (whiskey) + { + Player.GetDamage(DamageClass.Magic) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingMagic / Whiskey.TimeToDischarge); + } + } + else + { + TimeHoldingMagic -= 2; + if (TimeHoldingMagic < 0) + TimeHoldingMagic = 0; + } + if (item.DamageType.CountsAsClass(DamageClass.Summon)) + { + TimeHoldingSummon++; + if (TimeHoldingSummon > Whiskey.TimeToDischarge) + TimeHoldingSummon = (int)Whiskey.TimeToDischarge; + if (whiskey) + { + Player.GetDamage(DamageClass.Summon) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingSummon / Whiskey.TimeToDischarge); + } + } + else + { + TimeHoldingSummon -= 2; + if (TimeHoldingSummon < 0) + TimeHoldingSummon = 0; + } + if (item.DamageType.CountsAsClass(RogueDamageClass.Instance)) + { + TimeHoldingRogue++; + if (TimeHoldingRogue > Whiskey.TimeToDischarge) + TimeHoldingRogue = (int)Whiskey.TimeToDischarge; + if (whiskey) + { + Player.GetDamage(RogueDamageClass.Instance) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingRogue / Whiskey.TimeToDischarge); + } + } + else + { + TimeHoldingRogue -= 2; + if (TimeHoldingRogue < 0) + TimeHoldingRogue = 0; + } + } else + { + if (TimeHoldingMelee-- < 0) + TimeHoldingMelee = 0; + if (TimeHoldingRanged-- < 0) + TimeHoldingRanged = 0; + if (TimeHoldingMagic-- < 0) + TimeHoldingMagic = 0; + if (TimeHoldingSummon-- < 0) + TimeHoldingSummon = 0; + if (TimeHoldingRogue-- < 0) + TimeHoldingRogue = 0; + } + + // PostUpdateMiscEffects runs after the cap has been applied. Do NOT put mining speed stuff there. // Ancient Chisel nerf (also affects Hand of Creation) if (Player.chiselSpeed) @@ -5676,7 +5797,13 @@ namespace CalamityMod.CalPlayer } public override void PostUpdate() //needs to be here else it doesn't work properly, otherwise i'd have stuck it with the wing anim stuffs - { + { + //reset the stored Y value for red wine's increased vertical speed + if (redWine && (redWineStoredY > 0.2f || redWineStoredY < -0.2f) && (Player.velocity.Y > 0.2f || Player.velocity.Y < -0.2f)) + { + Player.velocity.Y = redWineStoredY; + } + bool validEquipSlot = Player.legs == EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs) || Player.legs == EquipLoader.GetEquipSlot(Mod, "PscNightLegs", EquipType.Legs); if (!profanedCrystalHide && (profanedCrystal || profanedCrystalForce) && validEquipSlot) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index b2dc65cee0..d11d8c8dc4 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3511,8 +3511,11 @@ namespace CalamityMod.CalPlayer if (purpleHazeStealthTimer > 0) { - Player.GetDamage() += PurpleHaze.DamageBoost; - stealthDamage -= PurpleHaze.StealthDamageLoss; + //this is so janky looking but it's the only way I could get it to work properly + if (!(StealthStrikeAvailable() && Player.HeldItem.DamageType == RogueDamageClass.Instance)) + Player.GetDamage(DamageClass.Generic) += PurpleHaze.DamageBoost; + else + stealthDamage -= PurpleHaze.StealthDamageLoss; } if (moonshine) @@ -3521,12 +3524,6 @@ namespace CalamityMod.CalPlayer Player.endurance += Moonshine.DamageReductionBoost; } - if (whiskey) - { - Player.GetDamage() += Whiskey.DamageBoost; - Player.GetCritChance() += Whiskey.CritBoost; - } - if (everclear) Player.GetDamage() += Everclear.DamageBoost; @@ -3571,7 +3568,32 @@ namespace CalamityMod.CalPlayer } if (whiteWine) - Player.GetDamage() += WhiteWine.MagicDamageBoost; + { + Player.wingTimeMax = (int)(Player.wingTimeMax * (1f - WhiteWine.FlightTimeLoss)); + + float bonus = 0f; + float MaxDistance = 640f; + NPC closestTarget = Player.Center.ClosestNPCAt(MaxDistance * 7); // extra range is to account for bonus range from massive targets + if (closestTarget != null) + { + float generousHitboxWidth = Math.Max(closestTarget.Hitbox.Width / 2f, closestTarget.Hitbox.Height / 2f) + 100; // Adds some room so max bonus isnt when you're ON the hitbox + bonus = Utils.Remap(Utils.Distance(Player.Center, closestTarget.Center), MaxDistance + generousHitboxWidth, generousHitboxWidth, 0, 1, true); + } + else + bonus = 0; + whiteWineTimer += bonus * WhiteWine.FlightTimeRecoveryAmount; + while (whiteWineTimer > 1) + { + if (Player.wingTime < Player.wingTimeMax) + Player.wingTime++; + whiteWineTimer--; + } + } + + if (redWine) + { + Player.wingTimeMax = (int)(Player.wingTimeMax * (1f - RedWine.FlightTimeLoss)); + } if (giantPearl) { diff --git a/Items/Potions/Alcohol/PurpleHaze.cs b/Items/Potions/Alcohol/PurpleHaze.cs index ea34ee77ed..534a00d9d7 100644 --- a/Items/Potions/Alcohol/PurpleHaze.cs +++ b/Items/Potions/Alcohol/PurpleHaze.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Potions.Alcohol public new string LocalizationCategory => "Items.Potions"; public static float DamageBoost = 0.25f; - public static float StealthDamageLoss = 0.15f; + public static float StealthDamageLoss = 0.25f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(),StealthDamageLoss.ToPercent()); diff --git a/Items/Potions/Alcohol/RedWine.cs b/Items/Potions/Alcohol/RedWine.cs index be7ea64e52..6da8577bda 100644 --- a/Items/Potions/Alcohol/RedWine.cs +++ b/Items/Potions/Alcohol/RedWine.cs @@ -12,10 +12,9 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static int HealValue = 200; - public static int RegenLoss = 1; - public static int SecondDuration = 30; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenLoss.ToRegenPerSecond(), SecondDuration); + public static float VerticalSpeedBoost = 0.1f; + public static float FlightTimeLoss = 0.25f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(VerticalSpeedBoost.ToPercent(), FlightTimeLoss.ToPercent()); public override void SetStaticDefaults() { @@ -29,21 +28,11 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToHealingPotion(14, 48, HealValue); + Item.DefaultToFood(14, 48, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5)); Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.LightRed; } - - public override void GetHealLife(Player player, bool quickHeal, ref int healValue) - { - healValue = player.Calamity().baguette ? Baguette.RedWineBuffedHealValue : HealValue; - } - - public override void OnConsumeItem(Player player) - { - player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(SecondDuration)); - } public override void AddRecipes() { CreateRecipe(10). diff --git a/Items/Potions/Alcohol/Rum.cs b/Items/Potions/Alcohol/Rum.cs index f6db87412a..26719ca3db 100644 --- a/Items/Potions/Alcohol/Rum.cs +++ b/Items/Potions/Alcohol/Rum.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Potions.Alcohol public static float NonMinionBoost = 1.15f; public static float MinionBoost = 0.85f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NonMinionBoost-1).ToPercent(), (MinionBoost - 1).ToPercent()); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NonMinionBoost-1).ToPercent(), (1- MinionBoost).ToPercent()); public override void SetStaticDefaults() { @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(24, 26, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); + Item.DefaultToFood(24, 26, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.LightRed; diff --git a/Items/Potions/Alcohol/Whiskey.cs b/Items/Potions/Alcohol/Whiskey.cs index 103f21d3be..0582b63fe8 100644 --- a/Items/Potions/Alcohol/Whiskey.cs +++ b/Items/Potions/Alcohol/Whiskey.cs @@ -12,11 +12,11 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float DamageBoost = 0.04f; - public static float KnockbackBoost = 0.2f; - public static int CritBoost = 2; - public static float DefenseLossPercent = 0.05f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), KnockbackBoost.ToPercent(), CritBoost, DefenseLossPercent.ToPercent()); + public static float MaxDamageBoost = 0.15f; + public static float MinDamageBoost = -0.15f; + public static float TimeToDischarge = 600; + public static float TimeToRecharge = 300; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxDamageBoost.ToPercent(), MinDamageBoost.ToPercent(), (TimeToDischarge/60).ToString("0.##"), (TimeToRecharge/60).ToString("0.##")); public override void SetStaticDefaults() { diff --git a/Items/Potions/Alcohol/WhiteWine.cs b/Items/Potions/Alcohol/WhiteWine.cs index 396bc4b338..9e6b9a8a1c 100644 --- a/Items/Potions/Alcohol/WhiteWine.cs +++ b/Items/Potions/Alcohol/WhiteWine.cs @@ -14,10 +14,9 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float MagicDamageBoost = 0.08f; - public static float DefenseLossPercent = 0.06f; - public static int RegenLoss = 2; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MagicDamageBoost.ToPercent(), DefenseLossPercent.ToPercent(), RegenLoss.ToRegenPerSecond()); + public static float FlightTimeRecoveryAmount = 0.66f; + public static float FlightTimeLoss = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightTimeLoss.ToPercent()); public override void SetStaticDefaults() { @@ -33,8 +32,6 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { Item.DefaultToFood(14, 44, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); - Item.healMana = 300; - Item.value = Item.sellPrice(silver: 40); Item.rare = ItemRarityID.LightPurple; } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 33fa01ce93..190bbc3e2a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -163,8 +163,8 @@ BloodyMary: { DisplayName: Bloody Mary Tooltip: ''' - Increased enemy spawn rates increased by {0} - Piercing attacks lose {1} of their damage for each enemy hit + Increased enemy spawn rates increased by {0}% + Piercing attacks lose {1}% of their damage for each enemy hit {$Common.AlcoholWarning} ''' } @@ -173,8 +173,8 @@ CaribbeanRum: { DisplayName: Caribbean Rum Tooltip: ''' - Increases move speed by {0} - Reduces your gravity by {1} + Increases move speed by {0}% + Reduces your gravity by {1}% {$Common.AlcoholWarning} ''' } @@ -183,18 +183,17 @@ CinnamonRoll: { DisplayName: Cinnamon Roll Tooltip: ''' - {0} increased maximum Mana - {1} increased mana consumption + {0}% increased maximum Mana + {1}% increased mana consumption {$Common.AlcoholWarning} ''' } PurpleHaze: { - DisplayName: purpleHaze + DisplayName: Purple Haze Tooltip: ''' - Damage increased by {0} for a short time after a stealth strike - Stealth Strike damage reduced by {1} + For 5 seconds after a stealth strike, all damage increased by {0}%, but stealth strike damage reduced by {1}% {$Common.AlcoholWarning} ''' } @@ -214,8 +213,8 @@ EvergreenGin: { DisplayName: Evergreen Gin Tooltip: ''' - {0} increased Water and Sickness debuff damage - {1} decreased Electric and Heat debuff damage + {0}% increased Water and Sickness debuff damage + {1}% decreased Electric and Heat debuff damage ''' } @@ -223,8 +222,8 @@ Fireball: { DisplayName: Fireball Tooltip: ''' - {0} increased Heat debuff damage - {1} decreased Sickness debuff damage + {0}% increased Heat debuff damage + {1}% decreased Sickness debuff damage {$Common.AlcoholWarning} ''' } @@ -234,7 +233,8 @@ GrapeBeer: { Tooltip: ''' Bullets, Arrows, Darts, and Rockets gain homing - {0} reduced critical strike chance + If many are fired at the same time, this only applies to five of them + {0}% reduced critical strike chance {$Common.AlcoholWarning} ''' } @@ -243,8 +243,8 @@ Margarita: { DisplayName: Margarita Tooltip: ''' - Reduces duration of harmful debuffs by {0} - Reduces damage of debuffs you inflict by {1} + Reduces duration of harmful debuffs by {0}% + Reduces damage of debuffs you inflict by {1}% {$Common.AlcoholWarning} ''' } @@ -254,7 +254,7 @@ Moonshine: { Tooltip: ''' Increases defense by {0} and damage reduction by {1}% - Reduces flight time by {2} + Reduces flight time by {2}% {$Common.AlcoholWarning} ''' } @@ -263,8 +263,8 @@ MoscowMule: { DisplayName: Moscow Mule Tooltip: ''' - {0} increased knockback, all attacks infict Heavy Knockback - Piercing attacks lose {1} of their damage for each enemy hit + {0}% increased knockback, all attacks infict Heavy Knockback + Piercing attacks lose {1}% of their damage for each enemy hit {$Common.AlcoholWarning} ''' } @@ -284,8 +284,8 @@ OldFashioned: { DisplayName: Old Fashioned Tooltip: ''' - {0} increase to most non-weapon, non-debuff damage - {1} decreased weapon damage + {0}% increase to most non-weapon, non-debuff damage + {1}% decreased weapon damage {$Common.AlcoholWarning} ''' } @@ -294,8 +294,8 @@ RedWine: { DisplayName: Red Wine Tooltip: ''' - {0} increased vertical speed - {1} reduced flight time + {0}% increased vertical speed + {1}% reduced flight time {$Common.AlcoholWarning} ''' } @@ -304,8 +304,8 @@ Rum: { DisplayName: Rum Tooltip: ''' - {0} increased non-minion Summon damage - {1} decreased minion damage + {0}% increased non-minion Summon damage + {1}% decreased minion damage {$Common.AlcoholWarning} ''' } @@ -314,8 +314,8 @@ Screwdriver: { DisplayName: Screwdriver Tooltip: ''' - {0} increased Cold debuff damage - {1} decreased Water debuff damage + {0}% increased Cold debuff damage + {1}% decreased Water debuff damage {$Common.AlcoholWarning} ''' } @@ -324,8 +324,8 @@ StarBeamRye: { DisplayName: Star Beam Rye Tooltip: ''' - {0} increased Mana regeneration - {1} decreased maximum Mana + {0}% increased Mana regeneration + {1}% decreased maximum Mana {$Common.AlcoholWarning} ''' } @@ -334,8 +334,8 @@ Tequila: { DisplayName: Tequila Tooltip: ''' - {0} increased Electric debuff damage - {1} decreased Cold debuff damage + {0}% increased Electric debuff damage + {1}% decreased Cold debuff damage {$Common.AlcoholWarning} ''' } @@ -345,7 +345,7 @@ TequilaSunrise: { Tooltip: ''' Greatly increases natural regeneration after suffering a damaging debuff - {0} increased damage taken from debuffs + {0}% increased damage taken from debuffs {$Common.AlcoholWarning} ''' } @@ -354,8 +354,8 @@ Vodka: { DisplayName: Vodka Tooltip: ''' - {0} increased Typeless debuff damage - {1} decreased other debuff damage + {0}% increased Typeless debuff damage + {1}% decreased other debuff damage {$Common.AlcoholWarning} ''' } @@ -364,8 +364,12 @@ Whiskey: { DisplayName: Whiskey Tooltip: ''' - {0} increased damage, which decays to {1} decreased damage the longer you hold the same class weapon - This does not apply when not holding a weapon + Provides between {0}% and {1}% damage to the held weapon's class + Each class tracks this boost individually + This boost lowers the longer you hold weapons of the same class + It takes {2} seconds for the damage to fully decay + This boost recharges when holding weapons of a different class + It takes {3} seconds for the damage to fully recharge {$Common.AlcoholWarning} ''' } @@ -374,8 +378,8 @@ WhiteWine: { DisplayName: White Wine Tooltip: ''' - {0} reduced mana consumption - {1} reduced maximum mana + You regain flight time the closer you are to an enemy + {0}% reduced flight time {$Common.AlcoholWarning} ''' } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index f893cf45d7..ad0e2a3d8c 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -4173,6 +4173,16 @@ namespace CalamityMod.Projectiles if (modPlayer.oldFashioned && buffedByOldFashioned.HasValue) modifiers.SourceDamage *= buffedByOldFashioned.Value ? OldFashioned.DamageBoostMultiplier : OldFashioned.DamageReductionMultiplier; + if (modPlayer.rum && projectile.DamageType.CountsAsClass(DamageClass.Summon)) + { + if (projectile.minion || ProjectileID.Sets.MinionShot[projectile.type]) + { + modifiers.SourceDamage *= Rum.MinionBoost; + } + else + modifiers.SourceDamage *= Rum.NonMinionBoost; + } + if (projectile.type == ProjectileID.JoustingLance || projectile.type == ProjectileID.HallowJoustingLance || projectile.type == ProjectileID.ShadowJoustingLance) { // The vanilla damage Jousting Lance multiplier is as follows. Calamity overrides this with a new formula From eca604bfbcba7e796d2c335bf7bdc96f75d23aa2 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Thu, 5 Jun 2025 08:16:03 -0500 Subject: [PATCH 03/12] starbeam rye, caribbean rum, bloody mary, tequila sunrise, misc changes --- CalPlayer/CalamityPlayer.cs | 1 + CalPlayer/CalamityPlayerLifeRegen.cs | 21 ++++++++++++--- CalPlayer/CalamityPlayerMiscEffects.cs | 27 +++++-------------- CalPlayer/CalamityPlayerOnHit.cs | 20 +++++++++++++- Items/Potions/Alcohol/BloodyMary.cs | 6 ----- Items/Potions/Alcohol/CaribbeanRum.cs | 9 +++---- Items/Potions/Alcohol/StarBeamRye.cs | 11 +++----- Items/Potions/Alcohol/TequilaSunrise.cs | 9 +++---- .../Mods.CalamityMod.Items.Potions.hjson | 6 ++--- NPCs/CalamityGlobalNPC.cs | 5 ++++ NPCs/CalamityPierceResistance.cs | 8 +++--- Projectiles/CalamityGlobalProjectile.cs | 8 +++++- 12 files changed, 73 insertions(+), 58 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3ddd7091d4..bab234be60 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -830,6 +830,7 @@ namespace CalamityMod.CalPlayer public bool lAmbergrisVisual = false; public bool tortShell = false; public bool absorber = false; + public bool hadLifeRegenHinderingDebuff = false; public bool alwaysHoneyRegen = false; public float alwaysHoneyRegenAmount = 0; public bool honeyTurboRegen = false; diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index aa2b2cbbe1..5e795e2182 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -271,9 +271,13 @@ namespace CalamityMod.CalPlayer // At the last second, Reaver defense helm reduces DoT debuffs by 20% if (reaverDefense) totalNegativeLifeRegen = (int)(0.8f * totalNegativeLifeRegen); + if (tequilaSunrise) + totalNegativeLifeRegen = (int)(totalNegativeLifeRegen * TequilaSunrise.DoTMultiplier); Player.lifeRegen -= (int)totalNegativeLifeRegen; + bool hasLifeRegenHinderingDebuff = Player.lifeRegenTime == 0; + #region Life Regen That Works Even During DoT Debuffs // Honey Dew (and upgrades) @@ -467,6 +471,16 @@ namespace CalamityMod.CalPlayer Player.lifeRegenTime = 1800; } } + + //If a player had a life regen hindering debuff, add 30 seconds to their regen time when under Tequila Sunrise + //This stacks with all other post-debuff boosts due to Tequila Sunrise increasing DoT damage taken + if (tequilaSunrise) + { + if (hadLifeRegenHinderingDebuff && !hasLifeRegenHinderingDebuff) + { + Player.lifeRegenTime += 1800; + } + } #endregion // During Silva revive or God Slayer dash, all negative life regen is canceled @@ -540,16 +554,15 @@ namespace CalamityMod.CalPlayer // Chalice of the Blood God bleedout // The bleedout is applied by directly reducing the player's health. It is not canceled by anything. ChaliceOfTheBloodGod.HandleBleedout(Player); + + //Finally, update the state of hadLifeRegenHinderingDebuff for next frame. + hadLifeRegenHinderingDebuff = hasLifeRegenHinderingDebuff; } #endregion #region Update Life Regen public override void UpdateLifeRegen() { - - if (caribbeanRum) - Player.lifeRegen += CaribbeanRum.RegenBoost; - if (mushy) Player.lifeRegen += Mushy.RegenBoost; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index d11d8c8dc4..4afe8e08cd 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3527,26 +3527,12 @@ namespace CalamityMod.CalPlayer if (everclear) Player.GetDamage() += Everclear.DamageBoost; - if (bloodyMary) - { - if (Main.bloodMoon) - { - Player.GetDamage() += BloodyMary.DamageBoost; - Player.moveSpeed += BloodyMary.MoveSpeedBoost; - } - } - - if (tequilaSunrise) - { - if (Main.dayTime) - { - Player.statDefense += TequilaSunrise.DefenseBoost; - Player.GetCritChance() += TequilaSunrise.CritBoost; - } - } if (caribbeanRum) + { + Player.gravity *= CaribbeanRum.GravityMultiplier; Player.moveSpeed += CaribbeanRum.MoveSpeedBoost; + } if (cinnamonRoll) { @@ -3556,9 +3542,8 @@ namespace CalamityMod.CalPlayer if (starBeamRye) { - Player.GetDamage() += StarBeamRye.MagicDamageBoost; - Player.manaCost *= (1f - StarBeamRye.ManaCostReduction); - Player.statManaMax2 += StarBeamRye.MaxManaBoost; + Player.manaRegenBonus += (int)((Player.statManaMax2/3f + 1) *2f ); + Player.statManaMax2 = (int)(Player.statManaMax2 * StarBeamRye.MaxManaBoost); } if (moscowMule) @@ -3769,7 +3754,7 @@ namespace CalamityMod.CalPlayer if (molluskLegs) Player.velocity.X *= 0.995f; - if ((warped || caribbeanRum) && !Player.slowFall && !Player.mount.Active) + if ((warped) && !Player.slowFall && !Player.mount.Active) { float velocityYMultiplier = (warped && Main.getGoodWorld) ? 1.02f : 1.01f; Player.velocity.Y *= velocityYMultiplier; diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index bdc581dea1..d542dee2d1 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -231,7 +231,25 @@ namespace CalamityMod.CalPlayer if (proj.type != ProjectileType()) MythrilArmorSetChange.OnHitEffects(target, damageDone, Player); - if (witheringWeaponEnchant) + if (moscowMule) + { + var center = Player.Center; + if (proj.IsMinionOrSentryRelated) + center = proj.Center; + Vector2 launchVel = Utils.DirectionTo(center, target.Center); + target.MoveNPC(launchVel, proj.knockBack, true); + } + + if (moscowMule || bloodyMary) + { + if (!(PierceResistNPC.exemptProjectiles.Contains(proj.type) || (PierceResistNPC.singleHitboxExemptProjectiles.ContainsKey(proj.type) && PierceResistNPC.singleHitboxExemptProjectiles[proj.type]))) + { + proj.damage = (int)(proj.damage * (moscowMule ? 0.8f : 1f) * (bloodyMary ? 0.75f : 1f)); + } + + } + + if (witheringWeaponEnchant) witheringDamageDone += (int)(damageDone * (hit.Crit ? 2D : 1D)); cgn.TypelessDebuffMultiplier = TypelessDebuffMultiplier; cgn.HeatDebuffMultiplier = HeatDebuffMultiplier; diff --git a/Items/Potions/Alcohol/BloodyMary.cs b/Items/Potions/Alcohol/BloodyMary.cs index 3a59eb34c0..c87adb4673 100644 --- a/Items/Potions/Alcohol/BloodyMary.cs +++ b/Items/Potions/Alcohol/BloodyMary.cs @@ -12,12 +12,6 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float DamageBoost = 0.1f; - public static float MoveSpeedBoost = 0.1f; // Both 10% so we only need just one in the tooltip - public static int RegenLoss = 4; - public static float DefenseLossPercent = 0.04f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), RegenLoss.ToRegenPerSecond(), DefenseLossPercent.ToPercent()); - public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; diff --git a/Items/Potions/Alcohol/CaribbeanRum.cs b/Items/Potions/Alcohol/CaribbeanRum.cs index df99ce342a..9211e4ba49 100644 --- a/Items/Potions/Alcohol/CaribbeanRum.cs +++ b/Items/Potions/Alcohol/CaribbeanRum.cs @@ -12,10 +12,9 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static int RegenBoost = 2; - public static float MoveSpeedBoost = 0.1f; - public static float DefenseLossPercent = 0.1f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), MoveSpeedBoost.ToPercent(), DefenseLossPercent.ToPercent()); + public static float MoveSpeedBoost = 0.25f; + public static float GravityMultiplier = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent(), (1-GravityMultiplier).ToPercent()); public override void SetStaticDefaults() { @@ -30,7 +29,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(14, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); + Item.DefaultToFood(14, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); Item.value = Item.sellPrice(silver: 60); Item.rare = ItemRarityID.Lime; diff --git a/Items/Potions/Alcohol/StarBeamRye.cs b/Items/Potions/Alcohol/StarBeamRye.cs index 70c37e28a6..f24bc7d950 100644 --- a/Items/Potions/Alcohol/StarBeamRye.cs +++ b/Items/Potions/Alcohol/StarBeamRye.cs @@ -12,12 +12,9 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static int MaxManaBoost = 50; - public static float MagicDamageBoost = 0.08f; - public static float ManaCostReduction = 0.1f; - public static float DefenseLossPercent = 0.06f; - public static int RegenLoss = 2; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, MagicDamageBoost.ToPercent(), ManaCostReduction.ToPercent(), DefenseLossPercent.ToPercent(), RegenLoss.ToRegenPerSecond()); + public static float MaxManaBoost = 0.5f; + public static float ManaRegenBoost = 2f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ManaRegenBoost.ToPercent(),(1-MaxManaBoost).ToPercent()); public override void SetStaticDefaults() { @@ -32,7 +29,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(20, 34, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); + Item.DefaultToFood(20, 34, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); Item.value = Item.sellPrice(silver: 80); Item.rare = ItemRarityID.Lime; diff --git a/Items/Potions/Alcohol/TequilaSunrise.cs b/Items/Potions/Alcohol/TequilaSunrise.cs index 21f4125b1e..3550d789cf 100644 --- a/Items/Potions/Alcohol/TequilaSunrise.cs +++ b/Items/Potions/Alcohol/TequilaSunrise.cs @@ -13,11 +13,8 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float KnockbackBoost = 0.2f; - public static int CritBoost = 8; - public static int DefenseBoost = 10; - public static int RegenLoss = 2; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(KnockbackBoost.ToPercent(), CritBoost, DefenseBoost, RegenLoss.ToRegenPerSecond()); + public static float DoTMultiplier = 1.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DoTMultiplier-1).ToPercent()); public override void SetStaticDefaults() { @@ -31,7 +28,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(22, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); + Item.DefaultToFood(22, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); Item.value = Item.sellPrice(gold: 1); Item.rare = ItemRarityID.Yellow; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 190bbc3e2a..74702e2b07 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -163,8 +163,8 @@ BloodyMary: { DisplayName: Bloody Mary Tooltip: ''' - Increased enemy spawn rates increased by {0}% - Piercing attacks lose {1}% of their damage for each enemy hit + Increased enemy spawn rates by 7x + Greatly reduced piercing weapon effectiveness {$Common.AlcoholWarning} ''' } @@ -264,7 +264,7 @@ MoscowMule: { Tooltip: ''' {0}% increased knockback, all attacks infict Heavy Knockback - Piercing attacks lose {1}% of their damage for each enemy hit + Reduces the effectiveness of piercing weapons {$Common.AlcoholWarning} ''' } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 9291b29055..49da95fd21 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -6679,6 +6679,11 @@ namespace CalamityMod.NPCs spawnRate = (int)(spawnRate * 0.2); // 5x spawn rate maxSpawns = (int)(maxSpawns * 5f); } + if (player.Calamity().bloodyMary) + { + spawnRate = (int)(spawnRate * 0.142); // ~7x spawn rate + maxSpawns = (int)(maxSpawns * 5f); // Only 5x the cap, however + } // Reductions if (Main.SceneMetrics.PeaceCandleCount > 0) diff --git a/NPCs/CalamityPierceResistance.cs b/NPCs/CalamityPierceResistance.cs index c69f0b3ad7..4b5cedde38 100644 --- a/NPCs/CalamityPierceResistance.cs +++ b/NPCs/CalamityPierceResistance.cs @@ -16,10 +16,10 @@ namespace CalamityMod.NPCs { public sealed class PierceResistNPC : GlobalNPC { - private static HashSet exemptProjectiles; - private static HashSet pierceResistNPC; - private static HashSet singleHitboxNPC; - private static Dictionary singleHitboxExemptProjectiles; + public static HashSet exemptProjectiles; + public static HashSet pierceResistNPC; + public static HashSet singleHitboxNPC; + public static Dictionary singleHitboxExemptProjectiles; public override void Load() { diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index ad0e2a3d8c..2f1a8a89a2 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -4182,7 +4182,13 @@ namespace CalamityMod.Projectiles else modifiers.SourceDamage *= Rum.NonMinionBoost; } - + if (modPlayer.moscowMule || modPlayer.bloodyMary) + { + if (projectile.DamageType == DamageClass.Summon || (PierceResistNPC.exemptProjectiles.Contains(projectile.type) || (PierceResistNPC.singleHitboxExemptProjectiles.ContainsKey(projectile.type) && PierceResistNPC.singleHitboxExemptProjectiles[projectile.type]))) + { + modifiers.SourceDamage *= ((modPlayer.moscowMule ? 0.7f : 1f) * (modPlayer.bloodyMary ? 0.33f : 1f)); + } + } if (projectile.type == ProjectileID.JoustingLance || projectile.type == ProjectileID.HallowJoustingLance || projectile.type == ProjectileID.ShadowJoustingLance) { // The vanilla damage Jousting Lance multiplier is as follows. Calamity overrides this with a new formula From 5f75d06a8d7c40371ac88a7c439b82b97c7d81c0 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Tue, 17 Jun 2025 10:12:36 -0500 Subject: [PATCH 04/12] moonshine --- CalPlayer/CalamityPlayer.cs | 3 ++- CalPlayer/CalamityPlayerHitHurt.cs | 22 ++++++++++++------- CalPlayer/CalamityPlayerLifeRegen.cs | 2 -- CalPlayer/CalamityPlayerMiscEffects.cs | 8 +------ Items/Potions/Alcohol/Moonshine.cs | 8 +++---- .../Mods.CalamityMod.Items.Potions.hjson | 4 ++-- 6 files changed, 22 insertions(+), 25 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index db5f929102..06a0c26106 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4442,7 +4442,8 @@ namespace CalamityMod.CalPlayer Player.manaRegenBuff = true; } - + if (moonshine) + Player.statLifeMax2 = (int)(Player.statLifeMax2 * (1 + Moonshine.MaxLifePercentBoost)); ForceVariousEffects(); } #endregion diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index baa0d5969f..06e439c763 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -2202,9 +2202,9 @@ namespace CalamityMod.CalPlayer bool hasIFrames = Player.HasIFrames(); // If the player was just hit by something capable of dealing defense damage, then apply defense damage. - // Bloodflare Core makes every hit deal defense damage (to enable its function). + // Bloodflare Core or Moonshine makes every hit deal defense damage (to enable its function). // Defense damage is not applied if the player has iframes or godmode. - bool hitCanApplyDefenseDamage = nextHitDealsDefenseDamage || bloodflareCore; + bool hitCanApplyDefenseDamage = nextHitDealsDefenseDamage || bloodflareCore || moonshine; bool defenseDamageShouldApply = hitCanApplyDefenseDamage && !hasIFrames && !Player.creativeGodMode; // 15AUG2024: Ozzatron: External flag which completely disables defense damage. This overrides Bloodflare Core. @@ -2212,19 +2212,25 @@ namespace CalamityMod.CalPlayer if (defenseDamageShouldApply && externalFlagsAppropriate) { + double specialDefenseDmgMinimum = 0; double halfDefense = Player.statDefense / 2.0; + if (bloodflareCore) + specialDefenseDmgMinimum += halfDefense; + if (moonshine) + specialDefenseDmgMinimum += halfDefense; int netMitigation = hurtInfo.SourceDamage - hurtInfo.Damage; double standardDefenseDamage = netMitigation * defenseDamageRatio; - // Bloodflare Core overrides standard defense damage if it would be less than half of the player's total defense. - if (bloodflareCore && standardDefenseDamage < halfDefense) + // Bloodflare Core or Moonshine overrides standard defense damage if it would be less than half of the player's total defense. + // They stack together for 100% lost defense + if (specialDefenseDmgMinimum > 0 && standardDefenseDamage < specialDefenseDmgMinimum) { - // In this case, forcibly deal half of the player's total defense as defense damage. This ignores ratios. - DealDefenseDamage((int)halfDefense, true); + // In this case, forcibly deal the proportion of the player's total defense as defense damage. This ignores ratios. + DealDefenseDamage((int)specialDefenseDmgMinimum, true); // Set up Bloodflare Core's heal over time. Any in-progress heals are overwritten if they would have a shorter duration. - if (bloodflareCoreRemainingHealOverTime < halfDefense) - bloodflareCoreRemainingHealOverTime = (int)halfDefense; + if (bloodflareCore && bloodflareCoreRemainingHealOverTime < specialDefenseDmgMinimum) + bloodflareCoreRemainingHealOverTime = (int)specialDefenseDmgMinimum; // Play a sound and make dust to signify that defense has been shattered SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact, Player.Center); diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 5e795e2182..11d6613634 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -194,8 +194,6 @@ namespace CalamityMod.CalPlayer if (AlcoholsDict.TryGet(buff, out var level)) alcoholPoisonLevel += level; } - if (moonshine) - totalNegativeLifeRegen += Moonshine.RegenLoss; if (everclear) totalNegativeLifeRegen += Everclear.RegenLoss; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 626da881aa..8a993c03a3 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3543,12 +3543,6 @@ namespace CalamityMod.CalPlayer stealthDamage -= PurpleHaze.StealthDamageLoss; } - if (moonshine) - { - Player.statDefense += Moonshine.DefenseBoost; - Player.endurance += Moonshine.DamageReductionBoost; - } - if (everclear) Player.GetDamage() += Everclear.DamageBoost; @@ -4806,7 +4800,7 @@ namespace CalamityMod.CalPlayer { totalDefenseDamage = 0; defenseDamageRecoveryFrames = 0; - totalDefenseDamageRecoveryFrames = DefenseDamageBaseRecoveryTime; + totalDefenseDamageRecoveryFrames = DefenseDamageBaseRecoveryTime * (moonshine ? 2 : 1); defenseDamageDelayFrames = 0; } } diff --git a/Items/Potions/Alcohol/Moonshine.cs b/Items/Potions/Alcohol/Moonshine.cs index 023184739f..5393e097b2 100644 --- a/Items/Potions/Alcohol/Moonshine.cs +++ b/Items/Potions/Alcohol/Moonshine.cs @@ -12,10 +12,8 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static int DefenseBoost = 10; - public static float DamageReductionBoost = 0.03f; - public static int RegenLoss = 1; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseBoost, DamageReductionBoost.ToPercent(), RegenLoss.ToRegenPerSecond()); + public static float MaxLifePercentBoost = 0.33f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifePercentBoost.ToPercent()); public override void SetStaticDefaults() { @@ -30,7 +28,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(24, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); + Item.DefaultToFood(24, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); Item.value = Item.sellPrice(gold: 1); Item.rare = ItemRarityID.Yellow; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 74702e2b07..3c7b3ce43b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -253,8 +253,8 @@ Moonshine: { DisplayName: Moonshine Tooltip: ''' - Increases defense by {0} and damage reduction by {1}% - Reduces flight time by {2}% + Increases maximum health by {0}% + Attacks always take at least half your defense worth of defense damage, and slows defense damage recovery slightly {$Common.AlcoholWarning} ''' } From ecf9865a439e19ced812c16e63ff34060e29bda5 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Wed, 18 Jun 2025 15:44:50 -0500 Subject: [PATCH 05/12] ale --- Buffs/CalamityGlobalBuff.cs | 3 ++- Items/CalamityGlobalItem.cs | 5 +++++ Localization/en-US/Mods.CalamityMod.Vanilla.hjson | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 5ed7fcddac..4cef396e78 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -66,7 +66,8 @@ namespace CalamityMod.Buffs { player.statDefense += 4; player.GetCritChance() -= 2; - player.GetAttackSpeed() -= 0.1f; + player.GetAttackSpeed() -= 0.2f; + player.GetDamage() -= 0.1f; } else if (type == BuffID.WellFed) { diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index f8aee874d4..44e5257afc 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1070,6 +1070,11 @@ namespace CalamityMod.Items return ""; } + public override void ModifyItemScale(Item item, Player player, ref float scale) + { + if (item.CountsAsClass() && player.HasBuff(BuffID.Tipsy)) + scale += 0.15f; + } public override void UpdateArmorSet(Player player, string set) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index eb9bbf4fc6..8547713098 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -175,7 +175,7 @@ EditedTooltip: { DD2BetsyBow: Shoots a tight spread of 6 splitting arrows AleSake: ''' - Increases melee damage by 10% and reduces defense by 5% + Increases melee size by 15%, but decreases melee speed by 10% Counts as an alcohol for Alcohol Poisoning {$Common.AlcoholWarning} ''' From 0402103320a8f0efd328bcc20b91dfc20bcd4ba5 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Mon, 14 Jul 2025 18:55:27 -0500 Subject: [PATCH 06/12] Grape Beer reduces crit dmg instead of crit chance --- Buffs/Alcohol/GrapeBeerBuff.cs | 2 +- Localization/en-US/Mods.CalamityMod.Items.Potions.hjson | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Buffs/Alcohol/GrapeBeerBuff.cs b/Buffs/Alcohol/GrapeBeerBuff.cs index 433d86a78c..886fdf42e6 100644 --- a/Buffs/Alcohol/GrapeBeerBuff.cs +++ b/Buffs/Alcohol/GrapeBeerBuff.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { player.Calamity().grapeBeer = true; - player.GetCritChance() -= GrapeBeer.CritLoss; + player.Calamity().critDamage -= GrapeBeer.CritLoss * 0.01f; } } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 3c7b3ce43b..3bf6d2d467 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -234,7 +234,7 @@ GrapeBeer: { ''' Bullets, Arrows, Darts, and Rockets gain homing If many are fired at the same time, this only applies to five of them - {0}% reduced critical strike chance + {0}% reduced critical strike damage {$Common.AlcoholWarning} ''' } From 35fa516f07301b4e827e6f24bdfdd4592e818318 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Mon, 4 Aug 2025 09:32:59 -0500 Subject: [PATCH 07/12] manhattan, screwdriver, cinnamon roll --- Buffs/Alcohol/ManhattanBuff.cs | 24 ++++++++ Buffs/Alcohol/ManhattanBuff.png | Bin 0 -> 626 bytes Buffs/Alcohol/ScrewdriverBuff.cs | 6 +- CalPlayer/CalamityPlayerMiscEffects.cs | 15 +++-- Items/Potions/Alcohol/CinnamonRoll.cs | 7 --- Items/Potions/Alcohol/Manhattan.cs | 54 ++++++++++++++++++ Items/Potions/Alcohol/Manhattan.png | Bin 0 -> 647 bytes .../en-US/Mods.CalamityMod.Buffs.hjson | 5 ++ .../Mods.CalamityMod.Items.Potions.hjson | 18 ++++-- 9 files changed, 110 insertions(+), 19 deletions(-) create mode 100644 Buffs/Alcohol/ManhattanBuff.cs create mode 100644 Buffs/Alcohol/ManhattanBuff.png create mode 100644 Items/Potions/Alcohol/Manhattan.cs create mode 100644 Items/Potions/Alcohol/Manhattan.png diff --git a/Buffs/Alcohol/ManhattanBuff.cs b/Buffs/Alcohol/ManhattanBuff.cs new file mode 100644 index 0000000000..2a8c160cd8 --- /dev/null +++ b/Buffs/Alcohol/ManhattanBuff.cs @@ -0,0 +1,24 @@ +using CalamityMod.Items.Potions.Alcohol; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Alcohol +{ + public class ManhattanBuff : ModBuff + { + public override void SetStaticDefaults() + { + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + player.Calamity().ColdDebuffMultiplier += Manhattan.DebuffBoost; + player.Calamity().WaterDebuffMultiplier -= Manhattan.DebuffLoss; + } + } +} diff --git a/Buffs/Alcohol/ManhattanBuff.png b/Buffs/Alcohol/ManhattanBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..8d3c026da5bca54f642800c06f8178c46c01d436 GIT binary patch literal 626 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCikF1AIbUfiyFNCbzVYgjVuXJH~(g5g*D~va-_Wa5B0^O#Hui@qZPSljpAd z|M7KVXz0^dAGYc;uaIK;8KdOH#i(J|xOC|vpU}juzaDG@8pK)P5n0T@z;_UY8Fx&~ zehUR|DNig)We7;j%q!9Ja}7~2)iczykj{Ly0;pzNYJ_K+r>7PJ2av3CK2NWMU8i(osO1+0FtM&jPYR;AR;k!wX<2z-Tl} zfgWazyvgx39K^6(gMhW>M}Gi0LebB&1_8y zoVpLlyx{5L7-Hc+_p-N8vw{Fiz@c=B(g2pP|J;2|r_4H~K5Sg#vgGSNd3Fx5?k$Z`$;qxR-(p!<#09oCO1yr% m!G=X%*Q;ks!}0mwIrlL3#YlF3y|q>t "Items.Potions"; - // Mana has a stupid formula so it won't go into the tooltip - public static float ManaRegenDelayBonus = 1f; - public static int ManaRegenBonus = 10; - public static float HeatDebuffBoost = 0.5f; - public static float DefenseLossPercent = 0.1f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f + HeatDebuffBoost).ToString(), DefenseLossPercent.ToPercent()); - public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; diff --git a/Items/Potions/Alcohol/Manhattan.cs b/Items/Potions/Alcohol/Manhattan.cs new file mode 100644 index 0000000000..d274d53d16 --- /dev/null +++ b/Items/Potions/Alcohol/Manhattan.cs @@ -0,0 +1,54 @@ +using CalamityMod.Buffs.Alcohol; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Ores; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Potions.Alcohol +{ + public class Manhattan : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Potions"; + + public static float DebuffBoost = 0.5f; + public static float DebuffLoss = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent()); + + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(225, 84, 33), + new Color(244, 176, 77), + new Color(255, 218, 102) + }; + } + + public override void SetDefaults() + { + Item.DefaultToFood(14, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); + + Item.value = Item.sellPrice(silver: 40); + Item.rare = ItemRarityID.LightPurple; + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.Ale). + AddIngredient(3). + AddTile(TileID.Kegs). + Register(); + + CreateRecipe(). + AddIngredient(ItemID.BottledWater). + AddIngredient(5). + AddIngredient(). + AddTile(TileID.AlchemyTable). + Register() + .DisableDecraft(); + } + } +} diff --git a/Items/Potions/Alcohol/Manhattan.png b/Items/Potions/Alcohol/Manhattan.png new file mode 100644 index 0000000000000000000000000000000000000000..c6226e8ff76826ebc4918f528f90d9e2ec7b02c5 GIT binary patch literal 647 zcmeAS@N?(olHy`uVBq!ia0vp^GC-`v!3-p;7kgF%DaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheegQrqu31^>PhWkQ!^s%P!0>O>_%)r2R2!t6$HM|;tf)XXJ5hcO-X(i=}MX3w{iJ5sNdVa1U z3Z{C7dKS`|uT}unY)g&sO!M^AV&DLBSQ(@kSs56CEH5CIhO$ASp~1)u7H0yo4H=mj z1b}oD5NEctfW@nsj7-%pW%~A%S)C6`07NAN4BVz-`1rSp~HnJ{&m^1~* z1_36ZxlCY{L6#Ok7F3s^fdNSNOrBVcSMUo^ByIC_aSXBW-+JLKU$X)aYk-4p#DOk( z(R=@0r=QC)KK-cRCvcc#w>#tiDVfz7o|moKAKB2jh68}pQ+)tC{=OR^C+Fv z*kBxr5@U$~fZZWsQqPdR6q l{%rM$H?~RV?(P2}lK)KJ Date: Wed, 20 Aug 2025 17:52:07 -0500 Subject: [PATCH 08/12] Grape Beer, Margarita, Starbeam Rye, Manhattan --- Buffs/Alcohol/MargaritaBuff.cs | 9 +- CalPlayer/CalamityPlayer.cs | 14 ++- CalPlayer/CalamityPlayerMiscEffects.cs | 19 +++- Items/Potions/Alcohol/GrapeBeer.cs | 7 +- Items/Potions/Alcohol/Manhattan.cs | 2 +- Items/Potions/Alcohol/Margarita.cs | 14 +-- .../Mods.CalamityMod.Items.Potions.hjson | 10 ++- Projectiles/CalamityGlobalProjectile.cs | 88 +++++++++++++++---- Projectiles/Ranged/VanquisherArrowProj.cs | 3 + 9 files changed, 116 insertions(+), 50 deletions(-) diff --git a/Buffs/Alcohol/MargaritaBuff.cs b/Buffs/Alcohol/MargaritaBuff.cs index fb43c678dc..34fe6db7fd 100644 --- a/Buffs/Alcohol/MargaritaBuff.cs +++ b/Buffs/Alcohol/MargaritaBuff.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Potions.Alcohol; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,6 +18,12 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { player.Calamity().margarita = true; + player.Calamity().HeatDebuffMultiplier -= Margarita.DebuffLoss; + player.Calamity().SicknessDebuffMultiplier -= Margarita.DebuffLoss; + player.Calamity().ColdDebuffMultiplier -= Margarita.DebuffLoss; + player.Calamity().WaterDebuffMultiplier -= Margarita.DebuffLoss; + player.Calamity().ElectricDebuffMultiplier -= Margarita.DebuffLoss; + player.Calamity().TypelessDebuffMultiplier -= Margarita.DebuffLoss; } } } diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 9af6796f50..c9646e09e5 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4647,6 +4647,12 @@ namespace CalamityMod.CalPlayer public override void PostUpdate() { + //reset the stored Y value for red wine's increased vertical speed + if (redWine && (redWineStoredY > 0.2f || redWineStoredY < -0.2f) && (Player.velocity.Y > 0.2f || Player.velocity.Y < -0.2f)) + { + Player.velocity.Y = redWineStoredY; + } + #region Managing time control if (Main.netMode != NetmodeID.Server && Player == Main.LocalPlayer) { @@ -5741,14 +5747,6 @@ namespace CalamityMod.CalPlayer } } } - public override void PostUpdate() - { - //reset the stored Y value for red wine's increased vertical speed - if (redWine && (redWineStoredY > 0.2f || redWineStoredY < -0.2f) && (Player.velocity.Y > 0.2f || Player.velocity.Y < -0.2f)) - { - Player.velocity.Y = redWineStoredY; - } - } #endregion #region Misc Stuff diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ec3b850307..980d5a2e27 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Balancing; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon; @@ -3534,8 +3535,20 @@ namespace CalamityMod.CalPlayer if (starBeamRye) { - Player.manaRegenBonus += (int)((Player.statManaMax2/3f + 1) *2f ); - Player.statManaMax2 = (int)(Player.statManaMax2 * StarBeamRye.MaxManaBoost); + Player.manaFlower = false; + Player.ClearBuff(ModContent.BuffType()); + if (!Player.manaSick) + { + Player.manaRegenCount -= Player.manaRegen; + Player.manaRegenDelay = 0; + Player.manaRegenCount += 20; // 20 mana per second, even while using an item + if (Player.HeldItem.mana > 0) + { + Main.NewText(Player.HeldItem.mana / (float)Player.HeldItem.useTime); + Player.GetDamage() += 0.5f + MathHelper.Max(0.1f,Player.HeldItem.mana / (float)Player.HeldItem.useTime); + } + Player.GetDamage() -= 0.5f; + } } if (moscowMule) @@ -5042,8 +5055,6 @@ namespace CalamityMod.CalPlayer if (item.type == ModContent.ItemType()) CalamityUtils.ConsumeItemViaQuickBuff(Player, item, HadalStew.BuffType, HadalStew.BuffDuration, true); - if (item.type == ModContent.ItemType()) - CalamityUtils.ConsumeItemViaQuickBuff(Player, item, Margarita.BuffType, CalamityUtils.MinutesToFrames(Margarita.MinuteDuration), false); } } } diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index 9fb604e4c8..b175f43a60 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -27,17 +27,12 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(12, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(2), true); + Item.DefaultToFood(12, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); Item.value = Item.sellPrice(silver: 3); Item.rare = ItemRarityID.LightRed; } - public override void OnConsumeItem(Player player) - { - //player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(SecondDuration)); - } - public override void AddRecipes() { CreateRecipe(10). diff --git a/Items/Potions/Alcohol/Manhattan.cs b/Items/Potions/Alcohol/Manhattan.cs index d274d53d16..d8159c7f92 100644 --- a/Items/Potions/Alcohol/Manhattan.cs +++ b/Items/Potions/Alcohol/Manhattan.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(14, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); + Item.DefaultToFood(14, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); Item.value = Item.sellPrice(silver: 40); Item.rare = ItemRarityID.LightPurple; diff --git a/Items/Potions/Alcohol/Margarita.cs b/Items/Potions/Alcohol/Margarita.cs index dc85eaba0f..1ceb04900a 100644 --- a/Items/Potions/Alcohol/Margarita.cs +++ b/Items/Potions/Alcohol/Margarita.cs @@ -13,10 +13,9 @@ namespace CalamityMod.Items.Potions.Alcohol public new string LocalizationCategory => "Items.Potions"; public static int BuffType = ModContent.BuffType(); - public static float DefenseLossPercent = 0.06f; - public static int RegenLoss = 1; - public static int MinuteDuration = 3; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseLossPercent.ToPercent(), RegenLoss.ToRegenPerSecond(), MinuteDuration); + public static float DebuffLoss = 0.5f; + public static int MinuteDuration = 3; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DebuffLoss.ToPercent()); public override void SetStaticDefaults() { @@ -30,16 +29,11 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToHealingPotion(28, 40, 200); + Item.DefaultToFood(28, 40, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); Item.value = Item.sellPrice(silver: 60); Item.rare = ItemRarityID.Lime; } - - public override void OnConsumeItem(Player player) - { - player.AddBuff(BuffType, CalamityUtils.MinutesToFrames(MinuteDuration)); - } public override void AddRecipes() { CreateRecipe(). diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 6b0258f564..08fc074698 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -253,8 +253,8 @@ Margarita: { DisplayName: Margarita Tooltip: ''' - Reduces duration of harmful debuffs by {0}% - Reduces damage of debuffs you inflict by {1}% + Halves duration of harmful debuffs you recieve + Reduces damage of debuffs you inflict by {0}% {$Common.AlcoholWarning} ''' } @@ -334,8 +334,10 @@ StarBeamRye: { DisplayName: Star Beam Rye Tooltip: ''' - {0}% increased Mana regeneration - {1}% decreased maximum Mana + Disabled natural mana regeneration + Mana regenerates at a fixed rate, even while using an item + Magic weapons deal increased damage based on how quickly they consume mana + This does not work while inflicted with Mana Sickness {$Common.AlcoholWarning} ''' } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index a338623764..ecefd5dbfe 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -181,6 +181,17 @@ namespace CalamityMod.Projectiles /// public float conditionalHomingRange = 0f; + /// + /// Causes a projectile to use both Static and Local iframes when set + /// + public bool HybridIframes = false; + + /// + /// Whether or not this proj was spawned with grape beer on + /// this does NOT mean it has grape beer homing! + /// + public bool GrapeBeer = false; + /// /// Variable used for storing the actual amount of extra updates a projectile has.
/// This is NOT set automatically, and must be set whenever it is needed. @@ -297,16 +308,50 @@ namespace CalamityMod.Projectiles projectile.Calamity().supercritHits = -1; } + void ApplyGrapeBeer() + { + + conditionalHomingRange = 600; + if (projectile.timeLeft > 300 * projectile.MaxUpdates) + projectile.timeLeft = 300 * projectile.MaxUpdates; + HybridIframes = true; + projectile.localNPCHitCooldown = -1; + projectile.usesLocalNPCImmunity = true; + Main.player[projectile.owner].Calamity().grapeBeerTimer++; + } + if (source is EntitySource_ItemUse_WithAmmo {Item: Item item}) + { + if (source is EntitySource_Parent { Entity: Player player }) + { + if (player.Calamity().grapeBeer && (item.useAmmo == AmmoID.Bullet || item.useAmmo == AmmoID.Arrow || item.useAmmo == AmmoID.Dart || item.useAmmo == AmmoID.Rocket)) + { + if (player.heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile && projectile.damage > 0 && player.Calamity().grapeBeerTimer < 5) + ApplyGrapeBeer(); + else + GrapeBeer = true; + } + } + } + if (source is EntitySource_Parent { Entity: NPC npc }) { if (!npc.friendly) ParentNPCIndex = npc.whoAmI; } // - // SPECIFIC PROJECTILE BALANCE CHANGES + // SPECIFIC PROJECTILE BALANCE CHANGES (and Grape Beer homing) // else if (source is EntitySource_Parent { Entity: Projectile parent }) { + //Grape Beer homing + if (parent.Calamity().GrapeBeer) + { + if (Main.player[projectile.owner].heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile && projectile.damage > 0 && Main.player[projectile.owner].Calamity().grapeBeerTimer < 5) + ApplyGrapeBeer(); + else + GrapeBeer = true; + } + // Nerf Crystal bullet shard damage by 45% // Vanilla crystal shards deal 50% of the bullet's damage which is absurd, this nerfs them to 27.5% if (parent.type == ProjectileID.CrystalBullet && projectile.type == ProjectileID.CrystalShard) @@ -364,13 +409,20 @@ namespace CalamityMod.Projectiles #region Pre AI public override bool PreAI(Projectile projectile) { + ///Apply Hybrid iframes + if (HybridIframes) + { + projectile.usesIDStaticNPCImmunity = true; + projectile.usesLocalNPCImmunity = true; + } + #region Vanilla Summons AI Changes - // - // MINION AI CHANGES: - // + // + // MINION AI CHANGES: + // - // Hornet Staff's minion changes. + // Hornet Staff's minion changes. if (projectile.type == ProjectileID.Hornet) return HornetMinionAI.DoHornetMinionAI(projectile); @@ -2914,17 +2966,6 @@ namespace CalamityMod.Projectiles if (modPlayer.filthyGlove || modPlayer.bloodyGlove) projectile.ArmorPenetration += gloveArmorPenAmt; } - if (player.Calamity().grapeBeer && player.heldProj != projectile.whoAmI && projectile.damage > 0 && projectile.DamageType == DamageClass.Ranged && projectile.Distance(player.Center) < 80) - { - var item = player.ActiveItem(); - if (item != null && (item.useAmmo == AmmoID.Bullet || item.useAmmo == AmmoID.Arrow || item.useAmmo == AmmoID.Dart || item.useAmmo == AmmoID.Rocket) && player.Calamity().grapeBeerTimer < 5) - { - conditionalHomingRange += 600; - player.Calamity().grapeBeerTimer += 1; - if (projectile.usesLocalNPCImmunity) - projectile.localNPCHitCooldown = -1; - } - } } if (NPC.downedMoonlord) @@ -3917,6 +3958,12 @@ namespace CalamityMod.Projectiles #region On Hit NPC public override void OnHitNPC(Projectile projectile, NPC target, NPC.HitInfo hit, int damageDone) { + //Manage Hybrid iframes + if (HybridIframes && (projectile.penetrate != 1 || projectile.appliesImmunityTimeOnSingleHits)) + { + projectile.localNPCImmunity[target.whoAmI] = projectile.localNPCHitCooldown; + Projectile.perIDStaticNPCImmunity[projectile.type][target.whoAmI] = Main.GameUpdateCount + (uint)projectile.idStaticNPCHitCooldown; + } if (BloodstoneOrbValue > 0) Projectile.NewProjectile(projectile.GetSource_OnHit(target), projectile.Center, projectile.velocity.SafeNormalize(Vector2.Zero) * Math.Min(((projectile.velocity.Length() * projectile.MaxUpdates) / 4f), 4f) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), BloodstoneOrbValue, 0f, Main.player[projectile.owner].whoAmI); //Mana Burn @@ -4030,6 +4077,15 @@ namespace CalamityMod.Projectiles return null; } + public override bool? CanHitNPC(Projectile projectile, NPC target) + { + if (HybridIframes && (projectile.localNPCImmunity[target.whoAmI] != 0 || Projectile.perIDStaticNPCImmunity[projectile.type][target.whoAmI] > Main.GameUpdateCount)) + { + return false; + } + return base.CanHitNPC(projectile, target); + } + // Cultist lightning orbs cannot hit players specifically. This could probably be switched to CanDamage? public override bool CanHitPlayer(Projectile projectile, Player target) { diff --git a/Projectiles/Ranged/VanquisherArrowProj.cs b/Projectiles/Ranged/VanquisherArrowProj.cs index 31f5215ec9..ec54cf5149 100644 --- a/Projectiles/Ranged/VanquisherArrowProj.cs +++ b/Projectiles/Ranged/VanquisherArrowProj.cs @@ -52,6 +52,9 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { + //This is so Grape Beer works properly with them + if (targeted != null && Projectile.localNPCImmunity[targeted.whoAmI] == -1) + Projectile.localNPCImmunity[targeted.whoAmI] = 15 * Projectile.extraUpdates; float rate = Main.GlobalTimeWrappedHourly * 5; List eColors = new List() { From 6f4a42572aee842a3dfc1eada65763ec14403a9f Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Mon, 22 Dec 2025 00:02:26 -0600 Subject: [PATCH 09/12] fix white wine recipe --- Items/Potions/Alcohol/WhiteWine.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Items/Potions/Alcohol/WhiteWine.cs b/Items/Potions/Alcohol/WhiteWine.cs index 815f3eb0ce..bfd006b1b9 100644 --- a/Items/Potions/Alcohol/WhiteWine.cs +++ b/Items/Potions/Alcohol/WhiteWine.cs @@ -45,7 +45,6 @@ namespace CalamityMod.Items.Potions.Alcohol CreateRecipe(12). AddIngredient(ItemID.Bottle, 12). AddIngredient(ItemID.GiantHarpyFeather). - AddIngredient(10). AddTile(TileID.Kegs). Register(); } From 40d75c7a1b295dea8c90f724b76d54520a228e04 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Mon, 22 Dec 2025 00:10:27 -0600 Subject: [PATCH 10/12] missed some cleanups --- Buffs/Alcohol/PurpleHazeBuff.cs | 2 +- CalPlayer/CalamityPlayerLifeRegen.cs | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Buffs/Alcohol/PurpleHazeBuff.cs b/Buffs/Alcohol/PurpleHazeBuff.cs index 95aa4b7330..9ef31ce2b1 100644 --- a/Buffs/Alcohol/PurpleHazeBuff.cs +++ b/Buffs/Alcohol/PurpleHazeBuff.cs @@ -4,7 +4,7 @@ using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol { - public class PurpleHazeBuff : ModBuff //FIX THIS DOZE - Hybrid Stealth + public class PurpleHazeBuff : ModBuff { public override void SetStaticDefaults() { diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 938e0aa92f..cb5743b8d9 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -433,16 +433,6 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += 3; } - //If a player had a life regen hindering debuff, add 30 seconds to their regen time when under Tequila Sunrise - //This stacks with all other post-debuff boosts due to Tequila Sunrise increasing DoT damage taken - if (tequilaSunrise) - { - if (hadLifeRegenHinderingDebuff && !hasLifeRegenHinderingDebuff) - { - Player.lifeRegenTime += 1800; - } - } - //If a player had a life regen hindering debuff, add 30 seconds to their regen time when under Tequila Sunrise //This stacks with all other post-debuff boosts due to Tequila Sunrise increasing DoT damage taken if (tequilaSunrise) From 53308217e3d8122ffd26a9057eedbd50e5278dbd Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Tue, 23 Dec 2025 13:40:05 -0800 Subject: [PATCH 11/12] remove debug text --- CalPlayer/CalamityPlayerMiscEffects.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 1bb7860b44..78000b3c77 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3621,7 +3621,6 @@ namespace CalamityMod.CalPlayer Player.manaRegenCount += 20; // 20 mana per second, even while using an item if (Player.HeldItem.mana > 0) { - Main.NewText(Player.HeldItem.mana / (float)Player.HeldItem.useTime); Player.GetDamage() += 0.5f + MathHelper.Max(0.1f,Player.HeldItem.mana / (float)Player.HeldItem.useTime); } Player.GetDamage() -= 0.5f; From 0b75c222bc6a538deddb0836fe7c9d8eb808153d Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Tue, 23 Dec 2025 20:56:02 -0600 Subject: [PATCH 12/12] cleanup --- Buffs/Alcohol/EvergreenGinBuff.cs | 11 ++++++----- Buffs/Alcohol/FireballBuff.cs | 7 ++++--- Buffs/Alcohol/GrapeBeerBuff.cs | 5 +++-- Buffs/Alcohol/ManhattanBuff.cs | 5 +++-- Buffs/Alcohol/MargaritaBuff.cs | 15 ++++++++------- Buffs/Alcohol/TequilaBuff.cs | 8 ++++---- Buffs/Alcohol/VodkaBuff.cs | 15 ++++++++------- CalPlayer/CalamityPlayerHitHurt.cs | 2 +- .../en-US/Mods.CalamityMod.Buffs.hjson | 2 +- .../en-US/Mods.CalamityMod.Items.Potions.hjson | 5 +++-- .../en-US/Mods.CalamityMod.Vanilla.hjson | 2 +- NPCs/CalamityPierceResistance.cs | 8 ++++---- Projectiles/CalamityGlobalProjectile.cs | 18 +++++++++--------- 13 files changed, 55 insertions(+), 48 deletions(-) diff --git a/Buffs/Alcohol/EvergreenGinBuff.cs b/Buffs/Alcohol/EvergreenGinBuff.cs index cf6a11e6b6..fd9ae4a227 100644 --- a/Buffs/Alcohol/EvergreenGinBuff.cs +++ b/Buffs/Alcohol/EvergreenGinBuff.cs @@ -17,11 +17,12 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { - player.Calamity().evergreenGin = true; - player.Calamity().SicknessDebuffMultiplier += EvergreenGin.DebuffBoost; - player.Calamity().WaterDebuffMultiplier += EvergreenGin.DebuffBoost; - player.Calamity().ElectricDebuffMultiplier -= EvergreenGin.DebuffLoss; - player.Calamity().HeatDebuffMultiplier -= EvergreenGin.DebuffLoss; + var cplayer = player.Calamity(); + cplayer.evergreenGin = true; + cplayer.SicknessDebuffMultiplier += EvergreenGin.DebuffBoost; + cplayer.WaterDebuffMultiplier += EvergreenGin.DebuffBoost; + cplayer.ElectricDebuffMultiplier -= EvergreenGin.DebuffLoss; + cplayer.HeatDebuffMultiplier -= EvergreenGin.DebuffLoss; } } } diff --git a/Buffs/Alcohol/FireballBuff.cs b/Buffs/Alcohol/FireballBuff.cs index 7f4f22cf9b..17a16d6784 100644 --- a/Buffs/Alcohol/FireballBuff.cs +++ b/Buffs/Alcohol/FireballBuff.cs @@ -17,9 +17,10 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { - player.Calamity().fireball = true; - player.Calamity().HeatDebuffMultiplier += Fireball.DebuffBoost; - player.Calamity().SicknessDebuffMultiplier -= Fireball.DebuffLoss; + var cplayer = player.Calamity(); + cplayer.fireball = true; + cplayer.HeatDebuffMultiplier += Fireball.DebuffBoost; + cplayer.SicknessDebuffMultiplier -= Fireball.DebuffLoss; } } } diff --git a/Buffs/Alcohol/GrapeBeerBuff.cs b/Buffs/Alcohol/GrapeBeerBuff.cs index 886fdf42e6..cf2f1bf0f4 100644 --- a/Buffs/Alcohol/GrapeBeerBuff.cs +++ b/Buffs/Alcohol/GrapeBeerBuff.cs @@ -17,8 +17,9 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { - player.Calamity().grapeBeer = true; - player.Calamity().critDamage -= GrapeBeer.CritLoss * 0.01f; + var cplayer = player.Calamity(); + cplayer.grapeBeer = true; + cplayer.critDamage -= GrapeBeer.CritLoss * 0.01f; } } } diff --git a/Buffs/Alcohol/ManhattanBuff.cs b/Buffs/Alcohol/ManhattanBuff.cs index 2a8c160cd8..d67bf91dcc 100644 --- a/Buffs/Alcohol/ManhattanBuff.cs +++ b/Buffs/Alcohol/ManhattanBuff.cs @@ -17,8 +17,9 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { - player.Calamity().ColdDebuffMultiplier += Manhattan.DebuffBoost; - player.Calamity().WaterDebuffMultiplier -= Manhattan.DebuffLoss; + var cplayer = player.Calamity(); + cplayer.ColdDebuffMultiplier += Manhattan.DebuffBoost; + cplayer.WaterDebuffMultiplier -= Manhattan.DebuffLoss; } } } diff --git a/Buffs/Alcohol/MargaritaBuff.cs b/Buffs/Alcohol/MargaritaBuff.cs index 34fe6db7fd..da30dd849b 100644 --- a/Buffs/Alcohol/MargaritaBuff.cs +++ b/Buffs/Alcohol/MargaritaBuff.cs @@ -17,13 +17,14 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { - player.Calamity().margarita = true; - player.Calamity().HeatDebuffMultiplier -= Margarita.DebuffLoss; - player.Calamity().SicknessDebuffMultiplier -= Margarita.DebuffLoss; - player.Calamity().ColdDebuffMultiplier -= Margarita.DebuffLoss; - player.Calamity().WaterDebuffMultiplier -= Margarita.DebuffLoss; - player.Calamity().ElectricDebuffMultiplier -= Margarita.DebuffLoss; - player.Calamity().TypelessDebuffMultiplier -= Margarita.DebuffLoss; + var cplayer = player.Calamity(); + cplayer.margarita = true; + cplayer.HeatDebuffMultiplier -= Margarita.DebuffLoss; + cplayer.SicknessDebuffMultiplier -= Margarita.DebuffLoss; + cplayer.ColdDebuffMultiplier -= Margarita.DebuffLoss; + cplayer.WaterDebuffMultiplier -= Margarita.DebuffLoss; + cplayer.ElectricDebuffMultiplier -= Margarita.DebuffLoss; + cplayer.TypelessDebuffMultiplier -= Margarita.DebuffLoss; } } } diff --git a/Buffs/Alcohol/TequilaBuff.cs b/Buffs/Alcohol/TequilaBuff.cs index c8652b5fb7..4014fcad49 100644 --- a/Buffs/Alcohol/TequilaBuff.cs +++ b/Buffs/Alcohol/TequilaBuff.cs @@ -17,10 +17,10 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { - player.Calamity().tequila = true; - - player.Calamity().ElectricDebuffMultiplier += Tequila.DebuffBoost; - player.Calamity().ColdDebuffMultiplier -= Tequila.DebuffLoss; + var cplayer = player.Calamity(); + cplayer.tequila = true; + cplayer.ElectricDebuffMultiplier += Tequila.DebuffBoost; + cplayer.ColdDebuffMultiplier -= Tequila.DebuffLoss; } } } diff --git a/Buffs/Alcohol/VodkaBuff.cs b/Buffs/Alcohol/VodkaBuff.cs index fee30c6753..b7844903ef 100644 --- a/Buffs/Alcohol/VodkaBuff.cs +++ b/Buffs/Alcohol/VodkaBuff.cs @@ -17,13 +17,14 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { - player.Calamity().vodka = true; - player.Calamity().TypelessDebuffMultiplier += Vodka.DebuffBoost; - player.Calamity().HeatDebuffMultiplier -= Vodka.DebuffLoss; - player.Calamity().ColdDebuffMultiplier -= Vodka.DebuffLoss; - player.Calamity().SicknessDebuffMultiplier -= Vodka.DebuffLoss; - player.Calamity().WaterDebuffMultiplier -= Vodka.DebuffLoss; - player.Calamity().ElectricDebuffMultiplier -= Vodka.DebuffLoss; + var cplayer = player.Calamity(); + cplayer.vodka = true; + cplayer.TypelessDebuffMultiplier += Vodka.DebuffBoost; + cplayer.HeatDebuffMultiplier -= Vodka.DebuffLoss; + cplayer.ColdDebuffMultiplier -= Vodka.DebuffLoss; + cplayer.SicknessDebuffMultiplier -= Vodka.DebuffLoss; + cplayer.WaterDebuffMultiplier -= Vodka.DebuffLoss; + cplayer.ElectricDebuffMultiplier -= Vodka.DebuffLoss; } } } diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 3d83e210ae..3045b54e08 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -2048,7 +2048,7 @@ namespace CalamityMod.CalPlayer double halfDefense = Player.statDefense / 2.0; if (bloodflareCore) specialDefenseDmgMinimum += halfDefense; - if (moonshine) + if (moonshine) //Moonshine also halves defense damage recovery alongside forcing 50% of defense as defense damage specialDefenseDmgMinimum += halfDefense; int netMitigation = hurtInfo.SourceDamage - hurtInfo.Damage; double standardDefenseDamage = netMitigation * defenseDamageRatio; diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 5b844145fa..93580a9825 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -102,7 +102,7 @@ VodkaBuff: { WhiskeyBuff: { DisplayName: Whiskey - Description: Increased damage when spawwing weapons + Description: Increased damage when swapping weapons } WhiteWineBuff: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index b5666acd00..1f008c762f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -273,7 +273,8 @@ Moonshine: { Tooltip: ''' Increases maximum health by {0}% - Attacks always take at least half your defense worth of defense damage, and slows defense damage recovery slightly + Attacks always take at least half your defense worth of defense damage + Defense damage takes twice as long to recover {$Common.AlcoholWarning} ''' } @@ -282,7 +283,7 @@ MoscowMule: { DisplayName: Moscow Mule Tooltip: ''' - {0}% increased knockback, all attacks infict Heavy Knockback + {0}% increased knockback, all attacks infict heavy knockback Reduces the effectiveness of piercing weapons {$Common.AlcoholWarning} ''' diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index c9b53eba4e..fdfc10a0fc 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -216,7 +216,7 @@ EditedTooltip: { ArcheryPotion: 5% increased arrow damage and 20% increased arrow speed AleSake: ''' - Increases melee size by 15%, but decreases melee speed by 10% + Increases melee weapon scale by 15%, but decreases melee speed by 10% Counts as an alcohol for Alcohol Poisoning {$Common.AlcoholWarning} ''' diff --git a/NPCs/CalamityPierceResistance.cs b/NPCs/CalamityPierceResistance.cs index 96b559c615..2ee5de4bbc 100644 --- a/NPCs/CalamityPierceResistance.cs +++ b/NPCs/CalamityPierceResistance.cs @@ -13,10 +13,10 @@ namespace CalamityMod.NPCs { public sealed class PierceResistNPC : GlobalNPC { - public static HashSet exemptProjectiles; - public static HashSet pierceResistNPC; - public static HashSet singleHitboxNPC; - public static Dictionary singleHitboxExemptProjectiles; + internal static HashSet exemptProjectiles; + internal static HashSet pierceResistNPC; + internal static HashSet singleHitboxNPC; + internal static Dictionary singleHitboxExemptProjectiles; public override void Load() { diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index ae10538b4c..cd8f2b1a49 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -193,13 +193,13 @@ namespace CalamityMod.Projectiles /// /// Causes a projectile to use both Static and Local iframes when set /// - public bool HybridIframes = false; + public bool hybridIframes = false; /// /// Whether or not this proj was spawned with grape beer on /// this does NOT mean it has grape beer homing! /// - public bool GrapeBeer = false; + public bool grapeBeer = false; /// /// Variable used for storing the actual amount of extra updates a projectile has.
@@ -325,7 +325,7 @@ namespace CalamityMod.Projectiles conditionalHomingRange = 600; if (projectile.timeLeft > 300 * projectile.MaxUpdates) projectile.timeLeft = 300 * projectile.MaxUpdates; - HybridIframes = true; + hybridIframes = true; projectile.localNPCHitCooldown = -1; projectile.usesLocalNPCImmunity = true; Main.player[projectile.owner].Calamity().grapeBeerTimer++; @@ -339,7 +339,7 @@ namespace CalamityMod.Projectiles if (player.heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile && projectile.damage > 0 && player.Calamity().grapeBeerTimer < 5) ApplyGrapeBeer(); else - GrapeBeer = true; + grapeBeer = true; } } } @@ -355,12 +355,12 @@ namespace CalamityMod.Projectiles else if (source is EntitySource_Parent { Entity: Projectile parent }) { //Grape Beer homing - if (parent.Calamity().GrapeBeer) + if (parent.Calamity().grapeBeer) { if (Main.player[projectile.owner].heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile && projectile.damage > 0 && Main.player[projectile.owner].Calamity().grapeBeerTimer < 5) ApplyGrapeBeer(); else - GrapeBeer = true; + grapeBeer = true; } // Nerf Crystal bullet shard damage by 45% @@ -422,7 +422,7 @@ namespace CalamityMod.Projectiles public override bool PreAI(Projectile projectile) { ///Apply Hybrid iframes - if (HybridIframes) + if (hybridIframes) { projectile.usesIDStaticNPCImmunity = true; projectile.usesLocalNPCImmunity = true; @@ -4633,7 +4633,7 @@ namespace CalamityMod.Projectiles public override void OnHitNPC(Projectile projectile, NPC target, NPC.HitInfo hit, int damageDone) { //Manage Hybrid iframes - if (HybridIframes && (projectile.penetrate != 1 || projectile.appliesImmunityTimeOnSingleHits)) + if (hybridIframes && (projectile.penetrate != 1 || projectile.appliesImmunityTimeOnSingleHits)) { projectile.localNPCImmunity[target.whoAmI] = projectile.localNPCHitCooldown; Projectile.perIDStaticNPCImmunity[projectile.type][target.whoAmI] = Main.GameUpdateCount + (uint)projectile.idStaticNPCHitCooldown; @@ -4769,7 +4769,7 @@ namespace CalamityMod.Projectiles public override bool? CanHitNPC(Projectile projectile, NPC target) { - if (HybridIframes && (projectile.localNPCImmunity[target.whoAmI] != 0 || Projectile.perIDStaticNPCImmunity[projectile.type][target.whoAmI] > Main.GameUpdateCount)) + if (hybridIframes && (projectile.localNPCImmunity[target.whoAmI] != 0 || Projectile.perIDStaticNPCImmunity[projectile.type][target.whoAmI] > Main.GameUpdateCount)) return false; if (target.Calamity().IsArmored() && HomingTarget > -1 && HomingTarget != target.whoAmI) return false;