Fix room display with RP characters

This commit is contained in:
Howard Abrams 2025-04-24 22:54:12 -07:00
parent 04aa677fb7
commit 600542b0d4
3 changed files with 196 additions and 192 deletions

View file

@ -6,9 +6,10 @@ Rooms are simple containers that has no location of their own.
""" """
from datetime import datetime from datetime import datetime
from re import match
from evennia import utils from evennia import utils
from evennia.utils import gametime from evennia.utils import gametime, logger
from evennia.contrib.grid.extended_room import ExtendedRoom from evennia.contrib.grid.extended_room import ExtendedRoom
from evennia.contrib.rpg.rpsystem import ContribRPRoom from evennia.contrib.rpg.rpsystem import ContribRPRoom
@ -33,6 +34,16 @@ class Room(ObjectParent, ExtendedRoom, ContribRPRoom):
""" """
is_dark = False is_dark = False
has_weather = False has_weather = False
appearance_template = """
{header}
|c{name}{extra_name_info}|n
{desc}
{exits}
{things}
{characters}
{footer}
"""
def get_time(self): def get_time(self):
""" """
@ -44,6 +55,34 @@ class Room(ObjectParent, ExtendedRoom, ContribRPRoom):
return (datestamp.minute, datestamp.hour, return (datestamp.minute, datestamp.hour,
self.get_time_of_day(), self.get_season()) self.get_time_of_day(), self.get_season())
def get_display_header(self, looker, **kwargs):
return "|n"
def get_display_footer(self, looker, **kwargs):
return "|n"
def get_display_characters(self, looker, *args, **kwargs):
num_chars = len(self.contents_get(content_type="character"))
char_list = super().get_display_characters(looker, pose=True)
if num_chars > 2:
return "You notice the following characters:\n" + char_list
if num_chars > 1:
character = char_list.strip()
if character.startswith('|'):
comp_char = character[2:].lower()
else:
comp_char = character.lower()
if match(r"an? |the ", comp_char):
return "You notice " + character
elif match(r"[aeiou]", comp_char):
return "You notice an " + character
else:
return "You notice a " + character
def get_display_things(self, looker, *args, **kwargs):
return super().get_display_things(looker, pose=False)
class DabblersRoom(Room): class DabblersRoom(Room):
def get_display_desc(self, looker): def get_display_desc(self, looker):

View file

@ -106,6 +106,8 @@ def choices(text, *substitutions):
selections = split(r"\s*;;\s*", text) selections = split(r"\s*;;\s*", text)
elif isinstance(text, (tuple, list)): elif isinstance(text, (tuple, list)):
selections = text selections = text
else:
selections = None
if selections: if selections:
return routput(choice(selections), *substitutions) return routput(choice(selections), *substitutions)

View file

