Remove time-based sea monster. Better error-handling
This commit is contained in:
@@ -6,51 +6,34 @@
|
||||
|
||||
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!",
|
||||
"The chest snaps open, releasing several huge air bubbles. You look into the chest and see something shining brightly from within, so bright you can't quite make out what it is."
|
||||
]
|
||||
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:",
|
||||
"You grab the treasure from the chest...it's so shiny! 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:",
|
||||
"Then get back to the surface. 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 .."
|
||||
]
|
||||
WRONG_CODE = [
|
||||
"nothing happens. Maybe next time."
|
||||
]
|
||||
|
||||
print_fancy(APPROACH_CHEST)
|
||||
guess = input(" > ")
|
||||
|
||||
if guess.strip() == SECRET:
|
||||
Path(CHEST_TIMER_FILE).write_text(datetime.now().isoformat())
|
||||
print_fancy(CHEST_OPENS)
|
||||
print_fancy(INSTRUCTIONS)
|
||||
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."])
|
||||
print_fancy(WRONG_CODE)
|
||||
|
Reference in New Issue
Block a user