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