diff options
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() |
