blob: 5dabe3c27d6c7027b5700700fbb99cf9571c5e71 (
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
43
44
|
from weatbag import words
import weatbag
class Tile:
def __init__(self):
self.contents = {'bug': 1}
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.contents['bug'] > 0:
print("You see a huge, ugly bug rush past you, "
"following the river South.")
self.contents['bug'] -= 1
else:
print("You remember this is where you saw that bug going South.")
def action(self, player, do):
pass
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 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
|