From b2dbe4990a2657690eadd4b698dd09512afa9682 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 20 Sep 2020 00:21:10 -0500 Subject: [PATCH] 1 - Nerfed Yanmei's Knife. 2 - Changed Slime God lore effect. 3 - Buffed Community base stats. 4 - Added projectile damage function calls in all boss files. 5 - Polterghast charge attack syncs. 6 - Provi AI refactor. 7 - Changed Ravager fight. 8 - Changed Signus fight. 9 - Death Mode Skeletron respawns all 4 hands when at 33% HP. --- Buffs/StatBuffs/KamiBuff.cs | 6 +- CalPlayer/CalamityPlayer.cs | 82 +- CalPlayer/CalamityPlayerLifeRegen.cs | 16 +- CalPlayer/CalamityPlayerMiscEffects.cs | 33 +- CalamityLists.cs | 100 +- Items/LoreItems/KnowledgeSlimeGod.cs | 18 +- NPCs/BrimstoneElemental/Brimling.cs | 5 +- NPCs/Calamitas/SoulSeeker.cs | 5 +- NPCs/CalamityAI.cs | 173 +- NPCs/CalamityGlobalAI.cs | 494 +++--- NPCs/CalamityGlobalNPC.cs | 11 +- NPCs/Crabulon/CrabulonIdle.cs | 13 +- NPCs/Cryogen/Cryogen.cs | 46 +- NPCs/Cryogen/CryogenIce.cs | 5 +- NPCs/DesertScourge/DesertScourgeBody.cs | 3 +- NPCs/DevourerofGods/DevourerofGodsBody.cs | 10 +- NPCs/DevourerofGods/DevourerofGodsHeadS.cs | 30 +- NPCs/HiveMind/DankCreeper.cs | 4 +- NPCs/HiveMind/DarkHeart.cs | 13 +- NPCs/HiveMind/HiveBlob.cs | 6 +- NPCs/HiveMind/HiveBlob2.cs | 6 +- NPCs/HiveMind/HiveMindP2.cs | 5 +- NPCs/Leviathan/Leviathan.cs | 14 +- NPCs/Leviathan/Siren.cs | 14 +- NPCs/NormalNPCs/KingSlimeJewel.cs | 7 +- NPCs/NormalNPCs/PhantomSpiritL.cs | 8 +- NPCs/Perforator/PerforatorBodyLarge.cs | 8 +- NPCs/Perforator/PerforatorBodyMedium.cs | 8 +- NPCs/Perforator/PerforatorBodySmall.cs | 8 +- NPCs/Perforator/PerforatorHive.cs | 6 +- .../PlaguebringerGoliath.cs | 27 +- .../PlaguebringerShade.cs | 11 +- NPCs/Polterghast/PhantomFuckYou.cs | 5 +- NPCs/Polterghast/PolterPhantom.cs | 17 +- NPCs/Polterghast/Polterghast.cs | 45 +- NPCs/Polterghast/PolterghastHook.cs | 8 +- .../ProfanedGuardians/ProfanedGuardianBoss.cs | 15 +- .../ProfanedGuardianBoss2.cs | 5 +- NPCs/Providence/ProvSpawnOffense.cs | 5 +- NPCs/Providence/Providence.cs | 1419 +++++++++-------- NPCs/Ravager/FlamePillar.cs | 36 +- NPCs/Ravager/RavagerBody.cs | 41 +- NPCs/Ravager/RavagerHead.cs | 8 +- NPCs/Ravager/RavagerHead2.cs | 27 +- NPCs/Signus/Signus.cs | 290 ++-- NPCs/Signus/SignusBomb.cs | 7 +- NPCs/SlimeGod/SlimeGod.cs | 12 +- NPCs/SlimeGod/SlimeGodCore.cs | 60 +- NPCs/SlimeGod/SlimeGodRun.cs | 12 +- NPCs/SlimeGod/SlimeGodRunSplit.cs | 12 +- NPCs/SlimeGod/SlimeGodSplit.cs | 12 +- NPCs/SlimeGod/SlimeSpawnCrimson2.cs | 11 +- NPCs/StormWeaver/StasisProbe.cs | 7 +- NPCs/StormWeaver/StasisProbeNaked.cs | 7 +- NPCs/StormWeaver/StormWeaverHead.cs | 23 +- NPCs/StormWeaver/StormWeaverHeadNaked.cs | 9 +- NPCs/SupremeCalamitas/SCalWormBodyWeak.cs | 5 +- NPCs/SupremeCalamitas/SoulSeekerSupreme.cs | 5 +- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 149 +- NPCs/SupremeCalamitas/SupremeCataclysm.cs | 15 +- NPCs/SupremeCalamitas/SupremeCatastrophe.cs | 17 +- NPCs/Yharon/DetonatingFlare.cs | 6 +- NPCs/Yharon/Yharon.cs | 38 +- Projectiles/Boss/BirbAuraFlare.cs | 9 +- Projectiles/Boss/BrimstoneBarrage.cs | 19 +- Projectiles/Boss/BrimstoneFireblast.cs | 56 +- Projectiles/Boss/BrimstoneGigaBlast.cs | 6 +- Projectiles/Boss/BrimstoneMonster.cs | 6 +- Projectiles/Boss/DoGBeam.cs | 4 +- Projectiles/Boss/DoGBeamPortal.cs | 3 +- Projectiles/Boss/FlareBomb.cs | 4 +- Projectiles/Boss/FlareDust.cs | 1 - Projectiles/Boss/Flarenado.cs | 4 +- Projectiles/Boss/HolyFire2.cs | 5 + Projectiles/Boss/Infernado.cs | 6 +- Projectiles/Boss/Infernado2.cs | 6 +- Projectiles/Boss/RavagerFlame.cs | 3 +- Projectiles/Boss/ScavengerLaser.cs | 66 +- Projectiles/Boss/ScavengerNuke.cs | 12 +- Projectiles/Boss/SignusScythe.cs | 46 +- Projectiles/CalamityGlobalProjectile.cs | 35 +- Projectiles/Typeless/YanmeisKnifeSlash.cs | 3 +- Utilities/NPCStats.cs | 25 +- 83 files changed, 1857 insertions(+), 1985 deletions(-) diff --git a/Buffs/StatBuffs/KamiBuff.cs b/Buffs/StatBuffs/KamiBuff.cs index 0e89d7656b..23a56290b4 100644 --- a/Buffs/StatBuffs/KamiBuff.cs +++ b/Buffs/StatBuffs/KamiBuff.cs @@ -5,12 +5,12 @@ namespace CalamityMod.Buffs.StatBuffs { public class KamiBuff : ModBuff { - public const float RunSpeedBoost = 0.2f; - public const float RunAccelerationBoost = 0.4f; + public const float RunSpeedBoost = 0.15f; + public const float RunAccelerationBoost = 0.15f; public override void SetDefaults() { DisplayName.SetDefault("Kami Injection"); - Description.SetDefault("Increased defense, movement speed, and damage"); + Description.SetDefault("Increased movement speed and damage"); Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 64d73fef08..ec2ed99725 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -373,7 +373,7 @@ namespace CalamityMod.CalPlayer public bool queenBeeLore = false; public bool skeletronLore = false; // This lore boolean is a bit different from the others. It just stops Slime God lore effects from stacking. - public bool slimeGodLoreProcessed = false; + public bool slimeGodLore = false; public bool wallOfFleshLore = false; public bool twinsLore = false; public bool destroyerLore = false; @@ -1319,22 +1319,22 @@ namespace CalamityMod.CalPlayer player.statLifeMax2 += player.statLifeMax / 5 / 20 * 25; if (community) { - float floatTypeBoost = 0.01f + + float floatTypeBoost = 0.05f + (NPC.downedSlimeKing ? 0.01f : 0f) + (NPC.downedBoss1 ? 0.01f : 0f) + (NPC.downedBoss2 ? 0.01f : 0f) + - (NPC.downedQueenBee ? 0.01f : 0f) + //0.05 - (NPC.downedBoss3 ? 0.01f : 0f) + - (Main.hardMode ? 0.01f : 0f) + + (NPC.downedQueenBee ? 0.01f : 0f) + + (NPC.downedBoss3 ? 0.01f : 0f) + // 0.1 + (Main.hardMode ? 0.01f : 0f) + (NPC.downedMechBossAny ? 0.01f : 0f) + (NPC.downedPlantBoss ? 0.01f : 0f) + - (NPC.downedGolemBoss ? 0.01f : 0f) + //0.1 - (NPC.downedFishron ? 0.01f : 0f) + - (NPC.downedAncientCultist ? 0.01f : 0f) + + (NPC.downedGolemBoss ? 0.01f : 0f) + + (NPC.downedFishron ? 0.01f : 0f) + // 0.15 + (NPC.downedAncientCultist ? 0.01f : 0f) + (NPC.downedMoonlord ? 0.01f : 0f) + - (CalamityWorld.downedProvidence ? 0.02f : 0f) + //0.15 - (CalamityWorld.downedDoG ? 0.02f : 0f) + //0.17 - (CalamityWorld.downedYharon ? 0.03f : 0f); //0.2 + (CalamityWorld.downedProvidence ? 0.01f : 0f) + + (CalamityWorld.downedDoG ? 0.01f : 0f) + + (CalamityWorld.downedYharon ? 0.01f : 0f); // 0.2 int integerTypeBoost = (int)(floatTypeBoost * 50f); player.statLifeMax2 += player.statLifeMax / 5 / 20 * integerTypeBoost; } @@ -1494,7 +1494,7 @@ namespace CalamityMod.CalPlayer perforatorLore = false; queenBeeLore = false; skeletronLore = false; - slimeGodLoreProcessed = false; + slimeGodLore = false; wallOfFleshLore = false; twinsLore = false; destroyerLore = false; @@ -3582,23 +3582,23 @@ namespace CalamityMod.CalPlayer } if (community) { - float floatTypeBoost = 0.01f + - (NPC.downedSlimeKing ? 0.01f : 0f) + - (NPC.downedBoss1 ? 0.01f : 0f) + - (NPC.downedBoss2 ? 0.01f : 0f) + - (NPC.downedQueenBee ? 0.01f : 0f) + //0.05 - (NPC.downedBoss3 ? 0.01f : 0f) + - (Main.hardMode ? 0.01f : 0f) + - (NPC.downedMechBossAny ? 0.01f : 0f) + - (NPC.downedPlantBoss ? 0.01f : 0f) + - (NPC.downedGolemBoss ? 0.01f : 0f) + //0.1 - (NPC.downedFishron ? 0.01f : 0f) + - (NPC.downedAncientCultist ? 0.01f : 0f) + - (NPC.downedMoonlord ? 0.01f : 0f) + - (CalamityWorld.downedProvidence ? 0.02f : 0f) + //0.15 - (CalamityWorld.downedDoG ? 0.02f : 0f) + //0.17 - (CalamityWorld.downedYharon ? 0.03f : 0f); //0.2 - meleeSpeedMult += floatTypeBoost * 0.25f; + float floatTypeBoost = 0.05f + + (NPC.downedSlimeKing ? 0.01f : 0f) + + (NPC.downedBoss1 ? 0.01f : 0f) + + (NPC.downedBoss2 ? 0.01f : 0f) + + (NPC.downedQueenBee ? 0.01f : 0f) + + (NPC.downedBoss3 ? 0.01f : 0f) + // 0.1 + (Main.hardMode ? 0.01f : 0f) + + (NPC.downedMechBossAny ? 0.01f : 0f) + + (NPC.downedPlantBoss ? 0.01f : 0f) + + (NPC.downedGolemBoss ? 0.01f : 0f) + + (NPC.downedFishron ? 0.01f : 0f) + // 0.15 + (NPC.downedAncientCultist ? 0.01f : 0f) + + (NPC.downedMoonlord ? 0.01f : 0f) + + (CalamityWorld.downedProvidence ? 0.01f : 0f) + + (CalamityWorld.downedDoG ? 0.01f : 0f) + + (CalamityWorld.downedYharon ? 0.01f : 0f); // 0.2 + meleeSpeedMult += floatTypeBoost * 0.25f; } if (eArtifact) { @@ -3867,6 +3867,7 @@ namespace CalamityMod.CalPlayer (auricSet ? 0.1f : 0f) + (dragonScales ? 0.1f : 0f) + (kamiBoost ? KamiBuff.RunAccelerationBoost : 0f) + + (slimeGodLore ? 0.1f : 0f) + (cTracers ? 0.1f : 0f) + (silvaSet ? 0.05f : 0f) + (eTracers ? 0.05f : 0f) + @@ -3887,7 +3888,8 @@ namespace CalamityMod.CalPlayer (silvaSet ? 0.05f : 0f) + (eTracers ? 0.05f : 0f) + (kamiBoost ? KamiBuff.RunSpeedBoost : 0f) + - (etherealExtorter && player.ZoneBeach ? 0.05f : 0f) + + (slimeGodLore ? 0.1f : 0f) + + (etherealExtorter && player.ZoneBeach ? 0.05f : 0f) + (stressPills ? 0.05f : 0f) + (laudanum && horror ? 0.1f : 0f) + (planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) + @@ -3952,6 +3954,12 @@ namespace CalamityMod.CalPlayer player.runAcceleration *= runAccMult; player.maxRunSpeed *= runSpeedMult; + + if (slimeGodLore) + { + if (!player.iceSkate) + player.runSlowdown *= 0.1f; + } #endregion #region DashEffects @@ -6350,25 +6358,11 @@ namespace CalamityMod.CalPlayer { double damageMultiplier = 1D; if (CalamityLists.revengeanceProjectileBuffList25Percent.Contains(proj.type)) - { damageMultiplier += 0.25; - } else if (CalamityLists.revengeanceProjectileBuffList20Percent.Contains(proj.type)) - { damageMultiplier += 0.2; - } else if (CalamityLists.revengeanceProjectileBuffList15Percent.Contains(proj.type)) - { damageMultiplier += 0.15; - } - else if (CalamityLists.revengeanceProjectileBuffList10Percent.Contains(proj.type)) - { - damageMultiplier += 0.1; - } - else if (CalamityLists.revengeanceProjectileBuffList5Percent.Contains(proj.type)) - { - damageMultiplier += 0.05; - } if (CalamityWorld.death) damageMultiplier += (damageMultiplier - 1D) * 0.6; diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 9c945978f9..d09625fe6e 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -643,22 +643,22 @@ namespace CalamityMod.CalPlayer if (modPlayer.community) { - float floatTypeBoost = 0.01f + + float floatTypeBoost = 0.05f + (NPC.downedSlimeKing ? 0.01f : 0f) + (NPC.downedBoss1 ? 0.01f : 0f) + (NPC.downedBoss2 ? 0.01f : 0f) + - (NPC.downedQueenBee ? 0.01f : 0f) + //0.05 - (NPC.downedBoss3 ? 0.01f : 0f) + + (NPC.downedQueenBee ? 0.01f : 0f) + + (NPC.downedBoss3 ? 0.01f : 0f) + // 0.1 (Main.hardMode ? 0.01f : 0f) + (NPC.downedMechBossAny ? 0.01f : 0f) + (NPC.downedPlantBoss ? 0.01f : 0f) + - (NPC.downedGolemBoss ? 0.01f : 0f) + //0.1 - (NPC.downedFishron ? 0.01f : 0f) + + (NPC.downedGolemBoss ? 0.01f : 0f) + + (NPC.downedFishron ? 0.01f : 0f) + // 0.15 (NPC.downedAncientCultist ? 0.01f : 0f) + (NPC.downedMoonlord ? 0.01f : 0f) + - (CalamityWorld.downedProvidence ? 0.02f : 0f) + //0.15 - (CalamityWorld.downedDoG ? 0.02f : 0f) + //0.17 - (CalamityWorld.downedYharon ? 0.03f : 0f); //0.2 + (CalamityWorld.downedProvidence ? 0.01f : 0f) + + (CalamityWorld.downedDoG ? 0.01f : 0f) + + (CalamityWorld.downedYharon ? 0.01f : 0f); // 0.2 int integerTypeBoost = (int)(floatTypeBoost * 50f); int regenBoost = 1 + (integerTypeBoost / 5); bool lesserEffect = false; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 954468489b..17d024f3a9 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1173,7 +1173,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.raiderTalisman) { float damageMult = modPlayer.nanotech ? 0.1f : 0.15f; - modPlayer.throwingDamage += (float)modPlayer.raiderStack / 150f * damageMult; + modPlayer.throwingDamage += modPlayer.raiderStack / 150f * damageMult; } // Silva minion bonus @@ -1195,10 +1195,7 @@ namespace CalamityMod.CalPlayer } if (modPlayer.kamiBoost) - { - player.allDamage += 0.3f; - player.statDefense += 20; - } + player.allDamage += 0.15f; if (modPlayer.roverDriveTimer < 616) { @@ -1530,6 +1527,13 @@ namespace CalamityMod.CalPlayer player.allDamage += 0.1f; modPlayer.AllCritBoost(5); } + if (modPlayer.slimeGodLore) + { + if (Main.myPlayer == player.whoAmI) + player.AddBuff(BuffID.Slimed, 2); + + player.statDefense -= 10; + } if (modPlayer.destroyerLore) { player.pickSpeed -= 0.05f; @@ -3037,22 +3041,22 @@ namespace CalamityMod.CalPlayer if (modPlayer.community) { - float floatTypeBoost = 0.01f + + float floatTypeBoost = 0.05f + (NPC.downedSlimeKing ? 0.01f : 0f) + (NPC.downedBoss1 ? 0.01f : 0f) + (NPC.downedBoss2 ? 0.01f : 0f) + - (NPC.downedQueenBee ? 0.01f : 0f) + //0.05 - (NPC.downedBoss3 ? 0.01f : 0f) + + (NPC.downedQueenBee ? 0.01f : 0f) + + (NPC.downedBoss3 ? 0.01f : 0f) + // 0.1 (Main.hardMode ? 0.01f : 0f) + (NPC.downedMechBossAny ? 0.01f : 0f) + (NPC.downedPlantBoss ? 0.01f : 0f) + - (NPC.downedGolemBoss ? 0.01f : 0f) + //0.1 - (NPC.downedFishron ? 0.01f : 0f) + + (NPC.downedGolemBoss ? 0.01f : 0f) + + (NPC.downedFishron ? 0.01f : 0f) + // 0.15 (NPC.downedAncientCultist ? 0.01f : 0f) + (NPC.downedMoonlord ? 0.01f : 0f) + - (CalamityWorld.downedProvidence ? 0.02f : 0f) + //0.15 - (CalamityWorld.downedDoG ? 0.02f : 0f) + //0.17 - (CalamityWorld.downedYharon ? 0.03f : 0f); //0.2 + (CalamityWorld.downedProvidence ? 0.01f : 0f) + + (CalamityWorld.downedDoG ? 0.01f : 0f) + + (CalamityWorld.downedYharon ? 0.01f : 0f); // 0.2 int integerTypeBoost = (int)(floatTypeBoost * 50f); int critBoost = integerTypeBoost / 2; float damageBoost = floatTypeBoost * 0.5f; @@ -3062,8 +3066,9 @@ namespace CalamityMod.CalPlayer modPlayer.AllCritBoost(critBoost); player.minionKB += floatTypeBoost; player.moveSpeed += floatTypeBoost; + double wingTimeBoost = 1 + floatTypeBoost; if (player.wingTimeMax > 0) - player.wingTimeMax = (int)(player.wingTimeMax * 1.15); + player.wingTimeMax = (int)(player.wingTimeMax * wingTimeBoost); } if (modPlayer.ravagerLore) diff --git a/CalamityLists.cs b/CalamityLists.cs index 5b92f9c836..5bdee4af8a 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -111,8 +111,6 @@ namespace CalamityMod public static List revengeanceProjectileBuffList25Percent; public static List revengeanceProjectileBuffList20Percent; public static List revengeanceProjectileBuffList15Percent; - public static List revengeanceProjectileBuffList10Percent; - public static List revengeanceProjectileBuffList5Percent; public static List revengeanceLifeStealExceptionList; public static List movementImpairImmuneList; public static List needsDebuffIconDisplayList; @@ -1341,12 +1339,7 @@ namespace CalamityMod ProjectileID.EbonsandBallFalling, ProjectileID.PearlSandBallFalling, ProjectileID.CrimsandBallFalling, - ProjectileID.GeyserTrap, - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType() + ProjectileID.GeyserTrap }; revengeanceProjectileBuffList20Percent = new List() @@ -1355,17 +1348,7 @@ namespace CalamityMod ProjectileID.DemonSickle, ProjectileID.SandnadoHostile, ProjectileID.DD2BetsyFireball, - ProjectileID.DD2BetsyFlameBreath, - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType() + ProjectileID.DD2BetsyFlameBreath }; revengeanceProjectileBuffList15Percent = new List() @@ -1374,7 +1357,6 @@ namespace CalamityMod ProjectileID.SpearTrap, ProjectileID.FlamethrowerTrap, ProjectileID.FlamesTrap, - ProjectileID.Fireball, ProjectileID.PaladinsHammerHostile, ProjectileID.FlamingWood, ProjectileID.FlamingScythe, @@ -1390,87 +1372,11 @@ namespace CalamityMod ProjectileID.VortexVortexLightning, ProjectileID.VortexLightning, ProjectileID.VortexAcid, - ProjectileID.Sharknado, - ProjectileID.Cthulunado, - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType() }; - revengeanceProjectileBuffList10Percent = new List() - { - ProjectileID.Boulder, - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType() - }; - - revengeanceProjectileBuffList5Percent = new List() - { - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType() - }; - revengeanceLifeStealExceptionList = new List() { NPCID.Probe, @@ -2430,8 +2336,6 @@ namespace CalamityMod revengeanceProjectileBuffList25Percent = null; revengeanceProjectileBuffList20Percent = null; revengeanceProjectileBuffList15Percent = null; - revengeanceProjectileBuffList10Percent = null; - revengeanceProjectileBuffList5Percent = null; revengeanceLifeStealExceptionList = null; movementImpairImmuneList = null; needsDebuffIconDisplayList = null; diff --git a/Items/LoreItems/KnowledgeSlimeGod.cs b/Items/LoreItems/KnowledgeSlimeGod.cs index 0d60631de9..68bfb0fc0e 100644 --- a/Items/LoreItems/KnowledgeSlimeGod.cs +++ b/Items/LoreItems/KnowledgeSlimeGod.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("The Slime God"); Tooltip.SetDefault("It is a travesty, one of the most threatening biological terrors ever created.\n" + "If this creature were allowed to combine every slime on the planet it would become nearly unstoppable.\n" + - "Favorite this item to become slimed and able to slide around on tiles quickly, at the cost of reduced defense.\n" + - "This effect makes dashing more difficult and does not work with mounts."); + "Favorite this item to become slimed and able to slide around on tiles, at the cost of reduced defense.\n" + + "This effect does not work with mounts."); } public override void SetDefaults() @@ -34,20 +34,10 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - if (player.mount.Active || !item.favorited || modPlayer.slimeGodLoreProcessed) + if (player.mount.Active || !item.favorited) return; - modPlayer.slimeGodLoreProcessed = true; - - if (player.dashDelay < 0 || (player.velocity.Length() >= 11f && CalamityPlayer.areThereAnyDamnBosses)) //If you go over 52.8 mph - player.velocity.X *= 0.9f; - - player.slippy2 = true; - - if (Main.myPlayer == player.whoAmI) - player.AddBuff(BuffID.Slimed, 2); - - player.statDefense -= 10; + modPlayer.slimeGodLore = true; } public override void AddRecipes() diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index 41db7cd0e2..b46c4c431e 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -146,8 +146,9 @@ namespace CalamityMod.NPCs.BrimstoneElemental num8 = speed / num8; num6 *= num8; num7 *= num8; - int projectileDamage = Main.expertMode ? 28 : 35; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, num6, num7, ModContent.ProjectileType(), projectileDamage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, num6, num7, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } if (vector251.Length() > 400f || !flag104) diff --git a/NPCs/Calamitas/SoulSeeker.cs b/NPCs/Calamitas/SoulSeeker.cs index 9963f646b2..2e1ee4e998 100644 --- a/NPCs/Calamitas/SoulSeeker.cs +++ b/NPCs/Calamitas/SoulSeeker.cs @@ -114,8 +114,9 @@ namespace CalamityMod.NPCs.Calamitas { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); } - int damage = expertMode ? 25 : 30; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X, direction.Y, ModContent.ProjectileType(), damage, 1f, npc.target); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X, direction.Y, type, damage, 1f, npc.target); } timer = 0; } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index d00f723c22..4dabd1dd0f 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -97,7 +97,8 @@ namespace CalamityMod.NPCs num743 *= num745; num744 *= num745; - int damage = expertMode ? 23 : 28; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); int numProj = 3; int spread = 36; float rotation = MathHelper.ToRadians(spread); @@ -109,7 +110,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < numProj; i++) { offsetAngle = startAngle + deltaAngle * i; - int proj = Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].tileCollide = false; } } @@ -189,7 +190,6 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { - int damageBoom = expertMode ? 23 : 28; float velocity = revenge ? 7.5f : 6.5f; if (death) velocity += 2f; @@ -198,15 +198,17 @@ namespace CalamityMod.NPCs int totalProjectiles = expertMode ? 30 : 20; float radians = MathHelper.TwoPi / totalProjectiles; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); for (int i = 0; i < totalProjectiles; i++) { - int projectileType = ModContent.ProjectileType(); Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); - Projectile.NewProjectile(npc.Center, vector255, projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); } - damageBoom = expertMode ? 28 : 33; int num320 = expertMode ? 14 : 7; + type = ModContent.ProjectileType(); + damage = npc.GetProjectileDamage(type); for (int num321 = 0; num321 < num320; num321++) { Vector2 vector15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); @@ -219,7 +221,7 @@ namespace CalamityMod.NPCs if (BossRushEvent.BossRushActive) vector15 *= 1.25f; - Projectile.NewProjectile(npc.Center, vector15, ModContent.ProjectileType(), damageBoom, 0f, Main.myPlayer, 0f, Main.rand.Next(-45, 1)); + Projectile.NewProjectile(npc.Center, vector15, type, damage, 0f, Main.myPlayer, 0f, Main.rand.Next(-45, 1)); } } } @@ -247,15 +249,15 @@ namespace CalamityMod.NPCs float num942 = player.position.X + player.width * 0.5f - vector104.X; float num943 = player.position.Y + player.height * 0.5f - vector104.Y; float num944 = (float)Math.Sqrt(num942 * num942 + num943 * num943); - int projectileType = ModContent.ProjectileType(); - int damage = expertMode ? 25 : 30; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); float num941 = BossRushEvent.BossRushActive ? 7.5f : 5f; num944 = num941 / num944; num942 *= num944; num943 *= num944; vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, 0f, 0f); npc.netUpdate = true; } } @@ -273,15 +275,15 @@ namespace CalamityMod.NPCs float num942 = player.position.X + player.width * 0.5f - vector104.X; float num943 = player.position.Y + player.height * 0.5f - vector104.Y; float num944 = (float)Math.Sqrt(num942 * num942 + num943 * num943); - int projectileType = ModContent.ProjectileType(); - int damage = expertMode ? 23 : 28; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); float num941 = BossRushEvent.BossRushActive ? 12f : 8f; num944 = num941 / num944; num942 *= num944; num943 *= num944; vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, 0f, 0f); npc.netUpdate = true; } } @@ -797,7 +799,8 @@ namespace CalamityMod.NPCs vectorCenter.X += num743 * 3f; vectorCenter.Y += num744 * 3f; - int damage = expertMode ? 25 : 30; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); int numProj = 4; int spread = 45; float rotation = MathHelper.ToRadians(spread); @@ -811,7 +814,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < numProj; i++) { offsetAngle = startAngle + deltaAngle * i; - Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), ModContent.ProjectileType(), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); } } @@ -835,9 +838,9 @@ namespace CalamityMod.NPCs relativeSpeedY *= totalRelativeSpeed; vectorCenter.X += relativeSpeedX * 3f; vectorCenter.Y += relativeSpeedY * 3f; - int projectileDamage = expertMode ? 28 : 35; - int projectileType = ModContent.ProjectileType(); - int projectileShot = Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, relativeSpeedX, relativeSpeedY, projectileType, projectileDamage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + type = ModContent.ProjectileType(); + damage = npc.GetProjectileDamage(type); + int projectileShot = Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, relativeSpeedX, relativeSpeedY, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); Main.projectile[projectileShot].timeLeft = 240; } } @@ -918,8 +921,6 @@ namespace CalamityMod.NPCs if (BossRushEvent.BossRushActive) projectileSpeed = 12f; - int damage = expertMode ? 25 : 30; - vectorCenter = player.Center - vectorCenter; float radialOffset = 0.2f; @@ -933,21 +934,25 @@ namespace CalamityMod.NPCs int totalProjectiles = 6; float offsetAngle = (float)Math.PI * radialOffset; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); for (int j = 0; j < totalProjectiles; j++) { float radians = j - (totalProjectiles - 1f) / 2f; Vector2 offset = velocity.RotatedBy(offsetAngle * radians, default); - int proj = Projectile.NewProjectile(npc.Center + offset, vectorCenter, ModContent.ProjectileType(), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.Center + offset, vectorCenter, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 300; Main.projectile[proj].tileCollide = false; } totalProjectiles = 12; float radians2 = MathHelper.TwoPi / totalProjectiles; + type = ModContent.ProjectileType(); + damage = npc.GetProjectileDamage(type); for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = new Vector2(0f, -projectileSpeed).RotatedBy(radians2 * k); - Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f); } } } @@ -1025,7 +1030,9 @@ namespace CalamityMod.NPCs Main.PlaySound(SoundID.Item68, source); Vector2 laserVelocity2 = new Vector2(npc.localAI[0], npc.localAI[1]); laserVelocity2.Normalize(); - Projectile.NewProjectile(source, laserVelocity2, ModContent.ProjectileType(), 40 + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, npc.whoAmI); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(source, laserVelocity2, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, npc.whoAmI); } } } @@ -1374,8 +1381,8 @@ namespace CalamityMod.NPCs if (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) num828 += 5f; - int num829 = expertMode ? 34 : 42; - int num830 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); num827 = (float)Math.Sqrt(num825 * num825 + num826 * num826); num827 = num828 / num827; num825 *= num827; @@ -1384,11 +1391,11 @@ namespace CalamityMod.NPCs vector82.Y += num826 * 6f; if (!Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { - int proj = Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, num830, num829 + (provy ? 30 : 0), 0f, Main.myPlayer, player.Center.X, player.Center.Y); + int proj = Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, player.Center.X, player.Center.Y); Main.projectile[proj].tileCollide = false; } else - Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, num830, num829 + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } else @@ -1400,15 +1407,15 @@ namespace CalamityMod.NPCs { npc.localAI[1] = 0f; float num828 = BossRushEvent.BossRushActive ? 16f : (expertMode ? 13f : 10.5f); - int num829 = expertMode ? 28 : 35; - int num830 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); num827 = (float)Math.Sqrt(num825 * num825 + num826 * num826); num827 = num828 / num827; num825 *= num827; num826 *= num827; vector82.X += num825 * 12f; vector82.Y += num826 * 12f; - Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, num830, num829 + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } } @@ -1507,8 +1514,8 @@ namespace CalamityMod.NPCs { npc.localAI[1] = 0f; float num837 = BossRushEvent.BossRushActive ? 15f : 11f; - int num838 = brotherAlive ? (expertMode ? 34 : 42) : (expertMode ? 28 : 35); - int num839 = brotherAlive ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = brotherAlive ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); num836 = (float)Math.Sqrt(num834 * num834 + num835 * num835); num836 = num837 / num836; num834 *= num836; @@ -1517,11 +1524,13 @@ namespace CalamityMod.NPCs vector83.Y += num835 * 12f; if (!Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { - int proj = Projectile.NewProjectile(vector83.X, vector83.Y, num834, num835, ModContent.ProjectileType(), (expertMode ? 34 : 42) + (provy ? 30 : 0), 0f, Main.myPlayer, player.Center.X, player.Center.Y); + type = ModContent.ProjectileType(); + damage = npc.GetProjectileDamage(type); + int proj = Projectile.NewProjectile(vector83.X, vector83.Y, num834, num835, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, player.Center.X, player.Center.Y); Main.projectile[proj].tileCollide = false; } else - Projectile.NewProjectile(vector83.X, vector83.Y, num834, num835, num839, num838 + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector83.X, vector83.Y, num834, num835, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } else @@ -1533,15 +1542,15 @@ namespace CalamityMod.NPCs { npc.localAI[1] = 0f; float num837 = BossRushEvent.BossRushActive ? 14f : 10.5f; - int num838 = expertMode ? 20 : 24; - int num839 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = (int)Math.Round(npc.GetProjectileDamage(type) * 0.75); num836 = (float)Math.Sqrt(num834 * num834 + num835 * num835); num836 = num837 / num836; num834 *= num836; num835 *= num836; vector83.X += num834 * 12f; vector83.Y += num835 * 12f; - Projectile.NewProjectile(vector83.X, vector83.Y, num834, num835, num839, num838 + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector83.X, vector83.Y, num834, num835, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } } @@ -1855,8 +1864,8 @@ namespace CalamityMod.NPCs { npc.localAI[1] = 0f; float num867 = BossRushEvent.BossRushActive ? 9f : 6f; - int num868 = expertMode ? 30 : 38; - int num869 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); vector86 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); num864 = player.position.X + (player.width / 2) - vector86.X; num865 = player.position.Y + (player.height / 2) - vector86.Y; @@ -1868,7 +1877,7 @@ namespace CalamityMod.NPCs num864 += npc.velocity.X * 0.5f; vector86.X -= num864 * 1f; vector86.Y -= num865 * 1f; - Projectile.NewProjectile(vector86.X, vector86.Y, num864, num865, num869, num868 + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector86.X, vector86.Y, num864, num865, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } } @@ -2128,8 +2137,8 @@ namespace CalamityMod.NPCs { npc.localAI[1] = 0f; float num867 = BossRushEvent.BossRushActive ? 18f : 12f; - int num868 = expertMode ? 29 : 36; - int num869 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); vector86 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); num864 = player.position.X + (player.width / 2) - vector86.X; num865 = player.position.Y + (player.height / 2) - vector86.Y; @@ -2141,7 +2150,7 @@ namespace CalamityMod.NPCs num864 += npc.velocity.X * 0.5f; vector86.X -= num864 * 1f; vector86.Y -= num865 * 1f; - Projectile.NewProjectile(vector86.X, vector86.Y, num864, num865, num869, num868 + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector86.X, vector86.Y, num864, num865, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } } @@ -2255,11 +2264,11 @@ namespace CalamityMod.NPCs bool phase3 = lifeRatio < 0.5f || death; // Despawn - if (!player.active || player.dead || dayTime) + if (!player.active || player.dead || dayTime || Vector2.Distance(player.Center, npc.Center) > 5600f) { npc.TargetClosest(false); player = Main.player[npc.target]; - if (!player.active || player.dead || dayTime) + if (!player.active || player.dead || dayTime || Vector2.Distance(player.Center, npc.Center) > 5600f) { npc.noTileCollide = true; @@ -2301,9 +2310,6 @@ namespace CalamityMod.NPCs { npc.localAI[0] = 0f; Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 33); - int laserDamage = expertMode ? 32 : 37; - if (NPC.downedMoonlord && revenge && !BossRushEvent.BossRushActive) - laserDamage *= 3; // Fire astral flames while teleporting if ((npc.ai[0] >= 5f && npc.ai[0] != 7) || calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) @@ -2311,10 +2317,15 @@ namespace CalamityMod.NPCs float velocity = BossRushEvent.BossRushActive ? 10f : 7f; int totalProjectiles = 8; float radians = MathHelper.TwoPi / totalProjectiles; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + if (NPC.downedMoonlord && revenge && !BossRushEvent.BossRushActive) + damage *= 3; + for (int i = 0; i < totalProjectiles; i++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); - Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), laserDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -2331,8 +2342,11 @@ namespace CalamityMod.NPCs num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num185 = ModContent.ProjectileType(); - value9.X += num180; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + if (NPC.downedMoonlord && revenge && !BossRushEvent.BossRushActive) + damage *= 3; + value9.X += num180; value9.Y += num182; for (int num186 = 0; num186 < 5; num186++) { @@ -2344,7 +2358,7 @@ namespace CalamityMod.NPCs num182 += Main.rand.Next(-60, 61); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, laserDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -3375,11 +3389,11 @@ namespace CalamityMod.NPCs num944 = num941 / num944; num942 *= num944; num943 *= num944; - int num945 = expertMode ? 38 : 45; - int num946 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); npc.netUpdate = true; } } @@ -3388,9 +3402,9 @@ namespace CalamityMod.NPCs { if (npc.localAI[0] % divisor == 0f && npc.ai[0] % 2f == 0f) { - int num945 = expertMode ? 45 : 60; - int num946 = ModContent.ProjectileType(); - int proj = Projectile.NewProjectile(npc.Center, Vector2.Zero, num946, num945, 0f, Main.myPlayer, 0f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + int proj = Projectile.NewProjectile(npc.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -3602,7 +3616,6 @@ namespace CalamityMod.NPCs if (calamityGlobalNPC.newAI[1] >= 600f * projectileFireRateMultiplier) { calamityGlobalNPC.newAI[1] = 0f; - int damage = (expertMode ? 50 : 60) + damageIncrease; if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { float num941 = 3f * tileEnrageMult; @@ -3613,10 +3626,11 @@ namespace CalamityMod.NPCs num944 = num941 / num944; num942 *= num944; num943 *= num944; - int num946 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, damage, 0f, Main.myPlayer, tileEnrageMult, 0f); + int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage + damageIncrease, 0f, Main.myPlayer, tileEnrageMult, 0f); Main.projectile[num947].timeLeft = baseProjectileTimeLeft / 2; npc.netUpdate = true; } @@ -3625,10 +3639,12 @@ namespace CalamityMod.NPCs { if (lifePercentage < 50 || death || !player.ZoneDungeon) { + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + float ai1 = player.ZoneDungeon ? 0f : 1f; for (int i = 0; i < 12; i++) { - float ai1 = player.ZoneDungeon ? 0f : 1f; - int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, i * 30, ai1); + int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, type, damage + damageIncrease, 0f, Main.myPlayer, i * 30, ai1); Main.projectile[proj].timeLeft = baseProjectileTimeLeft; } } @@ -3641,10 +3657,12 @@ namespace CalamityMod.NPCs int i; float passedVar = 1f; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); for (i = 0; i < 4; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, passedVar, 0f); + int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), type, damage + damageIncrease, 0f, Main.myPlayer, passedVar, 0f); Main.projectile[proj].timeLeft = baseProjectileTimeLeft; passedVar += 1f; } @@ -3998,8 +4016,9 @@ namespace CalamityMod.NPCs if (phase3) num1307 = 1; - int damage = expertMode ? 50 : 60; float featherVelocity = 3f + (enrageScale - 1) * 1.5f; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); if (num1307 == 0 && canHit && npc.localAI[3] == 0f) { @@ -4036,7 +4055,7 @@ namespace CalamityMod.NPCs { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(spawnVector, velocity, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, phase3 ? 1f : 0f); + Projectile.NewProjectile(spawnVector, velocity, type, damage, 0f, Main.myPlayer, 0f, phase3 ? 1f : 0f); } } } @@ -4060,7 +4079,7 @@ namespace CalamityMod.NPCs { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(spawnVector, velocity, ModContent.ProjectileType(), damage, 0f, Main.myPlayer); + Projectile.NewProjectile(spawnVector, velocity, type, damage, 0f, Main.myPlayer); } } } @@ -5100,11 +5119,12 @@ namespace CalamityMod.NPCs { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/OldDukeRoar"), (int)npc.position.X, (int)npc.position.Y); - int damage = expertMode ? 100 : 140; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); Vector2 vortexSpawn = vector + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / MathHelper.TwoPi; if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(vortexSpawn, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); + Projectile.NewProjectile(vortexSpawn, Vector2.Zero, type, damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); } } @@ -5154,12 +5174,13 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector7 = npc.rotation.ToRotationVector2() * (Vector2.UnitX * npc.direction) * (npc.width + 20) / 2f + vector; - int damage = expertMode ? 55 : 70; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); for (int i = 0; i < 20; i++) { float velocityX = npc.direction * 6 * (Main.rand.NextFloat() + 0.5f); float velocityY = 8f * (Main.rand.NextFloat() + 0.5f); - Projectile.NewProjectile(vector7.X, vector7.Y, velocityX, -velocityY, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector7.X, vector7.Y, velocityX, -velocityY, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -5466,12 +5487,13 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector7 = npc.rotation.ToRotationVector2() * (Vector2.UnitX * npc.direction) * (npc.width + 20) / 2f + vector; - int damage = expertMode ? 55 : 70; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); for (int i = 0; i < 20; i++) { float velocityX = npc.direction * 6 * (Main.rand.NextFloat() + 0.5f); float velocityY = 8f * (Main.rand.NextFloat() + 0.5f); - Projectile.NewProjectile(vector7.X, vector7.Y, velocityX, -velocityY, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector7.X, vector7.Y, velocityX, -velocityY, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -5507,11 +5529,12 @@ namespace CalamityMod.NPCs { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/OldDukeRoar"), (int)npc.position.X, (int)npc.position.Y); - int damage = expertMode ? 100 : 140; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); Vector2 vortexSpawn = vector + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / MathHelper.TwoPi; if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(vortexSpawn, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); + Projectile.NewProjectile(vortexSpawn, Vector2.Zero, type, damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); } } diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 1bff7e6436..6c1bff7ac8 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -1443,10 +1443,7 @@ namespace CalamityMod.NPCs num350 *= num351; float num418 = BossRushEvent.BossRushActive ? 18f : 12f; - int num419 = 15; - if (death) - num419 += 2; - int num420 = ProjectileID.CursedFlameHostile; + int type = ProjectileID.CursedFlameHostile; num351 = (float)Math.Sqrt(num349 * num349 + num350 * num350); num351 = num418 / num351; num349 *= num351; @@ -1454,7 +1451,7 @@ namespace CalamityMod.NPCs vector34.X += num349 * 3f; vector34.Y += num350 * 3f; - Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, num420, num419, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); } } } @@ -2188,8 +2185,10 @@ namespace CalamityMod.NPCs value9.X += num180; value9.Y += num182; - // Fire 10 projectiles in an arc - for (int num186 = 0; num186 < 5; num186++) + // Fire 10 projectiles in an arc + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + for (int num186 = 0; num186 < 5; num186++) { num180 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - value9.X; num182 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - value9.Y; @@ -2197,7 +2196,7 @@ namespace CalamityMod.NPCs num183 = num179 / num183; num180 += Main.rand.Next(-120, 121); num180 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, -5f, ModContent.ProjectileType(), 12, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, -5f, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -2649,10 +2648,7 @@ namespace CalamityMod.NPCs // Boost defense and damage as health decreases int statBoost = (int)(20f * (1f - npc.life / (float)npc.lifeMax)); - if (death) - npc.defense = npc.defDefense + 20; - else - npc.defense = npc.defDefense + statBoost; + npc.defense = npc.defDefense + statBoost; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -2709,11 +2705,11 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - int num618; - do num618 = Main.rand.Next(4); - while (num618 == npc.ai[1] || num618 == 1); + int phase; + do phase = Main.rand.Next(4); + while (phase == npc.ai[1] || phase == 1); - npc.ai[0] = num618; + npc.ai[0] = phase; npc.ai[1] = 0f; npc.ai[2] = 0f; } @@ -3033,24 +3029,15 @@ namespace CalamityMod.NPCs Main.PlaySound(SoundID.NPCHit1, (int)npc.position.X, (int)npc.position.Y); if (Main.netMode != NetmodeID.MultiplayerClient) { - int hornetAmt = CalamityLists.hornetList.Count; int spawnType = Main.rand.Next(210, 212); - if (npc.life < npc.lifeMax * 0.66 || death) - spawnType = 210; - - int random = death ? 5 : 6; - if (Main.rand.Next(random) == 0) - spawnType = CalamityLists.hornetList[Main.rand.Next(hornetAmt)]; - - int spawn = NPC.NewNPC((int)vector76.X, (int)vector76.Y, spawnType, 0, 0f, 0f, 0f, 0f, 255); + if (npc.life < npc.lifeMax * 0.33 || death) + spawnType = NPCID.Bee; + int spawn = NPC.NewNPC((int)vector76.X, (int)vector76.Y, spawnType); Main.npc[spawn].velocity = Main.player[npc.target].Center - npc.Center; Main.npc[spawn].velocity.Normalize(); Main.npc[spawn].velocity *= 5f; - - if (!CalamityLists.hornetList.Contains(spawnType)) - Main.npc[spawn].localAI[0] = 60f; - + Main.npc[spawn].localAI[0] = 60f; Main.npc[spawn].netUpdate = true; } } @@ -3138,12 +3125,8 @@ namespace CalamityMod.NPCs num627 = num624 / num627; num625 *= num627; num626 *= num627; - - int damage = Main.player[npc.target].buffImmune[BuffID.Poisoned] ? 18 : 14; - if (death) - damage += 2; int type = ProjectileID.Stinger; - int projectile = Projectile.NewProjectile(vector78.X, vector78.Y, num625, num626, type, damage, 0f, Main.myPlayer, 0f, 0f); + int projectile = Projectile.NewProjectile(vector78.X, vector78.Y, num625, num626, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); Main.projectile[projectile].timeLeft = 300; } } @@ -3269,11 +3252,12 @@ namespace CalamityMod.NPCs // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Phases - bool phase2 = lifeRatio < 0.33f || death; + // Phases + bool respawnHands = lifeRatio < 0.33f; + bool phase2 = respawnHands || death; - // Set defense - npc.defense = npc.defDefense; + // Set defense + npc.defense = npc.defDefense; // Spawn hands if (Main.netMode != NetmodeID.MultiplayerClient) @@ -3282,50 +3266,53 @@ namespace CalamityMod.NPCs { npc.TargetClosest(true); npc.ai[0] = 1f; - - int num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI, 0f, 0f, 0f, 0f, 255); - Main.npc[num155].ai[0] = -1f; - Main.npc[num155].ai[1] = npc.whoAmI; - Main.npc[num155].target = npc.target; - Main.npc[num155].netUpdate = true; - - num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI, 0f, 0f, 0f, 0f, 255); - Main.npc[num155].ai[0] = 1f; - Main.npc[num155].ai[1] = npc.whoAmI; - Main.npc[num155].ai[3] = 150f; - Main.npc[num155].target = npc.target; - Main.npc[num155].netUpdate = true; + SpawnHands(); } // Respawn hands - if (phase2 && calamityGlobalNPC.newAI[0] == 0f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 160f) + if (respawnHands && calamityGlobalNPC.newAI[0] == 0f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 160f) { npc.TargetClosest(true); calamityGlobalNPC.newAI[0] = 1f; Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, -0.25f); - - int num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI, 0f, 0f, 0f, 0f, 255); - Main.npc[num155].ai[0] = -1f; - - if (death) - Main.npc[num155].Calamity().newAI[0] = -1f; - - Main.npc[num155].ai[1] = npc.whoAmI; - Main.npc[num155].ai[3] = death ? -75f : 0f; - Main.npc[num155].target = npc.target; - Main.npc[num155].netUpdate = true; - - num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI, 0f, 0f, 0f, 0f, 255); - Main.npc[num155].ai[0] = 1f; - - if (death) - Main.npc[num155].Calamity().newAI[0] = -1f; - - Main.npc[num155].ai[1] = npc.whoAmI; - Main.npc[num155].ai[3] = death ? 75f : 150f; - Main.npc[num155].target = npc.target; - Main.npc[num155].netUpdate = true; + SpawnHands(); } + + void SpawnHands() + { + int num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI); + Main.npc[num155].ai[0] = -1f; + Main.npc[num155].ai[1] = npc.whoAmI; + Main.npc[num155].target = npc.target; + Main.npc[num155].netUpdate = true; + + num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI); + Main.npc[num155].ai[0] = 1f; + Main.npc[num155].ai[1] = npc.whoAmI; + Main.npc[num155].ai[3] = 150f; + Main.npc[num155].target = npc.target; + Main.npc[num155].netUpdate = true; + + // Spawn two additional hands with different attack timings + if (death) + { + num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI); + Main.npc[num155].ai[0] = -1f; + Main.npc[num155].Calamity().newAI[0] = -1f; + Main.npc[num155].ai[1] = npc.whoAmI; + Main.npc[num155].ai[3] = respawnHands ? -75f : 0f; + Main.npc[num155].target = npc.target; + Main.npc[num155].netUpdate = true; + + num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI); + Main.npc[num155].ai[0] = 1f; + Main.npc[num155].Calamity().newAI[0] = -1f; + Main.npc[num155].ai[1] = npc.whoAmI; + Main.npc[num155].ai[3] = respawnHands ? 75f : 150f; + Main.npc[num155].target = npc.target; + Main.npc[num155].netUpdate = true; + } + } } // Distance from target @@ -3381,12 +3368,9 @@ namespace CalamityMod.NPCs else if (num151 > 5f) num151 = 5f; - int num152 = 19; - if (death) - num152 += 2; - int num153 = ProjectileID.Shadowflames; - - Vector2 value19 = Main.player[npc.target].Center - npc.Center; + int type = ProjectileID.Shadowflames; + int damage = npc.GetProjectileDamage(type); + Vector2 value19 = Main.player[npc.target].Center - npc.Center; value19.Normalize(); value19 *= num151; int numProj = 2; @@ -3394,7 +3378,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < numProj + 1; i++) { Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, num153, num152, 0f, Main.myPlayer, 0f, 1f); + int proj = Projectile.NewProjectile(npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 1f); Main.projectile[proj].timeLeft = 600; } } @@ -3526,12 +3510,10 @@ namespace CalamityMod.NPCs vector19 += npc.velocity; num163 = vector19.X; num164 = vector19.Y; - int num166 = 21; - if (death) - num166 += 2; - int num167 = ProjectileID.Skull; - vector18 += vector19 * 5f; - int num168 = Projectile.NewProjectile(vector18.X, vector18.Y, num163, num164, num167, num166, 0f, Main.myPlayer, -1f, 0f); + int type = ProjectileID.Skull; + int damage = npc.GetProjectileDamage(type); + vector18 += vector19 * 5f; + int num168 = Projectile.NewProjectile(vector18.X, vector18.Y, num163, num164, type, damage, 0f, Main.myPlayer, -1f, 0f); Main.projectile[num168].timeLeft = 300; } } @@ -4423,10 +4405,8 @@ namespace CalamityMod.NPCs if (BossRushEvent.BossRushActive) velocity *= 1.5f; - int damage = phase2 ? 22 : 17; - if (death) - damage += 2; int projectileType = phase2 ? ProjectileID.DeathLaser : ProjectileID.EyeLaser; + int damage = npc.GetProjectileDamage(projectileType); float laserSpawnDistance = fireAcceleratingLasers ? 30f : 10f; Vector2 projectileVelocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center) * velocity; @@ -4610,7 +4590,6 @@ namespace CalamityMod.NPCs projectileSpeed *= 1.25f; // Set projectile damage and type, set projectile to saucer scrap if probe has been launched - int damage = death ? 25 : 23; int projectileType = ProjectileID.DeathLaser; float laserSpawnDistance = 5f; if (npc.ai[2] == 0f || Main.rand.NextBool(2)) @@ -4622,18 +4601,15 @@ namespace CalamityMod.NPCs case 1: break; case 2: - damage += 2; projectileType = ModContent.ProjectileType(); break; case 3: - damage += 4; projectileType = ModContent.ProjectileType(); break; } if (calamityGlobalNPC.newAI[2] > 0f) { - damage += 4; projectileType = ModContent.ProjectileType(); laserSpawnDistance = 10f; } @@ -4649,8 +4625,9 @@ namespace CalamityMod.NPCs Vector2 projectileSpawn = npc.Center + projectileVelocity * laserSpawnDistance; - // Shoot projectile and set timeLeft if not a homing laser/metal scrap so lasers don't last for too long - int proj = Projectile.NewProjectile(npc.Center, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, 1f, 0f); + // Shoot projectile and set timeLeft if not a homing laser/metal scrap so lasers don't last for too long + int damage = npc.GetProjectileDamage(projectileType); + int proj = Projectile.NewProjectile(npc.Center, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, 1f, 0f); if (projectileType == ProjectileID.SaucerScrap) Main.projectile[proj].timeLeft = 480; @@ -5093,8 +5070,9 @@ namespace CalamityMod.NPCs npc.localAI[0] = 0f; if (targetData.Type != 0 && Collision.CanHit(npc.position, npc.width, npc.height, targetData.Position, targetData.Width, targetData.Height)) { - int damage = Main.expertMode ? 22 : 25; - Projectile.NewProjectile(vector.X, vector.Y, num4, num5, ProjectileID.PinkLaser, damage, 0f, Main.myPlayer); + int type = ProjectileID.PinkLaser; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(vector.X, vector.Y, num4, num5, type, damage, 0f, Main.myPlayer); } } @@ -5637,19 +5615,17 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { float num389 = BossRushEvent.BossRushActive ? 12f : 10.5f; - int num390 = 23; - if (death) - num390 += 2; - int num391 = ProjectileID.EyeLaser; + int type = ProjectileID.EyeLaser; + int damage = npc.GetProjectileDamage(type); - num387 = (float)Math.Sqrt(num385 * num385 + num386 * num386); + num387 = (float)Math.Sqrt(num385 * num385 + num386 * num386); num387 = num389 / num387; num385 *= num387; num386 *= num387; vector40.X += num385 * 15f; vector40.Y += num386 * 15f; - Projectile.NewProjectile(vector40.X, vector40.Y, num385, num386, num391, num390, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector40.X, vector40.Y, num385, num386, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -5869,12 +5845,10 @@ namespace CalamityMod.NPCs { npc.localAI[1] = 0f; float num404 = BossRushEvent.BossRushActive ? 12f : 10f; - int num405 = 28; - if (death) - num405 += 3; - int num406 = ProjectileID.DeathLaser; + int type = ProjectileID.DeathLaser; + int damage = npc.GetProjectileDamage(type); - num403 = (float)Math.Sqrt(num401 * num401 + num402 * num402); + num403 = (float)Math.Sqrt(num401 * num401 + num402 * num402); num403 = num404 / num403; num401 *= num403; num402 *= num403; @@ -5882,10 +5856,10 @@ namespace CalamityMod.NPCs vector42.Y += num402 * 15f; if (canHit) - Projectile.NewProjectile(vector42.X, vector42.Y, num401, num402, num406, num405, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector42.X, vector42.Y, num401, num402, type, damage, 0f, Main.myPlayer, 0f, 0f); else { - int proj = Projectile.NewProjectile(vector42.X, vector42.Y, num401, num402, num406, num405, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(vector42.X, vector42.Y, num401, num402, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft = 300; } @@ -5972,12 +5946,10 @@ namespace CalamityMod.NPCs { npc.localAI[1] = 0f; float num414 = BossRushEvent.BossRushActive ? 11f : 9f; - int num415 = 21; - if (death) - num415 += 2; - int num416 = ProjectileID.DeathLaser; + int type = ProjectileID.DeathLaser; + int damage = (int)Math.Round(npc.GetProjectileDamage(type) * 0.75); - num413 = (float)Math.Sqrt(num411 * num411 + num412 * num412); + num413 = (float)Math.Sqrt(num411 * num411 + num412 * num412); num413 = num414 / num413; num411 *= num413; num412 *= num413; @@ -5985,10 +5957,10 @@ namespace CalamityMod.NPCs vector43.Y += num412 * 15f; if (canHit) - Projectile.NewProjectile(vector43.X, vector43.Y, num411, num412, num416, num415, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector43.X, vector43.Y, num411, num412, type, damage, 0f, Main.myPlayer, 0f, 0f); else { - int proj = Projectile.NewProjectile(vector43.X, vector43.Y, num411, num412, num416, num415, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(vector43.X, vector43.Y, num411, num412, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft = 300; } @@ -6071,12 +6043,10 @@ namespace CalamityMod.NPCs Main.PlaySound(SoundID.Item33, npc.position); float num353 = 6f; - int num354 = 30; - if (death) - num354 += 3; - int num355 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); - vector34 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + vector34 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); num349 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector34.X; num350 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector34.Y; num351 = (float)Math.Sqrt(num349 * num349 + num350 * num350); @@ -6086,7 +6056,7 @@ namespace CalamityMod.NPCs vector34.X += num349; vector34.Y += num350; - Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, num355, num354, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -6348,12 +6318,10 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { float num430 = BossRushEvent.BossRushActive ? 20f : 15f; - int num431 = 27; - if (death) - num431 += 3; - int num432 = ProjectileID.CursedFlameHostile; + int type = ProjectileID.CursedFlameHostile; + int damage = npc.GetProjectileDamage(type); - num429 = (float)Math.Sqrt(num427 * num427 + num428 * num428); + num429 = (float)Math.Sqrt(num427 * num427 + num428 * num428); num429 = num430 / num429; num427 *= num429; num428 *= num429; @@ -6362,7 +6330,7 @@ namespace CalamityMod.NPCs vector44.X += num427 * 4f; vector44.Y += num428 * 4f; - Projectile.NewProjectile(vector44.X, vector44.Y, num427, num428, num432, num431, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector44.X, vector44.Y, num427, num428, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -6606,13 +6574,10 @@ namespace CalamityMod.NPCs npc.localAI[1] = 0f; float num446 = BossRushEvent.BossRushActive ? 9f : 6f; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); - int num447 = 33; - if (death) - num447 += 3; - int num448 = ModContent.ProjectileType(); - - vector46 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + vector46 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); num443 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector46.X; num444 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector46.Y; num445 = (float)Math.Sqrt(num443 * num443 + num444 * num444); @@ -6627,10 +6592,10 @@ namespace CalamityMod.NPCs vector46.Y -= num444 * 1f; if (canHit) - Projectile.NewProjectile(vector46.X, vector46.Y, num443, num444, num448, num447, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector46.X, vector46.Y, num443, num444, type, damage, 0f, Main.myPlayer, 0f, 0f); else { - int proj = Projectile.NewProjectile(vector46.X, vector46.Y, num443, num444, num448, num447, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(vector46.X, vector46.Y, num443, num444, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].tileCollide = false; } } @@ -6890,19 +6855,17 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { float num430 = 16f; - int num431 = 31; - if (death) - num431 += 3; - int num432 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); - float num429 = (float)Math.Sqrt(num427 * num427 + num428 * num428); + float num429 = (float)Math.Sqrt(num427 * num427 + num428 * num428); num429 = num430 / num429; num427 *= num429; num428 *= num429; vector44.X += num427 * 4f; vector44.Y += num428 * 4f; - Projectile.NewProjectile(vector44.X, vector44.Y, num427, num428, num432, num431, 0f, Main.myPlayer, 0f, retAlive ? 0f : 1f); + Projectile.NewProjectile(vector44.X, vector44.Y, num427, num428, type, damage, 0f, Main.myPlayer, 0f, retAlive ? 0f : 1f); } } @@ -7106,12 +7069,13 @@ namespace CalamityMod.NPCs int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = death ? 34 : 31; + int type = ProjectileID.DeathLaser; + int damage = npc.GetProjectileDamage(type); float velocity = BossRushEvent.BossRushActive ? 6.5f : 5f; for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k); - int proj = Projectile.NewProjectile(npc.Center, vector255, ProjectileID.DeathLaser, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].timeLeft = 300; } } @@ -7128,11 +7092,9 @@ namespace CalamityMod.NPCs { npc.localAI[2] = 0f; float num502 = BossRushEvent.BossRushActive ? 10f : 6.5f; - int num503 = 33; - if (death) - num503 += 3; - int num504 = ProjectileID.RocketSkeleton; - Vector2 value19 = Main.player[npc.target].Center - npc.Center; + int type = ProjectileID.RocketSkeleton; + int damage = npc.GetProjectileDamage(type); + Vector2 value19 = Main.player[npc.target].Center - npc.Center; value19.Normalize(); value19 *= num502; int numProj = 2; @@ -7140,7 +7102,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < numProj + 1; i++) { Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, num504, num503, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, 1f); } } } @@ -7231,12 +7193,13 @@ namespace CalamityMod.NPCs int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = death ? 34 : 31; + int type = ProjectileID.DeathLaser; + int damage = npc.GetProjectileDamage(type); float velocity = BossRushEvent.BossRushActive ? 6.5f : 5f; for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k); - int proj = Projectile.NewProjectile(npc.Center, vector255, ProjectileID.DeathLaser, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].timeLeft = 300; } } @@ -7335,10 +7298,9 @@ namespace CalamityMod.NPCs num160 = value.X; num161 = value.Y; - int num163 = 250; - int num164 = ProjectileID.Skull; + int type = ProjectileID.Skull; vector16 += value * 5f; - int num165 = Projectile.NewProjectile(vector16.X, vector16.Y, num160, num161, num164, num163, 0f, Main.myPlayer, -1f, 0f); + int num165 = Projectile.NewProjectile(vector16.X, vector16.Y, num160, num161, type, 250, 0f, Main.myPlayer, -1f, 0f); Main.projectile[num165].timeLeft = 300; } } @@ -7413,12 +7375,10 @@ namespace CalamityMod.NPCs num160 = value.X; num161 = value.Y; - int num163 = 28; - if (death) - num163 += 3; - int num164 = ProjectileID.Skull; + int type = ProjectileID.Skull; + int damage = npc.GetProjectileDamage(type); vector16 += value * 5f; - int num165 = Projectile.NewProjectile(vector16.X, vector16.Y, num160, num161, num164, num163, 0f, Main.myPlayer, -1f, 0f); + int num165 = Projectile.NewProjectile(vector16.X, vector16.Y, num160, num161, type, damage, 0f, Main.myPlayer, -1f, 0f); Main.projectile[num165].timeLeft = 180; Main.projectile[num165].tileCollide = false; } @@ -7503,11 +7463,10 @@ namespace CalamityMod.NPCs Vector2 velocity = new Vector2(-1f * (float)Main.rand.NextDouble() * 3f, 1f); velocity = velocity.RotatedBy((Main.rand.NextDouble() - 0.5) * MathHelper.PiOver4); velocity *= BossRushEvent.BossRushActive ? 7.5f : 5f; - int damage = 33; - if (death) - damage += 3; + int type = ProjectileID.SaucerMissile; + int damage = npc.GetProjectileDamage(type); float delayBeforeHoming = BossRushEvent.BossRushActive ? 30f : 45f; - Projectile.NewProjectile(npc.Center.X + Main.rand.Next(npc.width / 2), npc.Center.Y + 4f, velocity.X, velocity.Y, ProjectileID.SaucerMissile, damage, 0f, Main.myPlayer, 0f, delayBeforeHoming); + Projectile.NewProjectile(npc.Center.X + Main.rand.Next(npc.width / 2), npc.Center.Y + 4f, velocity.X, velocity.Y, type, damage, 0f, Main.myPlayer, 0f, delayBeforeHoming); } Main.PlaySound(SoundID.Item39, npc.Center); @@ -7668,16 +7627,14 @@ namespace CalamityMod.NPCs { npc.localAI[0] = 0f; float num509 = BossRushEvent.BossRushActive ? 13f : 11f; - int num510 = 31; - if (death) - num510 += 3; - int num511 = ProjectileID.DeathLaser; - num508 = num509 / num508; + int type = ProjectileID.DeathLaser; + int damage = npc.GetProjectileDamage(type); + num508 = num509 / num508; num506 *= num508; num507 *= num508; vector62.X += num506 * 8f; vector62.Y += num507 * 8f; - Projectile.NewProjectile(vector62.X, vector62.Y, num506, num507, num511, num510, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector62.X, vector62.Y, num506, num507, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -7762,12 +7719,13 @@ namespace CalamityMod.NPCs int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = death ? 34 : 31; + int type = ProjectileID.DeathLaser; + int damage = npc.GetProjectileDamage(type); float velocity = BossRushEvent.BossRushActive ? 6.5f : 5f; for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k); - int proj = Projectile.NewProjectile(npc.Center, vector255, ProjectileID.DeathLaser, damage, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].timeLeft = 300; } } @@ -7950,16 +7908,14 @@ namespace CalamityMod.NPCs { npc.localAI[0] = 0f; float num495 = BossRushEvent.BossRushActive ? 10f : 6.5f; - int num496 = 33; - if (death) - num496 += 3; - int num497 = ProjectileID.RocketSkeleton; - num494 = num495 / num494; + int type = ProjectileID.RocketSkeleton; + int damage = npc.GetProjectileDamage(type); + num494 = num495 / num494; num492 *= num494; num493 *= num494; vector60.X += num492 * 5f; vector60.Y += num493 * 5f; - Projectile.NewProjectile(vector60.X, vector60.Y, num492, num493, num497, num496, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(vector60.X, vector60.Y, num492, num493, type, damage, 0f, Main.myPlayer, 0f, 1f); } } } @@ -8022,11 +7978,9 @@ namespace CalamityMod.NPCs { npc.localAI[0] = 0f; float num502 = BossRushEvent.BossRushActive ? 10f : 6.5f; - int num503 = 33; - if (death) - num503 += 3; - int num504 = ProjectileID.RocketSkeleton; - Vector2 value19 = Main.player[npc.target].Center - npc.Center; + int type = ProjectileID.RocketSkeleton; + int damage = npc.GetProjectileDamage(type); + Vector2 value19 = Main.player[npc.target].Center - npc.Center; value19.Normalize(); value19 *= num502; int numProj = 2; @@ -8034,7 +7988,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < numProj + 1; i++) { Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, num504, num503, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, 1f); } } } @@ -8969,11 +8923,9 @@ namespace CalamityMod.NPCs num743 *= num745; num744 *= num745; - int damage = 24; int projectileType = ProjectileID.SeedPlantera; if ((lifeRatio < 0.9f || death) && Main.rand.NextBool(2)) { - damage = 30; npc.localAI[1] = -30f; projectileType = ProjectileID.PoisonSeedPlantera; } @@ -8990,16 +8942,13 @@ namespace CalamityMod.NPCs } if (thornBallCount < 2) { - damage = 34; npc.localAI[1] = -120f; projectileType = ProjectileID.ThornBall; } } - if (death) - damage += 3; - - if (enrage) + int damage = npc.GetProjectileDamage(projectileType); + if (enrage) damage *= 2; vector93.X += num743 * 3f; @@ -9145,10 +9094,6 @@ namespace CalamityMod.NPCs vector93.X += num743 * 3f; vector93.Y += num744 * 3f; - int damage = 30; - if (death) - damage += 3; - bool anyThornBalls = false; for (int i = 0; i < Main.maxProjectiles; i++) { @@ -9160,11 +9105,12 @@ namespace CalamityMod.NPCs } if (!anyThornBalls && !insideTiles) { - damage += 4; + int type = ProjectileID.ThornBall; + int damage = npc.GetProjectileDamage(type); if (enrage) damage *= 2; - Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, ProjectileID.ThornBall, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, type, damage, 0f, Main.myPlayer, 0f, 0f); npc.localAI[3] = -240f; } @@ -9174,6 +9120,9 @@ namespace CalamityMod.NPCs int spread = 2 + tentacleScale; // 3 to 10, wider spread is harder to avoid if (nearbyActiveTiles < 300) spread = (Main.rand.NextBool(2) ? 3 : 6) + (tentacleScale / 2); + + int type = ProjectileID.PoisonSeedPlantera; + int damage = npc.GetProjectileDamage(type); if (enrage) damage *= 2; @@ -9181,7 +9130,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < numProj + 1; i++) { Vector2 perturbedSpeed = new Vector2(num743, num744).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(vector93, perturbedSpeed, ProjectileID.PoisonSeedPlantera, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector93, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 0f); } npc.localAI[3] = 0f; @@ -9211,9 +9160,8 @@ namespace CalamityMod.NPCs vector93.X += num743 * 3f; vector93.Y += num744 * 3f; - int damage = 35; - if (death) - damage += 3; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); if (enrage) damage *= 2; @@ -9232,7 +9180,7 @@ namespace CalamityMod.NPCs { offsetAngle = startAngle + deltaAngle * i; float ai0 = Main.rand.Next(3); - Projectile.NewProjectile(vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, ai0, 0f); + Projectile.NewProjectile(vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, ai0, 0f); } calamityGlobalNPC.newAI[0] = 0f; @@ -9723,13 +9671,11 @@ namespace CalamityMod.NPCs vector82.X += num674 * 3f; vector82.Y += num675 * 3f; - int damage = 35; - if (death) - damage += 3; - + int type = ProjectileID.EyeBeam; + int damage = npc.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) { - int num677 = Projectile.NewProjectile(vector82.X, vector82.Y, num674, num675, ProjectileID.EyeBeam, damage, 0f, Main.myPlayer, 0f, 0f); + int num677 = Projectile.NewProjectile(vector82.X, vector82.Y, num674, num675, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num677].timeLeft = 480; } } @@ -9856,12 +9802,10 @@ namespace CalamityMod.NPCs velocityY *= 2f; } - int damage = 37; - if (death) - damage += 3; - + int type = ProjectileID.Fireball; + int damage = npc.GetProjectileDamage(type); int proj = Projectile.NewProjectile(npc.Center.X + Main.rand.Next(-spawnX, spawnX), npc.Center.Y + npc.height / 2 * 0.8f, - velocityX, velocityY, ProjectileID.Fireball, damage, 0f, Main.myPlayer, 0f, 0f); + velocityX, velocityY, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].timeLeft = 240; } } @@ -10025,12 +9969,10 @@ namespace CalamityMod.NPCs num656 *= num658; num657 *= num658; - int damage = 37; - if (death) - damage += 3; - + int type = ProjectileID.Fireball; + int damage = npc.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(vector81.X, vector81.Y, num656, num657, ProjectileID.Fireball, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector81.X, vector81.Y, num656, num657, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -10079,12 +10021,10 @@ namespace CalamityMod.NPCs num664 *= num666; num665 *= num666; - int damage = 37; - if (death) - damage += 3; - + int type = ProjectileID.Fireball; + int damage = npc.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(vector82.X, vector82.Y, num664, num665, ProjectileID.Fireball, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector82.X, vector82.Y, num664, num665, type, damage, 0f, Main.myPlayer, 0f, 0f); } // Lasers @@ -10099,12 +10039,10 @@ namespace CalamityMod.NPCs { npc.ai[2] = 0f; - int dmg = 35; - if (death) - dmg += 3; int projType = ProjectileID.EyeBeam; + int dmg = npc.GetProjectileDamage(projType); - if (npc.localAI[1] == 0f) + if (npc.localAI[1] == 0f) { for (int num672 = 0; num672 < 2; num672++) { @@ -10410,10 +10348,7 @@ namespace CalamityMod.NPCs num710 *= num711; int projectileType = phase3 ? ProjectileID.InfernoHostileBolt : ProjectileID.Fireball; - int damage = 40; - if (death) - damage += 4; - + int damage = npc.GetProjectileDamage(projectileType); if (Main.netMode != NetmodeID.MultiplayerClient) { int proj = Projectile.NewProjectile(vector88.X, vector88.Y, num709, num710, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); @@ -10455,13 +10390,11 @@ namespace CalamityMod.NPCs vector89.X += num717 * 3f; vector89.Y += num718 * 3f; - int damage = 35; - if (death) - damage += 3; - - if (Main.netMode != NetmodeID.MultiplayerClient) + int type = ProjectileID.EyeBeam; + int damage = npc.GetProjectileDamage(type); + if (Main.netMode != NetmodeID.MultiplayerClient) { - int num720 = Projectile.NewProjectile(vector89.X, vector89.Y, num717, num718, ProjectileID.EyeBeam, damage, 0f, Main.myPlayer, 0f, 0f); + int num720 = Projectile.NewProjectile(vector89.X, vector89.Y, num717, num718, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num720].timeLeft = enrage ? 480 : 300; } } @@ -11452,18 +11385,11 @@ namespace CalamityMod.NPCs bool isCultist = npc.type == NPCID.CultistBoss; bool dontTakeDamage = false; - int iceMistDamage = 38; - int fireballDamage = isCultist ? 30 : 27; - int lightningDamage = 45; + int iceMistDamage = npc.GetProjectileDamage(ProjectileID.CultistBossIceMist); + int fireballDamage = isCultist ? npc.GetProjectileDamage(ProjectileID.CultistBossFireBall) : npc.GetProjectileDamage(ProjectileID.CultistBossFireBallClone); + int lightningDamage = npc.GetProjectileDamage(ProjectileID.CultistBossLightningOrb); - if (death) - { - iceMistDamage += 3; - fireballDamage += 3; - lightningDamage += 4; - } - - int iceMistFireRate = 60 - + int iceMistFireRate = 60 - (phase2 ? 5 : 0) - (phase3 ? 5 : 0) - (phase4 ? 5 : 0) - @@ -12632,17 +12558,15 @@ namespace CalamityMod.NPCs npc.localAI[1] = 0.25f + Vector2.UnitY.RotatedBy(npc.ai[1] * MathHelper.TwoPi / 60f).Y * 0.25f; if (npc.ai[1] >= num1496) { - int damage = 50; - if (death) - damage += 5; - - flag110 = true; + int type = ProjectileID.AncientDoomProjectile; + int damage = npc.GetProjectileDamage(type); + flag110 = true; if (Main.netMode != NetmodeID.MultiplayerClient) { for (int num1501 = 0; num1501 < 4; num1501++) { Vector2 vector255 = new Vector2(0f, -num1499).RotatedBy(MathHelper.PiOver2 * num1501); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector255.X, vector255.Y, ProjectileID.AncientDoomProjectile, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector255.X, vector255.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -13381,13 +13305,10 @@ namespace CalamityMod.NPCs } } - int damage = 95; - if (death) - damage += 10; - if (num1207 == 180f && Main.netMode != NetmodeID.MultiplayerClient) { int projectileType = ProjectileID.PhantasmalDeathray; + int damage = npc.GetProjectileDamage(projectileType); for (int i = 0; i < Main.maxProjectiles; i++) { if (Main.projectile[i].active) @@ -13522,10 +13443,6 @@ namespace CalamityMod.NPCs if (num1207 == num1208 - 35f) Main.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); - int damage = 40; - if (death) - damage += 4; - if ((shootFirstBolt || shootSecondBolt || shootThirdBolt) && Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector203 = Utils.Vector2FromElipse(npc.localAI[0].ToRotationVector2(), value19 * npc.localAI[1]); @@ -13549,7 +13466,9 @@ namespace CalamityMod.NPCs } Vector2 vector204 = Vector2.Normalize(v4) * velocity; - Projectile.NewProjectile(npc.Center.X + vector203.X, npc.Center.Y + vector203.Y, vector204.X, vector204.Y, ProjectileID.PhantasmalBolt, damage, 0f, Main.myPlayer, 0f, 0f); + int type = ProjectileID.PhantasmalBolt; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center.X + vector203.X, npc.Center.Y + vector203.Y, vector204.X, vector204.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -13743,10 +13662,6 @@ namespace CalamityMod.NPCs float num1188 = MathHelper.TwoPi * (num1178 % (num1186 * num1187)) / (num1186 * num1187) - MathHelper.PiOver2; npc.localAI[0] = new Vector2((float)Math.Cos(num1188) * vector165.X, (float)Math.Sin(num1188) * vector165.Y).ToRotation(); - int damage = 40; - if (death) - damage += 4; - if (num1178 % divisor == 0f) { Vector2 value11 = new Vector2(1f * -num1177, 3f); @@ -13773,7 +13688,9 @@ namespace CalamityMod.NPCs Vector2 vector170 = Vector2.Normalize(vector168) * velocity; float ai = (MathHelper.TwoPi * (float)Main.rand.NextDouble() - MathHelper.Pi) / 30f + 0.0174532924f * num1177; - int proj = Projectile.NewProjectile(vector169.X, vector169.Y, vector170.X, vector170.Y, ProjectileID.PhantasmalEye, damage, 0f, Main.myPlayer, 0f, ai); + int type = ProjectileID.PhantasmalEye; + int damage = npc.GetProjectileDamage(type); + int proj = Projectile.NewProjectile(vector169.X, vector169.Y, vector170.X, vector170.Y, type, damage, 0f, Main.myPlayer, 0f, ai); Main.projectile[proj].timeLeft = 1200; } } @@ -13852,10 +13769,6 @@ namespace CalamityMod.NPCs num1180 = 1; int num1190 = (int)num1178 - 30; - int damage = 65; - if (death) - damage += 6; - int divisor = 30; switch (aggressionLevel) { @@ -13881,7 +13794,9 @@ namespace CalamityMod.NPCs vector173.X += (num1191 - 3.5f) * num1177 * 3f; vector173.Y += (num1191 - 4.5f) * 1f; vector173 *= 1.2f; - int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector173.X, vector173.Y, ProjectileID.PhantasmalSphere, damage, 1f, Main.myPlayer, 0f, npc.whoAmI); + int type = ProjectileID.PhantasmalSphere; + int damage = npc.GetProjectileDamage(type); + int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector173.X, vector173.Y, type, damage, 1f, Main.myPlayer, 0f, npc.whoAmI); Main.projectile[proj].timeLeft = 1200; } @@ -14071,10 +13986,6 @@ namespace CalamityMod.NPCs if (num1178 == num1179 - 35f) Main.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); - int damage = 40; - if (death) - damage += 4; - if ((shootFirstBolt || shootSecondBolt || shootThirdBolt) && Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector181 = Utils.Vector2FromElipse(npc.localAI[0].ToRotationVector2(), vector165 * npc.localAI[1]); @@ -14098,7 +14009,9 @@ namespace CalamityMod.NPCs } Vector2 vector182 = Vector2.Normalize(v) * velocity; - Projectile.NewProjectile(npc.Center.X + vector181.X, npc.Center.Y + vector181.Y, vector182.X, vector182.Y, ProjectileID.PhantasmalBolt, damage, 0f, Main.myPlayer, 0f, 0f); + int type = ProjectileID.PhantasmalBolt; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center.X + vector181.X, npc.Center.Y + vector181.Y, vector182.X, vector182.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -14348,11 +14261,16 @@ namespace CalamityMod.NPCs { Vector2 vector214 = Utils.Vector2FromElipse(npc.localAI[0].ToRotationVector2(), value22 * npc.localAI[1]); Vector2 vector215 = Vector2.Normalize(v8) * 8f; - Projectile.NewProjectile(npc.Center.X + vector214.X, npc.Center.Y + vector214.Y, vector215.X, vector215.Y, ProjectileID.PhantasmalBolt, 35, 0f, Main.myPlayer, 0f, 0f); + int type = ProjectileID.PhantasmalBolt; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center.X + vector214.X, npc.Center.Y + vector214.Y, vector215.X, vector215.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); } } else if (npc.ai[0] == 2f) { + int type = ProjectileID.PhantasmalSphere; + int damage = npc.GetProjectileDamage(type); + if (num1245 < 15f) { npc.localAI[1] -= 0.07f; @@ -14422,7 +14340,7 @@ namespace CalamityMod.NPCs vector217 = Vector2.UnitY * -1f; vector217 *= 4f; - int proj = Projectile.NewProjectile(npc.Center.X + vector216.X, npc.Center.Y + vector216.Y, vector217.X, vector217.Y, ProjectileID.PhantasmalSphere, 0, 0f, Main.myPlayer, 30f, npc.whoAmI); + int proj = Projectile.NewProjectile(npc.Center.X + vector216.X, npc.Center.Y + vector216.Y, vector217.X, vector217.Y, type, 0, 0f, Main.myPlayer, 30f, npc.whoAmI); Main.projectile[proj].timeLeft = 1200; } } @@ -14445,7 +14363,7 @@ namespace CalamityMod.NPCs for (int num1255 = 0; num1255 < Main.maxProjectiles; num1255++) { Projectile projectile7 = Main.projectile[num1255]; - if (projectile7.active && projectile7.type == ProjectileID.PhantasmalSphere && projectile7.ai[1] == npc.whoAmI && projectile7.ai[0] != -1f) + if (projectile7.active && projectile7.type == type && projectile7.ai[1] == npc.whoAmI && projectile7.ai[0] != -1f) { Projectile projectile8 = projectile7; projectile8.velocity += npc.velocity; @@ -14477,10 +14395,10 @@ namespace CalamityMod.NPCs for (int num1256 = 0; num1256 < Main.maxProjectiles; num1256++) { Projectile projectile9 = Main.projectile[num1256]; - if (projectile9.active && projectile9.type == ProjectileID.PhantasmalSphere && projectile9.ai[1] == npc.whoAmI && projectile9.ai[0] != -1f) + if (projectile9.active && projectile9.type == type && projectile9.ai[1] == npc.whoAmI && projectile9.ai[0] != -1f) { projectile9.ai[0] = -1f; - projectile9.damage = 55; + projectile9.damage = damage; projectile9.velocity = velocity6; projectile9.netUpdate = true; } @@ -14558,7 +14476,9 @@ namespace CalamityMod.NPCs float velocity = BossRushEvent.BossRushActive ? 14f : 10f; Vector2 vector220 = Vector2.Normalize(vector218) * velocity; float ai3 = (MathHelper.TwoPi * (float)Main.rand.NextDouble() - MathHelper.Pi) / 30f + 0.0174532924f * npc.ai[2]; - int proj = Projectile.NewProjectile(vector219.X, vector219.Y, vector220.X, vector220.Y, ProjectileID.PhantasmalEye, 35, 0f, Main.myPlayer, 0f, ai3); + int type = ProjectileID.PhantasmalEye; + int damage = npc.GetProjectileDamage(type); + int proj = Projectile.NewProjectile(vector219.X, vector219.Y, vector220.X, vector220.Y, type, damage, 0f, Main.myPlayer, 0f, ai3); Main.projectile[proj].timeLeft = 1200; } } @@ -14633,7 +14553,9 @@ namespace CalamityMod.NPCs num1262 = 1f; vector222 = vector222.RotatedBy(-(double)num1262 * MathHelper.TwoPi / 6f); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector222.X, vector222.Y, ProjectileID.PhantasmalDeathray, 50, 0f, Main.myPlayer, num1262 * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); + int type = ProjectileID.PhantasmalDeathray; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector222.X, vector222.Y, type, damage, 0f, Main.myPlayer, num1262 * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); npc.ai[2] = (vector222.ToRotation() + MathHelper.Pi + MathHelper.TwoPi) * num1262; npc.netUpdate = true; } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 62db71fd6a..e079b053af 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -997,8 +997,10 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.SkeletronHead) { - npc.lifeMax = (int)(npc.lifeMax * 1.25); - npc.npcSlots = 12f; + if (!CalamityWorld.death) + npc.lifeMax = (int)(npc.lifeMax * 1.25); + + npc.npcSlots = 12f; } else if (npc.type == NPCID.SkeletronHand) { @@ -1009,6 +1011,11 @@ namespace CalamityMod.NPCs npc.lifeMax = (int)(npc.lifeMax * 1.15); npc.npcSlots = 14f; } + else if ((npc.type == NPCID.Bee || npc.type == NPCID.BeeSmall) && CalamityPlayer.areThereAnyDamnBosses) + { + npc.lifeMax = (int)(npc.lifeMax * 1.4); + npc.scale = 1.25f; + } else if (npc.type == NPCID.BrainofCthulhu) { npc.lifeMax = (int)(npc.lifeMax * 1.6); diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index bda26277d8..abe42cd826 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -170,8 +170,7 @@ namespace CalamityMod.NPCs.Crabulon npc.ai[3] = 0f; } float num353 = 10f; - int num354 = expertMode ? 12 : 16; - int num355 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); Main.PlaySound(SoundID.Item42, (int)npc.position.X, (int)npc.position.Y); if (BossRushEvent.BossRushActive) { @@ -194,7 +193,7 @@ namespace CalamityMod.NPCs.Crabulon num350 *= num351; vector34.X += num349; vector34.Y += num350; - Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350 - 5f, num355, num354, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350 - 5f, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); } } } @@ -435,7 +434,9 @@ namespace CalamityMod.NPCs.Crabulon if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile((int)npc.Center.X, (int)npc.Center.Y + 20, 0f, 0f, ModContent.ProjectileType(), 20, 0f, Main.myPlayer, 0f, 0f); - int num354 = expertMode ? 12 : 16; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + if (npc.ai[2] % 2f == 0f && phase2 && revenge) { if (Main.netMode != NetmodeID.MultiplayerClient) @@ -443,7 +444,7 @@ namespace CalamityMod.NPCs.Crabulon float velocityX = npc.ai[2] == 0f ? -4f : 4f; for (int x = 0; x < 20; x++) { - Projectile.NewProjectile(npc.Center.X + shotSpacing, npc.Center.Y - 1000f, velocityX, 0f, ModContent.ProjectileType(), num354, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center.X + shotSpacing, npc.Center.Y - 1000f, velocityX, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing -= 100; } shotSpacing = 1000; @@ -458,7 +459,7 @@ namespace CalamityMod.NPCs.Crabulon { for (int x = 0; x < 20; x++) { - Projectile.NewProjectile(npc.Center.X + shotSpacing, npc.Center.Y - 1000f, 0f, 0f, ModContent.ProjectileType(), num354, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center.X + shotSpacing, npc.Center.Y - 1000f, 0f, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing -= 100; } shotSpacing = 1000; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 22c3af6363..a22a26313a 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -218,13 +218,14 @@ namespace CalamityMod.NPCs.Cryogen { int totalProjectiles = 4; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = 25; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); float velocity = BossRushEvent.BossRushActive ? 12f : 4f; Vector2 spinningPoint = Main.rand.NextBool(2) ? new Vector2(0f, -velocity) : Vector2.Normalize(new Vector2(-velocity, -velocity)) * velocity; for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); } time = 0; } @@ -243,12 +244,13 @@ namespace CalamityMod.NPCs.Cryogen { int totalProjectiles = 16; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = expertMode ? 20 : 23; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); float velocity = BossRushEvent.BossRushActive ? 12f : 8f; for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k); - Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -293,12 +295,13 @@ namespace CalamityMod.NPCs.Cryogen { int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = expertMode ? 20 : 23; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); float velocity2 = BossRushEvent.BossRushActive ? 12f : 8f; for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = new Vector2(0f, -velocity2).RotatedBy(radians * k); - Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -380,12 +383,13 @@ namespace CalamityMod.NPCs.Cryogen { int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = expertMode ? 20 : 23; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); float velocity = BossRushEvent.BossRushActive ? 14f : 9f; for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k); - Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); } } else @@ -402,9 +406,9 @@ namespace CalamityMod.NPCs.Cryogen num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = expertMode ? 23 : 26; - int num185 = ModContent.ProjectileType(); - value9.X += num180; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + value9.X += num180; value9.Y += num182; for (int num186 = 0; num186 < 6; num186++) { @@ -415,7 +419,7 @@ namespace CalamityMod.NPCs.Cryogen num180 += Main.rand.Next(-360, 361); num182 += Main.rand.Next(-360, 361); num180 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, -8f, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, -8f, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -472,9 +476,9 @@ namespace CalamityMod.NPCs.Cryogen num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = expertMode ? 23 : 26; - int num185 = ModContent.ProjectileType(); - value9.X += num180; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + value9.X += num180; value9.Y += num182; for (int num186 = 0; num186 < 12; num186++) { @@ -485,7 +489,7 @@ namespace CalamityMod.NPCs.Cryogen num180 += Main.rand.Next(-360, 361); num182 += Main.rand.Next(-360, 361); num180 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, -2.5f, num185, num184, 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, -2.5f, type, damage, 0f, Main.myPlayer, 1f, 0f); } } } @@ -564,12 +568,13 @@ namespace CalamityMod.NPCs.Cryogen { int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = expertMode ? 20 : 23; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); float velocity = BossRushEvent.BossRushActive ? 14f : 9f; for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k); - Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -839,13 +844,14 @@ namespace CalamityMod.NPCs.Cryogen { int totalProjectiles = 4; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = 25; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); float velocity2 = BossRushEvent.BossRushActive ? 16f : 6f; Vector2 spinningPoint = Main.rand.NextBool(2) ? new Vector2(0f, -velocity2) : Vector2.Normalize(new Vector2(-velocity2, -velocity2)) * velocity2; for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); } time = 0; } diff --git a/NPCs/Cryogen/CryogenIce.cs b/NPCs/Cryogen/CryogenIce.cs index d6fd452be2..556c614a62 100644 --- a/NPCs/Cryogen/CryogenIce.cs +++ b/NPCs/Cryogen/CryogenIce.cs @@ -108,13 +108,14 @@ namespace CalamityMod.NPCs.Cryogen { int totalProjectiles = 4; float radians = MathHelper.TwoPi / totalProjectiles; - int damage2 = Main.expertMode ? 20 : 23; + int type = ModContent.ProjectileType(); + int damage2 = npc.GetProjectileDamage(type); float velocity = BossRushEvent.BossRushActive ? 12f : 8f; Vector2 spinningPoint = Main.rand.NextBool(2) ? new Vector2(0f, -velocity) : Vector2.Normalize(new Vector2(-velocity, -velocity)) * velocity; for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage2, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(npc.Center, vector255, type, damage2, 0f, Main.myPlayer, 0f, 0f); Main.projectile[proj].timeLeft = 300; } } diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index 0e914d4bf0..fd763ed76a 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -116,7 +116,6 @@ namespace CalamityMod.NPCs.DesertScourge float num943 = player.position.Y + (float)player.height * 0.5f - vector104.Y; float num944 = (float)Math.Sqrt((double)(num942 * num942 + num943 * num943)); int projectileType = ModContent.ProjectileType(); - int damage = 12; float num941 = BossRushEvent.BossRushActive ? 12f : 6f; num944 = num941 / num944; num942 *= num944; @@ -125,7 +124,7 @@ namespace CalamityMod.NPCs.DesertScourge vector104.Y += num943 * 5f; if (Main.rand.NextBool(2) || BossRushEvent.BossRushActive) { - Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, projectileType, npc.GetProjectileDamage(projectileType), 0f, Main.myPlayer, 0f, 0f); } npc.netUpdate = true; } diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 0cb5c39452..ac1f5278ec 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -140,9 +140,9 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += expertMode ? 1.5f : 1f; - int projectileType = ModContent.ProjectileType(); - int damage = expertMode ? 58 : 70; - float num941 = 5f; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + float num941 = 5f; if (npc.localAI[0] >= Main.rand.Next(1050, 12000)) { npc.localAI[0] = 0f; @@ -156,9 +156,7 @@ namespace CalamityMod.NPCs.DevourerofGods num943 *= num944; vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - int proj = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[proj].ai[0] = Main.player[npc.target].Center.X; - Main.projectile[proj].ai[1] = Main.player[npc.target].Center.Y; + int proj = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y); Main.projectile[proj].netUpdate = true; npc.netUpdate = true; } diff --git a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs index 1d62ea821c..023c936798 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs @@ -290,8 +290,6 @@ namespace CalamityMod.NPCs.DevourerofGods tail = true; } - int projectileDamage = expertMode ? 69 : 80; - // Fireballs if (npc.alpha <= 0 && distanceFromTarget > 500f) { @@ -304,8 +302,6 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.MultiplayerClient) { float num430 = 16f; - int num432 = ModContent.ProjectileType(); - float num429 = (float)Math.Sqrt(num427 * num427 + num428 * num428); num429 = num430 / num429; num427 *= num429; @@ -315,7 +311,9 @@ namespace CalamityMod.NPCs.DevourerofGods vector44.X -= num427 * 1f; vector44.Y -= num428 * 1f; - Projectile.NewProjectile(vector44.X, vector44.Y, num427, num428, num432, projectileDamage, 0f, Main.myPlayer, 0f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(vector44.X, vector44.Y, num427, num428, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -335,14 +333,16 @@ namespace CalamityMod.NPCs.DevourerofGods // Side walls float targetPosY = player.position.Y; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); switch (laserWallType) { case 0: for (int x = 0; x < totalShots; x++) { - Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing[0], -speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing[0], speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing[0], -speed, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing[0], speed, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing[0] -= spacingVar; } laserWallType = 1; @@ -353,8 +353,8 @@ namespace CalamityMod.NPCs.DevourerofGods targetPosY += 50f; for (int x = 0; x < totalShots; x++) { - Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing[0], -speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing[0], speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing[0], -speed, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing[0], speed, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing[0] -= spacingVar; } laserWallType = revenge ? 2 : 0; @@ -364,14 +364,14 @@ namespace CalamityMod.NPCs.DevourerofGods for (int x = 0; x < totalShots; x++) { - Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing[0], -speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing[0], speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing[0], -speed, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing[0], speed, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing[0] -= spacingVar; } for (int x = 0; x < 10; x++) { - Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing[3], -speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing[3], speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + spawnOffset, targetPosY + shotSpacing[3], -speed, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - spawnOffset, targetPosY + shotSpacing[3], speed, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing[3] -= Main.rand.NextBool(2) ? 180 : 200; } shotSpacing[3] = 1050; @@ -383,7 +383,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Lower wall for (int x = 0; x < totalShots; x++) { - Projectile.NewProjectile(player.position.X + shotSpacing[1], player.position.Y + spawnOffset, 0f, -speed, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + shotSpacing[1], player.position.Y + spawnOffset, 0f, -speed, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing[1] -= spacingVar; } shotSpacing[1] = 1050; @@ -391,7 +391,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Upper wall for (int x = 0; x < totalShots; x++) { - Projectile.NewProjectile(player.position.X + shotSpacing[2], player.position.Y - spawnOffset, 0f, speed, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + shotSpacing[2], player.position.Y - spawnOffset, 0f, speed, type, damage, 0f, Main.myPlayer, 0f, 0f); shotSpacing[2] -= spacingVar; } shotSpacing[2] = 1050; diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index 288864844b..f3242c13be 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -117,7 +117,9 @@ namespace CalamityMod.NPCs.HiveMind { if (Main.expertMode && Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, ModContent.ProjectileType(), 14, 0f, Main.myPlayer, 0f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index a4ae94f8fd..70794a2aea 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -61,7 +61,7 @@ namespace CalamityMod.NPCs.HiveMind Vector2 vector133 = new Vector2(npc.Center.X, npc.Center.Y); float num1166 = Main.player[npc.target].Center.X - vector133.X; float num1167 = Main.player[npc.target].Center.Y - vector133.Y - 400f; - float num1168 = (float)Math.Sqrt((double)(num1166 * num1166 + num1167 * num1167)); + float num1168 = (float)Math.Sqrt(num1166 * num1166 + num1167 * num1167); if (num1168 < 20f) { num1166 = npc.velocity.X; @@ -105,16 +105,17 @@ namespace CalamityMod.NPCs.HiveMind npc.velocity.Y = npc.velocity.Y - num1165 * 2f; } } - if (npc.position.X + (float)npc.width > Main.player[npc.target].position.X && npc.position.X < Main.player[npc.target].position.X + (float)Main.player[npc.target].width && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && Main.netMode != NetmodeID.MultiplayerClient) + if (npc.position.X + npc.width > Main.player[npc.target].position.X && npc.position.X < Main.player[npc.target].position.X + Main.player[npc.target].width && npc.position.Y + npc.height < Main.player[npc.target].position.Y && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[0] += 1f; if (npc.ai[0] >= 30f) { npc.ai[0] = 0f; - int num1169 = (int)(npc.position.X + 10f + (float)Main.rand.Next(npc.width - 20)); - int num1170 = (int)(npc.position.Y + (float)npc.height + 4f); - int num184 = Main.expertMode ? 14 : 18; - Projectile.NewProjectile((float)num1169, (float)num1170, 0f, 4f, ModContent.ProjectileType(), num184, 0f, Main.myPlayer, 0f, 0f); + int num1169 = (int)(npc.position.X + 10f + Main.rand.Next(npc.width - 20)); + int num1170 = (int)(npc.position.Y + npc.height + 4f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(num1169, num1170, 0f, 4f, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/HiveMind/HiveBlob.cs b/NPCs/HiveMind/HiveBlob.cs index 1b7a2f0a55..140b2a20bf 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -141,9 +141,9 @@ namespace CalamityMod.NPCs.HiveMind num944 = num941 / num944; num942 *= num944; num943 *= num944; - int num945 = expertMode ? 12 : 15; - int num946 = ModContent.ProjectileType(); - int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, 0f, 0f); npc.netUpdate = true; } } diff --git a/NPCs/HiveMind/HiveBlob2.cs b/NPCs/HiveMind/HiveBlob2.cs index 2fa7d45f60..57b883babb 100644 --- a/NPCs/HiveMind/HiveBlob2.cs +++ b/NPCs/HiveMind/HiveBlob2.cs @@ -141,9 +141,9 @@ namespace CalamityMod.NPCs.HiveMind num944 = num941 / num944; num942 *= num944; num943 *= num944; - int num945 = expertMode ? 12 : 15; - int num946 = ModContent.ProjectileType(); - int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, 0f, 0f); npc.netUpdate = true; } } diff --git a/NPCs/HiveMind/HiveMindP2.cs b/NPCs/HiveMind/HiveMindP2.cs index b069081cc1..bd0dbaf45a 100644 --- a/NPCs/HiveMind/HiveMindP2.cs +++ b/NPCs/HiveMind/HiveMindP2.cs @@ -631,8 +631,9 @@ namespace CalamityMod.NPCs.HiveMind npc.ai[0]++; if (Main.netMode != NetmodeID.MultiplayerClient) { - int damage = Main.expertMode ? 14 : 18; - Projectile.NewProjectile(npc.position.X + Main.rand.Next(npc.width), npc.position.Y + Main.rand.Next(npc.height), 0, 0, ModContent.ProjectileType(), damage, 0, Main.myPlayer, 11, 0); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.position.X + Main.rand.Next(npc.width), npc.position.Y + Main.rand.Next(npc.height), 0, 0, type, damage, 0, Main.myPlayer, 11, 0); } if (npc.ai[0] == 10) { diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 9c304f747d..e3ef357480 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -325,23 +325,17 @@ namespace CalamityMod.NPCs.Leviathan if (Main.netMode != NetmodeID.MultiplayerClient) { float speed = (sirenAlive && !phase4 && !death) ? 13.5f : 16f; - int dmg = 40; - int projType = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); - if (expertMode) - { + if (expertMode) speed = (sirenAlive && !phase4 && !death) ? 14f : 17f; - dmg = 33; - } if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) speed = 22f; if (!sirenAlive || phase4) - { speed += 3f * (1f - lifeRatio); - dmg += expertMode ? 3 : 4; - } if (BossRushEvent.BossRushActive) speed *= 1.5f; @@ -352,7 +346,7 @@ namespace CalamityMod.NPCs.Leviathan num416 *= num417; vector40.X += num415 * 4f; vector40.Y += num416 * 4f; - Projectile.NewProjectile(vector40.X, vector40.Y, num415, num416, projType, dmg, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector40.X, vector40.Y, num415, num416, type, damage, 0f, Main.myPlayer, 0f, 0f); if (soundDelay <= 0) { soundDelay = 120; diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index 7319194777..90af4eb6e0 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -523,18 +523,13 @@ namespace CalamityMod.NPCs.Leviathan bool shootProjectiles = npc.ai[1] % divisor == 0f; if (Main.netMode != NetmodeID.MultiplayerClient && shootProjectiles) { - int projectileDamage = expertMode ? 26 : 32; float projectileVelocity = expertMode ? 3f : 2f; - if (!leviAlive || phase4) - { - projectileDamage += expertMode ? 3 : 4; projectileVelocity += 2f * (1f - lifeRatio); - } int totalProjectiles = 8; int projectileDistance = 600; - int projectileType = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); switch ((int)npc.localAI[3]) { case 0: @@ -542,12 +537,12 @@ namespace CalamityMod.NPCs.Leviathan break; case 1: totalProjectiles = 3; - projectileType = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); Main.PlaySound(SoundID.Item30, player.position); break; case 2: totalProjectiles = 6; - projectileType = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f; Main.harpNote = soundPitch; Main.PlaySound(SoundID.Item26, player.position); @@ -561,11 +556,12 @@ namespace CalamityMod.NPCs.Leviathan totalProjectiles += totalProjectiles / 2; float radians = MathHelper.TwoPi / totalProjectiles; + int damage = npc.GetProjectileDamage(type); for (int i = 0; i < totalProjectiles; i++) { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -projectileVelocity).RotatedBy(radians * i)) * projectileDistance; Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * projectileVelocity; - Projectile.NewProjectile(spawnVector, velocity, projectileType, projectileDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(spawnVector, velocity, type, damage, 0f, Main.myPlayer); } } diff --git a/NPCs/NormalNPCs/KingSlimeJewel.cs b/NPCs/NormalNPCs/KingSlimeJewel.cs index 8fc6afa27c..97b9e525bc 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel.cs @@ -114,9 +114,6 @@ namespace CalamityMod.NPCs.NormalNPCs float projLength = projVector.Length(); float speed = BossRushEvent.BossRushActive ? 18f : 9f; - int damage = 11; - if (CalamityWorld.death) - damage += 1; int type = ModContent.ProjectileType(); projLength = speed / projLength; @@ -138,9 +135,9 @@ namespace CalamityMod.NPCs.NormalNPCs Main.dust[ruby].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - Main.PlaySound(SoundID.Item8, npc.position); - int proj = Projectile.NewProjectile(npcPos, projVector, type, damage, 0f, Main.myPlayer, 0f, 0f); + Main.PlaySound(SoundID.Item8, npc.position); + Projectile.NewProjectile(npcPos, projVector, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index ab5dafb63d..50eba1853c 100644 --- a/NPCs/NormalNPCs/PhantomSpiritL.cs +++ b/NPCs/NormalNPCs/PhantomSpiritL.cs @@ -86,12 +86,12 @@ namespace CalamityMod.NPCs.NormalNPCs if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == 20f) { float num151 = 10f; - int num152 = Main.expertMode ? 53 : 65; - int num153 = ModContent.ProjectileType(); - num149 = num151 / num149; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + num149 = num151 / num149; num147 *= num149; num148 *= num149; - int num154 = Projectile.NewProjectile(vector17.X, vector17.Y, num147, num148, num153, num152, 0f, Main.myPlayer, 0f, 0f); + int num154 = Projectile.NewProjectile(vector17.X, vector17.Y, num147, num148, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index ff2c886ce7..b7634b051a 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -76,13 +76,13 @@ namespace CalamityMod.NPCs.Perforator num944 = num941 / num944; num942 *= num944; num943 *= num944; - int num945 = expertMode ? 12 : 15; - int num946 = ModContent.ProjectileType(); - vector104.X += num942 * 5f; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + vector104.X += num942 * 5f; vector104.Y += num943 * 5f; if (Main.rand.NextBool(2)) { - int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); + int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num947].timeLeft = 160; } npc.netUpdate = true; diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index b61de37241..572de3a22b 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -76,13 +76,13 @@ namespace CalamityMod.NPCs.Perforator num944 = num941 / num944; num942 *= num944; num943 *= num944; - int num945 = expertMode ? 12 : 15; - int num946 = ModContent.ProjectileType(); - vector104.X += num942 * 5f; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + vector104.X += num942 * 5f; vector104.Y += num943 * 5f; if (Main.rand.NextBool(2)) { - int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); + int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num947].timeLeft = 160; } npc.netUpdate = true; diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index 8549f484ec..25807c4b62 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -76,13 +76,13 @@ namespace CalamityMod.NPCs.Perforator num944 = num941 / num944; num942 *= num944; num943 *= num944; - int num945 = expertMode ? 12 : 15; - int num946 = ModContent.ProjectileType(); - vector104.X += num942 * 5f; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + vector104.X += num942 * 5f; vector104.Y += num943 * 5f; if (Main.rand.NextBool(2)) { - int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); + int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num947].timeLeft = 160; } npc.netUpdate = true; diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 6e7a4964c2..71c4760a2d 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -168,8 +168,8 @@ namespace CalamityMod.NPCs.Perforator num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = expertMode ? 14 : 18; - int num185 = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; @@ -181,7 +181,7 @@ namespace CalamityMod.NPCs.Perforator num183 = num179 / num183; num180 += (float)Main.rand.Next(-180, 181); num180 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, -5f, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, -5f, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 4d63851126..27f55c828e 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -706,29 +706,19 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath num1071 *= num1073; num1072 *= num1073; - int num1074 = 40; - int num1075 = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); if (expertMode) { - num1074 = 32; - int damageBoost = death ? 5 : (int)(6f * (1f - lifeRatio)); - num1074 += damageBoost; - if (Main.rand.NextBool(6)) - { - num1074 += 8; - num1075 = ModContent.ProjectileType(); - } + type = ModContent.ProjectileType(); } else { if (Main.rand.NextBool(9)) - { - num1074 = 50; - num1075 = ModContent.ProjectileType(); - } + type = ModContent.ProjectileType(); } - Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, num1075, num1074, 0f, Main.myPlayer, 0f, player.position.Y); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, type, damage, 0f, Main.myPlayer, 0f, player.position.Y); } } @@ -790,9 +780,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (BossRushEvent.BossRushActive) speed = 12; - int damage = expertMode ? 48 : 60; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); - Vector2 baseVelocity = player.Center - vectorCenter; + Vector2 baseVelocity = player.Center - vectorCenter; baseVelocity.Normalize(); baseVelocity *= speed; @@ -801,7 +792,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Vector2 spawn = vectorCenter; spawn.X += i * 27 - (MissileProjectiles * 12); // -96 to 93 Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-MissileAngleSpread / 2 + (MissileAngleSpread * i / MissileProjectiles))); - Projectile.NewProjectile(spawn.X, spawn.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, player.position.Y); + Projectile.NewProjectile(spawn.X, spawn.Y, velocity.X, velocity.Y, type, damage, 0f, Main.myPlayer, 0f, player.position.Y); } } } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index a13ba5798a..0fc6f89863 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -490,14 +490,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath num1073 = num1070 / num1073; num1071 *= num1073; num1072 *= num1073; - int num1074 = 26; - int num1075 = ModContent.ProjectileType(); - if (Main.rand.NextBool(15)) - { - num1074 = 33; - num1075 = ModContent.ProjectileType(); - } - Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, num1075, num1074, 0f, Main.myPlayer, 0f, 0f); + int type = Main.rand.NextBool(15) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, type, damage, 0f, Main.myPlayer, 0f, 0f); } } if (!Collision.CanHit(new Vector2(vector121.X, vector121.Y - 30f), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index 3f737744c7..78a948c46c 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -92,9 +92,10 @@ namespace CalamityMod.NPCs.Polterghast { if (Main.netMode != NetmodeID.MultiplayerClient) { - int damage = expertMode ? 62 : 75; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); float maxVelocity = 8f * tileEnrageMult; - Projectile.NewProjectile(npc.Center, direction, ModContent.ProjectileType(), damage, 1f, npc.target, maxVelocity, 0f); + Projectile.NewProjectile(npc.Center, direction, type, damage, 1f, npc.target, maxVelocity, 0f); } npc.ai[2] = 0f; } diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index efee0a3cba..c229cf381a 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -310,12 +310,14 @@ namespace CalamityMod.NPCs.Polterghast float chargeDistanceGateValue = 32f; if (Vector2.Distance(vector, chargeVector) <= chargeDistanceGateValue) - { npc.velocity *= 0.8f; - return; + else + { + if (Vector2.Distance(vector, chargeVector) > 1200f) + npc.velocity = chargeLocationVelocity; + else + npc.SimpleFlyMovement(chargeLocationVelocity, chargeAcceleration); } - - npc.SimpleFlyMovement(chargeLocationVelocity, chargeAcceleration); } npc.netUpdate = true; @@ -392,7 +394,12 @@ namespace CalamityMod.NPCs.Polterghast } } - public override void OnHitPlayer(Player player, int damage, bool crit) + public override bool CheckActive() + { + return false; + } + + public override void OnHitPlayer(Player player, int damage, bool crit) { if (CalamityWorld.revenge) player.AddBuff(ModContent.BuffType(), 180, true); diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 628bcc3838..2544a01e39 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -511,6 +511,18 @@ namespace CalamityMod.NPCs.Polterghast Main.npc[CalamityGlobalNPC.ghostBossClone].Calamity().newAI[1] = 0f; Main.npc[CalamityGlobalNPC.ghostBossClone].Calamity().newAI[2] = 0f; Main.npc[CalamityGlobalNPC.ghostBossClone].Calamity().newAI[3] = 1f; + + if (Main.netMode == NetmodeID.Server) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.SyncCalamityNPCAIArray); + netMessage.Write((byte)CalamityGlobalNPC.ghostBossClone); + netMessage.Write(Main.npc[CalamityGlobalNPC.ghostBossClone].Calamity().newAI[0]); + netMessage.Write(Main.npc[CalamityGlobalNPC.ghostBossClone].Calamity().newAI[1]); + netMessage.Write(Main.npc[CalamityGlobalNPC.ghostBossClone].Calamity().newAI[2]); + netMessage.Write(Main.npc[CalamityGlobalNPC.ghostBossClone].Calamity().newAI[3]); + netMessage.Send(); + } } } } @@ -557,18 +569,14 @@ namespace CalamityMod.NPCs.Polterghast if (flag47) { - int damage = expertMode ? 48 : 60; int type = ModContent.ProjectileType(); - if (Main.rand.NextBool(3)) { - damage = expertMode ? 60 : 70; npc.localAI[1] = -30f; type = ModContent.ProjectileType(); } - damage += damageIncrease; - + int damage = npc.GetProjectileDamage(type) + damageIncrease; if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) damage *= 2; @@ -597,11 +605,8 @@ namespace CalamityMod.NPCs.Polterghast } else { - int damage = expertMode ? 60 : 70; int type = ModContent.ProjectileType(); - - damage += damageIncrease; - + int damage = npc.GetProjectileDamage(type) + damageIncrease; if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) damage *= 2; @@ -703,18 +708,14 @@ namespace CalamityMod.NPCs.Polterghast if (flag47) { - int damage = expertMode ? 53 : 65; int type = ModContent.ProjectileType(); - if (Main.rand.NextBool(3)) { - damage = expertMode ? 65 : 75; npc.localAI[1] = -30f; type = ModContent.ProjectileType(); } - damage += damageIncrease; - + int damage = npc.GetProjectileDamage(type) + damageIncrease; if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) damage *= 2; @@ -744,11 +745,8 @@ namespace CalamityMod.NPCs.Polterghast } else { - int damage = expertMode ? 65 : 75; int type = ModContent.ProjectileType(); - - damage += damageIncrease; - + int damage = npc.GetProjectileDamage(type) + damageIncrease; if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) damage *= 2; @@ -866,9 +864,6 @@ namespace CalamityMod.NPCs.Polterghast vector93.X += num743 * 3f; vector93.Y += num744 * 3f; - int damage = expertMode ? 53 : 65; - damage += damageIncrease; - int numProj = baseProjectileAmt + 2; float rotation = MathHelper.ToRadians(baseProjectileSpread + 45); float baseSpeed = (float)Math.Sqrt(num743 * num743 + num744 * num744); @@ -876,12 +871,14 @@ namespace CalamityMod.NPCs.Polterghast double deltaAngle = rotation / numProj; double offsetAngle; - int type = ModContent.ProjectileType(); + int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type) + damageIncrease; + if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) + damage *= 2; + for (int i = 0; i < numProj; i++) { offsetAngle = startAngle + deltaAngle * i; - if (i % 2 == 0) - type = ModContent.ProjectileType(); Projectile.NewProjectile(vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); } } diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index e84957492d..988f023917 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -148,12 +148,12 @@ namespace CalamityMod.NPCs.Polterghast if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == 20f) { float num151 = (BossRushEvent.BossRushActive ? 14f : 10f) * tileEnrageMult; - int num152 = expertMode ? 48 : 60; - int num153 = ModContent.ProjectileType(); - num149 = num151 / num149; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + num149 = num151 / num149; num147 *= num149; num148 *= num149; - int proj = Projectile.NewProjectile(vector17.X, vector17.Y, num147, num148, num153, num152, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(vector17.X, vector17.Y, num147, num148, type, damage, 0f, Main.myPlayer, 0f, 0f); } } return; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs index eaeee9c477..12298718f0 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs @@ -218,10 +218,10 @@ namespace CalamityMod.NPCs.ProfanedGuardians int totalProjectiles = 10; float velocity = 5f; - int damage = expertMode ? 50 : 60; - int projectileType = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); - switch (spearType) + switch (spearType) { case 0: break; @@ -241,7 +241,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians for (int i = 0; i < totalProjectiles; i++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); - Projectile.NewProjectile(npc.Center, vector255, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); } spearType++; @@ -313,9 +313,10 @@ namespace CalamityMod.NPCs.ProfanedGuardians if ((lifeRatio < 0.5f || death) && dustTimer <= 0) { Main.PlaySound(SoundID.Item20, npc.position); - int damage = expertMode ? 55 : 70; - Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (npc.width + 20) / 2f + vectorCenter; - int projectile = Projectile.NewProjectile((int)vector173.X, (int)vector173.Y, npc.direction * 2, 4f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 2f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (npc.width + 20) / 2f + vectorCenter; + int projectile = Projectile.NewProjectile((int)vector173.X, (int)vector173.Y, npc.direction * 2, 4f, type, damage, 0f, Main.myPlayer, 2f, 0f); Main.projectile[projectile].timeLeft = 120; Main.projectile[projectile].velocity.X = 0f; Main.projectile[projectile].velocity.Y = 0f; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs index 5b0ed08664..daa2020727 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs @@ -210,11 +210,12 @@ namespace CalamityMod.NPCs.ProfanedGuardians float velocity = 5f; int totalProjectiles = 6; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = expertMode ? 50 : 60; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); for (int i = 0; i < totalProjectiles; i++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); - Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index 6a11c11cf5..e49640f7b7 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -172,9 +172,10 @@ namespace CalamityMod.NPCs.Providence if (fireDust && dustTimer <= 0) { Main.PlaySound(SoundID.Item20, npc.position); - int damage = expertMode ? 40 : 59; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; - int projectile = Projectile.NewProjectile((int)vector173.X, (int)vector173.Y, (float)(npc.direction * 2), 4f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 2f, 0f); + int projectile = Projectile.NewProjectile((int)vector173.X, (int)vector173.Y, (float)(npc.direction * 2), 4f, type, damage, 0f, Main.myPlayer, 2f, 0f); Main.projectile[projectile].timeLeft = 120; Main.projectile[projectile].velocity.X = 0f; Main.projectile[projectile].velocity.Y = 0f; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 6a19eefa06..bfa1bad8e0 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -35,10 +35,29 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.Providence { - [AutoloadBossHead] - public class Providence : ModNPC - { - private bool text = false; + [AutoloadBossHead] + public class Providence : ModNPC + { + private enum Phase + { + PhaseChange = -1, + HolyBlast = 0, + HolyFire = 1, + FlameCocoon = 2, + MoltenBlobs = 3, + HolyBomb = 4, + SpearCocoon = 5, + Crystal = 6, + Laser = 7 + } + + private float AIState + { + get => npc.ai[0]; + set => npc.ai[0] = value; + } + + private bool text = false; private bool useDefenseFrames = false; private float bossLife; private int biomeType = 0; @@ -180,7 +199,7 @@ namespace CalamityMod.NPCs.Providence // Play enrage animation if night starts if (nightTime && calamityGlobalNPC.newAI[3] == spawnAnimationTime) { - npc.ai[0] = 0f; + AIState = (int)Phase.HolyBlast; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; @@ -195,22 +214,19 @@ namespace CalamityMod.NPCs.Providence bool expertMode = Main.expertMode || BossRushEvent.BossRushActive || nightTime; bool enraged = npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive); - // Projectile damage values - bool scaleExpertProjectileDamage = Main.expertMode && !nightTime; - int holyLaserDamage = 100; - int crystalDamage = scaleExpertProjectileDamage ? 57 : 70; - int holySpearDamage = scaleExpertProjectileDamage ? 52 : 65; - int holyBombDamage = scaleExpertProjectileDamage ? 48 : 60; - int moltenBlastDamage = scaleExpertProjectileDamage ? 42 : 55; - int holyFireDamage = scaleExpertProjectileDamage ? 48 : 60; - int holyBlastDamage = scaleExpertProjectileDamage ? 52 : 65; - // Increase all projectile damage at night - int projectileDamageNight = 100; + int projectileDamageMult = 1; if (nightTime) - { - holyLaserDamage = crystalDamage = holySpearDamage = holyBombDamage = moltenBlastDamage = holyFireDamage = holyBlastDamage = projectileDamageNight; - } + projectileDamageMult = 2; + + // Projectile damage values + int holyLaserDamage = npc.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; + int crystalDamage = npc.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; + int holySpearDamage = npc.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; + int holyBombDamage = npc.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; + int moltenBlastDamage = npc.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; + int holyFireDamage = npc.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; + int holyBlastDamage = npc.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; // Change dust type at night int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; @@ -242,11 +258,20 @@ namespace CalamityMod.NPCs.Providence // Projectile fire rate multiplier double attackRateMult = 1D; - // Distance X needed from target in order to fire holy or molten blasts - float distanceNeededToShoot = revenge ? 360f : 420f; + // Where projectiles are fired from during cocoon phases + Vector2 fireFrom = new Vector2(vector.X, vector.Y + 20f); - // Inflict Holy Inferno if target is too far away - if (Vector2.Distance(player.Center, vector) > 2800f) + // Cocoon projectile initial velocity + float cocoonProjVelocity = 3f; + + // Distance X needed from target in order to fire holy or molten blasts + float distanceNeededToShoot = revenge ? 360f : 420f; + + // X distance from target + float distanceX = Math.Abs(vector.X - player.Center.X); + + // Inflict Holy Inferno if target is too far away + if (Vector2.Distance(player.Center, vector) > 2800f) { if (!player.dead && player.active) player.AddBuff(ModContent.BuffType(), 2); @@ -298,7 +323,7 @@ namespace CalamityMod.NPCs.Providence } // Whether the boss can be homed in on or healed off of - npc.chaseable = normalAttackRate && npc.ai[0] != 2f && npc.ai[0] != 5f && npc.ai[0] != 7f; + npc.chaseable = normalAttackRate && AIState != (int)Phase.FlameCocoon && AIState != (int)Phase.SpearCocoon && AIState != (int)Phase.Laser; npc.canGhostHeal = npc.chaseable; // Prevent lag by stopping rain @@ -414,15 +439,15 @@ namespace CalamityMod.NPCs.Providence } // Set DR based on current attack phase - npc.Calamity().DR = (npc.ai[0] == 2f || npc.ai[0] == 5f || npc.ai[0] == 7f || spawnAnimation) ? + npc.Calamity().DR = (AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon || AIState == (int)Phase.Laser || spawnAnimation) ? cocoonDR : delayAttacks ? MathHelper.Lerp(normalDR, cocoonDR, npc.localAI[2] / attackDelayAfterCocoon) : normalDR; // Movement - if (npc.ai[0] != 2f && npc.ai[0] != 5f) + if (AIState != (int)Phase.FlameCocoon && AIState != (int)Phase.SpearCocoon) { // Firing holy ray or not - bool firingLaser = npc.ai[0] == 7f; + bool firingLaser = AIState == (int)Phase.Laser; // Change X direction of movement if (flightPath == 0) @@ -451,15 +476,14 @@ namespace CalamityMod.NPCs.Providence float num851 = 800f; // Increase distance from target when firing molten blasts or holy bombs - bool stayAwayFromTarget = npc.ai[0] == 3f || npc.ai[0] == 4f; + bool stayAwayFromTarget = AIState == (int)Phase.MoltenBlobs || AIState == (int)Phase.HolyBomb; if (stayAwayFromTarget) num851 += revenge ? 200f : 100f; // Change X movement path if far enough away from target - float num852 = Math.Abs(vector.X - player.Center.X); - if (vector.X < player.Center.X && flightPath < 0 && num852 > num851) + if (vector.X < player.Center.X && flightPath < 0 && distanceX > num851) flightPath = 0; - if (vector.X > player.Center.X && flightPath > 0 && num852 > num851) + if (vector.X > player.Center.X && flightPath > 0 && distanceX > num851) flightPath = 0; // Velocity and acceleration @@ -517,720 +541,711 @@ namespace CalamityMod.NPCs.Providence } // Phase switch - if (npc.ai[0] == -1f) + switch ((int)AIState) { - phaseChange++; - if (phaseChange > 14) - phaseChange = 0; + case (int)Phase.PhaseChange: - int phase = 0; - /* 0 = blasts - * 1 = holy fire - * 2 = shell heal - * 3 = molten blobs - * 4 = holy bombs - * 5 = shell spears - * 6 = crystal - * 7 = laser */ + phaseChange++; + if (phaseChange > 14) + phaseChange = 0; - // Holy ray in hallow, Crystal in hell - bool useLaser = (phase2 && biomeType == 1) || BossRushEvent.BossRushActive; - bool useCrystal = (phase2 && biomeType == 2) || BossRushEvent.BossRushActive; + int phase = 0; - // Unique pattern for Death Mode and Boss Rush - if (death) - { - switch (phaseChange) + // Holy ray in hallow, Crystal in hell + bool useLaser = (phase2 && biomeType == 1) || BossRushEvent.BossRushActive; + bool useCrystal = (phase2 && biomeType == 2) || BossRushEvent.BossRushActive; + + // Unique pattern for Death Mode and Boss Rush + if (death) { - case 0: - phase = 3; - break; // 1575 or 1500 - case 1: - phase = 5; - break; // 1875 or 1800 - case 2: - phase = 0; - break; // 2175 or 2100 - case 3: - phase = (useCrystal || nightTime) ? 6 : 3; - break; - case 4: - phase = useCrystal ? 3 : 2; - break; // 600 - case 5: - phase = useCrystal ? 2 : 1; - break; // 900 - case 6: - phase = (useLaser || nightTime) ? 7 : 4; // 1875 or 1800 - if (useLaser || nightTime) - { - npc.TargetClosest(false); - } - break; // 1200 - case 7: - phase = (useLaser || nightTime) ? 4 : 3; - break; // 1500 - case 8: - phase = (useLaser || nightTime) ? 3 : 5; - break; - case 9: - phase = 0; - break; // 2175 or 2100 - case 10: - phase = (useCrystal || nightTime) ? 6 : 2; - break; - case 11: - phase = nightTime ? 2 : 3; - break; // 300 - case 12: - phase = (useLaser || nightTime) ? 7 : 4; // 675 or 600 - if (useLaser || nightTime) - { - npc.TargetClosest(false); - } - break; - case 13: - phase = 5; - break; // 975 or 900 - case 14: - phase = (useLaser || nightTime) ? 4 : 0; - break; // 1275 or 1200 - default: - break; - } - } - else - { - switch (phaseChange) - { - case 0: - phase = 0; - break; // 3375 or 3300 - case 1: - phase = useLaser ? 7 : 1; // 3750 or 3600 - if (useLaser) - { - npc.TargetClosest(false); - } - break; - case 2: - phase = 4; - break; // 4050 or 3900 - case 3: - phase = 3; - break; // 4350 or 4200 - case 4: - phase = 5; - break; // 4650 or 4500 - case 5: - phase = useCrystal ? 6 : 4; - break; - case 6: - phase = 1; - break; // 300 - case 7: - phase = 0; - break; // 600 - case 8: - phase = 3; - break; // 900 - case 9: - phase = 2; - break; // 1500 - case 10: - phase = 4; - break; // 1800 - case 11: - phase = useLaser ? 7 : 0; //2175 or 2100 - if (useLaser) - { - npc.TargetClosest(false); - } - break; - case 12: - phase = 1; - break; // 2475 or 2400 - case 13: - phase = 3; - break; // 2775 or 2700 - case 14: - phase = 5; - break; // 3075 or 3000 - default: - break; - } - } - - // Pick a target - npc.TargetClosest(true); - - // If too far from target, set phase to 0 - if (Math.Abs(vector.X - player.Center.X) > 5600f) - phase = 0; - - // Reset attack delay for laser - if (phase == 7) - npc.localAI[2] = 0f; - - // Reset arrays - npc.ai[0] = phase; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - calamityGlobalNPC.newAI[1] = 0f; - calamityGlobalNPC.newAI[2] = 0f; - } - - // Holy blasts - else if (npc.ai[0] == 0f) - { - if (spawnAnimation) - { - if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[3] == 0f) - Projectile.NewProjectile(vector + new Vector2(0f, -80f), Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, biomeType, 0f); - - if (calamityGlobalNPC.newAI[3] == 10f && nightTime) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceHolyRay"), (int)npc.position.X, (int)npc.position.Y); - - if (calamityGlobalNPC.newAI[3] > 10f && calamityGlobalNPC.newAI[3] < 150f) - { - int dustAmt = (int)MathHelper.Lerp(4f, 8f, calamityGlobalNPC.newAI[3] / spawnAnimationTime); - for (int m = 0; m < dustAmt; m++) + switch (phaseChange) { - float fade = MathHelper.Lerp(1.3f, 0.7f, npc.Opacity) * CalamityUtils.GetLerpValue(0f, 120f, calamityGlobalNPC.newAI[3], clamped: true); - Color newColor = Main.hslToRgb(calamityGlobalNPC.newAI[3] / 180f, 1f, 0.5f); - - if (!nightTime) - { - newColor.R = 255; - if (biomeType == 2) - newColor.B = 0; - } - else - { - newColor.B = 255; - if (biomeType == 2) - newColor.G = 0; - else - newColor.R = 0; - } - - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 267, 0f, 0f, 0, newColor); - Main.dust[dust].position = npc.Center + Main.rand.NextVector2Circular(npc.width * 2f, npc.height * 2f) + new Vector2(0f, -150f); - Main.dust[dust].velocity *= Main.rand.NextFloat() * 0.8f; - Main.dust[dust].noGravity = true; - Main.dust[dust].fadeIn = 0.6f + Main.rand.NextFloat() * 0.7f * fade; - Main.dust[dust].velocity += Vector2.UnitY * 3f; - Main.dust[dust].scale = 1.2f; - - if (dust != 6000) - { - Dust dust2 = Dust.CloneDust(dust); - dust2.scale /= 2f; - dust2.fadeIn *= 0.85f; - dust2.color = new Color(255, 255, 0, 255); - } - } - } - - npc.Opacity = MathHelper.Clamp(calamityGlobalNPC.newAI[3] / spawnAnimationTime, 0f, 1f); - - calamityGlobalNPC.newAI[3] += 1f; - - if (nightTime && calamityGlobalNPC.newAI[3] >= spawnAnimationTime) - calamityGlobalNPC.newAI[3] += 1f; - - return; - } - - // Attack delay after cocoon phase - if (delayAttacks) - { - npc.localAI[2] -= 1f; - return; - } - - float num852 = Math.Abs(vector.X - player.Center.X); - if (num852 > distanceNeededToShoot && npc.position.Y < player.position.Y) - { - npc.ai[3] += 1f; - - int shootBoost = death ? 3 : (int)(4f * (1f - lifeRatio)); - int num856 = (expertMode ? 24 : 26) - shootBoost; - if (enraged) - num856 = 20; - - num856 = (int)(num856 * attackRateMult); - - if (npc.ai[3] >= num856) - npc.ai[3] = -num856; - - if (npc.ai[3] == 0f && Main.netMode != NetmodeID.MultiplayerClient) - { - vector.X += npc.velocity.X * 7f; - float num857 = player.position.X + player.width * 0.5f - vector.X; - float num858 = player.Center.Y - vector.Y; - float num859 = (float)Math.Sqrt(num857 * num857 + num858 * num858); - - float velocityBoost = death ? 2.5f : 2.5f * (1f - lifeRatio); - float num860 = (expertMode ? 10.25f : 9f) + velocityBoost; - if (enraged) - num860 = 12.75f; - - if (revenge) - num860 *= 1.15f; - - num859 = num860 / num859; - num857 *= num859; - num858 *= num859; - - Projectile.NewProjectile(vector.X, vector.Y, num857, num858, ModContent.ProjectileType(), holyBlastDamage, 0f, Main.myPlayer, 0f, 0f); - } - } - else if (npc.ai[3] < 0f) - npc.ai[3] += 1f; - - npc.ai[1] += 1f; - if (npc.ai[1] >= phaseTime) - npc.ai[0] = -1f; - } - - // Holy fire - else if (npc.ai[0] == 1f) - { - // Attack delay after cocoon phase - if (delayAttacks) - { - npc.localAI[2] -= 1f; - return; - } - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.ai[3] += 1f; - - int shootBoost = death ? 4 : (int)(5f * (1f - lifeRatio)); - int num864 = (expertMode ? 36 : 39) - shootBoost; - if (BossRushEvent.BossRushActive) - num864 = 31; - - num864 = (int)(num864 * attackRateMult); - - if (npc.ai[3] >= num864) - { - npc.ai[3] = 0f; - - Vector2 vector113 = new Vector2(vector.X, npc.position.Y + npc.height - 14f); - - float num865 = npc.velocity.Y; - if (num865 < 0f) - num865 = 0f; - - num865 += expertMode ? 4f : 3f; - - Projectile.NewProjectile(vector113.X, vector113.Y, npc.velocity.X * 0.25f, num865, ModContent.ProjectileType(), holyFireDamage, 0f, Main.myPlayer, 0f, 0f); - } - } - - npc.ai[1] += 1f; - if (npc.ai[1] >= phaseTime) - npc.ai[0] = -1f; - } - - // Cocoon flames - else if (npc.ai[0] == 2f) - { - npc.TargetClosest(true); - - if (!targetDead) - { - if (npc.velocity.Length() <= 2f) - npc.velocity = Vector2.Zero; - if (npc.velocity.Length() > 2f) - { - npc.velocity *= 0.9f; - return; - } - } - - float divisor = (expertMode ? 2f : 3f) + (float)Math.Floor(3f * lifeRatio) + (attackRateMult > 1D ? (float)Math.Ceiling(attackRateMult * 1.6) : 0f); - int totalProjectiles = 36; - int chains = 4; - float interval = totalProjectiles / chains * divisor; - double patternInterval = Math.Floor(npc.ai[3] / interval); - float velocity = 3f; - Vector2 fireFrom = new Vector2(vector.X, vector.Y + 20f); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (patternInterval % 2 == 0) - { - if (npc.ai[3] % divisor == 0f) - { - bool normalSpread = calamityGlobalNPC.newAI[1] % 2f == 0f; - Vector2 spinningPoint = normalSpread ? new Vector2(0f, -velocity) : Vector2.Normalize(new Vector2(-velocity, -velocity)); - double radians = MathHelper.TwoPi / chains; - Main.PlaySound(SoundID.Item20, npc.position); - for (int i = 0; i < chains; i++) - { - Vector2 vector2 = spinningPoint.RotatedBy(radians * i + MathHelper.ToRadians(npc.ai[2])); - - if (!normalSpread) - vector2 *= velocity; - - int projectileType = ModContent.ProjectileType(); - if (Main.rand.NextBool(4) && !death && !nightTime) - projectileType = ModContent.ProjectileType(); - - int dmgAmt = nightTime ? -300 : npc.GetProjectileDamageNoScaling(projectileType); - - Projectile.NewProjectile(fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt); - } - - // Radial offset - npc.ai[2] += 10f; + case 0: + phase = (int)Phase.MoltenBlobs; + break; + case 1: + phase = (int)Phase.SpearCocoon; + break; + case 2: + phase = (int)Phase.HolyBlast; + break; + case 3: + phase = (useCrystal || nightTime) ? (int)Phase.Crystal : (int)Phase.MoltenBlobs; + break; + case 4: + phase = useCrystal ? (int)Phase.MoltenBlobs : (int)Phase.FlameCocoon; + break; + case 5: + phase = useCrystal ? (int)Phase.FlameCocoon : (int)Phase.HolyFire; + break; + case 6: + phase = (useLaser || nightTime) ? (int)Phase.Laser : (int)Phase.HolyBomb; + if (useLaser || nightTime) + { + npc.TargetClosest(false); + } + break; + case 7: + phase = (useLaser || nightTime) ? (int)Phase.HolyBomb : (int)Phase.MoltenBlobs; + break; + case 8: + phase = (useLaser || nightTime) ? (int)Phase.MoltenBlobs : (int)Phase.SpearCocoon; + break; + case 9: + phase = (int)Phase.HolyBlast; + break; + case 10: + phase = (useCrystal || nightTime) ? (int)Phase.Crystal : (int)Phase.FlameCocoon; + break; + case 11: + phase = nightTime ? (int)Phase.FlameCocoon : (int)Phase.MoltenBlobs; + break; + case 12: + phase = (useLaser || nightTime) ? (int)Phase.Laser : (int)Phase.HolyBomb; + if (useLaser || nightTime) + { + npc.TargetClosest(false); + } + break; + case 13: + phase = (int)Phase.SpearCocoon; + break; + case 14: + phase = (useLaser || nightTime) ? (int)Phase.HolyBomb : (int)Phase.HolyBlast; + break; + default: + break; } } else { - npc.ai[2] = 0f; - - totalProjectiles = 16; - if (npc.ai[3] % (divisor * totalProjectiles) == 0f) + switch (phaseChange) { - calamityGlobalNPC.newAI[1] += 1f; - double radians = MathHelper.TwoPi / totalProjectiles; - Main.PlaySound(SoundID.Item20, npc.position); - for (int i = 0; i < totalProjectiles; i++) - { - Vector2 vector2 = new Vector2(0f, -velocity).RotatedBy(radians * i); - - int projectileType = ModContent.ProjectileType(); - if (Main.rand.NextBool(4) && !death) - projectileType = ModContent.ProjectileType(); - - Projectile.NewProjectile(fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, 0f); - } - - Vector2 velocity2 = Vector2.Normalize(player.Center - fireFrom) * velocity; - Projectile.NewProjectile(fireFrom, velocity2, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); + case 0: + phase = (int)Phase.HolyBlast; + break; + case 1: + phase = useLaser ? (int)Phase.Laser : (int)Phase.HolyFire; + if (useLaser) + { + npc.TargetClosest(false); + } + break; + case 2: + phase = (int)Phase.HolyBomb; + break; + case 3: + phase = (int)Phase.MoltenBlobs; + break; + case 4: + phase = (int)Phase.SpearCocoon; + break; + case 5: + phase = useCrystal ? (int)Phase.Crystal : (int)Phase.HolyBomb; + break; + case 6: + phase = (int)Phase.HolyFire; + break; + case 7: + phase = (int)Phase.HolyBlast; + break; + case 8: + phase = (int)Phase.MoltenBlobs; + break; + case 9: + phase = (int)Phase.FlameCocoon; + break; + case 10: + phase = (int)Phase.HolyBomb; + break; + case 11: + phase = useLaser ? (int)Phase.Laser : (int)Phase.HolyBlast; + if (useLaser) + { + npc.TargetClosest(false); + } + break; + case 12: + phase = (int)Phase.HolyFire; + break; + case 13: + phase = (int)Phase.MoltenBlobs; + break; + case 14: + phase = (int)Phase.SpearCocoon; + break; + default: + break; } } - } - if (npc.ai[3] == 0f) - DespawnSpecificProjectiles(); + // Pick a target + npc.TargetClosest(true); - // Air is burning text - npc.ai[3] += 1f; - if (npc.ai[3] >= (phaseTime * 1.5f) && !text) - { - text = true; - string key = "Mods.CalamityMod.ProfanedBossText"; - Color messageColor = Color.Orange; + // If too far from target, set phase to 0 + if (Math.Abs(vector.X - player.Center.X) > 5600f) + phase = (int)Phase.HolyBlast; - if (Main.netMode == NetmodeID.SinglePlayer) - Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == NetmodeID.Server) - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } + // Reset attack delay for laser + if (phase == (int)Phase.Laser) + npc.localAI[2] = 0f; - // Inflict Icarus Folly - if (npc.ai[3] >= (phaseTime * 2f)) - { - if (Main.netMode != NetmodeID.Server) + // Reset arrays + AIState = phase; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + calamityGlobalNPC.newAI[1] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + break; + + case (int)Phase.HolyBlast: + + if (spawnAnimation) { - Player player2 = Main.player[Main.myPlayer]; - bool inLiquid = (player2.wet || player2.honeyWet) && !player2.lavaWet; + if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[3] == 0f) + Projectile.NewProjectile(vector + new Vector2(0f, -80f), Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, biomeType, 0f); - if (!player2.dead && player2.active && Vector2.Distance(player2.Center, vector) < 2800f && !inLiquid) + if (calamityGlobalNPC.newAI[3] == 10f && nightTime) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceHolyRay"), (int)npc.position.X, (int)npc.position.Y); + + if (calamityGlobalNPC.newAI[3] > 10f && calamityGlobalNPC.newAI[3] < 150f) { - Main.PlaySound(SoundID.Item20, player2.position); - player2.AddBuff(ModContent.BuffType(), 3000, true); - - for (int num621 = 0; num621 < 40; num621++) + int dustAmt = (int)MathHelper.Lerp(4f, 8f, calamityGlobalNPC.newAI[3] / spawnAnimationTime); + for (int m = 0; m < dustAmt; m++) { - int num622 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, dustType, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + float fade = MathHelper.Lerp(1.3f, 0.7f, npc.Opacity) * CalamityUtils.GetLerpValue(0f, 120f, calamityGlobalNPC.newAI[3], clamped: true); + Color newColor = Main.hslToRgb(calamityGlobalNPC.newAI[3] / 180f, 1f, 0.5f); + + if (!nightTime) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + newColor.R = 255; + if (biomeType == 2) + newColor.B = 0; + } + else + { + newColor.B = 255; + if (biomeType == 2) + newColor.G = 0; + else + newColor.R = 0; + } + + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 267, 0f, 0f, 0, newColor); + Main.dust[dust].position = npc.Center + Main.rand.NextVector2Circular(npc.width * 2f, npc.height * 2f) + new Vector2(0f, -150f); + Main.dust[dust].velocity *= Main.rand.NextFloat() * 0.8f; + Main.dust[dust].noGravity = true; + Main.dust[dust].fadeIn = 0.6f + Main.rand.NextFloat() * 0.7f * fade; + Main.dust[dust].velocity += Vector2.UnitY * 3f; + Main.dust[dust].scale = 1.2f; + + if (dust != 6000) + { + Dust dust2 = Dust.CloneDust(dust); + dust2.scale /= 2f; + dust2.fadeIn *= 0.85f; + dust2.color = new Color(255, 255, 0, 255); } } - - for (int num623 = 0; num623 < 60; num623++) - { - int num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, dustType, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, dustType, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; - } } - } - text = false; - npc.ai[0] = -1f; - npc.localAI[2] = attackDelayAfterCocoon; - } - } + npc.Opacity = MathHelper.Clamp(calamityGlobalNPC.newAI[3] / spawnAnimationTime, 0f, 1f); - // Molten blasts - else if (npc.ai[0] == 3f) - { - // Attack delay after cocoon phase - if (delayAttacks) - { - npc.localAI[2] -= 1f; - return; - } + calamityGlobalNPC.newAI[3] += 1f; - float num852 = Math.Abs(vector.X - player.Center.X); - if (num852 > distanceNeededToShoot && npc.position.Y < player.position.Y) - { - npc.ai[3] += 1f; + if (nightTime && calamityGlobalNPC.newAI[3] >= spawnAnimationTime) + calamityGlobalNPC.newAI[3] += 1f; - int shootBoost = death ? 3 : (int)(4f * (1f - lifeRatio)); - int num856 = (expertMode ? 24 : 26) - shootBoost; - if (BossRushEvent.BossRushActive) - num856 = 20; - - num856 = (int)(num856 * attackRateMult); - - if (npc.ai[3] >= num856) - npc.ai[3] = -num856; - - if (npc.ai[3] == 0f && Main.netMode != NetmodeID.MultiplayerClient) - { - vector.X += npc.velocity.X * 7f; - float num857 = player.position.X + player.width * 0.5f - vector.X; - float num858 = player.Center.Y - vector.Y; - float num859 = (float)Math.Sqrt(num857 * num857 + num858 * num858); - - float shootBoost2 = death ? 2.5f : 2.5f * (1f - lifeRatio); - float num860 = (expertMode ? 10.25f : 9f) + shootBoost2; - if (BossRushEvent.BossRushActive) - num860 = 12.75f; - - if (revenge) - num860 *= 1.15f; - - num859 = num860 / num859; - num857 *= num859; - num858 *= num859; - - Projectile.NewProjectile(vector.X, vector.Y, num857 * 0.1f, num858, ModContent.ProjectileType(), moltenBlastDamage, 0f, Main.myPlayer, 0f, 0f); - } - } - else if (npc.ai[3] < 0f) - npc.ai[3] += 1f; - - npc.ai[1] += 1f; - if (npc.ai[1] >= phaseTime) - npc.ai[0] = -1f; - } - - // Holy bombs - else if (npc.ai[0] == 4f) - { - // Attack delay after cocoon phase - if (delayAttacks) - { - npc.localAI[2] -= 1f; - return; - } - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.ai[3] += 1f; - - int shootBoost = death ? 9 : (int)(10f * (1f - lifeRatio)); - int num864 = (expertMode ? 73 : 77) - shootBoost; - if (enraged) - num864 = 63; - - num864 = (int)(num864 * attackRateMult); - - if (npc.ai[3] >= num864) - { - npc.ai[3] = 0f; - - Vector2 vector113 = new Vector2(vector.X, npc.position.Y + npc.height - 14f); - - float num865 = npc.velocity.Y; - if (num865 < 0f) - num865 = 0f; - - num865 += expertMode ? 4f : 3f; - - Projectile.NewProjectile(vector113.X, vector113.Y, npc.velocity.X * 0.25f, num865, ModContent.ProjectileType(), holyBombDamage, 0f, Main.myPlayer, 0f, 0f); - } - } - - npc.ai[1] += 1f; - if (npc.ai[1] >= phaseTime) - npc.ai[0] = -1f; - } - - // Cocoon spears - else if (npc.ai[0] == 5f) - { - npc.TargetClosest(true); - - if (!targetDead) - { - if (npc.velocity.Length() <= 2f) - npc.velocity = Vector2.Zero; - if (npc.velocity.Length() > 2f) - { - npc.velocity *= 0.9f; return; } - } - if (npc.ai[1] == 0f) - DespawnSpecificProjectiles(); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.ai[2] += spearRate; - if (npc.ai[2] >= (float)(baseSpearRate * attackRateMult)) + // Attack delay after cocoon phase + if (delayAttacks) { - npc.ai[2] = 0f; - - Vector2 fireFrom = new Vector2(vector.X, vector.Y + 20f); - - Main.PlayTrackedSound(SoundID.DD2_BetsyFireballShot, fireFrom); - - float velocity = 3f; - int projectileType = ModContent.ProjectileType(); - - if (calamityGlobalNPC.newAI[2] % 2f == 0f) - { - int totalProjectiles = 12; - double radians = MathHelper.TwoPi / totalProjectiles; - Vector2 spinningPoint = Vector2.Normalize(new Vector2(-calamityGlobalNPC.newAI[1], -velocity)); - - for (int i = 0; i < totalProjectiles; i++) - { - Vector2 vector2 = spinningPoint.RotatedBy(radians * i) * velocity; - Projectile.NewProjectile(fireFrom, vector2, projectileType, holySpearDamage, 0f, Main.myPlayer, 0f, 0f); - } - - float radialOffset = MathHelper.Lerp(0.2f, 0.4f, spearRateIncrease); - calamityGlobalNPC.newAI[1] += radialOffset; - } - - calamityGlobalNPC.newAI[2] += 1f; - - velocity = expertMode ? 12f : 10f; - Vector2 velocity2 = Vector2.Normalize(player.Center - fireFrom) * velocity; - Projectile.NewProjectile(fireFrom, velocity2, projectileType, holySpearDamage, 0f, Main.myPlayer, 1f, 0f); - } - } - - npc.ai[1] += 1f; - if (npc.ai[1] >= phaseTime) - { - npc.ai[0] = -1f; - npc.localAI[2] = attackDelayAfterCocoon; - } - } - - // Crystal - else if (npc.ai[0] == 6f) - { - npc.TargetClosest(true); - - if (!targetDead) - npc.velocity *= 0.9f; - - npc.ai[1] += 1f; - if (npc.ai[1] >= crystalPhaseTime) - { - if (npc.ai[1] == crystalPhaseTime && Main.netMode != NetmodeID.MultiplayerClient) - { - int proj = Projectile.NewProjectile(player.Center.X, player.Center.Y - 360f, 0f, 0f, ModContent.ProjectileType(), crystalDamage, 0f, player.whoAmI, 0f, 0f); - - if (nightTime) - Main.projectile[proj].timeLeft = nightCrystalTime; + npc.localAI[2] -= 1f; + return; } - if (npc.ai[1] >= crystalPhaseTime + nightCrystalTime || !nightTime) - npc.ai[0] = -1f; - } - } - - // Holy ray - else if (npc.ai[0] == 7f) - { - Vector2 value19 = new Vector2(27f, 59f); - - float rotation = 450f + (guardianAmt * 18); - - npc.ai[2] += 1f; - if (npc.ai[2] < 120f) - { - if (npc.ai[2] >= 40f) + if (distanceX > distanceNeededToShoot && npc.position.Y < player.position.Y) { - int num1220 = 0; - if (npc.ai[2] >= 80f) - num1220 = 1; + npc.ai[3] += 1f; - for (int d = 0; d < 1 + num1220; d++) + int shootBoost = death ? 3 : (int)(4f * (1f - lifeRatio)); + int num856 = (expertMode ? 24 : 26) - shootBoost; + if (enraged) + num856 = 20; + + num856 = (int)(num856 * attackRateMult); + + if (npc.ai[3] >= num856) + npc.ai[3] = -num856; + + if (npc.ai[3] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { - float scalar = 1.2f; - if (d % 2 == 1) - scalar = 2.8f; + vector.X += npc.velocity.X * 7f; + float num857 = player.position.X + player.width * 0.5f - vector.X; + float num858 = player.Center.Y - vector.Y; + float num859 = (float)Math.Sqrt(num857 * num857 + num858 * num858); - Vector2 vector199 = new Vector2(vector.X, vector.Y + 32f) + ((float)Main.rand.NextDouble() * MathHelper.TwoPi).ToRotationVector2() * value19 / 2f; - int index = Dust.NewDust(vector199 - Vector2.One * 8f, 16, 16, dustType, npc.velocity.X / 2f, npc.velocity.Y / 2f, 0, default, 1f); - Main.dust[index].velocity = Vector2.Normalize(vector - vector199) * 3.5f * (10f - num1220 * 2f) / 10f; - Main.dust[index].noGravity = true; - Main.dust[index].scale = scalar; - } - } - } - else if (npc.ai[2] < (revenge ? 220f : 300f)) - { - if (npc.ai[2] == 120f) - { - if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, vector) < 2800f) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceHolyRay"), - (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); - } - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.TargetClosest(false); - - Vector2 velocity = player.Center - vector; - velocity.Normalize(); - - float num1225 = -1f; - if (velocity.X < 0f) - num1225 = 1f; - - velocity = velocity.RotatedBy(-(double)num1225 * MathHelper.TwoPi / 6f, default); - Projectile.NewProjectile(vector.X, vector.Y + 32f, velocity.X, velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, num1225 * MathHelper.TwoPi / rotation, npc.whoAmI); + float velocityBoost = death ? 2.5f : 2.5f * (1f - lifeRatio); + float num860 = (expertMode ? 10.25f : 9f) + velocityBoost; + if (enraged) + num860 = 12.75f; if (revenge) - Projectile.NewProjectile(vector.X, vector.Y + 32f, -velocity.X, -velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -num1225 * MathHelper.TwoPi / rotation, npc.whoAmI); + num860 *= 1.15f; - npc.ai[3] = (velocity.ToRotation() + MathHelper.TwoPi + MathHelper.Pi) * num1225; - npc.netUpdate = true; + num859 = num860 / num859; + num857 *= num859; + num858 *= num859; + + Projectile.NewProjectile(vector.X, vector.Y, num857, num858, ModContent.ProjectileType(), holyBlastDamage, 0f, Main.myPlayer, 0f, 0f); } } - } + else if (npc.ai[3] < 0f) + npc.ai[3] += 1f; - npc.ai[1] += 1f; - if (npc.ai[1] >= (revenge ? 235f : 315f)) - npc.ai[0] = -1f; + npc.ai[1] += 1f; + if (npc.ai[1] >= phaseTime) + AIState = (int)Phase.PhaseChange; + + break; + + case (int)Phase.HolyFire: + + // Attack delay after cocoon phase + if (delayAttacks) + { + npc.localAI[2] -= 1f; + return; + } + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.ai[3] += 1f; + + int shootBoost = death ? 4 : (int)(5f * (1f - lifeRatio)); + int num864 = (expertMode ? 36 : 39) - shootBoost; + if (BossRushEvent.BossRushActive) + num864 = 31; + + num864 = (int)(num864 * attackRateMult); + + if (npc.ai[3] >= num864) + { + npc.ai[3] = 0f; + + Vector2 vector113 = new Vector2(vector.X, npc.position.Y + npc.height - 14f); + + float num865 = npc.velocity.Y; + if (num865 < 0f) + num865 = 0f; + + num865 += expertMode ? 4f : 3f; + + Projectile.NewProjectile(vector113.X, vector113.Y, npc.velocity.X * 0.25f, num865, ModContent.ProjectileType(), holyFireDamage, 0f, Main.myPlayer, 0f, 0f); + } + } + + npc.ai[1] += 1f; + if (npc.ai[1] >= phaseTime) + AIState = (int)Phase.PhaseChange; + + break; + + case (int)Phase.FlameCocoon: + + npc.TargetClosest(true); + + if (!targetDead) + { + if (npc.velocity.Length() <= 2f) + npc.velocity = Vector2.Zero; + if (npc.velocity.Length() > 2f) + { + npc.velocity *= 0.9f; + return; + } + } + + float divisor = (expertMode ? 2f : 3f) + (float)Math.Floor(3f * lifeRatio) + (attackRateMult > 1D ? (float)Math.Ceiling(attackRateMult * 1.6) : 0f); + int totalFlameProjectiles = 36; + int chains = 4; + float interval = totalFlameProjectiles / chains * divisor; + double patternInterval = Math.Floor(npc.ai[3] / interval); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + if (patternInterval % 2 == 0) + { + if (npc.ai[3] % divisor == 0f) + { + bool normalSpread = calamityGlobalNPC.newAI[1] % 2f == 0f; + Vector2 spinningPoint = normalSpread ? new Vector2(0f, -cocoonProjVelocity) : Vector2.Normalize(new Vector2(-cocoonProjVelocity, -cocoonProjVelocity)); + double radians = MathHelper.TwoPi / chains; + Main.PlaySound(SoundID.Item20, npc.position); + for (int i = 0; i < chains; i++) + { + Vector2 vector2 = spinningPoint.RotatedBy(radians * i + MathHelper.ToRadians(npc.ai[2])); + + if (!normalSpread) + vector2 *= cocoonProjVelocity; + + int projectileType = ModContent.ProjectileType(); + if (Main.rand.NextBool(4) && !death) + projectileType = ModContent.ProjectileType(); + + int dmgAmt = nightTime ? -300 : npc.GetProjectileDamageNoScaling(projectileType); + + Projectile.NewProjectile(fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt); + } + + // Radial offset + npc.ai[2] += 10f; + } + } + else + { + npc.ai[2] = 0f; + + totalFlameProjectiles = 16; + if (npc.ai[3] % (divisor * totalFlameProjectiles) == 0f) + { + calamityGlobalNPC.newAI[1] += 1f; + double radians = MathHelper.TwoPi / totalFlameProjectiles; + Main.PlaySound(SoundID.Item20, npc.position); + for (int i = 0; i < totalFlameProjectiles; i++) + { + Vector2 vector2 = new Vector2(0f, -cocoonProjVelocity).RotatedBy(radians * i); + + int projectileType = ModContent.ProjectileType(); + if (Main.rand.NextBool(4) && !death) + projectileType = ModContent.ProjectileType(); + + int dmgAmt = nightTime ? -300 : npc.GetProjectileDamageNoScaling(projectileType); + + Projectile.NewProjectile(fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt); + } + + Vector2 velocity2 = Vector2.Normalize(player.Center - fireFrom) * cocoonProjVelocity; + int type = ModContent.ProjectileType(); + Projectile.NewProjectile(fireFrom, velocity2, type, 0, 0f, Main.myPlayer, 0f, nightTime ? -300 : npc.GetProjectileDamageNoScaling(type)); + } + } + } + + if (npc.ai[3] == 0f) + DespawnSpecificProjectiles(); + + // Air is burning text + npc.ai[3] += 1f; + if (npc.ai[3] >= (phaseTime * 1.5f) && !text) + { + text = true; + string key = "Mods.CalamityMod.ProfanedBossText"; + Color messageColor = Color.Orange; + + if (Main.netMode == NetmodeID.SinglePlayer) + Main.NewText(Language.GetTextValue(key), messageColor); + else if (Main.netMode == NetmodeID.Server) + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + + // Inflict Icarus Folly + if (npc.ai[3] >= (phaseTime * 2f)) + { + if (Main.netMode != NetmodeID.Server) + { + Player player2 = Main.player[Main.myPlayer]; + bool inLiquid = (player2.wet || player2.honeyWet) && !player2.lavaWet; + + if (!player2.dead && player2.active && Vector2.Distance(player2.Center, vector) < 2800f && !inLiquid) + { + Main.PlaySound(SoundID.Item20, player2.position); + player2.AddBuff(ModContent.BuffType(), 3000, true); + + for (int num621 = 0; num621 < 40; num621++) + { + int num622 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), + player2.width, player2.height, dustType, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + + for (int num623 = 0; num623 < 60; num623++) + { + int num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), + player2.width, player2.height, dustType, 0f, 0f, 100, default, 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), + player2.width, player2.height, dustType, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } + } + } + + text = false; + AIState = (int)Phase.PhaseChange; + npc.localAI[2] = attackDelayAfterCocoon; + } + + break; + + case (int)Phase.MoltenBlobs: + + // Attack delay after cocoon phase + if (delayAttacks) + { + npc.localAI[2] -= 1f; + return; + } + + if (distanceX > distanceNeededToShoot && npc.position.Y < player.position.Y) + { + npc.ai[3] += 1f; + + int shootBoost = death ? 3 : (int)(4f * (1f - lifeRatio)); + int num856 = (expertMode ? 24 : 26) - shootBoost; + if (BossRushEvent.BossRushActive) + num856 = 20; + + num856 = (int)(num856 * attackRateMult); + + if (npc.ai[3] >= num856) + npc.ai[3] = -num856; + + if (npc.ai[3] == 0f && Main.netMode != NetmodeID.MultiplayerClient) + { + vector.X += npc.velocity.X * 7f; + float num857 = player.position.X + player.width * 0.5f - vector.X; + float num858 = player.Center.Y - vector.Y; + float num859 = (float)Math.Sqrt(num857 * num857 + num858 * num858); + + float shootBoost2 = death ? 2.5f : 2.5f * (1f - lifeRatio); + float num860 = (expertMode ? 10.25f : 9f) + shootBoost2; + if (BossRushEvent.BossRushActive) + num860 = 12.75f; + + if (revenge) + num860 *= 1.15f; + + num859 = num860 / num859; + num857 *= num859; + num858 *= num859; + + Projectile.NewProjectile(vector.X, vector.Y, num857 * 0.1f, num858, ModContent.ProjectileType(), moltenBlastDamage, 0f, Main.myPlayer, 0f, 0f); + } + } + else if (npc.ai[3] < 0f) + npc.ai[3] += 1f; + + npc.ai[1] += 1f; + if (npc.ai[1] >= phaseTime) + AIState = (int)Phase.PhaseChange; + + break; + + case (int)Phase.HolyBomb: + + // Attack delay after cocoon phase + if (delayAttacks) + { + npc.localAI[2] -= 1f; + return; + } + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.ai[3] += 1f; + + int shootBoost = death ? 9 : (int)(10f * (1f - lifeRatio)); + int num864 = (expertMode ? 73 : 77) - shootBoost; + if (enraged) + num864 = 63; + + num864 = (int)(num864 * attackRateMult); + + if (npc.ai[3] >= num864) + { + npc.ai[3] = 0f; + + Vector2 vector113 = new Vector2(vector.X, npc.position.Y + npc.height - 14f); + + float num865 = npc.velocity.Y; + if (num865 < 0f) + num865 = 0f; + + num865 += expertMode ? 4f : 3f; + + Projectile.NewProjectile(vector113.X, vector113.Y, npc.velocity.X * 0.25f, num865, ModContent.ProjectileType(), holyBombDamage, 0f, Main.myPlayer, 0f, 0f); + } + } + + npc.ai[1] += 1f; + if (npc.ai[1] >= phaseTime) + AIState = (int)Phase.PhaseChange; + + break; + + case (int)Phase.SpearCocoon: + + npc.TargetClosest(true); + + if (!targetDead) + { + if (npc.velocity.Length() <= 2f) + npc.velocity = Vector2.Zero; + if (npc.velocity.Length() > 2f) + { + npc.velocity *= 0.9f; + return; + } + } + + if (npc.ai[1] == 0f) + DespawnSpecificProjectiles(); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.ai[2] += spearRate; + if (npc.ai[2] >= (float)(baseSpearRate * attackRateMult)) + { + npc.ai[2] = 0f; + + Main.PlayTrackedSound(SoundID.DD2_BetsyFireballShot, fireFrom); + + int projectileType = ModContent.ProjectileType(); + + if (calamityGlobalNPC.newAI[2] % 2f == 0f) + { + int totalSpearProjectiles = 12; + double radians = MathHelper.TwoPi / totalSpearProjectiles; + Vector2 spinningPoint = Vector2.Normalize(new Vector2(-calamityGlobalNPC.newAI[1], -cocoonProjVelocity)); + + for (int i = 0; i < totalSpearProjectiles; i++) + { + Vector2 vector2 = spinningPoint.RotatedBy(radians * i) * cocoonProjVelocity; + Projectile.NewProjectile(fireFrom, vector2, projectileType, holySpearDamage, 0f, Main.myPlayer, 0f, 0f); + } + + float radialOffset = MathHelper.Lerp(0.2f, 0.4f, spearRateIncrease); + calamityGlobalNPC.newAI[1] += radialOffset; + } + + calamityGlobalNPC.newAI[2] += 1f; + + cocoonProjVelocity = expertMode ? 12f : 10f; + Vector2 velocity2 = Vector2.Normalize(player.Center - fireFrom) * cocoonProjVelocity; + Projectile.NewProjectile(fireFrom, velocity2, projectileType, holySpearDamage, 0f, Main.myPlayer, 1f, 0f); + } + } + + npc.ai[1] += 1f; + if (npc.ai[1] >= phaseTime) + { + AIState = (int)Phase.PhaseChange; + npc.localAI[2] = attackDelayAfterCocoon; + } + + break; + + case (int)Phase.Crystal: + + npc.TargetClosest(true); + + if (!targetDead) + npc.velocity *= 0.9f; + + npc.ai[1] += 1f; + if (npc.ai[1] >= crystalPhaseTime) + { + if (npc.ai[1] == crystalPhaseTime && Main.netMode != NetmodeID.MultiplayerClient) + { + int proj = Projectile.NewProjectile(player.Center.X, player.Center.Y - 360f, 0f, 0f, ModContent.ProjectileType(), crystalDamage, 0f, player.whoAmI, 0f, 0f); + + if (nightTime) + Main.projectile[proj].timeLeft = nightCrystalTime; + } + + if (npc.ai[1] >= crystalPhaseTime + nightCrystalTime || !nightTime) + AIState = (int)Phase.PhaseChange; + } + + break; + + case (int)Phase.Laser: + + Vector2 value19 = new Vector2(27f, 59f); + + float rotation = 450f + (guardianAmt * 18); + + npc.ai[2] += 1f; + if (npc.ai[2] < 120f) + { + if (npc.ai[2] >= 40f) + { + int num1220 = 0; + if (npc.ai[2] >= 80f) + num1220 = 1; + + for (int d = 0; d < 1 + num1220; d++) + { + float scalar = 1.2f; + if (d % 2 == 1) + scalar = 2.8f; + + Vector2 vector199 = new Vector2(vector.X, vector.Y + 32f) + ((float)Main.rand.NextDouble() * MathHelper.TwoPi).ToRotationVector2() * value19 / 2f; + int index = Dust.NewDust(vector199 - Vector2.One * 8f, 16, 16, dustType, npc.velocity.X / 2f, npc.velocity.Y / 2f, 0, default, 1f); + Main.dust[index].velocity = Vector2.Normalize(vector - vector199) * 3.5f * (10f - num1220 * 2f) / 10f; + Main.dust[index].noGravity = true; + Main.dust[index].scale = scalar; + } + } + } + else if (npc.ai[2] < (revenge ? 220f : 300f)) + { + if (npc.ai[2] == 120f) + { + if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, vector) < 2800f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceHolyRay"), + (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + } + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.TargetClosest(false); + + Vector2 velocity = player.Center - vector; + velocity.Normalize(); + + float num1225 = -1f; + if (velocity.X < 0f) + num1225 = 1f; + + velocity = velocity.RotatedBy(-(double)num1225 * MathHelper.TwoPi / 6f, default); + Projectile.NewProjectile(vector.X, vector.Y + 32f, velocity.X, velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, num1225 * MathHelper.TwoPi / rotation, npc.whoAmI); + + if (revenge) + Projectile.NewProjectile(vector.X, vector.Y + 32f, -velocity.X, -velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -num1225 * MathHelper.TwoPi / rotation, npc.whoAmI); + + npc.ai[3] = (velocity.ToRotation() + MathHelper.TwoPi + MathHelper.Pi) * num1225; + npc.netUpdate = true; + } + } + } + + npc.ai[1] += 1f; + if (npc.ai[1] >= (revenge ? 235f : 315f)) + AIState = (int)Phase.PhaseChange; + + break; } } @@ -1384,7 +1399,7 @@ namespace CalamityMod.NPCs.Providence string getTextureGlowString = baseGlowTextureString + "ProvidenceGlow"; string getTextureGlow2String = baseGlowTextureString + "ProvidenceGlow2"; - if (npc.ai[0] == 2f || npc.ai[0] == 5f) + if (AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon) { if (!useDefenseFrames) { @@ -1499,7 +1514,7 @@ namespace CalamityMod.NPCs.Providence public override void FindFrame(int frameHeight) //9 total frames { - if (npc.ai[0] == 2f || npc.ai[0] == 5f) + if (AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon) { if (!useDefenseFrames) { diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 70584cffea..2ae45628fc 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -80,8 +80,11 @@ namespace CalamityMod.NPCs.Ravager if (npc.ai[0] == 0f) { npc.ai[1] += 1f; - if (npc.ai[1] >= 180f) - npc.ai[0] = 1f; + if (npc.ai[1] >= 60f) + { + npc.ai[0] = 1f; + npc.ai[1] = 180f; + } } else if (npc.ai[0] == 1f) { @@ -89,18 +92,31 @@ namespace CalamityMod.NPCs.Ravager { npc.ai[1] -= 1f; npc.localAI[0] += 1f; - float SpeedY = -10f; - if (BossRushEvent.BossRushActive) - { - SpeedY *= 1.5f; - } - if (npc.localAI[0] % 45f == 0f) + if (npc.localAI[0] % 60f == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) { - int damage = 45; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, SpeedY, ModContent.ProjectileType(), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + float speedY = -12f; + float speedX = 0f; + switch ((int)npc.ai[2]) + { + case 0: + break; + case 1: + speedX = 2f; + break; + case 2: + speedX = -2f; + break; + default: + break; + } + Vector2 velocity = new Vector2(speedX, speedY); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center, velocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } + npc.ai[2] += 1f; npc.localAI[0] = 0f; npc.netUpdate = true; } diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index e85a49f397..787e94399e 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -234,11 +234,12 @@ namespace CalamityMod.NPCs.Ravager float velocity = BossRushEvent.BossRushActive ? 10f : 7f; int totalProjectiles = 8; float radians = MathHelper.TwoPi / totalProjectiles; - int laserDamage = 45; + int type = ProjectileID.EyeBeam; + int damage = npc.GetProjectileDamage(type); for (int i = 0; i < totalProjectiles; i++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); - Projectile.NewProjectile(npc.Center, vector255, ProjectileID.EyeBeam, laserDamage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } } @@ -278,9 +279,10 @@ namespace CalamityMod.NPCs.Ravager Main.PlaySound(SoundID.Item20, npc.position); npc.localAI[2] = 0f; Vector2 shootFromVector = new Vector2(npc.Center.X + 80f, npc.Center.Y + 45f); - int damage = 40; + int type = ProjectileID.Fireball; + int damage = npc.GetProjectileDamage(type); float velocity = BossRushEvent.BossRushActive ? 18f : 12f; - Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, velocity, 0f, ProjectileID.Fireball, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, velocity, 0f, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } } @@ -317,9 +319,10 @@ namespace CalamityMod.NPCs.Ravager Main.PlaySound(SoundID.Item20, npc.position); npc.localAI[3] = 0f; Vector2 shootFromVector = new Vector2(npc.Center.X - 80f, npc.Center.Y + 45f); - int damage = 40; + int type = ProjectileID.Fireball; + int damage = npc.GetProjectileDamage(type); float velocity = BossRushEvent.BossRushActive ? -18f : -12f; - Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, velocity, 0f, ProjectileID.Fireball, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, velocity, 0f, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } } @@ -355,8 +358,9 @@ namespace CalamityMod.NPCs.Ravager { npc.ai[2] = 0f; Vector2 shootFromVector = new Vector2(npc.Center.X + 60f, npc.Center.Y + 60f); - int damage = 35; - int fire = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, 0f, 2f, ProjectileID.GreekFire1 + Main.rand.Next(3), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + int type = ProjectileID.GreekFire1; + int damage = npc.GetProjectileDamage(type); + int fire = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, 0f, 2f, type + Main.rand.Next(3), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); Main.projectile[fire].timeLeft = 180; } } @@ -394,8 +398,9 @@ namespace CalamityMod.NPCs.Ravager { npc.ai[3] = 0f; Vector2 shootFromVector = new Vector2(npc.Center.X - 60f, npc.Center.Y + 60f); - int damage = 35; - int fire = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, 0f, 2f, ProjectileID.GreekFire1 + Main.rand.Next(3), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + int type = ProjectileID.GreekFire1; + int damage = npc.GetProjectileDamage(type); + int fire = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, 0f, 2f, type + Main.rand.Next(3), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); Main.projectile[fire].timeLeft = 180; } } @@ -516,13 +521,13 @@ namespace CalamityMod.NPCs.Ravager if (!NPC.AnyNPCs(ModContent.NPCType())) { - NPC.NewNPC((int)npc.Center.X - spawnDistance, (int)npc.Center.Y - 10, ModContent.NPCType()); - NPC.NewNPC((int)npc.Center.X + spawnDistance, (int)npc.Center.Y - 10, ModContent.NPCType()); + NPC.NewNPC((int)player.Center.X - spawnDistance, (int)player.Center.Y - 100, ModContent.NPCType()); + NPC.NewNPC((int)player.Center.X + spawnDistance, (int)player.Center.Y - 100, ModContent.NPCType()); } else if (!NPC.AnyNPCs(ModContent.NPCType())) { - NPC.NewNPC((int)npc.Center.X - spawnDistance * 2, (int)npc.Center.Y - 10, ModContent.NPCType()); - NPC.NewNPC((int)npc.Center.X + spawnDistance * 2, (int)npc.Center.Y - 10, ModContent.NPCType()); + NPC.NewNPC((int)player.Center.X - spawnDistance * 2, (int)player.Center.Y - 100, ModContent.NPCType()); + NPC.NewNPC((int)player.Center.X + spawnDistance * 2, (int)player.Center.Y - 100, ModContent.NPCType()); } } } @@ -580,7 +585,7 @@ namespace CalamityMod.NPCs.Ravager npc.velocity.Y = -velocityY; } - float maxOffset = 360f; + float maxOffset = death ? 240f : 240f * (1f - lifeRatio); float offset = npc.ai[0] == 2f ? maxOffset * npc.Calamity().newAI[2] : 0f; // Set offset to 0 if the target stops moving @@ -589,13 +594,13 @@ namespace CalamityMod.NPCs.Ravager else npc.Calamity().newAI[2] = player.direction; - if ((npc.position.X < targetVector.X + offset && npc.position.X + npc.width > targetVector.X + player.width + offset && (inRange || npc.ai[0] != 2f)) || npc.ai[1] > 0f || npc.Calamity().newAI[3] >= 300f) + if ((npc.position.X < targetVector.X + offset && npc.position.X + npc.width > targetVector.X + player.width + offset && (inRange || npc.ai[0] != 2f)) || npc.ai[1] > 0f || npc.Calamity().newAI[3] >= 180f) { if (npc.ai[0] == 2f) { - float stopBeforeFallTime = 25f; + float stopBeforeFallTime = 30f; if (expertMode) - stopBeforeFallTime -= death ? 5f : 5f * (1f - lifeRatio); + stopBeforeFallTime -= death ? 15f : 15f * (1f - lifeRatio); if (npc.ai[1] < stopBeforeFallTime) { diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index 9a5b7813a0..5b9b1971d3 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -129,11 +129,11 @@ namespace CalamityMod.NPCs.Ravager totalPlayerDistance = nukeSpeed / totalPlayerDistance; playerDistanceX *= totalPlayerDistance; playerDistanceY *= totalPlayerDistance; - int nukeDamage = expertMode ? 45 : 60; - int projectileType = ModContent.ProjectileType(); - if (Main.netMode != NetmodeID.MultiplayerClient) + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + if (Main.netMode != NetmodeID.MultiplayerClient) { - int nuke = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, playerDistanceX, playerDistanceY, projectileType, nukeDamage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + int nuke = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, playerDistanceX, playerDistanceY, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); Main.projectile[nuke].velocity.Y = -15f; } } diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index 40b3817e01..fe23f7e9b2 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -96,15 +96,18 @@ namespace CalamityMod.NPCs.Ravager npc.ai[1] += 1f; bool fireProjectiles = npc.ai[1] >= 480f; - if (fireProjectiles && Vector2.Distance(npc.Center, player.Center) > 160f) + if (fireProjectiles && Vector2.Distance(npc.Center, player.Center) > 80f) { if (npc.ai[1] >= 600f) { + npc.ai[0] += 1f; npc.ai[1] = 0f; Main.PlaySound(SoundID.Item62, npc.position); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.Center, Vector2.Zero, ModContent.ProjectileType(), (Main.expertMode ? 45 : 60) + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, Vector2.Zero, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } else { @@ -112,24 +115,21 @@ namespace CalamityMod.NPCs.Ravager { if (Main.netMode != NetmodeID.MultiplayerClient) { - if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - Main.PlaySound(SoundID.Item33, npc.position); - int num8 = 40; - int num9 = ModContent.ProjectileType(); - Projectile.NewProjectile(npc.Center, Vector2.Normalize(player.Center - npc.Center) * 6f, num9, num8 + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); - } + Main.PlaySound(SoundID.Item33, npc.position); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center, Vector2.Normalize(player.Center - npc.Center) * 6f, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, -1f); } } } } - float num823 = 10f; + float num823 = 12f; float num824 = 0.15f; if (death) { num823 += 1f; - num824 += 0.02f; + num824 += 0.03f; } if (provy) { @@ -143,8 +143,9 @@ namespace CalamityMod.NPCs.Ravager } Vector2 vector82 = npc.Center; - float num825 = player.Center.X + (fireProjectiles ? 360f * player.direction : 0f) - vector82.X; - float num826 = player.Center.Y + (fireProjectiles ? 0f : 360f) - vector82.Y; + float distance = npc.ai[0] % 2f == 0f ? 360f : -360f; + float num825 = player.Center.X + (fireProjectiles ? distance : 0f) - vector82.X; + float num826 = player.Center.Y + (fireProjectiles ? -180f : 360f) - vector82.Y; float num827 = (float)Math.Sqrt(num825 * num825 + num826 * num826); num827 = num823 / num827; num825 *= num827; diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 200395a042..ebe5002e40 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -23,9 +23,6 @@ namespace CalamityMod.NPCs.Signus [AutoloadBossHead] public class Signus : ModNPC { - private int phaseSwitch = 0; - private int chargeSwitch = 0; - private int dustTimer = 3; private int spawnX = 750; private int spawnY = 120; private int lifeToAlpha = 0; @@ -94,9 +91,6 @@ namespace CalamityMod.NPCs.Signus public override void SendExtraAI(BinaryWriter writer) { - writer.Write(phaseSwitch); - writer.Write(chargeSwitch); - writer.Write(dustTimer); writer.Write(spawnX); writer.Write(spawnY); writer.Write(lifeToAlpha); @@ -104,9 +98,6 @@ namespace CalamityMod.NPCs.Signus public override void ReceiveExtraAI(BinaryReader reader) { - phaseSwitch = reader.ReadInt32(); - chargeSwitch = reader.ReadInt32(); - dustTimer = reader.ReadInt32(); spawnX = reader.ReadInt32(); spawnY = reader.ReadInt32(); lifeToAlpha = reader.ReadInt32(); @@ -124,10 +115,15 @@ namespace CalamityMod.NPCs.Signus double lifeRatio = npc.life / (double)npc.lifeMax; lifeToAlpha = (int)(100.0 * (1.0 - lifeRatio)); - - bool phase2 = (lifeRatio < 0.75f && expertMode) || death; + int maxCharges = death ? 1 : revenge ? 2 : expertMode ? 3 : 4; + int maxTeleports = death ? 1 : revenge ? 2 : expertMode ? 3 : 4; + float inertia = death ? 10f : revenge ? 11f : expertMode ? 12f : 14f; + float chargeVelocity = death ? 14f : revenge ? 13f : expertMode ? 12f : 10f; + bool phase2 = (lifeRatio < 0.75f && expertMode) || death; bool phase3 = lifeRatio < 0.5f || death; + npc.damage = npc.defDamage; + // Get a target if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(true); @@ -169,8 +165,8 @@ namespace CalamityMod.NPCs.Signus npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - phaseSwitch = 0; - chargeSwitch = 0; + npc.Calamity().newAI[0] = 0f; + npc.Calamity().newAI[1] = 0f; spawnY = 120; npc.netUpdate = true; } @@ -180,9 +176,6 @@ namespace CalamityMod.NPCs.Signus else if (npc.timeLeft < 1800) npc.timeLeft = 1800; - float num1000 = expertMode ? 11f : 13f; - float num1006 = 0.111111117f * num1000; - if (lifeToAlpha < 50 && npc.ai[0] != 1f) { for (int num1011 = 0; num1011 < 2; num1011++) @@ -227,10 +220,21 @@ namespace CalamityMod.NPCs.Signus npc.velocity.Y = (npc.velocity.Y * 50f + num796) / 51f; } else - { npc.knockBackResist = 0f; - } - if (npc.ai[0] == 0f) + + if (npc.ai[0] == -1f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int phase; + do phase = Main.rand.Next(5); + while (phase == npc.ai[1] || phase == 1 || phase == 2); + + npc.ai[0] = phase; + npc.ai[1] = 0f; + } + } + else if (npc.ai[0] == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -242,7 +246,9 @@ namespace CalamityMod.NPCs.Signus if (npc.localAI[1] >= 120f) { npc.localAI[1] = 0f; + npc.TargetClosest(true); + int num1249 = 0; int num1250; int num1251; @@ -271,10 +277,13 @@ namespace CalamityMod.NPCs.Signus if (num1249 > 100) return; } + npc.ai[0] = 1f; npc.ai[1] = num1250; npc.ai[2] = num1251; + npc.netUpdate = true; + return; } } @@ -296,14 +305,19 @@ namespace CalamityMod.NPCs.Signus if (npc.alpha >= 255) { Main.PlaySound(SoundID.Item8, vectorCenter); + npc.alpha = 255; + npc.position = position; + for (int n = 0; n < 15; n++) { int num39 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 90, default, 3f); Main.dust[num39].noGravity = true; } + npc.ai[0] = 2f; + npc.netUpdate = true; } } @@ -315,16 +329,15 @@ namespace CalamityMod.NPCs.Signus if (Main.netMode != NetmodeID.MultiplayerClient && revenge) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); + int num660 = NPC.NewNPC((int)(player.position.X + 750f), (int)player.position.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); if (Main.netMode == NetmodeID.Server) - { NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); - } + int num661 = NPC.NewNPC((int)(player.position.X - 750f), (int)player.position.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); if (Main.netMode == NetmodeID.Server) - { NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); - } + for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(player.position.X + 750f, player.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); @@ -344,6 +357,7 @@ namespace CalamityMod.NPCs.Signus Main.dust[num623].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } + for (int num623 = 0; num623 < 20; num623++) { int num624 = Dust.NewDust(new Vector2(player.position.X + 750f, player.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 3f); @@ -358,11 +372,12 @@ namespace CalamityMod.NPCs.Signus Main.dust[num625].velocity *= 2f; } } + npc.ai[3] += 1f; npc.alpha = lifeToAlpha; - if (npc.ai[3] >= 3f) + if (npc.ai[3] >= maxTeleports) { - npc.ai[0] = 3f; + npc.ai[0] = -1f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; @@ -375,87 +390,92 @@ namespace CalamityMod.NPCs.Signus } else if (npc.ai[0] == 3f) { + npc.damage = 0; npc.rotation = npc.velocity.X * 0.04f; float playerLocation = vectorCenter.X - player.Center.X; npc.direction = playerLocation < 0f ? 1 : -1; npc.spriteDirection = npc.direction; - Vector2 vector121 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2)); - npc.ai[1] += 1f; - float divisor = expertMode ? (death ? 55f : revenge ? 60f : 65f) - (float)Math.Ceiling(30D * (1D - lifeRatio)) : 70f; - - if (npc.ai[1] % divisor == divisor - 1f) + float divisor = expertMode ? (death ? 12f : revenge ? 15f : 20f) - (float)Math.Ceiling(5D * (1D - lifeRatio)) : 20f; + float scytheBarrageTime = divisor * 3f; + float scytheBarrageCooldown = divisor * 3f; + + npc.ai[1] += 1f; + if (npc.ai[2] > 0f) + npc.ai[2] -= 1f; + else + npc.ai[2] = scytheBarrageTime + scytheBarrageCooldown; + + if (npc.ai[2] <= scytheBarrageTime) { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float num1070 = 15f; - if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) - { - num1070 += 3f; - } - float num1071 = player.position.X + player.width * 0.5f - vector121.X; - float num1072 = player.position.Y + player.height * 0.5f - vector121.Y; - float num1073 = (float)Math.Sqrt(num1071 * num1071 + num1072 * num1072); - num1073 = num1070 / num1073; - num1071 *= num1073; - num1072 *= num1073; - int num1074 = expertMode ? 48 : 60; - int num1075 = ModContent.ProjectileType(); - Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, num1075, num1074, 0f, Main.myPlayer, 0f, npc.target + 1); - } + if (npc.ai[1] % divisor == divisor - 1f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float num1070 = 15f; + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) + num1070 += 3f; + + float num1071 = player.Center.X - vectorCenter.X; + float num1072 = player.Center.Y - vectorCenter.Y; + float num1073 = (float)Math.Sqrt(num1071 * num1071 + num1072 * num1072); + num1073 = num1070 / num1073; + num1071 *= num1073; + num1072 *= num1073; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, num1071, num1072, type, damage, 0f, Main.myPlayer, 0f, npc.target + 1); + } + } } - if (npc.position.Y > player.position.Y - 200f) //200 + + if (npc.position.Y > player.position.Y - 200f) { if (npc.velocity.Y > 0f) - { npc.velocity.Y *= 0.975f; - } + npc.velocity.Y -= BossRushEvent.BossRushActive ? 0.15f : 0.1f; + if (npc.velocity.Y > 3f) - { npc.velocity.Y = 3f; - } } - else if (npc.position.Y < player.position.Y - 400f) //500 + else if (npc.position.Y < player.position.Y - 400f) { if (npc.velocity.Y < 0f) - { npc.velocity.Y *= 0.975f; - } + npc.velocity.Y += BossRushEvent.BossRushActive ? 0.15f : 0.1f; + if (npc.velocity.Y < -3f) - { npc.velocity.Y = -3f; - } } - if (npc.position.X + (npc.width / 2) > player.position.X + (player.width / 2) + 500f) //100 + + if (vectorCenter.X > player.Center.X + 500f) { if (npc.velocity.X > 0f) - { npc.velocity.X *= 0.98f; - } + npc.velocity.X -= BossRushEvent.BossRushActive ? 0.15f : 0.1f; + if (npc.velocity.X > 8f) - { npc.velocity.X = 8f; - } } - if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2) - 500f) //100 + + if (vectorCenter.X < player.Center.X - 500f) { if (npc.velocity.X < 0f) - { npc.velocity.X *= 0.98f; - } + npc.velocity.X += BossRushEvent.BossRushActive ? 0.15f : 0.1f; + if (npc.velocity.X < -8f) - { npc.velocity.X = -8f; - } } - if (npc.ai[1] >= divisor * 5f) + + if (npc.ai[1] >= divisor * 20f) { - npc.ai[0] = 4f; - npc.ai[1] = 0f; + npc.ai[0] = -1f; + npc.ai[1] = 3f; npc.ai[2] = 0f; npc.ai[3] = 0f; npc.netUpdate = true; @@ -471,148 +491,144 @@ namespace CalamityMod.NPCs.Signus { int num660 = NPC.NewNPC((int)(player.position.X + spawnX), (int)(player.position.Y + spawnY), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); if (Main.netMode == NetmodeID.Server) - { NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); - } + int num661 = NPC.NewNPC((int)(player.position.X - spawnX), (int)(player.position.Y + spawnY), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); if (Main.netMode == NetmodeID.Server) - { NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); - } + spawnY -= 60; } spawnY = 120; } } - npc.TargetClosest(false); - npc.rotation = npc.velocity.ToRotation(); - if (Math.Sign(npc.velocity.X) != 0) - { - npc.spriteDirection = -Math.Sign(npc.velocity.X); - } - if (npc.rotation < -1.57079637f) - { - npc.rotation += 3.14159274f; - } - if (npc.rotation > 1.57079637f) - { - npc.rotation -= 3.14159274f; - } - npc.spriteDirection = Math.Sign(npc.velocity.X); - if (chargeSwitch == 0) //line up the charge - { - float scaleFactor6 = 14f; - if (expertMode) - scaleFactor6 += death ? 6f : 6f * (float)(1D - lifeRatio); - Vector2 center5 = player.Center; - Vector2 vector126 = center5 - vectorCenter; + npc.TargetClosest(false); + + npc.rotation = npc.velocity.ToRotation(); + + if (Math.Sign(npc.velocity.X) != 0) + npc.spriteDirection = -Math.Sign(npc.velocity.X); + + if (npc.rotation < -MathHelper.PiOver2) + npc.rotation += MathHelper.Pi; + if (npc.rotation > MathHelper.PiOver2) + npc.rotation -= MathHelper.Pi; + + npc.spriteDirection = Math.Sign(npc.velocity.X); + + if (npc.Calamity().newAI[0] == 0f) // Line up the charge + { + float velocity = revenge ? 16f : expertMode ? 15f : 14f; + if (expertMode) + velocity += death ? 4f : 4f * (float)(1D - lifeRatio); + + Vector2 vector126 = player.Center - vectorCenter; Vector2 vector127 = vector126 - Vector2.UnitY * 300f; + float num1013 = vector126.Length(); - vector126 = Vector2.Normalize(vector126) * scaleFactor6; - vector127 = Vector2.Normalize(vector127) * scaleFactor6; - bool flag64 = Collision.CanHit(vectorCenter, 1, 1, player.Center, 1, 1); - if (npc.ai[3] >= 120f) - { - flag64 = true; - } + + vector126 = Vector2.Normalize(vector126) * velocity; + vector127 = Vector2.Normalize(vector127) * velocity; + + bool flag64 = Collision.CanHit(vectorCenter, 1, 1, player.Center, 1, 1) || npc.ai[3] >= 120f; float num1014 = 8f; - flag64 = flag64 && vector126.ToRotation() > 3.14159274f / num1014 && vector126.ToRotation() < 3.14159274f - 3.14159274f / num1014; + flag64 = flag64 && vector126.ToRotation() > MathHelper.Pi / num1014 && vector126.ToRotation() < MathHelper.Pi - MathHelper.Pi / num1014; if (num1013 > 1400f || !flag64) { - npc.velocity.X = (npc.velocity.X * (num1000 - 1f) + vector127.X) / num1000; - npc.velocity.Y = (npc.velocity.Y * (num1000 - 1f) + vector127.Y) / num1000; + npc.velocity = (npc.velocity * (inertia - 1f) + vector127) / inertia; + if (!flag64) { npc.ai[3] += 1f; if (npc.ai[3] == 120f) - { npc.netUpdate = true; - } } else - { npc.ai[3] = 0f; - } } else { - chargeSwitch = 1; + npc.Calamity().newAI[0] = 1f; npc.ai[2] = vector126.X; npc.ai[3] = vector126.Y; npc.netUpdate = true; } } - else if (chargeSwitch == 1) //pause before charge + else if (npc.Calamity().newAI[0] == 1f) // Pause before charge { npc.velocity *= 0.8f; + npc.ai[1] += 1f; if (npc.ai[1] >= 5f) { - chargeSwitch = 2; - npc.ai[1] = 0f; + npc.Calamity().newAI[0] = 2f; + npc.netUpdate = true; + Vector2 velocity = new Vector2(npc.ai[2], npc.ai[3]); velocity.Normalize(); - velocity *= 10f; + velocity *= chargeVelocity; npc.velocity = velocity; - } + + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + } } - else if (chargeSwitch == 2) //charging + else if (npc.Calamity().newAI[0] == 2f) // Charging { if (Main.netMode != NetmodeID.MultiplayerClient) { - dustTimer--; - if (phase2 && dustTimer <= 0) + npc.ai[2] += 1f; + if (phase2 && npc.ai[2] % 3f == 0f) { Main.PlaySound(SoundID.Item73, npc.position); - int damage = expertMode ? 60 : 70; - int projectile = Projectile.NewProjectile((int)vectorCenter.X, (int)vectorCenter.Y, 0f, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - dustTimer = 3; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + int projectile = Projectile.NewProjectile(vectorCenter, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, 0f); } } + npc.ai[1] += 1f; bool flag65 = vectorCenter.Y + 50f > player.Center.Y; if ((npc.ai[1] >= 90f && flag65) || npc.velocity.Length() < 8f) { - chargeSwitch = 3; + npc.Calamity().newAI[0] = 3f; npc.ai[1] = 30f; npc.ai[2] = 0f; - npc.ai[3] = 0f; npc.velocity /= 2f; npc.netUpdate = true; } else { - Vector2 center7 = player.Center; - Vector2 vec2 = center7 - vectorCenter; + Vector2 vec2 = player.Center - vectorCenter; vec2.Normalize(); if (vec2.HasNaNs()) - { vec2 = new Vector2(npc.direction, 0f); - } - npc.velocity = (npc.velocity * (num1000 - 1f) + vec2 * (npc.velocity.Length() + num1006)) / num1000; + + npc.velocity = (npc.velocity * (inertia - 1f) + vec2 * (npc.velocity.Length() + 0.111111117f * inertia)) / inertia; } } - else if (chargeSwitch == 3) //slow down after charging and reset + else if (npc.Calamity().newAI[0] == 3f) // Slow down after charging and reset { npc.ai[1] -= 1f; if (npc.ai[1] <= 0f) { - phaseSwitch += 1; - if (phaseSwitch >= 3) + npc.Calamity().newAI[1] += 1f; + if (npc.Calamity().newAI[1] >= maxCharges) { - npc.ai[0] = 0f; - npc.ai[1] = 0f; + npc.ai[0] = -1f; + npc.ai[1] = 4f; npc.ai[2] = 0f; npc.ai[3] = 0f; - chargeSwitch = 0; - phaseSwitch = 0; + npc.Calamity().newAI[0] = 0f; + npc.Calamity().newAI[1] = 0f; npc.netUpdate = true; } else { - chargeSwitch = 0; + npc.Calamity().newAI[0] = 0f; npc.ai[1] = 0f; npc.netUpdate = true; } diff --git a/NPCs/Signus/SignusBomb.cs b/NPCs/Signus/SignusBomb.cs index 481abbc700..60a32ae9be 100644 --- a/NPCs/Signus/SignusBomb.cs +++ b/NPCs/Signus/SignusBomb.cs @@ -68,9 +68,9 @@ namespace CalamityMod.NPCs.Signus npc.Calamity().newAI[0] += 1f; npc.velocity *= 0.98f; npc.dontTakeDamage = false; - npc.scale = MathHelper.Lerp(1f, 3f, npc.Calamity().newAI[0] / 85f); + npc.scale = MathHelper.Lerp(1f, 3f, npc.Calamity().newAI[0] / 45f); - if (npc.Calamity().newAI[0] >= 85f) + if (npc.Calamity().newAI[0] >= 45f) { CheckDead(); npc.life = 0; @@ -147,6 +147,9 @@ namespace CalamityMod.NPCs.Signus public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + if (npc.Calamity().newAI[0] >= 45f) + return false; + SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index fa98484d36..0cda6ef7de 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -156,8 +156,8 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = 24; - int num185 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; for (int num186 = 0; num186 < 3; num186++) @@ -170,7 +170,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += (float)Main.rand.Next(-60, 61); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } else @@ -185,8 +185,8 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = expertMode ? 17 : 21; - int num185 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; for (int num186 = 0; num186 < 4; num186++) @@ -199,7 +199,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += (float)Main.rand.Next(-60, 61); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 280865c442..e76b1d8f3b 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -388,17 +388,8 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = 24; - int num185 = Main.rand.Next(2); - if (num185 == 0) - { - num185 = ModContent.ProjectileType(); - } - else - { - num185 = ModContent.ProjectileType(); - num184 = 22; - } + int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; num180 = player.position.X + player.width * 0.5f - value9.X; @@ -407,7 +398,7 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } else { @@ -423,17 +414,8 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = expertMode ? 17 : 21; - int num185 = Main.rand.Next(2); - if (num185 == 0) - { - num185 = ModContent.ProjectileType(); - } - else - { - num185 = ModContent.ProjectileType(); - num184 = expertMode ? 16 : 19; - } + int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; num180 = player.position.X + player.width * 0.5f - value9.X; @@ -442,7 +424,7 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -470,17 +452,8 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = 24; - int num185 = Main.rand.Next(2); - if (num185 == 0) - { - num185 = ModContent.ProjectileType(); - } - else - { - num185 = ModContent.ProjectileType(); - num184 = 22; - } + int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; num180 = player.position.X + player.width * 0.5f - value9.X; @@ -489,7 +462,7 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } else { @@ -505,17 +478,8 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = expertMode ? 17 : 21; - int num185 = Main.rand.Next(2); - if (num185 == 0) - { - num185 = ModContent.ProjectileType(); - } - else - { - num185 = ModContent.ProjectileType(); - num184 = expertMode ? 16 : 19; - } + int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; for (int num186 = 0; num186 < 2; num186++) @@ -528,7 +492,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += Main.rand.Next(-30, 31); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index 335977550b..26f137bda9 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -167,8 +167,8 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = 22; - int num185 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; for (int num186 = 0; num186 < 2; num186++) @@ -181,7 +181,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += (float)Main.rand.Next(-60, 61); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } else @@ -198,8 +198,8 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = expertMode ? 16 : 19; - int num185 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; for (int num186 = 0; num186 < 2; num186++) @@ -212,7 +212,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += (float)Main.rand.Next(-30, 31); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index 0472ef9c15..ba63f9ddd3 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -154,8 +154,8 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = 22; - int num185 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; num180 = player.position.X + (float)player.width * 0.5f - value9.X; @@ -166,7 +166,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += (float)Main.rand.Next(-30, 31); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } else { @@ -182,8 +182,8 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = expertMode ? 16 : 19; - int num185 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; num180 = player.position.X + (float)player.width * 0.5f - value9.X; @@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += (float)Main.rand.Next(-20, 21); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index 979497a7df..edce97bd2a 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -146,8 +146,8 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = 24; - int num185 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; num180 = player.position.X + (float)player.width * 0.5f - value9.X; @@ -158,7 +158,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += (float)Main.rand.Next(-30, 31); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } else { @@ -172,8 +172,8 @@ namespace CalamityMod.NPCs.SlimeGod num183 = num179 / num183; num180 *= num183; num182 *= num183; - int num184 = expertMode ? 17 : 21; - int num185 = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); value9.X += num180; value9.Y += num182; for (int num186 = 0; num186 < 2; num186++) @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.SlimeGod num182 += (float)Main.rand.Next(-20, 21); num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs index 6b411f2403..cad4eec264 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs @@ -45,10 +45,11 @@ namespace CalamityMod.NPCs.SlimeGod public override void AI() { if (spikeTimer > 0f) - { spikeTimer -= 1f; - } - if (!npc.wet) + + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + if (!npc.wet) { Vector2 vector3 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num14 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector3.X; @@ -70,7 +71,7 @@ namespace CalamityMod.NPCs.SlimeGod vector4.Y *= 1f + (float)Main.rand.Next(-50, 51) * 0.005f; vector4.Normalize(); vector4 *= 4f + (float)Main.rand.Next(-50, 51) * 0.01f; - Projectile.NewProjectile(vector3.X, vector3.Y, vector4.X, vector4.Y, ModContent.ProjectileType(), 12, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector3.X, vector3.Y, vector4.X, vector4.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); spikeTimer = 30f; } } @@ -90,7 +91,7 @@ namespace CalamityMod.NPCs.SlimeGod num14 *= num16; num15 *= num16; spikeTimer = 50f; - Projectile.NewProjectile(vector3.X, vector3.Y, num14, num15, ModContent.ProjectileType(), 12, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector3.X, vector3.Y, num14, num15, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/StormWeaver/StasisProbe.cs b/NPCs/StormWeaver/StasisProbe.cs index 48f394202b..d000c5eae5 100644 --- a/NPCs/StormWeaver/StasisProbe.cs +++ b/NPCs/StormWeaver/StasisProbe.cs @@ -133,10 +133,9 @@ namespace CalamityMod.NPCs.StormWeaver npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { - int num8 = Main.expertMode ? 50 : 60; - int num9 = ProjectileID.PinkLaser; - int beam = Projectile.NewProjectile(vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[beam].timeLeft = 200; + int type = ProjectileID.PinkLaser; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(vector.X, vector.Y, num4, num5, type, damage, 0f, Main.myPlayer, 0f, 0f); } } int num10 = (int)npc.position.X + npc.width / 2; diff --git a/NPCs/StormWeaver/StasisProbeNaked.cs b/NPCs/StormWeaver/StasisProbeNaked.cs index 1cbfe11ff3..97f9d49dbe 100644 --- a/NPCs/StormWeaver/StasisProbeNaked.cs +++ b/NPCs/StormWeaver/StasisProbeNaked.cs @@ -133,10 +133,9 @@ namespace CalamityMod.NPCs.StormWeaver npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { - int num8 = Main.expertMode ? 50 : 60; - int num9 = ProjectileID.PinkLaser; - int beam = Projectile.NewProjectile(vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[beam].timeLeft = 200; + int type = ProjectileID.PinkLaser; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(vector.X, vector.Y, num4, num5, type, damage, 0f, Main.myPlayer, 0f, 0f); } } int num10 = (int)npc.position.X + npc.width / 2; diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 3080cb93df..2890173644 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.StormWeaver { CalamityUtils.StartRain(); } - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); if (npc.ai[3] > 0f) { npc.realLife = (int)npc.ai[3]; @@ -137,16 +137,15 @@ namespace CalamityMod.NPCs.StormWeaver lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); } Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].ai[2] = (float)npc.whoAmI; - Main.npc[lol].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)lol; + Main.npc[lol].ai[2] = npc.whoAmI; + Main.npc[lol].ai[1] = Previous; + Main.npc[Previous].ai[0] = lol; npc.netUpdate = true; Previous = lol; } tail = true; } - int damage = expertMode ? 62 : 75; if (expertMode) { npc.localAI[0] += 1f; @@ -157,7 +156,9 @@ namespace CalamityMod.NPCs.StormWeaver npc.netUpdate = true; float xPos = Main.rand.NextBool(2) ? Main.player[npc.target].position.X + 500f : Main.player[npc.target].position.X - 500f; Vector2 spawnPos = new Vector2(xPos, Main.player[npc.target].position.Y + Main.rand.Next(-500, 501)); - Projectile.NewProjectile(spawnPos, Vector2.Zero, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); + int type = ProjectileID.CultistBossLightningOrb; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(spawnPos, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -175,7 +176,7 @@ namespace CalamityMod.NPCs.StormWeaver { speed2 += 1; } - float spawnX2 = (float)Main.rand.Next(2001) - 1000f + Main.player[npc.target].Center.X; + float spawnX2 = Main.rand.Next(2001) - 1000f + Main.player[npc.target].Center.X; float spawnY2 = -1000f + Main.player[npc.target].Center.Y; Vector2 baseSpawn = new Vector2(spawnX2, spawnY2); Vector2 baseVelocity = Main.player[npc.target].Center - baseSpawn; @@ -186,11 +187,13 @@ namespace CalamityMod.NPCs.StormWeaver { Vector2 source = baseSpawn; source.X += i * 30 - (BoltProjectiles * 15); - Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-BoltAngleSpread / 2 + (BoltAngleSpread * i / (float)BoltProjectiles))); + Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-BoltAngleSpread / 2 + (BoltAngleSpread * i / BoltProjectiles))); velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; Vector2 vector94 = Main.player[npc.target].Center - source; - float ai = (float)Main.rand.Next(100); - Projectile.NewProjectile(source, velocity, ProjectileID.CultistBossLightningOrbArc, damage, 0f, Main.myPlayer, vector94.ToRotation(), ai); + float ai = Main.rand.Next(100); + int type = ProjectileID.CultistBossLightningOrbArc; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(source, velocity, type, damage, 0f, Main.myPlayer, vector94.ToRotation(), ai); } } } diff --git a/NPCs/StormWeaver/StormWeaverHeadNaked.cs b/NPCs/StormWeaver/StormWeaverHeadNaked.cs index 300a7077b3..ea1ccce7b1 100644 --- a/NPCs/StormWeaver/StormWeaverHeadNaked.cs +++ b/NPCs/StormWeaver/StormWeaverHeadNaked.cs @@ -115,7 +115,6 @@ namespace CalamityMod.NPCs.StormWeaver double lifeRatio = npc.life / (double)npc.lifeMax; int lifePercentage = (int)(100.0 * lifeRatio); - int projectileDamage = expertMode ? 62 : 75; int BoltProjectiles = 2; if (lifePercentage < 33 || death) @@ -191,7 +190,9 @@ namespace CalamityMod.NPCs.StormWeaver npc.netUpdate = true; float xPos = Main.rand.NextBool(2) ? Main.player[npc.target].position.X + 500f : Main.player[npc.target].position.X - 500f; Vector2 spawnPos = new Vector2(xPos, Main.player[npc.target].position.Y + Main.rand.Next(-500, 501)); - Projectile.NewProjectile(spawnPos, Vector2.Zero, ProjectileID.CultistBossLightningOrb, projectileDamage, 0f, Main.myPlayer, 0f, 0f); + int type = ProjectileID.CultistBossLightningOrb; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(spawnPos, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -367,7 +368,9 @@ namespace CalamityMod.NPCs.StormWeaver velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; Vector2 vector94 = Main.player[npc.target].Center - source; float ai = Main.rand.Next(100); - Projectile.NewProjectile(source, velocity, ProjectileID.CultistBossLightningOrbArc, projectileDamage, 0f, Main.myPlayer, vector94.ToRotation(), ai); + int type = ProjectileID.CultistBossLightningOrbArc; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(source, velocity, type, damage, 0f, Main.myPlayer, vector94.ToRotation(), ai); } } diff --git a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs index 8d93a0c6c9..23b3e257ed 100644 --- a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs +++ b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs @@ -119,14 +119,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (npc.localAI[0] >= 900f) { npc.localAI[0] = 0f; - int damage = Main.expertMode ? 150 : 200; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); int totalProjectiles = 4; float radians = MathHelper.TwoPi / totalProjectiles; Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f)); for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index f9952ccbd7..13a3f49ff0 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -65,8 +65,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (Main.netMode != NetmodeID.MultiplayerClient) { - int damage = expertMode ? 150 : 200; //600 500 - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X, direction.Y, ModContent.ProjectileType(), damage, 1f, npc.target); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X, direction.Y, type, damage, 1f, npc.target); } timer = 0; } diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 4368a85ce8..320c783d94 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -202,6 +202,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { #region StartUp CalamityGlobalNPC.SCal = npc.whoAmI; + lootTimer++; bool wormAlive = false; @@ -209,11 +210,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas { wormAlive = Main.npc[CalamityGlobalNPC.SCalWorm].active; } + bool cataclysmAlive = false; if (CalamityGlobalNPC.SCalCataclysm != -1) { cataclysmAlive = Main.npc[CalamityGlobalNPC.SCalCataclysm].active; } + bool catastropheAlive = false; if (CalamityGlobalNPC.SCalCatastrophe != -1) { @@ -225,12 +228,24 @@ namespace CalamityMod.NPCs.SupremeCalamitas Main.StopSlimeRain(true); CalamityNetcode.SyncWorld(); } + CalamityMod.StopRain(); bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool enraged = npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive); + + // Projectile damage values + int bulletHellblastDamage = npc.GetProjectileDamage(ModContent.ProjectileType()); + int firstBulletHellblastDamage = (int)Math.Round(bulletHellblastDamage * 1.25); + int barrageDamage = npc.GetProjectileDamage(ModContent.ProjectileType()); + int gigablastDamage = npc.GetProjectileDamage(ModContent.ProjectileType()); + int fireblastDamage = npc.GetProjectileDamage(ModContent.ProjectileType()); + int monsterDamage = npc.GetProjectileDamage(ModContent.ProjectileType()); + int waveDamage = npc.GetProjectileDamage(ModContent.ProjectileType()); + int hellblastDamage = npc.GetProjectileDamage(ModContent.ProjectileType()); + Vector2 vectorCenter = npc.Center; // Get a target @@ -267,6 +282,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } } + if (Main.LocalPlayer.Calamity().sCalDeathCount < 51) { if (Main.LocalPlayer.Calamity().sCalDeathCount == 50) @@ -451,21 +467,20 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (bulletHellCounter > (enraged ? 4 : 6)) { bulletHellCounter = 0; - int damage = expertMode ? 200 : 250; //800 500 if (bulletHellCounter2 < 300) //blasts from above { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } else if (bulletHellCounter2 < 600) //blasts from left and right { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } else //blasts from above, left, and right { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), firstBulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -524,27 +539,20 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - int damage = expertMode ? 150 : 200; //600 400 if (bulletHellCounter2 < 1200) { if (bulletHellCounter2 % 180 == 0) //blasts from top - { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - } + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer, 0f, 0f); } else if (bulletHellCounter2 < 1500 && bulletHellCounter2 > 1200) { if (bulletHellCounter2 % 180 == 0) //blasts from right - { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - } + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -5f * uDieLul, 0f, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer, 0f, 0f); } else if (bulletHellCounter2 > 1500) { if (bulletHellCounter2 % 180 == 0) //blasts from top - { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - } + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer, 0f, 0f); } bulletHellCounter += 1; if (bulletHellCounter > (enraged ? 7 : 9)) @@ -552,16 +560,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas bulletHellCounter = 0; if (bulletHellCounter2 < 1200) //blasts from below { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } else if (bulletHellCounter2 < 1500) //blasts from left { - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } else //blasts from left and right { - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -601,31 +609,28 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - int damage = expertMode ? 150 : 200; if (bulletHellCounter2 % 180 == 0) //blasts from top - { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - } + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer, 0f, 0f); + if (bulletHellCounter2 % 240 == 0) //fireblasts from above - { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - } + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), fireblastDamage, 0f, Main.myPlayer, 0f, 0f); + bulletHellCounter += 1; if (bulletHellCounter > (enraged ? 9 : 11)) { bulletHellCounter = 0; if (bulletHellCounter2 < 2100) //blasts from above { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } else if (bulletHellCounter2 < 2400) //blasts from right { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } else //blasts from left and right { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -670,37 +675,35 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) //more clustered attack { - int damage = expertMode ? 150 : 200; if (bulletHellCounter2 % 180 == 0) //blasts from top - { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - } + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer, 0f, 0f); + if (bulletHellCounter2 % 240 == 0) //fireblasts from above - { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - } + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), fireblastDamage, 0f, Main.myPlayer, 0f, 0f); + int divisor = revenge ? 225 : expertMode ? 450 : 675; if (bulletHellCounter2 % divisor == 0 && expertMode) //giant homing fireballs { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 1f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, passedVar); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 1f * uDieLul, ModContent.ProjectileType(), monsterDamage, 0f, Main.myPlayer, 0f, passedVar); passedVar += 1f; } + bulletHellCounter += 1; if (bulletHellCounter > (enraged ? 10 : 12)) { bulletHellCounter = 0; if (bulletHellCounter2 < 3000) //blasts from below { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } else if (bulletHellCounter2 < 3300) //blasts from left { - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } else //blasts from left and right { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -745,39 +748,37 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - int damage = expertMode ? 150 : 200; if (bulletHellCounter2 % 240 == 0) //blasts from top - { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - } + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), gigablastDamage, 0f, Main.myPlayer, 0f, 0f); + if (bulletHellCounter2 % 360 == 0) //fireblasts from above - { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - } + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), fireblastDamage, 0f, Main.myPlayer, 0f, 0f); + if (bulletHellCounter2 % 30 == 0) //projectiles that move in wave pattern { int random = Main.rand.Next(-1000, 1001); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + random, -5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y - random, 5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + random, -5f * uDieLul, 0f, ModContent.ProjectileType(), waveDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y - random, 5f * uDieLul, 0f, ModContent.ProjectileType(), waveDamage, 0f, Main.myPlayer, 0f, 0f); } + bulletHellCounter += 1; if (bulletHellCounter > (enraged ? 12 : 14)) { bulletHellCounter = 0; if (bulletHellCounter2 < 3900) //blasts from above { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } else if (bulletHellCounter2 < 4200) //blasts from left and right { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } else //blasts from above, left, and right { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), bulletHellblastDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -1320,9 +1321,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (npc.localAI[1] > 90f) { npc.localAI[1] = 0f; - float num828 = 10f * uDieLul; - int num829 = expertMode ? 150 : 200; //600 400 + float num828 = 10f * uDieLul; Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num180 = player.position.X + player.width * 0.5f - value9.X; float num181 = Math.Abs(num180) * 0.1f; @@ -1346,7 +1346,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num826 *= num827; vector82.X += num825 * 8f; vector82.Y += num826 * 8f; - Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, fireblastDamage, 0f, Main.myPlayer, 0f, 0f); } else if (randomShot == 1 && canFireSplitingFireball) { @@ -1358,7 +1358,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num826 *= num827; vector82.X += num825 * 8f; vector82.Y += num826 * 8f; - Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, gigablastDamage, 0f, Main.myPlayer, 0f, 0f); } else { @@ -1373,7 +1373,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num183 = (8f + speedBoost) / num183; num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180 + speedBoost, num182 + speedBoost, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180 + speedBoost, num182 + speedBoost, randomShot, barrageDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -1515,7 +1515,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { float num418 = 10f * uDieLul; - int num419 = expertMode ? 150 : 200; //600 500 int num420 = ModContent.ProjectileType(); num417 = (float)Math.Sqrt(num415 * num415 + num416 * num416); num417 = num418 / num417; @@ -1523,7 +1522,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num416 *= num417; vector40.X += num415 * 4f; vector40.Y += num416 * 4f; - Projectile.NewProjectile(vector40.X, vector40.Y, num415, num416, num420, num419, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector40.X, vector40.Y, num415, num416, num420, hellblastDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -1593,7 +1592,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas { npc.localAI[1] = 0f; float num837 = 5f * uDieLul; - int num838 = expertMode ? 150 : 200; //600 500 int num839 = ModContent.ProjectileType(); num836 = (float)Math.Sqrt(num834 * num834 + num835 * num835); num836 = num837 / num836; @@ -1601,7 +1599,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num835 *= num836; vector83.X += num834 * 8f; vector83.Y += num835 * 8f; - Projectile.NewProjectile(vector83.X, vector83.Y, num834, num835, num839, num838, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector83.X, vector83.Y, num834, num835, num839, fireblastDamage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1865,9 +1863,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (npc.localAI[1] > 60f) { npc.localAI[1] = 0f; - float num828 = 10f * uDieLul; - int num829 = expertMode ? 150 : 200; //600 500 + float num828 = 10f * uDieLul; Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num180 = player.position.X + player.width * 0.5f - value9.X; float num181 = Math.Abs(num180) * 0.1f; @@ -1891,7 +1888,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num826 *= num827; vector82.X += num825 * 8f; vector82.Y += num826 * 8f; - Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, fireblastDamage, 0f, Main.myPlayer, 0f, 0f); } else if (randomShot == 1 && canFireSplitingFireball) { @@ -1903,7 +1900,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num826 *= num827; vector82.X += num825 * 8f; vector82.Y += num826 * 8f; - Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, gigablastDamage, 0f, Main.myPlayer, 0f, 0f); } else { @@ -1918,7 +1915,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num183 = (8f + speedBoost) / num183; num180 *= num183; num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180 + speedBoost, num182 + speedBoost, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180 + speedBoost, num182 + speedBoost, randomShot, barrageDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -2056,7 +2053,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { float num418 = 10f * uDieLul; - int num419 = expertMode ? 150 : 200; //600 500 int num420 = ModContent.ProjectileType(); num417 = (float)Math.Sqrt(num415 * num415 + num416 * num416); num417 = num418 / num417; @@ -2064,7 +2060,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num416 *= num417; vector40.X += num415 * 4f; vector40.Y += num416 * 4f; - Projectile.NewProjectile(vector40.X, vector40.Y, num415, num416, num420, num419, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector40.X, vector40.Y, num415, num416, num420, hellblastDamage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -2134,7 +2130,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas { npc.localAI[1] = 0f; float num837 = 5f * uDieLul; - int num838 = expertMode ? 150 : 200; //600 500 int num839 = ModContent.ProjectileType(); num836 = (float)Math.Sqrt(num834 * num834 + num835 * num835); num836 = num837 / num836; @@ -2142,7 +2137,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num835 *= num836; vector83.X += num834 * 8f; vector83.Y += num835 * 8f; - int shot = Projectile.NewProjectile(vector83.X, vector83.Y, num834, num835, num839, num838, 0f, Main.myPlayer, 0f, 0f); + int shot = Projectile.NewProjectile(vector83.X, vector83.Y, num834, num835, num839, fireblastDamage, 0f, Main.myPlayer, 0f, 0f); } } diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 430eeb1785..c4f1882d47 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -157,11 +157,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.ai[1] = 0f; Vector2 vector85 = new Vector2(npc.Center.X, npc.Center.Y); float num689 = -8f; - int num690 = expertMode ? 150 : 200; //600 500 - int num691 = ModContent.ProjectileType(); if (Main.netMode != NetmodeID.MultiplayerClient) { - int num695 = Projectile.NewProjectile(vector85.X, vector85.Y, num689, 0f, num691, num690, 0f, Main.myPlayer, 0f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(vector85.X, vector85.Y, num689, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); } } npc.ai[2] += 1f; @@ -173,20 +173,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas { npc.ai[2] = 0f; float num689 = 7f; - int num690 = expertMode ? 150 : 200; //600 500 Main.PlaySound(SoundID.Item20, npc.position); float spread = 45f * 0.0174f; double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; int i; - if (Main.netMode != NetmodeID.MultiplayerClient) + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + if (Main.netMode != NetmodeID.MultiplayerClient) { for (i = 0; i < 8; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * num689), (float)(Math.Cos(offsetAngle) * num689), ModContent.ProjectileType(), num690, 0f, Main.myPlayer, 0f, 1f); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(-Math.Sin(offsetAngle) * num689), (float)(-Math.Cos(offsetAngle) * num689), ModContent.ProjectileType(), num690, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * num689), (float)(Math.Cos(offsetAngle) * num689), type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(-Math.Sin(offsetAngle) * num689), (float)(-Math.Cos(offsetAngle) * num689), type, damage, 0f, Main.myPlayer, 0f, 1f); } } for (int dust = 0; dust <= 5; dust++) diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 1640fea478..15e0e8432e 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -157,11 +157,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.ai[1] = 0f; Vector2 vector85 = new Vector2(npc.Center.X, npc.Center.Y); float num689 = 4f; - int num690 = expertMode ? 150 : 200; //600 500 - int num691 = ModContent.ProjectileType(); - if (Main.netMode != NetmodeID.MultiplayerClient) + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + if (Main.netMode != NetmodeID.MultiplayerClient) { - int num695 = Projectile.NewProjectile(vector85.X, vector85.Y, num689, 0f, num691, num690, 0f, Main.myPlayer, 0f, 0f); + int num695 = Projectile.NewProjectile(vector85.X, vector85.Y, num689, 0f, type, damage, 0f, Main.myPlayer, 0f, 0f); } } npc.ai[2] += 1f; @@ -173,20 +173,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas { npc.ai[2] = 0f; float num689 = 7f; - int num690 = expertMode ? 150 : 200; //600 500 Main.PlaySound(SoundID.Item20, npc.position); float spread = 45f * 0.0174f; double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; int i; - if (Main.netMode != NetmodeID.MultiplayerClient) + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + if (Main.netMode != NetmodeID.MultiplayerClient) { for (i = 0; i < 8; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * num689), (float)(Math.Cos(offsetAngle) * num689), ModContent.ProjectileType(), num690, 0f, Main.myPlayer, 0f, 1f); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(-Math.Sin(offsetAngle) * num689), (float)(-Math.Cos(offsetAngle) * num689), ModContent.ProjectileType(), num690, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * num689), (float)(Math.Cos(offsetAngle) * num689), type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(-Math.Sin(offsetAngle) * num689), (float)(-Math.Cos(offsetAngle) * num689), type, damage, 0f, Main.myPlayer, 0f, 1f); } } for (int dust = 0; dust <= 5; dust++) diff --git a/NPCs/Yharon/DetonatingFlare.cs b/NPCs/Yharon/DetonatingFlare.cs index 0f592f04b0..4eed6dbf6f 100644 --- a/NPCs/Yharon/DetonatingFlare.cs +++ b/NPCs/Yharon/DetonatingFlare.cs @@ -164,9 +164,9 @@ namespace CalamityMod.NPCs.Yharon npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { - int num8 = Main.expertMode ? 75 : 90; - int num9 = ProjectileID.CultistBossFireBall; - Projectile.NewProjectile(vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); + int type = ProjectileID.CultistBossFireBall; + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(vector.X, vector.Y, num4, num5, type, damage, 0f, Main.myPlayer, 0f, 0f); } } int num10 = (int)npc.position.X + npc.width / 2; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index dd3f374012..ad938e099a 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -351,7 +351,6 @@ namespace CalamityMod.NPCs.Yharon float teleportPhaseTimer = 30f; Vector2 vectorCenter = npc.Center; int spawnPhaseTimer = 75; - int projectileDamage = expertMode ? 75 : 90; // Target if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -700,7 +699,9 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { SpawnDetonatingFlares(fromMouth, player, maxFlareCount, new int[] { ModContent.NPCType() }); - Projectile.NewProjectile(fromMouth, Vector2.Zero, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(fromMouth, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -999,7 +1000,7 @@ namespace CalamityMod.NPCs.Yharon { SpawnDetonatingFlares(flareDustBulletHellSpawn, player, maxFlareCount, new int[] { ModContent.NPCType() }); int totalProjectiles = 38 - (int)(npc.ai[2] / 15f); // 36 for first ring, 18 for last ring - DoFlareDustBulletHell(0, flareDustSpawnDivisor, projectileDamage, totalProjectiles, 0f, 0f, false); + DoFlareDustBulletHell(0, flareDustSpawnDivisor, npc.GetProjectileDamage(ModContent.ProjectileType()), totalProjectiles, 0f, 0f, false); } } @@ -1089,7 +1090,9 @@ namespace CalamityMod.NPCs.Yharon Vector2 projectileVelocity = player.Center - fromMouth; projectileVelocity.Normalize(); projectileVelocity *= 0.1f; - Projectile.NewProjectile(fromMouth, projectileVelocity, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1332,7 +1335,7 @@ namespace CalamityMod.NPCs.Yharon // Rotate spiral by 7.2 * (300 / 12) = +90 degrees and then back -90 degrees if (Main.netMode != NetmodeID.MultiplayerClient) - DoFlareDustBulletHell(1, flareDustPhaseTimer, projectileDamage, 8, 12f, 3.6f, false); + DoFlareDustBulletHell(1, flareDustPhaseTimer, npc.GetProjectileDamage(ModContent.ProjectileType()), 8, 12f, 3.6f, false); } npc.velocity = npc.velocity.RotatedBy(-(double)spinPhaseRotation * (float)npc.direction); @@ -1424,7 +1427,9 @@ namespace CalamityMod.NPCs.Yharon Vector2 projectileVelocity = player.Center - fromMouth; projectileVelocity.Normalize(); projectileVelocity *= 0.1f; - Projectile.NewProjectile(fromMouth, projectileVelocity, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1459,7 +1464,9 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { SpawnDetonatingFlares(fromMouth, player, maxFlareCount, new int[] { ModContent.NPCType(), ModContent.NPCType() }); - Projectile.NewProjectile(fromMouth, Vector2.Zero, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(fromMouth, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1620,7 +1627,6 @@ namespace CalamityMod.NPCs.Yharon if (bulletHell) npc.damage = 0; - int projectileDamage = expertMode ? 110 : 125; float phaseSwitchTimer = expertMode ? 30f : 32f; float acceleration = expertMode ? 0.92f : 0.9f; float velocity = expertMode ? 14.5f : 14f; @@ -2051,7 +2057,9 @@ namespace CalamityMod.NPCs.Yharon Vector2 projectileVelocity = targetData.Center - position; projectileVelocity.Normalize(); projectileVelocity *= 0.1f; - Projectile.NewProjectile(position, projectileVelocity, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 1f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(position, projectileVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); } if (Math.Abs(targetData.Center.X - npc.Center.X) > 700f && Math.Abs(npc.velocity.X) < chargeSpeed) @@ -2108,8 +2116,10 @@ namespace CalamityMod.NPCs.Yharon Vector2 position = npc.Center + new Vector2((110f + xOffset) * npc.direction, -20f).RotatedBy(npc.rotation); int num34 = (int)(npc.ai[1] - splittingFireballBreathTimer + 1f); - if (num34 <= splittingFireballBreathTimer2 && num34 % splittingFireballBreathDivisor == 0 && Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(position, npc.velocity, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + if (num34 <= splittingFireballBreathTimer2 && num34 % splittingFireballBreathDivisor == 0 && Main.netMode != NetmodeID.MultiplayerClient) + Projectile.NewProjectile(position, npc.velocity, type, damage, 0f, Main.myPlayer, 0f, 0f); } if (npc.ai[1] > splittingFireballBreathPhaseTimer - splittingFireballBreathYVelocityTimer) @@ -2150,7 +2160,7 @@ namespace CalamityMod.NPCs.Yharon int totalProjectiles = secondPhasePhase == 4 ? 12 : 10; float projectileVelocity = secondPhasePhase == 4 ? 16f : 12f; float radialOffset = secondPhasePhase == 4 ? 2.8f : 3.2f; - DoFlareDustBulletHell(1, (int)spinPhaseTimer, projectileDamage, totalProjectiles, projectileVelocity, radialOffset, true); + DoFlareDustBulletHell(1, (int)spinPhaseTimer, npc.GetProjectileDamage(ModContent.ProjectileType()), totalProjectiles, projectileVelocity, radialOffset, true); } } else @@ -2158,7 +2168,7 @@ namespace CalamityMod.NPCs.Yharon if (npc.ai[1] % flareDustSpawnDivisor == 0f) { int totalProjectiles = (secondPhasePhase == 2 ? 42 : 38) - (int)(npc.ai[1] / 12f); // 36 for first ring, 18 for last ring - DoFlareDustBulletHell(0, (int)spinPhaseTimer, projectileDamage, totalProjectiles, 0f, 0f, true); + DoFlareDustBulletHell(0, (int)spinPhaseTimer, npc.GetProjectileDamage(ModContent.ProjectileType()), totalProjectiles, 0f, 0f, true); } } @@ -2220,7 +2230,7 @@ namespace CalamityMod.NPCs.Yharon Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); if (expertMode) - DoFireRing(300, projectileDamage, 1f); + DoFireRing(300, npc.GetProjectileDamage(ModContent.ProjectileType()), 1f); Vector2 vector7 = npc.Center + (MathHelper.TwoPi * Main.rand.NextFloat()).ToRotationVector2() * new Vector2(2f, 1f) * 100f * (0.6f + Main.rand.NextFloat() * 0.4f); diff --git a/Projectiles/Boss/BirbAuraFlare.cs b/Projectiles/Boss/BirbAuraFlare.cs index 31286e3db9..adf3795a60 100644 --- a/Projectiles/Boss/BirbAuraFlare.cs +++ b/Projectiles/Boss/BirbAuraFlare.cs @@ -117,7 +117,8 @@ namespace CalamityMod.Projectiles.Boss float x = num232 * 16; float y = num231 * 16 + 900; Vector2 laserVelocity = new Vector2(x, 160f) - new Vector2(x, y); - int damage = Main.expertMode ? 75 : 100; + int type = ModContent.ProjectileType(); + int damage = projectile.GetProjectileDamage(type); if (projectile.ai[0] >= 2f) { x += 1000f; @@ -127,7 +128,7 @@ namespace CalamityMod.Projectiles.Boss } laserVelocity = new Vector2(x, 160f) - new Vector2(x, y); laserVelocity.Normalize(); - int num237 = Projectile.NewProjectile(x, y, 0f, laserVelocity.Y, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, x, y); + int num237 = Projectile.NewProjectile(x, y, 0f, laserVelocity.Y, type, damage, 0f, Main.myPlayer, x, y); Main.projectile[num237].timeLeft = 900; Main.projectile[num237].netUpdate = true; @@ -138,14 +139,14 @@ namespace CalamityMod.Projectiles.Boss } laserVelocity = new Vector2(x, 160f) - new Vector2(x, y); laserVelocity.Normalize(); - int num238 = Projectile.NewProjectile(x, y, 0f, laserVelocity.Y, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, x, y); + int num238 = Projectile.NewProjectile(x, y, 0f, laserVelocity.Y, type, damage, 0f, Main.myPlayer, x, y); Main.projectile[num238].timeLeft = 900; Main.projectile[num238].netUpdate = true; } else { laserVelocity.Normalize(); - int num236 = Projectile.NewProjectile(x, y, 0f, laserVelocity.Y, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, x, y); + int num236 = Projectile.NewProjectile(x, y, 0f, laserVelocity.Y, type, damage, 0f, Main.myPlayer, x, y); Main.projectile[num236].netUpdate = true; } } diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index 8bbb9d2785..f6b3506b98 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -1,7 +1,8 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs.SupremeCalamitas; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; +using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -29,6 +30,16 @@ namespace CalamityMod.Projectiles.Boss cooldownSlot = 1; } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.localAI[0]); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.localAI[0] = reader.ReadSingle(); + } + public override void AI() { if (projectile.velocity.Length() < (projectile.ai[1] == 0f ? 14f : 10f)) @@ -48,6 +59,12 @@ namespace CalamityMod.Projectiles.Boss if (projectile.timeLeft < 60) projectile.Opacity = MathHelper.Clamp(projectile.timeLeft / 60f, 0f, 1f); + if (projectile.localAI[0] == 0f) + { + projectile.localAI[0] = 1f; + projectile.damage = projectile.GetProjectileDamage(ModContent.NPCType()); + } + Lighting.AddLight(projectile.Center, 0.75f, 0f, 0f); } diff --git a/Projectiles/Boss/BrimstoneFireblast.cs b/Projectiles/Boss/BrimstoneFireblast.cs index bf53bdbcdb..42e834cfa3 100644 --- a/Projectiles/Boss/BrimstoneFireblast.cs +++ b/Projectiles/Boss/BrimstoneFireblast.cs @@ -29,45 +29,41 @@ namespace CalamityMod.Projectiles.Boss cooldownSlot = 1; } - public override void AI() - { - projectile.frameCounter++; - if (projectile.frameCounter > 4) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 5) - projectile.frame = 0; + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 5) + projectile.frame = 0; if (projectile.ai[1] == 1f) projectile.Opacity = MathHelper.Clamp(projectile.timeLeft / 60f, 0f, 1f); else projectile.Opacity = MathHelper.Clamp(1f - ((projectile.timeLeft - 60) / 60f), 0f, 1f); - Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.9f / 255f, 0f, 0f); + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.9f / 255f, 0f, 0f); - projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; - if (projectile.localAI[0] == 0f) - { - projectile.localAI[0] = 1f; - Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); - } + if (projectile.localAI[0] == 0f) + { + projectile.localAI[0] = 1f; + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); + } - int target = Player.FindClosest(projectile.Center, 1, 1); - projectile.ai[0] += 1f; - if (projectile.ai[0] > 20f) - { - float projSpeed = projectile.velocity.Length(); - Vector2 playerVec = Main.player[target].Center - projectile.Center; - playerVec.Normalize(); - playerVec *= projSpeed; - projectile.velocity = (projectile.velocity * 24f + playerVec) / 25f; - projectile.velocity.Normalize(); - projectile.velocity *= projSpeed; - } - } + int target = Player.FindClosest(projectile.Center, 1, 1); + float projSpeed = projectile.velocity.Length(); + Vector2 playerVec = Main.player[target].Center - projectile.Center; + playerVec.Normalize(); + playerVec *= projSpeed; + projectile.velocity = (projectile.velocity * 24f + playerVec) / 25f; + projectile.velocity.Normalize(); + projectile.velocity *= projSpeed; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/Boss/BrimstoneGigaBlast.cs b/Projectiles/Boss/BrimstoneGigaBlast.cs index 4134292304..4d28465b1c 100644 --- a/Projectiles/Boss/BrimstoneGigaBlast.cs +++ b/Projectiles/Boss/BrimstoneGigaBlast.cs @@ -58,8 +58,8 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); } - float turnSpeed = revenge ? 100f : 80f; //100 - float homeSpeed = revenge ? 20f : 15f; //5 + float inertia = revenge ? 80f : 100f; + float homeSpeed = revenge ? 20f : 15f; float minDist = 40f; int target = (int)projectile.ai[0]; if (target >= 0 && Main.player[target].active && !Main.player[target].dead) @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Boss if (targetVec.HasNaNs()) targetVec = Vector2.UnitY; - projectile.velocity = (projectile.velocity * (turnSpeed - 1f) + targetVec * homeSpeed) / turnSpeed; + projectile.velocity = (projectile.velocity * (inertia - 1f) + targetVec * homeSpeed) / inertia; } } else diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index 819a2fb92d..d192f64655 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -95,13 +95,13 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(projectile.Center, 3f, 0f, 0f); - float inertia = (revenge ? 5f : 4.5f) + speedAdd; //100 - float speed = (revenge ? 1.5f : 1.35f) + (speedAdd * 0.25f); //5 + float inertia = (revenge ? 4.5f : 5f) + speedAdd; + float speed = (revenge ? 1.5f : 1.35f) + (speedAdd * 0.25f); float minDist = 160f; if (NPC.AnyNPCs(ModContent.NPCType())) { - inertia *= 0.5f; + inertia *= 1.5f; speed *= 0.5f; } diff --git a/Projectiles/Boss/DoGBeam.cs b/Projectiles/Boss/DoGBeam.cs index 2a4bac8ce4..5e44817202 100644 --- a/Projectiles/Boss/DoGBeam.cs +++ b/Projectiles/Boss/DoGBeam.cs @@ -1,3 +1,4 @@ +using CalamityMod.NPCs.CeaselessVoid; using Microsoft.Xna.Framework; using System; using Terraria; @@ -51,9 +52,8 @@ namespace CalamityMod.Projectiles.Boss projectile.velocity.Normalize(); projectile.velocity *= scaleFactor2; } - int projectileDamage = Main.expertMode ? 64 : 75; if (projectile.timeLeft == 950) - projectile.damage = projectileDamage; + projectile.damage = (int)projectile.ai[0]; if (projectile.timeLeft < 85) projectile.damage = 0; } diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index ff16a68eea..7388372020 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -59,7 +59,6 @@ namespace CalamityMod.Projectiles.Boss if (projectile.owner == Main.myPlayer) { float speed = 3f; - int seeProjFileforDmg = 0; if (CalamityWorld.death) { speed = 5f; @@ -78,7 +77,7 @@ namespace CalamityMod.Projectiles.Boss for (int i = 0; i < totalProjectiles; i++) { Vector2 vector255 = new Vector2(0f, -speed).RotatedBy(radians * i); - Projectile.NewProjectile(projectile.Center, vector255, ModContent.ProjectileType(), seeProjFileforDmg, 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, vector255, ModContent.ProjectileType(), 0, 0f, projectile.owner, projectile.damage, 0f); } } beamTimer = 180; diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index 36edf06b2e..372ee918df 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[0] == 0f || (projectile.timeLeft > 135 && projectile.ai[1] == 1f)) return; - float num953 = revenge ? 77f : 70f; + float inertia = revenge ? 70f : 77f; float num954 = 40f; float scaleFactor12 = revenge ? 35f : 28f; int num959 = (int)projectile.ai[0]; @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Boss { vector102 = Vector2.UnitY; } - projectile.velocity = (projectile.velocity * (num953 - 1f) + vector102 * scaleFactor12) / num953; + projectile.velocity = (projectile.velocity * (inertia - 1f) + vector102 * scaleFactor12) / inertia; } } else diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 14fc375b1b..ace5b89783 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -144,7 +144,6 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num624].velocity *= 2f; } CalamityUtils.ExplosionGores(projectile.Center, 3); - projectile.damage = Main.expertMode ? 75 : 90; projectile.Damage(); } diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index 1829441a28..6a56f91f40 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs.Yharon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -126,9 +127,8 @@ namespace CalamityMod.Projectiles.Boss projectile.position.X = projectile.position.X + num624 * (float)-(float)projectile.direction; } - int damage = Main.expertMode ? 85 : 100; if (projectile.timeLeft == 480) - projectile.damage = damage; + projectile.damage = projectile.GetProjectileDamage(ModContent.NPCType()); } public override bool CanHitPlayer(Player target) diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index e6e69c59f7..3834cc465a 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.NPCs.Providence; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -45,6 +46,10 @@ namespace CalamityMod.Projectiles.Boss projectile.velocity.X *= 1.05f; } int num103 = Player.FindClosest(projectile.Center, 1, 1); + if (projectile.ai[1] == 0f) + { + projectile.damage = projectile.GetProjectileDamage(ModContent.NPCType()); + } projectile.ai[1] += 1f; if (projectile.ai[1] < 180f && projectile.ai[1] > 60f) { diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index 8aeb0720a9..930473764e 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs.Yharon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -127,10 +128,9 @@ namespace CalamityMod.Projectiles.Boss projectile.position.X = projectile.position.X + num624 * (float)-(float)projectile.direction; } - int damage = Main.expertMode ? 130 : 150; if (projectile.timeLeft == 600) - projectile.damage = damage; - } + projectile.damage = projectile.GetProjectileDamage(ModContent.NPCType()); + } public override bool CanHitPlayer(Player target) { diff --git a/Projectiles/Boss/Infernado2.cs b/Projectiles/Boss/Infernado2.cs index 13b5e3550e..247820d94c 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs.Yharon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -127,10 +128,9 @@ namespace CalamityMod.Projectiles.Boss projectile.position.X = projectile.position.X + num624 * (float)-(float)projectile.direction; } - int damage = Main.expertMode ? 130 : 150; if (projectile.timeLeft == 720) - projectile.damage = damage; - } + projectile.damage = projectile.GetProjectileDamage(ModContent.NPCType()); + } public override bool CanHitPlayer(Player target) { diff --git a/Projectiles/Boss/RavagerFlame.cs b/Projectiles/Boss/RavagerFlame.cs index 7bbbeeb4f9..d0cba9dd08 100644 --- a/Projectiles/Boss/RavagerFlame.cs +++ b/Projectiles/Boss/RavagerFlame.cs @@ -21,8 +21,9 @@ namespace CalamityMod.Projectiles.Boss projectile.tileCollide = false; projectile.alpha = 255; projectile.penetrate = 1; - projectile.timeLeft = 180; + projectile.timeLeft = 300; projectile.aiStyle = 1; + projectile.extraUpdates = 1; } public override void AI() diff --git a/Projectiles/Boss/ScavengerLaser.cs b/Projectiles/Boss/ScavengerLaser.cs index 43a231b491..ae9fafc189 100644 --- a/Projectiles/Boss/ScavengerLaser.cs +++ b/Projectiles/Boss/ScavengerLaser.cs @@ -45,6 +45,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + projectile.frameCounter++; if (projectile.frameCounter > 5) { @@ -52,14 +53,30 @@ namespace CalamityMod.Projectiles.Boss projectile.frameCounter = 0; } if (projectile.frame > 4) - { projectile.frame = 0; - } + projectile.alpha -= 40; if (projectile.alpha < 0) - { projectile.alpha = 0; - } + + if (projectile.alpha < 40) + { + int num805 = Dust.NewDust(projectile.Center - Vector2.One * 5f, 10, 10, 244, -projectile.velocity.X / 3f, -projectile.velocity.Y / 3f, 150, Color.Transparent, 0.6f); + Main.dust[num805].noGravity = true; + } + + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + + if (projectile.ai[1] == -1f) + { + if (projectile.velocity.Length() < 16f) + projectile.velocity *= 1.05f; + else + projectile.tileCollide = true; + + return; + } + if (projectile.ai[0] == 0f) { projectile.localAI[0] += 1f; @@ -67,20 +84,18 @@ namespace CalamityMod.Projectiles.Boss { projectile.localAI[0] = 0f; projectile.ai[0] = 1f; - projectile.ai[1] = (float)Player.FindClosest(projectile.position, projectile.width, projectile.height); + projectile.ai[1] = Player.FindClosest(projectile.position, projectile.width, projectile.height); projectile.netUpdate = true; } + projectile.velocity.X = projectile.velocity.RotatedBy(0.0, default).X; projectile.velocity.X = MathHelper.Clamp(projectile.velocity.X, -6f, 6f); + projectile.velocity.Y = projectile.velocity.Y - 0.08f; if (projectile.velocity.Y > 0f) - { projectile.velocity.Y = projectile.velocity.Y - 0.2f; - } if (projectile.velocity.Y < -7f) - { projectile.velocity.Y = -7f; - } } else if (projectile.ai[0] == 1f) { @@ -89,78 +104,63 @@ namespace CalamityMod.Projectiles.Boss projectile.ai[0] = 2f; projectile.netUpdate = true; } + projectile.velocity.X = projectile.velocity.RotatedBy(0.0, default).X; projectile.velocity.X = MathHelper.Clamp(projectile.velocity.X, -6f, 6f); + projectile.velocity.Y = projectile.velocity.Y - 0.08f; if (projectile.velocity.Y > 0f) - { projectile.velocity.Y = projectile.velocity.Y - 0.2f; - } if (projectile.velocity.Y < -7f) - { projectile.velocity.Y = -7f; - } } else if (projectile.ai[0] == 2f) { if (Main.player[(int)projectile.ai[1]].Center.Y < projectile.Center.Y) - { projectile.tileCollide = true; - } + float speed = revenge ? 9f : 7.5f; + Vector2 vector70 = Main.player[(int)projectile.ai[1]].Center - projectile.Center; if (vector70.Length() < 20f) { projectile.Kill(); return; } + vector70.Normalize(); vector70 *= 14f; vector70 = Vector2.Lerp(projectile.velocity, vector70, 0.6f); if (vector70.Y < speed) - { vector70.Y = speed; - } + float num804 = 0.4f; if (projectile.velocity.X < vector70.X) { projectile.velocity.X = projectile.velocity.X + num804; if (projectile.velocity.X < 0f && vector70.X > 0f) - { projectile.velocity.X = projectile.velocity.X + num804; - } } else if (projectile.velocity.X > vector70.X) { projectile.velocity.X = projectile.velocity.X - num804; if (projectile.velocity.X > 0f && vector70.X < 0f) - { projectile.velocity.X = projectile.velocity.X - num804; - } } + if (projectile.velocity.Y < vector70.Y) { projectile.velocity.Y = projectile.velocity.Y + num804; if (projectile.velocity.Y < 0f && vector70.Y > 0f) - { projectile.velocity.Y = projectile.velocity.Y + num804; - } } else if (projectile.velocity.Y > vector70.Y) { projectile.velocity.Y = projectile.velocity.Y - num804; if (projectile.velocity.Y > 0f && vector70.Y < 0f) - { projectile.velocity.Y = projectile.velocity.Y - num804; - } } } - if (projectile.alpha < 40) - { - int num805 = Dust.NewDust(projectile.Center - Vector2.One * 5f, 10, 10, 244, -projectile.velocity.X / 3f, -projectile.velocity.Y / 3f, 150, Color.Transparent, 0.6f); - Main.dust[num805].noGravity = true; - } - projectile.rotation = projectile.velocity.ToRotation() + 1.57079637f; } public override void OnHitPlayer(Player target, int damage, bool crit) @@ -184,8 +184,8 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); projectile.position = projectile.Center; projectile.width = projectile.height = 64; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - (projectile.width / 2); + projectile.position.Y = projectile.position.Y - (projectile.height / 2); for (int num193 = 0; num193 < 2; num193++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1.5f); diff --git a/Projectiles/Boss/ScavengerNuke.cs b/Projectiles/Boss/ScavengerNuke.cs index 1f5461a6e5..aec8e2cb1d 100644 --- a/Projectiles/Boss/ScavengerNuke.cs +++ b/Projectiles/Boss/ScavengerNuke.cs @@ -24,14 +24,14 @@ namespace CalamityMod.Projectiles.Boss projectile.tileCollide = false; projectile.penetrate = 1; projectile.alpha = 255; - projectile.timeLeft = 720; + projectile.timeLeft = 600; } public override void AI() { bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; projectile.ai[1] += 1f; - if (projectile.ai[1] > 480) + if (projectile.ai[1] > 420) { projectile.tileCollide = true; } @@ -45,9 +45,9 @@ namespace CalamityMod.Projectiles.Boss { projectile.frame = 0; } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - float num953 = revenge ? 75f : 60f; - float scaleFactor12 = revenge ? 15f : 12f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver2; + float inertia = revenge ? 90f : 110f; + float scaleFactor12 = revenge ? 16f : 12f; float num954 = 40f; if (projectile.alpha > 0) { @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Boss { vector102 = Vector2.UnitY; } - projectile.velocity = (projectile.velocity * (num953 - 1f) + vector102 * scaleFactor12) / num953; + projectile.velocity = (projectile.velocity * (inertia - 1f) + vector102 * scaleFactor12) / inertia; } } else diff --git a/Projectiles/Boss/SignusScythe.cs b/Projectiles/Boss/SignusScythe.cs index b367ebcf9b..0124bd51f5 100644 --- a/Projectiles/Boss/SignusScythe.cs +++ b/Projectiles/Boss/SignusScythe.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Boss projectile.hostile = true; projectile.tileCollide = false; projectile.ignoreWater = true; - projectile.timeLeft = 600; + projectile.timeLeft = 420; projectile.alpha = 100; projectile.penetrate = -1; cooldownSlot = 1; @@ -48,52 +48,28 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - projectile.rotation += 0.5f * (float)projectile.direction; + projectile.rotation += 0.5f * projectile.direction; + if (projectile.localAI[0] == 0f) { projectile.localAI[0] = 1f; Main.PlaySound(SoundID.Item73, projectile.position); } + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; + projectile.ai[0] += 1f; - if (projectile.ai[0] > 180f) + if (projectile.ai[0] >= 150f) { - if (projectile.ai[1] > 0f) + if (projectile.ai[1] > 0f && projectile.ai[0] < 160f) { int num625 = (int)projectile.ai[1] - 1; if (num625 < Main.maxPlayers) { Vector2 value16 = Main.player[num625].Center - projectile.Center; - if (value16.Length() < 200f || counter > 0) - { - counter--; - if (counter <= 0 && projectile.localAI[0] == 2f) - { - projectile.Kill(); - return; - } - if (projectile.localAI[0] < 2f) - { - projectile.localAI[0] = 2f; - float speed = 30f; - Vector2 vector167 = new Vector2(projectile.Center.X + (float)(projectile.direction * 20), projectile.Center.Y + 6f); - float num1373 = Main.player[num625].position.X + (float)Main.player[num625].width * 0.5f - vector167.X; - float num1374 = Main.player[num625].Center.Y - vector167.Y; - float num1375 = (float)Math.Sqrt((double)(num1373 * num1373 + num1374 * num1374)); - float num1376 = speed / num1375; - num1373 *= num1376; - num1374 *= num1376; - projectile.velocity.X = (projectile.velocity.X * 50f + num1373) / 51f; - projectile.velocity.Y = (projectile.velocity.Y * 50f + num1374) / 51f; - counter = 90; - } - } - else - { - projectile.velocity = Vector2.Normalize(value16) * 15f; - } + projectile.velocity = Vector2.Normalize(value16) * 20f; } } } @@ -105,8 +81,8 @@ namespace CalamityMod.Projectiles.Boss { projectile.localAI[1] += 1f; byte b2 = (byte)(((int)projectile.localAI[1]) * 3); - byte a2 = (byte)(projectile.alpha * ((float)b2 / 255f)); - return new Color((int)b2, (int)b2, (int)b2, (int)a2); + byte a2 = (byte)(projectile.alpha * (b2 / 255f)); + return new Color(b2, b2, b2, a2); } return new Color(255, 255, 255, projectile.alpha); } @@ -132,7 +108,7 @@ namespace CalamityMod.Projectiles.Boss if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 10; num623++) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 8307912f62..bf12029a56 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -337,9 +337,16 @@ namespace CalamityMod.Projectiles } } - // Large cthulhunadoes + else if (projectile.type == ProjectileID.Sharknado) + { + projectile.damage = projectile.GetProjectileDamage(NPCID.DukeFishron); + } + + // Larger cthulhunadoes else if (projectile.type == ProjectileID.Cthulunado) { + projectile.damage = projectile.GetProjectileDamage(NPCID.DukeFishron); + int num606 = 16; int num607 = 16; float num608 = 2f; @@ -688,7 +695,7 @@ namespace CalamityMod.Projectiles } if (projectile.velocity.X != 0f) { - projectile.direction = (projectile.spriteDirection = -Math.Sign(projectile.velocity.X)); + projectile.direction = projectile.spriteDirection = -Math.Sign(projectile.velocity.X); } projectile.frameCounter++; if (projectile.frameCounter > 2) @@ -705,18 +712,18 @@ namespace CalamityMod.Projectiles projectile.localAI[0] = 1f; projectile.position.X += projectile.width / 2; projectile.position.Y += projectile.height / 2; - projectile.scale = ((float)(num520 + num521) - projectile.ai[1]) * num522 / (float)(num521 + num520); - projectile.width = (int)((float)num523 * projectile.scale); - projectile.height = (int)((float)num524 * projectile.scale); + projectile.scale = (num520 + num521 - projectile.ai[1]) * num522 / (num521 + num520); + projectile.width = (int)(num523 * projectile.scale); + projectile.height = (int)(num524 * projectile.scale); projectile.position.X -= projectile.width / 2; projectile.position.Y -= projectile.height / 2; projectile.netUpdate = true; } if (projectile.ai[1] != -1f) { - projectile.scale = ((float)(num520 + num521) - projectile.ai[1]) * num522 / (float)(num521 + num520); - projectile.width = (int)((float)num523 * projectile.scale); - projectile.height = (int)((float)num524 * projectile.scale); + projectile.scale = (num520 + num521 - projectile.ai[1]) * num522 / (num521 + num520); + projectile.width = (int)(num523 * projectile.scale); + projectile.height = (int)(num524 * projectile.scale); } if (!Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { @@ -746,25 +753,25 @@ namespace CalamityMod.Projectiles { projectile.netUpdate = true; Vector2 center2 = projectile.Center; - center2.Y -= (float)num524 * projectile.scale / 2f; - float num525 = ((float)(num520 + num521) - projectile.ai[1] + 1f) * num522 / (float)(num521 + num520); - center2.Y -= (float)num524 * num525 / 2f; + center2.Y -= num524 * projectile.scale / 2f; + float num525 = (num520 + num521 - projectile.ai[1] + 1f) * num522 / (num521 + num520); + center2.Y -= num524 * num525 / 2f; center2.Y += 2f; Projectile.NewProjectile(center2, projectile.velocity, projectile.type, projectile.damage, projectile.knockBack, projectile.owner, 10f, projectile.ai[1] - 1f); } if (projectile.ai[0] <= 0f) { float num529 = (float)Math.PI / 30f; - float num530 = (float)projectile.width / 5f; + float num530 = projectile.width / 5f; if (projectile.type == ProjectileID.Cthulunado) { num530 *= 2f; } float num531 = (float)(Math.Cos(num529 * (-projectile.ai[0])) - 0.5) * num530; - projectile.position.X -= num531 * (float)(-projectile.direction); + projectile.position.X -= num531 * (-projectile.direction); projectile.ai[0] -= 1f; num531 = (float)(Math.Cos(num529 * (-projectile.ai[0])) - 0.5) * num530; - projectile.position.X += num531 * (float)(-projectile.direction); + projectile.position.X += num531 * (-projectile.direction); } return false; diff --git a/Projectiles/Typeless/YanmeisKnifeSlash.cs b/Projectiles/Typeless/YanmeisKnifeSlash.cs index a8411a64af..174ddf2585 100644 --- a/Projectiles/Typeless/YanmeisKnifeSlash.cs +++ b/Projectiles/Typeless/YanmeisKnifeSlash.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.NPCs.CeaselessVoid; +using CalamityMod.NPCs.DevourerofGods; using Microsoft.Xna.Framework; using System; using Terraria; @@ -13,7 +14,7 @@ namespace CalamityMod.Projectiles.Typeless public class YanmeisKnifeSlash : ModProjectile { // This is a rather weird thing, but it's what the patron asked for. - public static readonly Func CanRecieveCoolEffectsFrom = (npc) => (npc.boss && npc.type != ModContent.NPCType()) || CalamityLists.bossMinionList.Contains(npc.type) || CalamityLists.minibossList.Contains(npc.type) || AcidRainEvent.AllMinibosses.Contains(npc.type); + public static readonly Func CanRecieveCoolEffectsFrom = (npc) => (npc.boss && npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) || CalamityLists.bossMinionList.Contains(npc.type) || CalamityLists.minibossList.Contains(npc.type) || AcidRainEvent.AllMinibosses.Contains(npc.type); public override void SetStaticDefaults() { DisplayName.SetDefault("Yanmei's Knife"); diff --git a/Utilities/NPCStats.cs b/Utilities/NPCStats.cs index 3791d8553a..558db1614c 100644 --- a/Utilities/NPCStats.cs +++ b/Utilities/NPCStats.cs @@ -533,7 +533,7 @@ namespace CalamityMod 50, // 36 in rapid fire 92, // 68 in rapid fire 112, // 84 in rapid fire - 124, // 94 in rapid fire + 124, // 92 in rapid fire 168 } }, // 126 in rapid fire; 138 in non-rev master mode, 102 in rapid fire in non-rev master mode { new Tuple(NPCID.Retinazer, ModContent.ProjectileType()), new int[] { 0, 0, 120, 132, 180 } }, { new Tuple(NPCID.Spazmatism, ProjectileID.CursedFlameHostile), new int[] { 50, 88, 108, 120, 162 } }, // 132 in non-rev master mode @@ -576,14 +576,14 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 76, 120, 140, 152, 210 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 72, 116, 136, 144, 204 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 100, 108, 116, 162 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.PinkLaser), new int[] { 50, 88, 92, 100, 138 } }, + { new Tuple(ModContent.NPCType(), ProjectileID.PinkLaser), new int[] { 50, 88, 88, 88, 132 } }, { new Tuple(NPCID.Plantera, ProjectileID.SeedPlantera), new int[] { 44, 76, 96, 108, 144 } }, // 114 in non-rev master mode { new Tuple(NPCID.Plantera, ProjectileID.PoisonSeedPlantera), new int[] { 54, 96, 120, 132, 180 } }, // 144 in non-rev master mode { new Tuple(NPCID.Plantera, ProjectileID.ThornBall), new int[] { 62, 108, 136, 148, 204 } }, // 162 in non-rev master mode { new Tuple(NPCID.Plantera, ModContent.ProjectileType()), new int[] { 0, 0, 140, 152, 210 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 84, 132, 152, 164, 228 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 140, 160, 172, 252 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 72, 116, 136, 144, 204 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 72, 116, 136, 144, 204 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 72, 116, 136, 144, 204 } }, @@ -650,7 +650,7 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 220, 232, 330 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 220, 232, 330 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 300, 332, 256, 498 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 300, 332, 256, 498 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 130, 208, 228, 240, 342 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 236, 330 } }, @@ -668,7 +668,6 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 220, 232, 330 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 232, 248, 348 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 232, 248, 348 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 232, 248, 348 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 232, 248, 348 } }, @@ -697,7 +696,7 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 256, 366 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 232, 256, 272, 384 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 276, 304, 320, 456 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 180, 300, 332, 348, 498 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 276, 304, 320, 456 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 180, 300, 332, 348, 498 } }, @@ -710,17 +709,17 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, // 25% increased damage in bullet hell 1 { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 450, 676, 712, 732, 1068 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 500, 752, 788, 808, 1182 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 528, 556, 572, 834 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 528, 556, 572, 834 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 528, 556, 572, 834 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 528, 556, 572, 834 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } } + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 528, 556, 572, 834 } } }; }; }