summaryrefslogtreecommitdiff
path: root/scripts/entities/actions
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-09-04 18:31:40 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-09-04 18:31:40 -0300
commit1e248d3dd18f7c6bfaf8066c4662facbbb89e8f9 (patch)
tree8250335d5ad8176da05f7243052b9af85802c7ed /scripts/entities/actions
parent147bb12b5d48c5432aa1bd1cbe60b8435294445b (diff)
Itens na masmorra
Diffstat (limited to 'scripts/entities/actions')
-rw-r--r--scripts/entities/actions/Action.cs3
-rw-r--r--scripts/entities/actions/ItemAction.cs15
-rw-r--r--scripts/entities/actions/ItemAction.cs.uid1
3 files changed, 18 insertions, 1 deletions
diff --git a/scripts/entities/actions/Action.cs b/scripts/entities/actions/Action.cs
index 3f15105..9dab5a4 100644
--- a/scripts/entities/actions/Action.cs
+++ b/scripts/entities/actions/Action.cs
@@ -10,8 +10,9 @@ public abstract partial class Action : RefCounted {
/// O ator que realiza a ação.
/// </summary>
protected Actor actor;
+ public Actor ThisActor { get => actor; }
- // O custo da ação.
+ // O custo da ação.
protected int cost;
public Action(Actor actor) {
diff --git a/scripts/entities/actions/ItemAction.cs b/scripts/entities/actions/ItemAction.cs
new file mode 100644
index 0000000..54ff207
--- /dev/null
+++ b/scripts/entities/actions/ItemAction.cs
@@ -0,0 +1,15 @@
+using Godot;
+
+public partial class ItemAction : Action
+{
+ private ConsumableItem item;
+ public ItemAction(Actor actor, ConsumableItem item) : base(actor)
+ {
+ this.item = item;
+ }
+
+ public override bool Perform()
+ {
+ return item.Activate(this);
+ }
+} \ No newline at end of file
diff --git a/scripts/entities/actions/ItemAction.cs.uid b/scripts/entities/actions/ItemAction.cs.uid
new file mode 100644
index 0000000..c8c8e23
--- /dev/null
+++ b/scripts/entities/actions/ItemAction.cs.uid
@@ -0,0 +1 @@
+uid://f7ep4u4fwsyl