diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 64fe69fe35..1bbe15114a 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -8736,7 +8736,7 @@ namespace CalamityMod.CalPlayer price += Item.buyPrice(0, 3, 20, 0); else if (NPC.downedMoonlord) price += Item.buyPrice(0, 2, 0, 0); - else if (NPC.downedFishron || DownedBossSystem.downedPlaguebringer || DownedBossSystem.downedScavenger) + else if (NPC.downedFishron || DownedBossSystem.downedPlaguebringer || DownedBossSystem.downedRavager) price += Item.buyPrice(0, 1, 20, 0); else if (NPC.downedGolemBoss) price += Item.buyPrice(0, 0, 90, 0); diff --git a/Items/Fishing/AstralCatches/AstralCrate.cs b/Items/Fishing/AstralCatches/AstralCrate.cs index 34fdb23eb2..6362e7d4ad 100644 --- a/Items/Fishing/AstralCatches/AstralCrate.cs +++ b/Items/Fishing/AstralCatches/AstralCrate.cs @@ -50,13 +50,13 @@ namespace CalamityMod.Items.Fishing.AstralCatches DropHelper.DropItem(player, ItemID.FallenStar, 5, 10); DropHelper.DropItemChance(player, ItemID.Meteorite, 0.2f, 10, 20); DropHelper.DropItemChance(player, ItemID.MeteoriteBar, 0.1f, 1, 3); - DropHelper.DropItemCondition(player, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 0.2f, 2, 5); - DropHelper.DropItemCondition(player, ModContent.ItemType(), DownedBossSystem.downedStarGod, 0.2f, 10, 20); - DropHelper.DropItemCondition(player, ModContent.ItemType(), DownedBossSystem.downedStarGod, 0.1f, 1, 3); - DropHelper.DropItemCondition(player, ModContent.ItemType(), DownedBossSystem.downedStarGod, 0.25f, 5, 10); + DropHelper.DropItemCondition(player, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 0.2f, 2, 5); + DropHelper.DropItemCondition(player, ModContent.ItemType(), DownedBossSystem.downedAstrumDeus, 0.2f, 10, 20); + DropHelper.DropItemCondition(player, ModContent.ItemType(), DownedBossSystem.downedAstrumDeus, 0.1f, 1, 3); + DropHelper.DropItemCondition(player, ModContent.ItemType(), DownedBossSystem.downedAstrumDeus, 0.25f, 5, 10); // Weapons - DropHelper.DropItemFromSetCondition(player, DownedBossSystem.downedAstrageldon, 0.1f, + DropHelper.DropItemFromSetCondition(player, DownedBossSystem.downedAstrumAureus, 0.1f, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -83,8 +83,8 @@ namespace CalamityMod.Items.Fishing.AstralCatches DropHelper.DropItemChance(player, ItemID.MiningPotion, 10, 1, 3); DropHelper.DropItemChance(player, ItemID.HeartreachPotion, 10, 1, 3); DropHelper.DropItemChance(player, ItemID.TrapsightPotion, 10, 1, 3); //Dangersense Potion - DropHelper.DropItemCondition(player, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 0.1f, 1, 3); - DropHelper.DropItemCondition(player, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 0.1f, 1, 3); + DropHelper.DropItemCondition(player, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 0.1f, 1, 3); + DropHelper.DropItemCondition(player, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 0.1f, 1, 3); int healingPotID = ItemID.HealingPotion; int manaPotID = ItemID.ManaPotion; if (DownedBossSystem.downedDoG) diff --git a/Items/Placeables/AstralFossil.cs b/Items/Placeables/AstralFossil.cs index 3184b67f11..59f9c7d266 100644 --- a/Items/Placeables/AstralFossil.cs +++ b/Items/Placeables/AstralFossil.cs @@ -153,7 +153,7 @@ namespace CalamityMod.Items.Placeables resultType = CalamityConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre) : ItemID.TitaniumOre; resultStack = Main.rand.Next(1, 17); } - else if (DownedBossSystem.downedStarGod) + else if (DownedBossSystem.downedAstrumDeus) { resultType = ModContent.ItemType(); resultStack = Main.rand.Next(1, 2); diff --git a/Items/Placeables/AstralSilt.cs b/Items/Placeables/AstralSilt.cs index 67b31cde7e..9742698d32 100644 --- a/Items/Placeables/AstralSilt.cs +++ b/Items/Placeables/AstralSilt.cs @@ -136,7 +136,7 @@ namespace CalamityMod.Items.Placeables resultType = CalamityConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre) : ItemID.TitaniumOre; resultStack = Main.rand.Next(1, 17); } - else if (DownedBossSystem.downedStarGod) + else if (DownedBossSystem.downedAstrumDeus) { resultType = ModContent.ItemType(); resultStack = Main.rand.Next(1, 2); diff --git a/Items/SummonItems/CosmicWorm.cs b/Items/SummonItems/CosmicWorm.cs index 17f83b87da..520b49b20a 100644 --- a/Items/SummonItems/CosmicWorm.cs +++ b/Items/SummonItems/CosmicWorm.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.SummonItems public override void ModifyTooltips(List list) { TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip1"); - bool sentinelsNotDefeated = !DownedBossSystem.downedSentinel1 || !DownedBossSystem.downedSentinel2 || !DownedBossSystem.downedSentinel3; + bool sentinelsNotDefeated = !DownedBossSystem.downedCeaselessVoid || !DownedBossSystem.downedStormWeaver || !DownedBossSystem.downedSignus; if (line != null) line.Text = sentinelsNotDefeated ? "WARNING! Some sentinels have not been truly defeated yet and will spawn at full power during this fight!" : ""; diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 85f62321c6..8bbefabfe2 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -152,7 +152,7 @@ namespace CalamityMod case "aureus": case "astrumaureus": case "astrum aureus": - return DownedBossSystem.downedAstrageldon; + return DownedBossSystem.downedAstrumAureus; case "pbg": case "plaguebringer": @@ -164,13 +164,13 @@ namespace CalamityMod case "scavenger": // backwards compatibility case "ravager": - return DownedBossSystem.downedScavenger; + return DownedBossSystem.downedRavager; case "stargod": // backwards compatibility case "star god": // backwards compatibility case "astrumdeus": case "astrum deus": - return DownedBossSystem.downedStarGod; + return DownedBossSystem.downedAstrumDeus; case "guardians": case "donuts": @@ -184,7 +184,7 @@ namespace CalamityMod case "the dragonfolly": case "bumblebirb": case "bumblefuck": - return DownedBossSystem.downedBumble; + return DownedBossSystem.downedDragonfolly; case "providence": case "providencetheprofanedgoddess": @@ -220,12 +220,12 @@ namespace CalamityMod case "void": case "ceaselessvoid": case "ceaseless void": - return DownedBossSystem.downedSentinel1; + return DownedBossSystem.downedCeaselessVoid; case "sentinel2": // backwards compatibility case "stormweaver": case "storm weaver": - return DownedBossSystem.downedSentinel2; + return DownedBossSystem.downedStormWeaver; case "sentinel3": // backwards compatibility case "cosmicwraith": @@ -234,7 +234,7 @@ namespace CalamityMod case "signusenvoyofthedevourer": case "signus envoy of the devourer": case "signus, envoy of the devourer": - return DownedBossSystem.downedSentinel3; + return DownedBossSystem.downedSignus; case "sentinelany": // backwards compatibility case "anysentinel": @@ -242,14 +242,14 @@ namespace CalamityMod case "onesentinel": case "one sentinel": case "sentinel": - return DownedBossSystem.downedSentinel1 || DownedBossSystem.downedSentinel2 || DownedBossSystem.downedSentinel3; + return DownedBossSystem.downedCeaselessVoid || DownedBossSystem.downedStormWeaver || DownedBossSystem.downedSignus; case "sentinelall": // backwards compatibility case "sentinels": case "allsentinel": case "allsentinels": case "all sentinels": - return DownedBossSystem.downedSentinel1 && DownedBossSystem.downedSentinel2 && DownedBossSystem.downedSentinel3; + return DownedBossSystem.downedCeaselessVoid && DownedBossSystem.downedStormWeaver && DownedBossSystem.downedSignus; case "dog": case "devourerofgods": diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index b3f9bcda8e..1a022a146b 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -91,16 +91,16 @@ namespace CalamityMod public static readonly Func DownedCalamitas = () => DownedBossSystem.downedCalamitas; public static readonly Func DownedGSS = () => DownedBossSystem.downedGSS; public static readonly Func DownedLeviathan = () => DownedBossSystem.downedLeviathan; - public static readonly Func DownedAureus = () => DownedBossSystem.downedAstrageldon; + public static readonly Func DownedAureus = () => DownedBossSystem.downedAstrumAureus; public static readonly Func DownedPBG = () => DownedBossSystem.downedPlaguebringer; - public static readonly Func DownedRavager = () => DownedBossSystem.downedScavenger; - public static readonly Func DownedDeus = () => DownedBossSystem.downedStarGod; + public static readonly Func DownedRavager = () => DownedBossSystem.downedRavager; + public static readonly Func DownedDeus = () => DownedBossSystem.downedAstrumDeus; public static readonly Func DownedGuardians = () => DownedBossSystem.downedGuardians; - public static readonly Func DownedBirb = () => DownedBossSystem.downedBumble; + public static readonly Func DownedBirb = () => DownedBossSystem.downedDragonfolly; public static readonly Func DownedProvidence = () => DownedBossSystem.downedProvidence; - public static readonly Func DownedCeaselessVoid = () => DownedBossSystem.downedSentinel1; - public static readonly Func DownedStormWeaver = () => DownedBossSystem.downedSentinel2; - public static readonly Func DownedSignus = () => DownedBossSystem.downedSentinel3; + public static readonly Func DownedCeaselessVoid = () => DownedBossSystem.downedCeaselessVoid; + public static readonly Func DownedStormWeaver = () => DownedBossSystem.downedStormWeaver; + public static readonly Func DownedSignus = () => DownedBossSystem.downedSignus; public static readonly Func DownedPolterghast = () => DownedBossSystem.downedPolterghast; public static readonly Func DownedBoomerDuke = () => DownedBossSystem.downedBoomerDuke; public static readonly Func DownedDoG = () => DownedBossSystem.downedDoG; diff --git a/NPCs/Astral/Aries.cs b/NPCs/Astral/Aries.cs index eceb078958..9b48737151 100644 --- a/NPCs/Astral/Aries.cs +++ b/NPCs/Astral/Aries.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.Astral NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 85; NPC.defense = 24; @@ -124,7 +124,7 @@ namespace CalamityMod.NPCs.Astral { DropHelper.DropItemChance(NPC, ModContent.ItemType(), 0.5f, 1, 2); DropHelper.DropItemCondition(NPC, ModContent.ItemType(), Main.expertMode); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 7, 1, 1); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 7, 1, 1); } } } diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index ce5a9d550d..0a4bfa6e7c 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.Astral NPC.DeathSound = SoundID.NPCDeath14; Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 30; NPC.defense = 20; @@ -143,7 +143,7 @@ namespace CalamityMod.NPCs.Astral if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height)) { int num8 = Main.expertMode ? 14 : 18; - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) num8 += 6; int num9 = ProjectileID.PinkLaser; diff --git a/NPCs/Astral/AstralSlime.cs b/NPCs/Astral/AstralSlime.cs index 3158344e3d..123c690fde 100644 --- a/NPCs/Astral/AstralSlime.cs +++ b/NPCs/Astral/AstralSlime.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Astral animationType = NPCID.BlueSlime; Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 65; NPC.defense = 18; @@ -84,8 +84,8 @@ namespace CalamityMod.NPCs.Astral DropHelper.DropItemChance(NPC, ModContent.ItemType(), Main.expertMode ? 1 : 2, 1, 3); int oreMin = Main.expertMode ? 11 : 8; int oreMax = Main.expertMode ? 16 : 12; - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedStarGod, oreMin, oreMax); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 0.05f, 1, 1); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrumDeus, oreMin, oreMax); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 0.05f, 1, 1); } } } diff --git a/NPCs/Astral/AstralachneaGround.cs b/NPCs/Astral/AstralachneaGround.cs index 29cd351ad5..946df42c01 100644 --- a/NPCs/Astral/AstralachneaGround.cs +++ b/NPCs/Astral/AstralachneaGround.cs @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Astral animationType = NPCID.WallCreeper; Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 90; NPC.defense = 30; @@ -171,7 +171,7 @@ namespace CalamityMod.NPCs.Astral { DropHelper.DropItem(NPC, ModContent.ItemType(), 2, 3); DropHelper.DropItemCondition(NPC, ModContent.ItemType(), Main.expertMode); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 7, 1, 1); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 7, 1, 1); } } } diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index ee149a2751..184ff95752 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -47,7 +47,7 @@ namespace CalamityMod.NPCs.Astral animationType = NPCID.BlackRecluseWall; Banner = ModContent.NPCType(); BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 90; NPC.defense = 30; @@ -144,7 +144,7 @@ namespace CalamityMod.NPCs.Astral { DropHelper.DropItem(NPC, ModContent.ItemType(), 2, 3); DropHelper.DropItemCondition(NPC, ModContent.ItemType(), Main.expertMode); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 7, 1, 1); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 7, 1, 1); } } } diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index e671624c90..404370558f 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.Astral NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AtlasDeath"); Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 100; NPC.defense = 50; @@ -622,7 +622,7 @@ namespace CalamityMod.NPCs.Astral { return 0f; } - else if (spawnInfo.Player.InAstral(1) && NPC.downedAncientCultist && !DownedBossSystem.downedStarGod) + else if (spawnInfo.Player.InAstral(1) && NPC.downedAncientCultist && !DownedBossSystem.downedAstrumDeus) { return 0.27f; } @@ -644,7 +644,7 @@ namespace CalamityMod.NPCs.Astral int maxStardust = Main.expertMode ? 9 : 8; DropHelper.DropItem(NPC, ModContent.ItemType(), minStardust, maxStardust); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 7, 1, 1); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 7, 1, 1); DropHelper.DropItem(NPC, ModContent.ItemType()); } } diff --git a/NPCs/Astral/BigSightseer.cs b/NPCs/Astral/BigSightseer.cs index dd0128e2f6..54c813f19e 100644 --- a/NPCs/Astral/BigSightseer.cs +++ b/NPCs/Astral/BigSightseer.cs @@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.Astral NPC.aiStyle = -1; Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 85; NPC.defense = 30; @@ -197,7 +197,7 @@ namespace CalamityMod.NPCs.Astral NPC.noTileCollide = true; NPC.alpha = 80; NPC.aiStyle = -1; - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 75; } diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index 29a348e68a..c9159b7901 100644 --- a/NPCs/Astral/FusionFeeder.cs +++ b/NPCs/Astral/FusionFeeder.cs @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.Astral animationType = NPCID.SandShark; Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 65; NPC.defense = 22; diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index 6b8c15e837..4ddd87182b 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Astral NPC.value = Item.buyPrice(0, 0, 15, 0); Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 80; NPC.defense = 18; @@ -209,7 +209,7 @@ namespace CalamityMod.NPCs.Astral { DropHelper.DropItem(NPC, ModContent.ItemType(), 2, 3); DropHelper.DropItemCondition(NPC, ModContent.ItemType(), Main.expertMode); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 2, 2, 3); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 2, 2, 3); } } } diff --git a/NPCs/Astral/Hive.cs b/NPCs/Astral/Hive.cs index a1b3bf4ff7..d8956c8ad3 100644 --- a/NPCs/Astral/Hive.cs +++ b/NPCs/Astral/Hive.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Astral NPC.value = Item.buyPrice(0, 0, 15, 0); Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 90; NPC.defense = 25; @@ -143,7 +143,7 @@ namespace CalamityMod.NPCs.Astral { DropHelper.DropItem(NPC, ModContent.ItemType(), 2, 3); DropHelper.DropItemCondition(NPC, ModContent.ItemType(), Main.expertMode); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 7, 1, 1); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 7, 1, 1); } } } diff --git a/NPCs/Astral/Hiveling.cs b/NPCs/Astral/Hiveling.cs index 8671755d33..13af29b6a4 100644 --- a/NPCs/Astral/Hiveling.cs +++ b/NPCs/Astral/Hiveling.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Astral NPC.knockBackResist = 0.5f; NPC.noGravity = true; NPC.value = Item.buyPrice(0, 0, 5, 0); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 50; NPC.defense = 8; diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index c934b0a242..d784cf719a 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.Astral NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 85; NPC.defense = 16; @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.Astral SoundEngine.PlaySound(SoundID.Item71, NPC.position); Vector2 vector = Main.player[NPC.target].Center - NPC.Center; vector.Normalize(); - int damage = DownedBossSystem.downedAstrageldon ? 55 : 45; + int damage = DownedBossSystem.downedAstrumAureus ? 55 : 45; Projectile.NewProjectile(NPC.Center + (NPC.Center.X < target.Center.X ? -14f : 14f) * Vector2.UnitX, vector * 7f, ModContent.ProjectileType(), damage, 0f); } } @@ -240,7 +240,7 @@ namespace CalamityMod.NPCs.Astral { DropHelper.DropItem(NPC, ModContent.ItemType(), 2, 3); DropHelper.DropItemCondition(NPC, ModContent.ItemType(), Main.expertMode); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 7, 1, 1); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 7, 1, 1); } } } diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index 98198c9d3c..22054ce7b6 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.Astral NPC.aiStyle = -1; Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 75; NPC.defense = 25; @@ -288,7 +288,7 @@ namespace CalamityMod.NPCs.Astral { DropHelper.DropItem(NPC, ModContent.ItemType(), 2, 3); DropHelper.DropItemCondition(NPC, ModContent.ItemType(), Main.expertMode); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 7, 1, 1); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 7, 1, 1); DropHelper.DropItemChance(NPC, ModContent.ItemType(), 7, 1, 1); } } diff --git a/NPCs/Astral/SmallSightseer.cs b/NPCs/Astral/SmallSightseer.cs index 9cbbf064b5..10a38b89ff 100644 --- a/NPCs/Astral/SmallSightseer.cs +++ b/NPCs/Astral/SmallSightseer.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Astral NPC.aiStyle = -1; Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 58; NPC.defense = 26; diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index c0f95e5ce7..f827cf4f72 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.Astral animationType = NPCID.GiantFlyingFox; Banner = NPC.type; BannerItem = ModContent.ItemType(); - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 90; NPC.defense = 28; @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.Astral { DropHelper.DropItemChance(NPC, ModContent.ItemType(), 0.5f, 1, 2); DropHelper.DropItemCondition(NPC, ModContent.ItemType(), Main.expertMode); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrageldon, 7, 1, 1); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedAstrumAureus, 7, 1, 1); } } } diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index adbf63a81e..f2fc6f694d 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -318,9 +318,9 @@ namespace CalamityMod.NPCs.AstrumAureus DropHelper.DropBags(NPC); DropHelper.DropItemChance(NPC, ModContent.ItemType(), 10); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), true, !DownedBossSystem.downedAstrageldon); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), true, !DownedBossSystem.downedAstrumAureus); - CalamityGlobalNPC.SetNewShopVariable(new int[] { NPCID.Wizard, ModContent.NPCType() }, DownedBossSystem.downedAstrageldon); + CalamityGlobalNPC.SetNewShopVariable(new int[] { NPCID.Wizard, ModContent.NPCType() }, DownedBossSystem.downedAstrumAureus); // All other drops are contained in the bag, so they only drop directly on Normal if (!Main.expertMode) @@ -359,7 +359,7 @@ namespace CalamityMod.NPCs.AstrumAureus ThreadPool.QueueUserWorkItem(_ => AstralBiome.PlaceAstralMeteor()); // If Astrum Aureus has not yet been killed, notify players of new Astral enemy drops - if (!DownedBossSystem.downedAstrageldon) + if (!DownedBossSystem.downedAstrumAureus) { string key = "Mods.CalamityMod.AureusBossText"; string key2 = "Mods.CalamityMod.AureusBossText2"; @@ -370,7 +370,7 @@ namespace CalamityMod.NPCs.AstrumAureus } // Mark Astrum Aureus as dead - DownedBossSystem.downedAstrageldon = true; + DownedBossSystem.downedAstrumAureus = true; CalamityNetcode.SyncWorld(); } diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index c96d0edf7e..c4b8331e2e 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -252,8 +252,8 @@ namespace CalamityMod.NPCs.AstrumDeus DropHelper.DropItem(NPC, ItemID.GreaterHealingPotion, 8, 14); DropHelper.DropItemChance(NPC, ModContent.ItemType(), 10); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), !DownedBossSystem.downedStarGod); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), !DownedBossSystem.downedStarGod); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), !DownedBossSystem.downedAstrumDeus); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), !DownedBossSystem.downedAstrumDeus); // Drop a large spray of all 4 lunar fragments int minFragments = Main.expertMode ? 20 : 16; @@ -288,7 +288,7 @@ namespace CalamityMod.NPCs.AstrumDeus } // Notify players that Astral Ore can be mined if Deus has never been killed yet - if (!DownedBossSystem.downedStarGod) + if (!DownedBossSystem.downedAstrumDeus) { string key = "Mods.CalamityMod.AstralBossText"; Color messageColor = Color.Gold; @@ -296,7 +296,7 @@ namespace CalamityMod.NPCs.AstrumDeus } // Mark Astrum Deus as dead - DownedBossSystem.downedStarGod = true; + DownedBossSystem.downedAstrumDeus = true; CalamityNetcode.SyncWorld(); } diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index 9c8140d88b..3dd77029f1 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -398,7 +398,7 @@ namespace CalamityMod.NPCs.Bumblebirb DropHelper.DropBags(NPC); DropHelper.DropItemChance(NPC, ModContent.ItemType(), 10); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), true, !DownedBossSystem.downedBumble); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), true, !DownedBossSystem.downedDragonfolly); // All other drops are contained in the bag, so they only drop directly on Normal if (!Main.expertMode) @@ -425,7 +425,7 @@ namespace CalamityMod.NPCs.Bumblebirb DropHelper.DropItemCondition(NPC, ModContent.ItemType(), !Main.expertMode, 0.1f); // Mark The Dragonfolly as dead - DownedBossSystem.downedBumble = true; + DownedBossSystem.downedDragonfolly = true; CalamityNetcode.SyncWorld(); } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index f725433ded..3dcd25868e 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -4234,7 +4234,7 @@ namespace CalamityMod.NPCs } // Destroy all Dark Energies if their total HP is below 20% - int darkEnergyMaxHP = BossRushEvent.BossRushActive ? 44000 : (CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedSentinel1) ? 12000 : 3000; + int darkEnergyMaxHP = BossRushEvent.BossRushActive ? 44000 : (CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedCeaselessVoid) ? 12000 : 3000; int totalDarkEnergiesSpawned = darkEnergyAmt * 3 + 2; int totalDarkEnergyMaxHP = darkEnergyMaxHP * totalDarkEnergiesSpawned; int succPhaseGateValue = (int)(totalDarkEnergyMaxHP * 0.2); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 8d3f5c8b3d..138e81ccf5 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5402,11 +5402,11 @@ namespace CalamityMod.NPCs } else if (type == NPCType()) { - return DownedBossSystem.downedAstrageldon; + return DownedBossSystem.downedAstrumAureus; } else if (type == NPCType() || type == NPCType() || type == NPCType()) { - return DownedBossSystem.downedStarGod; + return DownedBossSystem.downedAstrumDeus; } else if (type == NPCType()) { @@ -5414,7 +5414,7 @@ namespace CalamityMod.NPCs } else if (type == NPCType()) { - return DownedBossSystem.downedScavenger; + return DownedBossSystem.downedRavager; } else if (type == NPCType()) { @@ -5422,7 +5422,7 @@ namespace CalamityMod.NPCs } else if (type == NPCType()) { - return DownedBossSystem.downedBumble; + return DownedBossSystem.downedDragonfolly; } else if (type == NPCType()) { @@ -5430,15 +5430,15 @@ namespace CalamityMod.NPCs } else if (type == NPCType() || type == NPCType()) { - return DownedBossSystem.downedSentinel1; + return DownedBossSystem.downedCeaselessVoid; } else if (type == NPCType() || type == NPCType() || type == NPCType()) { - return DownedBossSystem.downedSentinel2; + return DownedBossSystem.downedStormWeaver; } else if (type == NPCType()) { - return DownedBossSystem.downedSentinel3; + return DownedBossSystem.downedSignus; } else if (type == NPCType()) { diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index ee06d64359..c400353a85 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.CeaselessVoid CalamityGlobalNPC global = NPC.Calamity(); global.DR = 0.5f; - bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedSentinel1; + bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedCeaselessVoid; NPC.LifeMaxNERB(notDoGFight ? 64400 : 16100, notDoGFight ? 77280 : 19320, 72000); // If fought alone, Ceaseless Void plays its own theme @@ -181,7 +181,7 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void NPCLoot() { // Only drop items if fought at full strength - bool fullStrength = !DownedBossSystem.downedSentinel1 || CalamityWorld.DoGSecondStageCountdown <= 0; + bool fullStrength = !DownedBossSystem.downedCeaselessVoid || CalamityWorld.DoGSecondStageCountdown <= 0; if (fullStrength) { CalamityGlobalNPC.SetNewBossJustDowned(NPC); @@ -189,7 +189,7 @@ namespace CalamityMod.NPCs.CeaselessVoid DropHelper.DropBags(NPC); DropHelper.DropItemChance(NPC, ModContent.ItemType(), 10); - bool lastSentinelKilled = !DownedBossSystem.downedSentinel1 && DownedBossSystem.downedSentinel2 && DownedBossSystem.downedSentinel3; + bool lastSentinelKilled = !DownedBossSystem.downedCeaselessVoid && DownedBossSystem.downedStormWeaver && DownedBossSystem.downedSignus; DropHelper.DropItemCondition(NPC, ModContent.ItemType(), true, lastSentinelKilled); if (!Main.expertMode) @@ -232,7 +232,7 @@ namespace CalamityMod.NPCs.CeaselessVoid // Mark Ceaseless Void as dead if (fullStrength) { - DownedBossSystem.downedSentinel1 = true; + DownedBossSystem.downedCeaselessVoid = true; CalamityNetcode.SyncWorld(); } } diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index 859f9ac2a0..e76202eddb 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.CeaselessVoid NPC.height = 80; NPC.defense = 50; NPC.lifeMax = 3000; - if (CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedSentinel1) + if (CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedCeaselessVoid) { NPC.lifeMax = 12000; } diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index a808628cef..cc8fb5cdbd 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; + namespace CalamityMod.NPCs.NormalNPCs { public class AeroSlime : ModNPC @@ -63,9 +64,9 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void NPCLoot() + public override void ModifyNPCLoot(NPCLoot npcLoot) { - DropHelper.DropItem(NPC, ModContent.ItemType(), 10, 26); + npcLoot.Add(ModContent.ItemType(), 1, 10, 26); } } } diff --git a/NPCs/NormalNPCs/AngryDog.cs b/NPCs/NormalNPCs/AngryDog.cs index 3d7dd86c7d..e2c55d1f9b 100644 --- a/NPCs/NormalNPCs/AngryDog.cs +++ b/NPCs/NormalNPCs/AngryDog.cs @@ -146,10 +146,10 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void NPCLoot() + public override void ModifyNPCLoot(NPCLoot npcLoot) { - DropHelper.DropItemChance(NPC, ItemID.Leather, 1, 1, 2); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), DownedBossSystem.downedCryogen, 3, 1, 1); + npcLoot.Add(ItemID.Leather, 1, 1, 2); // 100% chance of 1-2 leather + npcLoot.AddIf(() => DownedBossSystem.downedCryogen, ModContent.ItemType(), 3); } } } diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index f7b7ee99b1..8b5c9b7737 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -776,7 +776,7 @@ namespace CalamityMod.NPCs.Ravager DropHelper.DropBags(NPC); DropHelper.DropItemChance(NPC, ModContent.ItemType(), 10); - DropHelper.DropItemCondition(NPC, ModContent.ItemType(), true, !DownedBossSystem.downedScavenger); + DropHelper.DropItemCondition(NPC, ModContent.ItemType(), true, !DownedBossSystem.downedRavager); // All other drops are contained in the bag, so they only drop directly on Normal if (!Main.expertMode) @@ -807,7 +807,7 @@ namespace CalamityMod.NPCs.Ravager DropHelper.DropItemCondition(NPC, ModContent.ItemType(), !Main.expertMode, 0.1f); // Mark Ravager as dead - DownedBossSystem.downedScavenger = true; + DownedBossSystem.downedRavager = true; CalamityNetcode.SyncWorld(); } } diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index be4e21e77f..8a28fbec9d 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Signus NPC.height = 130; NPC.defense = 60; - bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedSentinel3; + bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedSignus; NPC.LifeMaxNERB(notDoGFight ? 297000 : 73000, notDoGFight ? 356400 : 87600, 240000); // If fought alone, Signus plays his own theme @@ -752,7 +752,7 @@ namespace CalamityMod.NPCs.Signus public override void NPCLoot() { // Only drop items if fought at full strength - bool fullStrength = !DownedBossSystem.downedSentinel3 || CalamityWorld.DoGSecondStageCountdown <= 0; + bool fullStrength = !DownedBossSystem.downedSignus || CalamityWorld.DoGSecondStageCountdown <= 0; if (fullStrength) { CalamityGlobalNPC.SetNewBossJustDowned(NPC); @@ -760,7 +760,7 @@ namespace CalamityMod.NPCs.Signus DropHelper.DropBags(NPC); DropHelper.DropItemChance(NPC, ModContent.ItemType(), 10); - bool lastSentinelKilled = DownedBossSystem.downedSentinel1 && DownedBossSystem.downedSentinel2 && !DownedBossSystem.downedSentinel3; + bool lastSentinelKilled = DownedBossSystem.downedCeaselessVoid && DownedBossSystem.downedStormWeaver && !DownedBossSystem.downedSignus; DropHelper.DropItemCondition(NPC, ModContent.ItemType(), true, lastSentinelKilled); if (!Main.expertMode) @@ -806,7 +806,7 @@ namespace CalamityMod.NPCs.Signus // Mark Signus as dead if (fullStrength) { - DownedBossSystem.downedSentinel3 = true; + DownedBossSystem.downedSignus = true; CalamityNetcode.SyncWorld(); } } diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index cf178bcccb..77c497db09 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.StormWeaver NPC.height = 40; // 10% of HP is phase one - bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedSentinel2; + bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedStormWeaver; NPC.lifeMax = notDoGFight ? 825500 : 139750; NPC.LifeMaxNERB(NPC.lifeMax, NPC.lifeMax, 475000); diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 6ec7870850..47a849a006 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.StormWeaver NPC.height = 74; // 10% of HP is phase one - bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedSentinel2; + bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedStormWeaver; NPC.lifeMax = notDoGFight ? 825500 : 139750; NPC.LifeMaxNERB(NPC.lifeMax, NPC.lifeMax, 475000); @@ -754,7 +754,7 @@ namespace CalamityMod.NPCs.StormWeaver public override void NPCLoot() { // Only drop items if fought at full strength - bool fullStrength = !DownedBossSystem.downedSentinel2 || CalamityWorld.DoGSecondStageCountdown <= 0; + bool fullStrength = !DownedBossSystem.downedStormWeaver || CalamityWorld.DoGSecondStageCountdown <= 0; if (fullStrength) { CalamityGlobalNPC.SetNewBossJustDowned(NPC); @@ -762,7 +762,7 @@ namespace CalamityMod.NPCs.StormWeaver DropHelper.DropBags(NPC); DropHelper.DropItemChance(NPC, ModContent.ItemType(), 10); - bool lastSentinelKilled = DownedBossSystem.downedSentinel1 && !DownedBossSystem.downedSentinel2 && DownedBossSystem.downedSentinel3; + bool lastSentinelKilled = DownedBossSystem.downedCeaselessVoid && !DownedBossSystem.downedStormWeaver && DownedBossSystem.downedSignus; DropHelper.DropItemCondition(NPC, ModContent.ItemType(), true, lastSentinelKilled); if (!Main.expertMode) @@ -805,7 +805,7 @@ namespace CalamityMod.NPCs.StormWeaver // Mark Storm Weaver as dead if (fullStrength) { - DownedBossSystem.downedSentinel2 = true; + DownedBossSystem.downedStormWeaver = true; CalamityNetcode.SyncWorld(); } } diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 78c6703679..f3e89f0208 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.StormWeaver NPC.height = 80; // 10% of HP is phase one - bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedSentinel2; + bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0 || !DownedBossSystem.downedStormWeaver; NPC.lifeMax = notDoGFight ? 825500 : 139750; NPC.LifeMaxNERB(NPC.lifeMax, NPC.lifeMax, 475000); diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index 3375f090ff..1d6df78070 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -348,7 +348,7 @@ namespace CalamityMod.NPCs.TownNPCs nextSlot++; } - if (DownedBossSystem.downedAstrageldon) + if (DownedBossSystem.downedAstrumAureus) { shop.item[nextSlot].SetDefaults(ModContent.ItemType()); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 3, 0, 0); diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index b8e84fcef1..6eb1a2f0ad 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2870,14 +2870,7 @@ namespace CalamityMod.NPCs.Yharon npcLoot.Add(ModContent.ItemType(), 10); // Lore - npcLoot.Add(ItemDropRule.ByCondition(new FirstYharonKillCondition(), ModContent.ItemType())); - } - - private class FirstYharonKillCondition : IItemDropRuleCondition - { - public bool CanDrop(DropAttemptInfo info) => !DownedBossSystem.downedYharon; - public bool CanShowItemDropInUI() => true; - public string GetConditionDescription() => "On first kill"; + npcLoot.AddIf(() => !DownedBossSystem.downedYharon, ModContent.ItemType()); } public override void BossLoot(ref string name, ref int potionType) diff --git a/Systems/DownedBossSystem.cs b/Systems/DownedBossSystem.cs index 31456e3d6f..7384a01db4 100644 --- a/Systems/DownedBossSystem.cs +++ b/Systems/DownedBossSystem.cs @@ -10,6 +10,7 @@ namespace CalamityMod { public class DownedBossSystem : ModSystem { + // Bosses private static bool _downedDesertScourge = false; private static bool _downedCrabulon = false; private static bool _downedHiveMind = false; @@ -20,37 +21,41 @@ namespace CalamityMod private static bool _downedBrimstoneElemental = false; private static bool _downedCalamitas = false; private static bool _downedLeviathan = false; - private static bool _downedAstrageldon = false; - private static bool _downedStarGod = false; + private static bool _downedAstrumAureus = false; private static bool _downedPlaguebringer = false; - private static bool _downedScavenger = false; - private static bool _downedBoomerDuke = false; + private static bool _downedRavager = false; + private static bool _downedAstrumDeus = false; private static bool _downedGuardians = false; + private static bool _downedDragonfolly = false; private static bool _downedProvidence = false; - private static bool _downedSentinel1 = false; // Ceaseless Void - private static bool _downedSentinel2 = false; // Storm Weaver - private static bool _downedSentinel3 = false; // Signus, Envoy of the Devourer + private static bool _downedCeaselessVoid = false; + private static bool _downedStormWeaver = false; + private static bool _downedSignus = false; private static bool _downedSecondSentinels = false; private static bool _downedPolterghast = false; + private static bool _downedBoomerDuke = false; private static bool _downedDoG = false; - private static bool _downedBumble = false; private static bool _downedYharon = false; + private static bool _downedAres = false; // only used for loot drops + private static bool _downedThanatos = false; // only used for loot drops + private static bool _downedArtemisAndApollo = false; // only used for loot drops private static bool _downedExoMechs = false; private static bool _downedSCal = false; private static bool _downedAdultEidolonWyrm = false; + + // Minibosses private static bool _downedGSS = false; private static bool _downedCLAM = false; private static bool _downedCLAMHardMode = false; - private static bool _downedBetsy = false; // Betsy - - // These are purely used for loot drops, nothing else - private static bool _downedAres = false; - private static bool _downedThanatos = false; - private static bool _downedArtemisAndApollo = false; + // Events private static bool _downedEoCAcidRain = false; private static bool _downedAquaticScourgeAcidRain = false; + // Betsy, because vanilla doesn't track her + private static bool _downedBetsy = false; + + #region Wrapper Properties for Lantern Nights public static bool downedDesertScourge { get => _downedDesertScourge; @@ -161,26 +166,15 @@ namespace CalamityMod NPC.SetEventFlagCleared(ref _downedLeviathan, -1); } } - public static bool downedAstrageldon + public static bool downedAstrumAureus { - get => _downedAstrageldon; + get => _downedAstrumAureus; set { if (!value) - _downedAstrageldon = false; + _downedAstrumAureus = false; else - NPC.SetEventFlagCleared(ref _downedAstrageldon, -1); - } - } - public static bool downedStarGod - { - get => _downedStarGod; - set - { - if (!value) - _downedStarGod = false; - else - NPC.SetEventFlagCleared(ref _downedStarGod, -1); + NPC.SetEventFlagCleared(ref _downedAstrumAureus, -1); } } public static bool downedPlaguebringer @@ -194,26 +188,26 @@ namespace CalamityMod NPC.SetEventFlagCleared(ref _downedPlaguebringer, -1); } } - public static bool downedScavenger + public static bool downedRavager { - get => _downedScavenger; + get => _downedRavager; set { if (!value) - _downedScavenger = false; + _downedRavager = false; else - NPC.SetEventFlagCleared(ref _downedScavenger, -1); + NPC.SetEventFlagCleared(ref _downedRavager, -1); } } - public static bool downedBoomerDuke + public static bool downedAstrumDeus { - get => _downedBoomerDuke; + get => _downedAstrumDeus; set { if (!value) - _downedBoomerDuke = false; + _downedAstrumDeus = false; else - NPC.SetEventFlagCleared(ref _downedBoomerDuke, -1); + NPC.SetEventFlagCleared(ref _downedAstrumDeus, -1); } } public static bool downedGuardians @@ -227,6 +221,17 @@ namespace CalamityMod NPC.SetEventFlagCleared(ref _downedGuardians, -1); } } + public static bool downedDragonfolly + { + get => _downedDragonfolly; + set + { + if (!value) + _downedDragonfolly = false; + else + NPC.SetEventFlagCleared(ref _downedDragonfolly, -1); + } + } public static bool downedProvidence { get => _downedProvidence; @@ -238,47 +243,39 @@ namespace CalamityMod NPC.SetEventFlagCleared(ref _downedProvidence, -1); } } - // Ceaseless Void - public static bool downedSentinel1 + public static bool downedCeaselessVoid { - get => _downedSentinel1; + get => _downedCeaselessVoid; set { if (!value) - _downedSentinel1 = false; + _downedCeaselessVoid = false; else - NPC.SetEventFlagCleared(ref _downedSentinel1, -1); + NPC.SetEventFlagCleared(ref _downedCeaselessVoid, -1); } } - // Storm Weaver - public static bool downedSentinel2 + public static bool downedStormWeaver { - get => _downedSentinel2; + get => _downedStormWeaver; set { if (!value) - _downedSentinel2 = false; + _downedStormWeaver = false; else - NPC.SetEventFlagCleared(ref _downedSentinel2, -1); + NPC.SetEventFlagCleared(ref _downedStormWeaver, -1); } } - // Signus, Envoy of the Devourer - public static bool downedSentinel3 + public static bool downedSignus { - get => _downedSentinel3; + get => _downedSignus; set { if (!value) - _downedSentinel3 = false; + _downedSignus = false; else - NPC.SetEventFlagCleared(ref _downedSentinel3, -1); + NPC.SetEventFlagCleared(ref _downedSignus, -1); } } - public static bool downedSecondSentinels - { - get => _downedSecondSentinels; - set => _downedSecondSentinels = value; - } public static bool downedPolterghast { get => _downedPolterghast; @@ -290,6 +287,17 @@ namespace CalamityMod NPC.SetEventFlagCleared(ref _downedPolterghast, -1); } } + public static bool downedBoomerDuke + { + get => _downedBoomerDuke; + set + { + if (!value) + _downedBoomerDuke = false; + else + NPC.SetEventFlagCleared(ref _downedBoomerDuke, -1); + } + } public static bool downedDoG { get => _downedDoG; @@ -301,17 +309,6 @@ namespace CalamityMod NPC.SetEventFlagCleared(ref _downedDoG, -1); } } - public static bool downedBumble - { - get => _downedBumble; - set - { - if (!value) - _downedBumble = false; - else - NPC.SetEventFlagCleared(ref _downedBumble, -1); - } - } public static bool downedYharon { get => _downedYharon; @@ -400,8 +397,15 @@ namespace CalamityMod NPC.SetEventFlagCleared(ref _downedBetsy, -1); } } + #endregion // These are purely used for loot drops, nothing else + public static bool downedSecondSentinels + { + get => _downedSecondSentinels; + set => _downedSecondSentinels = value; + } + public static bool downedAres { get => _downedAres; @@ -444,42 +448,46 @@ namespace CalamityMod internal static void ResetAllFlags() { downedDesertScourge = false; - downedAquaticScourge = false; + downedCrabulon = false; downedHiveMind = false; downedPerforator = false; downedSlimeGod = false; downedCryogen = false; + downedAquaticScourge = false; downedBrimstoneElemental = false; downedCalamitas = false; downedLeviathan = false; - downedDoG = false; + downedAstrumAureus = false; downedPlaguebringer = false; - downedScavenger = false; + downedRavager = false; + downedAstrumDeus = false; downedGuardians = false; + downedDragonfolly = false; downedProvidence = false; - downedSentinel1 = false; - downedSentinel2 = false; - downedSentinel3 = false; + downedCeaselessVoid = false; + downedStormWeaver = false; + downedSignus = false; + downedPolterghast = false; + downedBoomerDuke = false; + downedDoG = false; downedYharon = false; - downedExoMechs = false; downedAres = false; downedThanatos = false; downedArtemisAndApollo = false; + downedExoMechs = false; downedSCal = false; downedAdultEidolonWyrm = false; + + downedSecondSentinels = false; + downedCLAM = false; downedCLAMHardMode = false; - downedBumble = false; - downedCrabulon = false; - downedBetsy = false; - downedStarGod = false; - downedAstrageldon = false; - downedPolterghast = false; downedGSS = false; - downedBoomerDuke = false; - downedSecondSentinels = false; + downedEoCAcidRain = false; downedAquaticScourgeAcidRain = false; + + downedBetsy = false; } public override void OnWorldLoad() => ResetAllFlags(); @@ -516,11 +524,11 @@ namespace CalamityMod downed.Add("guardians"); if (downedProvidence) downed.Add("providence"); - if (downedSentinel1) + if (downedCeaselessVoid) downed.Add("ceaselessVoid"); - if (downedSentinel2) + if (downedStormWeaver) downed.Add("stormWeaver"); - if (downedSentinel3) + if (downedSignus) downed.Add("signus"); if (downedSecondSentinels) downed.Add("secondSentinels"); @@ -538,17 +546,17 @@ namespace CalamityMod downed.Add("supremeCalamitas"); if (downedAdultEidolonWyrm) downed.Add("adultEidolonWyrm"); - if (downedBumble) + if (downedDragonfolly) downed.Add("bumblebirb"); if (downedCrabulon) downed.Add("crabulon"); if (downedBetsy) downed.Add("betsy"); - if (downedScavenger) + if (downedRavager) downed.Add("scavenger"); - if (downedStarGod) + if (downedAstrumDeus) downed.Add("starGod"); - if (downedAstrageldon) + if (downedAstrumAureus) downed.Add("astrageldon"); if (downedPolterghast) downed.Add("polterghast"); @@ -584,9 +592,9 @@ namespace CalamityMod downedPlaguebringer = downed.Contains("plaguebringerGoliath"); downedGuardians = downed.Contains("guardians"); downedProvidence = downed.Contains("providence"); - downedSentinel1 = downed.Contains("ceaselessVoid"); - downedSentinel2 = downed.Contains("stormWeaver"); - downedSentinel3 = downed.Contains("signus"); + downedCeaselessVoid = downed.Contains("ceaselessVoid"); + downedStormWeaver = downed.Contains("stormWeaver"); + downedSignus = downed.Contains("signus"); downedSecondSentinels = downed.Contains("secondSentinels"); downedYharon = downed.Contains("yharon"); downedExoMechs = downed.Contains("exoMechs"); @@ -595,12 +603,12 @@ namespace CalamityMod downedArtemisAndApollo = downed.Contains("artemisAndApollo"); downedSCal = downed.Contains("supremeCalamitas"); downedAdultEidolonWyrm = downed.Contains("adultEidolonWyrm"); - downedBumble = downed.Contains("bumblebirb"); + downedDragonfolly = downed.Contains("bumblebirb"); downedCrabulon = downed.Contains("crabulon"); downedBetsy = downed.Contains("betsy"); - downedScavenger = downed.Contains("scavenger"); - downedStarGod = downed.Contains("starGod"); - downedAstrageldon = downed.Contains("astrageldon"); + downedRavager = downed.Contains("scavenger"); + downedAstrumDeus = downed.Contains("starGod"); + downedAstrumAureus = downed.Contains("astrageldon"); downedPolterghast = downed.Contains("polterghast"); downedGSS = downed.Contains("greatSandShark"); downedBoomerDuke = downed.Contains("oldDuke"); diff --git a/Systems/WorldSyncingSystem.cs b/Systems/WorldSyncingSystem.cs index 9df1b773ad..72e2fe0f81 100644 --- a/Systems/WorldSyncingSystem.cs +++ b/Systems/WorldSyncingSystem.cs @@ -28,18 +28,18 @@ namespace CalamityMod.Systems flags2[1] = downedPlaguebringer; flags2[2] = downedGuardians; flags2[3] = downedProvidence; - flags2[4] = downedSentinel1; - flags2[5] = downedSentinel2; - flags2[6] = downedSentinel3; + flags2[4] = downedCeaselessVoid; + flags2[5] = downedStormWeaver; + flags2[6] = downedSignus; flags2[7] = downedYharon; // Don't write meaningful values for the now-unused vanilla boss booleans BitsByte flags3 = new BitsByte(); flags3[0] = downedSCal; - flags3[1] = downedBumble; + flags3[1] = downedDragonfolly; flags3[2] = downedCrabulon; flags3[3] = downedBetsy; - flags3[4] = downedScavenger; + flags3[4] = downedRavager; flags3[5] = false; flags3[6] = false; flags3[7] = false; @@ -55,7 +55,7 @@ namespace CalamityMod.Systems flags4[7] = revenge; BitsByte flags5 = new BitsByte(); - flags5[0] = downedStarGod; + flags5[0] = downedAstrumDeus; flags5[1] = spawnedBandit; flags5[2] = spawnedCirrus; flags5[3] = startAcidicDownpour; @@ -67,7 +67,7 @@ namespace CalamityMod.Systems BitsByte flags6 = new BitsByte(); flags6[0] = abyssSide; flags6[1] = downedAquaticScourge; - flags6[2] = downedAstrageldon; + flags6[2] = downedAstrumAureus; flags6[3] = false; flags6[4] = armageddon; flags6[5] = false; @@ -171,18 +171,18 @@ namespace CalamityMod.Systems downedPlaguebringer = flags2[1]; downedGuardians = flags2[2]; downedProvidence = flags2[3]; - downedSentinel1 = flags2[4]; - downedSentinel2 = flags2[5]; - downedSentinel3 = flags2[6]; + downedCeaselessVoid = flags2[4]; + downedStormWeaver = flags2[5]; + downedSignus = flags2[6]; downedYharon = flags2[7]; // Explicitly discard the now-unused vanilla boss booleans BitsByte flags3 = reader.ReadByte(); downedSCal = flags3[0]; - downedBumble = flags3[1]; + downedDragonfolly = flags3[1]; downedCrabulon = flags3[2]; downedBetsy = flags3[3]; - downedScavenger = flags3[4]; + downedRavager = flags3[4]; _ = flags3[5]; _ = flags3[6]; _ = flags3[7]; @@ -198,7 +198,7 @@ namespace CalamityMod.Systems revenge = flags4[7]; BitsByte flags5 = reader.ReadByte(); - downedStarGod = flags5[0]; + downedAstrumDeus = flags5[0]; spawnedBandit = flags5[1]; spawnedCirrus = flags5[2]; startAcidicDownpour = flags5[3]; @@ -210,7 +210,7 @@ namespace CalamityMod.Systems BitsByte flags6 = reader.ReadByte(); abyssSide = flags6[0]; downedAquaticScourge = flags6[1]; - downedAstrageldon = flags6[2]; + downedAstrumAureus = flags6[2]; _ = flags6[3]; armageddon = flags6[4]; _ = flags6[5]; diff --git a/Tiles/Astral/AstralChestLocked.cs b/Tiles/Astral/AstralChestLocked.cs index 6e302374d4..f6e167eff2 100644 --- a/Tiles/Astral/AstralChestLocked.cs +++ b/Tiles/Astral/AstralChestLocked.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Tiles.Astral public override bool UnlockChest(int i, int j, ref short frameXAdjustment, ref int dustType, ref bool manual) { - if (!DownedBossSystem.downedAstrageldon) + if (!DownedBossSystem.downedAstrumAureus) return false; DustType = this.dustType; diff --git a/Tiles/Ores/AstralOre.cs b/Tiles/Ores/AstralOre.cs index 2b71db26f1..8615f5abc6 100644 --- a/Tiles/Ores/AstralOre.cs +++ b/Tiles/Ores/AstralOre.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Tiles.Ores public override bool CanKillTile(int i, int j, ref bool blockDamaged) { - return DownedBossSystem.downedStarGod; + return DownedBossSystem.downedAstrumDeus; } public override bool CanExplode(int i, int j) diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index 58e681ff1e..cb5de20501 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -139,13 +140,38 @@ namespace CalamityMod } #endregion - #region Drop Rule and Condition Helpers + #region Lambda Drop Rule Condition + + // This class serves as a vanilla drop rule condition that is based on an arbitrary bool. + // Create these using the function DropHelper.If as needed. + internal class LambdaDropRuleCondition : IItemDropRuleCondition + { + private readonly Func conditionLambda; + private readonly bool visibleInUI; + private readonly string description; + + internal LambdaDropRuleCondition(Func lambda, bool ui = true, string desc = "") + { + conditionLambda = lambda; + visibleInUI = ui; + description = desc; + } + + public bool CanDrop(DropAttemptInfo info) => conditionLambda(); + public bool CanShowItemDropInUI() => visibleInUI; + public string GetConditionDescription() => description; + } + + public static IItemDropRuleCondition If(Func lambda) => new LambdaDropRuleCondition(lambda); + #endregion + + #region Leading Condition Rule Extensions /// /// Adds any given drop rule as a chained rule to the given LeadingConditionRule. /// /// The LeadingConditionRule which should have another drop rule registered as one of its chains. /// The drop rule which should occur given this leading condition. - /// UNKNOWN. PLEASE EDIT THIS DOCUMENTATION WHEN THIS PARAMETER IS UNDERSTOOD. + /// Set to true for this drop to not appear in the Bestiary. /// The LeadingConditionRule (first parameter). public static IItemDropRule Add(this LeadingConditionRule mainRule, IItemDropRule chainedRule, bool hideLootReport = false) { @@ -160,7 +186,7 @@ namespace CalamityMod /// The chance that the item will drop is 1 in this number. For example, 5 gives a 1 in 5 chance. /// The minimum number of items to drop. Defaults to 1. /// The maximum number of items to drop. Defaults to 1. - /// UNKNOWN. PLEASE EDIT THIS DOCUMENTATION WHEN THIS PARAMETER IS UNDERSTOOD. + /// Set to true for this drop to not appear in the Bestiary. /// public static IItemDropRule Add(this LeadingConditionRule mainRule, int itemID, int dropRateInt = 1, int minQuantity = 1, int maxQuantity = 1, bool hideLootReport = false) { @@ -168,7 +194,7 @@ namespace CalamityMod } #endregion - #region NPCLoot Extension Helpers + #region NPCLoot Extensions /// /// Shorthand to add a simple drop to an NPC. /// @@ -183,6 +209,21 @@ namespace CalamityMod return npcLoot.Add(ItemDropRule.Common(itemID, dropRateInt, minQuantity, maxQuantity)); } + /// + /// Shorthand to add an arbitrary conditional drop to an NPC. + /// + /// The NPC's NPCLoot object. + /// A lambda which evaluates in real-time to the condition that needs to be checked. + /// The item to drop. + /// The chance that the item will drop is 1 in this number. For example, 5 gives a 1 in 5 chance. + /// The minimum number of items to drop. Defaults to 1. + /// The maximum number of items to drop. Defaults to 1. + /// The item drop rule registered. + public static IItemDropRule AddIf(this NPCLoot npcLoot, Func lambda, int itemID, int dropRateInt = 1, int minQuantity = 1, int maxQuantity = 1) + { + return npcLoot.Add(ItemDropRule.ByCondition(If(lambda), itemID, dropRateInt, minQuantity, maxQuantity)); + } + /// /// Shorthand to add a simple normal-only drop to an NPC. /// @@ -213,7 +254,7 @@ namespace CalamityMod /// /// Shorthand for shorthand: Registers a Normal Mode only LeadingConditionRule for an NPC and returns it to you. /// - /// The NPC's NPCLOot object. + /// The NPC's NPCLoot object. /// A Normal Mode only LeadingConditionRule. public static LeadingConditionRule DefineNormalOnlyDropSet(this NPCLoot npcLoot) => npcLoot.DefineConditionalDropSet(new Conditions.NotExpert()); #endregion