Вот что мне нужно для сбора предметов:
Код: Выделить всё
if 'item' in inventory:
print('You already have the ', rooms[current_room]['item'])
player_move = input('Enter your move: ')
action = player_move.title().split()
print('-------------------')
elif action[1] == rooms[current_room]['item'] and 'item' not in inventory:
inventory.append(action[1])
print(rooms[current_room]['item'], 'retrieved')
player_move = input('Enter your move: ')
action = player_move.title().split()
print('-------------------')
Код: Выделить всё
if 'Villain' in rooms[current_room].keys():
if len(inventory) < 6:
print("You got caught before you could complete your mission! :(")
break
else:
print("You successfully infiltrated the company!")
break
Подробнее здесь: https://stackoverflow.com/questions/791 ... based-game