From 254a8ace79a19743491de20d956a4872c4259b3e Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Fri, 18 Apr 2025 18:42:21 -0700 Subject: [PATCH] Create a magic crystal ball --- typeclasses/things.py | 37 ++++++++ world/version1.ev | 190 +++++++++++++++++++++++++++--------------- 2 files changed, 159 insertions(+), 68 deletions(-) diff --git a/typeclasses/things.py b/typeclasses/things.py index 261124b..d65b2c1 100755 --- a/typeclasses/things.py +++ b/typeclasses/things.py @@ -45,11 +45,48 @@ class Trinket(Object): Return a trinket by cycling through the list. """ self.db.last_trinket_num = self.db.last_trinket_num + 1 + + # Once they have seen the crystal ball, they can now "see" + # them, and probably pick one up, if they are around: + if self.db.last_trinket_num == 0: + self.tags.add("hidden_ball") + + # Seen all the trinkets? Oh boy, well, let's loop: 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 CrystalBall(Object): + def return_appearance(self, looker, **kwargs): + """Return a different result each time it is looked.""" + return routput(self.db.desc) + " |w" + choice([ + "Definitely yes", + "It is certain", + "It is decidedly so", + "Without a doubt", + "You may rely on it", + "As I see it, yes", + "Most likely", + "Outlook good", + "Yes", + "Signs point to yes", + + "Reply hazy, try again", + "Ask again later", + "Better not tell you now", + "Cannot predict now", + "Concentrate and ask again", + + "Nope", + "Don’t count on it", + "My reply is no", + "My sources say no", + "Outlook not so good", + "Very doubtful", + ]) + class Ring(Object): def move_to(self, destination, **kwargs): """ diff --git a/world/version1.ev b/world/version1.ev index 0b9a85a..c0b8b33 100644 --- a/world/version1.ev +++ b/world/version1.ev @@ -451,20 +451,24 @@ east @detail frog;frogs = Cute little guys with their big black eyes. Too quick to catch. # Field:14 ends here -# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:15]] -@detail waterfall;water = Cascading down the cliff in three sections, each section of this giant waterfall widens ending in a large pool. + +# This is special, in that it should be hidden: + + +# [[file:../../../Dropbox/org/projects/mud.org::*Waterfall][Waterfall:1]] +@create/drop waterfall;water +# Waterfall:1 ends here + + + +# And the description: + + +# [[file:../../../Dropbox/org/projects/mud.org::*Waterfall][Waterfall:2]] +@desc waterfall = Cascading down the cliff in three sections, each section of this giant waterfall widens ending in a large pool. Wait! Is there a large cave entrance hidden behind the water? -# Field:15 ends here - - - -# And a detail if they look at the shadow in the field: - - -# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:16]] -@detail shadow = You see a big, hairy beast with long teeth and claws. Its great horns, tipped in black, point to the sky. -# Field:16 ends here +# Waterfall:2 ends here # To create a place for our big, hairy beast to sleep, first jump to the Meadow: @@ -562,142 +566,141 @@ lair # The Lair of the Beast:11 ends here - # And we create the Big, Hairy Beast: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:12]] -@create/drop big hairy beast;bhb;beast;hairy beast;monster: typeclasses.pets.BHB -# The Lair of the Beast:12 ends here +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:1]] +@create/drop big hairy beast;bhb;beast;hairy beast;monster,shadow: typeclasses.pets.BHB +# Beast:1 ends here # And let’s hide it until we are ready: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:13]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:2]] @set beast/hidden_tag = "hidden_beast" # @lock beast = view:tag(hidden_beast) -# The Lair of the Beast:13 ends here +# Beast:2 ends here # And a general description that will be /expanded/ with its current reaction. -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:14]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:3]] @desc beast = A big, hairy beast with long claws and teeth. -# The Lair of the Beast:14 ends here +# Beast:3 ends here # Can’t get this: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:15]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:4]] @lock beast = get:false() # @set beast/get_err_msg = "You can't pick that up, as that beast is far larger than you." -# The Lair of the Beast:15 ends here +# Beast:4 ends here # And set its sleepy time at 8pm … -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:16]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:5]] @set beast/sleep_hour = 21 -# The Lair of the Beast:16 ends here +# Beast:5 ends here # It will wake at 8am … -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:17]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:6]] @set beast/wake_hour = 8 -# The Lair of the Beast:17 ends here +# Beast:6 ends here # Let’s set some behavior levels. For instance, the beast is sad when he doesn’t see its friends: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:18]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:7]] @set beast/loneliness_amount = -2 -# The Lair of the Beast:18 ends here +# Beast:7 ends here # It seem to warm up the to new characters hanging around the area, but not as much as those that would interact with it: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:19]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:8]] @set beast/shyness_amount = 3 -# The Lair of the Beast:19 ends here +# Beast:8 ends here # How active should this pet be? Seems like at the moment, it shouldn’t be too obnoxious. This setting is a percentage, so 12 is /12%/, which returns a message only 12% of the /ticks/ (where a tick is about a minute). -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:20]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:9]] @set beast/active_amount = 10 -# The Lair of the Beast:20 ends here +# Beast:9 ends here # It isn’t that scared of new people, as it will ignore them when someone it knows is around. -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:21]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:10]] @set beast/new_character_reaction = 'ignores' -# The Lair of the Beast:21 ends here +# Beast:10 ends here # Seems we should make descriptions for all the states that happen when you look at them. These are appended to the standard description. -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:22]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:11]] @set beast/scared_msg = "It seems <> as it tries to hide behind a tall clump of grass. Yeah, it doesn't do a good job of hiding." -# The Lair of the Beast:22 ends here +# Beast:11 ends here # Concerned level: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:23]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:12]] @set beast/concerned_msg = "Its large, yellow eyes stare at you from a safe distance." -# The Lair of the Beast:23 ends here +# Beast:12 ends here # Interested level: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:24]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:13]] @set beast/interested_msg = "It seems <> in what you are doing <>. ;; Its << ^ large, ^ big,>> yellow eyes watch your every move." -# The Lair of the Beast:24 ends here +# Beast:13 ends here # Friendly level: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:25]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:14]] @set beast/friendly_msg = "It sits next to you, as its big, friendly eyes gaze as you. ;; It <> to you, wagging its tail-less behind. ;; It lays down next to you." -# The Lair of the Beast:25 ends here +# Beast:14 ends here # When the beast is sleeping, we can some times spam the room with the snores: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:26]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:15]] @set beast/sleeping_actions = "The <> <> <> lets loose a <> snore. ;; The <> <> <> growls in its sleep. ;; The <> <> <> twitches its <>. ;; The <> <> <> <> on its <> mattress." -# The Lair of the Beast:26 ends here +# Beast:15 ends here @@ -706,9 +709,9 @@ lair # The scared level doesn’t last long, so let’s just leave one message: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:27]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:16]] @set beast/scared_actions = "A shadow hovers at the edge of the meadow.." -# The Lair of the Beast:27 ends here +# Beast:16 ends here @@ -716,36 +719,36 @@ lair # Concerned actions: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:28]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:17]] @set beast/concerned_actions = "The <> <> <> <> concerned by your presence in the <>. ;; The <> <> <> seems concerned. Maybe it's hungry.. ;; The <> <> <> seems concerned and keeps its distance.." -# The Lair of the Beast:28 ends here +# Beast:17 ends here # Interested actions: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:29]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:18]] @set beast/interested_actions = "The <> <> <> seems <> in what you are doing <>. ;; The <> <> <> seems curious about you. ;; The <> <> <> stands on its hind legs. ;; The <> <> <> <> you with its <> yellow eyes." -# The Lair of the Beast:29 ends here +# Beast:18 ends here # Friendly actions: -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:30]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:19]] @set beast/friendly_actions = "The <> <> <> <> <> wagging its backend<<, ^ as it seems>> happy to see . ;; The <> <> <> <> <> hoping to play with . ;; The <> <> <> flops over in front of wriggling <> on the ground. ;; The <> <> <> <> <> next to you. ;; The <> <> <> chases butterflies around the <>." -# The Lair of the Beast:30 ends here +# Beast:19 ends here # The ecstatic states are just a bit more than friendly. -# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:31]] +# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:20]] @set beast/ecstatic_actions = "The <> <> <> <> <> to give a sloppy <>. ;; The <> <> <> <> <> wagging its backend as it seems <> excited to see . ;; The <> <> <> <> <> hoping to play with . ;; The <> <> <> flops over in front of happily wriggling on the ground. ;; The <> <> <> excitedly <> <> next to you. ;; The <> <> <> <> leaps into air. ;; The <> <> <> chases butterflies around the <>." -# The Lair of the Beast:31 ends here +# Beast:20 ends here # The dock leads out into the large pond. The break in the trees lets you see the sky. Looks like a nice place to relax. @@ -802,18 +805,26 @@ south -# And describe the walk back into the forest: +# Since we use the =tunnel= command, we need to update the weather system: # [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:8]] -@set north/traverse_msg = "You walk up a path and back into the forest of giant trees." +@update here = typeclasses.rooms_weather.TimeWeatherRoom # The Dock:8 ends here + +# And describe the walk back into the forest: + +# [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:9]] +@set north/traverse_msg = "You walk up a path and back into the forest of giant trees." +# The Dock:9 ends here + + # And a description: -# [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:9]] +# [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:10]] @desc north = This path leads into the forest of collosal trees. -# The Dock:9 ends here +# The Dock:10 ends here # A nice chair to sit on the dock by the bay, watching the clouds as they drift away. @@ -844,6 +855,13 @@ Looks good for being out in the weather. # Chair:4 ends here +# It we are going to sit on a chair by the dock, why not go fishing? + +# [[file:../../../Dropbox/org/projects/mud.org::*Fishing Pole][Fishing Pole:1]] +@create/drop fishing pole;pole:typeclasses.fishing.FishingPole +# Fishing Pole:1 ends here + + # With a description: @@ -871,7 +889,7 @@ Looks good for being out in the weather. # @detail water;waves = Despite the weather, the water looks nice...well, nice for fishing. # -@detail dock = Sturdy and well made. Bobs a little with the waves. +# @detail dock = Sturdy and well made. Bobs a little with the waves. # Fishing Pole:4 ends here @@ -972,35 +990,43 @@ west -# And some aliases: +# Since we use the =tunnel= command, we need to update the weather system: # [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:9]] -@name east = east;e;footpath +@update here = typeclasses.rooms_weather.TimeWeatherRoom # Forest Path:9 ends here + +# And some aliases: + +# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:10]] +@name east = east;e;footpath +# Forest Path:10 ends here + + # A description if they look east: -# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:10]] +# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:11]] @desc east = A winding footpath that leads through the forest of giant trees. -# Forest Path:10 ends here +# Forest Path:11 ends here # And a nice journey message to go east in of the forest: -# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:11]] +# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:12]] @set east/traverse_msg = "The mossy tree roots makes for an interesting path..." -# Forest Path:11 ends here +# Forest Path:12 ends here # And extra things to see: -# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:12]] +# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:13]] @detail trees;tree = The trees in this forest are massive, but a smaller tree has a red door. Must lead to a closet! -# Forest Path:12 ends here +# Forest Path:13 ends here # The berry bush is a [[file:~/src/moss-n-puddles/typeclasses/consumables.py::class Producer(Object):][producer]] that makes /berries/, which is something to eat and use to feed the wildlife. @@ -1163,7 +1189,7 @@ west # [[file:../../../Dropbox/org/projects/mud.org::*Knocker][Knocker:9]] -@lock ring = tethered:id(#27) +@lock ring = tethered:id(#28) # @set ring/tethered_msg = "You put the ring back in the knocker's mouth. \"Mmmuufffmm,\" says the door knocker." # Knocker:9 ends here @@ -1428,6 +1454,34 @@ west # Knickknacks:2 ends here +# One trinket we might create to give to people as a souvenir. + + +# [[file:../../../Dropbox/org/projects/mud.org::*Magic 8 Ball][Magic 8 Ball:1]] +@create/drop crystal ball;ball;magic ball: typeclasses.things.CrystalBall +# Magic 8 Ball:1 ends here + + + +# And its description: + + +# [[file:../../../Dropbox/org/projects/mud.org::*Magic 8 Ball][Magic 8 Ball:2]] +@desc ball = A glass orb with swirling mists << ^ of blue ^ the color of octarine ^ and stars>>; when clear, the glass reads, +# Magic 8 Ball:2 ends here + + + +# And we should hide it: + + +# [[file:../../../Dropbox/org/projects/mud.org::*Magic 8 Ball][Magic 8 Ball:3]] +@set ball/hidden_tag = "hidden_ball" +# +@lock ball = view:tag(hidden_ball) +# Magic 8 Ball:3 ends here + + # We mentioned shelves of books: