change stuff with objects
This commit is contained in:
@@ -1,18 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
class Chips : FoodItem
|
||||
internal class Chips : ConsumableItem
|
||||
{
|
||||
public override int Id => 100;
|
||||
public override string Name => "Chips";
|
||||
public override string Description => "Eine tüte Chips";
|
||||
public override int Gewicht => 10;
|
||||
public override int Gewicht => 180;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 10;
|
||||
public override int HpAmount => 5;
|
||||
public override uint Object => 2240524752;
|
||||
public override int Price => 20;
|
||||
public override int Price => 5;
|
||||
|
||||
public override float Cooldown => 3500;
|
||||
|
||||
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 ~y~" + Name + " ~s~gegessen.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user