# The Mist Horn

# The mist horn calls the boat to the character, no matter where they are. We create one regularly in the witch’s hut:


# [[file:../../../projects/mud-adventure.org::*The Mist Horn][The Mist Horn:1]]
@teleport/quiet mp09
#
py timed_script = evennia.create_script(key="Create Horns",
                                        typeclass='typeclasses.scripts.CreateHorns',
                                        interval=14400,  # 4 hours?
                                        start_delay=False,  # wait interval before first call
                                        autostart=True,
                                        attributes=[("destination", here)] )
# The Mist Horn:1 ends here



# When a character arrives at the Lazy Dock and wait, the room gives a hint about the horn and the boat occurring.


# [[file:../../../projects/mud-adventure.org::*The Mist Horn][The Mist Horn:2]]
@set mp06/arrive = "30 ;; gm Did you hear that? Sounds like a distant horn ... Perhaps the wind. ;; gm You think you saw a boat out on the sea ... but maybe not. "
# The Mist Horn:2 ends here

# The Boat
# When the boat is docked, we should have a special /state/ to describe it:


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:1]]
@teleport/quiet Lazy Dock
#
@desc/boat here = The dock you stand on juts into a bay of water the color of lavender flowers. A giant leaf softly bobs in the subtle surf next to the dock. Perhaps one could use this to sail across this sea?
# The Boat:1 ends here



# A boat on the sea is a separate room.


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:2]]
@dig/teleport Leaf Boat;gr01 = leaf boat;boat;embark,dock;land;disembark
# The Boat:2 ends here



# General description:


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:3]]
@desc here = This leaf, large enough to accommodate a few people comfortably, seems to be a strange, but steady watercraft.
# The Boat:3 ends here



# Controlling the boat comes from a Script:


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:4]]
@script here = typeclasses.sailing.Boat
# The Boat:4 ends here



# The boat has three /states/:

#   - =docked= (at *Lazy Dock*)
#   - =sailing= (at sea)
#   - =ashore= (at some island below)


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:5]]
@desc/docked here = This leaf, large enough to accommodate a few people comfortably, seems to be a strange, but steady watercraft. While next to the dock, you can disembark, but feel this boat could set sail at any minute.
|x[|WNote:|x Waiting on other potential passengers]|n
# The Boat:5 ends here



# And describe sailing on it.:


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:7]]
@desc/sailing here = This leaf, large enough to accommodate a few people comfortably, seems to be a strange, but steady watercraft.

Only eddies from the subtle wake, intrude on the lavender sea's tranquility, as the giant leaf floats along an invisible current. <morning>The morning sun peaks above the colossal trees and the snow-capped mountains beyond.</morning><afternoon>The afternoon sun peaks out briefly from misty clouds.</afternoon><evening>The evening sun begins to set on a watery horizon.</evening><night>The moon peaks out from behind wispy clouds.</night>
# The Boat:7 ends here



# And the description of the boat when ashore on an island:


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:8]]
@desc/ashore here = This leaf, large enough to accommodate a few people comfortably, seems to be a strange, but steady watercraft. Bobbing softly in the surf, the giant leaf bumps against the shore of the island, allowing you to disembark.
|x[|WNote:|x Waiting on other potential passengers]|n
# The Boat:8 ends here



# While on the boat, describe the dock:


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:9]]
desc dock = A lazy dock with a comfortable-looking chair and a forest of colossal trees behind it on a hill.
# The Boat:9 ends here



# And describe disembarking to the Lazy Dock:


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:10]]
@set dock/traverse_msg = "You easily disembark from the giant leaf and step onto the dock..."
# The Boat:10 ends here



# Disembark to describe the exits to the boat:


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:11]]
@teleport/quiet Lazy Dock
# The Boat:11 ends here



# Describe the leaf boat (as an exit):


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:12]]
@desc boat = A giant leaf, tipped on all sides, gently floats on the tranquil sea, subtly bumping against the dock. Doesn't seem to have an oar, or even a rudder, but... it appears to be a strange, but steady watercraft if one were to gather a few friends to venture to the lands beyond...
# The Boat:12 ends here



# And describe embarking:


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:13]]
@set boat/traverse_msg = "You step into the bowed cavity of the leaf. Seems surprisingly steady...for a leaf."
# The Boat:13 ends here



# The /exit/ to and from the Dock to the *Leaf Boat* comes and goes.

# Send the “exit” to te leaf boat into the void to be picked up later:


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:14]]
@teleport/tonone boat
# The Boat:14 ends here



# Finally, we create a script that keeps the boat out at the island:


# [[file:../../../projects/mud-adventure.org::*The Boat][The Boat:15]]
py timed_script = evennia.create_script(key="boat reset",
                                        typeclass='typeclasses.sailing.ResetBoat',
                                        interval=14400,
                                        start_delay=False,
                                        autostart=True)
