From 383211be939a37f813a266e3c6309548749de763 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Sat, 5 Jan 2013 22:43:07 +0000 Subject: Add tile n2. Need to put in a flaming torch somewhere. --- weatbag/tiles/n2.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 weatbag/tiles/n2.py diff --git a/weatbag/tiles/n2.py b/weatbag/tiles/n2.py new file mode 100644 index 0000000..53257f6 --- /dev/null +++ b/weatbag/tiles/n2.py @@ -0,0 +1,25 @@ +from weatbag import words + +class Tile: + def describe(self): + print("You are standing in the mouth of a cave. The air feels cool.") + + def leave(self, player, direction): + if direction=='s': + return True + if player.has('flaming torch'): + return True + print("You can't explore the cave without being able to see. You'll need " + "that stalwart friend of the adventurer, the flaming torch.") + + def action(self, player, do): + if (do[0] in words.use or do[0]=='light') and do[1]=='torch': + if player.has('unlit torch'): + player.take('unlit torch') + player.give('flaming torch') + print("The torch catches, casting a flickering light on the " + "cave walls.") + else: + print("Good plan, but you don't have a torch.") + + print("Sorry, I don't understand") -- cgit v1.3