diff --git a/Group_game/game.py b/Group_game/game.py index 1aa12a90e48d3f605dfbbec06a9f037e77930a32..0d230453c7650c51456104d4b50bb9717146a3d5 100644 --- a/Group_game/game.py +++ b/Group_game/game.py @@ -122,6 +122,9 @@ def print_menu(exits, room_items, inv_items): if item_winebottle in inventory: time.sleep(0.8) print('DRINK WINE to have a glass of wine') + if powered_torch in inventory: + print("REMOVE BATTERIES from TORCH to remove the batteries from the torch") + time.sleep(0.8) time.sleep(0.8) print("What do you want to do?") @@ -171,7 +174,6 @@ 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 @@ -289,6 +291,20 @@ def execute_command(command): use_torch(current_room) else: print("use what?") + elif command[0] == "remove": + if len(command) > 1: + if command[1] == "batteries": + if len(command) > 2: + if command[2] == "torch": + remove_battery_torch() + elif command[2] == "lock": + "" # remove_battery_lock() + else: + print("remove batteries from what?") + elif command[1] == "torch": + use_torch(current_room) + else: + print("remove what?") elif command[0] == "drink": if command[1] == "wine": drink_wine() diff --git a/Group_game/level_1.py b/Group_game/level_1.py index 50d98ca3a73b74b53d8f3f5bfbcb5f84bf579a5b..5e53bf438a7037b750c6cf6f71c903734b1fc5e1 100644 --- a/Group_game/level_1.py +++ b/Group_game/level_1.py @@ -24,7 +24,12 @@ def open_safe(room_items): else: print("you try the code", passcode, "but the safe wouldn't open") print("TRY AGAIN") - +def remove_battery_torch(): + if powered_torch in inventory: + inventory.remove(powered_torch) + inventory.append(item_batteries) + inventory.append(unpowered_torch) + print("You removed the batteries from the torch") def use_battery_torch(): if item_batteries in inventory: @@ -33,9 +38,6 @@ def use_battery_torch(): inventory.remove(unpowered_torch) inventory.append(powered_torch) print("You placed the batteries in the torch.") - else: - print("You have no items in your inventory that uses a battery") - def use_torch(room): if powered_torch in inventory: diff --git a/Group_game/map.py b/Group_game/map.py index 2e4889a407c483d489599154c88f2ffb53bb4aa3..a70946ce06e3e7b41ffe02b41f7eb63997e24268 100644 --- a/Group_game/map.py +++ b/Group_game/map.py @@ -84,7 +84,7 @@ location_winecellar = { location_storage = { "name": "Storage Room", - "description": "(description needed)", + "description": "Boxes of computer parts are lying around scattered across the room. There's a closet across the other side of the room.", "exits": {"north": "closet", "east": "entrance"}, @@ -92,8 +92,8 @@ location_storage = { } location_boileroom = { "name": "Boiler Room", - - "description": "(description needed)", + + "description": "You immediately start hearing a high pitched hissing sound. You look around and see a valve needs to be closed. If only you had come sort of utensil to shut it.", "exits": {"north": "entrance"}, @@ -103,20 +103,20 @@ location_boileroom = { } desk = { "name": "desk", - "description": "(description needed)", + "description": "A computer is placed on the desk. There seems to be a game of hangman loaded. Do you wish to play it?", "exits": {"north-west": "entrance"}, "items": [] } trap_door = { "name": "trap door", - "description": "(description needed)", + "description": "You remove the carpet and try to pry open the door. It's locked. ", "exits": {"west": "entrance"}, "items": [] } closet = { "name": "closet", - "description": "(description needed)", - "exits": {}, + "description": "You walk up to the closet and try to open it however there's a battery powered lock preventing it from being opened", + "exits": {"south": "storage room"}, "items": [] } locations = {