-
Notifications
You must be signed in to change notification settings - Fork 2
/
InvTweaksItem.cs
42 lines (40 loc) · 1.3 KB
/
InvTweaksItem.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
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace InvTweaks
{
public class InvTweaksItem : GlobalItem
{
public override bool ConsumeItem(Item item, Player player)
{
if (item.stack == 1 && ClientConfig.Instance.CursorFill)
{
for (int i = 0; i < player.inventory.Length; i++)
{
Item queryItem = player.inventory[i];
if (queryItem.type == item.type && i != player.selectedItem && !queryItem.favorited)
{
item.stack = queryItem.stack;
queryItem.TurnToAir();
Recipe.FindRecipes();
return false;
}
}
}
return true;
}
public override void SetDefaults(Item item)
{
if ((item.type == ItemID.ManaCrystal ||
item.type == ItemID.LifeCrystal ||
item.type == ItemID.LifeFruit) && ClientConfig.Instance.LifeCrystalDevour)
{
item.useTime = 3;
item.useAnimation = 9;
item.autoReuse = true;
item.reuseDelay = 2;
item.useTurn = true;
}
}
}
}