Take notes in the transcript

Along with an daily introduction, the shrub can take notes.
This commit is contained in:
Howard Abrams 2025-06-10 13:45:36 -07:00
parent 4dbb354ce9
commit fb4f0a0f0d
2 changed files with 45 additions and 1 deletions

View file

@ -22,12 +22,26 @@
margin-bottom: .5em; margin-bottom: .5em;
} }
blockquote {
font-style: italic;
}
blockquote i {
font-weight: bold;
}
.special { .special {
margin: 20px; margin: 20px;
padding: 2px 20px; padding: 2px 20px;
border: 2px solid brown; border: 2px solid brown;
border-radius: 12px; border-radius: 12px;
} }
.heavy {
font-weight: 700;
}
.title {
font-variant-caps: small-caps;
}
</style> </style>
</head> </head>
<body> <body>

View file

@ -165,6 +165,30 @@ class Shrub(Puppet):
"Called when a character is first created." "Called when a character is first created."
self.cmdset.add(CmdSetShrubSay, persistent=True) self.cmdset.add(CmdSetShrubSay, persistent=True)
def intro(self):
self.record_msg("After tuning their instruments, a quartet of pixies start their first number. \"Quiet evening, eh Mushy?\" asks the elf bartender to a stout myconid. It makes a vaguely <i>shrugging</i> motion with a pair of pseudopods it uses to manipulate its environment. It knew the question was rhetorical, as everyone knew the portal was opening, and that always brought characters.")
self.execute_cmd("look")
self.record_msg("The bartender says, \"Fetch that bowl of candies for bar, please, Mushy.\"")
self.execute_cmd("recog elf as bartender")
self.note("Not sure how I landed in this bar, but here I am. Don't get me wrong, I enjoy it. The bartender, a fairly haughty elf originally from the <i>Mud World</i>, always supplies me with a nice glass of water.")
self.execute_cmd("look elf")
self.record_msg("The mushroom man returns, balancing the bowl on its cap. \"One more thing,\" the bartender says, \"I had a box of oddly shaped, orange crackers. I have a feeling they may come in useful.\"")
self.note("Helping to keep the place respectable, <i>Mushy</i> also gathers empty cocktail glasses. One of the <i>fungus ones</i>, or mushroom people, it too has always been kind to me.")
# self.execute_cmd("look mushroom man")
self.record_msg("\"Any requests?\" asks Lemon of the bartender.")
self.note("Lemon, Cart, Hairy and Ring, this pixie quartet can't decided on a name for their group; currently calling themselves, the <i>Pixie Stones</i>, provide the entertainment.")
self.execute_cmd("look pixies")
self.record_msg("The bartender replies, \"Nah, just remember to play that weird <i>juzz</i> music when the boss arrives later.\"")
self.note("And here I am, an <i>Awakened Shrub</i>, joting down the events that traspire in this wyld bar somewhere in the <i>Domain of Moss</i>, out of reach from both the Seelie and the Unseelie courts. Of course, that may change.")
self.note("Now then, let's see what characters may arrive...")
self.record_msg("<hr/>")
def note(self, text):
"""
Record in the transcript log, a special note.
"""
self.record_msg((text, {'type': 'note'}))
def write(self, new_text): def write(self, new_text):
""" """
Change the readable message on the chalkboard. Change the readable message on the chalkboard.
@ -215,8 +239,12 @@ class Shrub(Puppet):
""" """
Convert the 'text' to an HTML formatted string. Convert the 'text' to an HTML formatted string.
""" """
# Bold and tag the titles:
text = sub(r"\|[cb](.*?)\|n", '<b class="title">\\1</b>', text)
# Bold anything white: # Bold anything white:
text = sub(r"\|w(.*?)\|n", '<b>\\1</b>', text) text = sub(r"\|w(.*?)\|n", '<b class="heavy">\\1</b>', text)
# Yellow text should be italics:
text = sub(r"\|y(.*?)\|n", '<i">\\1</i>', text)
# Remove the rest: # Remove the rest:
text = sub(r"\|[A-z]", '', text) text = sub(r"\|[A-z]", '', text)
# Remove initial or final carriage returns: # Remove initial or final carriage returns:
@ -228,6 +256,8 @@ class Shrub(Puppet):
if msg_type and msg_type == 'look': if msg_type and msg_type == 'look':
text = text[0].upper() + text[1:] text = text[0].upper() + text[1:]
return f"<div class=\"special\"><p>{text}</p></div>\n" return f"<div class=\"special\"><p>{text}</p></div>\n"
if msg_type and msg_type == 'note':
return f"<blockquote>{text}</blockquote>"
return f"<p>{text}</p>\n" return f"<p>{text}</p>\n"
def record_msg(self, text, actor=None): def record_msg(self, text, actor=None):