diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-08 22:10:45 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-08 22:10:45 -0300 |
| commit | f1b51bed52ffbd90b5b7cc8dcfc6f0484bbbeb3c (patch) | |
| tree | d607142daee4948765a97008bdef21fa6efa2d2b /scripts/entities/actions | |
| parent | 4b2afd3e2144e42bfa7f11a870584b9255052cf7 (diff) | |
inventário acessivel
Diffstat (limited to 'scripts/entities/actions')
| -rw-r--r-- | scripts/entities/actions/DropAction.cs | 13 | ||||
| -rw-r--r-- | scripts/entities/actions/DropAction.cs.uid | 1 | ||||
| -rw-r--r-- | scripts/entities/actions/ItemAction.cs | 6 |
3 files changed, 18 insertions, 2 deletions
diff --git a/scripts/entities/actions/DropAction.cs b/scripts/entities/actions/DropAction.cs new file mode 100644 index 0000000..e5bd929 --- /dev/null +++ b/scripts/entities/actions/DropAction.cs @@ -0,0 +1,13 @@ +using Godot; + +public partial class DropAction : ItemAction +{ + public DropAction(Player player, ConsumableItem item) : base(player, item) + { + } + + public override bool Perform() { + player.inventory.Drop(item); + return true; + } +}
\ No newline at end of file diff --git a/scripts/entities/actions/DropAction.cs.uid b/scripts/entities/actions/DropAction.cs.uid new file mode 100644 index 0000000..98ed82f --- /dev/null +++ b/scripts/entities/actions/DropAction.cs.uid @@ -0,0 +1 @@ +uid://by48a3a3gbvfa diff --git a/scripts/entities/actions/ItemAction.cs b/scripts/entities/actions/ItemAction.cs index 54ff207..d5247df 100644 --- a/scripts/entities/actions/ItemAction.cs +++ b/scripts/entities/actions/ItemAction.cs @@ -2,10 +2,12 @@ using Godot; public partial class ItemAction : Action { - private ConsumableItem item; - public ItemAction(Actor actor, ConsumableItem item) : base(actor) + protected ConsumableItem item; + protected Player player; + public ItemAction(Player player, ConsumableItem item) : base(player) { this.item = item; + this.player = player; } public override bool Perform() |
