This commit is contained in:
Oscar
2025-06-28 22:26:47 +03:00
parent f7e8f8bf1f
commit 7223dd3b61
50 changed files with 479 additions and 82 deletions

View File

@@ -19,49 +19,40 @@ public enum ItemRarity
Legendary
}
[GameResource("Base Item Definition", "inv", "", Category = "Sasalka", Icon = "inventory_2")]
[GameResource( "Base Item Definition", "inv", "", Category = "Sasalka", Icon = "inventory_2" )]
public class BaseItemDefinition : GameResource
{
[Property, Title("Basic Info")]
public string Name { get; set; } = "Unknown Item";
[Property, Title( "Basic Info" )] public string Name { get; set; } = "Unknown Item";
[Property]
public string Description { get; set; } = "";
[Property] public string Description { get; set; } = "";
[Property, Category("Visual")]
[ResourceType("prefab")]
public GameObject Prefab { get; set; } = GameObject.GetPrefab("prefabs/item_parcel.prefab");
[Property, Category( "Visual" )]
[ResourceType( "prefab" )]
public GameObject Prefab { get; set; } = GameObject.GetPrefab( "prefabs/item_parcel.prefab" );
[Property, Category("Visual")]
public Texture ImageTexture { get; set; }
[Property, Category( "Visual" )] public Texture ImageTexture { get; set; }
[Property, Category("Visual")]
public string ImageUrl { get; set; }
[Property, Category( "Visual" )] public string ImageUrl { get; set; }
[Property, Category("Properties")]
[Range(1, 1000)]
[Property, Category( "Properties" )]
[Range( 1, 1000 )]
public int MaxCount { get; set; } = 1;
[Property, Category("Properties")]
public virtual ItemCategory Category { get; set; } = ItemCategory.Misc;
[Property, Category( "Properties" )] public virtual ItemCategory Category { get; set; } = ItemCategory.Misc;
[Property, Category("Properties")]
public ItemRarity Rarity { get; set; } = ItemRarity.Common;
[Property, Category( "Properties" )] public ItemRarity Rarity { get; set; } = ItemRarity.Common;
[Property, Category("Properties")]
public float Weight { get; set; } = 1.0f;
[Property, Category( "Properties" )] public float Weight { get; set; } = 1.0f;
[Property, Category("Properties")]
public bool IsStackable => MaxCount > 1;
[Property, Category( "Properties" )] public bool IsStackable = false;
[Property, Category("Properties")]
public bool IsEquipable => this is IEquipable;
[Property, Category( "Properties" )] public bool IsEquipable => this is IEquipable;
public virtual Inventar.InventorySlot? GetSlot() => null;
public virtual bool CanUse() => false;
public virtual void OnUse(InventoryItem item) { }
public virtual void OnUse( InventoryItem item ) { }
public string GetRarityColor()
{

View File

@@ -15,8 +15,8 @@ public class ClothingItemDefinition : BaseItemDefinition, IEquipable
[Property, Category( "Clothing Properties" )]
public bool IsVisible { get; set; } = true;
[Property, Category( "Clothing Properties" )]
public string BodyPart { get; set; } = "";
// [Property, Category( "Clothing Properties" )]
// public string BodyPart { get; set; } = "";
public override Inventar.InventorySlot? GetSlot() => Slot;