diff --git a/Buffs/StatDebuffs/ArmorCrunch.cs b/Buffs/StatDebuffs/ArmorCrunch.cs index 0499da3b75..76bac57e11 100644 --- a/Buffs/StatDebuffs/ArmorCrunch.cs +++ b/Buffs/StatDebuffs/ArmorCrunch.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -8,7 +8,8 @@ namespace CalamityMod.Buffs.StatDebuffs { public static int DefenseReduction = 15; public static float MultiplicativeDamageReductionPlayer = 0.33f; - public static float MultiplicativeDamageReductionEnemy = 0.85f; + //20% dr reduction + public static float MultiplicativeDamageReductionEnemy = 0.80f; public override void SetStaticDefaults() { diff --git a/Buffs/StatDebuffs/Crumbling.cs b/Buffs/StatDebuffs/Crumbling.cs new file mode 100644 index 0000000000..ecc06ca622 --- /dev/null +++ b/Buffs/StatDebuffs/Crumbling.cs @@ -0,0 +1,36 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatDebuffs +{ + public class Crumbling : ModBuff + { + public static int DefenseReduction = 10; + public static float MultiplicativeDamageReductionPlayer = 0.55f; + //12% dr reduction + public static float MultiplicativeDamageReductionEnemy = 0.88f; + + public override void SetStaticDefaults() + { + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; + BuffID.Sets.LongerExpertDebuff[Type] = true; + } + + public override void Update(NPC npc, ref int buffIndex) + { + if (npc.Calamity().crumble < npc.buffTime[buffIndex]) + npc.Calamity().crumble = npc.buffTime[buffIndex]; + npc.DelBuff(buffIndex); + buffIndex--; + } + + public override void Update(Player player, ref int buffIndex) + { + player.Calamity().crumble = true; + } + } +} diff --git a/Buffs/StatDebuffs/Crumbling.png b/Buffs/StatDebuffs/Crumbling.png new file mode 100644 index 0000000000..eacef7559f Binary files /dev/null and b/Buffs/StatDebuffs/Crumbling.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 87b59a9e24..74846498ad 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -807,6 +807,7 @@ namespace CalamityMod.CalPlayer public bool dragonFire = false; public bool miracleBlight = false; public bool aCrunch = false; + public bool crumble = false; public bool irradiated = false; public bool bFlames = false; public bool weakBrimstoneFlames = false; @@ -1813,6 +1814,7 @@ namespace CalamityMod.CalPlayer dragonFire = false; miracleBlight = false; aCrunch = false; + crumble = false; irradiated = false; bFlames = false; witheredDebuff = false; @@ -2223,6 +2225,7 @@ namespace CalamityMod.CalPlayer dragonFire = false; miracleBlight = false; aCrunch = false; + crumble = false; irradiated = false; bFlames = false; witheredDebuff = false; @@ -4689,6 +4692,8 @@ namespace CalamityMod.CalPlayer { if (aCrunch) contactDamageReduction *= (double)ArmorCrunch.MultiplicativeDamageReductionPlayer; + if (crumble) + contactDamageReduction *= (double)Crumbling.MultiplicativeDamageReductionPlayer; // Contact damage reduction is reduced by DR Damage, which itself is proportional to defense damage int currentDefense = Player.GetCurrentDefense(false); @@ -4962,6 +4967,8 @@ namespace CalamityMod.CalPlayer { if (aCrunch) projectileDamageReduction *= (double)ArmorCrunch.MultiplicativeDamageReductionPlayer; + if (crumble) + contactDamageReduction *= (double)Crumbling.MultiplicativeDamageReductionPlayer; // Projectile damage reduction is reduced by DR Damage, which itself is proportional to defense damage int currentDefense = Player.GetCurrentDefense(false); @@ -5014,7 +5021,7 @@ namespace CalamityMod.CalPlayer } if (crawCarapace) { - npc.AddBuff(ModContent.BuffType(), 720); + npc.AddBuff(ModContent.BuffType(), 720); SoundEngine.PlaySound(SoundID.NPCHit33 with { Volume = 0.5f }, Player.Center); } diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 1e51fe6bf4..a78609045a 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -306,7 +306,7 @@ namespace CalamityMod.CalPlayer break; case ProjectileID.BoneArrow: - target.AddBuff(BuffType(), 300); + target.AddBuff(BuffType(), 300); break; case ProjectileID.FrostBlastFriendly: @@ -1017,7 +1017,7 @@ namespace CalamityMod.CalPlayer { if (flaskCrumbling) { - CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); + CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); } if (flaskBrimstone) { diff --git a/CalamityLists.cs b/CalamityLists.cs index 99f8969867..adda84f6d9 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1148,6 +1148,7 @@ namespace CalamityMod BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index ce3a676c7c..aa532e787a 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -859,6 +859,11 @@ ArmorCrunch: { Description: Your armor is shredded } +Crumbling: { + DisplayName: Crumbling + Description: Your armor is damaged +} + Clamity: { DisplayName: Clamity Description: The clams have been angered! diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 846f6eaa0c..3dd1dba112 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -422,7 +422,7 @@ CrawCarapace: { Tooltip: ''' 5% increased damage - Enemies that hit you take damage and are inflicted with Armor Crunch + Enemies that hit you take damage and are inflicted with Crumbling ''' } @@ -1381,7 +1381,7 @@ RottenBrain: { RottenDogtooth: { DisplayName: Rotten Dogtooth - Tooltip: Makes Stealth strikes inflict Armor Crunch and deal 8% more damage + Tooltip: Makes Stealth strikes inflict Crumbling and deal 8% more damage } RoverDrive: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 79cc3a47cc..b694abfb31 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -72,7 +72,7 @@ FlaskOfBrimstone: { FlaskOfCrumbling: { DisplayName: Flask of Crumbling - Tooltip: Melee, Whip, and Rogue attacks inflict Armor Crunch on enemies + Tooltip: Melee, Whip, and Rogue attacks inflict Crumbling on enemies } FlaskOfHolyFlames: { diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 4fa8054b29..25726ca6d3 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -223,6 +223,7 @@ namespace CalamityMod.NPCs public int hFlames = 0; public int pFlames = 0; public int aCrunch = 0; + public int crumble = 0; // Soma Prime Shred deals damage with DirectStrikes instead of with direct debuff damage // It also stacks, scales with ranged damage, and can crit, meaning it needs to know who applied it most recently @@ -431,6 +432,7 @@ namespace CalamityMod.NPCs myClone.hFlames = hFlames; myClone.pFlames = pFlames; myClone.aCrunch = aCrunch; + myClone.crumble = crumble; myClone.somaShredStacks = somaShredStacks; myClone.somaShredApplicator = somaShredApplicator; @@ -2687,6 +2689,9 @@ namespace CalamityMod.NPCs calcDR *= KamiFlu.MultiplicativeDamageReduction; if (npc.Calamity().aCrunch > 0) calcDR *= ArmorCrunch.MultiplicativeDamageReductionEnemy; + if (npc.Calamity().crumble > 0) + calcDR *= Crumbling.MultiplicativeDamageReductionEnemy; + return calcDR; } @@ -4220,6 +4225,8 @@ namespace CalamityMod.NPCs // Soma Prime's Shred stacks have a unique falloff mechanic in the debuff's own file. if (aCrunch > 0) aCrunch--; + if (crumble > 0) + crumble--; if (cDepth > 0) cDepth--; if (gsInferno > 0) @@ -5711,6 +5718,8 @@ namespace CalamityMod.NPCs // Stat debuffs if (aCrunch > 0) buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/ArmorCrunch").Value); + if (crumble > 0) + buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/Crumbling").Value); if (enraged > 0) buffTextureList.Add(Request("CalamityMod/Buffs/StatDebuffs/Enraged").Value); if (eutrophication > 0) diff --git a/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs b/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs index 1cbae39294..60ef37e19e 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { int debuffTime = 90; - target.AddBuff(BuffType(), debuffTime); + target.AddBuff(BuffType(), debuffTime); } } }