Call 'get' on a producer to return its produce
This now makes more sense too.
This commit is contained in:
parent
fb45aa44a3
commit
1f5a776ebd
2 changed files with 18 additions and 4 deletions
|
|
@ -6,10 +6,15 @@ from commands.command import Command
|
|||
|
||||
class CmdMakeConsumable(Command):
|
||||
"""
|
||||
Generate a new thing and give it to the caller.
|
||||
Pick something off of something else.
|
||||
|
||||
Usage: pick [ object ]
|
||||
|
||||
For instance |gpick berry|n from off of the brambleberry bush, or
|
||||
|ggrab candy|n from a bowl.
|
||||
"""
|
||||
key = "pick"
|
||||
# aliases = "pick"
|
||||
aliases = ["gather"]
|
||||
|
||||
def func(self):
|
||||
self.obj.do_make(self.caller, words=self.words())
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ class Consumable(Object):
|
|||
elif self.db.finish_msg:
|
||||
msg = self.db.finish_msg
|
||||
else:
|
||||
msg = "You finished it."
|
||||
msg = None
|
||||
|
||||
if msg:
|
||||
eater.msg(routput(msg))
|
||||
self.delete()
|
||||
|
||||
|
|
@ -89,6 +91,13 @@ class Producer(Object):
|
|||
def at_object_creation(self):
|
||||
self.cmdset.add_default(CmdSetMakeConsumable)
|
||||
|
||||
def at_pre_get(self, getter, **kwargs):
|
||||
"""
|
||||
Can't get a producer.
|
||||
"""
|
||||
self.do_make(getter)
|
||||
return False
|
||||
|
||||
def do_make(self, picker, **kwargs):
|
||||
"""
|
||||
Create a configurable consumable, given to picker.
|
||||
|
|
|
|||
Loading…
Reference in a new issue