blob: 32e3ce49c6e7811462a88ca4476f2992e3423306 (
plain)
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
27
28
29
30
|
from weatbag import words
class Tile:
def describe(self):
print("You are standing in the mouth of a cave. The air feels cool and "
"is filled with the stench of rotting flesh. "
"A dark path leads to the north. An exit to the south.")
def leave(self, player, direction):
if direction=='s':
return True
if player.has('flaming torch'):
return True
print("You can't explore the cave without being able to see. You'll need "
"that stalwart friend of the adventurer, the flaming torch.")
def action(self, player, do):
if (do[0] in words.use or do[0]=='light') and do[1]=='torch':
if player.has('unlit torch'):
player.take('unlit torch')
player.give('flaming torch')
print("The torch catches, casting a flickering light on the "
"cave walls.")
else:
print("Good plan, but you don't have a torch.")
else:
print("Sorry, I don't understand")
test_items = ['unlit torch']
|