From b2ca4beccc2054f4fcd2272e4ab9416c47c9f8d6 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Fri, 14 Feb 2025 19:43:53 -0800 Subject: [PATCH] Fix the knock on the red door. --- server/conf/connection_screens.py | 6 +- typeclasses/objects.py | 3 + typeclasses/rooms_weather.py | 1 + typeclasses/scripts.py | 5 +- web/static/webclient/css/custom.css | 7 + web/static/website/css/moss-styles.css | 5 + web/templates/website/index.html | 12 +- world/version1.ev | 172 +++++++++++++++++++++---- 8 files changed, 170 insertions(+), 41 deletions(-) diff --git a/server/conf/connection_screens.py b/server/conf/connection_screens.py index b7750a8..74e2377 100644 --- a/server/conf/connection_screens.py +++ b/server/conf/connection_screens.py @@ -31,7 +31,7 @@ You followed his instructions. Head to the city park, and on the woodsy side, tu Just keep following the red kerchiefs, until... - |b ⋅•⋅⋅•⋅⊰⋅•⋅⋅•⋅⋅•⋅⋅•⋅∙∘☽༓☾∘∙•⋅⋅⋅•⋅⋅⊰⋅•⋅⋅•⋅⋅•⋅⋅•⋅ |n + |b ⋅•⋅⋅•⋅⊰⋅•⋅⋅•⋅∙∘☽༓☾∘∙•⋅⋅⋅•⋅⋅⊰⋅•⋅⋅•⋅ |n Welcome to the World of |g{}|n, version {}! @@ -47,9 +47,9 @@ If you need to create an account, (in the box at the bottom of the screen) type If you have spaces in your username, enclose it in quotes. -After you've logged in Enter |whelp me|n for more info. +After you've logged in Enter |whelp me start|n for more the getting started guide. - |b ⋅•⋅⋅•⋅⊰⋅•⋅⋅•⋅⋅•⋅⋅•⋅∙∘☾༓☽∘∙•⋅⋅⋅•⋅⋅⊰⋅•⋅⋅•⋅⋅•⋅⋅•⋅ |n + |b ⋅•⋅⋅•⋅⊰⋅•⋅⋅•⋅∙∘☾༓☽∘∙•⋅⋅⋅•⋅⋅⊰⋅•⋅⋅•⋅ |n """.format( settings.SERVERNAME, utils.get_evennia_version("short") ) diff --git a/typeclasses/objects.py b/typeclasses/objects.py index 6f7971e..ee55dc7 100755 --- a/typeclasses/objects.py +++ b/typeclasses/objects.py @@ -216,6 +216,9 @@ class Object(ObjectParent, DefaultObject): at_desc(looker=None) """ + def global_search(self, searchdata): + return super().search(searchdata, global_search=True) + def has(self, item): """ Return true if object has an item. diff --git a/typeclasses/rooms_weather.py b/typeclasses/rooms_weather.py index 92920e7..3a2b9a4 100755 --- a/typeclasses/rooms_weather.py +++ b/typeclasses/rooms_weather.py @@ -172,6 +172,7 @@ class KnockableOutsideRoom(TimeWeatherRoom): autostart=True, attributes=[("knocker", knocker)]) knock_script.db.waker = door + # This is the _character_ that does the knocking, not the door knocker: knock_script.db.knocker = knocker knocker.msg("You grab the ring and knock firmly on the door.") diff --git a/typeclasses/scripts.py b/typeclasses/scripts.py index 24099ff..c9b8148 100644 --- a/typeclasses/scripts.py +++ b/typeclasses/scripts.py @@ -110,7 +110,10 @@ class KnockScript(Script): def at_start(self): knocker = self.attributes.get("knocker") if knocker: - god_msg(f"{knocker.key} stands at the door, and knocks.") + room = knocker.global_search("mp03") + if room: + room.msg_contents("Someone is knocking on the door...") + god_msg(f"With your seer stone, you see the knocker is {knocker.key}.") def at_repeat(self): if self.db.waker: diff --git a/web/static/webclient/css/custom.css b/web/static/webclient/css/custom.css index e1ace80..df6b566 100644 --- a/web/static/webclient/css/custom.css +++ b/web/static/webclient/css/custom.css @@ -18,6 +18,13 @@ div.out { font-weight: 400; font-style: normal; font-size: 21px; + line-height: 1.4em; +} + +@media screen and (max-width: 480px) { + div.out { + line-height: 1.4em; + } } input[type=textarea]:focus { diff --git a/web/static/website/css/moss-styles.css b/web/static/website/css/moss-styles.css index d7a528e..6a834d4 100644 --- a/web/static/website/css/moss-styles.css +++ b/web/static/website/css/moss-styles.css @@ -65,6 +65,11 @@ a.playbutton { margin: auto; } +@media screen and (max-width: 480px) { + #instructions { + display: none; + } +} #scrolled-instructions { display: none; /* display: none; */ diff --git a/web/templates/website/index.html b/web/templates/website/index.html index 42f27ab..54daccc 100644 --- a/web/templates/website/index.html +++ b/web/templates/website/index.html @@ -52,13 +52,7 @@
  • When two windows appear, click the lower one to enter some commands.
  • Type create, then a space, followed by some username, another space, and a password. Don't bother getting creative with the username. The password? Go nuts.
  • - Type the following (replacing the text on the right side of the = symbol): -
    -          name self = Rambler
    -          desc self = A frumpy, but spry person with large ears and dark blue cloak.
    -        
    - When someone types, look rambler, they will see - the desc line. Make sense? + When you've logged in, type help me for additional instructions.
  • When you return, type connect followed by the original username and password you typed the first time.
  • @@ -73,10 +67,10 @@

    Enter a cozy world... + class="playbutton" id="play">Enter a cozy world...         Wait, what is this? + class="playbutton" id="instructions">Wait, what is this?

    {% endif %} diff --git a/world/version1.ev b/world/version1.ev index 4d71332..884830f 100644 --- a/world/version1.ev +++ b/world/version1.ev @@ -16,10 +16,69 @@ # [[file:../../../projects/mud.org::*Character: Dabble][Character: Dabble:2]] -@desc self = A small, hunched old man with a gray vandyke and an eye twinkle. Spectacles perched precariously on the end of his hooked nose, wobble with his head. A jaunty crimson cap contrasts with his dark brown cloak. +@desc self = A small, hunched old man with a gray vandyke and an eye twinkle. + +Spectacles perched precariously on the end of his hooked nose, wobble with his head. A jaunty crimson cap contrasts with his dark brown cloak. # Character: Dabble:2 ends here +# Would love to have the following /introduction/. So edit [[file:~/src/moss-n-puddles/server/conf/connection_screens.py::CONNECTION_SCREEN = """][connection_screens.py]]: + +# #+begin_example +# Wha...what is this place? + +# You followed his instructions. Head to the city park, and on the woodsy side, turn left at the lamp post. Peer in the brambles and when you see the red handkerchief tied to branch, follow it ... + +# Just keep following the red kerchiefs, until... +# #+end_example + + +# When starting for the first time, I would like to add … + +# #+begin_example +# An envelope of parchment wedged under a scaly protrusion of bark...inside, a letter in familiar penmanship, personally addressed to you... + +# If you are reading this, you've found the world I +# was overly excited in relaying to you over drinks in +# Marsivan. Most excellent. Enjoy this halcyon world, +# unspoiled and idyllic. + +# I'm here, so join me in a cup of tea and we can +# reconnect and reminisce of glorious days gone by, +# and the utter curiosity that surrounds us. + +# Your friend, +# Dabbler +# #+end_example + +# As the surrounding mists dissipate, you find yourself in an ancient, halcyon forest dripping with moss. + +# Or some help: + + +# [[file:../../../projects/mud.org::*World: Moss and Puddles][World: Moss and Puddles:1]] +@sethelp/replace me start = Again, welcome to my cozy little game. + +To |wplay this game|n, you typically type a |w|b for an action, or |w |b combinations. For instance, type |blook|n to look around the area, and |blook tree|n to examine the trees in particular. The more you look, the more you explore. + +What verbs are available depends on where you are and what you might be holding. Type |bhelp|n with so other option to get a list. Then type |bhelp look|n to get details on how to use the |wlook|n verb. + +This is a multi-user game, you might run into other characters, and they may look at you, so let's use some |w@|b verbs to affect the world from outside the storybook. +Type: + |b@name self = Rambler|n + +Where Rambler would be the name that you would like to be known. It currently defaults to the name you used when you created this account. + +Next type: + |b@desc self = A frumpy, but spry person with large ears and dark blue cloak.|n + +You see what people see when they look at you by typing: + |blook self|n + +What is the goal of this game? Just to escape the chaos of the world and explore an idyllic setting. Feel free to find me to chat, but good luck finding me, as I may be hiding. +# World: Moss and Puddles:1 ends here + + # Rename the Limbo (or starting place) with the name *Forest*. Note the term =mp01= as a global label that matches my map. @@ -27,10 +86,17 @@ @name here = The Forest;mp01 # The Forest:1 ends here + + # The description will take advantage of the /seasons/ and /times/ of the day: + # [[file:../../../projects/mud.org::*The Forest][The Forest:2]] -@desc here = A giant, moss-covered boulder stands among immense trees that etch the sky and slice the clouds in the darkening twilightawakening dawnlazy afternoonnight sky. A footpath winds around the giant, moss-covered tree roots to the East and West. To the south, a dock lounges on a large pond. +@desc here = A giant, moss-covered boulder stands among immense trees that etch the sky and slice the clouds in the darkening twilightawakening dawnlazy afternoonnight sky. + +Since it is morning, you can hear the dawn chorus of birds afternoon, you can hear the buzzing of insects around giant colorful flowersevening, you can hear much as most of the forest creatures are settling down for the nightnight, you can hear crickets and an occassional owl. + +A footpath winds around the giant, moss-covered tree roots to the East and West. To the south, a dock lounges on a large pond. # The Forest:2 ends here @@ -43,6 +109,24 @@ # The Forest:3 ends here + +# Derived from the original [[~/src/moss-n-puddles/.venv/lib/python3.12/site-packages/evennia/contrib/tutorials/tutorial_world/rooms.py][rooms.py]], but now stored in [[file:~/src/moss-n-puddles/typeclasses/rooms_weather.py][rooms_weather.py]]. + +# Describe the trees: + +# [[file:../../../projects/mud.org::*The Forest][The Forest:4]] +@detail tree;trees = You feel dwarfed by colossal trees whose moss-covered roots are difficult to peer over. An occassional breeze often smells of flowers and other times earthy. While the leafy canopy hides the sky, you certainly can |wfeel|n the weather. +# The Forest:4 ends here + + + +# And the flowers: + +# [[file:../../../projects/mud.org::*The Forest][The Forest:5]] +@detail flower;flowers = Beautiful, but giant flowers look down on you and nod a friendly greeting. +# The Forest:5 ends here + + # More details about the room that describes aspects of the boulder in the =desc= above. First, the symbol: # [[file:../../../projects/mud.org::*Boulder][Boulder:1]] @@ -70,7 +154,7 @@ # The runes use multibyte unicode which screws up the =telnet= client. # [[file:../../../projects/mud.org::*Boulder][Boulder:4]] -@detail runes = "The runes read ᛞ ᚪ ᛒ ᛚ ᚱ" +@detail runes;rune = The runes read ᛞ ᚪ ᛒ ᛚ ᚱ # Boulder:4 ends here @@ -87,7 +171,9 @@ # The ability to /climb/ the boulder isn’t immediately obvious, so let’s make it a bit of a secret: # [[file:../../../projects/mud.org::*Boulder][Boulder:6]] -@desc boulder = A boulder with patches of moss and delicate clover. A carved symbol and even some runes try to hide behind tendrils of ivy as if keeping a secret. Wait! You notice a foot hold, and then another. You can |bclimb|n this boulder! +@desc boulder = A boulder with patches of moss and delicate clover. A carved symbol and even some runes try to hide behind tendrils of ivy as if keeping a secret. + +Wait! You notice a foot hold, and then another. You can |bclimb|n this boulder! # Boulder:6 ends here @@ -336,9 +422,6 @@ Looks good for being out in the weather. # Chair:4 ends here -# And a fishing pole? - -# First we need to make a =PermanentObject= (from the regular =Object=), but one that offers a # Return to the forest: @@ -357,7 +440,8 @@ Looks good for being out in the weather. # With a nice message about wandering: # [[file:../../../projects/mud.org::*Forest Path][Forest Path:3]] -@set west/traverse_msg = "You meander between mossy tree roots along a footpath for a while..." +@set west/traverse_msg = "You meander between mossy tree roots along a +footpath for a while..." # Forest Path:3 ends here @@ -388,7 +472,9 @@ west # [[file:../../../projects/mud.org::*Forest Path][Forest Path:7]] -@desc here = Moss-covered tree roots border the meandering footpath. A red door with a round top lies at the base of a giant tree, a carved sign over it reads, Dabblers. +@desc here = Moss-covered tree roots border the meandering footpath. A + red door with a round top lies at the base of a giant tree, a carved + sign over it reads, Dabblers. # Forest Path:7 ends here @@ -497,7 +583,8 @@ How else are you going to knock on a door? # And an error message if the ring is not with the goblin: # [[file:../../../projects/mud.org::*Knocker][Knocker:13]] -@set here/knock_err_msg = "This door knocker is defective, as it doesn't have a ring to...er, do the knockin'." +@set here/knock_err_msg = "This door knocker is defective, as it +doesn't have a ring to...er, do the knockin'." # Knocker:13 ends here # [[file:../../../projects/mud.org::*Cozy Tea House][Cozy Tea House:1]] @@ -508,7 +595,10 @@ How else are you going to knock on a door? # The door description should match the artwork on the website: # [[file:../../../projects/mud.org::*Red Door][Red Door:1]] -@desc red door = A painted red door where the round top of the door fits snugly in the bark of the tree. Along with a large brass doorknob, the door sports the most curious door knocker in the shape of a goblin's face. +@desc red door = A painted red door where the round top of the door + fits snugly in the bark of the tree. Along with a large brass + doorknob, the door sports the most curious door knocker in the shape + of a goblin's face. # Red Door:1 ends here @@ -568,9 +658,13 @@ How else are you going to knock on a door? # And the best description ever: # [[file:../../../projects/mud.org::*Inside][Inside:5]] -@desc here = An enormous stone hearth overshadows this round room with dark paneling. A subtle smell of tea and incense. Large, overstuffed chairs sit invitingly by the fireplace. Oddly angled shelves with books and knickknackery adorn the walls while a trolley supports a large kettle, cups and scones. +@desc here = An enormous stone hearth overshadows this round room with + dark paneling. A subtle smell of tea and incense. Large, overstuffed + chairs sit invitingly by the fireplace. Oddly angled shelves with + books and knickknackery adorn the walls while a trolley supports a + large kettle, cups and scones. # Inside:5 ends here -#ZZ + # Since we want the description to include the state of the fire, we need some /parts/ to assemble. Still not sure how this should be done. @@ -580,19 +674,26 @@ How else are you going to knock on a door? @set here/initial_desc = "You found a cozy, cornerless room." # Ravenous State -@set here/fire_out = "The room is dim, but you see large, overstuffed chairs placed by a dark fireplace in a large stone hearth. Perhaps you could light a fire?" +@set here/fire_out = "The room is dim, but you see large, overstuffed chairs placed + by a dark fireplace in a large stone hearth. Perhaps you could light a fire?" # Hungry State -@set here/fire_dim = "Large, overstuffed chairs sit invitingly close to the dimly glowing embers in the fireplace of a stone hearth." +@set here/fire_dim = "Large, overstuffed chairs sit invitingly close to the + dimly glowing embers in the fireplace of a stone hearth." # Fed State -@set here/fire_on = "Large, overstuffed chairs sit invitingly by a fire casting shadows that dance on the dark paneling." +@set here/fire_on = "Large, overstuffed chairs sit invitingly by a fire casting + shadows that dance on the dark paneling." # Full State -@set here/fire_full = "Large, overstuffed chairs slightly shield you from the bright light of the roaring fire in the fireplace of a stone hearth." +@set here/fire_full = "Large, overstuffed chairs slightly shield you + from the bright light of the roaring fire in the fireplace of a stone hearth." # And a final description: -@set here/final_desc = "Oddly angled shelves with books and knickknackery adorn the walls around a tapestry. The subtle smell of wood smoke, incense and tea leads you to a trolley supporting a large teapot, cups and freshly baked scones." +@set here/final_desc = "Oddly angled shelves with books and + knickknackery adorn the walls around a tapestry. The subtle smell of + wood smoke, incense and tea leads you to a trolley supporting a large + teapot, cups and freshly baked scones." # Inside:6 ends here @@ -602,7 +703,11 @@ How else are you going to knock on a door? # Let’s come up with a lot of descriptions: # [[file:../../../projects/mud.org::*Inside][Inside:7]] -@detail tapestry = The muted colors of the tapestry either show its age or its location over the sometimes smokey hearth. It shows a gallant stag surrounded by woodland creatures. A racoon holds aloft a gold box while a wolf has a gnarled staff. A raven perched on the stag's antlers grips a blue ball in its beak. +@detail tapestry = The muted colors of the tapestry either show its + age or its location over the sometimes smokey hearth. It shows a + gallant stag surrounded by woodland creatures. A racoon holds aloft a + gold box while a wolf has a gnarled staff. A raven perched on the + stag's antlers grips a blue ball in its beak. # Inside:7 ends here @@ -610,8 +715,7 @@ How else are you going to knock on a door? # We should describe all the objects in the tapestry, eh? # [[file:../../../projects/mud.org::*Inside][Inside:8]] -@detail raven = The raven winks at you, and says, “Nevermore.” -Really? It probably didn't. Your eyes must be playing trickster. +@detail raven = The raven winks at you, and says, “Nevermore.” Really? It probably didn't. Your eyes must be playing trickster. # Inside:8 ends here @@ -662,14 +766,17 @@ Really? It probably didn't. Your eyes must be playing trickster. # And a description that will be overridden: # [[file:../../../projects/mud.org::*Fireplace][Fireplace:3]] -@desc fireplace = A stone fireplace with a carved wooden mantel supporting small pictures, some books and a black statue. +@desc fireplace = A stone fireplace with a carved wooden mantel supporting + small pictures, some books and a black statue. # Fireplace:3 ends here # Since we mentioned some details, we better mention them: # [[file:../../../projects/mud.org::*Fireplace][Fireplace:4]] -@detail pictures = Two small framed pictures perch above the fireplace mantle. One is of a satyr playing a saxophone, and the other is of a fish with a big smile. +@detail pictures = Two small framed pictures perch above the fireplace + mantle. One is of a satyr playing a saxophone, and the other is of a + fish with a big smile. # Fireplace:4 ends here @@ -677,7 +784,8 @@ Really? It probably didn't. Your eyes must be playing trickster. # This reference in this detail is obviously, only for me: # [[file:../../../projects/mud.org::*Fireplace][Fireplace:5]] -@detail statue = A small, black statue of a salamander curled around a book, engraved with a title, "Seeing Stones". +@detail statue = A small, black statue of a salamander curled around a + book, engraved with a title, "Seeing Stones". # Fireplace:5 ends here @@ -685,7 +793,9 @@ Really? It probably didn't. Your eyes must be playing trickster. # I imagine a giant picture over the fireplace … need to do something interesting with it. # [[file:../../../projects/mud.org::*Fireplace][Fireplace:6]] -@detail picture;painting = Above the fireplace is a large, somewhat abstract painting stretching its arm-like branches with shadowing that looks like a yawn. +@detail picture = Above the fireplace is a large, somewhat abstract + painting stretching its arm-like branches with shadowing that looks + like a yawn. # Fireplace:6 ends here @@ -695,7 +805,9 @@ Really? It probably didn't. Your eyes must be playing trickster. # [[file:../../../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. +@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. # Knickknacks:1 ends here @@ -703,7 +815,10 @@ Really? It probably didn't. Your eyes must be playing trickster. # We mentioned shelves of books: # [[file:../../../projects/mud.org::*Books][Books:1]] -@detail shelves;bookshelf;bookshelves = Shelves at various angles embellish the walls of this small, cozy room. Leatherbound books weigh each shelf, while some stacks of books support other shelves. Dabbler has decorated some shelves with odd trinkets. +@detail shelves;bookshelf;bookshelves = Shelves at various angles + embellish the walls of this small, cozy room. Leatherbound books + weigh each shelf, while some stacks of books support other shelves. + Dabbler has decorated some shelves with odd trinkets. # Books:1 ends here @@ -734,7 +849,8 @@ Really? It probably didn't. Your eyes must be playing trickster. # We mentioned a /trolley/ with tea, cups and scones: # [[file:../../../projects/mud.org::*Tea Service][Tea Service:1]] -@detail trolley = A tea trolley, complete with a small collection of teacups, a magical teapot, as well as an assortment of scones and pastries. +@detail trolley = A tea trolley, complete with a small collection of + teacups, a magical teapot, as well as an assortment of scones and pastries. # Tea Service:1 ends here