Get the Goblin Tester to work with new stuff
This commit is contained in:
parent
503dd0301a
commit
c2f707303b
6 changed files with 398 additions and 142 deletions
|
|
@ -1801,7 +1801,7 @@ I want to make sure that when someone new sees the beast, they see it hiding beh
|
|||
expect {
|
||||
"a big hairy beast" {
|
||||
send "look beast\n"
|
||||
expectit "it tries to hide behind a tall clump of grass"
|
||||
expectit "beast with long claws and teeth"
|
||||
|
||||
send "pet bhb\n"
|
||||
expectit "can't get near"
|
||||
|
|
@ -2360,11 +2360,11 @@ And:
|
|||
@set bartender/leave:character
|
||||
|
||||
#+BEGIN_SRC ruby :tangle no
|
||||
@set bartender/sayto = {r"\bthanks?( you)?": "gm The << bartender ^ barkeep >> << mumbles ^ mutters ^ softly replies >> << back ^ >> to {1}, \"You're << very ^ >> welcome.\""}
|
||||
@set bartender/sayto = {r".*\bthanks?( you)?": "gm The << bartender ^ barkeep >> << mumbles ^ mutters ^ softly replies >> << back ^ >> to {1}, \"You're << very ^ >> welcome.\""}
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC ruby :tangle no
|
||||
@set bartender/say = {r"\bthanks?( you)?.*bar(tend|keep)": "gm The << bartender ^ barkeep >> << mumbles ^ mutters ^ softly replies >> << back ^ >> to {1}, \"You're << very ^ >> welcome.\""}
|
||||
@set bartender/say = {r".*\bthanks?( you)?.*bar(tend|keep)": "gm The << bartender ^ barkeep >> << mumbles ^ mutters ^ softly replies >> << back ^ >> to {1}, \"You're << very ^ >> welcome.\""}
|
||||
#+END_SRC
|
||||
|
||||
First, split the line into its parts, and if:
|
||||
|
|
@ -2382,69 +2382,6 @@ Let’s convert the Bartender to a Chatbot using [[file:~/src/moss-n-puddles/per
|
|||
@set bartender/personality_file = "personalities/tavern.md"
|
||||
#+END_SRC
|
||||
|
||||
**** Hide and Seek
|
||||
First create a number of magic rings equal to the number of players, minus one:
|
||||
|
||||
#+BEGIN_SRC evennia :tangle no
|
||||
@create magic ring:typeclasses.things.MagicRing
|
||||
#
|
||||
@desc magic ring = Octarine sparks fly when you don this ring.|/Commands: |gtransform|n and |guntransform|n.
|
||||
#
|
||||
give magic ring to _char_
|
||||
#+END_SRC
|
||||
|
||||
And create a monocle:
|
||||
|
||||
#+BEGIN_SRC evennia :tangle no
|
||||
@create monocle:typeclasses.things.MagicMonocle
|
||||
#
|
||||
@desc monocle = Allows you to see past magical illusions. |/Command: |gpeer <object>|n
|
||||
#
|
||||
give monocle to _char_
|
||||
#+END_SRC
|
||||
|
||||
Reset the game:
|
||||
|
||||
#+BEGIN_SRC evennia :tangle no
|
||||
# Who has the monocle
|
||||
py me.search('monocle', typeclass="typeclasses.things.MagicMonocle", global_search=True).reset_counts()
|
||||
#+END_SRC
|
||||
|
||||
Get the scoreboard:
|
||||
|
||||
#+BEGIN_SRC evennia :tangle no
|
||||
# Who has the monocle
|
||||
py me.search('monocle', typeclass="typeclasses.things.MagicMonocle", global_search=True).report_score()
|
||||
#+END_SRC
|
||||
|
||||
Need a global clock, right?
|
||||
|
||||
#+BEGIN_SRC evennia :tangle no
|
||||
@create clock:typeclasses.things.GlobalAlarmClock
|
||||
#
|
||||
@desc clock = Strange round clock with four hands and twenty symbols.
|
||||
#+END_SRC
|
||||
|
||||
Need a channel to chat about the game:
|
||||
|
||||
#+BEGIN_SRC evennia
|
||||
@channel/create Hide and Seek Game;hide;game = Messages to people playing the Hide and Seek game
|
||||
#
|
||||
# Others would type:
|
||||
# channel/sub game
|
||||
#+END_SRC
|
||||
|
||||
Start the hiders …
|
||||
#+BEGIN_SRC evennia :tangle no
|
||||
say Alright everyone ready to play the game?
|
||||
#
|
||||
py me.search('clock').start_timer(60, "Ready, get set ... and |wgo hide!|n|/Seeker will start the count-down.", "Ready or not, here comes the seeker!")
|
||||
#
|
||||
py me.search('clock').start_timer(300, finish="The round of the game is done! Let's return and see the score.")
|
||||
#
|
||||
@tel <char> = here
|
||||
#+END_SRC
|
||||
|
||||
*** Bowl of Candy
|
||||
Gives out candy, as there is a never-ending bowl of them on the bar.
|
||||
Gotta have something to munch on.
|
||||
|
|
@ -4942,7 +4879,7 @@ We need to fix it so that =feed fire= just works.
|
|||
Need a way to produce wood for the fireplace.
|
||||
|
||||
#+BEGIN_src evennia
|
||||
@create/drop wood rack;log rack;log holder;wood holder;wood;log :typeclasses.consumables.Producer
|
||||
@create/drop rack of wood;log rack;log holder;wood holder;wood;log :typeclasses.consumables.Producer
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_src evennia
|
||||
|
|
@ -5251,6 +5188,66 @@ And an un-puppeted, sleeping, description:
|
|||
@set gnome/desc_unpuppeted = "A small, hunched old man with messy white hair and a gray vandyke snoring soundly in one of the overstuffed chairs.|/|/Spectacles perched precariously on the end of his hooked nose, wobble with each breath. His bright crimson jacket contrasts with the dark brown blanket covering his legs."
|
||||
#+END_SRC
|
||||
|
||||
**** Nicks
|
||||
:PROPERTIES:
|
||||
:header-args:evennia: :tangle world/my-nicks.ev :comments both
|
||||
:END:
|
||||
While we can’t tangle his /nicks/ and other shortcuts to the Evennia file (as we are currently puppeting the Avatar), we can create these as a separate file, and batch command them later.
|
||||
|
||||
Let’s pretend we are in an IRC:
|
||||
#+BEGIN_SRC evennia
|
||||
@nick /me $1 = emote $1
|
||||
#+END_SRC
|
||||
|
||||
Have the shrub, in the bar, write out a message:
|
||||
#+BEGIN_SRC evennia
|
||||
@nick write $1 = py me.search('shrub').write("$1")
|
||||
#+END_SRC
|
||||
|
||||
Create a note in the cozy transcripts in the house:
|
||||
#+BEGIN_SRC evennia
|
||||
@nick note $1 = py me.search('golden butterfly').note("$1")
|
||||
#+END_SRC
|
||||
|
||||
Special places that I want to quickly move to:
|
||||
#+BEGIN_SRC evennia
|
||||
@nick meadow = fly Frog Meadow
|
||||
#
|
||||
@nick bar = fly Wyldwood Bar
|
||||
#
|
||||
@nick grove = fly Grove of the Matriarchs
|
||||
#
|
||||
@nick grotto = fly Grotto
|
||||
#
|
||||
@nick secret = fly mp12
|
||||
#
|
||||
@nick hut = fly Homey Hut
|
||||
#
|
||||
@nick marsh = fly Mellow Marsh
|
||||
#
|
||||
@nick dock = fly Lazy Dock
|
||||
#
|
||||
@nick lair = fly Lair
|
||||
#
|
||||
@nick myroom = fly Dabbler's House
|
||||
#+END_SRC
|
||||
|
||||
Where is a certain thing or character located:
|
||||
#+BEGIN_SRC evennia
|
||||
@nick where $1 = py me.search("$1", global_search=True).location
|
||||
#+END_SRC
|
||||
|
||||
Tell a particular NPC to come to the house:
|
||||
#+BEGIN_SRC evennia
|
||||
@nick come $1 = py me.search("$1", global_search=True).come()
|
||||
#+END_SRC
|
||||
|
||||
In case I end up in the meadow without a scone, I can make one for the BHB:
|
||||
#+BEGIN_SRC evennia
|
||||
@nick scone = py me.search("cabinet", global_search=True).do_make(me, words=scone")
|
||||
#+END_SRC
|
||||
|
||||
**** His Magic Devices
|
||||
And we create a couple of objects:
|
||||
|
||||
Like his special teacup:
|
||||
|
|
@ -5359,6 +5356,69 @@ Commands:
|
|||
- light pipe (how should this be different from lighting a candle or a fire in the fireplace)?
|
||||
- puff (if the pipe is out, perhaps it calls the =do_light= function)?
|
||||
- snuff (to put it out). This would require the start.
|
||||
**** Hide and Seek
|
||||
First create a number of magic rings equal to the number of players, minus one:
|
||||
|
||||
#+BEGIN_SRC evennia
|
||||
@create magic ring:typeclasses.things.MagicRing
|
||||
#
|
||||
@desc magic ring = Octarine sparks fly when you don this ring.|/Commands: |gtransform|n and |guntransform|n.
|
||||
#
|
||||
give magic ring to Dabbler
|
||||
#+END_SRC
|
||||
|
||||
And create a monocle:
|
||||
|
||||
#+BEGIN_SRC evennia
|
||||
@create monocle:typeclasses.things.MagicMonocle
|
||||
#
|
||||
@desc monocle = Allows you to see past magical illusions. |/Command: |gpeer <object>|n
|
||||
#
|
||||
give monocle to Dabbler
|
||||
#+END_SRC
|
||||
|
||||
Reset the game:
|
||||
|
||||
#+BEGIN_SRC evennia :tangle no
|
||||
# Who has the monocle
|
||||
py me.search('monocle', typeclass="typeclasses.things.MagicMonocle", global_search=True).reset_counts()
|
||||
#+END_SRC
|
||||
|
||||
Get the scoreboard:
|
||||
|
||||
#+BEGIN_SRC evennia :tangle no
|
||||
# Who has the monocle
|
||||
py me.search('monocle', typeclass="typeclasses.things.MagicMonocle", global_search=True).report_score()
|
||||
#+END_SRC
|
||||
|
||||
Need a global clock, right?
|
||||
|
||||
#+BEGIN_SRC evennia :tangle no
|
||||
@create clock:typeclasses.things.GlobalAlarmClock
|
||||
#
|
||||
@desc clock = Strange round clock with four hands and twenty symbols.
|
||||
#+END_SRC
|
||||
|
||||
Need a channel to chat about the game:
|
||||
|
||||
#+BEGIN_SRC evennia
|
||||
@channel/create Hide and Seek Game;hide;game = Messages to people playing the Hide and Seek game
|
||||
#
|
||||
# Others would type:
|
||||
# channel/sub game
|
||||
#+END_SRC
|
||||
|
||||
Start the hiders …
|
||||
#+BEGIN_SRC evennia :tangle no
|
||||
say Alright everyone ready to play the game?
|
||||
#
|
||||
py me.search('clock').start_timer(60, "Ready, get set ... and |wgo hide!|n|/Seeker will start the count-down.", "Ready or not, here comes the seeker!")
|
||||
#
|
||||
py me.search('clock').start_timer(300, finish="The round of the game is done! Let's return and see the score.")
|
||||
#
|
||||
@tel <char> = here
|
||||
#+END_SRC
|
||||
|
||||
**** Journal
|
||||
The pipe is little more than messages to the smoker and everyone else in the room.
|
||||
|
||||
|
|
@ -5485,6 +5545,33 @@ And actions at this level are about as cute as a cat can be:
|
|||
@set stoat/friendly_actions = "The << sleepy ^ wee >> beastie << on $your() lap ^ >> let's out an adorable yawn. ;; The << sleepy ^ wee >> beastie << on $your() lap ^ >> uncurls itself, stretches, and recurls again. ;; $You() $conj(pet) the << sleepy ^ wee >> beastie << on |p lap ^ >> as it snuggles << close ^ >>. ;; You hear a deep purring sounds from the << sleepy ^ wee >> beastie << on $your() lap ^ >>. ;; The << sleepy ^ wee >> beastie twitches in its sleep, as if playing with dream toys."
|
||||
#+END_SRC
|
||||
|
||||
Since the beastie doesn’t go anywhere, we could probably attach the following “room actions” to it?
|
||||
|
||||
- The scent of fresh-baked scones drifts from the kitchen, rich with butter.
|
||||
- A book from the shelf slides out, and flaps it pages like a bird before resting on another shelf.
|
||||
- A swirling portal of magic opens near a bookcase, a devilish head emerges and looks around. It shakes it head and returns into the energy. With a pop of octarine, the portal closes.
|
||||
- The tiny brass dragon on the mantel turns its head to watch you pass.
|
||||
- The brass dragon on the mantel sneezes a puff of harmless sparks.
|
||||
- The smoke from the old man’s pipe curls into tiny dancing gnomes before vanishing in the darkness of the ceiling.
|
||||
- Among the books on the shelf, the clock ticks backward for three beats, then resumes its proper rhythm.
|
||||
- A porcelain frog on the mantel croaks. ;; “Sorry,” says the frog, “I’ll try to be more quiet.”
|
||||
- A silver mouse wind-up toy patrols the bookshelves, stopping to salute every portrait.
|
||||
A china owl blinks awake at midnight and asks if anyone has seen its spectacles.
|
||||
A brass beetle scuttles across the mantel, polishing every trinket it passes with its tiny feet.
|
||||
A painted cat on a teacup flicks its tail whenever the tea is too strong.
|
||||
A little stone gargoyle atop the hearth coughs whenever the fire pops, then pretends it was clearing its throat.
|
||||
|
||||
Many of these require details or knick-knacks to back it up:
|
||||
- brass dragon
|
||||
- clock
|
||||
- porcelain frog
|
||||
- owl
|
||||
- brass beetle
|
||||
- gargoyle
|
||||
- tarot cards
|
||||
|
||||
Fix bug of =get trinket= gives the player “a few tinkets” that are nothing special.
|
||||
|
||||
And this pet loves his gnome.
|
||||
|
||||
#+BEGIN_src evennia
|
||||
|
|
@ -5494,7 +5581,7 @@ And this pet loves his gnome.
|
|||
Trigger some events … which can’t work at the moment, since a Pet is not a Puppet … yet:
|
||||
|
||||
#+BEGIN_SRC evennia
|
||||
@set stoat/arrive = "5 ;; gma {0} = A sleeping << wee ^ >> beastie, opens one curious eye to look at $you()."
|
||||
@set stoat/arrive = "5 ;; gma {0} = A << sleeping ^ dozing ^ >> << wee ^ >> beastie, opens one curious eye to look at $you()."
|
||||
#
|
||||
# @set stoat/sit = "3 ;; gm A sleeping << wee ^ >> beastie, opens one curious eye to see who arrived."
|
||||
#+END_SRC
|
||||
|
|
@ -7285,7 +7372,7 @@ What about pushing?
|
|||
Let’s test if we can sit on the rock:
|
||||
|
||||
#+BEGIN_SRC tcl
|
||||
send "look rock\n"
|
||||
send "look flat rock\n"
|
||||
expectit "A flat rock"
|
||||
|
||||
send "get rock\n"
|
||||
|
|
@ -7294,10 +7381,10 @@ Let’s test if we can sit on the rock:
|
|||
send "sit rock\n"
|
||||
expectit "You sit on the flat rock"
|
||||
|
||||
send "push rock\n"
|
||||
send "push flat rock\n"
|
||||
expectit "push the rock away"
|
||||
|
||||
send "pull rock\n"
|
||||
send "pull flat rock\n"
|
||||
expectit "pull the rock closer"
|
||||
#+END_SRC
|
||||
|
||||
|
|
@ -7904,6 +7991,8 @@ Let’s blow our horn and board the boat (we begin from the Grove of Matriarches
|
|||
|
||||
send "boat\n"
|
||||
expectit "The giant leaf gently bobs in the surf of this island, allowing you to disembark."
|
||||
|
||||
set timeout 30
|
||||
#+END_SRC
|
||||
** Throne Island
|
||||
The boat should land on a distant island.
|
||||
|
|
@ -8129,7 +8218,7 @@ The plaque contains a /password/ to say aloud. We need another StoryCube to list
|
|||
The poem in the shield has the /name, and the plague mentions that someone needs to say the name, which if said aloud, we hear:
|
||||
|
||||
#+BEGIN_SRC evennia
|
||||
@set gr02ctl/say = { r".*\bthalome.*": "gm Upon uttering that phrase, sparks of octarine magic pop the illusion, revealing an open archway at the base of the giant statue. ;; tag_all hidden_archway" }
|
||||
@set gr02ctl/say = { r".*\bthalome\b.*": "gm Upon uttering that phrase, sparks of octarine magic pop the illusion, revealing an open archway at the base of the giant statue. ;; tag_all hidden_archway" }
|
||||
#+END_SRC
|
||||
|
||||
And we need to get rid of it when any one leaves:
|
||||
|
|
@ -8191,28 +8280,6 @@ But we can enter:
|
|||
#+BEGIN_SRC tcl
|
||||
send "look opening\n"
|
||||
expectit "shaped as a cresent moon"
|
||||
|
||||
send "arch\n"
|
||||
expect {
|
||||
"The room is completely dark" {
|
||||
send "light torch\n"
|
||||
expectit "The room is lit up"
|
||||
|
||||
send "look\n"
|
||||
expectit "Antechamber"
|
||||
}
|
||||
"Antechamber" {
|
||||
send_user "We still have our torch lit from the last time."
|
||||
}
|
||||
timeout {
|
||||
puts "ERROR: Expected response for 'get stick' not received."
|
||||
send "quit\n"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#+END_SRC
|
||||
*** Puzzle Two: A Dark Place
|
||||
Let’s make this a dark room where one has to have two feel around for a splinter to light, or bring a torch.
|
||||
|
|
@ -8252,6 +8319,25 @@ Dome?
|
|||
Let’s look at all the fine details:
|
||||
|
||||
#+BEGIN_SRC tcl
|
||||
send "arch\n"
|
||||
expect {
|
||||
"The room is completely dark" {
|
||||
send "light torch\n"
|
||||
expectit "The room is lit up"
|
||||
|
||||
send "look\n"
|
||||
expectit "Antechamber"
|
||||
}
|
||||
"Antechamber" {
|
||||
send_user "We still have our torch lit from the last time."
|
||||
}
|
||||
timeout {
|
||||
puts "ERROR: Expected response for 'get stick' not received."
|
||||
send "quit\n"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
send "look cavity\n"
|
||||
expectit "this opening"
|
||||
|
||||
|
|
@ -8305,8 +8391,7 @@ And a list of differences that gives a hint to the password:
|
|||
If they say the /magic word/, they get the maguffin.
|
||||
|
||||
#+BEGIN_SRC evennia
|
||||
@set obelisk/say = { r".*\b[Ww]ater\b": "gm Upon uttering that phrase, sparks of octarine magic and mist appear on the opening on the obelisk. ;; scoring_all blue_medal ;; gm A blue medal materializes in the opening. You snatch it, claiming your prize.
|
||||
;; gift_all blue ;; gm You also notice a secret door! ;; tag_all hidden_antechamber_door" }
|
||||
@set obelisk/say = { r".*\b[Ww]ater\b.*": "gm Upon uttering that phrase, sparks of octarine magic and mist appear on the opening on the obelisk. ;; scoring_all blue_medal ;; gm A blue medal materializes in the opening. You snatch it, claiming your prize. ;; gift_all blue ;; gm You also notice a secret door! ;; tag_all hidden_antechamber_door" }
|
||||
#+END_SRC
|
||||
|
||||
And let’s test this out:
|
||||
|
|
@ -8421,7 +8506,7 @@ We use a =StoryCube= to lock the door until the password is said:
|
|||
If they say, /Tidal Surge/, the *Locker* unlocks the door, and they can go through.
|
||||
|
||||
#+BEGIN_SRC evennia
|
||||
@set gr04ctl/say = {r"^tidal ?surge.*": "gm You hear an audible click from the ornate door! ;; tag_all open_ornate_door"}
|
||||
@set gr04ctl/say = { r".*\btidal ?surge\b.*": "tag_all open_ornate_door ;; gm You hear an audible click from the ornate door! " }
|
||||
#+END_SRC
|
||||
|
||||
And the description of passing through:
|
||||
|
|
@ -8443,8 +8528,39 @@ But we’ll have the goblin test this out:
|
|||
expectit "A door you didn't notice before"
|
||||
|
||||
send "door\n"
|
||||
expectit "Escape Hallway"
|
||||
expectit "relocate some gold coins"
|
||||
|
||||
send "look plaque\n"
|
||||
expectit "green patina"
|
||||
|
||||
send "look door\n"
|
||||
expectit "grid of letters"
|
||||
|
||||
send "door\n"
|
||||
expectit "The door is locked"
|
||||
|
||||
send "say This is tricky. I think the answer is tidal surge!\n"
|
||||
expectit "You hear an audible click"
|
||||
|
||||
send "door\n"
|
||||
expectit "Lonely Island"
|
||||
#+END_SRC
|
||||
|
||||
Let’s test that we can return back to the mainland.
|
||||
|
||||
#+BEGIN_SRC tcl
|
||||
set timeout 240
|
||||
send "boat\n"
|
||||
expectit "docks"
|
||||
set timeout 30
|
||||
|
||||
send "disembark\n"
|
||||
expectit "Lazy Dock"
|
||||
|
||||
send "north\n"
|
||||
expectit "Grove of the Matriarchs"
|
||||
#+END_SRC
|
||||
|
||||
* Scoring
|
||||
I would like a =score= command that gives them a tally based on the activities they have participated in. This will be a hashtable, stored as an attribute. Perhaps it increments a value? Should I simplify the number of items, and then list them all, so they have goals?
|
||||
|
||||
|
|
@ -8522,12 +8638,6 @@ The /janitor/ is a =Script= that moves every thing back to where they should be
|
|||
Can we quickly walk back through the world, gathering ingredients, and then going back into the Secret Room to make potions?
|
||||
|
||||
#+BEGIN_SRC tcl
|
||||
send "leave\n"
|
||||
expectit "Grotto"
|
||||
|
||||
send "east\n"
|
||||
expectit "Grove of the Matriarchs"
|
||||
|
||||
send "climb boulder\n"
|
||||
expectit "Boulder Top"
|
||||
|
||||
|
|
@ -8548,6 +8658,9 @@ Can we quickly walk back through the world, gathering ingredients, and then goin
|
|||
expect {
|
||||
"a big hairy beast" {
|
||||
# Refeed!
|
||||
send "inv\n"
|
||||
expectit "pouch"
|
||||
|
||||
send "feed beast\n"
|
||||
expectit "scone"
|
||||
}
|
||||
|
|
@ -8667,6 +8780,10 @@ Let’s try the next potion, the /Somnium Illusorium/:
|
|||
send "west\n"
|
||||
expectit "Grove"
|
||||
|
||||
send "south\n"
|
||||
expectit "Lazy Dock"
|
||||
|
||||
# WHAT!?
|
||||
send "disembark\n"
|
||||
expectit "Lonely Island"
|
||||
|
||||
|
|
|
|||
|
|
@ -966,7 +966,6 @@ class Recorder(Object):
|
|||
return f"<blockquote>{text}</blockquote>"
|
||||
return f"<p>{text}</p>\n"
|
||||
|
||||
|
||||
def find_actor(self, text, default=None):
|
||||
"""
|
||||
Extract the character performing the action from the text.
|
||||
|
|
@ -994,14 +993,24 @@ class Recorder(Object):
|
|||
if names:
|
||||
msg = sub(f"^{actor.sdesc.get()}", choice(names),
|
||||
msg, flags=IGNORECASE)
|
||||
self.record_html(msg, msg_type)
|
||||
|
||||
actor = self.find_actor(msg, actor)
|
||||
self.followup_actions(msg, msg_type,
|
||||
self.find_actor(msg, actor))
|
||||
|
||||
def record_html(self, msg, msg_type):
|
||||
"""
|
||||
Write msg to HTML based on 'transcripts_path'.
|
||||
If file doesn't exist, prepend 'header_file'.
|
||||
|
||||
Set both with something like:
|
||||
|
||||
@set shrub/transcripts_path = "transcripts/bar-%Y-%m-%d.html"
|
||||
@set shrub/header_file = "transcripts/header-template.html"
|
||||
"""
|
||||
msg = self.to_html(msg, msg_type)
|
||||
# @set shrub/transcripts_path = "transcripts/bar-%Y-%m-%d.html"
|
||||
filename = datetime.today().strftime(self.db.transcripts_path)
|
||||
|
||||
# @set shrub/header_file = "transcripts/header-template.html"
|
||||
if not exists(filename):
|
||||
makedirs(dirname(filename), exist_ok=True)
|
||||
copyfile(self.db.header_file, filename)
|
||||
|
|
@ -1009,7 +1018,8 @@ class Recorder(Object):
|
|||
with open(filename, "a") as myfile:
|
||||
myfile.write(msg)
|
||||
|
||||
def followup_actions(self, msg, msg_type, actor):
|
||||
# Follow-up Actions ...
|
||||
if match(r".* arrives .*", msg) and actor and \
|
||||
msg_type in ('traverse', 'teleport'):
|
||||
self.execute_cmd(f"look {actor}")
|
||||
self.record_html(actor.db.desc, "look")
|
||||
|
|
|
|||
|
|
@ -1221,8 +1221,11 @@ class Scribe(Recorder):
|
|||
|
||||
Set the following properties:
|
||||
|
||||
@set scribe/directory = "transcripts"
|
||||
@set scribe/header = "transcripts/header-template.html"
|
||||
@set scribe/transcripts_path = "transcripts/bar-%Y-%m-%d.html"
|
||||
@set scribe/header_file = "transcripts/header-template.html"
|
||||
"""
|
||||
def msg(self, text=None, from_obj=None, session=None, **kwargs):
|
||||
self.record_msg(text, from_obj)
|
||||
|
||||
def note(self, text):
|
||||
self.record_html(text, "note")
|
||||
|
|
|
|||
77
world/my-nicks.ev
Normal file
77
world/my-nicks.ev
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
# :PROPERTIES:
|
||||
# :header-args:evennia: :tangle world/my-nicks.ev :comments both
|
||||
# :END:
|
||||
# While we can’t tangle his /nicks/ and other shortcuts to the Evennia file (as we are currently puppeting the Avatar), we can create these as a separate file, and batch command them later.
|
||||
|
||||
# Let’s pretend we are in an IRC:
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Nicks][Nicks:1]]
|
||||
@nick /me $1 = emote $1
|
||||
# Nicks:1 ends here
|
||||
|
||||
|
||||
|
||||
# Have the shrub, in the bar, write out a message:
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Nicks][Nicks:2]]
|
||||
@nick write $1 = py me.search('shrub').write("$1")
|
||||
# Nicks:2 ends here
|
||||
|
||||
|
||||
|
||||
# Create a note in the cozy transcripts in the house:
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Nicks][Nicks:3]]
|
||||
@nick note $1 = py me.search('golden butterfly').note("$1")
|
||||
# Nicks:3 ends here
|
||||
|
||||
|
||||
|
||||
# Special places that I want to quickly move to:
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Nicks][Nicks:4]]
|
||||
@nick meadow = fly Frog Meadow
|
||||
#
|
||||
@nick bar = fly Wyldwood Bar
|
||||
#
|
||||
@nick grove = fly Grove of the Matriarchs
|
||||
#
|
||||
@nick grotto = fly Grotto
|
||||
#
|
||||
@nick secret = fly mp12
|
||||
#
|
||||
@nick hut = fly Homey Hut
|
||||
#
|
||||
@nick marsh = fly Mellow Marsh
|
||||
#
|
||||
@nick dock = fly Lazy Dock
|
||||
#
|
||||
@nick lair = fly Lair
|
||||
#
|
||||
@nick myroom = fly Dabbler's House
|
||||
# Nicks:4 ends here
|
||||
|
||||
|
||||
|
||||
# Where is a certain thing or character located:
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Nicks][Nicks:5]]
|
||||
@nick where $1 = py me.search("$1", global_search=True).location
|
||||
# Nicks:5 ends here
|
||||
|
||||
|
||||
|
||||
# Tell a particular NPC to come to the house:
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Nicks][Nicks:6]]
|
||||
@nick come $1 = py me.search("$1", global_search=True).come()
|
||||
# Nicks:6 ends here
|
||||
|
||||
|
||||
|
||||
# In case I end up in the meadow without a scone, I can make one for the BHB:
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Nicks][Nicks:7]]
|
||||
@nick scone = py me.search("cabinet", global_search=True).do_make(me, words=scone")
|
||||
# Nicks:7 ends here
|
||||
|
|
@ -404,7 +404,7 @@ expectit "Frog Meadow"
|
|||
expect {
|
||||
"a big hairy beast" {
|
||||
send "look beast\n"
|
||||
expectit "it tries to hide behind a tall clump of grass"
|
||||
expectit "beast with long claws and teeth"
|
||||
|
||||
send "pet bhb\n"
|
||||
expectit "can't get near"
|
||||
|
|
@ -1171,7 +1171,7 @@ expectit "Conspicuously absent"
|
|||
send "fill teacup\n"
|
||||
expectit "mucky water"
|
||||
|
||||
send "look rock\n"
|
||||
send "look flat rock\n"
|
||||
expectit "A flat rock"
|
||||
|
||||
send "get rock\n"
|
||||
|
|
@ -1180,10 +1180,10 @@ expectit "You can't take it"
|
|||
send "sit rock\n"
|
||||
expectit "You sit on the flat rock"
|
||||
|
||||
send "push rock\n"
|
||||
send "push flat rock\n"
|
||||
expectit "push the rock away"
|
||||
|
||||
send "pull rock\n"
|
||||
send "pull flat rock\n"
|
||||
expectit "pull the rock closer"
|
||||
|
||||
send "get doll\n"
|
||||
|
|
@ -1215,6 +1215,8 @@ expectit "The giant leaf slows as it arrives next to the dock."
|
|||
send "boat\n"
|
||||
expectit "The giant leaf gently bobs in the surf of this island, allowing you to disembark."
|
||||
|
||||
set timeout 30
|
||||
|
||||
send "disembark\n"
|
||||
expectit "Lonely Island"
|
||||
|
||||
|
|
@ -1292,12 +1294,32 @@ send "look door\n"
|
|||
expectit "A door you didn't notice before"
|
||||
|
||||
send "door\n"
|
||||
expectit "Escape Hallway"
|
||||
expectit "relocate some gold coins"
|
||||
|
||||
send "leave\n"
|
||||
expectit "Grotto"
|
||||
send "look plaque\n"
|
||||
expectit "green patina"
|
||||
|
||||
send "east\n"
|
||||
send "look door\n"
|
||||
expectit "grid of letters"
|
||||
|
||||
send "door\n"
|
||||
expectit "The door is locked"
|
||||
|
||||
send "say This is tricky. I think the answer is tidal surge!\n"
|
||||
expectit "You hear an audible click"
|
||||
|
||||
send "door\n"
|
||||
expectit "Lonely Island"
|
||||
|
||||
set timeout 240
|
||||
send "boat\n"
|
||||
expectit "docks"
|
||||
set timeout 30
|
||||
|
||||
send "disembark\n"
|
||||
expectit "Lazy Dock"
|
||||
|
||||
send "north\n"
|
||||
expectit "Grove of the Matriarchs"
|
||||
|
||||
send "climb boulder\n"
|
||||
|
|
@ -1320,6 +1342,9 @@ expectit "Frog Meadow"
|
|||
expect {
|
||||
"a big hairy beast" {
|
||||
# Refeed!
|
||||
send "inv\n"
|
||||
expectit "pouch"
|
||||
|
||||
send "feed beast\n"
|
||||
expectit "scone"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1556,18 +1556,6 @@ py me.search("bartender").backstory("tavern")
|
|||
# Puppeting:1 ends here
|
||||
|
||||
|
||||
|
||||
# Need a channel to chat about the game:
|
||||
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Hide and Seek][Hide and Seek:6]]
|
||||
@channel/create Hide and Seek Game;hide;game = Messages to people playing the Hide and Seek game
|
||||
#
|
||||
# Others would type:
|
||||
# channel/sub game
|
||||
# Hide and Seek:6 ends here
|
||||
|
||||
|
||||
# Gives out candy, as there is a never-ending bowl of them on the bar.
|
||||
# Gotta have something to munch on.
|
||||
|
||||
|
|
@ -4093,7 +4081,7 @@ py bt = self.search('gnome'); bt.sdesc.add('old gnome'); bt.db.pose = 'smiling a
|
|||
# And his fancy jacket:
|
||||
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Character: Dabbler][Character: Dabbler:10]]
|
||||
# [[file:../moss-n-puddles.org::*His Magic Devices][His Magic Devices:2]]
|
||||
@create waistcoat : typeclasses.things.BagofJunk
|
||||
#
|
||||
@desc waistcoat = An elegant green waistcoat with gold embroidery.
|
||||
|
|
@ -4101,14 +4089,14 @@ py bt = self.search('gnome'); bt.sdesc.add('old gnome'); bt.db.pose = 'smiling a
|
|||
@set waistcoat/stuff = "fey"
|
||||
#
|
||||
@give waistcoat = gnome
|
||||
# Character: Dabbler:10 ends here
|
||||
# His Magic Devices:2 ends here
|
||||
|
||||
|
||||
|
||||
# And some special /triggers/ which are mostly “phrases” that are shown to all characters:
|
||||
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Character: Dabbler][Character: Dabbler:11]]
|
||||
# [[file:../moss-n-puddles.org::*His Magic Devices][His Magic Devices:3]]
|
||||
@set self/triggers:main = {
|
||||
"darkness": {
|
||||
"desc": "Make the room go black",
|
||||
|
|
@ -4117,15 +4105,15 @@ py bt = self.search('gnome'); bt.sdesc.add('old gnome'); bt.db.pose = 'smiling a
|
|||
"The room gets dark",
|
||||
"And then pitch-black!",
|
||||
"The darkess lifts, and the room returns to normal."]}}
|
||||
# Character: Dabbler:11 ends here
|
||||
# His Magic Devices:3 ends here
|
||||
|
||||
|
||||
|
||||
# And set the /typical/ state of =main=:
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Character: Dabbler][Character: Dabbler:12]]
|
||||
# [[file:../moss-n-puddles.org::*His Magic Devices][His Magic Devices:4]]
|
||||
@set self/currentgame = main
|
||||
# Character: Dabbler:12 ends here
|
||||
# His Magic Devices:4 ends here
|
||||
|
||||
|
||||
# And my staff:
|
||||
|
|
@ -4192,6 +4180,43 @@ py bt = self.search('gnome'); bt.sdesc.add('old gnome'); bt.db.pose = 'smiling a
|
|||
# Pipe:2 ends here
|
||||
|
||||
|
||||
# First create a number of magic rings equal to the number of players, minus one:
|
||||
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Hide and Seek][Hide and Seek:1]]
|
||||
@create magic ring:typeclasses.things.MagicRing
|
||||
#
|
||||
@desc magic ring = Octarine sparks fly when you don this ring.|/Commands: |gtransform|n and |guntransform|n.
|
||||
#
|
||||
give magic ring to Dabbler
|
||||
# Hide and Seek:1 ends here
|
||||
|
||||
|
||||
|
||||
# And create a monocle:
|
||||
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Hide and Seek][Hide and Seek:2]]
|
||||
@create monocle:typeclasses.things.MagicMonocle
|
||||
#
|
||||
@desc monocle = Allows you to see past magical illusions. |/Command: |gpeer <object>|n
|
||||
#
|
||||
give monocle to Dabbler
|
||||
# Hide and Seek:2 ends here
|
||||
|
||||
|
||||
|
||||
# Need a channel to chat about the game:
|
||||
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Hide and Seek][Hide and Seek:6]]
|
||||
@channel/create Hide and Seek Game;hide;game = Messages to people playing the Hide and Seek game
|
||||
#
|
||||
# Others would type:
|
||||
# channel/sub game
|
||||
# Hide and Seek:6 ends here
|
||||
|
||||
|
||||
# The pipe is little more than messages to the smoker and everyone else in the room.
|
||||
|
||||
|
||||
|
|
@ -6602,7 +6627,7 @@ $state(boat, A large leaf bobs invitingly in the surf.)
|
|||
|
||||
|
||||
# [[file:../moss-n-puddles.org::*The Throne: First Puzzle][The Throne: First Puzzle:7]]
|
||||
@set gr02ctl/say = { r".*\bthalome.*": "gm Upon uttering that phrase, sparks of octarine magic pop the illusion, revealing an open archway at the base of the giant statue. ;; tag_all hidden_archway" }
|
||||
@set gr02ctl/say = { r".*\bthalome\b.*": "gm Upon uttering that phrase, sparks of octarine magic pop the illusion, revealing an open archway at the base of the giant statue. ;; tag_all hidden_archway" }
|
||||
# The Throne: First Puzzle:7 ends here
|
||||
|
||||
|
||||
|
|
@ -6754,8 +6779,7 @@ light torch
|
|||
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Puzzle Three: The Changing Obelisk][Puzzle Three: The Changing Obelisk:6]]
|
||||
@set obelisk/say = { r".*\b[Ww]ater\b": "gm Upon uttering that phrase, sparks of octarine magic and mist appear on the opening on the obelisk. ;; scoring_all blue_medal ;; gm A blue medal materializes in the opening. You snatch it, claiming your prize.
|
||||
;; gift_all blue ;; gm You also notice a secret door! ;; tag_all hidden_antechamber_door" }
|
||||
@set obelisk/say = { r".*\b[Ww]ater\b.*": "gm Upon uttering that phrase, sparks of octarine magic and mist appear on the opening on the obelisk. ;; scoring_all blue_medal ;; gm A blue medal materializes in the opening. You snatch it, claiming your prize. ;; gift_all blue ;; gm You also notice a secret door! ;; tag_all hidden_antechamber_door" }
|
||||
# Puzzle Three: The Changing Obelisk:6 ends here
|
||||
|
||||
|
||||
|
|
@ -6889,7 +6913,7 @@ light torch
|
|||
|
||||
|
||||
# [[file:../moss-n-puddles.org::*Puzzle Four: The Door Puzzle][Puzzle Four: The Door Puzzle:13]]
|
||||
@set gr04ctl/say = {r"^tidal ?surge.*": "gm You hear an audible click from the ornate door! ;; tag_all open_ornate_door"}
|
||||
@set gr04ctl/say = { r".*\btidal ?surge\b.*": "tag_all open_ornate_door ;; gm You hear an audible click from the ornate door! " }
|
||||
# Puzzle Four: The Door Puzzle:13 ends here
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue