-
Notifications
You must be signed in to change notification settings - Fork 1
/
PoMNPC.cs
64 lines (59 loc) · 2.43 KB
/
PoMNPC.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using Terraria;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
namespace PathOfModifiers
{
public class PoMNPC : GlobalNPC
{
public override void ModifyGlobalLoot(GlobalLoot globalLoot)
{
var isHardmode = new LeadingConditionRule(new Conditions.IsHardmode());
isHardmode.OnSuccess(
new CommonDrop(
ItemType<Items.ModifierFragment>(),
1,
PoMGlobals.DropRate.Fragment.fromBossHardmode,
PoMGlobals.DropRate.Fragment.fromBossHardmode));
isHardmode.OnFailedConditions(
new CommonDrop(
ItemType<Items.ModifierFragment>(),
1,
PoMGlobals.DropRate.Fragment.fromBoss,
PoMGlobals.DropRate.Fragment.fromBoss));
var isPostPlantera = new LeadingConditionRule(new Conditions.DownedPlantera());
isPostPlantera.OnSuccess(
new CommonDrop(
ItemType<Items.ModifierFragment>(),
1,
PoMGlobals.DropRate.Fragment.fromBossPostPlantera,
PoMGlobals.DropRate.Fragment.fromBossPostPlantera));
isPostPlantera.OnFailedConditions(isHardmode);
var isBoss = new LeadingConditionRule(new Conditions.LegacyHack_IsABoss());
isBoss.OnSuccess(isPostPlantera);
isBoss.OnFailedConditions(
new PoMGlobals.DropRate.CommonDropScalingWithValue(
ItemType<Items.ModifierFragment>(),
PoMGlobals.DropRate.Fragment.chanceDenominator,
PoMGlobals.DropRate.Fragment.baseMin,
PoMGlobals.DropRate.Fragment.baseMax,
PoMGlobals.DropRate.Fragment.multiplyPerValue));
globalLoot.Add(isBoss);
}
public override void ModifyActiveShop(NPC npc, string shopName, Item[] items)
{
if (npc.type == NPCID.Wizard)
{
foreach (Item item in items)
{
// Skip 'air' items and null items.
if (item == null || item.type == ItemID.None)
{
item.SetDefaults(ItemType<Items.ModifierFragment>());
}
}
}
}
}
}