Decimation_Mod/Content/Items/Misc/Souls/SoulofLife.cs
FyloZ 884e67c5e2 Updated some potions's sprite.
Changed buy price to sell price.
2020-07-09 18:03:44 -04:00

43 lines
1.4 KiB
C#

using Decimation.Lib.Items;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Items.Misc.Souls
{
internal class SoulofLife : DecimationItem
{
protected override string ItemName => "Soul of Life";
protected override string ItemTooltip => "The essence of living cells.";
protected override DrawAnimation Animation => new DrawAnimationVertical(5, 4);
protected override void Init()
{
Item refItem = new Item();
refItem.SetDefaults(ItemID.SoulofSight);
item.width = refItem.width;
item.height = refItem.height;
item.width = 20;
item.height = 20;
item.value = Item.sellPrice(silver: 2);
this.item.maxStack = 999;
ItemID.Sets.AnimatesAsSoul[this.item.type] = true;
ItemID.Sets.ItemIconPulse[this.item.type] = true;
ItemID.Sets.ItemNoGravity[this.item.type] = true;
}
public class SoulGlobalNPC : GlobalNPC
{
public override void NPCLoot(NPC npc)
{
if (npc.type == NPCID.Plantera)
Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height,
ModContent.ItemType<SoulofLife>(), Main.rand.Next(12, 25));
}
}
}
}