From 1f5a776ebda8fa57ba0641be396509b98de41494 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Thu, 5 Jun 2025 22:02:14 -0700 Subject: [PATCH] Call 'get' on a producer to return its produce This now makes more sense too. --- commands/consumables.py | 9 +++++++-- typeclasses/consumables.py | 13 +++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/commands/consumables.py b/commands/consumables.py index 05b8562..104cbbb 100755 --- a/commands/consumables.py +++ b/commands/consumables.py @@ -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()) diff --git a/typeclasses/consumables.py b/typeclasses/consumables.py index f021ffd..9ace57e 100755 --- a/typeclasses/consumables.py +++ b/typeclasses/consumables.py @@ -52,8 +52,10 @@ class Consumable(Object): elif self.db.finish_msg: msg = self.db.finish_msg else: - msg = "You finished it." - eater.msg(routput(msg)) + 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.