Decimation_Mod/Content/Items/Misc/SoulFruit.cs
FyloZ ec4585bed5 - Changed Bloodshot Eye's music to Boss 1 Orchestra ( https://www.youtube.com/watch?time_continue=120&v=r-9nKGc85FQ )
- Added support for animated projectiles
- Refactoring
- Removed useless fields
- Fixed swords not dealing damages
- Added Hour Hand (from Evie's PR)
2020-03-21 00:11:07 -04:00

47 lines
1.4 KiB
C#

using Decimation.Lib.Items;
using Decimation.Lib.Util.Builder;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Items.Misc
{
internal class SoulFruit : DecimationItem
{
public static readonly int LifeHealAmount = 5;
protected override string ItemName => "Soul Fruit";
protected override string ItemTooltip => "Adds 5 to maximum life";
protected override void Init()
{
this.item.CloneDefaults(ItemID.LifeFruit);
this.item.width = 34;
this.item.height = 46;
}
public override bool CanUseItem(Player player)
{
return player.statLifeMax >= 500 && player.GetModPlayer<DecimationPlayer>().soulFruits < 10;
}
public override bool UseItem(Player player)
{
player.statLifeMax2 += LifeHealAmount;
player.GetModPlayer<DecimationPlayer>().soulFruits++;
if (Main.myPlayer == player.whoAmI) player.HealEffect(LifeHealAmount);
return true;
}
protected override ModRecipe GetRecipe()
{
return new RecipeBuilder(this.mod, this)
.WithIngredient(ItemID.LifeFruit)
.WithIngredient(ItemID.Ectoplasm, 5)
.WithStation(TileID.MythrilAnvil)
.Build();
}
}
}