2024-11-08 23:29:12 +00:00
|
|
|
using System;
|
|
|
|
using System.Linq;
|
2024-11-07 14:45:05 +00:00
|
|
|
using Terraria;
|
|
|
|
using Terraria.ID;
|
|
|
|
using Terraria.ModLoader;
|
|
|
|
using Terraria.GameContent.ItemDropRules;
|
|
|
|
using Continuity.Content.Items;
|
2024-11-12 11:48:36 +00:00
|
|
|
using Continuity.Content.Items.Materials;
|
2024-11-07 14:45:05 +00:00
|
|
|
|
2024-11-08 23:29:12 +00:00
|
|
|
namespace Continuity.Content
|
2024-11-07 14:45:05 +00:00
|
|
|
{
|
|
|
|
public class PlanteraDrops : GlobalNPC
|
|
|
|
{
|
|
|
|
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
|
|
|
|
{
|
|
|
|
if (npc.type == NPCID.Plantera)
|
|
|
|
{
|
2024-11-09 10:14:04 +00:00
|
|
|
LeadingConditionRule notExpertRule = new LeadingConditionRule(new Conditions.NotExpert());
|
|
|
|
notExpertRule.OnSuccess(ItemDropRule.Common(ModContent.ItemType<PalishadeTissue>(), 1, 10, 35));
|
|
|
|
npcLoot.Add(notExpertRule);
|
2024-11-08 23:29:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-11-11 09:53:32 +00:00
|
|
|
[JITWhenModsEnabled("CalamityMod")]
|
2024-11-08 23:29:12 +00:00
|
|
|
public class PlanteraBossBag : GlobalItem
|
|
|
|
{
|
|
|
|
public override void ModifyItemLoot(Item item, ItemLoot itemLoot)
|
|
|
|
{
|
2024-11-11 19:14:36 +00:00
|
|
|
short[] toRemove = {
|
|
|
|
ItemID.TheAxe,
|
|
|
|
ItemID.PygmyStaff,
|
|
|
|
ItemID.Seedling,
|
|
|
|
ItemID.ThornHook,
|
|
|
|
};
|
|
|
|
foreach (var i in toRemove)
|
|
|
|
{
|
|
|
|
itemLoot.RemoveWhere(rule => rule is CommonDropNotScalingWithLuck drop
|
|
|
|
&& drop.itemId == i);
|
|
|
|
}
|
|
|
|
|
2024-11-08 23:29:12 +00:00
|
|
|
if (item.type == ItemID.PlanteraBossBag)
|
|
|
|
{
|
2024-11-09 10:14:04 +00:00
|
|
|
itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<PalishadeTissue>(), 1, 25, 35));
|
2024-11-11 09:53:32 +00:00
|
|
|
|
2024-11-08 23:29:12 +00:00
|
|
|
itemLoot.RemoveWhere(rule => rule is CommonDrop drop
|
|
|
|
&& drop.itemId == ItemID.TempleKey);
|
|
|
|
|
|
|
|
foreach (var rule in itemLoot.Get())
|
|
|
|
{
|
|
|
|
itemLoot.RemoveWhere(rule => rule is OneFromRulesRule);
|
2024-11-11 09:53:32 +00:00
|
|
|
|
2024-11-09 00:32:47 +00:00
|
|
|
if (ModLoader.HasMod("CalamityMod"))
|
|
|
|
{
|
2024-11-11 09:53:32 +00:00
|
|
|
itemLoot.RemoveWhere(rule => rule is CalamityMod.DropHelper.AllOptionsAtOnceWithPityDropRule);
|
2024-11-10 21:36:50 +00:00
|
|
|
|
2024-11-09 00:32:47 +00:00
|
|
|
if (ModLoader.TryGetMod("CalamityMod", out Mod calamityMod) && calamityMod.TryFind<ModItem>("BlossomFlux", out ModItem BlossomFlux)) {
|
|
|
|
itemLoot.RemoveWhere(rule => rule is CommonDrop drop
|
|
|
|
&& drop.itemId == BlossomFlux.Type);
|
|
|
|
}
|
|
|
|
}
|
2024-11-11 19:14:36 +00:00
|
|
|
}
|
2024-11-07 14:45:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|