diff options
| author | Thomas Kluyver <takowl@gmail.com> | 2013-04-24 14:31:55 -0700 |
|---|---|---|
| committer | Thomas Kluyver <takowl@gmail.com> | 2013-04-24 14:31:55 -0700 |
| commit | 0436b931c9941f5ac49198cffe4c88fd555ed67b (patch) | |
| tree | 19d5bff7af4d5f3ca080a60774eb374f959b806c /weatbag/tiles/s1e1.py | |
| parent | 32db2f567c844ece509a5001233606465474d18f (diff) | |
| parent | 871d2649c85c56c6b092cffa91a42e2a3210706d (diff) | |
Merge pull request #18 from lathan/bug_quest
Bug quest
Diffstat (limited to 'weatbag/tiles/s1e1.py')
| -rw-r--r-- | weatbag/tiles/s1e1.py | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py new file mode 100644 index 0000000..8a217e0 --- /dev/null +++ b/weatbag/tiles/s1e1.py @@ -0,0 +1,54 @@ +# First bug quest tile. +# +# To future hackers: +# This is part of a short quest which beggins by +# going South from e1. Plase consider this when coding neighbouring tiles. +# thnx :) +from weatbag import words +import weatbag + +class Tile: + def __init__(self): + self.bug_is_here = True + self.first_visit = True + self.hasnt_gone_south = True + pass + + def describe(self): + print("There is a stream here. " + "It runs from South to North.") + + if self.bug_is_here: + print("You see a huge, ugly bug rush past you, " + "following the river South.") + self.bug_is_here = False + else: + print("You remember this is where you saw that bug going South.") + + # Nothing to do here. + def action(self, player, do): + pass + + # Player can only exit the bug quest going back North. + # Player gets different messages the first time they + # exit this tile, depending on their direction. + def leave(self, player, direction): + restricted_directions = { 'w', 'e' } + if direction in restricted_directions: + print("The undergrowth in that direction " + "is impassable. You turn back.") + return False + elif direction == 's' and self.hasnt_gone_south: + print("Bugs are the enemy and must be crushed!\n" + "So you decide to follow the bug upstream.") + input() + self.first_visit = False + self.hasnt_gone_south = False + return True + else: + if self.first_visit: + print("Bugs do not interest you very much.\n" + "Lets get out of here.") + self.first_visit = False + input() + return True |
