blob: 39f73e501bb04aeb35b962abf0412fcb8eeb2d06 (
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
|
from weatbag import words
from weatbag.utils import transfer
class Tile:
def __init__(self):
self.contents = {'berries': 1}
def describe(self):
print("The path crosses a small stream.")
if self.contents['berries']:
print("There are some berries hanging from a tree. "
"They look edible. "
"If you're hungry enough, anyway.")
def action(self, player, do):
if (do[0] in words.take) and ('berries' in do):
self.take_berries(player)
else:
print("Sorry, I don't understand.")
def take_berries(self, player):
if transfer('berries', self.contents, player.inventory):
print("Reaching up, you pick the berries.")
else:
print("There are no berries here.")
|