@ -1,5 +1,5 @@
# [[file:../../../Dropbox/org/projects/mud.org::*Shell][Shell:4]] # [[file:../../../Dropbox/org/projects/mud.org::*Shell][Shell:4]]
# # -*- mode:ruby; -*- # # -*- mode:ruby; -*-says,
# Shell:4 ends here # Shell:4 ends here
@ -7,7 +7,7 @@
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:1]] # [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:1]]
@name self = Dabbler;gnome;old gnome @name self = Dabbler;gnome
# Character: Dabble:1 ends here # Character: Dabble:1 ends here
@ -32,57 +32,66 @@ Spectacles perched precariously on the end of his hooked nose, wobble with his h
# And we create a couple of objects, like a cap: # And a short description:
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:4]] # [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:4]]
@sdesc old gnome
# Character: Dabble:4 ends here
# And we create a couple of objects, like a cap:
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:5]]
@create cap @create cap
# #
@desc cap = It's crimson. It's jaunty. @desc cap = It's crimson. It's jaunty.
# Character: Dabble:4 ends here # Character: Dabble:5 ends here
# And my staff: # And my staff:
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:5]] # [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:6]]
@create gnarled staff;stick;staff: typeclasses.things.Stick @create gnarled staff;stick;staff: typeclasses.things.Stick
# #
@desc stick = An oaken staff with a sprig of two leaves next to a swirling ball of crystal embedded near the top. @desc stick = An oaken staff with a sprig of two leaves next to a swirling ball of crystal embedded near the top.
# Character: Dabble:5 ends here # Character: Dabble:6 ends here
# And his special teacup: # And his special teacup:
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:6]] # [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:7]]
@create teacup;cup : typeclasses.drinkables.TeaCup @create teacup;cup : typeclasses.drinkables.TeaCup
# #
@desc teacup = A rustic teacup crafted from clay etched with leaves and runes, with an olive green and brown glaze. @desc teacup = A rustic teacup crafted from clay etched with leaves and runes, with an olive green and brown glaze.
# Character: Dabble:6 ends here # Character: Dabble:7 ends here
# And his spells: # And his spells:
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:7]] # [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:8]]
@set self/disappear_msg = "After a raspberry sound, the gnome, Dabbler, disappears in a wisp of smoke." @set self/disappear_msg = "After a raspberry sound, the gnome, Dabbler, disappears in a wisp of smoke."
# #
@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>>." @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:7 ends here # Character: Dabble:8 ends here
# And help with the =fly= spell: # And help with the =fly= spell:
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:8]] # [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:9]]
# nick/object meadow = Frog Meadow # nick/object meadow = Frog Meadow
nick meadow = ^fly Frog Meadow nick meadow = ^fly Frog Meadow
# Character: Dabble:8 ends here # Character: Dabble:9 ends here
# The pipe is little more than messages to the smoker and everyone else in the room. # The pipe is little more than messages to the smoker and everyone else in the room.
@ -94,7 +103,7 @@ nick meadow = ^fly Frog Meadow
# And a desciption: # And a description:
# [[file:../../../Dropbox/org/projects/mud.org::*Pipe][Pipe:2]] # [[file:../../../Dropbox/org/projects/mud.org::*Pipe][Pipe:2]]
@ -123,7 +132,6 @@ nick meadow = ^fly Frog Meadow
# Need to add weather and time data to this: # Need to add weather and time data to this:
# [[file:../../../Dropbox/org/projects/mud.org::*The Forest][The Forest:3]] # [[file:../../../Dropbox/org/projects/mud.org::*The Forest][The Forest:3]]
# from evennia.contrib.tutorials.tutorial_world.rooms import WeatherRoom
@update here = typeclasses.rooms_weather.TimeWeatherRoom @update here = typeclasses.rooms_weather.TimeWeatherRoom
# The Forest:3 ends here # The Forest:3 ends here
@ -352,104 +360,75 @@ Wait! You notice a foot hold, and then another. You can |gclimb|n this boulder!
# And we use the =tunnel= command this time: # And we use the =tunnel= command this time:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:2]] # [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:2]]
@tunnel e = path @dig Frog Meadow;mp05 : typeclasses.rooms_weather.TimeWeatherRoom = east;e;path,footpath;west;w
# Field:2 ends here # Field:2 ends here
# And some aliases:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:3]]
@name east = east;e
# Field:3 ends here
# A description if they look east: # A description if they look east:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:4]] # [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:3]]
@desc east = A winding footpath that may lead out of the forest... Is that a meadow? @desc east = A winding footpath that may lead out of the forest... Is that a meadow?
# Field:4 ends here # Field:3 ends here
# And a nice journey message to go east out of the forest: # And a nice journey message to go east out of the forest:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:5]] # [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:4]]
@set east/traverse_msg = "The mossy tree roots that borders this footpath begin to thin out to clover and flowers..." @set east/traverse_msg = "The mossy tree roots that borders this footpath begin to thin out to clover and flowers..."
# Field:5 ends here # Field:4 ends here
# Before we label it, we follow =east=: # Before we label it, we follow =east=:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:6]] # [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:5]]
east @teleport mp05
# Field:6 ends here # Field:5 ends here
# And we give this area a name:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:7]]
@name here = Frog Meadow;mp05
# Field:7 ends here
# And a description that takes advantage of the time of day. We should get busy and get some seasonal description here. # And a description that takes advantage of the time of day. We should get busy and get some seasonal description here.
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:8]] # [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:6]]
@desc here = A large waterfall cascades on the far side of this meadow creating a stream that meanders through the tall grass and large yellow flowers. They nod their heads to you as you pass by in the <evening>darkening twilight</evening><morning>awakening dawn</morning><afternoon>lazy afternoon</afternoon><night>night sky</night>. A gap in the trees show how you can return to the footpath in the forest. @desc here = A large waterfall cascades on the far side of this meadow creating a stream that meanders through the tall grass and large yellow flowers. They nod their heads to you as you pass by in the <evening>darkening twilight</evening><morning>awakening dawn</morning><afternoon>lazy afternoon</afternoon><night>night sky</night>. A gap in the trees show how you can return to the footpath in the forest.
# Field:8 ends here # Field:6 ends here
# Since we use the =tunnel= command, we need to update the weather system:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:9]]
@update here = typeclasses.rooms_weather.TimeWeatherRoom
# Field:9 ends here
# And describe the way out:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:10]]
@name west = footpath;forest;west;w
# Field:10 ends here
# Along with a mesage: # Along with a mesage:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:11]] # [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:7]]
@set footpath/traverse_msg = "You leave the open meadow for the footpath through the giant trees. The yellow flowers nod goodbye to you..." @set footpath/traverse_msg = "You leave the open meadow for the footpath through the giant trees. The yellow flowers nod goodbye to you..."
# Field:11 ends here # Field:7 ends here
# And a description: # And a description:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:12]] # [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:8]]
@desc footpath = This footpath goes in a forest of immense trees. @desc footpath = This footpath goes in a forest of immense trees.
# Field:12 ends here # Field:8 ends here
# Can the waterfall be a detail or an actual object? # Can the waterfall be a detail or an actual object?
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:13]] # [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:9]]
@detail stream;field = A slow-moving stream meanders like a snake in the grassy field. Little green frogs cling to grass stems hanging over the water. @detail stream;field = A slow-moving stream meanders like a snake in the grassy field. Little green frogs cling to grass stems hanging over the water.
# Field:13 ends here # Field:9 ends here
# And detail the frogs: # And detail the frogs:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:14]] # [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:10]]
@detail frog;frogs = Cute little guys with their big black eyes. Too quick to catch. @detail frog;frogs = Cute little guys with their big black eyes. Too quick to catch.
# Field:14 ends here # Field:10 ends here
# This is special, in that it should be hidden: # This is special, in that it should be hidden:
@ -471,6 +450,14 @@ Wait! Is there a large cave entrance hidden behind the water?
# Waterfall:2 ends here # Waterfall:2 ends here
# Looking at the waterfall, shows the cave entrance:
# [[file:../../../Dropbox/org/projects/mud.org::*Waterfall][Waterfall:3]]
@set waterfall/hidden_tag = "hidden_cave"
# Waterfall:3 ends here
# To create a place for our big, hairy beast to sleep, first jump to the Meadow: # To create a place for our big, hairy beast to sleep, first jump to the Meadow:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:1]] # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:1]]
@ -482,7 +469,7 @@ Wait! Is there a large cave entrance hidden behind the water?
# From the Meadow, we create a lair /behind/ the water. # From the Meadow, we create a lair /behind/ the water.
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:2]] # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:2]]
@dig lair = cave entrance;cave;lair;inside,outside;leave @dig Lair;mp07 = cave entrance;cave;inside,outside;leave
# The Lair of the Beast:2 ends here # The Lair of the Beast:2 ends here
@ -490,9 +477,9 @@ Wait! Is there a large cave entrance hidden behind the water?
# And we make it hidden: # And we make it hidden:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:3]] # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:3]]
@set lair/hidden_tag = "hidden_cave" @set cave/hidden_tag = "hidden_cave"
# #
@lock lair = view:tag(hidden_cave) @lock cave = view:tag(hidden_cave)
# The Lair of the Beast:3 ends here # The Lair of the Beast:3 ends here
@ -500,7 +487,7 @@ Wait! Is there a large cave entrance hidden behind the water?
# And a description if they look: # And a description if they look:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:4]] # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:4]]
@desc lair = A large entrance to a dark, and foul-smelling cave. The waterfall is so loud, you can't hear anything that may live there. @desc cave = A large entrance to a dark, and foul-smelling cave. The waterfall is so loud, you can't hear anything that may live there.
# The Lair of the Beast:4 ends here # The Lair of the Beast:4 ends here
@ -508,7 +495,7 @@ Wait! Is there a large cave entrance hidden behind the water?
# And a description when entering … # And a description when entering …
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:5]] # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:5]]
@set lair/traverse_msg = "You venture inside the dark cave." @set cave/traverse_msg = "You venture inside the dark cave."
# The Lair of the Beast:5 ends here # The Lair of the Beast:5 ends here
@ -517,53 +504,46 @@ Wait! Is there a large cave entrance hidden behind the water?
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:6]] # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:6]]
lair @teleport mp07
# The Lair of the Beast:6 ends here # The Lair of the Beast:6 ends here
# And a good name:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:7]]
@name here = Beastie's Lair;mp07
# The Lair of the Beast:7 ends here
# And a description: # And a description:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:8]] # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:7]]
@desc here = Vaulted stone ceiling harbors the darkness that hovers a large mattress, so tall, you can barely see what might be resting on it. @desc here = Vaulted stone ceiling harbors the darkness that hovers a large mattress, so tall, you can barely see what might be resting on it.
# The Lair of the Beast:8 ends here # The Lair of the Beast:7 ends here
# And a description of leaving: # And a description of leaving:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:9]] # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:8]]
@desc leave = You can see the waterfall cascading outside the cave entrance. @desc leave = You can see the waterfall cascading outside the cave entrance.
# The Lair of the Beast:9 ends here # The Lair of the Beast:8 ends here
# And the leaving message: # And the leaving message:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:10]] # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:9]]
@set leave/traverse_msg = "You leave the dark cave and pass behind the waterfall for the meadow beyond." @set leave/traverse_msg = "You leave the dark cave and pass behind the waterfall for the meadow beyond."
# The Lair of the Beast:10 ends here # The Lair of the Beast:9 ends here
# And a description of the mattress: # And a description of the mattress:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:11]] # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:10]]
@detail mattress = Looks comfortable, if you could just get a leg up to get on it... @detail mattress = Looks comfortable, if you could just get a leg up to get on it...
# The Lair of the Beast:11 ends here
Nope. Too tall, and just as well. It does not smell very good.
# The Lair of the Beast:10 ends here
# And we create the Big, Hairy Beast: # And we create the Big, Hairy Beast:
@ -751,6 +731,26 @@ lair
# Beast:20 ends here # Beast:20 ends here
# And the responses to being /pet/:
# [[file:../../../Dropbox/org/projects/mud.org::*Beast][Beast:21]]
@set beast/pet_scared_response = "You can't get near it to pet it. It seems scared of you."
#
@set beast/pet_concerned_response = "You can't get near it to pet it. It seems concerned by your presence."
#
@set beast/pet_interested_response = "It keeps its distance, but seems curious about <you>."
#
@set beast/pet_friendly_response = "
<You> pet the << big, hairy ^ >> beast.
"
#
@set beast/pet_scared_response = "
"
# Beast:21 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. # 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.
# Return to the Forest: # Return to the Forest:
@ -763,7 +763,7 @@ lair
# And tunnel to the pond: # And tunnel to the pond:
# [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:2]] # [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:2]]
@tunnel s = dock @dig Lazy Dock;mp06 :typeclasses.rooms_weather.TimeWeatherRoom = south;s,north,n,footpath
# The Dock:2 ends here # The Dock:2 ends here
@ -785,46 +785,39 @@ lair
# And move ourselves there: # And move ourselves there:
# [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:5]] # [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:5]]
south @teleport mp06
# The Dock:5 ends here # The Dock:5 ends here
# Since we are on a dock in the pond, well emphasize that:
# [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:6]]
@name here = Lazy Dock;mp06
# The Dock:6 ends here
# And describe this. # And describe this.
# [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:7]] # [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:6]]
@desc here = The dock you stand on juts into an immense pond. Someone has set a nice chair for viewing. @desc here = The dock you stand on juts into an immense pond. Someone has set a nice chair for viewing.
# The Dock:7 ends here # The Dock:6 ends here
# Since we use the =tunnel= command, we need to update the weather system: # Since we use the =tunnel= command, we need to update the weather system:
# [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:8]] # [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:7]]
@update here = typeclasses.rooms_weather.TimeWeatherRoom @update here = typeclasses.rooms_weather.TimeWeatherRoom
# The Dock:8 ends here # The Dock:7 ends here
# And describe the walk back into the forest: # And describe the walk back into the forest:
# [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:9]] # [[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." @set north/traverse_msg = "You walk up a path and back into the forest of giant trees."
# The Dock:9 ends here # The Dock:8 ends here
# And a description: # And a description:
# [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:10]] # [[file:../../../Dropbox/org/projects/mud.org::*The Dock][The Dock:9]]
@desc north = This path leads into the forest of collosal trees. @desc north = This path leads into the forest of collosal trees.
# The Dock:10 ends here # The Dock:9 ends here
# A nice chair to sit on the dock by the bay, watching the clouds as they drift away. # A nice chair to sit on the dock by the bay, watching the clouds as they drift away.
@ -871,11 +864,11 @@ Looks good for being out in the weather.
# And tether it to the Dock, #10, which we need to reset if the ID numbers ever change. # And tether it to the Dock, which we need to reset if the ID numbers ever change.
# [[file:../../../Dropbox/org/projects/mud.org::*Fishing Pole][Fishing Pole:3]] # [[file:../../../Dropbox/org/projects/mud.org::*Fishing Pole][Fishing Pole:3]]
@lock pole = tethered:id(#10) @lock pole = tethered:id(Lazy Dock)
# #
@set pole/tethered_msg = "Let's leave the fishing pole here at the dock for others to fish...besides, where else are you going to go fishing around here?" @set pole/tethered_msg = "Let's leave the fishing pole here at the dock for others to fish...besides, where else are you going to go fishing around here?"
# Fishing Pole:3 ends here # Fishing Pole:3 ends here
@ -939,10 +932,11 @@ Looks good for being out in the weather.
# Lets travel west along the path in the forest: # Lets travel west along the path in the forest:
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:2]] # [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:2]]
@tunnel w = path @dig Grotto;mp04 :typeclasses.rooms_weather.TimeWeatherRoom = west;w,east,e,path
# Forest Path:2 ends here # Forest Path:2 ends here
# With a nice message about wandering: # With a nice message about wandering:
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:3]] # [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:3]]
@ -950,83 +944,54 @@ Looks good for being out in the weather.
# Forest Path:3 ends here # Forest Path:3 ends here
# And some aliases:
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:4]]
@name west = west;w;footpath
# Forest Path:4 ends here
# And a description: # And a description:
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:5]] # [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:4]]
@desc west = A footpath winds between the roots of a tree. You try to jump to look over the roots, and something red catches your eye. @desc west = A footpath winds between the roots of a tree. You try to jump to look over the roots, and something red catches your eye.
# Forest Path:5 ends here # Forest Path:4 ends here
# Jump into the new room: # Jump into the new room:
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:6]] # [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:5]]
west @teleport mp04
# Forest Path:6 ends here # Forest Path:5 ends here
# And name it:
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:7]]
@name here = Dabbler's Grove;mp04
# Forest Path:7 ends here
# And describe the tree and the door: # And describe the tree and the door:
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:8]] # [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:6]]
@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, |wDabblers|n. @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, |wDabblers|n.
# Forest Path:8 ends here # Forest Path:6 ends here
# Since we use the =tunnel= command, we need to update the weather system:
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:9]]
@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: # A description if they look east:
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:11]] # [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:7]]
@desc east = A winding footpath that leads through the forest of giant trees. @desc east = A winding footpath that leads through the forest of giant trees.
# Forest Path:11 ends here # Forest Path:7 ends here
# And a nice journey message to go east in of the forest: # And a nice journey message to go east in of the forest:
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:12]] # [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:8]]
@set east/traverse_msg = "The mossy tree roots makes for an interesting path..." @set east/traverse_msg = "The mossy tree roots makes for an interesting path..."
# Forest Path:12 ends here # Forest Path:8 ends here
# And extra things to see: # And extra things to see:
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:13]] # [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:9]]
@detail trees;tree = The trees in this forest are massive, but a smaller tree has a red door. Must lead to a closet! @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:13 ends here # Forest Path:9 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. # 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.
@ -1092,6 +1057,7 @@ west
# Berry Bush:9 ends here # Berry Bush:9 ends here
# We can either have a single /eat/ message: # We can either have a single /eat/ message:
# [[file:../../../Dropbox/org/projects/mud.org::*Berry Bush][Berry Bush:10]] # [[file:../../../Dropbox/org/projects/mud.org::*Berry Bush][Berry Bush:10]]
@ -1189,7 +1155,7 @@ west
# [[file:../../../Dropbox/org/projects/mud.org::*Knocker][Knocker:9]] # [[file:../../../Dropbox/org/projects/mud.org::*Knocker][Knocker:9]]
@lock ring = tethered:id(#28) @lock ring = tethered:id(knocker)
# #
@set ring/tethered_msg = "You put the ring back in the knocker's mouth. \"Mmmuufffmm,\" says the door knocker." @set ring/tethered_msg = "You put the ring back in the knocker's mouth. \"Mmmuufffmm,\" says the door knocker."
# Knocker:9 ends here # Knocker:9 ends here
@ -1244,8 +1210,12 @@ west
@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:15 ends here # Knocker:15 ends here
# Add the Python /special-ness/ for [[file:~/src/moss-n-puddles/typeclasses/rooms.py::class DabblersRoom(Room):][this room]]:
# [[file:../../../Dropbox/org/projects/mud.org::*Cozy Tea House][Cozy Tea House:1]] # [[file:../../../Dropbox/org/projects/mud.org::*Cozy Tea House][Cozy Tea House:1]]
@dig house = red door;door;house;inside,outside;leave @dig Dabbler's House;mp03: typeclasses.rooms.DabblersRoom = red door;door;inside,outside;leave
# Cozy Tea House:1 ends here # Cozy Tea House:1 ends here
@ -1283,44 +1253,31 @@ west
# Fix the inside of the “House”: # Fix the inside of the “House”:
# [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:1]] # [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:1]]
@teleport red door @teleport mp03
# Inside:1 ends here # Inside:1 ends here
# Add the Python /special-ness/ for [[file:~/src/moss-n-puddles/typeclasses/rooms.py::class DabblersRoom(Room):][this room]]:
# [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:2]]
@update here = typeclasses.rooms.DabblersRoom
# Inside:2 ends here
# Give it a title:
# [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:3]]
@name here = Dabbler's House;mp03
# Inside:3 ends here
# Might as well stay a while: # Might as well stay a while:
# [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:4]] # [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:2]]
@sethome me = here @sethome me = here
# Inside:4 ends here # Inside:2 ends here
# And the best description ever: # And the best description ever:
# [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:5]] # [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:3]]
@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 # Inside:3 ends here
# 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. # 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.
# [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:6]] # [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:4]]
@set here/initial_desc = "You found a cozy, cornerless room." @set here/initial_desc = "You found a cozy, cornerless room."
# Ravenous State # Ravenous State
@ -1337,7 +1294,7 @@ west
# And a final description: # 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 # Inside:4 ends here
@ -1345,48 +1302,47 @@ west
# Lets come up with a lot of descriptions: # Lets come up with a lot of descriptions:
# [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:7]] # [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:5]]
@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 # Inside:5 ends here
# We should describe all the objects in the tapestry, eh? # We should describe all the objects in the tapestry, eh?
# [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:8]] # [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:6]]
@detail raven = The raven winks at you, and says, “Nevermore.” Really? It probably didn't. Your eyes must be playing trickster. @detail raven;ball;blue ball = The raven in the tapestry winks at you, and says, “Nevermore.” Really? It probably didn't. Your eyes must be playing trickster.
# Inside:8 ends here # Inside:6 ends here
# And the other animals: # And the other animals:
# [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:9]] # [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:7]]
@detail wolf = The gnarled staff the wolf holds looks a lot like the staff the gnome, Dabbler, has. @detail wolf = The gnarled staff the wolf in the tapestry holds looks a lot like the staff the gnome, Dabbler, has.
# #
@detail stag = A majestic looking deer with gold fur and antlers that look more like tree branches. @detail stag;deer = The majestic looking deer in the tapestry with gold fur and antlers that look more like tree branches.
# #
@detail raccoon = The box he's holding seems to be a distraction, for he's pocketing a gold coin with his other paw. @detail raccoon;box;gold box = The box the raccoon in the tapestry is holding seems to be a distraction, for he's pocketing a gold coin with his other paw.
# Inside:9 ends here # Inside:7 ends here
# Will this staff get confused at some point? # Will this staff get confused at some point?
# [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:10]] # [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:8]]
@detail staff = A gnarled staff made of oak has a dark petina from age. Three small leaves has sprouted from the side. @detail staff;gnarled staff = The gnarled staff in the tapestry that the wolf is holding seems to be made of oak with a dark petina from age. Three small leaves has sprouted from the side.
# Inside:10 ends here # Inside:8 ends here
# Touch up the exit: # Touch up the exit:
# [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:11]] # [[file:../../../Dropbox/org/projects/mud.org::*Inside][Inside:9]]
@open leave;outside =
@desc leave = A wood door with a large brass knob leads to the outside. @desc leave = A wood door with a large brass knob leads to the outside.
# #
@set leave/traverse_msg = "You open the door and step outside..." @set leave/traverse_msg = "You open the door and step outside..."
# Inside:11 ends here # Inside:9 ends here
# And a fire in the fireplace is a type of /pet/, since we can feed it: # And a fire in the fireplace is a type of /pet/, since we can feed it:
@ -1623,28 +1579,35 @@ py here.search("trolley").do_bake()
# Chairs:5 ends here # Chairs:5 ends here
# Lets make him a wizard: # Lets make him a wizard:
# [[file:../../../Dropbox/org/projects/mud.org::*Chairs][Chairs:6]] # [[file:../../../Dropbox/org/projects/mud.org::*Bugs][Bugs:1]]
@update self = typeclasses.characters.Wizard @update self = typeclasses.characters.Wizard
# Chairs:6 ends here # Bugs:1 ends here
# And we need to update the Knocker to get the “knock” command going: # And we need to update the Knocker to get the “knock” command going:
# [[file:../../../Dropbox/org/projects/mud.org::*Chairs][Chairs:7]] # [[file:../../../Dropbox/org/projects/mud.org::*Bugs][Bugs:2]]
@update knocker = typeclasses.things.Knocker @update knocker = typeclasses.things.Knocker
# Chairs:7 ends here # Bugs:2 ends here
# And now that we are done, say it: # And now that we are done, say it:
# [[file:../../../Dropbox/org/projects/mud.org::*Chairs][Chairs:8]] # [[file:../../../Dropbox/org/projects/mud.org::*Bugs][Bugs:3]]
say I have finished this, the first version, of my creation. say I have finished this, the first version, of my creation.
# Chairs:8 ends here # Bugs:3 ends here
# Can we fix the permissions for our friends:
# [[file:../../../Dropbox/org/projects/mud.org::*Accounts][Accounts:1]]
perm/account steve = Builders
# Accounts:1 ends here