From ae1fa7bec562f9aeff88146343f07566bc4a94e8 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Mon, 7 Oct 2019 19:40:40 -0400 Subject: [PATCH] Redid DR formula so that DR applies after vanilla defense. Also moved AEW & Sepulcher DR to vanilla damage taken multiplier, and moved flat defense reductions for Calamity debuffs into their buff files. Unified line endings and added extensions to get CalamityGlobalNPC and CalamityGlobalProjectile. THIS WILL REQUIRE ENORMOUS AMOUNTS OF TESTING AND REBALANCING. --- Buffs/DoTDebuffs/AbyssalFlames.cs | 5 +- Buffs/DoTDebuffs/AstralInfectionDebuff.cs | 5 +- Buffs/DoTDebuffs/GodSlayerInferno.cs | 5 +- Buffs/DoTDebuffs/Plague.cs | 5 +- Buffs/StatDebuffs/WarCleave.cs | 4 +- Buffs/StatDebuffs/WhisperingDeath.cs | 5 +- Items/Accessories/EclipseMirror.cs | 4 +- Items/Accessories/RuinMedallion.cs | 2 +- .../BlastBarrel.cs | 2 +- .../EclipsesFall.cs | 2 +- Items/CalamityGlobalItem.cs | 2 +- Items/Weapons/Astral/AstralBlaster.cs | 2 +- Items/Weapons/Bumblebirb/GoldenEagle.cs | 2 +- Items/Weapons/Crabulon/Fungicide.cs | 2 +- Items/Weapons/HalleysInferno.cs | 8 +- Items/Weapons/Perforators/Eviscerator.cs | 2 +- Items/Weapons/SDFMG.cs | 4 +- Items/Weapons/SlagMagnum.cs | 2 +- Items/Weapons/SlimeGod/GunkShot.cs | 2 +- Items/Weapons/SlimeGod/OverloadedBlaster.cs | 2 +- Items/Weapons/SparkSpreader.cs | 8 +- NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs | 3 +- NPCs/AstralBiomeNPCs/Twinkler.cs | 10 +- NPCs/CalamityGlobalNPC.cs | 214 ++++++++---------- NPCs/SupremeCalamitas/SCalWormBody.cs | 1 + NPCs/SupremeCalamitas/SCalWormBodyWeak.cs | 3 +- NPCs/SupremeCalamitas/SCalWormHead.cs | 1 + NPCs/SupremeCalamitas/SCalWormTail.cs | 1 + Projectiles/Ranged/HalleysComet.cs | 4 +- Projectiles/Ranged/SparkSpreaderFire.cs | 4 +- Projectiles/Rogue/BlastBarrelProjectile.cs | 6 +- Projectiles/Rogue/EclipsesStealth.cs | 4 +- Projectiles/Rogue/InkCloud.cs | 2 +- Projectiles/Rogue/InkCloud2.cs | 2 +- Projectiles/Rogue/InkCloud3.cs | 2 +- Projectiles/Rogue/ScourgeVenomCloud.cs | 2 +- .../Rogue/ScourgeoftheSeasProjectile.cs | 8 +- Projectiles/Rogue/ScourgeoftheSeasStealth.cs | 8 +- Projectiles/Summon/BlackHawkSummon.cs | 10 +- Tiles/CharredOre.cs | 2 +- Tiles/FurnitureOccult/OccultStone.cs | 2 +- Utilities/CalamityUtils.cs | 13 +- 42 files changed, 189 insertions(+), 188 deletions(-) diff --git a/Buffs/DoTDebuffs/AbyssalFlames.cs b/Buffs/DoTDebuffs/AbyssalFlames.cs index ab5be6fca2..894a08bca7 100644 --- a/Buffs/DoTDebuffs/AbyssalFlames.cs +++ b/Buffs/DoTDebuffs/AbyssalFlames.cs @@ -1,13 +1,14 @@ using Terraria; using Terraria.ModLoader; using CalamityMod.NPCs; -using CalamityMod.CalPlayer; namespace CalamityMod.Buffs.DoTDebuffs { public class AbyssalFlames : ModBuff { - public override void SetDefaults() + public static int DefenseReduction = 10; + + public override void SetDefaults() { DisplayName.SetDefault("Abyssal Flames"); Description.SetDefault("Your soul is being consumed"); diff --git a/Buffs/DoTDebuffs/AstralInfectionDebuff.cs b/Buffs/DoTDebuffs/AstralInfectionDebuff.cs index b503e59e7a..4c373e65bb 100644 --- a/Buffs/DoTDebuffs/AstralInfectionDebuff.cs +++ b/Buffs/DoTDebuffs/AstralInfectionDebuff.cs @@ -1,13 +1,14 @@ using Terraria; using Terraria.ModLoader; using CalamityMod.NPCs; -using CalamityMod.CalPlayer; namespace CalamityMod.Buffs.DoTDebuffs { public class AstralInfectionDebuff : ModBuff { - public override void SetDefaults() + public static int DefenseReduction = 8; + + public override void SetDefaults() { DisplayName.SetDefault("Astral Infection"); Description.SetDefault("Your flesh is melting off"); diff --git a/Buffs/DoTDebuffs/GodSlayerInferno.cs b/Buffs/DoTDebuffs/GodSlayerInferno.cs index 73705be872..3d7e001811 100644 --- a/Buffs/DoTDebuffs/GodSlayerInferno.cs +++ b/Buffs/DoTDebuffs/GodSlayerInferno.cs @@ -1,13 +1,14 @@ using Terraria; using Terraria.ModLoader; using CalamityMod.NPCs; -using CalamityMod.CalPlayer; namespace CalamityMod.Buffs.DoTDebuffs { public class GodSlayerInferno : ModBuff { - public override void SetDefaults() + public static int DefenseReduction = 20; + + public override void SetDefaults() { DisplayName.SetDefault("God Slayer Inferno"); Description.SetDefault("Your flesh is burning off"); diff --git a/Buffs/DoTDebuffs/Plague.cs b/Buffs/DoTDebuffs/Plague.cs index bed5e900fa..6b442c4b5f 100644 --- a/Buffs/DoTDebuffs/Plague.cs +++ b/Buffs/DoTDebuffs/Plague.cs @@ -1,13 +1,14 @@ using Terraria; using Terraria.ModLoader; using CalamityMod.NPCs; -using CalamityMod.CalPlayer; namespace CalamityMod.Buffs.DoTDebuffs { public class Plague : ModBuff { - public override void SetDefaults() + public static int DefenseReduction = 4; + + public override void SetDefaults() { DisplayName.SetDefault("Plague"); Description.SetDefault("Rotting from the inside"); diff --git a/Buffs/StatDebuffs/WarCleave.cs b/Buffs/StatDebuffs/WarCleave.cs index 2ee824ef3d..366bee9b82 100644 --- a/Buffs/StatDebuffs/WarCleave.cs +++ b/Buffs/StatDebuffs/WarCleave.cs @@ -6,7 +6,9 @@ namespace CalamityMod.Buffs.StatDebuffs { public class WarCleave : ModBuff { - public override void SetDefaults() + public static int DefenseReduction = 15; + + public override void SetDefaults() { DisplayName.SetDefault("War Cleave"); Description.SetDefault("Defense and protection reduced"); diff --git a/Buffs/StatDebuffs/WhisperingDeath.cs b/Buffs/StatDebuffs/WhisperingDeath.cs index e0651255cf..14c71f5c52 100644 --- a/Buffs/StatDebuffs/WhisperingDeath.cs +++ b/Buffs/StatDebuffs/WhisperingDeath.cs @@ -1,13 +1,14 @@ using Terraria; using Terraria.ModLoader; using CalamityMod.NPCs; -using CalamityMod.CalPlayer; namespace CalamityMod.Buffs.StatDebuffs { public class WhisperingDeath : ModBuff { - public override void SetDefaults() + public static int DefenseReduction = 50; + + public override void SetDefaults() { DisplayName.SetDefault("Whispering Death"); Description.SetDefault("Death approaches; defense, attack power, and life regen reduced"); diff --git a/Items/Accessories/EclipseMirror.cs b/Items/Accessories/EclipseMirror.cs index d87c0d8449..207c7a6f6c 100644 --- a/Items/Accessories/EclipseMirror.cs +++ b/Items/Accessories/EclipseMirror.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Accessories "20% increased stealth regeneration while moving\n" + "Stealth regeneration rate exponentially increases while standing still\n" + "Stealth strikes have a 100% critical hit chance\n" + - "Stealth strikes only expend 50% of your max stealth\n" + - "Grants a small chance to evade attacks in a blast of darksun light, which inflicts extreme damage in a wide area\n" + + "Stealth strikes only expend 50% of your max stealth\n" + + "Grants a small chance to evade attacks in a blast of darksun light, which inflicts extreme damage in a wide area\n" + "Evading an attack grants full stealth\n" + "This evade has a 20s cooldown before it can occur again"); } diff --git a/Items/Accessories/RuinMedallion.cs b/Items/Accessories/RuinMedallion.cs index edee64d1fc..27e7e203c3 100644 --- a/Items/Accessories/RuinMedallion.cs +++ b/Items/Accessories/RuinMedallion.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Ruin Medallion"); - Tooltip.SetDefault("Stealth strikes only expend 50% of your max stealth\n" + + Tooltip.SetDefault("Stealth strikes only expend 50% of your max stealth\n" + "6% increased rogue damage, and 6% increased rogue crit chance"); } diff --git a/Items/CalamityCustomThrowingDamage/BlastBarrel.cs b/Items/CalamityCustomThrowingDamage/BlastBarrel.cs index 428885f2c0..acc3d01076 100644 --- a/Items/CalamityCustomThrowingDamage/BlastBarrel.cs +++ b/Items/CalamityCustomThrowingDamage/BlastBarrel.cs @@ -44,4 +44,4 @@ namespace CalamityMod.Items.CalamityCustomThrowingDamage return false; } } -} \ No newline at end of file +} diff --git a/Items/CalamityCustomThrowingDamage/EclipsesFall.cs b/Items/CalamityCustomThrowingDamage/EclipsesFall.cs index e85a711d5d..da5acfa910 100644 --- a/Items/CalamityCustomThrowingDamage/EclipsesFall.cs +++ b/Items/CalamityCustomThrowingDamage/EclipsesFall.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.CalamityCustomThrowingDamage } return false; } - + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 0357739fbb..fb739d5eb7 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1803,7 +1803,7 @@ namespace CalamityMod.Items if (item.type == ItemID.WormScarf) player.endurance -= 0.07f; - + if (item.type == ItemID.RoyalGel) modPlayer.royalGel = true; diff --git a/Items/Weapons/Astral/AstralBlaster.cs b/Items/Weapons/Astral/AstralBlaster.cs index e0e664e638..9ec2d6e27c 100644 --- a/Items/Weapons/Astral/AstralBlaster.cs +++ b/Items/Weapons/Astral/AstralBlaster.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Astral item.shoot = mod.ProjectileType("AstralRound"); item.useAmmo = 97; } - + public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); diff --git a/Items/Weapons/Bumblebirb/GoldenEagle.cs b/Items/Weapons/Bumblebirb/GoldenEagle.cs index 1cafff97d5..35395959b8 100644 --- a/Items/Weapons/Bumblebirb/GoldenEagle.cs +++ b/Items/Weapons/Bumblebirb/GoldenEagle.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Bumblebirb item.useAmmo = 97; item.GetGlobalItem(mod).postMoonLordRarity = 12; } - + public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); diff --git a/Items/Weapons/Crabulon/Fungicide.cs b/Items/Weapons/Crabulon/Fungicide.cs index ae84df3190..331f5660e7 100644 --- a/Items/Weapons/Crabulon/Fungicide.cs +++ b/Items/Weapons/Crabulon/Fungicide.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Crabulon item.shootSpeed = 14f; item.useAmmo = 97; } - + public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); diff --git a/Items/Weapons/HalleysInferno.cs b/Items/Weapons/HalleysInferno.cs index b5e8272a90..5348a74fc6 100644 --- a/Items/Weapons/HalleysInferno.cs +++ b/Items/Weapons/HalleysInferno.cs @@ -40,19 +40,19 @@ namespace CalamityMod.Items.Weapons item.shootSpeed = 14.6f; item.useAmmo = 23; } - + public override Vector2? HoldoutOffset() { return new Vector2(-15, 0); } - + public override bool ConsumeAmmo(Player player) { if (Main.rand.Next(0, 100) < 50) return false; return true; } - + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); @@ -63,4 +63,4 @@ namespace CalamityMod.Items.Weapons recipe.AddRecipe(); } } -} \ No newline at end of file +} diff --git a/Items/Weapons/Perforators/Eviscerator.cs b/Items/Weapons/Perforators/Eviscerator.cs index 7a6f417810..3b13d7d8df 100644 --- a/Items/Weapons/Perforators/Eviscerator.cs +++ b/Items/Weapons/Perforators/Eviscerator.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Perforators item.shootSpeed = 22f; item.useAmmo = 97; } - + public override Vector2? HoldoutOffset() { return new Vector2(-7, 0); diff --git a/Items/Weapons/SDFMG.cs b/Items/Weapons/SDFMG.cs index d173fdd129..f163496208 100644 --- a/Items/Weapons/SDFMG.cs +++ b/Items/Weapons/SDFMG.cs @@ -39,12 +39,12 @@ namespace CalamityMod.Items.Weapons item.useAmmo = 97; item.GetGlobalItem(mod).postMoonLordRarity = 14; } - + public override Vector2? HoldoutOffset() { return new Vector2(-10, 0); } - + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { float SpeedX = speedX + (float)Main.rand.Next(-5, 6) * 0.05f; diff --git a/Items/Weapons/SlagMagnum.cs b/Items/Weapons/SlagMagnum.cs index 1912cd586c..158c55d8d9 100644 --- a/Items/Weapons/SlagMagnum.cs +++ b/Items/Weapons/SlagMagnum.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("SlagRound"); item.useAmmo = 97; } - + public override Vector2? HoldoutOffset() { return new Vector2(-10, 0); diff --git a/Items/Weapons/SlimeGod/GunkShot.cs b/Items/Weapons/SlimeGod/GunkShot.cs index 5f22b4f536..3035334cef 100644 --- a/Items/Weapons/SlimeGod/GunkShot.cs +++ b/Items/Weapons/SlimeGod/GunkShot.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.SlimeGod item.shootSpeed = 5f; item.useAmmo = 97; } - + public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); diff --git a/Items/Weapons/SlimeGod/OverloadedBlaster.cs b/Items/Weapons/SlimeGod/OverloadedBlaster.cs index 0be0a3de6d..23bab11b5f 100644 --- a/Items/Weapons/SlimeGod/OverloadedBlaster.cs +++ b/Items/Weapons/SlimeGod/OverloadedBlaster.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.SlimeGod item.shoot = mod.ProjectileType("SlimeBolt"); item.useAmmo = 23; } - + public override Vector2? HoldoutOffset() { return new Vector2(-4, 0); diff --git a/Items/Weapons/SparkSpreader.cs b/Items/Weapons/SparkSpreader.cs index 5a4fd54ac2..2bb371a910 100644 --- a/Items/Weapons/SparkSpreader.cs +++ b/Items/Weapons/SparkSpreader.cs @@ -36,19 +36,19 @@ namespace CalamityMod.Items.Weapons item.shootSpeed = 5f; item.useAmmo = 23; } - + public override Vector2? HoldoutOffset() { return new Vector2(-4, 0); } - + public override bool ConsumeAmmo(Player player) { if (Main.rand.Next(0, 100) < 20) return false; return true; } - + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); @@ -60,4 +60,4 @@ namespace CalamityMod.Items.Weapons recipe.AddRecipe(); } } -} \ No newline at end of file +} diff --git a/NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs b/NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs index deec893330..e515dc39de 100644 --- a/NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs +++ b/NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs @@ -31,7 +31,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.width = 254; //36 npc.height = 138; //20 npc.defense = 3000; - npc.lifeMax = 1000000; + npc.takenDamageMultiplier = 1E-6f; + npc.lifeMax = 1000000; npc.aiStyle = -1; aiType = -1; for (int k = 0; k < npc.buffImmune.Length; k++) diff --git a/NPCs/AstralBiomeNPCs/Twinkler.cs b/NPCs/AstralBiomeNPCs/Twinkler.cs index 0f9722eb02..cfaa0bf5ff 100644 --- a/NPCs/AstralBiomeNPCs/Twinkler.cs +++ b/NPCs/AstralBiomeNPCs/Twinkler.cs @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs //banner = npc.type; //bannerItem = mod.ItemType("TwinklerBanner"); } - + public override bool? CanBeHitByItem(Player player, Item item) { return true; @@ -68,10 +68,10 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs public virtual void OnCatchNPC(Player player, Item item) { - try + try { var npcCenter = npc.Center.ToTileCoordinates(); - if (!WorldGen.SolidTile(npcCenter.X, npcCenter.Y) && Main.tile[npcCenter.X, npcCenter.Y].liquid == 0) + if (!WorldGen.SolidTile(npcCenter.X, npcCenter.Y) && Main.tile[npcCenter.X, npcCenter.Y].liquid == 0) { Main.tile[npcCenter.X, npcCenter.Y].liquid = (byte)Main.rand.Next(50, 150); Main.tile[npcCenter.X, npcCenter.Y].lava(true); @@ -79,13 +79,13 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs WorldGen.SquareTileFrame(npcCenter.X, npcCenter.Y, true); } } - catch + catch { return; } } } - + internal class TwinklerItem : ModItem { public override void SetStaticDefaults() diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 214b6ff395..fa7439d8be 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1,3 +1,5 @@ +using CalamityMod.Buffs.DoTDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Projectiles; using CalamityMod.Utilities; @@ -17,9 +19,7 @@ namespace CalamityMod.NPCs public class CalamityGlobalNPC : GlobalNPC { #region Variables - // Damage reduction - private float protection = 0f; - private float defProtection = 0f; + private float DR = 0f; // Iron Heart private int ironHeartDamage = 0; @@ -564,11 +564,6 @@ namespace CalamityMod.NPCs { IronHeartChanges(npc); } - - if (protection > 0f) - { - defProtection = protection; - } } #endregion @@ -834,30 +829,30 @@ namespace CalamityMod.NPCs if (npc.type == thorium.NPCType("Viscount") || npc.type == thorium.NPCType("BoreanStrider") || npc.type == thorium.NPCType("FallenDeathBeholder") || npc.type == thorium.NPCType("Lich") || npc.type == thorium.NPCType("AbyssionReleased")) { - protection = 0.05f; + DR = 0.05f; } else if (npc.type == thorium.NPCType("CryoCore") || npc.type == thorium.NPCType("BioCore") || npc.type == thorium.NPCType("PyroCore") || npc.type == thorium.NPCType("Aquaius")) { - protection = 0.1f; + DR = 0.1f; } else if (npc.type == thorium.NPCType("ThePrimeScouter") || npc.type == thorium.NPCType("FallenDeathBeholder2") || npc.type == thorium.NPCType("SlagFury") || npc.type == thorium.NPCType("Aquaius2") || npc.type == thorium.NPCType("GraniteEnergyStorm")) { - protection = 0.2f; + DR = 0.2f; } else if (npc.type == thorium.NPCType("TheBuriedWarrior") || npc.type == thorium.NPCType("TheBuriedWarrior1") || npc.type == thorium.NPCType("TheBuriedWarrior2") || npc.type == thorium.NPCType("LichHeadless") || npc.type == thorium.NPCType("AbyssionCracked")) { - protection = 0.25f; + DR = 0.25f; } else if (npc.type == thorium.NPCType("Omnicide")) { - protection = 0.3f; + DR = 0.3f; } else if (npc.type == thorium.NPCType("Abyssion")) { - protection = 0.35f; + DR = 0.35f; } } } @@ -867,7 +862,7 @@ namespace CalamityMod.NPCs npc.type == mod.NPCType("ScornEater") || npc.type == mod.NPCType("AquaticScourgeBody") || npc.type == mod.NPCType("AquaticScourgeBodyAlt") || npc.type == mod.NPCType("Mauler") || npc.type == mod.NPCType("EutrophicRay")) { - protection = 0.05f; + DR = 0.05f; } else if (npc.type == mod.NPCType("AstrumDeusBody") || npc.type == mod.NPCType("SoulSeeker") || npc.type == mod.NPCType("DesertScourgeTail") || npc.type == mod.NPCType("Horse") || npc.type == mod.NPCType("ProfanedEnergyBody") || npc.type == mod.NPCType("ScavengerClawLeft") || @@ -875,7 +870,7 @@ namespace CalamityMod.NPCs npc.type == mod.NPCType("PhantomDebris") || npc.type == mod.NPCType("AstrumDeusHead") || npc.type == mod.NPCType("AquaticScourgeHead") || npc.type == mod.NPCType("Cryon") || npc.type == mod.NPCType("Cryogen")) { - protection = 0.1f; + DR = 0.1f; } else if (npc.type == mod.NPCType("ArmoredDiggerHead") || npc.type == mod.NPCType("AstralProbe") || npc.type == mod.NPCType("Calamitas") || npc.type == mod.NPCType("CalamitasRun") || npc.type == mod.NPCType("CalamitasRun2") || npc.type == mod.NPCType("CalamitasRun3") || @@ -888,39 +883,39 @@ namespace CalamityMod.NPCs npc.type == mod.NPCType("Hive") || npc.type == mod.NPCType("Mantis") || npc.type == mod.NPCType("Nova") || npc.type == mod.NPCType("SmallSightseer") || npc.type == mod.NPCType("StellarCulex")) { - protection = 0.15f; + DR = 0.15f; } else if (npc.type == mod.NPCType("AstrumDeusProbe3") || npc.type == mod.NPCType("PlaguebringerShade") || npc.type == mod.NPCType("BlindedAngler")) { - protection = 0.2f; + DR = 0.2f; } else if (npc.type == mod.NPCType("PlaguebringerGoliath") || npc.type == mod.NPCType("ProfanedGuardianBoss2") || npc.type == mod.NPCType("SandTortoise") || npc.type == mod.NPCType("StasisProbe") || npc.type == mod.NPCType("BobbitWormHead") || npc.type == mod.NPCType("GreatSandShark") || npc.type == mod.NPCType("Clam") || npc.type == mod.NPCType("PrismTurtle")) { - protection = 0.25f; + DR = 0.25f; } else if (npc.type == mod.NPCType("ProvSpawnOffense") || npc.type == mod.NPCType("GiantClam")) { - protection = 0.3f; + DR = 0.3f; } else if (npc.type == mod.NPCType("ArmoredDiggerBody") || npc.type == mod.NPCType("AstrumDeusTail") || npc.type == mod.NPCType("DespairStone") || npc.type == mod.NPCType("SoulSeekerSupreme") || npc.type == mod.NPCType("Leviathan")) { - protection = 0.35f; + DR = 0.35f; } else if (npc.type == mod.NPCType("CryogenIce") || npc.type == mod.NPCType("ProfanedGuardianBoss") || npc.type == mod.NPCType("ProvSpawnDefense") || npc.type == mod.NPCType("ScavengerBody")) { - protection = 0.4f; + DR = 0.4f; } else if (npc.type == mod.NPCType("ArmoredDiggerTail")) { - protection = 0.45f; + DR = 0.45f; } else if (npc.type == mod.NPCType("SirenIce")) { - protection = 0.5f; + DR = 0.5f; } else { @@ -939,7 +934,7 @@ namespace CalamityMod.NPCs case NPCID.CultistBoss: case NPCID.Crab: case NPCID.SeaSnail: - protection = 0.05f; + DR = 0.05f; break; case NPCID.Antlion: @@ -961,7 +956,7 @@ namespace CalamityMod.NPCs case NPCID.ArmoredViking: case NPCID.DD2Betsy: case NPCID.DD2OgreT2: - protection = 0.1f; + DR = 0.1f; break; case NPCID.ElfCopter: @@ -969,7 +964,7 @@ namespace CalamityMod.NPCs case NPCID.ArmoredSkeleton: case NPCID.PirateShipCannon: case NPCID.DD2OgreT3: - protection = 0.15f; + DR = 0.15f; break; case NPCID.Retinazer: @@ -1015,7 +1010,7 @@ namespace CalamityMod.NPCs case NPCID.GiantShelly: case NPCID.GiantShelly2: case NPCID.Mothron: - protection = 0.2f; + DR = 0.2f; break; case NPCID.PrimeSaw: @@ -1028,7 +1023,7 @@ namespace CalamityMod.NPCs case NPCID.GolemFistRight: case NPCID.GolemHead: case NPCID.GolemHeadFree: - protection = 0.25f; + DR = 0.25f; break; case NPCID.Mimic: @@ -1037,7 +1032,7 @@ namespace CalamityMod.NPCs case NPCID.BigMimicCrimson: case NPCID.BigMimicHallow: case NPCID.BigMimicJungle: - protection = 0.3f; + DR = 0.3f; break; case NPCID.GiantTortoise: @@ -1045,24 +1040,24 @@ namespace CalamityMod.NPCs case NPCID.SantaNK1: case NPCID.MartianWalker: case NPCID.TheDestroyerTail: - protection = 0.35f; + DR = 0.35f; break; case NPCID.DeadlySphere: - protection = 0.4f; + DR = 0.4f; break; case NPCID.Paladin: - protection = 0.45f; + DR = 0.45f; break; case NPCID.WallofFlesh: case NPCID.MothronEgg: - protection = 0.5f; + DR = 0.5f; break; case NPCID.DungeonGuardian: - protection = 0.999999f; + DR = 0.999999f; break; default: @@ -1351,6 +1346,7 @@ namespace CalamityMod.NPCs #region Strike NPC public override bool StrikeNPC(NPC npc, ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { + // TODO -- move this to Destroyer's Rev+ AI; either set his DR or modify npc.takenDamageMultiplier if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.TheDestroyerBody || npc.type == NPCID.TheDestroyerTail) { if ((newAI[1] < 480f || newAI[2] > 0f) && (CalamityWorld.revenge || CalamityWorld.bossRushActive)) @@ -1358,99 +1354,83 @@ namespace CalamityMod.NPCs damage *= 0.01; } } - else if (npc.type == mod.NPCType("SCalWormBody") || npc.type == mod.NPCType("SCalWormHead") || npc.type == mod.NPCType("SCalWormBodyWeak") || npc.type == mod.NPCType("SCalWormTail") || npc.type == mod.NPCType("EidolonWyrmHeadHuge")) - { - damage *= 0.000001; - } - double yellowCandleDamageBoost = damage * 0.05; // Get value before DR + // Yellow Candle provides +5% damage which ignores both DR and defense. + // However, armor penetration bonus damage has already been applied, so it's slightly higher than it should be. + double yellowCandleDamage = 0.05 * damage; - int newDefense = npc.defense - - (pFlames ? 4 : 0) - - (wDeath ? 50 : 0) - - (gsInferno ? 20 : 0) - - (astralInfection ? 8 : 0) - - (aFlames ? 10 : 0) - - (wCleave ? 15 : 0); + // Apply modifications to enemy's current defense based on Calamity debuffs. + // As with defense and DR, flat reductions apply first, then multiplicative reductions. + int effectiveDefense = npc.defense - + (pFlames ? Plague.DefenseReduction : 0) - + (wDeath ? WhisperingDeath.DefenseReduction : 0) - + (gsInferno ? GodSlayerInferno.DefenseReduction : 0) - + (astralInfection ? AstralInfectionDebuff.DefenseReduction : 0) - + (aFlames ? AbyssalFlames.DefenseReduction : 0) - + (wCleave ? WarCleave.DefenseReduction : 0); if (gState) - { - newDefense /= 2; - } - + effectiveDefense /= 2; if (aCrunch) - { - newDefense /= 3; - } + effectiveDefense /= 3; - if (newDefense < 0) - { - newDefense = 0; - } + // Defense can never be negative and has a minimum value of zero. + if (effectiveDefense < 0) + effectiveDefense = 0; - defense = newDefense; + // Apply vanilla-style defense before DR, using Calamity's reduced defense. + damage = Main.CalculateDamage((int)damage, effectiveDefense); - if (protection > 0f) - { - double newDamage = damage + (defense * 0.25); //defense damage boost 150 * .25 = 45 + 150 = 195 damage 180 defense + // DR applies after vanilla defense. + damage = ApplyDR(npc, damage); - if (marked) - { - protection *= 0.5f; - } + // Add Yellow Candle damage if the NPC isn't supposed to be "near invincible" + if (yellowCandle && DR < 0.99f && npc.takenDamageMultiplier > 0.05f) + damage += yellowCandleDamage; - if (npc.betsysCurse) - { - protection *= 0.66f; - } - - if (wCleave) - { - protection *= 0.75f; - } - - if (npc.ichor) - { - protection *= 0.75f; - } - else if (npc.onFire2) - { - protection *= 0.8f; - } - - if (protection < 0f) - { - protection = 0f; - } - - if (newDamage >= 1.0) - { - newDamage = (1f - protection) * newDamage; //DR calc 195 * 0.4 = 78 damage 0.6 DR - - if (newDamage < 1.0) - { - newDamage = 1.0; - } - } - - damage = newDamage; - protection = defProtection; - } - - if (protection < 0.99f) - { - if (yellowCandle) - { - damage += yellowCandleDamageBoost; - } - } - - return true; //vanilla defense calc 78 - (180 / 2 = 90) = 0, boosted to 1 by calc + // Cancel out vanilla defense math by reversing the calculation vanilla is about to perform. + // While roundabout, this is safer than returning false to stop vanilla damage calculations entirely. + // Other mods will probably expect the vanilla code to run and may compensate for it themselves. + damage = Main.CalculateDamage((int)damage, -defense); + return true; } - #endregion - #region Boss Head Slot - public override void BossHeadSlot(NPC npc, ref int index) + /// + /// Modifies damage incoming to an NPC based on their DR (damage reduction) stat added by Calamity.

+ /// This is entirely separate from vanilla's takenDamageMultiplier. + ///
+ /// Incoming damage. Has been modified by Main.DamageVar and boosted by armor penetration, but nothing else. + /// + private double ApplyDR(NPC npc, double damage) + { + if (DR <= 0f || damage <= 1.0) + return damage; + + float effectiveDR = DR; + if (marked) + effectiveDR *= 0.5f; + if (npc.betsysCurse) + effectiveDR *= 0.66f; + if (wCleave) + effectiveDR *= 0.75f; + + // Ichor and Cursed Flames are mutually exclusive + if (npc.ichor) + effectiveDR *= 0.75f; + else if (npc.onFire2) + effectiveDR *= 0.8f; + + // DR floor is 0%. Nothing can have negative DR. + if (effectiveDR <= 0f) + effectiveDR = 0f; + + double newDamage = (1f - effectiveDR) * damage; + return newDamage < 1.0 ? 1.0 : newDamage; + } + #endregion + + #region Boss Head Slot + public override void BossHeadSlot(NPC npc, ref int index) { if (CalamityWorld.revenge) { @@ -2564,7 +2544,7 @@ namespace CalamityMod.NPCs public override void OnHitByProjectile(NPC npc, Projectile projectile, int damage, float knockback, bool crit) { bool isSummon = projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type); - + if (Main.player[projectile.owner].GetCalamityPlayer().sGenerator) { if (isSummon && npc.damage > 0) diff --git a/NPCs/SupremeCalamitas/SCalWormBody.cs b/NPCs/SupremeCalamitas/SCalWormBody.cs index bdb74c2749..0b01037523 100644 --- a/NPCs/SupremeCalamitas/SCalWormBody.cs +++ b/NPCs/SupremeCalamitas/SCalWormBody.cs @@ -22,6 +22,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.width = 26; //28 npc.height = 18; //28 npc.defense = 0; + npc.takenDamageMultiplier = 1E-6f; npc.lifeMax = CalamityWorld.revenge ? 1200000 : 1000000; if (CalamityWorld.death) { diff --git a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs index 198075af0c..17764f6cf2 100644 --- a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs +++ b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs @@ -30,7 +30,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.aiStyle = 6; aiType = -1; npc.knockBackResist = 0f; - npc.scale = 1.2f; + npc.takenDamageMultiplier = 1E-6f; + npc.scale = 1.2f; if (Main.expertMode) { npc.scale = 1.35f; diff --git a/NPCs/SupremeCalamitas/SCalWormHead.cs b/NPCs/SupremeCalamitas/SCalWormHead.cs index fea35229c4..38523c07b7 100644 --- a/NPCs/SupremeCalamitas/SCalWormHead.cs +++ b/NPCs/SupremeCalamitas/SCalWormHead.cs @@ -29,6 +29,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.width = 56; //324 npc.height = 62; //216 npc.defense = 0; + npc.takenDamageMultiplier = 1E-6f; npc.lifeMax = CalamityWorld.revenge ? 1200000 : 1000000; if (CalamityWorld.death) { diff --git a/NPCs/SupremeCalamitas/SCalWormTail.cs b/NPCs/SupremeCalamitas/SCalWormTail.cs index a2de006140..b0c31f50fe 100644 --- a/NPCs/SupremeCalamitas/SCalWormTail.cs +++ b/NPCs/SupremeCalamitas/SCalWormTail.cs @@ -20,6 +20,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.width = 26; //324 npc.height = 46; //216 npc.defense = 0; + npc.takenDamageMultiplier = 1E-6f; npc.lifeMax = CalamityWorld.revenge ? 1200000 : 1000000; if (CalamityWorld.death) { diff --git a/Projectiles/Ranged/HalleysComet.cs b/Projectiles/Ranged/HalleysComet.cs index d916932bf3..6d439031ce 100644 --- a/Projectiles/Ranged/HalleysComet.cs +++ b/Projectiles/Ranged/HalleysComet.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Ranged { DisplayName.SetDefault("Halley's Comet"); } - + public override void SetDefaults() { projectile.width = 20; @@ -97,4 +97,4 @@ namespace CalamityMod.Projectiles.Ranged target.AddBuff(mod.BuffType("Nightwither"), 300); } } -} \ No newline at end of file +} diff --git a/Projectiles/Ranged/SparkSpreaderFire.cs b/Projectiles/Ranged/SparkSpreaderFire.cs index b4d6906bbf..ea5967466c 100644 --- a/Projectiles/Ranged/SparkSpreaderFire.cs +++ b/Projectiles/Ranged/SparkSpreaderFire.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Ranged { DisplayName.SetDefault("Fire"); } - + public override void SetDefaults() { projectile.width = 12; @@ -100,4 +100,4 @@ namespace CalamityMod.Projectiles.Ranged target.AddBuff(BuffID.OnFire, 60 * Main.rand.Next(1,4)); } } -} \ No newline at end of file +} diff --git a/Projectiles/Rogue/BlastBarrelProjectile.cs b/Projectiles/Rogue/BlastBarrelProjectile.cs index 7b063779eb..586e2b240a 100644 --- a/Projectiles/Rogue/BlastBarrelProjectile.cs +++ b/Projectiles/Rogue/BlastBarrelProjectile.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue public class BlastBarrelProjectile : ModProjectile { public float cooldown = 0f; - public float oldVelocityX = 0f; + public float oldVelocityX = 0f; public override void SetStaticDefaults() { DisplayName.SetDefault("Barrel"); @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Rogue { Vector2 fireVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); int fireIndex = Projectile.NewProjectile(projectile.Center, projectile.velocity + fireVelocity, - Main.rand.Next(ProjectileID.MolotovFire, ProjectileID.MolotovFire3 + 1), + Main.rand.Next(ProjectileID.MolotovFire, ProjectileID.MolotovFire3 + 1), BlastBarrel.BaseDamage, 1f, projectile.owner); Main.projectile[fireIndex].thrown = false; Main.projectile[fireIndex].GetGlobalProjectile(mod).rogue = true; @@ -97,4 +97,4 @@ namespace CalamityMod.Projectiles.Rogue return false; } } -} \ No newline at end of file +} diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs index 17e48c4f31..27c71c199c 100644 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ b/Projectiles/Rogue/EclipsesStealth.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Rogue public class EclipsesStealth : ModProjectile { private int deadinside = 0; //used to know when to drop spears from the sky - + public override void SetStaticDefaults() { DisplayName.SetDefault("Eclipse's Stealth"); @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.localNPCHitCooldown = 30; projectile.GetGlobalProjectile(mod).rogue = true; } - + public override void AI() { deadinside++; //congrats Pinkie diff --git a/Projectiles/Rogue/InkCloud.cs b/Projectiles/Rogue/InkCloud.cs index 8e5fcc27ec..48f0c5d8c8 100644 --- a/Projectiles/Rogue/InkCloud.cs +++ b/Projectiles/Rogue/InkCloud.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.alpha += 5; if (projectile.timeLeft < 75) projectile.velocity *= 0.95f; - } + } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { diff --git a/Projectiles/Rogue/InkCloud2.cs b/Projectiles/Rogue/InkCloud2.cs index 2a1a5f2b6e..e48b574a22 100644 --- a/Projectiles/Rogue/InkCloud2.cs +++ b/Projectiles/Rogue/InkCloud2.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.alpha += 5; if (projectile.timeLeft < 75) projectile.velocity *= 0.95f; - } + } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { diff --git a/Projectiles/Rogue/InkCloud3.cs b/Projectiles/Rogue/InkCloud3.cs index 271b01aa85..34952fb55e 100644 --- a/Projectiles/Rogue/InkCloud3.cs +++ b/Projectiles/Rogue/InkCloud3.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.alpha += 5; if (projectile.timeLeft < 75) projectile.velocity *= 0.95f; - } + } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { diff --git a/Projectiles/Rogue/ScourgeVenomCloud.cs b/Projectiles/Rogue/ScourgeVenomCloud.cs index ccff03a1d2..0316c517ee 100644 --- a/Projectiles/Rogue/ScourgeVenomCloud.cs +++ b/Projectiles/Rogue/ScourgeVenomCloud.cs @@ -75,4 +75,4 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Venom, 240); } } -} \ No newline at end of file +} diff --git a/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs b/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs index fcf715725f..b99e150e4d 100644 --- a/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs +++ b/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Rogue ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } - + public override void SetDefaults() { projectile.width = 26; @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.timeLeft = 1200; projectile.GetGlobalProjectile(mod).rogue = true; } - + public override void AI() { if (Main.rand.Next(5) == 0) @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[num622].velocity *= 1f; } if (projectile.owner == Main.myPlayer) - { + { int num320 = Main.rand.Next(2, 6); int num3; for (int num321 = 0; num321 < num320; num321 = num3 + 1) @@ -83,4 +83,4 @@ namespace CalamityMod.Projectiles.Rogue return false; } } -} \ No newline at end of file +} diff --git a/Projectiles/Rogue/ScourgeoftheSeasStealth.cs b/Projectiles/Rogue/ScourgeoftheSeasStealth.cs index 39982291dc..018105df32 100644 --- a/Projectiles/Rogue/ScourgeoftheSeasStealth.cs +++ b/Projectiles/Rogue/ScourgeoftheSeasStealth.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Rogue ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } - + public override void SetDefaults() { projectile.width = 26; @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 60; } - + public override void AI() { if (Main.rand.Next(5) == 0 && projectile.ai[0] != 1f) @@ -199,7 +199,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[num622].velocity *= 1f; } if (projectile.owner == Main.myPlayer) - { + { int num320 = Main.rand.Next(2, 6); int num3; for (int num321 = 0; num321 < num320; num321 = num3 + 1) @@ -219,4 +219,4 @@ namespace CalamityMod.Projectiles.Rogue return false; } } -} \ No newline at end of file +} diff --git a/Projectiles/Summon/BlackHawkSummon.cs b/Projectiles/Summon/BlackHawkSummon.cs index 6f03cb8db7..25f7ce94ee 100644 --- a/Projectiles/Summon/BlackHawkSummon.cs +++ b/Projectiles/Summon/BlackHawkSummon.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Summon ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; Main.projFrames[projectile.type] = 3; } - + public override void SetDefaults() { projectile.width = 36; @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Summon projectile.minion = true; target = GetClosestNPCToTarget(maxDistToEnemy, false); } - + public int GetClosestNPCToTarget(float maxDistance, bool ignoreTiles) { int closestNPC = -1; @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon } return closestNPC; } - + public override void AI() { if (projectile.localAI[0] == 0f) @@ -278,7 +278,7 @@ namespace CalamityMod.Projectiles.Summon projectile.netUpdate = true; } } - } + } if (Vector2.Distance(player.Center, projectile.Center) <= 1400 & !returningBackToPlayer) //don't return to player if currently busy dealing with an enemy { if (enemyCheckTimer % 240 == 0 & enemyCheckTimer != 0) @@ -293,4 +293,4 @@ namespace CalamityMod.Projectiles.Summon return false; } } -} \ No newline at end of file +} diff --git a/Tiles/CharredOre.cs b/Tiles/CharredOre.cs index 30876bce64..3c048beb99 100644 --- a/Tiles/CharredOre.cs +++ b/Tiles/CharredOre.cs @@ -60,4 +60,4 @@ namespace CalamityMod.Tiles return false; } } -} \ No newline at end of file +} diff --git a/Tiles/FurnitureOccult/OccultStone.cs b/Tiles/FurnitureOccult/OccultStone.cs index 71ac71a725..3df5ba0c33 100644 --- a/Tiles/FurnitureOccult/OccultStone.cs +++ b/Tiles/FurnitureOccult/OccultStone.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Tiles.FurnitureOccult //Left if ( - CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, true, 0, 1, i, j) && + CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, true, 0, 1, i, j) && (CheckTile(Type, true, -1, 1, i, j) || CheckTile(Type, false, -1, 0, i, j)) ) { diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 4c4857f285..f18118f3ea 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1,4 +1,6 @@ using CalamityMod.CalPlayer; +using CalamityMod.NPCs; +using CalamityMod.Projectiles; using CalamityMod.World; using Microsoft.Xna.Framework; using System.Collections.Generic; @@ -20,7 +22,7 @@ namespace CalamityMod { case 1: return player.GetCalamityPlayer().ZoneAbyssLayer1; - + case 2: return player.GetCalamityPlayer().ZoneAbyssLayer2; @@ -38,6 +40,8 @@ namespace CalamityMod public static class CNPCUtils { + public static CalamityGlobalNPC GetCalamityNPC(this NPC npc) => npc.GetGlobalNPC(); + /// /// Allows you to set the lifeMax value of a NPC to different values based on the mode. Called instead of npc.lifeMax = X. /// @@ -66,7 +70,7 @@ namespace CalamityMod if (npc.boss) { double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); } } /// @@ -108,6 +112,11 @@ namespace CalamityMod } } + public static class CProjectileUtils + { + public static CalamityGlobalProjectile GetCalamityProj(this Projectile proj) => proj.GetGlobalProjectile(); + } + public static class CMiscUtils { public static void AddWithCondition(this List list, T type, bool condition)