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/n2w4.py | |
| parent | e3612c7544341abf9e84234d4bda5f65ce8ee47a (diff) | |
| parent | 3d626b5229add94f08acc3ae3731566507fc2f7e (diff) | |
Merge pull request #22 from ratmonkey/island_rebased
Island area
Diffstat (limited to 'weatbag/tiles/n2w4.py')
| -rw-r--r-- | weatbag/tiles/n2w4.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/weatbag/tiles/n2w4.py b/weatbag/tiles/n2w4.py new file mode 100644 index 0000000..59904c2 --- /dev/null +++ b/weatbag/tiles/n2w4.py @@ -0,0 +1,44 @@ +from weatbag import words +from weatbag.utils import transfer + +class Tile: + def __init__(self): + self.opendoor = False + + def describe(self): + if self.opendoor: + print("The hut's door is open and the kitties are playing with " + "their momcat!\n") + else: + print("You are standing in front of the hut's door. The hut " + "looks very small and you wonder who could live here...\n" + "It has a door but you can't open it because the doorknob " + "is missing.\n") + + def action(self, player, do): + if (do[0] in words.use) and do[1]=='doorknob': + if player.has('doorknob'): + player.take('doorknob') + print("Doorknob fits fine, clicks and voila... Door is open!\n" + "\nYou are in a cozy living room with a cat and five " + "kittens resting on a couch.\n" + "There is another room to the west.\n") + self.opendoor = True + else: + print("You'll need a doorknob to open the door.\n") + self.opendoor = False + else: + print("Sorry, I don't understand.\n") + + def leave(self, player, direction): + if direction == 'w' and not self.opendoor: + print("First you need to enter the hut.\n") + return False + elif direction == 's': + print("Meeeeh, nothing of importance is going on there, try " + "another direction.\n") + return False + else: + return True + +test_items = ['doorknob'] |
