From c8b29393ac6c1dfaa5196de0e435d5fe0f79adef Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Wed, 7 Jun 2023 17:56:41 -0500 Subject: [PATCH] Legendary Rev+ GFB introduces the true Murderswarm. Added GFB drops to Bumblefuck and Guardians. --- NPCs/Bumblebirb/Bumblefuck.cs | 5 +++++ NPCs/CalamityAI.cs | 11 ++++++++--- NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs | 8 ++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index c5f4dbadd1..af973929ba 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -25,6 +25,8 @@ using Terraria.GameContent.ItemDropRules; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Items.Pets; +using CalamityMod.Items.Potions; namespace CalamityMod.NPCs.Bumblebirb { @@ -449,6 +451,9 @@ namespace CalamityMod.NPCs.Bumblebirb // Relic npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); + // GFB Omega Healing Potion drop + npcLoot.DefineConditionalDropSet(DropHelper.GFB).Add(ModContent.ItemType(), 1, 50, 100); + // Lore npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDragonfolly, ModContent.ItemType(), desc: DropHelper.FirstKillText); } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 88aeca723a..f20e8111b5 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -5039,7 +5039,7 @@ namespace CalamityMod.NPCs } // Max spawn amount - int maxBirbs = revenge ? 3 : 2; + int maxBirbs = (CalamityWorld.getFixedBoi && CalamityWorld.LegendaryMode && revenge) ? 12 : revenge ? 3 : 2; // Variable for charging float chargeDistance = 600f; @@ -5334,13 +5334,16 @@ namespace CalamityMod.NPCs float velocity = 8f + (enrageScale - 1f) * 2f; float scaleFactor17 = velocity + npc.ai[2] + value53.Length() / 120f; + if (CalamityWorld.getFixedBoi && CalamityWorld.LegendaryMode && revenge) + scaleFactor17 *= 2f; + float num1309 = 20f; value53.Normalize(); value53 *= scaleFactor17; npc.velocity = (npc.velocity * (num1309 - 1f) + value53) / num1309; npc.ai[1] += 1f; - if (npc.ai[1] >= 120f || !Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1)) + if (npc.ai[1] >= ((CalamityWorld.getFixedBoi && CalamityWorld.LegendaryMode && revenge) ? 60f : 120f) || !Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1)) { npc.TargetClosest(); npc.ai[0] = 0f; @@ -5516,12 +5519,14 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { - bool spawnFlag = NPC.CountNPCS(ModContent.NPCType()) < maxBirbs && (npc.ai[1] == 140f || (revenge && npc.ai[1] == 155f) || npc.ai[1] == 170f); + bool gfbSpawnFlag = CalamityWorld.getFixedBoi && CalamityWorld.LegendaryMode && revenge && (npc.ai[1] == 145f || npc.ai[1] == 150f || npc.ai[1] == 160f || npc.ai[1] == 165f); + bool spawnFlag = NPC.CountNPCS(ModContent.NPCType()) < maxBirbs && (npc.ai[1] == 140f || (revenge && npc.ai[1] == 155f) || npc.ai[1] == 170f || gfbSpawnFlag); if (spawnFlag) { Vector2 vector7 = npc.Center + (MathHelper.TwoPi * Main.rand.NextFloat()).ToRotationVector2() * new Vector2(2f, 1f) * 50f * (0.6f + Main.rand.NextFloat() * 0.4f); if (Vector2.Distance(vector7, player.Center) > 150f) NPC.NewNPC(npc.GetSource_FromAI(), (int)vector7.X, (int)vector7.Y, ModContent.NPCType(), npc.whoAmI); + npc.netUpdate = true; } } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index a29a831bce..e31fa08fb5 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -21,6 +21,7 @@ using CalamityMod.Items.Placeables.Furniture.DevPaintings; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Events; using Terraria.Audio; +using CalamityMod.Items.Materials; namespace CalamityMod.NPCs.ProfanedGuardians { @@ -1166,6 +1167,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Relic npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); + // GFB Chicken Nugget and Divine Geode drops + var GFBOnly = npcLoot.DefineConditionalDropSet(DropHelper.GFB); + { + GFBOnly.Add(ItemID.ChickenNugget, 1, 1, 9999); + GFBOnly.Add(ModContent.ItemType(), 1, 25, 30); + } + // Lore npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedGuardians, ModContent.ItemType(), desc: DropHelper.FirstKillText); }