From 1bfe189dc8de1546b69d045d5243ecaf2fdcfd30 Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Sat, 14 Dec 2024 18:52:01 -0800 Subject: [PATCH] Small rework to Corrosive Spine + Whiskey fix --- CalPlayer/CalamityPlayerHitHurt.cs | 13 ++++++ CalPlayer/CalamityPlayerLifeRegen.cs | 4 +- CalPlayer/CalamityPlayerOnHit.cs | 43 +++---------------- Items/Accessories/CorrosiveSpine.cs | 27 ++---------- Items/Potions/Alcohol/Whiskey.cs | 2 +- .../Mods.CalamityMod.Items.Accessories.hjson | 5 ++- NPCs/CalamityGlobalNPC.cs | 9 +++- 7 files changed, 38 insertions(+), 65 deletions(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 61f822f94b..f93a99d6ea 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1546,6 +1546,19 @@ namespace CalamityMod.CalPlayer dust2.color = Main.rand.NextBool() ? Color.Coral : Color.DarkTurquoise; } } + + if (corrosiveSpine) + { + int cloudCount = 3; + for (int i = 0; i < cloudCount; i++) + { + float speed = 2f; + int damage = 40; + int cloud = Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * speed, ModContent.ProjectileType(), damage, 0f, Player.whoAmI); + if (cloud.WithinBounds(Main.maxProjectiles)) + Main.projectile[cloud].DamageType = DamageClass.Generic; + } + } } #endregion diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 541d3403b0..e2c07cb591 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -99,7 +99,7 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(wDeath, 0); ApplyDoTDebuff(irradiated, 4, purity); - int sulphurDoT = 6 - (sulphurSet ? 2 : 0) - (sulphurskin ? 2 : 0); + int sulphurDoT = 6 - (sulphurSet ? 2 : 0) - (sulphurskin ? 2 : 0) - (corrosiveSpine ? 2 : 0); ApplyDoTDebuff(sulphurPoison, sulphurDoT, purity); ApplyDoTDebuff(rTide, 6, purity); ApplyDoTDebuff(weakBrimstoneFlames, 7); @@ -167,6 +167,8 @@ namespace CalamityMod.CalPlayer increment *= 0.5f; if (sulphurSet && !ASPoisoning) increment *= 0.5f; + if (corrosiveSpine && !ASPoisoning) + increment *= 0.5f; if (ZoneAbyssLayer1 && !ASPoisoning) increment *= 0.33f; diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 79cd74b765..4b481bc38e 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -83,6 +83,7 @@ namespace CalamityMod.CalPlayer target.Calamity().IncreasedSicknessEffects_ToxicHeart = toxicHeart; target.Calamity().IncreasedSicknessAndWaterEffects_EvergreenGin = evergreenGin; + target.Calamity().IncreasedSicknessAndWaterEffects_CorrosiveSpine = corrosiveSpine; switch (item.type) { @@ -198,6 +199,7 @@ namespace CalamityMod.CalPlayer cgn.IncreasedSicknessEffects_ToxicHeart = toxicHeart; cgn.IncreasedSicknessAndWaterEffects_EvergreenGin = evergreenGin; + cgn.IncreasedSicknessAndWaterEffects_CorrosiveSpine = corrosiveSpine; switch (proj.type) { @@ -1031,39 +1033,6 @@ namespace CalamityMod.CalPlayer titanCooldown = 15; } - if (corrosiveSpine && modProj.stealthStrikeHitCount < 3 && (Player.ownedProjectileCounts[ProjectileType()] + Player.ownedProjectileCounts[ProjectileType()] + Player.ownedProjectileCounts[ProjectileType()]) < 3) - { - for (int i = 0; i < 3; i++) - { - if (Main.rand.NextBool()) - { - int type = -1; - switch (Main.rand.Next(15)) - { - case 0: - type = ProjectileType(); - break; - case 1: - type = ProjectileType(); - break; - case 2: - type = ProjectileType(); - break; - } - - if (type != -1) - { - int damage = (int)Player.GetTotalDamage().ApplyTo(22); - - float speed = Main.rand.NextFloat(5f, 11f); - int cloud = Projectile.NewProjectile(spawnSource, position, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * speed, type, damage, proj.knockBack, Player.whoAmI); - if (cloud.WithinBounds(Main.maxProjectiles)) - Main.projectile[cloud].DamageType = DamageClass.Generic; - } - } - } - } - if (raiderTalisman && modProj.stealthStrike) { raiderCritLifespan = CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown); @@ -1164,10 +1133,6 @@ namespace CalamityMod.CalPlayer { target.AddBuff(BuffType(), 120); } - if (corrosiveSpine) - { - target.AddBuff(BuffID.Poisoned, 240); - } } if (summon) { @@ -1222,6 +1187,10 @@ namespace CalamityMod.CalPlayer { CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); } + if (corrosiveSpine) + { + target.AddBuff(BuffType(), 120); + } if (alchFlask) { CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); diff --git a/Items/Accessories/CorrosiveSpine.cs b/Items/Accessories/CorrosiveSpine.cs index 6f99322f4d..f9bc1fde4a 100644 --- a/Items/Accessories/CorrosiveSpine.cs +++ b/Items/Accessories/CorrosiveSpine.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -21,29 +22,9 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.corrosiveSpine = true; player.moveSpeed += 0.05f; - player.Calamity().corrosiveSpine = true; - if (player.immune) - { - if (Main.rand.NextBool(15)) - { - var source = player.GetSource_Accessory(Item); - int cloudCount = Main.rand.Next(2, 5); - for (int i = 0; i < cloudCount; i++) - { - int type = Utils.SelectRandom(Main.rand, new int[] - { - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType() - }); - float speed = Main.rand.NextFloat(3f, 11f); - int damage = (int)player.GetTotalDamage().ApplyTo(80); - Projectile.NewProjectile(source, player.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * speed, - type, damage, 0f, player.whoAmI); - } - } - } } } } diff --git a/Items/Potions/Alcohol/Whiskey.cs b/Items/Potions/Alcohol/Whiskey.cs index 266eb72018..a51019706d 100644 --- a/Items/Potions/Alcohol/Whiskey.cs +++ b/Items/Potions/Alcohol/Whiskey.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Potions.Alcohol public static float DamageBoost = 0.04f; public static float KnockbackBoost = 0.2f; public static int CritBoost = 2; - public static float DefenseLossPercent = 5; + public static float DefenseLossPercent = 0.05f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), KnockbackBoost.ToPercent(), CritBoost, DefenseLossPercent.ToPercent()); public override void SetStaticDefaults() diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 5be6435e20..ce940220d3 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -441,8 +441,9 @@ CorrosiveSpine: { Tooltip: ''' 5% increased movement speed - All rogue weapons inflict poison and spawn poisoned clouds on enemy hits - You release a ton of clouds everywhere on hit + Multiplies all sickness and water-related debuff damage by 1.25x + All attacks irradiate enemies and reduces the severity of the sulphuric waters + You burst into radioactive clouds when struck ''' } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 6cf45e0bd9..ec847e1600 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -150,8 +150,9 @@ namespace CalamityMod.NPCs // Toxic Heart effect public bool IncreasedSicknessEffects_ToxicHeart = false; - // Evergreen Gin effect + // Sickness and Water debuff effects public bool IncreasedSicknessAndWaterEffects_EvergreenGin = false; + public bool IncreasedSicknessAndWaterEffects_CorrosiveSpine = false; /// Constant representing the grace period, in frames, in which a boss can remain outside of its native biome before enraging. public const int biomeEnrageTimerMax = 300; @@ -490,6 +491,7 @@ namespace CalamityMod.NPCs myClone.IncreasedHeatEffects_FireBoots = IncreasedHeatEffects_FireBoots; myClone.IncreasedHeatEffects_FlameWings = IncreasedHeatEffects_FlameWings; myClone.IncreasedSicknessEffects_ToxicHeart = IncreasedSicknessEffects_ToxicHeart; + myClone.IncreasedSicknessAndWaterEffects_CorrosiveSpine = IncreasedSicknessAndWaterEffects_CorrosiveSpine; myClone.IncreasedSicknessAndWaterEffects_EvergreenGin = IncreasedSicknessAndWaterEffects_EvergreenGin; myClone.velocityPriorToPhaseSwap = velocityPriorToPhaseSwap; @@ -911,6 +913,11 @@ namespace CalamityMod.NPCs if (IncreasedSicknessEffects_ToxicHeart) sicknessDamageMult += 0.5; + if (IncreasedSicknessAndWaterEffects_CorrosiveSpine) + { + sicknessDamageMult += 0.25; + waterDamageMult += 0.25; + } if (IncreasedSicknessAndWaterEffects_EvergreenGin) { sicknessDamageMult += EvergreenGin.SicknessWaterDebuffBoost;