From d8a885567ef00da6967a872524ffa9d6193f4fbe Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 26 Jul 2022 22:21:05 +0000 Subject: [PATCH] Stub out initial inventory management commands Basic command framework to get items into your inventory, drop items from your inventory, and list items in your inventory. No functionality is yet implemented by these. --- mudpy/command.py | 29 ++++++++++++++++++++++++++++- share/command.yaml | 15 ++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/mudpy/command.py b/mudpy/command.py index d186053..2318024 100644 --- a/mudpy/command.py +++ b/mudpy/command.py @@ -1,6 +1,6 @@ """User command functions for the mudpy engine.""" -# Copyright (c) 2004-2020 mudpy authors. Permission to use, copy, +# Copyright (c) 2004-2022 mudpy authors. Permission to use, copy, # modify, and distribute this software is granted under terms # provided in the LICENSE file distributed with this software. @@ -162,6 +162,26 @@ def evaluate(actor, parameters): return True +def c_get(actor, parameters): + """Move a prop into inventory.""" + if not parameters: + message = "What do you wish to get?" + else: + message = ('Not yet implemented.') + actor.send(message) + return True + + +def drop(actor, parameters): + """Move a prop out of inventory.""" + if not parameters: + message = "What do you wish to drop?" + else: + message = ('Not yet implemented.') + actor.send(message) + return True + + def halt(actor, parameters): """Halt the world.""" if actor.owner: @@ -290,6 +310,13 @@ def help(actor, parameters): return True +def inventory(actor, parameters): + """List the inventory.""" + message = ('Not yet implemented.') + actor.send(message) + return True + + def look(actor, parameters): """Look around.""" if parameters: diff --git a/share/command.yaml b/share/command.yaml index fd78a03..cfa10f7 100644 --- a/share/command.yaml +++ b/share/command.yaml @@ -1,5 +1,5 @@ --- -_copy: Copyright (c) 2004-2020 mudpy authors. Permission to use, copy, +_copy: Copyright (c) 2004-2022 mudpy authors. Permission to use, copy, modify, and distribute this software is granted under terms provided in the LICENSE file distributed with this software. @@ -44,6 +44,16 @@ command.evaluate.help: For debugging purposes, you can use this to run certain useful for inspecting the contents of in-memory objects, for example:$(eol)$(eol) evaluate universe.groups['actor'].keys() +command.get.action: command.c_get +command.get.description: Pick up or retrieve an item. +command.get.help: To retrieve something from your environment into your + inventory, get it by whatever name is shown, or even a subset or keyword + which you think might relate to it. + +command.drop.description: Put an item onto the ground. +command.drop.help: To drop something, reference it by whatever name is shown in + your inventory. + command.halt.administrative: true command.halt.description: Shut down the world. command.halt.help: This will save all active accounts, disconnect all clients @@ -54,6 +64,9 @@ command.help.help: This will list all command words available to you along with a brief description or, alternatively, give you detailed information on one command. +command.inventory.description: Look in your inventory. +command.inventory.help: List the items you're currently carrying around. + command.look.description: Look around. command.look.help: With the look command, you can see where you are. -- 2.11.0