From 97c0178cea64975f00b6b6960fc5358b6f68f823 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 15 Apr 2025 22:29:21 -0700 Subject: [PATCH] Create a few trinkets for Dabbler's Room And fixed a few other bugs. --- typeclasses/characters.py | 4 +--- typeclasses/pets.py | 16 +++++++++------- typeclasses/things.py | 36 ++++++++++++++++++++++++++++++++++++ world/version1.ev | 23 ++++++++++++++++------- 4 files changed, 62 insertions(+), 17 deletions(-) diff --git a/typeclasses/characters.py b/typeclasses/characters.py index 8ed36ee..e52141b 100644 --- a/typeclasses/characters.py +++ b/typeclasses/characters.py @@ -194,18 +194,16 @@ class Wizard(Character): if dest and dest.is_typeclass("typeclasses.characters.Character"): dest = dest.location elif not dest or not dest.is_typeclass("typeclasses.rooms.Room"): - self.msg(f"Not sure how to go to: {location}") + self.msg(f"Not sure where, '{location}' is.") return if self.db.disappear_msg: - # logger.info(f"Got {self.db.disappear_msg}") self.spell_sequence(self.location, self.db.disappear_msg.split(';;'), self.db.appear_delay or 2) self.move_to(dest, move_type="magic", quiet=True) if self.db.reappear_msg: - # logger.info(f"Got {self.db.reappear_msg}") self.spell_sequence(self.location, self.db.reappear_msg.split(';;'), self.db.appear_delay or 2) diff --git a/typeclasses/pets.py b/typeclasses/pets.py index 72af955..1428581 100755 --- a/typeclasses/pets.py +++ b/typeclasses/pets.py @@ -431,18 +431,20 @@ class BHB(Friendly): noun = random.choice(["beast", "BHB", "monstrous beast", "big, hairy beast"]) - if hour == wake_hour: - if minute == 0: + if hour == wake_hour - 1: + if minute == 53: msg = f"The {noun} begins to stir from slumber." - elif minute == 3: + elif minute == 56: msg = f"The {noun} rises and stretches ..." - elif minute == 5: + elif minute == 58: msg = f"The {noun} lets loose a big yawn." - if hour == sleep_hour: - if minute == 0: + if hour == sleep_hour - 1: + if minute == 53: msg = f"The {noun} look up at the darkening sky." - elif minute == 3: + elif minute == 56: + msg = f"The {noun} blinks. It looks tired." + elif minute == 58: msg = f"The {noun} lets loose a big yawn." meadow = self.global_search("mp05") diff --git a/typeclasses/things.py b/typeclasses/things.py index cc321e9..c36d969 100755 --- a/typeclasses/things.py +++ b/typeclasses/things.py @@ -14,6 +14,42 @@ from .objects import Object import re +class Trinket(Object): + """ + For instance: + + """ + msgs = [ + "You see a crystal ball. When the swirling vortex stops, It reads, '[Why not?|Don't even think about it|Maybe, maybe not|Sure, just don't tell]'.", + "You find a deck of Tarot cards, but the card of Death has been replaced by a worker in an office cubical that reads, 'Mostly Death'.", + "You see a statue of a [black|red|yellow] dragon in the shape of a question mark. You have to ask yourself, Why?", + "A Venus fly trap in a shell surrounded by chubby cherubs.", + "You see a statue of a large rat. Did it just blink? Wow, after it ran away you think that was a rat of unusual size.", + "An ancient Colombian grave owl holding a sign that reads, 'Cannibals don't eat clowns? They taste funny.'", + "You find a dirty plate with a pizza crust. This is probably not a trinket as much as just sloppy housecleaning.", + "You find a vial of colorless, odorless, tasteless Iocane powder. This is among the deadlier poisons known to man, so you should probably not touch it.", + "A troll doll with an outie belly button. Everyone knows that trolls are not placental mammals, but reproduce through a complex series of... wait, you haven't had this talk with your parents, yet?", + "A small statue of a flexing giant. When you push its belly, it says, 'Its not my fault I'm the biggest and the strongest. I don't even exercise.'", + "You see a license plate from the State of Utah that reads HEATHEN, and think, what is the significance of hens in heat? Oh, and you also think, what is a license plate doing in a fantasy game about escaping the clamors of last stage capitalism?", + "You find a brilliant [blue|green|iridescent] scarf around a book, but as soon as you remove it, the book tries to bite you. After it chases you around the room, you double back, jump on it, breaking its spine (which is lets out a sad yelp), and wrap the scarf back around it. Maybe you've seen enough stuff on these shelves for a while.", + ] + + def at_object_creation(self): + """ + Set the initial number position for cycling through them. + """ + self.db.last_trinket_num = -1 + + def return_appearance(self, looker, **kwargs): + """ + Return a trinket by cycling through the list. + """ + self.db.last_trinket_num = self.db.last_trinket_num + 1 + if self.db.last_trinket_num >= len(self.msgs): + self.db.last_trinket_num = 0 + return routput(self.msgs[self.db.last_trinket_num]) + + class Ring(Object): def move_to(self, destination, **kwargs): """ diff --git a/world/version1.ev b/world/version1.ev index 2a6e4ed..c3931b2 100644 --- a/world/version1.ev +++ b/world/version1.ev @@ -49,9 +49,9 @@ Spectacles perched precariously on the end of his hooked nose, wobble with his h # [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:6]] -@set self/disappear_msg = "The gnome, Dabbler, disappears in a puff of smoke." +@set self/disappear_msg = "After a raspberry sound, the gnome, Dabbler, disappears in a wisp of smoke." # -@set self/reappear_msg = "A plume of [white|light blue|gray|] smoke appears... ;; When the smoke clears, an old gnome [emerges|materializes]." +@set self/reappear_msg = "[White|Light blue|Gray] mist appears...along with the smell of sulphur... ;; When the smoke clears, an old gnome [emerges|materializes|shows up, looking a bit confused]." # Character: Dabble:6 ends here @@ -345,7 +345,7 @@ east # And we give this area a name: # [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:7]] -@name here = Meadow;mp05 +@name here = Frog Meadow;mp05 # Field:7 ends here @@ -476,7 +476,7 @@ lair # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:7]] -@name here = Cave;mp07 +@name here = Beastie's Lair;mp07 # The Lair of the Beast:7 ends here @@ -1365,15 +1365,24 @@ west # What sort of non-books do we want to look at? -# In the meantime, let’s just have some descriptions: - # [[file:../../../Dropbox/org/projects/mud.org::*Knickknacks][Knickknacks:1]] -@detail knickknacks;things;knick-knacks;doodads;stuff;crap = An odd assortment of knickknacks and doodads that decorate the minimal space between the askewed books on the skewampus shelves. +@create/drop few trinkets;trinkets;trinket;knickknacks;knickknackery;doodads;doodad;knick-knacks: typeclasses.things.Trinket # Knickknacks:1 ends here +# Let’s not let anything of this sort be picked up: + + +# [[file:../../../Dropbox/org/projects/mud.org::*Knickknacks][Knickknacks:2]] +@lock trinkets = get:false() +# +@set trinkets/get_err_msg = "While interesting, perhaps you shouldn't steal Dabbler's personal collection." +# Knickknacks:2 ends here + + + # We mentioned shelves of books: # [[file:../../../Dropbox/org/projects/mud.org::*Books][Books:1]]