diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1eaf435872..1e1b2c5233 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -74,6 +74,7 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using Terraria.ModLoader.IO; +using static Terraria.ModLoader.PlayerDrawLayer; namespace CalamityMod.CalPlayer { @@ -233,6 +234,7 @@ namespace CalamityMod.CalPlayer public int auralisAurora = 0; public int necroReviveCounter = -1; public int hideOfDeusTimer = 0; + public int giantShellPostHit = 0; public int spiritOriginBullseyeShootCountdown = 0; public int spiritOriginConvertedCrit = 0; public int RustyMedallionCooldown = 0; @@ -528,6 +530,8 @@ namespace CalamityMod.CalPlayer public bool spiritOrigin = false; public bool spiritOriginVanity = false; public bool darkSunRing = false; + public bool crawCarapace = false; + public bool HasReducedDashFirstFrame = false; public bool voidOfCalamity = false; public bool voidOfExtinction = false; public bool eArtifact = false; @@ -1592,6 +1596,8 @@ namespace CalamityMod.CalPlayer harpyWingBoost = false; //harpy wings + harpy ring fleshKnuckles = false; darkSunRing = false; + crawCarapace = false; + gShell = false; voidOfCalamity = false; voidOfExtinction = false; eArtifact = false; @@ -4881,7 +4887,13 @@ namespace CalamityMod.CalPlayer if (NPC.AnyNPCs(ModContent.NPCType())) { Player.AddBuff(ModContent.BuffType(), 15, true); - } + } + + if (crawCarapace) + { + npc.AddBuff(ModContent.BuffType(), (int)720); + SoundEngine.PlaySound(SoundID.NPCHit33 with { Volume = 0.5f }, Player.Center); + } } public override void OnHitByProjectile(Projectile proj, Player.HurtInfo hurtInfo) @@ -5803,9 +5815,12 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(SoundID.Item96, Player.Center); } - if ((gShell || flameLickedShell) && !Player.panic) + if ((flameLickedShell) && !Player.panic) Player.AddBuff(ModContent.BuffType(), 180); + if (gShell) //5 seconds of no dash reduction and reduced defense + giantShellPostHit = 300; + if (abyssalDivingSuitPlates && hurtInfo.Damage > 50) { if (abyssalDivingSuitPlateHits < 3) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index bcfe84af6c..8f13c2a769 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -238,6 +238,21 @@ namespace CalamityMod.CalPlayer //Todo - Move this back to the wulfrum set class whenever statmodifiers are implemented for stats other than damage if (WulfrumHat.PowerModeEngaged(Player, out _)) Player.moveSpeed *= 0.8f; + + if (gShell) + { + //reduce player dash velocity as long as you didn't just get hit + if (Player.dashDelay == -1 && giantShellPostHit == 0) + { + if (!HasReducedDashFirstFrame) + { + Player.velocity.X *= 0.9f; + HasReducedDashFirstFrame = true; + } + } + else + HasReducedDashFirstFrame = false; + } } #endregion @@ -2485,6 +2500,26 @@ namespace CalamityMod.CalPlayer Player.statDefense += Main.eclipse ? 10 : 20; } + if (crawCarapace) + Player.GetDamage() += 0.05f; + + if (gShell) + { + if (giantShellPostHit == 1) + SoundEngine.PlaySound(SoundID.Zombie58, Player.Center); + + if (giantShellPostHit > 0) + { + Player.statDefense -= 5; + giantShellPostHit--; + } + if (giantShellPostHit < 0) + { + giantShellPostHit = 0; + } + } + + // Ancient Chisel nerf if (Player.chiselSpeed) Player.pickSpeed += 0.1f; diff --git a/Items/Accessories/CrawCarapace.cs b/Items/Accessories/CrawCarapace.cs index 4e01739f08..65c64a6ed6 100644 --- a/Items/Accessories/CrawCarapace.cs +++ b/Items/Accessories/CrawCarapace.cs @@ -1,6 +1,7 @@ using Terraria; using Terraria.ModLoader; using Terraria.ID; +using CalamityMod.CalPlayer; namespace CalamityMod.Items.Accessories { @@ -9,7 +10,6 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.defense = 5; Item.width = 28; Item.height = 28; Item.value = CalamityGlobalItem.Rarity1BuyPrice; @@ -19,7 +19,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.thorns += 0.5f; + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.crawCarapace = true; } } } diff --git a/Items/Accessories/GiantShell.cs b/Items/Accessories/GiantShell.cs index 7b56586c36..3d6c009bac 100644 --- a/Items/Accessories/GiantShell.cs +++ b/Items/Accessories/GiantShell.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.moveSpeed -= 0.15f; CalamityPlayer modPlayer = player.Calamity(); modPlayer.gShell = true; } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index fa220b3153..7e3ee1f412 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -418,7 +418,11 @@ CounterScarf: { CrawCarapace: { DisplayName: Craw Carapace - Tooltip: Enemies take damage when they touch you + Tooltip: + ''' + 5% increased damage + Enemies that hit you are inflicted with Armor Crunch + ''' } CrimsonFlask: { @@ -799,8 +803,8 @@ GiantShell: { DisplayName: Giant Shell Tooltip: ''' - 15% reduced movement speed - Taking a hit will make you move very fast for a short time + 10% reduced dash velocity + Taking a hit will remove the dash penalty and reduce defense for 5 seconds ''' }