forked from BeeIsYou/TrueEndless
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEndlessPlayer.cs
More file actions
31 lines (27 loc) · 784 Bytes
/
Copy pathEndlessPlayer.cs
File metadata and controls
31 lines (27 loc) · 784 Bytes
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
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
namespace TrueEndless
{
class EndlessPlayer : ModPlayer
{
public bool infinity;
private EndlessItem eI = new EndlessItem();
public override TagCompound Save()
{
return new TagCompound
{
{"infinityItems", infinity},
};
}
public override void Load(TagCompound tag)
{
infinity = tag.GetBool("infinityItems");
}
public override bool ConsumeAmmo(Item weapon, Item ammo)
{
return !(infinity && !eI.IsEndlessExempt(ammo) && (eI.IsEndlessAmmo(ammo) || eI.IsEndlessSpecific(ammo)));
}
}
}