2020 True ),
2121
2222 'ruins' : Room ("Ancient Ruins" , """Smooth, mossy rocks are scattered about. Some are still loosely connected,
23- forming the remains of a circular tower. An engraved pedastel lies in the center of the tower.
24- On its surface is an oblong indentation.""" ,
23+ forming the remains of a circular tower. An engraved pedastel lies in the center of the tower.""" ,
2524 True ),
2625
2726 'forest' : Room ("Forest" , """Trees tower over your head and the floor is thick with underbrush.
8584 'gate' : LockedItem ('gate' , "A large, imposing wrought-iron gate. It's closed and locked." , False ),
8685 'river' : Item ('river' , "Shallow and rocky. The water foams and bubbles and it flows by." , False ),
8786 'waterfall' : Item ('waterfall' , "It's falling at a tremendous rate. It could crush you easily." , False ),
88- 'dam' : Item ('dam' , "Built from sticks and mud. Completely stopping up the river." , False )
87+ 'dam' : Item ('dam' , "Built from sticks and mud. Completely stopping up the river." , False ),
88+ 'pedastel' : LockedItem ('pedastel' , "It's covered in strange markings. On its surface is an oblong indentation." , False ),
8989}
9090
9191# Add items to rooms
9292
9393room ['shack' ].add_item (item ['wood' ])
9494room ['shack' ].add_item (item ['lantern' ])
9595room ['garden' ].add_item (item ['mushroom' ])
96+ room ['garden' ].add_item (item ['gate' ])
9697room ['coop' ].add_item (item ['egg' ])
9798room ['coop' ].add_item (item ['chicken' ])
9899room ['forest' ].add_item (item ['knife' ])
101102room ['river' ].add_item (item ['river' ])
102103room ['cliff' ].add_item (item ['waterfall' ])
103104room ['cave' ].add_item (item ['key' ])
105+ room ['ruins' ].add_item (item ['pedastel' ])
104106
105107# Add keys to locks
106108
107109item ['beaver' ].key = item ['flute' ]
108110item ['gate' ].key = item ['key' ]
111+ item ['pedastel' ].key = item ['egg' ]
109112
110113
111114# Define actions
@@ -160,6 +163,8 @@ def lily_beaver(self, lily, beaver):
160163
161164 def beaver_river (self , beaver , river ):
162165 self .player .current_room .add_item (beaver )
166+ beaver .is_gettable = False
167+ beaver .is_locked = False
163168 self .player .current_room .add_item (item ['dam' ])
164169 room ['cliff' ].remove_item (item ['waterfall' ])
165170 room ['cliff' ].s_to = room ['cave' ]
@@ -172,6 +177,31 @@ def beaver_river(self, beaver, river):
172177 display_string += "\n The dam completely blocks the flow of the river."
173178 print (display_string )
174179
180+ def key_gate (self , key , gate ):
181+ self .player .remove_item (key )
182+ gate .is_locked = False
183+ room ['garden' ].e_to = room ['ruins' ]
184+
185+ display_string = ""
186+ display_string += "\n You insert the key into the lock."
187+ display_string += "\n The gate swings open with a groan."
188+ print (display_string )
189+
190+ def egg_pedastel (self , egg , pedastel ):
191+ pedastel .is_locked = False
192+ self .player .remove_item (egg )
193+ self .player .current_room .add_item (egg )
194+
195+ display_string = ""
196+ display_string += "\n You insert the egg into the indentation on the pedastel."
197+ display_string += "\n Your hands glow blue for a few seconds, then return to normal."
198+ display_string += "\n The pedastel starts to vibrate, slowly at first, then faster and faster until"
199+ display_string += "\n it stops abruptly with the sound of a gong. You pick up the egg and gently tap"
200+ display_string += "\n the shell against the worn stone. A perfect hard boil. You groan."
201+ display_string += "\n \n You hate hard-boiled eggs."
202+ print (display_string )
203+
204+
175205
176206#
177207# Main
@@ -258,7 +288,7 @@ def main():
258288 player .drop_item (item [object_name ])
259289
260290 # look at item
261- elif verb == 'look' :
291+ elif verb == 'look' or verb == 'l' :
262292 player .look_item (item [object_name ])
263293
264294 # print error message if user enters invalid input
0 commit comments