Skip to content
Snippets Groups Projects
Commit 2d1c2b2b authored by AnAverageProgrammer99's avatar AnAverageProgrammer99
Browse files

Cannot attempt puzzles once completed

parent a9482a93
Branches
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -94,5 +94,5 @@ def decoder_puzzle():
correct = function_guessing()
decode()
return True
......@@ -3,9 +3,12 @@
from decoder import *
from gameparser import *
from items import *
from lightswitches import *
from map import rooms
from player import *
import lightswitches
decoder_complete = False
lights_complete = False
def check_complete(room):
......@@ -222,10 +225,14 @@ def execute_drop(item_id):
print("You cannot drop that")
def execute_puzzle():
global decoder_complete, lights_complete
if current_room["puzzle"] == "Decoder":
decoder_puzzle()
current_room["puzzle_complete"] = decoder_puzzle()
print(current_room["puzzle_complete"])
elif current_room["puzzle"] == "Lights":
lights.StartPuzzle()
def execute_command(command):
......@@ -257,15 +264,19 @@ def execute_command(command):
print("Drop what?")
elif command[0] == "attempt":
if len(command) > 1:
if len(command) > 1 and current_room["puzzle_complete"] == False:
execute_puzzle()
else:
print("This makes no sense.")
def puzzle_check():
if "puzzle_complete" in current_room:
if current_room["puzzle_complete"] == False and current_room["puzzle"] != False:
return True
else:
return False
def menu(exits, room_items, inv_items):
"""This function, given a dictionary of possible exits from a room, and a list
......
......@@ -108,8 +108,6 @@ class LightPuzzle:
self.solved = True
'''
def light_puzzle():
puzzle = LightPuzzle()
puzzle.StartPuzzle()'''
lights = LightPuzzle()
......@@ -13,6 +13,7 @@ south and east. The exit is to the west.""",
"exits": {"south": "Admins", "east": "Tutor", "west": "Parking"},
"items": [item_biscuits, item_handbook],
"puzzle": False,
"puzzle_complete": False,
}
room_admins = {
......@@ -46,6 +47,7 @@ general office.""",
"exits": {"east": "Office", "south": "Reception"},
"items": [],
"puzzle": False,
"puzzle_complete": False,
}
room_office = {
......@@ -57,6 +59,7 @@ Queen's Buildings.""",
"exits": {"west": "Parking"},
"items": [item_pen],
"puzzle": False,
"puzzle_complete": False,
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment