generated from mwc/lab_terminal
Initial commit
This commit is contained in:
56
adventure/seafloor/coral_reef/chest.py
Normal file
56
adventure/seafloor/coral_reef/chest.py
Normal file
@@ -0,0 +1,56 @@
|
||||
# chest.py
|
||||
# --------
|
||||
# By MWC Contributors
|
||||
#
|
||||
# This is a Python program. You should run it by typing `python chest.py`.
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
from urllib.request import urlretrieve
|
||||
from threading import Timer
|
||||
from datetime import datetime
|
||||
import sys
|
||||
sys.path.append('../../..')
|
||||
from fancy_printing import print_fancy
|
||||
|
||||
CHEST_TIMER_FILE = ".timer"
|
||||
SECRET = "318"
|
||||
APPROACH_CHEST = [
|
||||
"You approach the chest and see that the lock is surprisingly free of rust. In fact, the code dials turn smoothly. Try entering a code."
|
||||
]
|
||||
CHEST_OPENS = [
|
||||
"The chest snaps open, releasing several huge air bubbles. You look into the chest and see..."
|
||||
]
|
||||
TREASURE = [
|
||||
"something shining brightly from within, so bright you can't quite make out what it is."
|
||||
]
|
||||
MONSTER1 = [
|
||||
"*rumble* *rumble* *rumble*",
|
||||
"Around the reef, nothing seems out of place."
|
||||
]
|
||||
MONSTER2 = [
|
||||
"*rumble* *rumble* *rumble*",
|
||||
"A SEA MONSTER APPEARS FROM THE REEF!",
|
||||
]
|
||||
INSTRUCTIONS = [
|
||||
"The sea monster must have seen you open the chest! There's no time to squander. You grab the treasure from the chest without taking a closer look! Quick, make a bag and store your treasure inside, using the following commands:",
|
||||
"mkdir bag",
|
||||
"mv treasure.jpg bag",
|
||||
"Then get back to the surface ASAP! Don't forget to take your treasure bag with you. Remember, `..` means 'the parent directory,' so these commands will move the bag to the parent directory and then move yourself:",
|
||||
"mv bag ../bag",
|
||||
"cd .."
|
||||
]
|
||||
|
||||
print_fancy(APPROACH_CHEST)
|
||||
guess = input(" > ")
|
||||
|
||||
if guess.strip() == SECRET:
|
||||
Path(CHEST_TIMER_FILE).write_text(datetime.now().isoformat())
|
||||
print_fancy(CHEST_OPENS)
|
||||
os.system('cp ./../../../.assets/fork.jpg treasure.jpg')
|
||||
Timer(1.0, print_fancy, [TREASURE]).start()
|
||||
Timer(5.0, print_fancy, [MONSTER1]).start()
|
||||
Timer(9.0, print_fancy, [MONSTER2]).start()
|
||||
Timer(13.0, print_fancy, [INSTRUCTIONS]).start()
|
||||
else:
|
||||
print_fancy(["nothing happens. Maybe next time."])
|
||||
23
adventure/seafloor/coral_reef/reef.txt
Normal file
23
adventure/seafloor/coral_reef/reef.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
You are standing at the edge of a beautiful coral reef. Schools of fish are
|
||||
swirling around you in every direction. In front of you is a deep chasm
|
||||
where you see larger fish sliding through the shadows. There is a chest
|
||||
half-buried in the seafloor.
|
||||
|
||||
|
||||
____...------------...____
|
||||
_.-"` /o/__ ____ __ __ __ \o\_`"-._
|
||||
.' / / \ \ '.
|
||||
|=====/o/======================\o\=====|
|
||||
|____/_/________..____..________\_\____|
|
||||
/ _/ \_ <_o#\__/#o_> _/ \_ \
|
||||
\________________\####/________________/
|
||||
|===\!/========================\!/===|
|
||||
| |=| .---. |=| |
|
||||
|===|o|=========/ \========|o|===|
|
||||
| | | \() ()/ | | |
|
||||
|===|o|======{'-.) A (.-'}=====|o|===|
|
||||
| __/ \__ '-.\uuu/.-' __/ \__ |
|
||||
|============= .'.'^'.'.=============|
|
||||
| _\o/ __ {.' __ '.} _ _\o/ _|
|
||||
|
||||
|
||||
7
adventure/seafloor/seafloor.txt
Normal file
7
adventure/seafloor/seafloor.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
After several moments of peaceful floating, you make a gentle landing on
|
||||
the seafloor, several hundered meters away from the sunken ship. You appear
|
||||
to be at the edge of a plateau whose edges are encrusted with beautiful
|
||||
corals.
|
||||
|
||||
Both sunken_ship and coral_reef are directories, so use the `cd` command
|
||||
to go into whichever one you want.
|
||||
25
adventure/seafloor/sunken_ship/galley/ghost.py
Normal file
25
adventure/seafloor/sunken_ship/galley/ghost.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# ghost.py
|
||||
# --------
|
||||
# By MWC Contributors
|
||||
#
|
||||
# This is a Python program. You can run it by typing `python ghost.py`
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
sys.path.append('../../../..')
|
||||
from fancy_printing import print_fancy
|
||||
|
||||
GHOST_GIVES_KEY = [
|
||||
"You enter the cramped galley and notice a sad, lonely ghost wandering around. You always wondered if you would be afraid of ghosts, but somehow this feels completely normal. The ghost begins to speak.",
|
||||
"'It has been a long while since I have seen anybody down here,' she says. 'I would like to give you a gift. Here's a key.'"
|
||||
]
|
||||
GHOST_IS_BORED = [
|
||||
"The ghost glances over at you. 'I hope you find some use for that key.'"
|
||||
]
|
||||
KEY = " Even in the faint light of your lamp, the key has a golden gleam.\n\n"
|
||||
|
||||
if Path("key.txt").exists():
|
||||
print_fancy(GHOST_IS_BORED)
|
||||
else:
|
||||
print_fancy(GHOST_GIVES_KEY)
|
||||
Path("key.txt").write_text(KEY)
|
||||
6
adventure/seafloor/sunken_ship/ship.txt
Normal file
6
adventure/seafloor/sunken_ship/ship.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
The sunken ship is lying on the seafloor at a slight angle. From the remains
|
||||
of its masts and rigging, you can tell it's from the age before ships were made
|
||||
of steel and powered by engines. You climb up in the deck, and see a large hole
|
||||
allowing access to the inner chambers. You flick on your suit's light and
|
||||
go inside.
|
||||
|
||||
26
adventure/seafloor/sunken_ship/stateroom/desk.py
Normal file
26
adventure/seafloor/sunken_ship/stateroom/desk.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# desk.py
|
||||
# --------
|
||||
# By MWC Contributors
|
||||
#
|
||||
# This is a Python program. You can run it by typing `python desk.py`
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
sys.path.append('../../../..')
|
||||
from fancy_printing import print_fancy
|
||||
|
||||
DESCRIPTION = [
|
||||
"The stateroom contains the ruins of an elegant office. Scraps of wallpaper are peeling from the wall; there is an eel living in the chandelier. There is a huge desk at the center of the room."
|
||||
]
|
||||
OPEN_DESK = [
|
||||
"You try your key in the desk drawer, and it clicks open. There are many decaying pieces of paper. One has the numbers 318 written in a fine script."
|
||||
]
|
||||
DESK_LOCKED = [
|
||||
"You try to open the desk's drawer, but it is firmly locked."
|
||||
]
|
||||
|
||||
print_fancy(DESCRIPTION)
|
||||
if Path("../galley/key.txt").exists():
|
||||
print_fancy(OPEN_DESK)
|
||||
else:
|
||||
print_fancy(DESK_LOCKED)
|
||||
Reference in New Issue
Block a user