From 355eb3ee0bc7943dfb2bf52f8f1a08a899208de2 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Thu, 27 Feb 2020 02:46:39 -0600 Subject: [PATCH] Perf Lore tooltip changed, Boss Rush Mod.Call support, Polterghast DR boosted by 15%, Slime God Core AI changes, Moon Lord rev+ AI changes, whoAmI variable reset changes, Polter Clone removed from boss HP bar list. --- Items/LoreItems/KnowledgePerforators.cs | 1 - ModSupport/ModCalls.cs | 18 +++- NPCs/CalamityGlobalAI.cs | 23 +++-- NPCs/CalamityGlobalNPC.cs | 107 ++++++++++++++---------- NPCs/Polterghast/Polterghast.cs | 2 +- NPCs/SlimeGod/SlimeGodCore.cs | 10 ++- UI/BossHealthBarManager.cs | 3 +- 7 files changed, 97 insertions(+), 67 deletions(-) diff --git a/Items/LoreItems/KnowledgePerforators.cs b/Items/LoreItems/KnowledgePerforators.cs index 8a1c6a17fa..9adc7131d8 100644 --- a/Items/LoreItems/KnowledgePerforators.cs +++ b/Items/LoreItems/KnowledgePerforators.cs @@ -10,7 +10,6 @@ namespace CalamityMod.Items.LoreItems { DisplayName.SetDefault("The Perforators and their Hive"); Tooltip.SetDefault("An abomination of comingled flesh, bone, and organ, infested primarily by blood-slurping worms.\n" + - "The chunks left over from the brain must have been absorbed by the crimson and reconstituted into it.\n" + "Place in your inventory for all of your projectiles to inflict ichor when in the crimson.\n" + "However, enemy spawn rates will be greatly increased while in the crimson due to your body excreting a sweet-smelling pus."); } diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 667a1dd69c..f33c0e8bb0 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -334,7 +334,14 @@ namespace CalamityMod case "death mode": return CalamityWorld.death; - case "defiled": + case "br": + case "bossrush": + case "boss rush": + case "bossrushactive": + case "boss rush active": + return CalamityWorld.bossRushActive; + + case "defiled": case "defiledrune": case "defiled rune": case "defiledmode": @@ -383,7 +390,14 @@ namespace CalamityMod case "death mode": return CalamityWorld.death = enabled; - case "defiled": + case "br": + case "bossrush": + case "boss rush": + case "bossrushactive": + case "boss rush active": + return CalamityWorld.bossRushActive = enabled; + + case "defiled": case "defiledrune": case "defiled rune": case "defiledmode": diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 18c5292176..7ca2df9496 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -12694,13 +12694,13 @@ namespace CalamityMod.NPCs case 4: break; case 3: - rotation += 60f; - break; - case 2: rotation += 120f; break; + case 2: + rotation += 240f; + break; case 1: - rotation += 180f; + rotation += 360f; break; default: break; @@ -13544,22 +13544,21 @@ namespace CalamityMod.NPCs float velocity = CalamityWorld.bossRushActive ? 38f : 30f; Vector2 center23 = npc.Center; - Vector2 center24 = Main.player[npc.target].Center; + Vector2 center24 = Main.npc[(int)Main.npc[(int)npc.ai[3]].localAI[2]].Center; Vector2 value24 = center24 - center23; - Vector2 vector213 = value24 - Vector2.UnitY * 200f; - vector213 = Vector2.Normalize(vector213) * velocity; + value24 = Vector2.Normalize(value24) * velocity; int num1246 = 30; - npc.velocity.X = (npc.velocity.X * (float)(num1246 - 1) + vector213.X) / (float)num1246; - npc.velocity.Y = (npc.velocity.Y * (float)(num1246 - 1) + vector213.Y) / (float)num1246; + npc.velocity.X = (npc.velocity.X * (float)(num1246 - 1) + value24.X) / (float)num1246; + npc.velocity.Y = (npc.velocity.Y * (float)(num1246 - 1) + value24.Y) / (float)num1246; // Fly towards Moon Lord Head and stay away from other True Eyes - float num1247 = 0.6f; + float num1247 = 0.5f; for (int num1248 = 0; num1248 < Main.maxNPCs; num1248++) { if (Main.npc[num1248].active) { - if (Main.npc[num1248].type == NPCID.MoonLordHead && Vector2.Distance(npc.Center, Main.npc[num1248].Center) > 480f) + if (Main.npc[num1248].type == NPCID.MoonLordHead && Vector2.Distance(npc.Center, Main.npc[num1248].Center) > 600f) { if (npc.position.X < Main.npc[num1248].position.X) npc.velocity.X = npc.velocity.X - num1247; @@ -13696,7 +13695,7 @@ namespace CalamityMod.NPCs if (vector217.HasNaNs()) vector217 = Vector2.UnitY * -1f; - vector217 *= 16f; + vector217 *= 4f; Projectile.NewProjectile(npc.Center.X + vector216.X, npc.Center.Y + vector216.Y, vector217.X, vector217.Y, ProjectileID.PhantasmalSphere, 0, 0f, Main.myPlayer, 30f, (float)npc.whoAmI); } } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index e5a7139704..4bb707c388 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -306,51 +306,64 @@ namespace CalamityMod.NPCs #region Reset Effects public override void ResetEffects(NPC npc) { - void ResetSavedIndex(ref int type) + void ResetSavedIndex(ref int type, int type1, int type2 = -1) { - if (type >= 0 && !Main.npc[type].active) + if (type >= 0) { - type = -1; + if (!Main.npc[type].active) + { + type = -1; + } + else if (type2 == -1) + { + if (Main.npc[type].type != type1) + type = -1; + } + else + { + if (Main.npc[type].type != type1 && Main.npc[type].type != type2) + type = -1; + } } } for (int i = 0; i < bobbitWormBottom.Length; i++) - ResetSavedIndex(ref bobbitWormBottom[i]); + ResetSavedIndex(ref bobbitWormBottom[i], ModContent.NPCType()); - ResetSavedIndex(ref hiveMind); - ResetSavedIndex(ref perfHive); - ResetSavedIndex(ref slimeGodPurple); - ResetSavedIndex(ref slimeGodRed); - ResetSavedIndex(ref slimeGod); - ResetSavedIndex(ref laserEye); - ResetSavedIndex(ref fireEye); - ResetSavedIndex(ref primeLaser); - ResetSavedIndex(ref primeCannon); - ResetSavedIndex(ref primeVice); - ResetSavedIndex(ref primeSaw); - ResetSavedIndex(ref brimstoneElemental); - ResetSavedIndex(ref cataclysm); - ResetSavedIndex(ref catastrophe); - ResetSavedIndex(ref calamitas); - ResetSavedIndex(ref leviathan); - ResetSavedIndex(ref siren); - ResetSavedIndex(ref scavenger); - ResetSavedIndex(ref astrumDeusHeadMain); - ResetSavedIndex(ref energyFlame); - ResetSavedIndex(ref doughnutBoss); - ResetSavedIndex(ref holyBossAttacker); - ResetSavedIndex(ref holyBossDefender); - ResetSavedIndex(ref holyBossHealer); - ResetSavedIndex(ref holyBoss); - ResetSavedIndex(ref voidBoss); - ResetSavedIndex(ref signus); - ResetSavedIndex(ref ghostBossClone); - ResetSavedIndex(ref ghostBoss); - ResetSavedIndex(ref DoGHead); - ResetSavedIndex(ref SCalCataclysm); - ResetSavedIndex(ref SCalCatastrophe); - ResetSavedIndex(ref SCal); - ResetSavedIndex(ref SCalWorm); + ResetSavedIndex(ref hiveMind, ModContent.NPCType(), ModContent.NPCType()); + ResetSavedIndex(ref perfHive, ModContent.NPCType()); + ResetSavedIndex(ref slimeGodPurple, ModContent.NPCType(), ModContent.NPCType()); + ResetSavedIndex(ref slimeGodRed, ModContent.NPCType(), ModContent.NPCType()); + ResetSavedIndex(ref slimeGod, ModContent.NPCType()); + ResetSavedIndex(ref laserEye, NPCID.Retinazer); + ResetSavedIndex(ref fireEye, NPCID.Spazmatism); + ResetSavedIndex(ref primeLaser, NPCID.PrimeLaser); + ResetSavedIndex(ref primeCannon, NPCID.PrimeCannon); + ResetSavedIndex(ref primeVice, NPCID.PrimeVice); + ResetSavedIndex(ref primeSaw, NPCID.PrimeSaw); + ResetSavedIndex(ref brimstoneElemental, ModContent.NPCType()); + ResetSavedIndex(ref cataclysm, ModContent.NPCType()); + ResetSavedIndex(ref catastrophe, ModContent.NPCType()); + ResetSavedIndex(ref calamitas, ModContent.NPCType()); + ResetSavedIndex(ref leviathan, ModContent.NPCType()); + ResetSavedIndex(ref siren, ModContent.NPCType()); + ResetSavedIndex(ref scavenger, ModContent.NPCType()); + ResetSavedIndex(ref astrumDeusHeadMain, ModContent.NPCType()); + ResetSavedIndex(ref energyFlame, ModContent.NPCType()); + ResetSavedIndex(ref doughnutBoss, ModContent.NPCType()); + ResetSavedIndex(ref holyBossAttacker, ModContent.NPCType()); + ResetSavedIndex(ref holyBossDefender, ModContent.NPCType()); + ResetSavedIndex(ref holyBossHealer, ModContent.NPCType()); + ResetSavedIndex(ref holyBoss, ModContent.NPCType()); + ResetSavedIndex(ref voidBoss, ModContent.NPCType()); + ResetSavedIndex(ref signus, ModContent.NPCType()); + ResetSavedIndex(ref ghostBossClone, ModContent.NPCType()); + ResetSavedIndex(ref ghostBoss, ModContent.NPCType()); + ResetSavedIndex(ref DoGHead, ModContent.NPCType(), ModContent.NPCType()); + ResetSavedIndex(ref SCalCataclysm, ModContent.NPCType()); + ResetSavedIndex(ref SCalCatastrophe, ModContent.NPCType()); + ResetSavedIndex(ref SCal, ModContent.NPCType()); + ResetSavedIndex(ref SCalWorm, ModContent.NPCType()); } #endregion @@ -1248,13 +1261,17 @@ namespace CalamityMod.NPCs #region Strike NPC public override bool StrikeNPC(NPC npc, ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { - if (DestroyerIDs.Contains(npc.type)) - { - if ((newAI[1] < 480f || newAI[2] > 0f) && (CalamityWorld.revenge || CalamityWorld.bossRushActive)) - { - damage *= 0.01; - } - } + Mod chaos = ModLoader.GetMod("ChaosMod"); + if ((CalamityWorld.revenge && chaos == null) || CalamityWorld.bossRushActive) + { + if (DestroyerIDs.Contains(npc.type)) + { + if (newAI[1] < 480f || newAI[2] > 0f) + { + damage *= 0.01; + } + } + } // Override hand/head eye 'death' code and use custom 'death' code instead, this is here just in case the AI code fails if (CalamityWorld.revenge || CalamityWorld.bossRushActive) diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index b62070059a..323cba6600 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.Polterghast private bool spawnGhost = false; public static float phase1DR = 0.1f; public static float phase2DR = 0.15f; - public static float phase3DR = 0.2f; + public static float phase3DR = 0.35f; public override void SetStaticDefaults() { diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 85da93d865..ef6c017c60 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.width = 44; npc.height = 44; npc.defense = 6; - npc.LifeMaxNERB(5000, 6250, 2500000); + npc.LifeMaxNERB(4000, 5000, 2500000); double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); NPCID.Sets.TrailCacheLength[npc.type] = 8; @@ -199,7 +199,7 @@ namespace CalamityMod.NPCs.SlimeGod else if (npc.timeLeft < 1800) npc.timeLeft = 1800; - float ai1 = hyperMode ? 210f : 300f; + float ai1 = hyperMode ? 270f : 360f; // Hide inside large slime if (!hyperMode && npc.ai[1] < ai1) @@ -236,8 +236,10 @@ namespace CalamityMod.NPCs.SlimeGod Vector2 purpleSlimeVector = new Vector2(npc.Calamity().newAI[0], npc.Calamity().newAI[1]); Vector2 redSlimeVector = new Vector2(npc.localAI[2], npc.localAI[3]); - Vector2 goToPosition = (buffedSlime == 1 ? purpleSlimeVector : redSlimeVector) - vectorCenter; - npc.velocity = Vector2.Normalize(goToPosition) * 12f; + Vector2 goToVector = buffedSlime == 1 ? purpleSlimeVector : redSlimeVector; + + Vector2 goToPosition = goToVector - vectorCenter; + npc.velocity = Vector2.Normalize(goToPosition) * (CalamityWorld.bossRushActive ? 24f : 16f); npc.ai[2] += 1f; if (npc.ai[2] >= 600f) diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index 1b11466aa5..f5dd461f36 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -259,8 +259,7 @@ namespace CalamityMod.UI ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), - ModContent.NPCType(), - ModContent.NPCType() + ModContent.NPCType() }; }