62 lines
2.3 KiB
C#
62 lines
2.3 KiB
C#
using System;
|
|
using System.Linq;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.GameContent.ItemDropRules;
|
|
using Continuity.Content.Items;
|
|
using continuity.Utilities;
|
|
|
|
namespace Continuity.Content
|
|
{
|
|
public class PlanteraDrops : GlobalNPC
|
|
{
|
|
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
|
|
{
|
|
if (npc.type == NPCID.Plantera)
|
|
{
|
|
LeadingConditionRule notExpertRule = new LeadingConditionRule(new Conditions.NotExpert());
|
|
notExpertRule.OnSuccess(ItemDropRule.Common(ModContent.ItemType<PalishadeTissue>(), 1, 10, 35));
|
|
npcLoot.Add(notExpertRule);
|
|
}
|
|
}
|
|
}
|
|
|
|
public class PlanteraBossBag : GlobalItem
|
|
{
|
|
public override void ModifyItemLoot(Item item, ItemLoot itemLoot)
|
|
{
|
|
if (item.type == ItemID.PlanteraBossBag)
|
|
{
|
|
itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<PalishadeTissue>(), 1, 25, 35));
|
|
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);
|
|
}
|
|
itemLoot.RemoveWhere(rule => rule is CommonDrop drop
|
|
&& drop.itemId == ItemID.TempleKey);
|
|
|
|
foreach (var rule in itemLoot.Get())
|
|
{
|
|
itemLoot.RemoveWhere(rule => rule is OneFromRulesRule);
|
|
if (ModLoader.HasMod("CalamityMod"))
|
|
{
|
|
itemLoot.RemoveWhere(rule => rule is CalamityDropHelper.AllOptionsAtOnceWithPityDropRule);
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|