if "cat ears" in heldItems: catEars.get_interface() if "pocket knife" in heldItems: PocketKnife.get_interface() # This fuction checks the player's command and then runs the corresponding method def checkUserInput(current_room,command,heldItems): # Convert it to ALL CAPS command = command.upper() # All possible user input commands go here print("\n") # ********************************* SPECIAL USER INPUT ********************************* # If holding a special item, then check for that item's UI keywords with check_input() if "red flashlight" in heldItems and "RED FLASHLIGHT" in command: redFlashlight.check_input(command,heldItems,current_room) elif "yellow flashlight" in heldItems and "YELLOW FLASHLIGHT" in command: yellowFlashlight.check_input(command,heldItems,current_room) elif "cat ears" in heldItems and ("CAT EARS" in command or "COLOR WHEEL" in command): catEars.check_input(command) elif "pocket knife" in heldItems and "BLADE" in command: PocketKnife.check_input(command) # ********************************* USE, TAKE, DROP ********************************* # Use an item to fight an enemy elif "USE " in command and current_room.get_character() is not None: # command[4:] is used to get the characters typed after "USE " enemyHealth = current_room.character.fight(command[4:]) if enemyHealth < 1: print(current_room.character.name+" is dead") current_room.remove_character() # If the enemy is dead, then remove them from the room