summaryrefslogtreecommitdiffstats
path: root/weatbag/tiles/e2.py
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2013-04-18 13:23:23 -0700
committerThomas Kluyver <takowl@gmail.com>2013-04-18 13:23:23 -0700
commit32db2f567c844ece509a5001233606465474d18f (patch)
tree71b0f86bb78aa06536090d54dc8125761781ff67 /weatbag/tiles/e2.py
parent26abad862afefb0e6c598719545572e187fa9033 (diff)
parenta0d1dc13e0923b12e8a9f21fcfa71165b333eb71 (diff)
Merge pull request #17 from lathan/master
Fixed bug in e2.py, Wrapped all lines in tiles longer than 79 characters to conform to PEP 8
Diffstat (limited to 'weatbag/tiles/e2.py')
-rw-r--r--weatbag/tiles/e2.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/weatbag/tiles/e2.py b/weatbag/tiles/e2.py
index ca66475..68798b3 100644
--- a/weatbag/tiles/e2.py
+++ b/weatbag/tiles/e2.py
@@ -25,7 +25,8 @@ class Tile:
if do[1] == "correctly":
print("You sly dog, you!")
print("The dwarf hands you a torch! "
- "He then suddenly vanishes, leaving behind a pile of dust.")
+ "He then suddenly vanishes, "
+ "leaving behind a pile of dust.")
self.contents['unlit torch'] -= 1
player.give('unlit torch')
return
@@ -40,12 +41,17 @@ class Tile:
print("You guessed my lucky number in %d guesses!" %
(self.guess_count))
print("The dwarf hands you a torch! "
- "He then suddenly vanishes, leaving behind a pile of dust.")
+ "He then suddenly vanishes, "
+ "leaving behind a pile of dust.")
self.contents['unlit torch'] -= 1
player.give('unlit torch')
except:
print("Please try guessing a number, like 'guess 7'.")
- elif (do[0] in words.take):
- print("You can't have my prize, you have to guess the lucky number!")
+
+ #if action is "take" AND there is still a dwarf around to complain,
+ #then complain.
+ elif (do[0] in words.take) and (self.contents['unlit torch'] == 1):
+ print("You can't have my prize, "
+ "you have to guess the lucky number!")
else:
print("Sorry, I don't understand.")