-
Notifications
You must be signed in to change notification settings - Fork 13
/
main_hall.py
94 lines (79 loc) · 4.07 KB
/
main_hall.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
class Main_Hall:
floor1_is_flooded = True
if floor1_1_flooded = True:
def __int__(self,global_state,inventory):
self.global_state = global_state
self.inventory = inventory
self.set_state()
self.description = "You are the end end of senior hall near the library. "
"To the north there are stairs leading down to the main hall which looks flooded, "
"to the south there is a door that leads to the ASL room, "
"to the west is the history hall, "
"to the east is the senior hall. Choose wisely..."
print(self.description())
self.run()
def run(self):
self.route(input(">>"))
def route(self,command):
if command in ["go north", "go south", "go east", "go west"]:
self.move(command.split(" ")[1])
else:
if command in ["Walk down stairs", "Enter stairs", "pass through stairs,"]:
print("You cannot enter! The water is too deep to pass!")
else:
print("What???")
self.run()
def move(self, direction):
for key in self.state.keys():
self.global_state[self.name+"_"+key] = self.state[key]
if direction == "north":
print("The stairs down to the art room seem to be flooded")
if direction == "west":
room = SeniorHall(self.global_state,self.inventory)
room.run()
if direction = "south":
print("The doors to the ASL room seem to be locked. "
"You look into the window but fail to see anything. "
"It's too dark.")
for it is too dark")
if direction = "east":
room = HistoryHall(self.global_state,self.inventory)
room.run()
elif floor1_is_flooded = False
def __int__(self,global_state,inventory):
self.global_state = global_state
self.inventory = inventory
self.set_state()
self.description = "You are the end end of senior hall near the library. "
"To the north there are stairs leading down to the main hall which looks flooded, "
"to the south there is a door that leads to the ASL room, "
"to the west is the history hall, "
"to the east is the senior hall. Choose wisely..."
print(self.description())
self.run()
def run(self):
self.route(input(">>"))
def route(self, command):
if command in ["go north", "go south", "go east", "go west"]:
self.move(command.split(" ")[1])
else:
if command in ["Walk down stairs", "Enter stairs", "pass through stairs,"]:
print("You are able to walk down the stairs and see that the main hall is no longer flooded")
else:
print("What???")
self.run()
def move(direction):
for key in self.state.kets():
self.global_state[self.name+"_"+key] = self.state[key]
if direction == "south":
print("You see the the main entrance. It looks locked")
if("Enter door", "Open door", "Pass through door")
print("You cannot go through this door")
if direction == "west":
room = EnglishHall(self.global_state,self.inventory)
room.run()
if direction = "north":
room = ArtRoom(self.global_state,self.inventory)
room.run()
if direction = "east":
print("Hmm...there is a giant hole in the middle of the floor...it's best that you dont pass through here...")