diff options
Diffstat (limited to 'scripts/entities/actions')
| -rw-r--r-- | scripts/entities/actions/Action.cs | 3 | ||||
| -rw-r--r-- | scripts/entities/actions/ItemAction.cs | 15 | ||||
| -rw-r--r-- | scripts/entities/actions/ItemAction.cs.uid | 1 |
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 |
