(Feat) Item Dqta

This commit is contained in:
2026-06-25 14:40:21 +02:00
parent 3597bacb1a
commit 931bc9c9e2
10 changed files with 372 additions and 20 deletions
+21
View File
@@ -32,6 +32,12 @@ namespace Ashwild.Inventory
[Header("Type")]
[SerializeField] private ItemType itemType;
[Header("Uses / Durability")]
[Tooltip("How many times this item can be used before it is depleted (a tool's hits, a food's bites). 0 = no usage tracking — a normal item without a uses bar.")]
[SerializeField] private int maxUses = 0;
[Tooltip("When the uses reach 0: checked = the item stays in the inventory, shown red and unusable (repairable tool, refillable container); unchecked = it is destroyed.")]
[SerializeField] private bool keepWhenDepleted = false;
[Header("Tool")]
[SerializeField] private HarvestType harvestType = HarvestType.None;
[SerializeField] private float toolPower = 1f;
@@ -59,6 +65,21 @@ namespace Ashwild.Inventory
public bool IsStackable => isStackable;
public int MaxStackSize => maxStackSize;
public ItemType ItemType => itemType;
public int MaxUses => maxUses;
/// <summary>
/// When uses run out: true keeps the item (shown red, unusable until repaired/refilled),
/// false destroys it. Repairable tools and refillable containers set this true.
/// </summary>
public bool KeepWhenDepleted => keepWhenDepleted;
/// <summary>
/// Whether this item tracks per-instance uses (a tool's durability, a food's bites). Items
/// with uses get a slot bar and are treated as non-stackable so each instance keeps its own value.
/// </summary>
public bool HasUses => maxUses > 0;
public HarvestType HarvestType => harvestType;
public float ToolPower => toolPower;
public float HealthRestore => healthRestore;