From 040c3cb2ff23787c06e26936c4ca5bfcaf82d7b6 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 25 Mar 2020 21:49:38 -0400 Subject: [PATCH] fixed range bugs with several minions --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- Projectiles/Summon/ApexShark.cs | 14 ++++++------- Projectiles/Summon/AquaticStarMinion.cs | 6 +++--- Projectiles/Summon/AstrageldonSummon.cs | 10 ++++----- Projectiles/Summon/AstralProbeSummon.cs | 10 ++++----- Projectiles/Summon/BabyPlaguebringer.cs | 4 ++-- Projectiles/Summon/BloodClotMinion.cs | 2 +- .../Summon/BrimstoneElementalMinion.cs | 14 ++++++------- Projectiles/Summon/BrittleStarMinion.cs | 6 +++--- Projectiles/Summon/CalamariMinion.cs | 20 +++++++++--------- Projectiles/Summon/Calamitamini.cs | 14 ++++++------- Projectiles/Summon/Cataclymini.cs | 14 ++++++------- Projectiles/Summon/Catastromini.cs | 14 ++++++------- Projectiles/Summon/CloudElementalMinion.cs | 12 +++++------ Projectiles/Summon/CorroslimeMinion.cs | 6 +++--- .../Summon/CorruptionSlimeGodMinion.cs | 6 +++--- Projectiles/Summon/CosmicEnergySpiral.cs | 14 ++++++------- Projectiles/Summon/CosmilampMinion.cs | 10 ++++----- Projectiles/Summon/CrimslimeMinion.cs | 6 +++--- Projectiles/Summon/DaedalusCrystal.cs | 6 +++--- Projectiles/Summon/DankCreeperMinion.cs | 20 +++++++++--------- Projectiles/Summon/DemonshadeRedDevil.cs | 11 +++++----- Projectiles/Summon/DreadmineTurret.cs | 6 +++--- Projectiles/Summon/EXPLODINGFROG.cs | 6 +++--- Projectiles/Summon/ElementalAxeMinion.cs | 8 +++---- Projectiles/Summon/EndoCooperBody.cs | 10 ++++----- Projectiles/Summon/EndoCooperLimbs.cs | 6 +++--- Projectiles/Summon/FungalClumpMinion.cs | 6 +++--- Projectiles/Summon/GhostlyMine.cs | 6 +++--- Projectiles/Summon/GladiatorSword.cs | 6 +++--- Projectiles/Summon/GladiatorSword2.cs | 6 +++--- Projectiles/Summon/HermitCrabMinion.cs | 12 +++++------ Projectiles/Summon/HerringMinion.cs | 10 ++++----- Projectiles/Summon/Hive.cs | 12 +++++------ Projectiles/Summon/IceClasperMinion.cs | 14 ++++++------- Projectiles/Summon/IceSentry.cs | 10 ++++----- Projectiles/Summon/IgneousBlade.cs | 6 +++--- Projectiles/Summon/LanternSoul.cs | 6 +++--- Projectiles/Summon/LuxorsGiftSummon.cs | 14 ++++++------- Projectiles/Summon/MagicAxe.cs | 6 +++--- Projectiles/Summon/MagicHat.cs | 6 +++--- Projectiles/Summon/MagicRifle.cs | 7 ++++--- Projectiles/Summon/MagicUmbrella.cs | 6 +++--- Projectiles/Summon/MechwormHead.cs | 2 +- Projectiles/Summon/MiniGuardianAttack.cs | 2 +- Projectiles/Summon/MiniGuardianDefense.cs | 5 +++-- Projectiles/Summon/PhantomGuy.cs | 21 ++++++++++--------- Projectiles/Summon/PinkButterfly.cs | 12 +++++------ Projectiles/Summon/PlagueBeeSmall.cs | 2 +- Projectiles/Summon/PlaguePrincess.cs | 4 ++-- Projectiles/Summon/PlaguebringerMK2.cs | 6 +++--- Projectiles/Summon/PlantSummon.cs | 20 +++++++++--------- Projectiles/Summon/PowerfulRaven.cs | 6 +++--- Projectiles/Summon/ProfanedEnergy.cs | 8 +++---- Projectiles/Summon/PurpleButterfly.cs | 10 ++++----- Projectiles/Summon/ReaverOrb.cs | 8 +++---- Projectiles/Summon/SandElementalHealer.cs | 14 ++++++------- Projectiles/Summon/SandElementalMinion.cs | 14 ++++++------- Projectiles/Summon/SandnadoMinion.cs | 10 ++++----- Projectiles/Summon/Shellfish.cs | 6 +++--- Projectiles/Summon/SilvaCrystal.cs | 12 +++++------ Projectiles/Summon/SkeletalDragonChild.cs | 6 +++--- Projectiles/Summon/SkeletalDragonMother.cs | 6 +++--- Projectiles/Summon/SolarGod.cs | 14 ++++++------- Projectiles/Summon/SolarPixie.cs | 14 ++++++------- Projectiles/Summon/SonOfYharon.cs | 12 +++++------ Projectiles/Summon/Spikecrag.cs | 8 +++---- .../Summon/TacticalPlagueEngineSummon.cs | 6 +++--- Projectiles/Summon/Urchin.cs | 14 ++++++------- Projectiles/Summon/Valkyrie.cs | 14 ++++++------- Projectiles/Summon/WaterElementalMinion.cs | 14 ++++++------- Projectiles/Summon/WulfrumDroid.cs | 20 +++++++++--------- 72 files changed, 341 insertions(+), 339 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index afbfd8ea03..583b471220 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3020,7 +3020,7 @@ namespace CalamityMod.CalPlayer { float ai1 = (float)(I * 120); Projectile.NewProjectile(player.Center.X + (float)(Math.Sin(I * 120) * 550), player.Center.Y + (float)(Math.Cos(I * 120) * 550), 0f, 0f, - ModContent.ProjectileType(), (int)((modPlayer.auricSet ? 15000f : 5000f) * (player.allDamage + player.minionDamage - 1f)), 1f, player.whoAmI, ai1, 0f); + ModContent.ProjectileType(), (int)((modPlayer.auricSet ? 15000f : 5000f) * player.MinionDamage()), 1f, player.whoAmI, ai1, 0f); } } } diff --git a/Projectiles/Summon/ApexShark.cs b/Projectiles/Summon/ApexShark.cs index d709518acc..4dc9adf1cd 100644 --- a/Projectiles/Summon/ApexShark.cs +++ b/Projectiles/Summon/ApexShark.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[projectile.owner]; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -59,11 +59,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0]++; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } projectile.frameCounter++; @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Summon } } float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = npc.Center; @@ -160,13 +160,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/AquaticStarMinion.cs b/Projectiles/Summon/AquaticStarMinion.cs index 624e38abd3..54ce706f28 100644 --- a/Projectiles/Summon/AquaticStarMinion.cs +++ b/Projectiles/Summon/AquaticStarMinion.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -57,11 +57,11 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } projectile.rotation += projectile.velocity.X * 0.04f; diff --git a/Projectiles/Summon/AstrageldonSummon.cs b/Projectiles/Summon/AstrageldonSummon.cs index c988c1a602..60a8f6e587 100644 --- a/Projectiles/Summon/AstrageldonSummon.cs +++ b/Projectiles/Summon/AstrageldonSummon.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Summon //on spawn effects and flexible minions if (!dust) { - modProj.spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + modProj.spawnedPlayerMinionDamageValue = player.MinionDamage(); modProj.spawnedPlayerMinionProjectileDamageValue = projectile.damage; int dustAmt = 16; for (int dustIndex = 0; dustIndex < dustAmt; dustIndex++) @@ -83,11 +83,11 @@ namespace CalamityMod.Projectiles.Summon } dust = true; } - if ((player.allDamage + player.minionDamage - 1f) != modProj.spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != modProj.spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)modProj.spawnedPlayerMinionProjectileDamageValue / modProj.spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Summon { bool lineOfSight = Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height); float disttoobjective = Vector2.Distance(npc.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, objectivepos) > disttoobjective && disttoobjective < mindistance) || !gotoenemy) && lineOfSight) + if ((!gotoenemy && disttoobjective < mindistance) && lineOfSight) { mindistance = disttoobjective; @@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles.Summon { bool lineOfSight = Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height); float disttoobjective = Vector2.Distance(npc.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, objectivepos) > disttoobjective && disttoobjective < mindistance) || !gotoenemy) && lineOfSight) + if ((!gotoenemy && disttoobjective < mindistance) && lineOfSight) { mindistance = disttoobjective; diff --git a/Projectiles/Summon/AstralProbeSummon.cs b/Projectiles/Summon/AstralProbeSummon.cs index b1c48c522e..fccd980aeb 100644 --- a/Projectiles/Summon/AstralProbeSummon.cs +++ b/Projectiles/Summon/AstralProbeSummon.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -54,11 +54,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { vector46 = npc.Center; flag25 = true; @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Summon if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/BabyPlaguebringer.cs b/Projectiles/Summon/BabyPlaguebringer.cs index 66db9020c7..8355493836 100644 --- a/Projectiles/Summon/BabyPlaguebringer.cs +++ b/Projectiles/Summon/BabyPlaguebringer.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = npc.Center; @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Summon if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/BloodClotMinion.cs b/Projectiles/Summon/BloodClotMinion.cs index 712e74fc64..94916bc43c 100644 --- a/Projectiles/Summon/BloodClotMinion.cs +++ b/Projectiles/Summon/BloodClotMinion.cs @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Summon { num538 = 1800; } - if (Math.Abs(projectile.Center.X - Main.player[projectile.owner].Center.X) + Math.Abs(projectile.Center.Y - Main.player[projectile.owner].Center.Y) > (float)num538) + if (Math.Abs(projectile.Center.X - player.Center.X) + Math.Abs(projectile.Center.Y - player.Center.Y) > (float)num538) { projectile.ai[0] = 1f; } diff --git a/Projectiles/Summon/BrimstoneElementalMinion.cs b/Projectiles/Summon/BrimstoneElementalMinion.cs index 15896dad62..ed62c3fc64 100644 --- a/Projectiles/Summon/BrimstoneElementalMinion.cs +++ b/Projectiles/Summon/BrimstoneElementalMinion.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -77,11 +77,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } projectile.frameCounter++; @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Summon float num633 = 700f; float num636 = 400f; //150 float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { vector46 = npc.Center; flag25 = true; @@ -152,13 +152,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/BrittleStarMinion.cs b/Projectiles/Summon/BrittleStarMinion.cs index b5e533de78..2e3a294c42 100644 --- a/Projectiles/Summon/BrittleStarMinion.cs +++ b/Projectiles/Summon/BrittleStarMinion.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -57,11 +57,11 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } projectile.rotation += projectile.velocity.X * 0.04f; diff --git a/Projectiles/Summon/CalamariMinion.cs b/Projectiles/Summon/CalamariMinion.cs index 5da25a145f..a1579f8ae8 100644 --- a/Projectiles/Summon/CalamariMinion.cs +++ b/Projectiles/Summon/CalamariMinion.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[1] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); //66% = 1.66 + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); //66% = 1.66 projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; //300 * 1.66 = 498 (new value) int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -62,11 +62,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[1] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) //15% = 1.15 != 1.66 + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) //15% = 1.15 != 1.66 { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / //498 projectile.Calamity().spawnedPlayerMinionDamageValue * //1.66 498 / 1.66 = 300 (original value) - (player.allDamage + player.minionDamage - 1f)); //300 * 1.15 = 345 (new value) + player.MinionDamage()); //300 * 1.15 = 345 (new value) projectile.damage = damage2; } projectile.frameCounter++; @@ -135,7 +135,7 @@ namespace CalamityMod.Projectiles.Summon projectile.localAI[0] -= 1f; } int num3; - for (int num534 = 0; num534 < 1000; num534 = num3 + 1) + for (int num534 = 0; num534 < Main.maxProjectiles; num534 = num3 + 1) { if (num534 != projectile.whoAmI && Main.projectile[num534].active && Main.projectile[num534].owner == projectile.owner && Main.projectile[num534].type == ModContent.ProjectileType() && @@ -161,7 +161,7 @@ namespace CalamityMod.Projectiles.Summon num3 = num534; } Vector2 vector = projectile.position; - float num10 = 300f; //300 + float num10 = 3000f; //300 bool flag = false; Vector2 center = Main.player[projectile.owner].Center; Vector2 value = new Vector2(0.5f); @@ -173,7 +173,7 @@ namespace CalamityMod.Projectiles.Summon { Vector2 vector2 = npc.position + npc.Size * value; float num12 = Vector2.Distance(vector2, center); - if (((Vector2.Distance(center, vector) > num12 && num12 < num10) || !flag) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if ((!flag && num12 < num10) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { vector = vector2; flag = true; @@ -183,14 +183,14 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int k = 0; k < 200; k++) + for (int k = 0; k < Main.maxNPCs; k++) { NPC nPC = Main.npc[k]; if (nPC.CanBeChasedBy(projectile, false)) { Vector2 vector3 = nPC.position + nPC.Size * value; float num13 = Vector2.Distance(vector3, center); - if (((Vector2.Distance(center, vector) > num13 && num13 < num10) || !flag) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC.position, nPC.width, nPC.height)) + if ((!flag && num12 < num10) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC.position, nPC.width, nPC.height)) { num10 = num13; vector = vector3; @@ -199,10 +199,10 @@ namespace CalamityMod.Projectiles.Summon } } } - int num16 = 500; + int num16 = 3500; if (flag) { - num16 = 2000; + num16 = 4000; } if (Vector2.Distance(player.Center, projectile.Center) > (float)num16) { diff --git a/Projectiles/Summon/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs index 8316c1e92b..2f39fe67d4 100644 --- a/Projectiles/Summon/Calamitamini.cs +++ b/Projectiles/Summon/Calamitamini.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -54,11 +54,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } float num633 = 700f; @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Summon } } float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { vector46 = npc.Center; flag25 = true; @@ -132,13 +132,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/Cataclymini.cs b/Projectiles/Summon/Cataclymini.cs index 043bfbe7ac..0390c49754 100644 --- a/Projectiles/Summon/Cataclymini.cs +++ b/Projectiles/Summon/Cataclymini.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -54,11 +54,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } float num633 = 700f; @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Summon } } float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { vector46 = npc.Center; flag25 = true; @@ -131,13 +131,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/Catastromini.cs b/Projectiles/Summon/Catastromini.cs index b5385b3069..52942a9fe4 100644 --- a/Projectiles/Summon/Catastromini.cs +++ b/Projectiles/Summon/Catastromini.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -54,11 +54,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } float num633 = 700f; @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Summon } } float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; vector46 = npc.Center; @@ -160,13 +160,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/CloudElementalMinion.cs b/Projectiles/Summon/CloudElementalMinion.cs index 96a1f42614..027ceff01d 100644 --- a/Projectiles/Summon/CloudElementalMinion.cs +++ b/Projectiles/Summon/CloudElementalMinion.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -75,11 +75,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Summon num *= Main.essScale; Lighting.AddLight(projectile.Center, 0.25f * num, 0.55f * num, 0.75f * num); float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -157,7 +157,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; vector46 = npc.Center; @@ -173,7 +173,7 @@ namespace CalamityMod.Projectiles.Summon if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/CorroslimeMinion.cs b/Projectiles/Summon/CorroslimeMinion.cs index 6aa86892e6..e7eb26e4ed 100644 --- a/Projectiles/Summon/CorroslimeMinion.cs +++ b/Projectiles/Summon/CorroslimeMinion.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 16; for (int num227 = 0; num227 < num226; num227++) @@ -66,11 +66,11 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); diff --git a/Projectiles/Summon/CorruptionSlimeGodMinion.cs b/Projectiles/Summon/CorruptionSlimeGodMinion.cs index 2766e84e7f..d040cf3128 100644 --- a/Projectiles/Summon/CorruptionSlimeGodMinion.cs +++ b/Projectiles/Summon/CorruptionSlimeGodMinion.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 16; for (int num227 = 0; num227 < num226; num227++) @@ -64,11 +64,11 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); diff --git a/Projectiles/Summon/CosmicEnergySpiral.cs b/Projectiles/Summon/CosmicEnergySpiral.cs index a1b6b0e40d..42eecccdfa 100644 --- a/Projectiles/Summon/CosmicEnergySpiral.cs +++ b/Projectiles/Summon/CosmicEnergySpiral.cs @@ -42,15 +42,15 @@ namespace CalamityMod.Projectiles.Summon Lighting.AddLight((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, (float)Main.DiscoR / 255f, (float)Main.DiscoG / 255f, (float)Main.DiscoB / 255f); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Summon float num635 = 2400f; //1200 float num636 = 800f; float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { vector46 = npc.Center; flag25 = true; @@ -114,13 +114,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/CosmilampMinion.cs b/Projectiles/Summon/CosmilampMinion.cs index 52c01574a5..48797d4acf 100644 --- a/Projectiles/Summon/CosmilampMinion.cs +++ b/Projectiles/Summon/CosmilampMinion.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -55,11 +55,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.75f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0f / 255f); @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Summon } } int num3; - for (int num534 = 0; num534 < 1000; num534 = num3 + 1) + for (int num534 = 0; num534 < Main.maxProjectiles; num534 = num3 + 1) { if (num534 != projectile.whoAmI && Main.projectile[num534].active && Main.projectile[num534].owner == projectile.owner && Main.projectile[num534].type == ModContent.ProjectileType() && @@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num542 = 0; num542 < 200; num542 = num3 + 1) + for (int num542 = 0; num542 < Main.maxNPCs; num542 = num3 + 1) { if (Main.npc[num542].CanBeChasedBy(projectile, false)) { diff --git a/Projectiles/Summon/CrimslimeMinion.cs b/Projectiles/Summon/CrimslimeMinion.cs index 5fe6f1ba0b..50c2dc6a16 100644 --- a/Projectiles/Summon/CrimslimeMinion.cs +++ b/Projectiles/Summon/CrimslimeMinion.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 16; for (int num227 = 0; num227 < num226; num227++) @@ -66,11 +66,11 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); diff --git a/Projectiles/Summon/DaedalusCrystal.cs b/Projectiles/Summon/DaedalusCrystal.cs index 5debaff6aa..d3053e17ad 100644 --- a/Projectiles/Summon/DaedalusCrystal.cs +++ b/Projectiles/Summon/DaedalusCrystal.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -67,11 +67,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.35f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.75f / 255f); diff --git a/Projectiles/Summon/DankCreeperMinion.cs b/Projectiles/Summon/DankCreeperMinion.cs index 625888f83e..cb582f3ec2 100644 --- a/Projectiles/Summon/DankCreeperMinion.cs +++ b/Projectiles/Summon/DankCreeperMinion.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -57,11 +57,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Summon } } int num3; - for (int num534 = 0; num534 < 1000; num534 = num3 + 1) + for (int num534 = 0; num534 < Main.maxProjectiles; num534 = num3 + 1) { if (num534 != projectile.whoAmI && Main.projectile[num534].active && Main.projectile[num534].owner == projectile.owner && Main.projectile[num534].type == ModContent.ProjectileType() && @@ -136,7 +136,7 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num542 = 0; num542 < 200; num542 = num3 + 1) + for (int num542 = 0; num542 < Main.maxNPCs; num542 = num3 + 1) { if (Main.npc[num542].CanBeChasedBy(projectile, false)) { @@ -163,8 +163,8 @@ namespace CalamityMod.Projectiles.Summon num546 = 12f; } Vector2 vector42 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num547 = Main.player[projectile.owner].Center.X - vector42.X; - float num548 = Main.player[projectile.owner].Center.Y - vector42.Y - 60f; + float num547 = player.Center.X - vector42.X; + float num548 = player.Center.Y - vector42.Y - 60f; float num549 = (float)Math.Sqrt((double)(num547 * num547 + num548 * num548)); if (num549 < 100f && projectile.ai[0] == 1f && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { @@ -172,8 +172,8 @@ namespace CalamityMod.Projectiles.Summon } if (num549 > 2000f) { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.width / 2); + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.width / 2); } if (num549 > 70f) { @@ -247,7 +247,7 @@ namespace CalamityMod.Projectiles.Summon Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); if (projectile.owner == Main.myPlayer) { - for (int i = 0; i < 200; i++) + for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || diff --git a/Projectiles/Summon/DemonshadeRedDevil.cs b/Projectiles/Summon/DemonshadeRedDevil.cs index 58f6c89db4..0a6c4c998f 100644 --- a/Projectiles/Summon/DemonshadeRedDevil.cs +++ b/Projectiles/Summon/DemonshadeRedDevil.cs @@ -85,12 +85,12 @@ namespace CalamityMod.Projectiles.Summon { projectile.spriteDirection = -projectile.direction; } - float num633 = 700f; + float num633 = 2000f; float num634 = 2000f; float num635 = 3000f; float num636 = 150f; float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -151,8 +151,9 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { + num633 = num646; vector46 = npc.Center; flag25 = true; } @@ -160,13 +161,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/DreadmineTurret.cs b/Projectiles/Summon/DreadmineTurret.cs index 2587c71af8..e317b7de9c 100644 --- a/Projectiles/Summon/DreadmineTurret.cs +++ b/Projectiles/Summon/DreadmineTurret.cs @@ -32,15 +32,15 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[projectile.owner]; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } projectile.frameCounter++; diff --git a/Projectiles/Summon/EXPLODINGFROG.cs b/Projectiles/Summon/EXPLODINGFROG.cs index 2da4af702b..ddc34c7c99 100644 --- a/Projectiles/Summon/EXPLODINGFROG.cs +++ b/Projectiles/Summon/EXPLODINGFROG.cs @@ -42,15 +42,15 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[projectile.owner]; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] = 1; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int trueDamage = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = trueDamage; } bool canExplode = projectile.Center.ClosestNPCAt(MinExplodeDistance) != null; diff --git a/Projectiles/Summon/ElementalAxeMinion.cs b/Projectiles/Summon/ElementalAxeMinion.cs index 27891c0d9a..adf22823a0 100644 --- a/Projectiles/Summon/ElementalAxeMinion.cs +++ b/Projectiles/Summon/ElementalAxeMinion.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Summon float num635 = 2500f; float num636 = 400f; float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = npc.Center; @@ -137,13 +137,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index 3fb2622696..33fc6dfed2 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Summon projectile.damage = damage2; } //Variables - float mindistance = 700f; + float mindistance = 2000f; float longdistance = AttackMode != 2 ? 1300f : 1200f; float longestdistance = AttackMode != 2 ? 2600f : 2500f; float idledistance = AttackMode != 2 ? 600f : 400f; @@ -197,9 +197,8 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float disttoobjective = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, objectivepos) > disttoobjective && disttoobjective < mindistance) || !gotoenemy) + if (!gotoenemy && disttoobjective < mindistance) { - mindistance = disttoobjective; objectivepos = npc.Center; gotoenemy = true; @@ -208,15 +207,14 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float disttoobjective = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, objectivepos) > disttoobjective && disttoobjective < mindistance) || !gotoenemy) + if (!gotoenemy && disttoobjective < mindistance) { - mindistance = disttoobjective; objectivepos = nPC2.Center; gotoenemy = true; diff --git a/Projectiles/Summon/EndoCooperLimbs.cs b/Projectiles/Summon/EndoCooperLimbs.cs index 9086423b2a..414002c2f4 100644 --- a/Projectiles/Summon/EndoCooperLimbs.cs +++ b/Projectiles/Summon/EndoCooperLimbs.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Summon //Spawn effects if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = player.minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; AttackMode = (int)projectile.ai[0]; @@ -89,10 +89,10 @@ namespace CalamityMod.Projectiles.Summon } //Damage Update - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / - projectile.Calamity().spawnedPlayerMinionDamageValue * (player.allDamage + player.minionDamage - 1f)); + projectile.Calamity().spawnedPlayerMinionDamageValue * player.MinionDamage()); projectile.damage = damage2; } diff --git a/Projectiles/Summon/FungalClumpMinion.cs b/Projectiles/Summon/FungalClumpMinion.cs index e4a904d495..98598df164 100644 --- a/Projectiles/Summon/FungalClumpMinion.cs +++ b/Projectiles/Summon/FungalClumpMinion.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Summon } if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -72,11 +72,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if (Main.rand.NextBool(16)) diff --git a/Projectiles/Summon/GhostlyMine.cs b/Projectiles/Summon/GhostlyMine.cs index 4b706240a3..ad409440c7 100644 --- a/Projectiles/Summon/GhostlyMine.cs +++ b/Projectiles/Summon/GhostlyMine.cs @@ -34,17 +34,17 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[projectile.owner]; if (start) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; Main.PlaySound(SoundID.Item20, projectile.position); projectile.ai[1] = projectile.ai[0]; start = false; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } double deg = (double)projectile.ai[1]; diff --git a/Projectiles/Summon/GladiatorSword.cs b/Projectiles/Summon/GladiatorSword.cs index 55dfc9ba81..1597094168 100644 --- a/Projectiles/Summon/GladiatorSword.cs +++ b/Projectiles/Summon/GladiatorSword.cs @@ -38,15 +38,15 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if (!modPlayer.gladiatorSword) diff --git a/Projectiles/Summon/GladiatorSword2.cs b/Projectiles/Summon/GladiatorSword2.cs index 96ec5c1231..39d78ca95c 100644 --- a/Projectiles/Summon/GladiatorSword2.cs +++ b/Projectiles/Summon/GladiatorSword2.cs @@ -38,15 +38,15 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if (!modPlayer.gladiatorSword) diff --git a/Projectiles/Summon/HermitCrabMinion.cs b/Projectiles/Summon/HermitCrabMinion.cs index 21e007ed96..edd09eeab4 100644 --- a/Projectiles/Summon/HermitCrabMinion.cs +++ b/Projectiles/Summon/HermitCrabMinion.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (spawnDust) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 20; for (int num502 = 0; num502 < num501; num502++) @@ -58,11 +58,11 @@ namespace CalamityMod.Projectiles.Summon } spawnDust = false; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !chaseNPC) + if (!chaseNPC && num646 < num633) { num633 = num646; vector46 = npc.Center; @@ -122,13 +122,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC npcTarget = Main.npc[num645]; if (npcTarget.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npcTarget.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !chaseNPC) + if (!chaseNPC && num646 < num633) { num633 = num646; vector46 = npcTarget.Center; diff --git a/Projectiles/Summon/HerringMinion.cs b/Projectiles/Summon/HerringMinion.cs index da8b324723..5390179ccf 100644 --- a/Projectiles/Summon/HerringMinion.cs +++ b/Projectiles/Summon/HerringMinion.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (dust > 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -56,11 +56,11 @@ namespace CalamityMod.Projectiles.Summon } dust--; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if ((!gotoenemy && disttoobjective < mindistance) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; vector46 = npc.Center; @@ -166,7 +166,7 @@ namespace CalamityMod.Projectiles.Summon if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + if ((!gotoenemy && disttoobjective < mindistance) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/Hive.cs b/Projectiles/Summon/Hive.cs index e06e6c786e..a4ed1d9953 100644 --- a/Projectiles/Summon/Hive.cs +++ b/Projectiles/Summon/Hive.cs @@ -30,15 +30,15 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[projectile.owner]; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { vector46 = npc.Center; flag25 = true; @@ -79,13 +79,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/IceClasperMinion.cs b/Projectiles/Summon/IceClasperMinion.cs index 49d682d0fe..3d20d0f0be 100644 --- a/Projectiles/Summon/IceClasperMinion.cs +++ b/Projectiles/Summon/IceClasperMinion.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (dust > 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -57,11 +57,11 @@ namespace CalamityMod.Projectiles.Summon } dust--; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } projectile.frameCounter++; @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Summon } } float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && @@ -148,7 +148,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = npc.Center; @@ -158,13 +158,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/IceSentry.cs b/Projectiles/Summon/IceSentry.cs index 43aa534bbb..2d69fb0592 100644 --- a/Projectiles/Summon/IceSentry.cs +++ b/Projectiles/Summon/IceSentry.cs @@ -34,15 +34,15 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[projectile.owner]; if (setDamage) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; setDamage = false; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Summon projectile.netUpdate = true; } - if (projectile.ai[0] >= 0 && projectile.ai[0] < 200) + if (projectile.ai[0] >= 0 && projectile.ai[0] < Main.maxNPCs) { NPC npc = Main.npc[(int)projectile.ai[0]]; @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Summon float maxDistance = 1000f; int possibleTarget = -1; - for (int i = 0; i < 200; i++) + for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(projectile)) diff --git a/Projectiles/Summon/IgneousBlade.cs b/Projectiles/Summon/IgneousBlade.cs index 10c87d0d32..a5d68cfa4c 100644 --- a/Projectiles/Summon/IgneousBlade.cs +++ b/Projectiles/Summon/IgneousBlade.cs @@ -50,15 +50,15 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] = 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = trueDamage; } bool isProperProjectile = projectile.type == ModContent.ProjectileType(); diff --git a/Projectiles/Summon/LanternSoul.cs b/Projectiles/Summon/LanternSoul.cs index ccbe72b1b2..d73074b8a1 100644 --- a/Projectiles/Summon/LanternSoul.cs +++ b/Projectiles/Summon/LanternSoul.cs @@ -44,15 +44,15 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[projectile.owner]; if (count == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; count += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } diff --git a/Projectiles/Summon/LuxorsGiftSummon.cs b/Projectiles/Summon/LuxorsGiftSummon.cs index f862f5a4f6..dbbf55d8b7 100644 --- a/Projectiles/Summon/LuxorsGiftSummon.cs +++ b/Projectiles/Summon/LuxorsGiftSummon.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (dust > 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -57,11 +57,11 @@ namespace CalamityMod.Projectiles.Summon } dust--; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if (projectile.localAI[0] == 0f) @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Summon } } float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && @@ -152,7 +152,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = npc.Center; @@ -162,13 +162,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/MagicAxe.cs b/Projectiles/Summon/MagicAxe.cs index a1f71a5a16..5edcf7e95e 100644 --- a/Projectiles/Summon/MagicAxe.cs +++ b/Projectiles/Summon/MagicAxe.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Summon return; } Vector2 vector46 = projectile.position; - float homingRange = 700f; + float homingRange = 1000f; bool homeIn = false; if (player.HasMinionAttackTargetNPC) { @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < homingRange) || !homeIn) + if (!homeIn && num646 < homingRange) { homingRange = num646; vector46 = npc.Center; @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Summon if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < homingRange) || !homeIn) + if (!homeIn && num646 < homingRange) { homingRange = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/MagicHat.cs b/Projectiles/Summon/MagicHat.cs index 77af61d0fc..ec33d284ad 100644 --- a/Projectiles/Summon/MagicHat.cs +++ b/Projectiles/Summon/MagicHat.cs @@ -82,15 +82,15 @@ namespace CalamityMod.Projectiles.Summon Main.dust[dustEffects].velocity *= 2f; Main.dust[dustEffects].scale *= 1.15f; } - modProj.spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + modProj.spawnedPlayerMinionDamageValue = player.MinionDamage(); modProj.spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != modProj.spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != modProj.spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)modProj.spawnedPlayerMinionProjectileDamageValue / modProj.spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } diff --git a/Projectiles/Summon/MagicRifle.cs b/Projectiles/Summon/MagicRifle.cs index 91c2fe8592..3d5d342c13 100644 --- a/Projectiles/Summon/MagicRifle.cs +++ b/Projectiles/Summon/MagicRifle.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Summon counter++; canHome = true; } - float homingRange = 700f; + float homingRange = 1000f; float num634 = 1300f; float num635 = 2600f; float num636 = 600f; @@ -75,8 +75,9 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false) && canHome) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < homingRange) || !flag25) + if (!flag25 && num646 < homingRange) { + homingRange = num646; vector46 = npc.Center; flag25 = true; } @@ -90,7 +91,7 @@ namespace CalamityMod.Projectiles.Summon if (nPC2.CanBeChasedBy(projectile, false) && canHome) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < homingRange) || !flag25) + if (!flag25 && num646 < homingRange) { homingRange = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/MagicUmbrella.cs b/Projectiles/Summon/MagicUmbrella.cs index 667136ccac..cb2f04dd11 100644 --- a/Projectiles/Summon/MagicUmbrella.cs +++ b/Projectiles/Summon/MagicUmbrella.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[projectile.owner]; projectile.rotation += 0.075f; projectile.alpha -= 50; - float num633 = 700f; + float num633 = 1000f; float num634 = 1000f; float num635 = 2200f; float num636 = 150f; @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false) && canHome) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = npc.Center; @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Summon if (nPC2.CanBeChasedBy(projectile, false) && canHome) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/MechwormHead.cs b/Projectiles/Summon/MechwormHead.cs index 2ae0236a4f..aeb975b2ce 100644 --- a/Projectiles/Summon/MechwormHead.cs +++ b/Projectiles/Summon/MechwormHead.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num1056 = 0; num1056 < 200; num1056++) + for (int num1056 = 0; num1056 < Main.maxNPCs; num1056++) { NPC nPC13 = Main.npc[num1056]; if (nPC13.CanBeChasedBy(projectile, false) && player9.Distance(nPC13.Center) < num1054) diff --git a/Projectiles/Summon/MiniGuardianAttack.cs b/Projectiles/Summon/MiniGuardianAttack.cs index 8e0bc1a0ff..5b3d82a820 100644 --- a/Projectiles/Summon/MiniGuardianAttack.cs +++ b/Projectiles/Summon/MiniGuardianAttack.cs @@ -258,7 +258,7 @@ namespace CalamityMod.Projectiles.Summon if (!flag19) { int num3; - for (int num542 = 0; num542 < 200; num542 = num3 + 1) + for (int num542 = 0; num542 < Main.maxNPCs; num542 = num3 + 1) { if (Main.npc[num542].CanBeChasedBy(projectile, false)) { diff --git a/Projectiles/Summon/MiniGuardianDefense.cs b/Projectiles/Summon/MiniGuardianDefense.cs index ac47a33419..055d971a30 100644 --- a/Projectiles/Summon/MiniGuardianDefense.cs +++ b/Projectiles/Summon/MiniGuardianDefense.cs @@ -205,7 +205,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - if (Main.player[projectile.owner].Calamity().profanedCrystalBuffs && !Main.player[projectile.owner].Calamity().magicHat && !Main.player[projectile.owner].Calamity().endoCooper) { + if (Main.player[projectile.owner].Calamity().profanedCrystalBuffs && !Main.player[projectile.owner].Calamity().magicHat && !Main.player[projectile.owner].Calamity().endoCooper) + { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); return false; } @@ -255,7 +256,7 @@ namespace CalamityMod.Projectiles.Summon if (!flag19) { int num3; - for (int num542 = 0; num542 < 200; num542 = num3 + 1) + for (int num542 = 0; num542 < Main.maxNPCs; num542 = num3 + 1) { if (Main.npc[num542].CanBeChasedBy(projectile, false)) { diff --git a/Projectiles/Summon/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs index 3854420a48..42c0e72143 100644 --- a/Projectiles/Summon/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -52,11 +52,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Summon } } float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -96,9 +96,9 @@ namespace CalamityMod.Projectiles.Summon } } } - float num633 = 700f; - float num634 = 1300f; - float num635 = 2600f; + float num633 = 3000f; + float num634 = 3500f; + float num635 = 4000f; float num636 = 600f; Vector2 vector46 = projectile.position; bool flag25 = false; @@ -108,8 +108,9 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { + num633 = num646; vector46 = npc.Center; flag25 = true; } @@ -117,13 +118,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/PinkButterfly.cs b/Projectiles/Summon/PinkButterfly.cs index 8063ad335d..973cab56c2 100644 --- a/Projectiles/Summon/PinkButterfly.cs +++ b/Projectiles/Summon/PinkButterfly.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -52,11 +52,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Summon } } float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Summon if ((npc.CanBeChasedBy(projectile, false) || npc.type == NPCID.DukeFishron) && npc.active) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { vector46 = npc.Center; flag25 = true; @@ -144,7 +144,7 @@ namespace CalamityMod.Projectiles.Summon if ((nPC2.CanBeChasedBy(projectile, false) || nPC2.type == NPCID.DukeFishron) && nPC2.active) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/PlagueBeeSmall.cs b/Projectiles/Summon/PlagueBeeSmall.cs index 00d0d6d9d8..284afaedb6 100644 --- a/Projectiles/Summon/PlagueBeeSmall.cs +++ b/Projectiles/Summon/PlagueBeeSmall.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon } float num373 = projectile.position.X; float num374 = projectile.position.Y; - float num375 = 100000f; + float num375 = 1000f; bool flag10 = false; projectile.ai[0] += 1f; if (projectile.ai[0] > 30f) diff --git a/Projectiles/Summon/PlaguePrincess.cs b/Projectiles/Summon/PlaguePrincess.cs index 5a6f188cbe..c407d45a94 100644 --- a/Projectiles/Summon/PlaguePrincess.cs +++ b/Projectiles/Summon/PlaguePrincess.cs @@ -209,7 +209,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, targetLocation) > num646 && num646 < num633) || !targetFound) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if ((!targetFound && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; targetLocation = npc.Center; @@ -225,7 +225,7 @@ namespace CalamityMod.Projectiles.Summon if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, targetLocation) > num646 && num646 < num633) || !targetFound) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + if ((!targetFound && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) { num633 = num646; targetLocation = nPC2.Center; diff --git a/Projectiles/Summon/PlaguebringerMK2.cs b/Projectiles/Summon/PlaguebringerMK2.cs index bfa9ef0a3e..559121220d 100644 --- a/Projectiles/Summon/PlaguebringerMK2.cs +++ b/Projectiles/Summon/PlaguebringerMK2.cs @@ -38,15 +38,15 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] = 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = trueDamage; } bool isProperProjectile = projectile.type == ModContent.ProjectileType(); diff --git a/Projectiles/Summon/PlantSummon.cs b/Projectiles/Summon/PlantSummon.cs index a71ad05891..e54d51b734 100644 --- a/Projectiles/Summon/PlantSummon.cs +++ b/Projectiles/Summon/PlantSummon.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft *= 5; projectile.minion = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 15; + projectile.localNPCHitCooldown = 12; projectile.extraUpdates = 0; } @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Summon if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -93,11 +93,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } @@ -115,14 +115,14 @@ namespace CalamityMod.Projectiles.Summon } } - float num633 = 700f; + float num633 = 1000f; float num634 = 1300f; float num635 = 2600f; float num636 = 600f; float num637 = 0.05f; //idle movement - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -158,7 +158,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = npc.Center; @@ -168,13 +168,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; @@ -456,7 +456,7 @@ namespace CalamityMod.Projectiles.Summon value20.Normalize(); if (Main.rand.NextBool(2)) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value20.X * 2f, value20.Y * 2f, ModContent.ProjectileType(), (int)(projectile.damage * 1.2f), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value20.X * 2f, value20.Y * 2f, ModContent.ProjectileType(), (int)(projectile.damage * 1.5f), 0f, Main.myPlayer, 0f, 0f); } projectile.velocity = value20 * 8f; projectile.netUpdate = true; diff --git a/Projectiles/Summon/PowerfulRaven.cs b/Projectiles/Summon/PowerfulRaven.cs index 24533b4ae2..e497365010 100644 --- a/Projectiles/Summon/PowerfulRaven.cs +++ b/Projectiles/Summon/PowerfulRaven.cs @@ -45,16 +45,16 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.ai[0] = -1f; projectile.localAI[0] = 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = trueDamage; } bool isProperProjectile = projectile.type == ModContent.ProjectileType(); diff --git a/Projectiles/Summon/ProfanedEnergy.cs b/Projectiles/Summon/ProfanedEnergy.cs index 93b191e433..b1b029216e 100644 --- a/Projectiles/Summon/ProfanedEnergy.cs +++ b/Projectiles/Summon/ProfanedEnergy.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon } if (count == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); for (int num621 = 0; num621 < 5; num621++) @@ -66,11 +66,11 @@ namespace CalamityMod.Projectiles.Summon } count += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if (projectile.owner == Main.myPlayer) @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num512 = 0; num512 < 200; num512++) + for (int num512 = 0; num512 < Main.maxNPC; num512++) { if (Main.npc[num512].CanBeChasedBy(projectile, false)) { diff --git a/Projectiles/Summon/PurpleButterfly.cs b/Projectiles/Summon/PurpleButterfly.cs index 4db43742ba..1a25ae4129 100644 --- a/Projectiles/Summon/PurpleButterfly.cs +++ b/Projectiles/Summon/PurpleButterfly.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (dust > 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -54,11 +54,11 @@ namespace CalamityMod.Projectiles.Summon } dust--; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) @@ -149,7 +149,7 @@ namespace CalamityMod.Projectiles.Summon if ((npc.CanBeChasedBy(projectile, false) || npc.type == NPCID.DukeFishron) && npc.active) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = npc.Center; @@ -165,7 +165,7 @@ namespace CalamityMod.Projectiles.Summon if ((nPC2.CanBeChasedBy(projectile, false) || nPC2.type == NPCID.DukeFishron) && nPC2.active) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/ReaverOrb.cs b/Projectiles/Summon/ReaverOrb.cs index f99092ee5c..91300cd59f 100644 --- a/Projectiles/Summon/ReaverOrb.cs +++ b/Projectiles/Summon/ReaverOrb.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -67,11 +67,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 1f / 255f, (255 - projectile.alpha) * 0f / 255f); @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Summon } bool flag18 = false; float num508 = 600f; - for (int num512 = 0; num512 < 200; num512++) + for (int num512 = 0; num512 < Main.maxNPCs; num512++) { if (Main.npc[num512].CanBeChasedBy(projectile, false)) { diff --git a/Projectiles/Summon/SandElementalHealer.cs b/Projectiles/Summon/SandElementalHealer.cs index 3758c8334f..3a900d64de 100644 --- a/Projectiles/Summon/SandElementalHealer.cs +++ b/Projectiles/Summon/SandElementalHealer.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -76,11 +76,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } projectile.frameCounter++; @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Summon num *= Main.essScale; Lighting.AddLight(projectile.Center, 0.7f * num, 0.6f * num, 0f * num); float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -155,8 +155,8 @@ namespace CalamityMod.Projectiles.Summon } if (num651 > 2000f) { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); projectile.netUpdate = true; } if (num651 > 70f) @@ -199,7 +199,7 @@ namespace CalamityMod.Projectiles.Summon if (projectile.ai[1] == 0f && projectile.localAI[0] >= 120f) { projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner && Main.player[projectile.owner].statLife < Main.player[projectile.owner].statLifeMax2) + if (Main.myPlayer == projectile.owner && player.statLife < player.statLifeMax2) { Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 6); int num226 = 36; diff --git a/Projectiles/Summon/SandElementalMinion.cs b/Projectiles/Summon/SandElementalMinion.cs index ea988d7a61..59d3979ce8 100644 --- a/Projectiles/Summon/SandElementalMinion.cs +++ b/Projectiles/Summon/SandElementalMinion.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -75,11 +75,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Summon num *= Main.essScale; Lighting.AddLight(projectile.Center, 0.7f * num, 0.6f * num, 0f * num); float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { vector46 = npc.Center; flag25 = true; @@ -142,13 +142,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index 34a4af5077..5beb6dbb5c 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Summon } float num8 = 0.1f; float num9 = (float)projectile.width * 2f; - for (int j = 0; j < 1000; j++) + for (int j = 0; j < Main.maxProjectiles; j++) { if (j != projectile.whoAmI && Main.projectile[j].active && Main.projectile[j].owner == projectile.owner && Main.projectile[j].type == projectile.type && Math.Abs(projectile.position.X - Main.projectile[j].position.X) + Math.Abs(projectile.position.Y - Main.projectile[j].position.Y) < num9) @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Summon } } Vector2 vector = projectile.position; - float num10 = 400f; + float num10 = 600f; bool flag = false; if (Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Summon { Vector2 vector2 = npc.position + npc.Size * value; float num12 = Vector2.Distance(vector2, center); - if (((Vector2.Distance(center, vector) > num12 && num12 < num10) || !flag) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if ((!flag && num13 < num10) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { vector = vector2; flag = true; @@ -140,14 +140,14 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int k = 0; k < 200; k++) + for (int k = 0; k < Main.maxNPCs; k++) { NPC nPC = Main.npc[k]; if (nPC.CanBeChasedBy(projectile, false)) { Vector2 vector3 = nPC.position + nPC.Size * value; float num13 = Vector2.Distance(vector3, center); - if (((Vector2.Distance(center, vector) > num13 && num13 < num10) || !flag) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC.position, nPC.width, nPC.height)) + if ((!flag && num13 < num10) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC.position, nPC.width, nPC.height)) { num10 = num13; vector = vector3; diff --git a/Projectiles/Summon/Shellfish.cs b/Projectiles/Summon/Shellfish.cs index 8e5612d9ac..d6d76c956e 100644 --- a/Projectiles/Summon/Shellfish.cs +++ b/Projectiles/Summon/Shellfish.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Summon CalamityGlobalProjectile modProj = projectile.Calamity(); if (spawnDust) { - modProj.spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + modProj.spawnedPlayerMinionDamageValue = player.MinionDamage(); modProj.spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 20; for (int num502 = 0; num502 < num501; num502++) @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !chaseNPC) + if (!chaseNPC && num646 < num633) { num633 = num646; vector46 = npc.Center; @@ -148,7 +148,7 @@ namespace CalamityMod.Projectiles.Summon if (npcTarget.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npcTarget.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !chaseNPC) + if (!chaseNPC && num646 < num633) { num633 = num646; vector46 = npcTarget.Center; diff --git a/Projectiles/Summon/SilvaCrystal.cs b/Projectiles/Summon/SilvaCrystal.cs index 24ca27a1b5..5da5e5f66d 100644 --- a/Projectiles/Summon/SilvaCrystal.cs +++ b/Projectiles/Summon/SilvaCrystal.cs @@ -39,15 +39,15 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[1] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[1] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); @@ -67,8 +67,8 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2) + Main.player[projectile.owner].gfxOffY - 60f; + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; if (Main.player[projectile.owner].gravDir == -1f) { projectile.position.Y = projectile.position.Y + 120f; @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Summon if (num1074 < 0) { int num30; - for (int num1077 = 0; num1077 < 200; num1077 = num30 + 1) + for (int num1077 = 0; num1077 < Main.maxNPCs; num1077 = num30 + 1) { NPC nPC16 = Main.npc[num1077]; if (nPC16.CanBeChasedBy(projectile, false)) diff --git a/Projectiles/Summon/SkeletalDragonChild.cs b/Projectiles/Summon/SkeletalDragonChild.cs index 49c9b0bd64..372511e4ec 100644 --- a/Projectiles/Summon/SkeletalDragonChild.cs +++ b/Projectiles/Summon/SkeletalDragonChild.cs @@ -40,15 +40,15 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[projectile.owner]; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] = 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = trueDamage; } diff --git a/Projectiles/Summon/SkeletalDragonMother.cs b/Projectiles/Summon/SkeletalDragonMother.cs index 40907b0e0a..2936adf730 100644 --- a/Projectiles/Summon/SkeletalDragonMother.cs +++ b/Projectiles/Summon/SkeletalDragonMother.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; for (int i = 0; i < 2; i++) { @@ -51,11 +51,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] = 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = trueDamage; } bool isProperProjectile = projectile.type == ModContent.ProjectileType(); diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index dd64310198..e57f8abe75 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -49,9 +49,9 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2) + Main.player[projectile.owner].gfxOffY - 60f; - if (Main.player[projectile.owner].gravDir == -1f) + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; + if (player.gravDir == -1f) { projectile.position.Y = projectile.position.Y + 150f; projectile.rotation = 3.14f; @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Summon projectile.scale = num395 + 0.95f; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -78,11 +78,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if (projectile.owner == Main.myPlayer) @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num399 = 0; num399 < 200; num399++) + for (int num399 = 0; num399 < Main.maxNPCs; num399++) { if (Main.npc[num399].CanBeChasedBy(projectile, true)) { diff --git a/Projectiles/Summon/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs index 7e65edaf3b..eda14913e8 100644 --- a/Projectiles/Summon/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -49,9 +49,9 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2) + Main.player[projectile.owner].gfxOffY - 60f; - if (Main.player[projectile.owner].gravDir == -1f) + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; + if (player.gravDir == -1f) { projectile.position.Y = projectile.position.Y + 140f; projectile.rotation = 3.14f; @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Summon projectile.scale = num395 + 0.95f; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 25; for (int num502 = 0; num502 < num501; num502++) @@ -78,11 +78,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if (projectile.owner == Main.myPlayer) @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num399 = 0; num399 < 200; num399++) + for (int num399 = 0; num399 < Main.maxNPCs; num399++) { if (Main.npc[num399].CanBeChasedBy(projectile, true)) { diff --git a/Projectiles/Summon/SonOfYharon.cs b/Projectiles/Summon/SonOfYharon.cs index bfe766a618..361eac8190 100644 --- a/Projectiles/Summon/SonOfYharon.cs +++ b/Projectiles/Summon/SonOfYharon.cs @@ -64,8 +64,8 @@ namespace CalamityMod.Projectiles.Summon { projectile.spriteDirection = -projectile.direction; } - float num633 = 800f; - float num634 = 1200f; + float num633 = 1000f; + float num634 = 2000f; float num635 = 3000f; float num636 = 500f; float num = (float)Main.rand.Next(90, 111) * 0.01f; @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Summon } } float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -148,7 +148,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = npc.Center; @@ -158,13 +158,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + if (!flag25 && num646 < num633) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/Spikecrag.cs b/Projectiles/Summon/Spikecrag.cs index 10dfc94d79..0c1125258e 100644 --- a/Projectiles/Summon/Spikecrag.cs +++ b/Projectiles/Summon/Spikecrag.cs @@ -33,15 +33,15 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[projectile.owner]; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Summon float centerY = projectile.Center.Y; float num474 = 1000f; bool homeIn = false; - for (int i = 0; i < 200; i++) + for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].CanBeChasedBy(projectile, false)) { diff --git a/Projectiles/Summon/TacticalPlagueEngineSummon.cs b/Projectiles/Summon/TacticalPlagueEngineSummon.cs index 154eb578ce..265a105b44 100644 --- a/Projectiles/Summon/TacticalPlagueEngineSummon.cs +++ b/Projectiles/Summon/TacticalPlagueEngineSummon.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; for (int i = 0; i < 45; i++) { @@ -60,11 +60,11 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int trueDamage = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = trueDamage; } bool isCorrectProjectile = projectile.type == ModContent.ProjectileType(); diff --git a/Projectiles/Summon/Urchin.cs b/Projectiles/Summon/Urchin.cs index c2b5f909cb..b2dcc7b2dc 100644 --- a/Projectiles/Summon/Urchin.cs +++ b/Projectiles/Summon/Urchin.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -66,19 +66,19 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } float num395 = (float)Main.mouseTextColor / 200f - 0.35f; num395 *= 0.2f; projectile.scale = num395 + 0.95f; - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2) + Main.player[projectile.owner].gfxOffY - 60f; - if (Main.player[projectile.owner].gravDir == -1f) + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; + if (player.gravDir == -1f) { projectile.position.Y = projectile.position.Y + 120f; projectile.rotation = 3.14f; @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Summon } bool flag18 = false; float num508 = 300f; - for (int num512 = 0; num512 < 200; num512++) + for (int num512 = 0; num512 < Main.maxNPCs; num512++) { if (Main.npc[num512].CanBeChasedBy(projectile, false)) { diff --git a/Projectiles/Summon/Valkyrie.cs b/Projectiles/Summon/Valkyrie.cs index 879e81e5a3..746ecdfc04 100644 --- a/Projectiles/Summon/Valkyrie.cs +++ b/Projectiles/Summon/Valkyrie.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Summon } if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 30; for (int num502 = 0; num502 < num501; num502++) @@ -69,11 +69,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Summon num *= Main.essScale; Lighting.AddLight(projectile.Center, 0f * num, 0.2f * num, 0.45f * num); float num637 = 0.05f; - for (int num638 = 0; num638 < 1000; num638++) + for (int num638 = 0; num638 < Main.maxProjectiles; num638++) { bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) @@ -149,7 +149,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; vector46 = npc.Center; @@ -159,13 +159,13 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) { float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) { num633 = num646; vector46 = nPC2.Center; diff --git a/Projectiles/Summon/WaterElementalMinion.cs b/Projectiles/Summon/WaterElementalMinion.cs index 91e96bb351..c680438b0d 100644 --- a/Projectiles/Summon/WaterElementalMinion.cs +++ b/Projectiles/Summon/WaterElementalMinion.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Summon } if (dust > 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -68,11 +68,11 @@ namespace CalamityMod.Projectiles.Summon } dust--; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } Lighting.AddLight(projectile.Center, 0f, 0.25f, 1.5f); @@ -86,9 +86,9 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2) + Main.player[projectile.owner].gfxOffY - 180f; - if (Main.player[projectile.owner].gravDir == -1f) + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 180f; + if (player.gravDir == -1f) { projectile.position.Y = projectile.position.Y + 360f; projectile.rotation = 3.14f; @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num512 = 0; num512 < 200; num512++) + for (int num512 = 0; num512 < Main.maxNPCs; num512++) { if (Main.npc[num512].CanBeChasedBy(projectile, false)) { diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index 4427564a11..c674c1d367 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -58,11 +58,11 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - (player.allDamage + player.minionDamage - 1f)); + player.MinionDamage()); projectile.damage = damage2; } projectile.frameCounter++; @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Summon } float num6 = 0.05f; float width = (float) projectile.width; - for (int index = 0; index < 1000; ++index) + for (int index = 0; index < Main.maxProjectiles; ++index) { if (index != projectile.whoAmI && Main.projectile[index].active && (Main.projectile[index].owner == projectile.owner && Main.projectile[index].type == projectile.type) && (double) Math.Abs(projectile.position.X - Main.projectile[index].position.X) + (double) Math.Abs(projectile.position.Y - Main.projectile[index].position.Y) < (double) width) { @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Summon } } Vector2 vector2_3 = projectile.position; - float num7 = 400f; + float num7 = 450f; bool flag = false; int num8 = -1; if (player.HasMinionAttackTargetNPC) @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy((object) this, false)) { float num1 = Vector2.Distance(npc.Center, projectile.Center); - if (((double) Vector2.Distance(projectile.Center, vector2_3) > (double) num1 && (double) num1 < (double) num7 || !flag) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if ((!flag && num1 < num7) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num7 = num1; vector2_3 = npc.Center; @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy((object) this, false)) { float num1 = Vector2.Distance(npc.Center, projectile.Center); - if (((double) Vector2.Distance(projectile.Center, vector2_3) > (double) num1 && (double) num1 < (double) num7 || !flag) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + if ((!flag && num1 < num7) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num7 = num1; vector2_3 = npc.Center; @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Summon } else { - if (!Collision.CanHitLine(projectile.Center, 1, 1, Main.player[projectile.owner].Center, 1, 1)) + if (!Collision.CanHitLine(projectile.Center, 1, 1, player.Center, 1, 1)) projectile.ai[0] = 1f; float num1 = 6f; if ((double) projectile.ai[0] == 1.0) @@ -185,8 +185,8 @@ namespace CalamityMod.Projectiles.Summon } if ((double) num3 > 2000.0) { - projectile.position.X = Main.player[projectile.owner].Center.X - (float) (projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float) (projectile.width / 2); + projectile.position.X = player.Center.X - (float) (projectile.width / 2); + projectile.position.Y = player.Center.Y - (float) (projectile.width / 2); } else if ((double) num3 > 70.0) {