using GTANetworkAPI;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Managers;

/**
* @overview Life of German Reallife - Inventory Items Cheeseburger (Cheeseburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/

namespace ReallifeGamemode.Server.Inventory.Items
{
  public class Cheeseburger : ConsumableItem
  {
    public override int Id => 103;
    public override string Name => "Cheeseburger";
    public override string Description => "Extra käsig.";
    public override int Gewicht => 120;
    public override string Einheit => "g";
    public override int HpAmount => 20;
    public override uint Object => 2240524752;
    public override int Price => 100;
    public override float Cooldown => 120000;

    public override void Consume(UserItem uItem)
    {
      Player player = uItem.GetUser().Player;

      int amountToAdd = HpAmount;
      if (player.Health + amountToAdd > 100)
      {
        amountToAdd = 100 - player.Health;
      }

      player.SafeSetHealth(player.Health + amountToAdd);
      player.SendNotification("Du hast einen ~y~" + Name + " ~s~gegessen.", false);
      InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
    }
  }
}
