From bf9d8ac229fb505cf8f3ce4cc0f7698cb59e9d67 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 17 May 2024 01:22:51 -0400 Subject: [PATCH] After some thought, Nullification Pistol's effects EXCEPT scale work while a boss is alive again Scale was the only effect that was truly broken at all with bosses using this thing. Removing the rest of the weapon's gimmick for bosses feels very awkward and unsatisfying. Personally I'm in the camp that that the scale really should be considered a feature too but that is beyond my jurisdiction at this point. --- Projectiles/Ranged/NullShot.cs | 64 +++++++++++++-------------- Projectiles/Ranged/NullShot2.cs | 78 ++++++++++++++++----------------- 2 files changed, 70 insertions(+), 72 deletions(-) diff --git a/Projectiles/Ranged/NullShot.cs b/Projectiles/Ranged/NullShot.cs index e7b444bcb3..2ec483b36b 100644 --- a/Projectiles/Ranged/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -45,44 +45,44 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (target.type == NPCID.TargetDummy || CalamityPlayer.areThereAnyDamnBosses || CalamityLists.AquaticScourgeIDs.Contains(target.type)) + if (target.type == NPCID.TargetDummy) { return; } - int nullBuff = Main.rand.Next(7); + + int randAmt = (CalamityPlayer.areThereAnyDamnBosses || CalamityLists.AquaticScourgeIDs.Contains(target.type)) ? 6 : 8; + int nullBuff = Main.rand.Next(randAmt); if (!target.boss) { - if (nullBuff == 0) + switch (nullBuff) { - target.scale *= 2f; - } - else if (nullBuff == 1) - { - target.scale *= 0.5f; - } - else if (nullBuff == 2 && target.type != ModContent.NPCType()) - { - target.damage += 10; - } - else if (nullBuff == 3) - { - target.damage -= 10; - } - else if (nullBuff == 4) - { - target.knockBackResist = 0f; - } - else if (nullBuff == 5) - { - target.knockBackResist = 1f; - } - else if (nullBuff == 6) - { - target.defense += 5; - } - else - { - target.defense -= 5; + case 0: + if (target.type != ModContent.NPCType()) + target.damage += 10; + break; + case 1: + target.damage -= 10; + break; + case 2: + target.knockBackResist = 0f; + break; + case 3: + target.knockBackResist = 1f; + break; + case 4: + target.defense += 5; + break; + case 5: + target.defense -= 5; + break; + case 6: + target.scale *= 2f; + break; + case 7: + target.scale *= 0.5f; + break; + default: + break; } } } diff --git a/Projectiles/Ranged/NullShot2.cs b/Projectiles/Ranged/NullShot2.cs index dfcc271c29..d24185b9d0 100644 --- a/Projectiles/Ranged/NullShot2.cs +++ b/Projectiles/Ranged/NullShot2.cs @@ -45,52 +45,50 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (target.type == NPCID.TargetDummy || CalamityPlayer.areThereAnyDamnBosses || CalamityLists.AquaticScourgeIDs.Contains(target.type)) + if (target.type == NPCID.TargetDummy) { return; } - int nullBuff = Main.rand.Next(10); + + int randAmt = (CalamityPlayer.areThereAnyDamnBosses || CalamityLists.AquaticScourgeIDs.Contains(target.type)) ? 8 : 10; + int nullBuff = Main.rand.Next(randAmt); if (!target.boss) { - if (nullBuff == 0) + switch (nullBuff) { - target.scale *= 5f; - } - else if (nullBuff == 1) - { - target.scale *= 0.1f; - } - else if (nullBuff == 2 && target.type != ModContent.NPCType()) - { - target.damage += 20; - } - else if (nullBuff == 3) - { - target.damage -= 20; - } - else if (nullBuff == 4) - { - target.knockBackResist = 0f; - } - else if (nullBuff == 5) - { - target.knockBackResist = 1f; - } - else if (nullBuff == 6) - { - target.defense += 10; - } - else if (nullBuff == 7) - { - target.defense -= 10; - } - else if (nullBuff == 8) - { - target.velocity.Y = Main.rand.NextBool() ? 30f : -30f; - } - else - { - target.velocity.X = Main.rand.NextBool() ? 30f : -30f; + case 0: + if (target.type != ModContent.NPCType()) + target.damage += 20; + break; + case 1: + target.damage -= 20; + break; + case 2: + target.knockBackResist = 0f; + break; + case 3: + target.knockBackResist = 1f; + break; + case 4: + target.defense += 10; + break; + case 5: + target.defense -= 10; + break; + case 6: + target.velocity.Y = Main.rand.NextBool() ? 30f : -30f; + break; + case 7: + target.velocity.X = Main.rand.NextBool() ? 30f : -30f; + break; + case 8: + target.scale *= 5f; + break; + case 9: + target.scale *= 0.1f; + break; + default: + break; } } }