Added a ticket to the Wyldwood Bar

Fix the name displacement in the Letter.
This commit is contained in:
Howard Abrams 2025-05-17 17:56:40 -07:00
parent 5c01a15a17
commit bd745e999b
3 changed files with 100 additions and 32 deletions

View file

@ -8,7 +8,8 @@ creation commands.
"""
from re import match, compile
from datetime import datetime, timedelta
from re import match, compile, sub
from evennia.contrib.game_systems.gendersub import GenderCharacter
from evennia.contrib.rpg.rpsystem import ContribRPCharacter
@ -28,7 +29,7 @@ A little gray bird flies by you, almost grazing your ear!"""
READ_LETTER = """You read a letter with an oddly familiar penmanship:
My dearest {0},
My dear {0},
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.
@ -65,8 +66,9 @@ class Character(Object, GenderCharacter, ContribRPCharacter):
"called when a character is first created."
self.db.tutorstate = 0
if self.dbref != "#1":
if self.dbref != "#1" and not self.is_typeclass('typeclasses.puppets.Puppet'):
self.create_letter()
self.create_ticket()
def at_post_puppet(self, **kwargs):
if self.db.visited:
@ -75,6 +77,7 @@ class Character(Object, GenderCharacter, ContribRPCharacter):
else:
self.db.visited = True
self.db.tutorstate = 0
self.fix_letter()
TutorBird.do_start_tutorial(self)
self.msg(INTRO)
self.account.db._last_puppet = self
@ -107,6 +110,39 @@ class Character(Object, GenderCharacter, ContribRPCharacter):
letter.db.inside = READ_LETTER.format(self.name.capitalize())
letter.location = self
def fix_letter(self):
letter = self.search('letter', location=self)
if letter:
text = sub(r"My dear [^,]*", f"My dear {self.name}", letter.db.inside)
letter.db.inside = text
def create_ticket(self):
"""
Create a dated ticket.
"""
today = datetime.now()
days_ahead = (1 - today.weekday() + 7) % 7 # 1 is Tuesday
next_tuesday_date = today + timedelta(days=days_ahead)
tuesday = next_tuesday_date.date()
day = tuesday.day
month = tuesday.strftime("%B") # Full month name
if 10 <= day % 100 <= 20:
suffix = 'th'
else:
suffix = {1: 'st', 2: 'nd', 3: 'rd'}.get(day % 10, 'th')
ticket = spawn({
"typeclass": "typeclasses.readables.Letter",
"key": "ticket",
"desc": "A ticket to |wWyldwood Bar|n.",
})[0]
ticket.db.inside = f"""
The ticket is dated, {day}{suffix} of {month} ...
It also reads that the portal opens in the field at seven.
"""
ticket.location = self
def get_display_things(self, looker, *args, **kwargs):
return super().get_display_things(looker, pose=False)

View file

@ -150,7 +150,7 @@ py timed_script = evennia.create_script(key="Create Sticks",
# [[file:../../../projects/mud.org::*Boulder][Boulder:5]]
@dig Boulder Top;mp02 : typeclasses.rooms_weather.TimeWeatherRoom = boulder,climb
@dig Boulder Top;mp02 : typeclasses.rooms_weather.TimeWeatherRoom = boulder;climb,climb down;climb;down
# Boulder:5 ends here
@ -271,7 +271,7 @@ Wait! You notice a foot hold, and then another. You can |gclimb|n this boulder!
# And we use the =tunnel= command this time:
# [[file:../../../projects/mud.org::*Field][Field:2]]
@dig Frog Meadow;mp05 : typeclasses.rooms_weather.TimeWeatherRoom = east;e;path,footpath;west;w
@dig Frog Meadow;mp05 : typeclasses.rooms_weather.TimeWeatherRoom = east;e;path;footpath,footpath;west;w;path
# Field:2 ends here
@ -680,7 +680,7 @@ Nope. Too tall, and just as well. It does not smell very good.
# And tunnel to the dock:
# [[file:../../../projects/mud.org::*The Dock][The Dock:2]]
@dig Lazy Dock;mp06 :typeclasses.rooms_weather.TimeWeatherRoom = south;s,north,n,footpath
@dig Lazy Dock;mp06 :typeclasses.rooms_weather.TimeWeatherRoom = south;s,north;n;footpath
# The Dock:2 ends here
@ -858,98 +858,98 @@ Looks good for being out in the weather.
@desc here = Vibrant green moss covers the island's gray rock. Wandering around the conifers you encounter giant statues of armored knights surrounding a huge, empty throne. An inscription at the base reads, ᚦ ᚮ ᚱ
# The Island:2 ends here
# Forest Path
# Grotto
# Return to the forest:
# [[file:../../../projects/mud.org::*Forest Path][Forest Path:1]]
# [[file:../../../projects/mud.org::*Grotto][Grotto:1]]
@teleport mp01
# Forest Path:1 ends here
# Grotto:1 ends here
# Lets travel west along the path in the forest:
# [[file:../../../projects/mud.org::*Forest Path][Forest Path:2]]
@dig Grotto;mp04 :typeclasses.rooms_weather.TimeWeatherRoom = west;w,east,e,path
# Forest Path:2 ends here
# [[file:../../../projects/mud.org::*Grotto][Grotto:2]]
@dig Grotto;mp04 :typeclasses.rooms_weather.TimeWeatherRoom = west;w,east;e;path;footpath
# Grotto:2 ends here
# With a nice message about wandering:
# [[file:../../../projects/mud.org::*Forest Path][Forest Path:3]]
# [[file:../../../projects/mud.org::*Grotto][Grotto:3]]
@set west/traverse_msg = "You meander between mossy tree roots along a footpath for a while until it ends in a grotto."
# Forest Path:3 ends here
# Grotto:3 ends here
# And a description:
# [[file:../../../projects/mud.org::*Forest Path][Forest Path:4]]
# [[file:../../../projects/mud.org::*Grotto][Grotto: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.
# Forest Path:4 ends here
# Grotto:4 ends here
# Jump into the new room:
# [[file:../../../projects/mud.org::*Forest Path][Forest Path:5]]
# [[file:../../../projects/mud.org::*Grotto][Grotto:5]]
@teleport mp04
# Forest Path:5 ends here
# Grotto:5 ends here
# And describe the tree and the door:
# [[file:../../../projects/mud.org::*Forest Path][Forest Path:6]]
# [[file:../../../projects/mud.org::*Grotto][Grotto:6]]
@desc here = The trickling sound of a small stream drops down a lush hill between ferns and brambleberry bushes. The path ends at a small bridge that leads to a red door embedded at the base of a giant tree. A carved sign over the door reads, |wDabblers|n.
# Forest Path:6 ends here
# Grotto:6 ends here
# A description if they look east:
# [[file:../../../projects/mud.org::*Forest Path][Forest Path:7]]
# [[file:../../../projects/mud.org::*Grotto][Grotto:7]]
@desc east = A winding footpath leads through the forest of giant trees.
# Forest Path:7 ends here
# Grotto:7 ends here
# And a nice journey message to go east in of the forest:
# [[file:../../../projects/mud.org::*Forest Path][Forest Path:8]]
# [[file:../../../projects/mud.org::*Grotto][Grotto:8]]
@set east/traverse_msg = "The mossy tree roots makes for an interesting path..."
# Forest Path:8 ends here
# Grotto:8 ends here
# And extra things to see:
# [[file:../../../projects/mud.org::*Forest Path][Forest Path:9]]
# [[file:../../../projects/mud.org::*Grotto][Grotto:9]]
@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:9 ends here
# Grotto:9 ends here
# And the bridge:
# [[file:../../../projects/mud.org::*Forest Path][Forest Path:10]]
# [[file:../../../projects/mud.org::*Grotto][Grotto:10]]
@detail bridge = A small wooden bridge leads over a tiny stream. Hard to see the water on account of the giant leafed skunk cabbages.
# Forest Path:10 ends here
# Grotto:10 ends here
# And the cabbages? And ferns?
# [[file:../../../projects/mud.org::*Forest Path][Forest Path:11]]
# [[file:../../../projects/mud.org::*Grotto][Grotto:11]]
@detail cabbage;cabbages;skunk cabbage;skunk cabbages = Large glossy green leaves with big yellow flowers that looks like cobras in drag. They hiss as you cross the bridge.
#
@detail fern;ferns = Mostly Sword ferns interrupted by Maiden Hair ferns that sing to the stream.
# Forest Path:11 ends here
# Grotto:11 ends here
# Berry Bush
# 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.

View file

@ -232,15 +232,47 @@ py bt = self.search('shrub'); bt.db.gender = 'neutral'; bt.db._sdesc = 'shrub';
# Awakened Shrub:7 ends here
# [[file:../../../projects/mud-rpg.org::*Awakened Shrub][Awakened Shrub:9]]
@desc chalkboard = The shrub is holding a small chalkboard with a wood frame.
@detail chalkboard = The shrub is holding a small chalkboard with a wood frame.
# Awakened Shrub:9 ends here
# A GM should have /events/ and at least interesting NPCs show up. Keep in mind, all ideas need to be Feywild themed.
# - =bubbles= :: A /target/ is mentioned speaking with bubbles … no real effects in the game need to be kept up.
# - darkness :: The room gets temporarily dark. Need a good joke if someone asks about it.
# [[file:../../../projects/mud-rpg.org::*Dabbler][Dabbler:2]]
@set/character #34/triggers:session1 = {
"bubbles": {"desc": "Character blows bubbles",
"timer": 10,
"events": [
("You notice bubbles coming out every time you open your mouth to speak.",
"Every time |s speaks, you notice bubbles coming from the mouth of /target."
)
]
},
"dark": {"desc": "Make the room go black",
"timer": 5,
"events": [
"The /gnome slams his staff against the floor. The room goes completely dark.",
"The music stops.",
"In the darkness, you see a pair of large red eyes, and a low gutteral growl.",
("You can't help it, but scream!",
"You hear a scream!"),
"The glowing orbs along the branches of this room relight and the music, starts again. Much better."
]
},
}
# Dabbler:2 ends here
# Cocktails
# Lets create a sign for the list of cocktails:
# [[file:../../../projects/mud-rpg.org::*Cocktails][Cocktails:1]]
@create/drop sign;list:typeclasses.readables.Readable
@create/drop sign above the bar;sign;list:typeclasses.readables.Readable
# Cocktails:1 ends here