diff options
| author | Thomas Kluyver <takowl@gmail.com> | 2013-04-30 10:15:21 -0700 |
|---|---|---|
| committer | Thomas Kluyver <takowl@gmail.com> | 2013-04-30 10:15:21 -0700 |
| commit | e8676fe2073467b093af0abc8ccb19443ed4ecb7 (patch) | |
| tree | c25d9794e1b8c77d70c2862f07f197fc0c69f067 /weatbag/tiles/n3w3.py | |
| parent | e3612c7544341abf9e84234d4bda5f65ce8ee47a (diff) | |
| parent | 3d626b5229add94f08acc3ae3731566507fc2f7e (diff) | |
Merge pull request #22 from ratmonkey/island_rebased
Island area
Diffstat (limited to 'weatbag/tiles/n3w3.py')
| -rw-r--r-- | weatbag/tiles/n3w3.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/weatbag/tiles/n3w3.py b/weatbag/tiles/n3w3.py new file mode 100644 index 0000000..d2977c4 --- /dev/null +++ b/weatbag/tiles/n3w3.py @@ -0,0 +1,34 @@ +from weatbag import words +from weatbag.utils import transfer + +class Tile: + def __init__(self): + self.contents = {'doorknob': 1} + + def describe(self): + if self.contents['doorknob']: + print("As you walk through the path you find something shiny on " + "the ground beside some rocks.\n" + "It looks like a brass doorknob.\n") + else: + print("There is nothing to do here, all you see is your path and " + "the trees around!\n") + def action(self, player, do): + if (do[0] in words.take) and ('doorknob' in do): + self.take_doorknob(player) + + else: + print("Sorry, I don't understand.\n") + + def take_doorknob(self, player): + if transfer('doorknob', self.contents, player.inventory): + print("You pick up the doorknob.\n") + else: + print("There is nothing here.\n") + + def leave(self, player, direction): + if direction == "n": + print("Oops! You can't go there. There is a rocky wall.\n") + return False + else: + return True |
