diff options
Diffstat (limited to 'weatbag')
| -rw-r--r-- | weatbag/tiles/e1.py | 25 | ||||
| -rw-r--r-- | weatbag/tiles/n1.py | 8 | ||||
| -rw-r--r-- | weatbag/tiles/s1.py | 7 | ||||
| -rw-r--r-- | weatbag/tiles/w1.py | 16 |
4 files changed, 56 insertions, 0 deletions
diff --git a/weatbag/tiles/e1.py b/weatbag/tiles/e1.py new file mode 100644 index 0000000..909f1b3 --- /dev/null +++ b/weatbag/tiles/e1.py @@ -0,0 +1,25 @@ +from weatbag import words + +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 self.contents['berries'] > 0: + self.contents['berries'] -= 1 + player.give('berries') + print("Reaching up, you pick the berries.") + else: + print("There are no berries here.") diff --git a/weatbag/tiles/n1.py b/weatbag/tiles/n1.py new file mode 100644 index 0000000..1484ca4 --- /dev/null +++ b/weatbag/tiles/n1.py @@ -0,0 +1,8 @@ +class Tile: + def describe(self): + print("A path runs through dense jungle. To the north, you can see the " + "entrance to a cave.") + + def action(self, player, do): + # Nothing to do here yet. + print("Sorry, I don't understand") diff --git a/weatbag/tiles/s1.py b/weatbag/tiles/s1.py new file mode 100644 index 0000000..efdc041 --- /dev/null +++ b/weatbag/tiles/s1.py @@ -0,0 +1,7 @@ +class Tile: + def describe(self): + print("You push through the undergrowth - there's hardly a path here at all.") + + def action(self, player, do): + # Nothing to do here yet. + print("Sorry, I don't understand") diff --git a/weatbag/tiles/w1.py b/weatbag/tiles/w1.py new file mode 100644 index 0000000..6f9119e --- /dev/null +++ b/weatbag/tiles/w1.py @@ -0,0 +1,16 @@ +class Tile: + + def describe(self): + print("The trees open out onto a beautiful beach. Small waves lap at the " + "sand. Ahead of you, the ocean stretches as far as you can see.") + + def action(self, player, do): + # Nothing to do here yet. + print("Sorry, I don't understand") + + def leave(self, player, direction): + if direction=='w': + print("You've forgotten how to swim") + return False + return True + |
