-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathElementReassigner.cs
43 lines (38 loc) · 1.03 KB
/
ElementReassigner.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
using BattleNetworkElements.Utilities;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace BattleNetworkElements
{
public class ElementReassigner : ModItem
{
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 30;
}
public override void SetDefaults()
{
Item.width = 34;
Item.height = 34;
Item.maxStack = 9999;
Item.consumable = true;
Item.useTime = 15;
Item.useAnimation = 15;
Item.useStyle = ItemUseStyleID.HoldUp;
Item.UseSound = SoundID.NPCHit53;
Item.rare = ItemRarityID.Expert;
Item.value = 20000;
}
public override bool? UseItem(Player player)
{
var bn = player.Elements();
int element = -1;
if (Main.rand.NextBool(3))
{
element = 5;
}
bn.AssignElements(element);
return true;
}
}
}