-
Notifications
You must be signed in to change notification settings - Fork 0
/
look.py
26 lines (24 loc) · 926 Bytes
/
look.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#1/usr/bin/python
from examine import examine
def look(commands, available_actions, player, room):
if len(commands) > 1:
examine(commands, available_actions, player, room)
else:
print "\t{}".format(room.intro_text())
room.intro_text()
if room.inventory:
for item in room.inventory:
print "\t{} is here.".format(item.name)
if hasattr(item, "opened") and item.opened:
if item.inventory:
print "\tIt contains:"
for sub_item in item.inventory:
print "\t\t{}".format(sub_item.name)
else:
print "\tIt is empty"
if room.npcs:
for npc in room.npcs:
print "\t{} is here.".format(npc.name)
room.exits_text(player)
# if __name__ == "__main__":
# trip()