diff --git a/Group_game/game.py b/Group_game/game.py index c778eb31d841894df6c69322a25335776b9732f7..087769dc702b0c15ffb2d023aa881985f77cbe7e 100644 --- a/Group_game/game.py +++ b/Group_game/game.py @@ -97,6 +97,8 @@ def print_menu(exits, room_items, inv_items): print("CLOSE valve to close the valve and stop the leakage") if location_boileroom["valve_open"]: print("CHECK GAS TIMER to see how long left before the room fills with gas") + if item_winebottle in inventory: + print('DRINK WINE to have a glass of wine') print("What do you want to do?") @@ -166,7 +168,7 @@ def unlock_door(): location_door["exits"].update({"upstairs": "entrance"}) current_room = locations["entrance"] start_time = datetime.now() - print("(introduction to level 2)") + print("You open the door and see a staircase. You decide to head up to the next level...") time.sleep(5) break @@ -256,6 +258,11 @@ def execute_command(command): use_torch(current_room) else: print("use what?") + elif command[0] == "drink": + if command[1] == "wine": + drink_wine() + else: + print("drink what?") else: print("This makes no sense.") diff --git a/Group_game/items.py b/Group_game/items.py index a9e0f19e6e5399b1b6a378f498b2dad81ac9cedc..edb8325dcd430431fef9c9613f464eede2573709 100644 --- a/Group_game/items.py +++ b/Group_game/items.py @@ -69,4 +69,14 @@ item_screwdriver = { "description": "()", "pick-up": True +} +item_winebottle = { + "id": "wine", + + "name": "the bottle of wine", + + "description": "()", + + "pick-up": True, + } \ No newline at end of file diff --git a/Group_game/level_2.py b/Group_game/level_2.py index 31462d4ab3bd545eb63a54bb0e3963371227c0d0..76e1ec04d331d26a1a53ae04767c509a42f9310a 100644 --- a/Group_game/level_2.py +++ b/Group_game/level_2.py @@ -5,23 +5,40 @@ from player import * from map import * from datetime import datetime from gameparser import * +import time -def drink_wine(time_taken): +def drink_wine(): + # need to add time deduction counter = 0 - while True: - if counter < 2: - print('You drink a glass of the wine, but still cannot see the clue.') + while counter < 3: + if counter < 1: + print('You drink a glass of the wine, but have not got much closer the clue.') print('Would you like to drink another glass?') + print('YES or NO') more = str(input()) if more == 'yes': counter += 1 - False + else: + counter = 3 + elif counter == 1: + print() + print('You enjoy a second glass of wine, but can not see the bottom yet.') + print('Would you like to drink another glass?') + print('YES or NO') + more = str(input()) + if more == 'yes': + counter += 1 + else: + counter = 3 else: + print() print('You pass out from too much alchohol consumption.') print('You wake up 5 minutes later on the floor.') - time_taken = time_taken - 360 - False + counter += 1 + time.sleep(5) + # time_taken = time_taken - 360 + def close_valve(): if item_screwdriver in inventory: diff --git a/Group_game/map.py b/Group_game/map.py index 2cef007ebc6b0fe9a1bc4e8785ef3147cc7421a7..2e4889a407c483d489599154c88f2ffb53bb4aa3 100644 --- a/Group_game/map.py +++ b/Group_game/map.py @@ -66,7 +66,7 @@ location_door = { location_entrance = { "name": "level 2 Entrance", - "description": "(description needed)", + "description": "You reach the top of the staircase, you're in a bright, cold room. You are surrounded by doors, and the only other thing in sight is a desk in the corner.", "exits": {"north": "wine cellar", "west": "storage room", "south": "boiler room", "east": "trap door", "south-east": "desk", "downstairs": "door"}, @@ -75,11 +75,11 @@ location_entrance = { location_winecellar = { "name": "Wine Cellar", - "description": "(description needed)", + "description": "The wine cellar is filled with old, dusty bottles of wine. One stands out, pick it up to take a look.", "exits": {"south": "entrance"}, - "items": [] + "items": [item_winebottle] } location_storage = { "name": "Storage Room", diff --git a/Group_game/player.py b/Group_game/player.py index e234b6c6bc15b6e8b34b6b171d6808712ce4809a..51d27083afc3190398dc693f358f0bf1940fa609 100644 --- a/Group_game/player.py +++ b/Group_game/player.py @@ -1,7 +1,7 @@ from items import * from map import * -inventory = [] +inventory = [item_key] # Start game at the centre current_room = locations["centre"]