# The Boat:15 ends here

# Throne Island
# The boat should land on a distant island.

# We should come up with a *theme* for the entire island, from the “statue” to the puzzles and answers.


# [[file:../../../projects/mud-adventure.org::*Throne Island][Throne Island:1]]
@dig/teleport Lonely Island;gr02:typeclasses.rooms_weather.TimeWeatherRoom
# Throne Island:1 ends here



# And describe it:


# [[file:../../../projects/mud-adventure.org::*Throne Island][Throne Island:2]]
@desc here = Vibrant green moss covers the island's gray rock. Wandering around the conifers you encounter a |Ystatue|n of an elegant woman seated on a large throne.
$state(boat, A large leaf bobs invitingly in the surf.)
# Throne Island:2 ends here



# Now jump into the boat,


# [[file:../../../projects/mud-adventure.org::*Throne Island][Throne Island:3]]
@open leaf boat;boat;embark = gr01
# Throne Island:3 ends here



# And describe the exit:


# [[file:../../../projects/mud-adventure.org::*Throne Island][Throne Island:4]]
@desc boat = A giant leaf, tipped on all sides, gently bobs in the surf of this island. Doesn't seem to have an oar, or even a rudder, but... it appears to be a strange, but steady watercraft.
# Throne Island:4 ends here



# And about getting on the boat:


# [[file:../../../projects/mud-adventure.org::*Throne Island][Throne Island:5]]
@set boat/traverse_msg = "You step into the bowed cavity of the giant leaf."
# Throne Island:5 ends here

# [[file:../../../projects/mud-adventure.org::*Throne Island][Throne Island:6]]
@teleport gr01
#
@open shore;island;disembark = gr02
# Throne Island:6 ends here



# And exiting the boat:


# [[file:../../../projects/mud-adventure.org::*Throne Island][Throne Island:7]]
@set shore/traverse_msg = "You disembark from the giant leaf to step off into the surf and onto the shore..."
# Throne Island:7 ends here



# Are they going to look before getting off?


# [[file:../../../projects/mud-adventure.org::*Throne Island][Throne Island:8]]
@desc shore = You seem to have arrived at some island covered in large conifer trees.
# Throne Island:8 ends here



# And a bit of clean up to leave the boat at the island.


# [[file:../../../projects/mud-adventure.org::*Throne Island][Throne Island:9]]
@teleport/tonone dock
# Throne Island:9 ends here



# And the boat’s “room state”:

# [[file:../../../projects/mud-adventure.org::*Throne Island][Throne Island:10]]
@roomstate shore
# Throne Island:10 ends here

# First Puzzle
# Details on the throne and the statues and maybe moss? What about sitting on the throne?


# [[file:../../../projects/mud-adventure.org::*First Puzzle][First Puzzle:1]]
@teleport gr02
#
@detail statue = A massive statue of an elegant woman atop a throne. A |Yshield|n rests against her knee as she hold an upright |Ytrident|n. In her other hand, she holds aloft an |Yorb|n. Eons of moss and mildew adds the appearance of tears streaming down her face. Only a raised eyebrow and subtle smirk hints at an earlier impression. At the base of statue is a |Yplaque|n.
# First Puzzle:1 ends here

# [[file:../../../projects/mud-adventure.org::*First Puzzle][First Puzzle:2]]
@detail trident = Held loosely with one hand. Unclear if the sculptor intended for the middle tine to be missing, or if it broke centuries ago.
# First Puzzle:2 ends here

# [[file:../../../projects/mud-adventure.org::*First Puzzle][First Puzzle:3]]
@detail orb;ball = The sphere resting on the statue's outstretched hand has an ornamental cross on top and the carved letters: |mR E G I N A|n
# First Puzzle:3 ends here



# The shield holds a poem:


# [[file:../../../projects/mud-adventure.org::*First Puzzle][First Puzzle:4]]
@detail shield = An ornate shield carved with a poem:

   Upon the waves, as ship doeth glide,
   Fearful whispers of the sea abide,
   We cast our plea, with silver and song
   To keep us safe as we sail along.

   She stirs the tides with playful ease,
   Her whispers ride the ocean's breeze,
   Her mischief wrapped in salty foam,
   A siren's call, the sea, her home.
# First Puzzle:4 ends here



# And the plaque gives the riddle.


# [[file:../../../projects/mud-adventure.org::*First Puzzle][First Puzzle:5]]
@detail plaque = Glory to the Wildmother. All should |yspeak|n her |yname|n: |mA Q U E E R T H E M E L O N|n
# First Puzzle:5 ends here



# The plaque contains a /password/ to say aloud. We need another StoryCube to listen for the pass phrase:


