From e562ac89634c85d6c40030b40a24b58e883817c3 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 12 May 2020 09:45:15 -0400 Subject: [PATCH 1/3] Moss Hornets, Queen Bee, PBG, Plaguebringers, Plague chargers, and pestilent slimes now drop stingers Plaguebringers also no longer drop loot while PBG is alive --- Items/CalamityGlobalItem.cs | 1 + Items/TreasureBags/PlaguebringerGoliathBag.cs | 7 +++---- NPCs/CalamityGlobalNPCLoot.cs | 9 ++++++++- NPCs/NormalNPCs/PlagueBee.cs | 3 ++- NPCs/NormalNPCs/PlagueBeeLarge.cs | 3 ++- NPCs/NormalNPCs/PlaguedJungleSlime.cs | 3 ++- NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs | 6 ++---- NPCs/PlaguebringerGoliath/PlaguebringerShade.cs | 7 ++++--- 8 files changed, 24 insertions(+), 15 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index ed2121e06f..4c45f0e531 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -2601,6 +2601,7 @@ Provides heat and cold protection in Death Mode"; // Queen Bee case ItemID.QueenBeeBossBag: + DropHelper.DropItem(player, ItemID.Stinger, 8, 12); DropHelper.DropItem(player, ModContent.ItemType(), 50, 75); break; diff --git a/Items/TreasureBags/PlaguebringerGoliathBag.cs b/Items/TreasureBags/PlaguebringerGoliathBag.cs index 7fc7c68c57..7e0b0982a3 100644 --- a/Items/TreasureBags/PlaguebringerGoliathBag.cs +++ b/Items/TreasureBags/PlaguebringerGoliathBag.cs @@ -10,6 +10,7 @@ using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.PlaguebringerGoliath; using CalamityMod.World; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.TreasureBags @@ -34,10 +35,7 @@ namespace CalamityMod.Items.TreasureBags item.expert = true; } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() => true; public override void OpenBossBag(Player player) { @@ -45,6 +43,7 @@ namespace CalamityMod.Items.TreasureBags // Materials DropHelper.DropItem(player, ModContent.ItemType(), 13, 17); + DropHelper.DropItem(player, ItemID.Stinger, 4, 8); // Weapons DropHelper.DropItemChance(player, ModContent.ItemType(), 3); // Virulence diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 06a6652cd5..721657255b 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -279,7 +279,7 @@ namespace CalamityMod.NPCs npc.Calamity().SetNewShopVariable(new int[] { NPCID.ArmsDealer, NPCID.Cyborg, NPCID.Steampunker, NPCID.Wizard, NPCID.WitchDoctor, NPCID.DD2Bartender, ModContent.NPCType(), ModContent.NPCType() }, NPC.downedGolemBoss); - // If Golem has never been killed, send messages about PBG and Ravager + // If Golem has never been killed, send messages about PBG if (!NPC.downedGolemBoss) { string key = "Mods.CalamityMod.BabyBossText"; @@ -1741,6 +1741,7 @@ namespace CalamityMod.NPCs break; case NPCID.QueenBee: + DropHelper.DropItemCondition(npc, ItemID.Stinger, !Main.expertMode, 5, 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 30, 50); break; @@ -1828,6 +1829,12 @@ namespace CalamityMod.NPCs { DropHelper.DropItemChance(npc, ModContent.ItemType(), 2, 1, Main.expertMode ? 3 : 1); } + + // Every type of moss hornet can drop stingers + if (CalamityMod.mossHornetList.Contains(npc.type)) + { + DropHelper.DropItemChance(npc, ItemID.Stinger, Main.expertMode ? 1f : 0.6666f); + } } #endregion diff --git a/NPCs/NormalNPCs/PlagueBee.cs b/NPCs/NormalNPCs/PlagueBee.cs index e072189a1b..10f5f879dd 100644 --- a/NPCs/NormalNPCs/PlagueBee.cs +++ b/NPCs/NormalNPCs/PlagueBee.cs @@ -101,7 +101,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType(), Main.rand.Next(1, 3)); + DropHelper.DropItemChance(npc, ItemID.Stinger, Main.expertMode ? 0.5f : 0.25f); + DropHelper.DropItem(npc, ModContent.ItemType(), 1, 2); } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/NormalNPCs/PlagueBeeLarge.cs b/NPCs/NormalNPCs/PlagueBeeLarge.cs index f7ded6f32e..c1c9c01b83 100644 --- a/NPCs/NormalNPCs/PlagueBeeLarge.cs +++ b/NPCs/NormalNPCs/PlagueBeeLarge.cs @@ -100,7 +100,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType(), Main.rand.Next(2, 4)); + DropHelper.DropItemChance(npc, ItemID.Stinger, Main.expertMode ? 0.5f : 0.25f); + DropHelper.DropItem(npc, ModContent.ItemType(), 2, 3); } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/NormalNPCs/PlaguedJungleSlime.cs b/NPCs/NormalNPCs/PlaguedJungleSlime.cs index 59fac63837..8651394bcb 100644 --- a/NPCs/NormalNPCs/PlaguedJungleSlime.cs +++ b/NPCs/NormalNPCs/PlaguedJungleSlime.cs @@ -128,7 +128,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType(), Main.rand.Next(1, 3)); + DropHelper.DropItemChance(npc, ItemID.Stinger, Main.expertMode ? 0.5f : 0.25f); + DropHelper.DropItem(npc, ModContent.ItemType(), 1, 2); } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 5c5f9c4319..12830e52c8 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -974,10 +974,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } } - public override bool CheckActive() - { - return canDespawn; - } + public override bool CheckActive() => canDespawn; public override void HitEffect(int hitDirection, double damage) { @@ -1134,6 +1131,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { // Materials DropHelper.DropItemSpray(npc, ModContent.ItemType(), 10, 14); + DropHelper.DropItemSpray(npc, ItemID.Stinger, 3, 5); // Weapons DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); // Virulence diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index 68b5ca4ec2..2f7ae507e8 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -675,9 +675,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void NPCLoot() { - DropHelper.DropItem(npc, ModContent.ItemType(), 8, 12); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 50); //no, this isn't getting boosted by Defiled. Rover, I don't care. PBG also drops it + DropHelper.DropItemChance(npc, ItemID.Stinger, Main.expertMode ? 0.5f : 0.25f, 2, 3); + DropHelper.DropItem(npc, ModContent.ItemType(), 8, 12); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 50); //no, this isn't getting boosted by Defiled. Rover, I don't care. PBG also drops it } public override void OnHitPlayer(Player player, int damage, bool crit) From 0176f174ab7746e6e45d1258b883747995ba73cb Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 12 May 2020 09:45:49 -0400 Subject: [PATCH 2/3] Plaguebringers no longer drop loot while PBG is alive --- NPCs/PlaguebringerGoliath/PlaguebringerShade.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index 2f7ae507e8..fd2ab09ab5 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -673,6 +673,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } } + public override bool PreNPCLoot(NPC npc) => !NPC.AnyNPCs(ModContent.NPCType()); //don't drop items in the PBG fight + public override void NPCLoot() { DropHelper.DropItemChance(npc, ItemID.Stinger, Main.expertMode ? 0.5f : 0.25f, 2, 3); From 1c702fd6557ede37af7cfd6a6b576b9fa788b0fd Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 12 May 2020 09:54:03 -0400 Subject: [PATCH 3/3] error fix --- NPCs/PlaguebringerGoliath/PlaguebringerShade.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index fd2ab09ab5..8a4a6b5cbb 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -673,7 +673,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } } - public override bool PreNPCLoot(NPC npc) => !NPC.AnyNPCs(ModContent.NPCType()); //don't drop items in the PBG fight + public override bool PreNPCLoot() => !NPC.AnyNPCs(ModContent.NPCType()); //don't drop items in the PBG fight public override void NPCLoot() {