From 876c890052192b2bb1fd9fce0c1a90b8b2123521 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 13 May 2025 22:08:33 -0700 Subject: [PATCH] Made the knocker more interesting to see --- typeclasses/things.py | 66 +++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/typeclasses/things.py b/typeclasses/things.py index 0d2dddc..fe35940 100755 --- a/typeclasses/things.py +++ b/typeclasses/things.py @@ -258,24 +258,23 @@ class Knocker(Object): "A hint does sound fair. <> come up with a |mriddle|n<<, huh ^ >>?" ] riddle_responses = [ - "Aged in barrels, smooth and neat, in a glass by the fire, I'm a treat.", - "A scent of oak, a whiff of grain, a drop of expertise from the cask remains.", """ - In oaken halls, I sleep and bide, - till I'm called to warm your insides... - hrm, that's a little vague, but kinda nice. - """, - """ - Alright, alright, the riddle should be clever. - It should refer to its golden hue, and I should make it obvious - that it isn't gold, and adding a reference to quest of the Argonauts - would be a complete red herring, and quite a mean thing to do, - so I shouldn't add that, - but what about barrels? Yeah, need to include barrels, but not the - way Bilbo road barrels, for that was definitely intended as a misleading - riddle for Smaug, but of course, a smart dragon would always figure such - things out, wait, where was I? - """ + Aged in barrels, smooth and neat, + In a glass by the fire, I'm a treat. + """, + """ + A scent of oak, a whiff of grain, + A drop of expertise from the cask remains. + """, + """ + In oaken halls, I sleep and bide, + till I'm called to warm your insides... + hrm, that's a little vague, but kinda nice. + """, + """ + Alright, alright, the riddle should be clever. + + It should refer to its golden hue, and I should make it obvious that it isn't gold, and adding a reference to quest of the Argonauts would be a complete red herring, and quite a mean thing to do, so I shouldn't add that, but what about barrels? Yeah, need to include barrels, but not the way Bilbo road barrels, for that was definitely intended as a misleading riddle for Smaug, but of course, a smart dragon would always figure such things out, wait, where was I?""" ] locked_responses = [ @@ -320,8 +319,7 @@ class Knocker(Object): "I'm hanging on a door? Really? Let's see, can I roll my eyes?", "Just to let you know, the door is locked.", """ - I shouldn't be telling you this, - but I like the cut of your <>. + I shouldn't be telling you this, but I like the cut of your <>. So, you see, if you speak the |mpassword|n, wait, I've said too much. """ ], Knocker_Convo.DOOR], @@ -362,17 +360,8 @@ class Knocker(Object): ] after_unlocked_responses = [ - """ - We could <> and - <> this <>, - but we both know that |wyou|n know the <>, - and can go through the |gdoor|n now. - """, - """ - <>, let's <> you - don't know the <>, and - <> this conversation. - """, + "We could <> and <> this <>, but we both know that |wyou|n know the <>, and can go through the |gdoor|n now.", + "<>, let's <> you don't know the <>, and <> this conversation.", ] cant_hear_responses = [ @@ -524,6 +513,23 @@ class Knocker(Object): # get any feedback from the server (not even the results of look) super().msg(text=text, from_obj=from_obj, **kwargs) + def at_say(self, text): + obj_name = choice(["The knocker", "The knocker", + "The knocker", "The knocker", + "The door knocker", "The door knocker", + "The goblin-shaped knocker", + "The goblin-shaped door knocker"]) + if text.endswith("?"): + verb = "asks" + elif text.endswith("!"): + verb = "exclaims" + else: + verb = choice(["says", "replies", "answers", + "responds", "says", "says"]) + + phrase = f"{obj_name} {verb}, \"{text}\"" + self.location.msg_contents(phrase, exclude=self) + def at_object_leave(self, moved_obj, target_location, move_type="move", **kwargs): """ If the ring is removed, we make a comment.