From 347afb709024004608055b081fd9751cf54380db Mon Sep 17 00:00:00 2001
From: Lucas Von Mullen Brown <vonmullenbrownl@cardiff.ac.uk>
Date: Tue, 25 Oct 2022 15:19:42 +0000
Subject: [PATCH] time.sleep changes

---
 Group_game/game.py | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/Group_game/game.py b/Group_game/game.py
index 087769d..1aa12a9 100644
--- a/Group_game/game.py
+++ b/Group_game/game.py
@@ -13,6 +13,7 @@ global current_level
 gas_starttime = ""
 
 def list_of_items(items):
+    time.sleep(0.1)
     new_list = ""
     for number in range(len(items)):
         if number == len(items) - 1:
@@ -24,24 +25,30 @@ def list_of_items(items):
 
 
 def print_room_items(room):
+    time.sleep(0.8)
     if room["items"]:
         print("There is", list_of_items(room["items"]), "here." + "\n")
 
 
 def print_inventory_items(items):
+    time.sleep(0.1)
     if items:
         print("You have", list_of_items(items) + "." + "\n")
 
 
 def print_room(room):
+    time.sleep(0.5)
     # Display room name
     print()
     print(room["name"].upper())
     print()
+    time.sleep(1.2)
     # Display room description
     print(room["description"])
     print()
+    time.sleep(1.2)
     print_room_items(room)
+    time.sleep(0.5)
 
     #
     # COMPLETE ME!
@@ -49,15 +56,18 @@ def print_room(room):
 
 
 def exit_leads_to(exits, direction):
+    time.sleep(0.1)
     return locations[exits[direction]]["name"]
 
 
 def print_exit(direction, leads_to):
+    time.sleep(0.8)
     print("GO " + direction.upper() + " to " + leads_to + ".")
 
 
 def print_menu(exits, room_items, inv_items):
     global current_level
+    time.sleep(0.5)
     print("You can:")
     # Iterate over available exits
     for direction in exits:
@@ -65,48 +75,64 @@ def print_menu(exits, room_items, inv_items):
         print_exit(direction, exit_leads_to(exits, direction))
     for items in room_items:
         if items["pick-up"]:
+            time.sleep(0.8)
             print("TAKE", items["id"], "to take", items["name"] + ".")
 
     for items in inv_items:
+        time.sleep(0.8)
         print("DROP", items["id"], "to drop", items["name"] + ".")
     for items in inv_items:
         if "open" in items:
             if not items["open"]:
+                time.sleep(0.8)
                 print("OPEN", items["id"], "to open", items["name"] + ".")
     if not location_boileroom["valve_open"]:
+        time.sleep(0.8)
         print("CHECK TIMER to check the time remaining")
     if current_room == location_door and location_door["locked"]:
         if current_level == "level 1":
+            time.sleep(0.8)
             print("UNLOCK DOOR to attempt to unlock the escape door")
         else:
+            time.sleep(0.8)
             print("GO UPSTAIRS to go back to level 1")
     if item_note in inv_items:
+        time.sleep(0.8)
         print("READ NOTE to read the hidden note")
     if item_safe in room_items:
         if not item_safe["open"]:
+            time.sleep(0.8)
             print("OPEN SAFE to attempt to open the safe")
         else:
             "You've already opened the safe"
     if item_batteries in inventory and unpowered_torch in inventory:
+        time.sleep(0.8)
         print("USE BATTERIES for TORCH to place the batteries in the torch")
     # if item_batteries in inventory and item_lock in inventory:
     #     print("USE BATTERIES for LOCK to place the batteries in the torch")
     if (powered_torch in inv_items) or (unpowered_torch in inv_items):
+        time.sleep(0.8)
         print("USE TORCH to use your torch")
     if current_room == location_boileroom and location_boileroom["valve_open"]:
+        time.sleep(0.8)
         print("CLOSE valve to close the valve and stop the leakage")
     if location_boileroom["valve_open"]:
+        time.sleep(0.8)
         print("CHECK GAS TIMER to see how long left before the room fills with gas")
     if item_winebottle in inventory:
+        time.sleep(0.8)
         print('DRINK WINE to have a glass of wine')
+    time.sleep(0.8)
     print("What do you want to do?")
 
 
 def is_valid_exit(exits, chosen_exit):
+    time.sleep(0.1)
     return chosen_exit in exits
 
 
 def execute_go(direction):
+    time.sleep(0.1)
     global current_room
     if is_valid_exit(current_room["exits"], direction):
         new_room = move(current_room["exits"], direction)
@@ -117,6 +143,7 @@ def execute_go(direction):
 
 
 def execute_take(item_id):
+    time.sleep(0.1)
     found = False
     for items in current_room["items"]:
         if item_id == items["id"]:
@@ -131,6 +158,7 @@ def execute_take(item_id):
 
 
 def execute_drop(item_id):
+    time.sleep(0.1)
     found = False
     for items in inventory:
         if items["id"] == item_id:
@@ -143,6 +171,7 @@ def execute_drop(item_id):
 
 
 def time_taken():
+    time.sleep(0.1)
     current_time = datetime.now()
     time_taken = (current_time - start_time).total_seconds()
     minutes = time_taken // 60
@@ -152,6 +181,7 @@ def time_taken():
 
 
 def unlock_door():
+    time.sleep(0.2)
     global current_room
     global start_time
     minutes = time_taken()[0]
@@ -181,6 +211,7 @@ def unlock_door():
 
 
 def check_timer():
+    time.sleep(0.2)
     current_time = datetime.now()
     time_taken = current_time - start_time
     time_left = 1200 - time_taken.total_seconds()
-- 
GitLab