# [[file:../../../projects/mud-adventure.org::*First Puzzle][First Puzzle:6]]
@create/drop gr02ctl:typeclasses.puzzles.StoryCube
#
@desc gr02ctl = Opens the door when someone says Melora
#
@lock gr02ctl = view:false()
# First Puzzle:6 ends here



# The letters form a phrase to be said: =Melora the Queen= … which if said aloud, we hear:

# [[file:../../../projects/mud-adventure.org::*First Puzzle][First Puzzle:7]]
@set gr02ctl/say = {r".*\bmelora.*": "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", r".*\b(leamor|lemor)\b.*": "gm You hear a voice on the wind that whispers, \"That isn't even how you spell lemur.\""}
# First Puzzle:7 ends here



# And we need to get rid of it when any one leaves:


# [[file:../../../projects/mud-adventure.org::*First Puzzle][First Puzzle:8]]
@set gr02ctl/leave = "30 ;; @teleport/tonone arched opening"
# First Puzzle:8 ends here



# Which exit would need to be moved from the =None= space and a script to teleport it back after a minute.


# [[file:../../../projects/mud-adventure.org::*First Puzzle][First Puzzle:9]]
@dig Antechamber;gr03:typeclasses.rooms_dark.DarkRoom = arched opening;opening;arch
# First Puzzle:9 ends here

# [[file:../../../projects/mud-adventure.org::*First Puzzle][First Puzzle:10]]
@desc arched opening = An arch, shaped as a cresent moon, rests on two ornate pillars to frame a short opening at the base of the statue. One pillar shows carved letters: |mF I C K L E|n and the other pillar shows: |mF A I T H|n.
# First Puzzle:10 ends here



# And the description of entering:


# [[file:../../../projects/mud-adventure.org::*First Puzzle][First Puzzle:11]]
@set arched opening/traverse_msg = "You slightly stoop to enter into the darkness beyond the archway... As soon as you do, a large stone block slams down behind you, trapping you in the darkness."
# First Puzzle:11 ends here



# Let’s hide and lock this down:


# [[file:../../../projects/mud-adventure.org::*First Puzzle][First Puzzle:12]]
@set arched opening/hidden_tag = "hidden_archway"
#
@lock arched opening = view:tag(hidden_archway)
# First Puzzle:12 ends here

# Puzzle Two
# Let’s make this a dark room where one has to have two feel around for a splinter to light, or bring a torch.


# [[file:../../../projects/mud-adventure.org::*Puzzle Two][Puzzle Two:1]]
@create torch:typeclasses.lightables.LightSource
# Puzzle Two:1 ends here



# Now, we can go in:


# [[file:../../../projects/mud-adventure.org::*Puzzle Two][Puzzle Two:2]]
@teleport gr03
#
light torch
#
@desc here = A large room formed from intricately placed |Ystone blocks|n, tapered to form a |Ydome|n above you. In the center you see a large |Yobelisk|n with an empty |Ycavity|n halfway up. There seems to be no visible way to escape.
# Puzzle Two:2 ends here



# And some details:


# [[file:../../../projects/mud-adventure.org::*Puzzle Two][Puzzle Two:3]]
@detail cavity = While empty, this opening, about a foot or so deep, looks like it may have held something in the past.
# Puzzle Two:3 ends here



# Don’t know if the blocks are interesting:


# [[file:../../../projects/mud-adventure.org::*Puzzle Two][Puzzle Two:4]]
@detail stone blocks;blocks = While the stones are tightly placed, a curious blue fungus grows where moisture seeps between the seams.
# Puzzle Two:4 ends here



# Dome?


# [[file:../../../projects/mud-adventure.org::*Puzzle Two][Puzzle Two:5]]
@detail dome = Perhaps 30 feet high, but as shadows from the flame dance above you, you find it difficult to tell.
# Puzzle Two:5 ends here

# Puzzle Three
# Each time this is “seen”, the response is different, so we use a [[file:~/src/moss-n-puddles/typeclasses/puzzles.py::class Changling(Object):][Changling]]:


# [[file:../../../projects/mud-adventure.org::*Puzzle Three][Puzzle Three:1]]
@create/drop granite obelisk: typeclasses.puzzles.Changling
# Puzzle Three:1 ends here



# And pin it down:


# [[file:../../../projects/mud-adventure.org::*Puzzle Three][Puzzle Three:2]]
@lock obelisk = get:false()
#
@set obelisk/get_err_msg = "That is way too big to lift."
# Puzzle Three:2 ends here



# The default description will be replaced:


# [[file:../../../projects/mud-adventure.org::*Puzzle Three][Puzzle Three:3]]
@desc obelisk = A granite obelisk grazes the top of the dome. Each of its four sides show a different image.
# Puzzle Three:3 ends here



# We build a /changling’s/ description from a =_prefix=, a random =descs=, and a =_postfix=:


