summaryrefslogtreecommitdiffstats
path: root/weatbag/tiles/s2e1.py
blob: 78eddfb644c56df94ca45cc361195944e9373867 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Second and final bug quest tile.
#
# To future hackers:
# This is part of a short quest which begins by
# going South from e1. Plase consider this when coding neighbouring tiles.
# thnx :)
from weatbag import words

class Tile:
    def __init__(self):
        self.first_time = True

    def describe(self):
        print("You have reached upstream."
            "You see the bug.")

    def action(self, player, do):
        if ('bug' in do) and ( do[0] in words.attack or
                               do[0] in words.look or
                               do[0] == 'crush' or
                               do[0] == 'fix' ):
            print("Traceback (most recent call last):\n"
                "  File \"matrix.py\", line 97397, in <module>\n"
                "    main()\n"
                "  File \"slacking_off.py\", line 23934, in main\n"
                "    print(excuse[723])\n"
                "IndexError: list index out of range")
            input()
            if self.first_time == True:
                print("Suddenly, you realize!")
                self.first_time = False
                input()
            print("It's not a bug, it's a feature!")

    def leave(self, player, direction):
        restricted_directions = { 'w', 'e', 's' }
        if direction in restricted_directions:
            print("The undergrowth in that direction "
                "is impassable. You turn back.")
            return False
        else:
            return True