From f1b51bed52ffbd90b5b7cc8dcfc6f0484bbbeb3c Mon Sep 17 00:00:00 2001 From: Matheus Date: Mon, 8 Sep 2025 22:10:45 -0300 Subject: inventário acessivel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/entities/items/ConsumableItem.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts/entities/items/ConsumableItem.cs') 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 /// /// /// - 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 /// Ação gerada pelo item. /// Se a ação foi realizada ou não. 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 -- cgit v1.2.3