Stub out initial inventory management commands
authorJeremy Stanley <fungi@yuggoth.org>
Tue, 26 Jul 2022 22:21:05 +0000 (22:21 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Tue, 26 Jul 2022 22:22:15 +0000 (22:22 +0000)
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
share/command.yaml

index d186053..2318024 100644 (file)
@@ -1,6 +1,6 @@
 """User command functions for the mudpy engine."""
 
 """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.
 
 # 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
 
 
     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:
 def halt(actor, parameters):
     """Halt the world."""
     if actor.owner:
@@ -290,6 +310,13 @@ def help(actor, parameters):
     return True
 
 
     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:
 def look(actor, parameters):
     """Look around."""
     if parameters:
index fd78a03..cfa10f7 100644 (file)
@@ -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.
 
     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()
 
     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
 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.
 
     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.
 
 command.look.description: Look around.
 command.look.help: With the look command, you can see where you are.