# [[file:../../../projects/mud-adventure.org::*Puzzle Three][Puzzle Three:4]]
@set obelisk/desc_prefix = "A << granite ^ large ^ stone >> obelisk grazes the top of the dome. The surface of the obelisk seem to waver, shift and writhe under your gaze."
#
@set obelisk/desc_postfix = " And << quickly ^ soon ^ swiftly >>, the << image ^ visage ^ vision ^ carving >> << is gone ^ fades ^ disappears ^ vanishes >>."
# Puzzle Three:4 ends here



# And a list of differences that gives a hint to the password:


# [[file:../../../projects/mud-adventure.org::*Puzzle Three][Puzzle Three:5]]
@set obelisk/descs = (
  "You can briefly make out the image of ocean waves.",
  "For the briefest moment you make out an icy engravings of crystals.",
  "You think you can see the outline of grass covered in dew drops.",
  "The surface for a moment seems to portray clouds passing by.",
  "Trees bordering a flowing river show up on the surface.",
)
# Puzzle Three:5 ends here



# If they say the /magic word/, they get the maguffin.


# [[file:../../../projects/mud-adventure.org::*Puzzle Three][Puzzle Three: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. ;; gm A blue medal materializes in the opening. You inspect it, wondering if this is the great prize you've heard about. ;; gift_all blue ;; gm You also notice a secret door! ;; tag_all hidden_antechamber_door" }
# Puzzle Three:6 ends here

# Puzzle Four
# Another puzzle, another room:


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:1]]
@dig Escape Hallway;gr04:typeclasses.rooms_dark.DarkRoom = secret door;door
# Puzzle Four:1 ends here



# And we describe the secret door…


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:2]]
@desc secret door = An door, you didn't notice before, looks like stone blocks. Beyond looks like another chamber.
# Puzzle Four:2 ends here



# And the description of entering:


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:3]]
@set secret door/traverse_msg = "You slightly stoop to enter the dark chamber beyond..."
# Puzzle Four:3 ends here



# Let’s hide and lock this down:


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:4]]
@set secret door/hidden_tag = "hidden_antechamber_door"
#
@lock secret door = view:tag(hidden_antechamber_door)
# Puzzle Four:4 ends here



# Let’s go:


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:5]]
@teleport gr04
#
@desc here = This stone hallway ends with an overly |Yornate door|n covered with letters in rows and columns forming a grid matrix. Placed above the door, a bronze |Yplaque|n, shows its age with a coat of patina.
# Puzzle Four:5 ends here



# Let’s reward our players again:


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:6]]
@set gr04/arrive = "4 ;; gm ... You hear a distant dice roll ... ;; gm With your excellent perception, you notice some gold coins hidden in the floor's dust. ;; gm You don't hesitate to relocate those to your pouch. ;; coin_all 10 "
# Puzzle Four:6 ends here



# We need another door in order to escape.


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:7]]
@detail plaque = Through the green patina, you can barely make out the text:|/
    A spoken word unseals me.
    It starts with a T.
    Halfway between twins.
    The next character lies.
# Puzzle Four:7 ends here



# The door leads back out.


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:8]]
@open ornate door;door = Lonely Island
# Puzzle Four:8 ends here



# The dock is locked:


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:9]]
@lock ornate door = traverse:tag(open_ornate_door)
# Puzzle Four:9 ends here

# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:10]]
@set ornate door/err_traverse = "The door is locked."
# Puzzle Four:10 ends here



# Look at the grid to find the two T’s:


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:11]]
@desc ornate door = The grid of letters look like:|/
     | Y | B | Q | X | D | Q |
     | Y | A | K | D | X | B |
     | D | E | L | G | W | X |
     | T | S | - | A | X | V |
     | L | J | H | E | P | V |
     | F | U | I | D | I | P |
     | H | X | R | G | R | X |
     | K | S | M | U | T | N |
     | W | X | M | W | Z | Z |
# Puzzle Four:11 ends here



# We use a =StoryCube= to lock the door until the password is said:


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:12]]
@create/drop gr04ctl:typeclasses.puzzles.StoryCube
#
@desc gr04ctl = Opens the door when someone says Tidal Surge
#
@lock gr04ctl = view:false()
# Puzzle Four:12 ends here



# If they say, /Tidal Surge/, the *Locker* unlocks the door, and they can go through.


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:13]]
@set gr04ctl/say = {r"^tidal ?surge.*": "gm You hear an audible click from the ornate door! ;; tag_all open_ornate_door"}
# Puzzle Four:13 ends here



# And the description of passing through:


# [[file:../../../projects/mud-adventure.org::*Puzzle Four][Puzzle Four:14]]
@set ornate door/traverse_msg = "You open the door, and see that the door exits next to the statue..."
# Puzzle Four:14 ends here
