Skip to content
Snippets Groups Projects
Commit ceb185d3 authored by Morgan Diment's avatar Morgan Diment
Browse files

adding drinking wine functionality

parent 2e29e2db
No related branches found
No related tags found
No related merge requests found
......@@ -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.")
......
......@@ -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
......@@ -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:
......
......@@ -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",
......
from items import *
from map import *
inventory = []
inventory = [item_key]
# Start game at the 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