bissl formattiert
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
namespace ReallifeGamemode.Server.Inventory.Interfaces
|
||||
{
|
||||
public interface IDroppableItem : IItem
|
||||
{
|
||||
uint Object { get; }
|
||||
}
|
||||
{
|
||||
uint Object { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
namespace ReallifeGamemode.Server.Inventory.Interfaces
|
||||
{
|
||||
public interface IItem
|
||||
{
|
||||
int Id { get; }
|
||||
string Name { get; }
|
||||
string Description { get; }
|
||||
int Gewicht { get; }
|
||||
string Einheit { get; }
|
||||
int Price { get; }
|
||||
}
|
||||
{
|
||||
int Id { get; }
|
||||
string Name { get; }
|
||||
string Description { get; }
|
||||
int Gewicht { get; }
|
||||
string Einheit { get; }
|
||||
int Price { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
namespace ReallifeGamemode.Server.Inventory.Interfaces
|
||||
{
|
||||
public interface IUsableItem : IItem, IDroppableItem
|
||||
{
|
||||
void Use(UserItem uItem);
|
||||
}
|
||||
{
|
||||
void Use(UserItem uItem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using ReallifeGamemode.Database.Entities;
|
||||
namespace ReallifeGamemode.Server.Inventory.Interfaces
|
||||
{
|
||||
public interface IWeaponDealItem : IItem, IDroppableItem
|
||||
{
|
||||
bool noTransfer(Player client, UserItem uItem, FactionVehicle fVeh);
|
||||
}
|
||||
{
|
||||
bool noTransfer(Player client, UserItem uItem, FactionVehicle fVeh);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,20 +7,20 @@ using ReallifeGamemode.Server.Managers;
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
public abstract class DropItem : IDroppableItem
|
||||
{
|
||||
public abstract int HpAmount { get; }
|
||||
public abstract int Id { get; }
|
||||
public abstract string Name { get; }
|
||||
public abstract string Description { get; }
|
||||
public abstract int Gewicht { get; }
|
||||
public abstract string Einheit { get; }
|
||||
public abstract uint Object { get; }
|
||||
public abstract int Price { get; }
|
||||
{
|
||||
public abstract int HpAmount { get; }
|
||||
public abstract int Id { get; }
|
||||
public abstract string Name { get; }
|
||||
public abstract string Description { get; }
|
||||
public abstract int Gewicht { get; }
|
||||
public abstract string Einheit { get; }
|
||||
public abstract uint Object { get; }
|
||||
public abstract int Price { get; }
|
||||
|
||||
public void Drop(UserItem uItem, Player player, int amount)
|
||||
{
|
||||
player.SendNotification("Du hast ~g~" + amount + " ~y~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~weggeworfen.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, amount);
|
||||
}
|
||||
public void Drop(UserItem uItem, Player player, int amount)
|
||||
{
|
||||
player.SendNotification("Du hast ~g~" + amount + " ~y~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~weggeworfen.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,29 +7,29 @@ using ReallifeGamemode.Server.Managers;
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
public abstract class FoodItem : IUsableItem
|
||||
{
|
||||
public abstract int HpAmount { get; }
|
||||
public abstract int Id { get; }
|
||||
public abstract string Name { get; }
|
||||
public abstract string Description { get; }
|
||||
public abstract int Gewicht { get; }
|
||||
public abstract string Einheit { get; }
|
||||
public abstract uint Object { get; }
|
||||
public abstract int Price { get; }
|
||||
|
||||
public void Use(UserItem uItem)
|
||||
{
|
||||
public abstract int HpAmount { get; }
|
||||
public abstract int Id { get; }
|
||||
public abstract string Name { get; }
|
||||
public abstract string Description { get; }
|
||||
public abstract int Gewicht { get; }
|
||||
public abstract string Einheit { get; }
|
||||
public abstract uint Object { get; }
|
||||
public abstract int Price { get; }
|
||||
Player player = uItem.GetUser().Player;
|
||||
|
||||
public void Use(UserItem uItem)
|
||||
{
|
||||
Player player = uItem.GetUser().Player;
|
||||
int amountToAdd = HpAmount;
|
||||
if (player.Health + amountToAdd > 100)
|
||||
{
|
||||
amountToAdd = 100 - player.Health;
|
||||
}
|
||||
|
||||
int amountToAdd = HpAmount;
|
||||
if (player.Health + amountToAdd > 100)
|
||||
{
|
||||
amountToAdd = 100 - player.Health;
|
||||
}
|
||||
|
||||
player.Health += amountToAdd;
|
||||
player.SendNotification("Du hast ein/einen ~y~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~gegessen.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
|
||||
}
|
||||
player.Health += amountToAdd;
|
||||
player.SendNotification("Du hast ein/einen ~y~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~gegessen.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,23 +6,23 @@ using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
public abstract class WeaponDealItem : IWeaponDealItem
|
||||
{
|
||||
public abstract int Id { get; }
|
||||
public abstract string Name { get; }
|
||||
public abstract string Description { get; }
|
||||
public abstract int Gewicht { get; }
|
||||
public abstract string Einheit { get; }
|
||||
public abstract uint Object { get; }
|
||||
public abstract int Price { get; }
|
||||
|
||||
public bool noTransfer(Player client, UserItem uItem, FactionVehicle fVeh)
|
||||
{
|
||||
public abstract int Id { get; }
|
||||
public abstract string Name { get; }
|
||||
public abstract string Description { get; }
|
||||
public abstract int Gewicht { get; }
|
||||
public abstract string Einheit { get; }
|
||||
public abstract uint Object { get; }
|
||||
public abstract int Price { get; }
|
||||
if (!fVeh.GetOwners().Contains(client.GetUser().FactionId ?? 0))
|
||||
return false;
|
||||
if (fVeh.Model != VehicleHash.Burrito3)
|
||||
return false;
|
||||
|
||||
public bool noTransfer(Player client, UserItem uItem, FactionVehicle fVeh)
|
||||
{
|
||||
if (!fVeh.GetOwners().Contains(client.GetUser().FactionId ?? 0))
|
||||
return false;
|
||||
if (fVeh.Model != VehicleHash.Burrito3)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user