summaryrefslogtreecommitdiff
path: root/scripts/entities/items/ConsumableItem.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-09-08 22:10:45 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-09-08 22:10:45 -0300
commitf1b51bed52ffbd90b5b7cc8dcfc6f0484bbbeb3c (patch)
treed607142daee4948765a97008bdef21fa6efa2d2b /scripts/entities/items/ConsumableItem.cs
parent4b2afd3e2144e42bfa7f11a870584b9255052cf7 (diff)
inventário acessivel
Diffstat (limited to 'scripts/entities/items/ConsumableItem.cs')
-rw-r--r--scripts/entities/items/ConsumableItem.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/entities/items/ConsumableItem.cs b/scripts/entities/items/ConsumableItem.cs
index 8c862da..82fab49 100644
--- a/scripts/entities/items/ConsumableItem.cs
+++ b/scripts/entities/items/ConsumableItem.cs
@@ -15,7 +15,7 @@ public abstract partial class ConsumableItem : Entity
/// </summary>
/// <param name="consumer"></param>
/// <returns></returns>
- public Action GetAction(Actor consumer)
+ public Action GetAction(Player consumer)
{
return new ItemAction(consumer, this);
}
@@ -28,4 +28,10 @@ public abstract partial class ConsumableItem : Entity
/// <param name="action">Ação gerada pelo item.</param>
/// <returns>Se a ação foi realizada ou não.</returns>
public abstract bool Activate(ItemAction action);
+
+ public void ConsumedBy(Player consumer) {
+ Inventory inventory = consumer.inventory;
+ inventory.RemoveItem(this);
+ QueueFree();
+ }
} \ No newline at end of file