using Decimation.Lib.Items;
using Decimation.Lib.Util;
using Terraria;

namespace Decimation.Content.Items.Misc
{
    internal class LunarTablet : DecimationItem
    {
        protected override string ItemName => "Lunar Tablet";
        protected override string ItemTooltip => "Summons the full moon.";

        protected override void Init()
        {
            item.width = 30;
            item.height = 40;
            item.consumable = true;
            item.value = Item.buyPrice(gold: 2, silver: 50);
            item.rare = Rarity.Green.GetRarityValue();
            item.useStyle = 1;
            item.useTime = 20;
            item.useAnimation = 20;

            this.item.maxStack = 1;
        }

        public override bool CanUseItem(Player player)
        {
            return Main.dayTime;
        }

        public override bool UseItem(Player player)
        {
            Main.moonPhase = 0;
            Main.dayTime = false;

            return true;
        }
    }
}