Call 'get' on a producer to return its produce

This now makes more sense too.
This commit is contained in:
Howard Abrams 2025-06-05 22:02:14 -07:00
parent fb45aa44a3
commit 1f5a776ebd
2 changed files with 18 additions and 4 deletions

View file

@ -6,10 +6,15 @@ from commands.command import Command
class CmdMakeConsumable(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" key = "pick"
# aliases = "pick" aliases = ["gather"]
def func(self): def func(self):
self.obj.do_make(self.caller, words=self.words()) self.obj.do_make(self.caller, words=self.words())

View file

@ -52,7 +52,9 @@ class Consumable(Object):
elif self.db.finish_msg: elif self.db.finish_msg:
msg = self.db.finish_msg msg = self.db.finish_msg
else: else:
msg = "You finished it." msg = None
if msg:
eater.msg(routput(msg)) eater.msg(routput(msg))
self.delete() self.delete()
@ -89,6 +91,13 @@ class Producer(Object):
def at_object_creation(self): def at_object_creation(self):
self.cmdset.add_default(CmdSetMakeConsumable) 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): def do_make(self, picker, **kwargs):
""" """
Create a configurable consumable, given to picker. Create a configurable consumable, given to picker.