From fb4f0a0f0de989afadc5bbe900a85956aec4c8bd Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 10 Jun 2025 13:45:36 -0700 Subject: [PATCH] Take notes in the transcript Along with an daily introduction, the shrub can take notes. --- transcripts/header-template.html | 14 ++++++++++++++ typeclasses/puppets.py | 32 +++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/transcripts/header-template.html b/transcripts/header-template.html index c05b575..8cbaf2d 100644 --- a/transcripts/header-template.html +++ b/transcripts/header-template.html @@ -22,12 +22,26 @@ margin-bottom: .5em; } + blockquote { + font-style: italic; + } + blockquote i { + font-weight: bold; + } + .special { margin: 20px; padding: 2px 20px; border: 2px solid brown; border-radius: 12px; } + + .heavy { + font-weight: 700; + } + .title { + font-variant-caps: small-caps; + } diff --git a/typeclasses/puppets.py b/typeclasses/puppets.py index 8f55c27..1dea005 100755 --- a/typeclasses/puppets.py +++ b/typeclasses/puppets.py @@ -165,6 +165,30 @@ class Shrub(Puppet): "Called when a character is first created." 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 shrugging 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 Mud World, 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, Mushy also gathers empty cocktail glasses. One of the fungus ones, 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 Pixie Stones, provide the entertainment.") + self.execute_cmd("look pixies") + self.record_msg("The bartender replies, \"Nah, just remember to play that weird juzz music when the boss arrives later.\"") + self.note("And here I am, an Awakened Shrub, joting down the events that traspire in this wyld bar somewhere in the Domain of Moss, 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("
") + + def note(self, text): + """ + Record in the transcript log, a special note. + """ + self.record_msg((text, {'type': 'note'})) + def write(self, new_text): """ Change the readable message on the chalkboard. @@ -215,8 +239,12 @@ class Shrub(Puppet): """ Convert the 'text' to an HTML formatted string. """ + # Bold and tag the titles: + text = sub(r"\|[cb](.*?)\|n", '\\1', text) # Bold anything white: - text = sub(r"\|w(.*?)\|n", '\\1', text) + text = sub(r"\|w(.*?)\|n", '\\1', text) + # Yellow text should be italics: + text = sub(r"\|y(.*?)\|n", '\\1', text) # Remove the rest: text = sub(r"\|[A-z]", '', text) # Remove initial or final carriage returns: @@ -228,6 +256,8 @@ class Shrub(Puppet): if msg_type and msg_type == 'look': text = text[0].upper() + text[1:] return f"

{text}

\n" + if msg_type and msg_type == 'note': + return f"
{text}
" return f"

{text}

\n" def record_msg(self, text, actor=None):