(if: $key3 is true and (history:)'s last is not "south door")[Standing in the main room once more, you squint down at the new key. It bears not a word, but a symbol: a jagged line, like a representation of a lightning bolt.
(if: $searchsouth is true and $scuff is false)[[[Haven't I seen something like this before...?->south door]]
][[Enough of this sidequest! You head to the window->window]]
](else:)[This room has two doors and a window high up on the wall, too high for you to reach. You:
(unless: $key2 is true or $open is true)[(link-reveal-goto: "Open the north door", "north door")[(set:$look to false)]
](unless: $key2 is true)[(link-reveal-goto: "Open the south door", "south door")[(set:$look to false)]
](if: $ladder)[[[Use the ladder to reach the window->window]]
](if: $key1 and $ladder and ($searchsouth is false or $candle is false or $trapdoor is false))[(link-goto: "Search the rooms more thoroughly", "search")
](if: $scuff is true)[[[Return to the south room->south door]]
](if: $open is true and not $notrapdoor)[[[Return to the trapdoor->trapdoor open]]
](if: $giveup is true)[(if: (history:) contains "light" and does not contain "hole")[[[Return to the basement->light]]
](if: (history:) contains "hole" and does not contain "drop")[[[Return to the basement->hole]]
](if: (history:) contains "drop" and does not contain "deeper")[[[Return to the basement->drop]]
](if: $key3 is false and (history:) contains "deeper")[[[Return to the basement->deeper]]]]](if: $ladder is false)[This is a closet containing only a ladder. (set: $ladder to true)] (else:)[This is a closet that previously contained the ladder and nothing else.] (if: $look is true or $trapdoor is true)[At least, that's what you thought at first glance. A more thorough inspection reveals that the worn carpet is loose in one corner; you lift it up to uncover a padlocked trapdoor in the floor.(set: $trapdoor to true)]
(if: $key1 is true and $trapdoor is true)[(link: "Try the key in the trapdoor lock")[It fits! [[Open the trapdoor->trapdoor open]]]
](if: visits is 1)[[[Move the ladder to the main room->main]]
](else:)[[[Return to the main room->main]]](if: $searchsouth is true and $key3 is true and $scuff is false)[You return to the south room.](if: $key1 is false)[In this room there is a key hanging on a nail on the wall. Scrawled above it in red paint are the words //All is not as it appears...//(set: $key1 to true)] (else:)[This is the room where you found the key. A message scrawled on the wall reads //All is not as it appears...//] (if: $looksouth is true)[(set: $searchsouth to true)Searching the room reveals nothing else of note; it's simply a bare room with a cryptic message written on the mildly scuffed plaster walls. (if: $searchsouth is true and $key3 is true)[But one of the scuff marks looks a lot like the symbol on the key...(set: $scuff to true)]]
(if: $looksouth is false and $key3 is true)[(link-reveal-goto:"Take a closer look around the room", "south door")[(set: $looksouth to true)]
](if: $looksouth is true and $key3 is true)[[[Crouch to examine it more closely->secret]]
][(if: visits is 1)[[[Take the key and return to the main room->main]]
](else:)[[[Return to the main room->main]]]]Closed shutters on the outside block your view out the window. It's big enough for you to fit through(if: $unlock is false)[, but it's locked with a padlock.](else:)[, and it's now unlocked.]
(if: $key1 is true and $keytry is false)[(link: "Try the key from the south room in the lock")[This key does not fit. (set: $keytry to true)]
](if: $key2 is true and $unlock is false)[(link: "Try the basement key")[It fits! The window is now unlocked. [[Ready to go?->free]](set: $unlock to true)]
](if: $unlock is true)[ [[Ready to go?->free]]
](unless: $final is true)[[[Climb back down to the floor of the main room->main]]](set: $look to true)Where would you like to look?
(unless: $searchsouth is true)[(link-reveal-goto: "South door", "south door")[(set: $looksouth to true)]
](unless: $trapdoor is true)[[[North door->north door]]
](unless: $candle is true)[[[Main room->main room]]](set: $candle to true)Two doors, one window, a flickering flourescent light overhead with no obvious switch. A closer examination of the walls reveals a loose board; you pry it off and find a hole in the wall with a candle inside. (if: $descent is false)[You put in your pocket, because why not?] (if: $descent is true)[Perfect!]
[[Continue->main]](set: $open to true)(if: $key3 is true)[No reason to go back down there. (set: $notrapdoor to true)<br>](else:)[{(if: $descent is true)[You're standing outside the trapdoor again. ](else:)[The trapdoor now sits open. The light from the main room does little to illuminate whatever's inside.]} (if: $candle is true and $descent is false)[Your candle would be helpful, if you had something to light it with...]
{(if: $descent is false and $downladder is false)[[[Reach into the opening to feel for a way to get down->reach]]
](if: $giveup is true)[(if: (history:) contains "light" and does not contain "hole")[[[Climb back down->light]]
](if: (history:) contains "hole" and does not contain "drop")[[[Climb back down->hole]]
](if: (history:) contains "drop" and does not contain "deeper")[[[Return to the edge of the pit. You must satisfy your curiosity before you leave.->drop]]
](if: (history:) contains "deeper")[[[Return to the edge of the pit. You must satisfy your curiosity before you leave.->deeper]]
]](if: $descent is true and $key2 is false)[[[Climb back down->descend]]
](if: $descent is false and $downladder is true)[[[Climb down the ladder->descend]]]}
][[Return to the main room->main]](set: $candle to false)(set: $descent to false)(set: $trapdoor to false)(set: $searchsouth to false)(set: $downladder to false)(set: $ladder to false)(set: $key1 to false)(set: $key3 to false)(set: $tookit to false)(set: $note to false)(set: $keytry to false)(set: $looksouth to false) (set: $scuff to false)(set: $giveup to false)(set: $unlock to false)(set: $key2 to false)(set: $notrapdoor to false)(set: $downladder to true)Your hand finds only empty space at first — but then it hits the cold metal of a rung attached to the wall. Presumably there are more below it.
[[Descend->descend]]
[[You're not ready to climb down into the unknown yet. Return to the main room.->main]](set: $descent to true)You climb about 10 feet down, the air growing colder around you, until your feet touch solid floor. (if: visit is 1)[One of them also hits something that sounds like cardboard; when you reach down, you realize it's a matchbox with a few matches inside. (if: $candle is false)[These would be nice if you had something to light with them...]]
{(if: $candle is true)[[[Aha! You light the candle.->light]]<br>
[[You're not ready to explore the creepy basement yet. Climb back up.->trapdoor open]] ]
(if: $candle is false)[[[Slowly fumble your way through the dark. Who needs light?->dark]]<br>
[[Wandering in the dark is too scary, not to mention dangerous. Climb back up.->main]]]}
(set: $key2 to true)(set: $notrapdoor to true)(if: $giveup is true)[You're back in the basement, at the edge of the gaping pit.](else:)[It doesn't do much, but enough to see you're in a typical basement — except for the giant hole in the floor. You carefully step around it and get to the opposite wall, where another key hangs. It goes into your pocket with the first one.]
(link-reveal-goto: "Retrace your steps to the main room", "main")[(set: $giveup to true)]
[[Try to look into the hole->hole]]You feel your way forward... until the floor suddenly drops out from under you. You plunge, screaming, into an even deeper darkness.
**Game Over**
Restart
(click:"Restart")[(restart:)]The window opens, and cool night air drifts through the shutters. You push them open and crawl out.
**You're free!**
(if: $tookit is true or $note is true)[[[But that's not the end quite yet...->end]]
](else:)[Replay](click:"Replay")[(restart:)]You awaken on the floor of a bare room, with no memory of how you got here.
[[Stand up->main]](append: ?Sidebar)[**Menu**
(button:"=XXXXXX=")[[Items->items]]](set: $footer to false)(if: $key1 is true)[Key from south room
](if: $ladder is true)[Ladder
](if: $candle is true)[Candle
](if: $key2 is true)[Key from basement
](if: $descent is true)[Matches
](if: $key3 is true)[Key from pit
](unless: $key1 is true or $ladder is true)[None]
(button: "=XXXXXX=")[(link-reveal-goto: "Return", (history:)'s last)[(set: $footer to true)]]
**give sidebar back its footer tag if you want this to show**(if: $giveup is true and visits is >=2)[Once more you stand beside the spooky basement chasm.](else:)[You're curious how deep this hole is, and what's in it — could there be another exit this way? You kneel and hold the sputtering candle below the hole's edge, but all you can see is the jagged edges of broken concrete closest to you.]
(link-reveal-goto: "This is a waste of time. Go back to the main room", "main")[(set: $giveup to true)]
[[Light a match and drop it in the hole->drop]](if: visits is 1)[You could be about to cause a house fire... but you need to know what's down there, whether it's danger, a means of escape, or simply an empty pit. You drip a little wax on the floor and then stick your candle in it to free your hands to light a match. Once it's burning you let it fall, illuminating the hole's walls as it does. Unfortunately, it flickers out before it reaches the bottom, giving you no further insights.](else:)[You're back at the edge of the pit, its black mouth yawning before you.]
(if: $unlock is false)[(link-reveal-goto: "Time to go back up and try the window", "window")[(set: $giveup to true)]
](else:)[[[...Never mind, time to go->window]]
][[There's only one match left; might as well try one more time->deeper]]Somehow, this match makes it! It lies flickering at the bottom of the hole (which is about 20 feet down), illuminating something shiny... But before you can look closer and figure out what it is, the match winks out.
(link-reveal-goto: "Forget this, time to gtfo", "window")[(set: $final to true)]
[[Go get the ladder so you can climb down into the pit->pit quest]]Hauling the ladder down here is a bit cumbersome, but your curiosity must be sated. Finally, warm despite the chill of the basement air, you have the ladder positioned in the hole. All that's left to do is:
[[Climb down]](set: $key3 to true)With your trusty candle in one hand, you make your way down the ladder. The concrete gives way to dirt partway down, and the bottom of the pit is full of rubble and more dirt. Doesn't seem to be anything of interest... except for the shiny object. Another key. It looks like there's writing on it, but it's too hard to read by the weak candlelight.
[[Back up to the surface->main]](set: $final to true)This spot, you see now, is indented slightly from the rest. When you press your finger into the indentation, there's a grinding sound, startling you to your feet. Slowly, a portion of the wall detaches itself, sliding toward you, like a drawer. Inside the "drawer" is a locked compartment.
[[Try the key->treasure]]
[[This is too weird, time to go!->window]]The key turns in the lock with a click. You lift the lid of the box to reveal a (either: [small golden statue of a rat. (set: $treasure to true)], [coiled snake figurine with some sort of gemstones for scales.(set: $treasure to true)], [folded note. It reads: //Haha! You've solved my puzzles! Maybe next time I'll have to make them harder...//(set: $note to true)])
(if: $note is true)[[[Well, that's certainly creepy. Time to go!->window]]
] (if: $treasure is true)[(link-reveal-goto: "There's no way of knowing how valuable this is, but you might as well take it with you.", "window")[(set:$tookit to true)]
](if: $treasure is true)[(link-goto: "You're not going to steal from whoever's creepy dungeon this is. You leave the treasure and get going.", "window")](if: $treasure is true)[You make it home and when you get around to checking, you find that your little animal treasure is, apparently, worth something. But you're not sure if you actually want to sell it, or keep it as a souvenir. Or, perhaps, try to use it to track down whoever was running that escape-room dungeon...
](if: $note is true)[You make it home, and the next day you take some friends back to where the building you were entrapped in was. Except... it's not there? No, that can't be right. You must have gotten mixed up last night in the dark and remembered wrong. You never do manage to find it, though. And whenever you walk alone now, you get the feeling that someone is watching you...
]
**The end**
Replay(click:"Replay")[(restart:)](set: $looksouth to false)(set: $key3 to true)(set: $key1 to true)(set: $key2 to true)(set: $searchsouth to false)(set: $ladder to true)(set: $treasure to true)(set: $key1 to true)(set: $ladder to true)(set: $candle to true)(set: $trapdoor to true)(set: $open to true)(set: $notrapdoor to false)(set: $descent to true)(set: $key3 to false)(set: $key2 to true)(set: $notrapdoor to true)