Skip to content
Snippets Groups Projects
Commit 3e7e939d authored by Morgan Diment's avatar Morgan Diment
Browse files
parents a113316c 2af9004f
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ global current_level ...@@ -16,6 +16,7 @@ global current_level
gas_starttime = "" gas_starttime = ""
time_penalty = False time_penalty = False
def list_of_items(items): def list_of_items(items):
time.sleep(0.1) time.sleep(0.1)
new_list = "" new_list = ""
...@@ -381,7 +382,9 @@ def main(): ...@@ -381,7 +382,9 @@ def main():
if location_boileroom["valve_open"]: if location_boileroom["valve_open"]:
gastime = current_time - gas_starttime gastime = current_time - gas_starttime
gastime_left = 180 - gastime.total_seconds() gastime_left = 180 - gastime.total_seconds()
if gastime_left < 0: if time_penalty:
gastime_left = gastime_left - 300
if gastime_left <= 0:
print("OH NO! The floor was filled with gas and you died") print("OH NO! The floor was filled with gas and you died")
break break
# Display game status (room description, inventory etc.) # Display game status (room description, inventory etc.)
......
...@@ -12,7 +12,7 @@ item_safe = { ...@@ -12,7 +12,7 @@ item_safe = {
"name": "a secure safe", "name": "a secure safe",
"description": "(no description)", "description": "The safe seems to be locked, it looks like it needs a passcode to open it.",
"pick-up": False, "pick-up": False,
"open": False "open": False
...@@ -22,7 +22,7 @@ item_note = { ...@@ -22,7 +22,7 @@ item_note = {
"name": "a hidden note", "name": "a hidden note",
"description": "(no description)", "description": "You read the note and it seems to have some sort of puzzle on it.",
"pick-up": True "pick-up": True
} }
...@@ -48,7 +48,7 @@ powered_torch = { ...@@ -48,7 +48,7 @@ powered_torch = {
"name": "a torch with batteries", "name": "a torch with batteries",
"description": "(no description)", "description": "The torch is now functioning and able to light up dark areas.",
"pick-up": True "pick-up": True
} }
...@@ -58,7 +58,7 @@ item_diary = { ...@@ -58,7 +58,7 @@ item_diary = {
"name": "a personal diary", "name": "a personal diary",
"description": "(no description)", "description": "You've found a diary, you flip through some pages and read some interesting stories but you notice a note sticking out.",
"pick-up": True, "pick-up": True,
"open": False "open": False
} }
...@@ -67,7 +67,7 @@ item_screwdriver = { ...@@ -67,7 +67,7 @@ item_screwdriver = {
"name": "a screwdriver", "name": "a screwdriver",
"description": "()", "description": "You notice something shiny on the floor, it looks like a screwdriver, it may come in use later.",
"pick-up": True "pick-up": True
} }
item_winebottle = { item_winebottle = {
......
...@@ -69,10 +69,11 @@ def append_leaderboard(seconds_used,filename): #time_used = 20 minutes - time r ...@@ -69,10 +69,11 @@ def append_leaderboard(seconds_used,filename): #time_used = 20 minutes - time r
userinput = userinput.lower() userinput = userinput.lower()
if userinput == 'yes': if userinput == 'yes':
view_leaderboard(filename) view_leaderboard(filename)
print('Returning back to the game...')
elif userinput == 'no': elif userinput == 'no':
print("Continuing back into the game...") print("Continuing back into the game...")
print('Returning back to the game...')
#Returns back to game.py #Returns back to game.py
append_leaderboard(932, 'Times.csv')
...@@ -18,16 +18,19 @@ def open_diary(room_items): ...@@ -18,16 +18,19 @@ def open_diary(room_items):
def open_safe(room_items): def open_safe(room_items):
print("To open this safe you need a passcode.") print("To open this safe you need a passcode.")
time.sleep(0.8)
print("Please enter the passcode.") print("Please enter the passcode.")
passcode = input() passcode = input()
if passcode == "042": if passcode == "042":
print("THE PASSCODE WAS CORRECT!") print("THE PASSCODE WAS CORRECT!")
time.sleep(0.8)
print("Inside the safe you found a pair of batteries.") print("Inside the safe you found a pair of batteries.")
time.sleep(0.8) time.sleep(0.8)
room_items.append(item_batteries) room_items.append(item_batteries)
item_safe.update({"open": True}) item_safe.update({"open": True})
else: else:
print("You try the code", passcode, "but the safe wouldn't open.") print("You try the code", passcode, "but the safe wouldn't open.")
time.sleep(0.8)
print("TRY AGAIN.") print("TRY AGAIN.")
time.sleep(0.8) time.sleep(0.8)
...@@ -64,15 +67,21 @@ def use_torch(room): ...@@ -64,15 +67,21 @@ def use_torch(room):
time.sleep(0.8) time.sleep(0.8)
else: else:
print("You cannot do that") print("You cannot do that")
time.sleep(0.4)
def read_note(): def read_note():
if item_note in inventory: if item_note in inventory:
print("You read the note and notice a strange puzzle") print("You read the note and notice a strange puzzle")
time.sleep(0.8)
print("682 >> one digit is correct & well placed") print("682 >> one digit is correct & well placed")
time.sleep(0.8)
print("614 >> one digit is correct but wrong placed") print("614 >> one digit is correct but wrong placed")
time.sleep(0.8)
print("206 >> two numbers are correct but wrong placed") print("206 >> two numbers are correct but wrong placed")
time.sleep(0.8)
print("738 >> nothing is correct") print("738 >> nothing is correct")
time.sleep(0.8)
print("870 >> one number is correct but wrong placed") print("870 >> one number is correct but wrong placed")
time.sleep(5) time.sleep(5)
else: else:
......
...@@ -15,7 +15,9 @@ def drink_wine(): ...@@ -15,7 +15,9 @@ def drink_wine():
if counter < 1: if counter < 1:
time.sleep(1) time.sleep(1)
print('You drink a glass of the wine, but have not got much closer to getting the clue.') print('You drink a glass of the wine, but have not got much closer to getting the clue.')
time.sleep(0.8)
print('Would you like to drink another glass?') print('Would you like to drink another glass?')
time.sleep(0.8)
print('YES or NO') print('YES or NO')
more = str(input('> ')) more = str(input('> '))
if more == 'yes': if more == 'yes':
...@@ -27,7 +29,9 @@ def drink_wine(): ...@@ -27,7 +29,9 @@ def drink_wine():
time.sleep(1) time.sleep(1)
print() print()
print('You enjoy a second glass of wine, but can not see the bottom yet.') print('You enjoy a second glass of wine, but can not see the bottom yet.')
time.sleep(0.8)
print('Would you like to drink another glass?') print('Would you like to drink another glass?')
time.sleep(0.8)
print('YES or NO') print('YES or NO')
more = str(input('> ')) more = str(input('> '))
if more == 'yes': if more == 'yes':
...@@ -37,8 +41,14 @@ def drink_wine(): ...@@ -37,8 +41,14 @@ def drink_wine():
x = 2 x = 2
else: else:
time.sleep(1) time.sleep(1)
print() print(".")
time.sleep(0.2)
print(".")
time.sleep(0.2)
print(".")
time.sleep(0.2)
print('You pass out from too much alchohol consumption.') print('You pass out from too much alchohol consumption.')
time.sleep(0.8)
print('You wake up 5 minutes later on the floor of the wine cellar.') print('You wake up 5 minutes later on the floor of the wine cellar.')
time.sleep(1) time.sleep(1)
print('...') print('...')
...@@ -53,10 +63,13 @@ def close_valve(): ...@@ -53,10 +63,13 @@ def close_valve():
if location_boileroom["valve_open"]: if location_boileroom["valve_open"]:
location_boileroom["valve_open"] = False location_boileroom["valve_open"] = False
print("Well done! You stopped the leak!") print("Well done! You stopped the leak!")
time.sleep(0.8)
else: else:
print("Valve is closed") print("Valve is closed")
time.sleep(0.8)
else: else:
print("You need a screwdriver to close the valve") print("You need a screwdriver to close the valve")
time.sleep(0.8)
...@@ -66,10 +79,13 @@ def open_trapdoor(room): ...@@ -66,10 +79,13 @@ def open_trapdoor(room):
if key_card in inventory: if key_card in inventory:
trap_door["open"] = True trap_door["open"] = True
else: else:
time.sleep(0.8)
print("You need a key card to open the lock.") print("You need a key card to open the lock.")
else: else:
time.sleep(0.8)
print("The electrical lock requires batteries to open.") print("The electrical lock requires batteries to open.")
else: else:
time.sleep(0.8)
print("Command isn't available in this room") print("Command isn't available in this room")
...@@ -82,6 +98,7 @@ def use_battery_lock(room): ...@@ -82,6 +98,7 @@ def use_battery_lock(room):
time.sleep(1) time.sleep(1)
def gas_timer(timer): def gas_timer(timer):
time.sleep(0.8)
current_time = datetime.now() current_time = datetime.now()
time_taken = current_time - timer time_taken = current_time - timer
time_left = 180 - time_taken.total_seconds() time_left = 180 - time_taken.total_seconds()
......
from items import * from items import *
from map import * from map import *
inventory = [item_key] inventory = []
# Start game at the centre # Start game at the centre
current_room = locations["centre"] current_room = locations["centre"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment