summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKleopatra Angelidi <akleop@gmail.com>2013-05-14 04:00:08 +0300
committerKleopatra Angelidi <akleop@gmail.com>2013-05-14 04:00:08 +0300
commit69ef57ced38a1eb487e88fe0162f312d22369d1e (patch)
tree03338f27744364aaa0f5bb31ea1fff6c908bba25
parent8a3c4a270a36d8709948d27eec0bf7b74ef37a71 (diff)
added take_knife function (n3w5)
-rw-r--r--weatbag/tiles/n3w5.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/weatbag/tiles/n3w5.py b/weatbag/tiles/n3w5.py
index 7bfebe2..819fd77 100644
--- a/weatbag/tiles/n3w5.py
+++ b/weatbag/tiles/n3w5.py
@@ -11,7 +11,7 @@ class Tile:
"the ground.\n")
if not self.challenge_completed:
self.challenge()
- self.challenge_completed = True
+
def challenge(self):
print("You just steped into something different. It is a metal box and "
@@ -21,16 +21,24 @@ class Tile:
"-------\n"
"0_2345\n\n"
"You try to open the box but it won't open.\n"
- "Now obviously as you might have guessed already it is a magic "
- "box! If you *understand* what these carvings represend the box "
- "will open!")
+ "Now... as you might have guessed already, it is a magic box! "
+ "If you *understand* what these carvings represend the box will "
+ "open!")
# What the riddle says is "No one understands"
def action(self, player, do):
if do[0] == "no" and do[1] == "one" and do[2] == "understands":
print("And that is absolutely right!\n"
"The lid opens and you see a brand new army knife!")
+
+ elif (do[0] in words.take) and ('knife' in do):
+ self.take_knife(player, do)
+ self.challenge_completed = True
else:
print("Sorry, I don't understand.\n")
-
+ def take_knife(self, player, do):
+ if transfer('knife', self.contents, player.inventory):
+ print("You take the knife.\n")
+ else:
+ print("There is nothing here.\n")