From 7c8310fca243a43daa98b4ea271f15b8e04551f1 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 21 Aug 2023 13:56:03 -0700 Subject: [PATCH 1/4] 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&Nr6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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); } } } From 8df3188613f37f469795c8845db41b9c5acaac65 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 21 Aug 2023 21:15:51 -0700 Subject: [PATCH 2/4] Added Riptide (Debuff) and changed Crush Depth Riptide deals 20 dps on enemies and 3 dps on players Crush Depth deals 50 dps on enemies and 9 dps on players Abyssal Amulet and Depth crusher use Riptide instead of Crush Depth --- Buffs/DamageOverTime/RiptideDebuff.cs | 30 +++++++++++++++++ Buffs/DamageOverTime/RiptideDebuff.png | Bin 0 -> 3083 bytes CalPlayer/CalamityPlayer.cs | 8 +++++ CalPlayer/CalamityPlayerDrawEffects.cs | 11 +++++++ CalPlayer/CalamityPlayerLifeRegen.cs | 25 +++++++------- CalPlayer/CalamityPlayerOnHit.cs | 2 +- CalamityLists.cs | 1 + CalamityMod.cs | 2 +- Items/Accessories/AbyssalAmulet.cs | 2 +- Items/Weapons/Melee/DepthCrusher.cs | 4 +-- .../en-US/Mods.CalamityMod.Buffs.hjson | 5 +++ .../Mods.CalamityMod.Items.Accessories.hjson | 6 ++-- ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 4 +-- .../en-US/Mods.CalamityMod.Status.Death.hjson | 1 + NPCs/CalamityGlobalNPC.cs | 31 +++++++++++++++--- Projectiles/CalamityGlobalProjectile.cs | 2 +- 16 files changed, 105 insertions(+), 29 deletions(-) create mode 100644 Buffs/DamageOverTime/RiptideDebuff.cs create mode 100644 Buffs/DamageOverTime/RiptideDebuff.png diff --git a/Buffs/DamageOverTime/RiptideDebuff.cs b/Buffs/DamageOverTime/RiptideDebuff.cs new file mode 100644 index 0000000000..a9f31f66bd --- /dev/null +++ b/Buffs/DamageOverTime/RiptideDebuff.cs @@ -0,0 +1,30 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.DamageOverTime +{ + public class RiptideDebuff : ModBuff + { + public override void SetStaticDefaults() + { + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + BuffID.Sets.LongerExpertDebuff[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + player.Calamity().rTide = true; + } + + public override void Update(NPC npc, ref int buffIndex) + { + if (npc.Calamity().rTide < npc.buffTime[buffIndex]) + npc.Calamity().rTide = npc.buffTime[buffIndex]; + npc.DelBuff(buffIndex); + buffIndex--; + } + } +} diff --git a/Buffs/DamageOverTime/RiptideDebuff.png b/Buffs/DamageOverTime/RiptideDebuff.png new file mode 100644 index 0000000000000000000000000000000000000000..4f0a50c3f2d3ccd057552a3bf1766182e822ece7 GIT binary patch literal 3083 zcmV+m4D|DfP)f6 zXi@@54ZTQ_E-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FZU(%pXi0000RbVXQn zQ*UN;cVTj607GSLb9r+hQ*?D?X>TA@Z*OeDr{R16009?CL_t(og=75x|33o*0|Nsi zBO`=CC-DFOe?|rd1_s6fcK`ze1B%5QvWh4QStVo`7#J8B)Xl9(vf$>)V+;%o3=F?t zJV6ov@%TOpfABZ}-C`a8Fcf}URT*}h-eDK6n$d;Azp`-^R)-8e2N1IO@~&gpZA1gQ zCRTVIGWZ<8Yii5Dz<@|>xGXM;_rYs%-@+|;9Rf?7pHCkiWDYRNDJRQfbPI6-bcdXo z(mBW-fXiZHEyQqu64U{!MjbHd9gqQaz!_8rkZbX%17P}hAAUDP9Y84FZ?Eo0S(), 1800); + npc.AddBuff(ModContent.BuffType(), 1800); SoundEngine.PlaySound(BaroclawHit, Player.Center); Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f; Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 9554681078..4910050608 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -482,6 +482,17 @@ namespace CalamityMod.CalPlayer fullBright = true; } } + if (calamityPlayer.rTide) + { + if (Main.rand.NextBool(7) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 165, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); + Main.dust[dust].noGravity = false; + Main.dust[dust].velocity *= 1.8f; + Main.dust[dust].velocity.Y += 0.5f; + drawInfo.DustCache.Add(dust); + } + } if (calamityPlayer.bBlood) { if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index c67192093d..d358a1c42f 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -282,21 +282,20 @@ namespace CalamityMod.CalPlayer if (cDepth) { - if (Player.statDefense > 0) - { - int depthDamage = depthCharm ? 9 : 18; - int subtractDefense = (int)(Player.statDefense * 0.05); // 240 defense = 0 damage taken with depth charm - int calcDepthDamage = depthDamage - subtractDefense; + if (Player.lifeRegen > 0) + Player.lifeRegen = 0; - if (calcDepthDamage < 0) - calcDepthDamage = 0; + Player.lifeRegenTime = 0; + lifeRegenLost += 18; + } + + if (rTide) + { + if (Player.lifeRegen > 0) + Player.lifeRegen = 0; - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - - Player.lifeRegenTime = 0; - lifeRegenLost += calcDepthDamage; - } + Player.lifeRegenTime = 0; + lifeRegenLost += 6; } if (vodka) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index a78609045a..0784b84d49 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1106,7 +1106,7 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.Poisoned, 120); if (abyssalAmulet) { - CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); + CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); } if (alchFlask) { diff --git a/CalamityLists.cs b/CalamityLists.cs index adda84f6d9..878f01aa30 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1145,6 +1145,7 @@ namespace CalamityMod BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), diff --git a/CalamityMod.cs b/CalamityMod.cs index ca6000ee17..8f665dadcf 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -138,7 +138,7 @@ namespace CalamityMod public static int[] iceEnemyImmunities = new int[3] { BuffID.Frostburn, BuffID.Frostburn2, ModContent.BuffType() }; public static int[] sulphurEnemyImmunities = new int[4] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType(), ModContent.BuffType() }; public static int[] sunkenSeaEnemyImmunities = new int[2] { ModContent.BuffType(), ModContent.BuffType() }; - public static int[] abyssEnemyImmunities = new int[1] { ModContent.BuffType() }; + public static int[] abyssEnemyImmunities = new int[2] { ModContent.BuffType(), ModContent.BuffType() }; public static int[] cragEnemyImmunities = new int[3] { BuffID.OnFire, BuffID.OnFire3, ModContent.BuffType() }; public static int[] astralEnemyImmunities = new int[2] { BuffID.Poisoned, ModContent.BuffType() }; public static int[] plagueEnemyImmunities = new int[3] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType() }; diff --git a/Items/Accessories/AbyssalAmulet.cs b/Items/Accessories/AbyssalAmulet.cs index b9f9b48955..86c23b4bb4 100644 --- a/Items/Accessories/AbyssalAmulet.cs +++ b/Items/Accessories/AbyssalAmulet.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.abyssalAmulet = true; - player.buffImmune[ModContent.BuffType()] = true; + player.buffImmune[ModContent.BuffType()] = true; } } } diff --git a/Items/Weapons/Melee/DepthCrusher.cs b/Items/Weapons/Melee/DepthCrusher.cs index dbbbe80f4c..26edc82f51 100644 --- a/Items/Weapons/Melee/DepthCrusher.cs +++ b/Items/Weapons/Melee/DepthCrusher.cs @@ -62,12 +62,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); } public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) { - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index aa532e787a..772c052271 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -138,6 +138,11 @@ CrushDepth: { Description: Crushed by aquatic pressure } +RiptideDebuff: { + DisplayName: Riptide + Description: Lashed at by powerful waters +} + Dragonfire: { DisplayName: Dragonfire Description: Engulfed by roaring flames diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 3dd1dba112..5cd7eda970 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -7,8 +7,8 @@ AbyssalAmulet: { DisplayName: Abyssal Amulet Tooltip: ''' - Attacks inflict the Crush Depth debuff - Grants immunity to the Crush Depth debuff + Attacks inflict the Riptide debuff + Grants immunity to the Riptide debuff While in the abyss you gain 10% increased max life ''' } @@ -431,7 +431,7 @@ Baroclaw: { Tooltip: ''' 10% increased damage - Enemies that hit you take high damage and are inflicted with Armor Crunch for a long time + Enemies that hit you take high damage and are inflicted with Armor Crunch and Crush Depth for a long time ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index c14822f477..10f3da9a2c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -318,8 +318,7 @@ DepthCrusher: { DisplayName: Depth Crusher Tooltip: ''' - Hitting enemies will inflict the crush depth debuff - The lower the enemies' defense, the more damage they take from this debuff + Hitting enemies will inflict the Riptide debuff Press to use without hammering down walls ''' } @@ -792,7 +791,6 @@ NeptunesBounty: { ''' Fires a trident that rains additional tridents as it travels Hitting enemies will inflict the crush depth debuff - The lower the enemies' defense, the more damage they take from this debuff ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson index de7c3ae8db..df69f47f2f 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson @@ -17,6 +17,7 @@ CirrusSlap: "{0} was slapped too hard." CorpusAvertor: "{0} became the blood god's sacrifice." CrushDepth1: "{0} was crushed by the pressure." CrushDepth2: "{0}'s lungs collapsed." +Riptide: "{0} was swept away by the tides" Dragonfire: "{0}'s ashes scatter in the wind." GodSlayerInferno: "{0}'s soul was extinguished." Goldfish: "{0} was once again impaled by Goldfish." diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 25726ca6d3..18ad726471 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -233,6 +233,7 @@ namespace CalamityMod.NPCs public int somaShredFalloff = Shred.StackFalloffFrames; public int cDepth = 0; + public int rTide = 0; public int gsInferno = 0; public int dragonFire = 0; public int miracleBlight = 0; @@ -439,6 +440,7 @@ namespace CalamityMod.NPCs myClone.somaShredFalloff = somaShredFalloff; myClone.cDepth = cDepth; + myClone.rTide = rTide; myClone.gsInferno = gsInferno; myClone.miracleBlight = miracleBlight; myClone.dragonFire = dragonFire; @@ -1013,7 +1015,7 @@ namespace CalamityMod.NPCs if (absorberAffliction > 0) { int baseAbsorberDoTValue = (int)(260 * sicknessDamageMult); - ApplyDPSDebuff(baseAbsorberDoTValue, baseAbsorberDoTValue / 10, ref npc.lifeRegen, ref damage); + ApplyDPSDebuff(baseAbsorberDoTValue, baseAbsorberDoTValue / 65, ref npc.lifeRegen, ref damage); } // Poisoned @@ -1044,9 +1046,15 @@ namespace CalamityMod.NPCs // Crush Depth if (cDepth > 0) { - int baseCrushDepthDoTValue = (int)(((Main.hardMode ? 36 : 12) - npc.defense) * 5 * waterDamageMult); - if (baseCrushDepthDoTValue > 0) - ApplyDPSDebuff(baseCrushDepthDoTValue, baseCrushDepthDoTValue / 5, ref npc.lifeRegen, ref damage); + int baseCrushDepthDoTValue = (int)(100 * waterDamageMult); + ApplyDPSDebuff(baseCrushDepthDoTValue, baseCrushDepthDoTValue / 2, ref npc.lifeRegen, ref damage); + } + + //Riptide + if (rTide > 0) + { + int baseRiptideDoTValue = (int)(40 * waterDamageMult); + ApplyDPSDebuff(baseRiptideDoTValue, baseRiptideDoTValue / 3, ref npc.lifeRegen, ref damage); } // Debuffs that aren't affected by weaknesses or resistances. @@ -4229,6 +4237,8 @@ namespace CalamityMod.NPCs crumble--; if (cDepth > 0) cDepth--; + if (rTide > 0) + rTide--; if (gsInferno > 0) gsInferno--; if (dragonFire > 0) @@ -5545,6 +5555,17 @@ namespace CalamityMod.NPCs } } + if (rTide > 0) + { + if (Main.rand.Next(7) < 3) + { + int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, 165, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1f); + Main.dust[dust].noGravity = false; + Main.dust[dust].velocity *= 1.8f; + Main.dust[dust].velocity.Y += 0.5f; + } + } + if (sulphurPoison > 0) { if (Main.rand.Next(5) < 4) @@ -5688,6 +5709,8 @@ namespace CalamityMod.NPCs buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/BurningBlood").Value); if (cDepth > 0) buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/CrushDepth").Value); + if (rTide > 0) + buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/RiptideDebuff").Value); if (dragonFire > 0) buffTextureList.Add(Request("CalamityMod/Buffs/DamageOverTime/Dragonfire").Value); if (miracleBlight > 0) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index a0d8deaf09..1da386d36d 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2584,7 +2584,7 @@ namespace CalamityMod.Projectiles modifiers.SetCrit(); if (modPlayer.rottenDogTooth && projectile.Calamity().stealthStrike) - target.AddBuff(BuffType(), RottenDogtooth.ArmorCrunchDebuffTime); + target.AddBuff(BuffType(), RottenDogtooth.ArmorCrunchDebuffTime); if (modPlayer.flamingItemEnchant && !projectile.minion && !projectile.npcProj && !projectile.Calamity().CreatedByPlayerDash) target.AddBuff(BuffType(), VulnerabilityHex.AflameDuration); From 4a4642a16cb1b918bf7b271de2034c5bd02600e2 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Tue, 22 Aug 2023 12:14:27 -0400 Subject: [PATCH 3/4] added riptide death message manually --- CalPlayer/CalamityPlayerHitHurt.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 0c4ee94d8c..6506167565 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -373,6 +373,10 @@ namespace CalamityMod.CalPlayer { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CrushDepth" + Main.rand.Next(1, 2 + 1)).Format(Player.name)); } + if (rTide) + { + damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Riptide").Format(Player.name)); + } if (bFlames || weakBrimstoneFlames) { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrimstoneFlames").Format(Player.name)); @@ -813,6 +817,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); @@ -1086,6 +1092,8 @@ namespace CalamityMod.CalPlayer { if (aCrunch) projectileDamageReduction *= (double)ArmorCrunch.MultiplicativeDamageReductionPlayer; + if (crumble) + projectileDamageReduction *= (double)Crumbling.MultiplicativeDamageReductionPlayer; // Projectile damage reduction is reduced by DR Damage, which itself is proportional to defense damage int currentDefense = Player.GetCurrentDefense(false); @@ -1138,13 +1146,14 @@ 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); } if (baroclaw) { npc.AddBuff(ModContent.BuffType(), 1800); + npc.AddBuff(ModContent.BuffType(), 1800); SoundEngine.PlaySound(BaroclawHit, Player.Center); Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f; Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); From b626eddf7cd9a600c9cc31ad68ea814b12033eec Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Tue, 22 Aug 2023 12:17:38 -0400 Subject: [PATCH 4/4] Fixed Riptide death messages --- Localization/en-US/Mods.CalamityMod.Status.Death.hjson | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson index df69f47f2f..174deb6fec 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson @@ -1,5 +1,5 @@ AbyssDrown1: "{0} is food for the Wyrms." -AbyssDrown2: Oxygen failed to reach {0} from the depths of the Abyss. +AbyssDrown2: "Oxygen failed to reach {0} from the depths of the Abyss." AlcoholBig1: "{0} downed too many shots." AlcoholBig2: "{0}'s liver failed." AlcoholSmall: "{0} succumbed to alcohol sickness." @@ -17,7 +17,8 @@ CirrusSlap: "{0} was slapped too hard." CorpusAvertor: "{0} became the blood god's sacrifice." CrushDepth1: "{0} was crushed by the pressure." CrushDepth2: "{0}'s lungs collapsed." -Riptide: "{0} was swept away by the tides" +Riptide1: "{0} was swept away by the tides." +Riptide2: "{0} was ripped apart by the current." Dragonfire: "{0}'s ashes scatter in the wind." GodSlayerInferno: "{0}'s soul was extinguished." Goldfish: "{0} was once again impaled by Goldfish."