From 7c8310fca243a43daa98b4ea271f15b8e04551f1 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 21 Aug 2023 13:56:03 -0700 Subject: [PATCH] Added Crumbling Added Crumbling, reduces enemy dr by 12%, reduces player defense by 10 and multiplies player dr by 0.55 Crumbling replaced Armor crunch on: Craw Carapace, Broken Biome Blade Purity, Rotten Dogtooth, Crumbling Potion, Bone Arrow Buffed Armor crunch dr reduction on enemies to 20% --- Buffs/StatDebuffs/ArmorCrunch.cs | 5 ++- Buffs/StatDebuffs/Crumbling.cs | 36 ++++++++++++++++++ Buffs/StatDebuffs/Crumbling.png | Bin 0 -> 3091 bytes CalPlayer/CalamityPlayer.cs | 9 ++++- CalPlayer/CalamityPlayerOnHit.cs | 4 +- CalamityLists.cs | 1 + .../en-US/Mods.CalamityMod.Buffs.hjson | 5 +++ .../Mods.CalamityMod.Items.Accessories.hjson | 4 +- .../Mods.CalamityMod.Items.Potions.hjson | 2 +- NPCs/CalamityGlobalNPC.cs | 9 +++++ .../BrokenBiomeBlade_PurityProjection.cs | 4 +- 11 files changed, 69 insertions(+), 10 deletions(-) create mode 100644 Buffs/StatDebuffs/Crumbling.cs create mode 100644 Buffs/StatDebuffs/Crumbling.png 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 0000000000000000000000000000000000000000..eacef7559fe6a24bb94a215a37197a7b9256ebda GIT binary patch literal 3091 zcmV+u4D9oXP)f6 zXi@@54ZTQ_E-Enz5K6$103tR-RB%L5k){YTDBysjLy@r}iiH7DvFijGMAUI`6dRUF zWUU$Bym{}eS9UO(Z2>7`&z9wUXbV-Il#&6`Y8GKGQ04S2&F6MJnWNa;Ck|;8QE#r9r;7G||@X{|> z%+C|c55>;RS}qbKr-&IQTvLXPlM{>K&(BTgi^a?^4mXV>;xX8n8Ce|RasXz}{8imI52H3ZN4bfe_i~WlJ|C&UW9+{8AKoW!}eExnGFE2re(F+`iE_46#!l9 z0Z_aBhs|Iw0E)7{bq;-T9=d#9QpDmcXDh4R++0fmpKB>E=%LdZt9g$j;($`3&Zthxi`{{&gM}5&R^+h%b~yM9Zd3AWW9ETgVfL z1(`yIK=_}U_z%PWq}jQaiQ4!P(3V&Nr6C$Xej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(), 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); } } }