diff options
| author | Thomas Kluyver <takowl@gmail.com> | 2013-05-26 14:43:55 -0700 |
|---|---|---|
| committer | Thomas Kluyver <takowl@gmail.com> | 2013-05-26 14:43:55 -0700 |
| commit | 0f8ea0492007d5a330558665e00012b0b7b92fef (patch) | |
| tree | 7845c107d6bfe9def38fbbc4af13fa36d68d1c74 | |
| parent | 8cdd5546c6993898e6d319853ab6c7e639ab7bf0 (diff) | |
| parent | 74288b83d9e99f790ef4a96fe7bfc96814bcb3d6 (diff) | |
Merge pull request #24 from ratmonkey/kittens
Kittens
| -rw-r--r-- | weatbag/tiles/n1w1.py | 2 | ||||
| -rw-r--r-- | weatbag/tiles/n1w2.py | 25 | ||||
| -rw-r--r-- | weatbag/tiles/n1w3.py | 23 | ||||
| -rw-r--r-- | weatbag/tiles/n1w4.py | 73 | ||||
| -rw-r--r-- | weatbag/tiles/n1w5.py | 48 | ||||
| -rw-r--r-- | weatbag/tiles/n1w6.py | 21 | ||||
| -rw-r--r-- | weatbag/tiles/n2w1.py | 10 | ||||
| -rw-r--r-- | weatbag/tiles/n2w2.py | 5 | ||||
| -rw-r--r-- | weatbag/tiles/n2w3.py | 4 | ||||
| -rw-r--r-- | weatbag/tiles/n2w4.py | 6 | ||||
| -rw-r--r-- | weatbag/tiles/n2w5.py | 4 | ||||
| -rw-r--r-- | weatbag/tiles/n2w6.py | 25 | ||||
| -rw-r--r-- | weatbag/tiles/n3w1.py | 4 | ||||
| -rw-r--r-- | weatbag/tiles/n3w2.py | 6 | ||||
| -rw-r--r-- | weatbag/tiles/n3w3.py | 4 | ||||
| -rw-r--r-- | weatbag/tiles/n3w4.py | 14 | ||||
| -rw-r--r-- | weatbag/tiles/n3w5.py | 57 | ||||
| -rw-r--r-- | weatbag/tiles/n3w6.py | 22 | ||||
| -rw-r--r-- | weatbag/tiles/n4w5.py | 20 | ||||
| -rw-r--r-- | weatbag/tiles/n4w6.py | 20 | ||||
| -rw-r--r-- | weatbag/tiles/n4w7.py | 54 | ||||
| -rw-r--r-- | weatbag/tiles/n5w5.py | 52 | ||||
| -rw-r--r-- | weatbag/tiles/n5w6.py | 16 | ||||
| -rw-r--r-- | weatbag/tiles/n5w7.py | 96 |
24 files changed, 580 insertions, 31 deletions
diff --git a/weatbag/tiles/n1w1.py b/weatbag/tiles/n1w1.py index f809dc4..b4f1252 100644 --- a/weatbag/tiles/n1w1.py +++ b/weatbag/tiles/n1w1.py @@ -12,7 +12,7 @@ class Tile: def leave(self, player, direction): if direction == "w": print ("You can't go there by swimming, that part is full of " - "electric eels.\n") + "electric eels.") return False else: return True diff --git a/weatbag/tiles/n1w2.py b/weatbag/tiles/n1w2.py new file mode 100644 index 0000000..e517ca3 --- /dev/null +++ b/weatbag/tiles/n1w2.py @@ -0,0 +1,25 @@ +class Tile: + map_word = "Island beach" + + def describe(self): + print("The beach is really quiet and you can hear and see the seagulls " + "on the sea.\n") + + def action(self, player, do): + print("What is this gibberish?") + + def leave(self, player, direction): + if direction == "e": + print("You can't go back by swimming, that part is full of " + "electric eels.\n") + return False + elif direction == "s": + print("I'm afraid I can't let you go there Dave.") + return False + elif direction == "w": + print("The sandy beach is transforming into big rocks but it looks " + "like you are able to climb them.\n" + "Just be careful because they are a bit slipery.") + return True + else: + return True diff --git a/weatbag/tiles/n1w3.py b/weatbag/tiles/n1w3.py new file mode 100644 index 0000000..5d63235 --- /dev/null +++ b/weatbag/tiles/n1w3.py @@ -0,0 +1,23 @@ +class Tile: + map_word = "Beach rocks" + + def describe(self): + print("Woooah! Those rocks are full of lichens!\n") + + def action(self, player, do): + print("Sorry, I don't speak gibberish.") + + def leave(self, player, direction): + if direction == "s": + print("Are you planing to throw your self to the rocks? You can't " + "go there!") + return False + elif direction == "n": + print("The rocks are way to high for you. " + "Unfortunately you cannot climb them.") + return False + elif direction == "w": + print("The rocks led you to a path uphill.") + return True + else: + return True diff --git a/weatbag/tiles/n1w4.py b/weatbag/tiles/n1w4.py new file mode 100644 index 0000000..6dfdde7 --- /dev/null +++ b/weatbag/tiles/n1w4.py @@ -0,0 +1,73 @@ +from weatbag.utils import transfer + +class Tile: + map_word = "Persian cat" + + def __init__(self): + self.contents = {'neko': 1} + self.challenge_completed = False + self.sequence = "1113213211" + + def describe(self): + if not self.challenge_completed: + print("*Poof* A purrr-sian cat appears in front of you!\n") + self.challenge() + else: + print("Some pawprints on the ground probably from the persian cat " + "you encountered earlier.\n" + "It's a little bit windy and a flock of seagulls is flying " + "above you.\n") + + def challenge(self): + print("Meow good traveler! I have a question for you.\n" + "You might as well go away and ignore me and my awesome fur but " + "if you pass my little test I will reward you!\n\n" + "Here is a series of numbers.\n" + "What is the next number in the sequence?\n" + "1\n" + "11\n" + "21\n" + "1211\n" + "111221\n" + "312211\n" + "13112221\n") + #The next number in the sequence is 1113213211, because the rule for + #creating the next number is to simply describe the previous number. + #The first number is 1, or 1 (one) 1, so you get 11. + #To describe 11, you have two 1's, or 21. Now you have one 2 and one 1, + #so the next number is 1211. The solution is to simply continue + #describing the previous number using only numbers.\n") + + def action(self, player, do): + if not self.challenge_completed: + if do[0] == self.sequence: + print("You are a clever human, aren't you?!\n\n" + "Here is my offering. I give you this maneki-neko.\n" + "If you ever come across a wall of kittens and you want " + "them to let you pass you will use this lucky charm!\n\n" + "And as the cat says these words, " + "*poof* she disappears!") + #https://en.wikipedia.org/wiki/Maneki-neko + self.contents['neko'] -= 1 + player.give('neko') + self.challenge_completed = True + else: + print("Wut? Try h4rd3r st00p3d hum4n!") + else: + print("I don't understand...") + + def leave(self, player, direction): + if direction == "s": + print("Oh dear Basdet! You can't go south, you will fall of the " + "cliff!") + return False + elif direction == "n": + print("It looks like the side of a wooden hut.\n" + "Since you don't walk though walls (yet) " + "you can't go there.") + return False + elif direction == "e": + print("You follow the path downhill.") + return True + else: + return True diff --git a/weatbag/tiles/n1w5.py b/weatbag/tiles/n1w5.py new file mode 100644 index 0000000..634b4f7 --- /dev/null +++ b/weatbag/tiles/n1w5.py @@ -0,0 +1,48 @@ +from weatbag import words +from weatbag.utils import transfer + +class Tile: + map_word = "Mouse traps" + + def __init__(self): + self.contents = {'mice': 2} + + def describe(self): + if self.contents['mice']: + print("As you walk the rocky path at the edge of the cliff you " + "hear a squeaking sound and you notice two mouse traps on " + "the ground. Each has one mouse trapped inside.\n" + "You could take the silly rodents but really... what the " + "hell are you gonna do with them?\n") + else: + print("You walk the path at the edge of the cliff. Nothing " + "to do here.\n") + + def action(self, player, do): + if (do[0] in words.take) and ('mice' in do): + self.take_mice(player) + else: + print("Sorry, I don't understand.") + + def take_mice(self, player): + if transfer('mice', self.contents, player.inventory, n=2): + print("Ok then. You took the mice.\n") + else: + print("No more mice for now. Got to leave the traps do their " + "job.\n") + + def leave(self, player, direction): + if direction == "s": + print("My dear traveler, you can't go south, you will fall off the " + "cliff!") + return False + elif direction == "n": + print("It looks like the side of a wooden hut.\n" + "Since you don't walk though walls (yet) " + "you can't go there.") + return False + elif direction == "e": + print("You follow the path downhill.") + return True + else: + return True diff --git a/weatbag/tiles/n1w6.py b/weatbag/tiles/n1w6.py new file mode 100644 index 0000000..78528ff --- /dev/null +++ b/weatbag/tiles/n1w6.py @@ -0,0 +1,21 @@ +class Tile: + map_word = "Top cliff" + + def describe(self): + print("You have reached the top of the cliff! You feel the fresh " + "breeze in your face and you smell the salty sea! The view and " + "the weather here are wonderful! You'd like to stay but the " + "adventure spirit shakes you and you're on the move again.\n" + "So which way?\n") + + def action(self, player, do): + print("Sorry, I don't understand.") + + def leave(self, player, direction): + if direction in ('s', 'w'): + print("My dear traveler, you can't go there, you will fall of the " + "cliff!") + return False + elif direction in('e', 'n'): + print("You follow the path downhill.") + return True diff --git a/weatbag/tiles/n2w1.py b/weatbag/tiles/n2w1.py index 00198a8..9be8cdc 100644 --- a/weatbag/tiles/n2w1.py +++ b/weatbag/tiles/n2w1.py @@ -36,11 +36,11 @@ class Tile: print("Your answer has pleased me and my sister! " "\nLet's go!") print("The brother and sister will take you to the " - "island.\n") + "island.") self.challenge_completed = True else: print("We're afraid this is not the correct answer. " - "Try another one.\n") + "Try another one.") elif (do[0] in words.take) and (do[1] == "sister" or do[1] == "girl"): print("You bastard! Let my sister down!\n" @@ -48,14 +48,14 @@ class Tile: "Taking advantage of little children?\n" "We will transport you for free.\n") print("The brother and sister will take you " - "to the island!\n") + "to the island!") self.challenge_completed = True elif (do[0] in words.take) and (do[1] == "brother" or do[1] == "boy"): print("You bastard, put me down!\n" "We will trasnport you for free!\n") print("The brother and sister will take you " - "to the island!\n") + "to the island!") self.challenge_completed = True elif (do[0] in words.take) and not self.challenge_completed: print("I told you we won't give you our raft, " @@ -68,7 +68,7 @@ class Tile: def leave(self, player, direction): if direction == "w" and not self.challenge_completed: print ("You can't go there by swimming, that part is full of " - "electric eels.\n") + "electric eels.") return False else: return True diff --git a/weatbag/tiles/n2w2.py b/weatbag/tiles/n2w2.py index 010ff0e..35897c3 100644 --- a/weatbag/tiles/n2w2.py +++ b/weatbag/tiles/n2w2.py @@ -26,10 +26,7 @@ class Tile: def leave(self, player, direction): if direction == "e": print("You can't go back by swimming, that part is full of " - "electric eels.\n") - return False - elif direction == "s": - print("I'm afraid I can't let you go there Dave.\n") + "electric eels.") return False else: return True diff --git a/weatbag/tiles/n2w3.py b/weatbag/tiles/n2w3.py index 2030fea..4e6707b 100644 --- a/weatbag/tiles/n2w3.py +++ b/weatbag/tiles/n2w3.py @@ -20,8 +20,8 @@ class Tile: def leave(self, player, direction): if direction == "s": - print("STAHP! Hammer Time!\n(Meaning you just can't go to that " - "direction yet. Sorry! :))\n") + print("Careful now! Nasty rocks all over to the south.\n" + "(Meaning you just can't go to that direction. Sorry!)") return False else: return True diff --git a/weatbag/tiles/n2w4.py b/weatbag/tiles/n2w4.py index 59904c2..c14bffb 100644 --- a/weatbag/tiles/n2w4.py +++ b/weatbag/tiles/n2w4.py @@ -28,15 +28,15 @@ class Tile: print("You'll need a doorknob to open the door.\n") self.opendoor = False else: - print("Sorry, I don't understand.\n") + print("Sorry, I don't understand.") def leave(self, player, direction): if direction == 'w' and not self.opendoor: - print("First you need to enter the hut.\n") + print("First you need to enter the hut.") return False elif direction == 's': print("Meeeeh, nothing of importance is going on there, try " - "another direction.\n") + "another direction.") return False else: return True diff --git a/weatbag/tiles/n2w5.py b/weatbag/tiles/n2w5.py index 12ae7d2..d6d3efa 100644 --- a/weatbag/tiles/n2w5.py +++ b/weatbag/tiles/n2w5.py @@ -17,7 +17,7 @@ class Tile: if (do[0] in words.take) and ('catfood' in do): self.take_catfood(player) else: - print("Sorry, I don't understand.\n") + print("Sorry, I don't understand.") def take_catfood(self, player): if transfer('catfood', self.contents, player.inventory, n=2): @@ -27,7 +27,7 @@ class Tile: def leave(self, player, direction): if direction == 'w'or direction == 's' or direction == 'n': - print("Area 51. No trespassing beyond this point.\n") + print("I don't think you can pass through walls.") return False else: return True diff --git a/weatbag/tiles/n2w6.py b/weatbag/tiles/n2w6.py new file mode 100644 index 0000000..15a3cf6 --- /dev/null +++ b/weatbag/tiles/n2w6.py @@ -0,0 +1,25 @@ +class Tile: + map_word = "Cliff" + + def describe(self): + print("Big rocks around the place, and the sound of small waves at the " + "western sea makes you calm! \n") + + def action(self, player, do): + print("Sorry, I don't understand.") + + def leave(self, player, direction): + if direction == "w": + print("My dear traveler, you can't fall off the cliff! " + "I won't let you do it.") + return False + elif direction == "e": + print("It looks like the back of a wooden hut.\n" + "Since you don't walk through walls (yet) " + "you can't go there.") + return False + elif direction == "s": + print("You follow the path uphill.") + return True + else: + return True diff --git a/weatbag/tiles/n3w1.py b/weatbag/tiles/n3w1.py index 98877eb..922ec4a 100644 --- a/weatbag/tiles/n3w1.py +++ b/weatbag/tiles/n3w1.py @@ -8,7 +8,7 @@ class Tile: def leave(self, player, direction): if direction == 'w': print("I'm afraid you can't go west.\nThe sea on that part is " - "full of electric eels and you don't have a transport.\n") + "full of electric eels and you don't have a transport.") return False elif direction == 'e': print("There's a steep mountainside here which you can't climb.") @@ -36,6 +36,6 @@ class Tile: " '-...-' '-...-' \n") print("A wall of kitties doesn't allow you to go North.\n" "But that doesn't make you mad... " - "You can't be mad at kitties, rite?!\n") + "You can't be mad at kitties, rite?!") return False return True diff --git a/weatbag/tiles/n3w2.py b/weatbag/tiles/n3w2.py index 9ff35a5..d4300b5 100644 --- a/weatbag/tiles/n3w2.py +++ b/weatbag/tiles/n3w2.py @@ -35,16 +35,16 @@ class Tile: elif len(do) > 1: print("I have no use for that.\n") else: - print("Sorry, I don't understand.\n") + print("Sorry, I don't understand.") def leave(self, player, direction): if direction == 'e'and not self.give_catfood: print("You can't swim, remember the electric eels? You need a " - "transport to go across.\n") + "transport to go across.") return False if direction == 'n': - print("Nothing to do there.\n") + print("Nothing to do there.") return False else: return True diff --git a/weatbag/tiles/n3w3.py b/weatbag/tiles/n3w3.py index d2977c4..f0bcce5 100644 --- a/weatbag/tiles/n3w3.py +++ b/weatbag/tiles/n3w3.py @@ -18,7 +18,7 @@ class Tile: self.take_doorknob(player) else: - print("Sorry, I don't understand.\n") + print("Sorry, I don't understand.") def take_doorknob(self, player): if transfer('doorknob', self.contents, player.inventory): @@ -28,7 +28,7 @@ class Tile: def leave(self, player, direction): if direction == "n": - print("Oops! You can't go there. There is a rocky wall.\n") + print("Oops! You can't go there. There is a rocky wall.") return False else: return True diff --git a/weatbag/tiles/n3w4.py b/weatbag/tiles/n3w4.py index aeb58f9..cc286bd 100644 --- a/weatbag/tiles/n3w4.py +++ b/weatbag/tiles/n3w4.py @@ -1,17 +1,17 @@ class Tile: def describe(self): - print("Looks like you are in a walking mood because you still follow " - "the path.\nYou hear birds singing, some small waves on the " - "background, there is a nice flowery smell, rays of sun make the " - "tree sceenery heavenly...\n" + print("Looks like you are in a walking mood!\n" + "You hear birds singing, some small waves on the background, " + "there is a nice flowery smell, rays of sun make the tree " + "scenery heavenly...\n" "I totaly get you, it's a nice path to have a walk!\n") def action(self, player, do): - print("Sorry, I don't understand.\n") + print("Sorry, I don't understand.") def leave(self, player, direction): - if direction in ('n', 'w'): - print("No trespasing. Violators will vanish without a trace.\n") + if direction == "n": + print("No trespasing. Violators will vanish without a trace.") return False else: return True diff --git a/weatbag/tiles/n3w5.py b/weatbag/tiles/n3w5.py new file mode 100644 index 0000000..eec9779 --- /dev/null +++ b/weatbag/tiles/n3w5.py @@ -0,0 +1,57 @@ +from weatbag import words +from weatbag.utils import transfer + +class Tile: + map_word = "Box riddle" + + def __init__(self): + self.contents = {'knife': 1} + self.challenge_completed = False + + def describe(self): + print("Your feet make a crackling sound as your feet snap some twigs " + "on the ground.") + if not self.challenge_completed: + self.challenge() + elif self.challenge_completed and self.contents["knife"]>0: + print("You look around and you see an open box with a knife " + "inside. You should probably take it. A knife can be usefull.") + + def challenge(self): + print("You just steped into something different. It is a metal box and " + "it looks like something is written on it. You clear the dirt " + "off it and what you see carved in the box lid is:\n\n" + "stands\n" + "-------\n" + "0_2345\n\n" + "You try to open the box but it won't open.\n" + "Now... as you might have guessed already, it is a magic box!\n" + "If you *understand* what these carvings represent the box will " + "open!\n") + # What the riddle says is "No one understands" + + def action(self, player, do): + if do == ["no", "one", "understands"]: + print("And that is absolutely right!\n" + "The lid opens and you see a brand new army knife!\n") + self.challenge_completed = True + + elif ((do[0] in words.take) and ('knife' in do) + and self.challenge_completed): + self.take_knife(player, do) + else: + print("Sorry, I don't understand.") + + def take_knife(self, player, do): + if transfer('knife', self.contents, player.inventory): + print("You put the knife in your bag.\n") + else: + print("There is nothing here.\n") + + def leave(self, player, direction): + if direction == "s": + print("You can't go there, it's a wall. It looks like the side of " + "a wooden hut.") + return False + else: + return True diff --git a/weatbag/tiles/n3w6.py b/weatbag/tiles/n3w6.py new file mode 100644 index 0000000..7877139 --- /dev/null +++ b/weatbag/tiles/n3w6.py @@ -0,0 +1,22 @@ +class Tile: + map_word = "Beach rocks" + + def describe(self): + print("Rocks. Big rocks. Slippery rocks all over!\n") + + def action(self, player, do): + print("Sorry, I don't understand.") + + def leave(self, player, direction): + if direction == "w": + print("No-no! You'll break your head on the rocks down there!") + return False + elif direction == "s": + print("You follow the path uphill. Just be careful of the slippery " + "rocks.") + return True + elif direction == "n": + print("You are almost down at the beach.") + return True + else: + return True diff --git a/weatbag/tiles/n4w5.py b/weatbag/tiles/n4w5.py new file mode 100644 index 0000000..8308503 --- /dev/null +++ b/weatbag/tiles/n4w5.py @@ -0,0 +1,20 @@ +class Tile: + map_word = "Pine forest" + + def describe(self): + print("There are not so many trees around but the ground is full of " + "pine needles and pine cones.\n") + + def action(self, player, do): + print("I don't understand.") + + def leave(self, player, direction): + if direction == "e": + print("Area 51. No trespassing beyond this point.") + return False + elif direction == "n": + print("There is an opening that leads you to the beach on the " + "northen side of the island.") + return True + else: + return True diff --git a/weatbag/tiles/n4w6.py b/weatbag/tiles/n4w6.py new file mode 100644 index 0000000..0f2c508 --- /dev/null +++ b/weatbag/tiles/n4w6.py @@ -0,0 +1,20 @@ +class Tile: + map_word = "Beach curve" + + def describe(self): + print("The beach makes a nice little curve on that spot. There are " + "some pine trees around too. A really quiet sceenery!\n") + + def action(self, player, do): + print("Sorry, I don't understand.") + + def leave(self, player, direction): + if direction == "s": + print("You follow the path uphill. There are some rocks. Just be " + "careful, they all have this gooey green stuff on them!") + return True + elif direction == "e": + print("You are going through the pine trees.") + return True + else: + return True diff --git a/weatbag/tiles/n4w7.py b/weatbag/tiles/n4w7.py new file mode 100644 index 0000000..bc582bb --- /dev/null +++ b/weatbag/tiles/n4w7.py @@ -0,0 +1,54 @@ +from weatbag import words +from weatbag.utils import transfer + +class Tile: + map_word = "Kitties" + + def __init__(self): + self.challenge_completed = False + + def describe(self): + print("The only thing around this place is sand, small rocks, the " + "beach waters, about a dozen of kitties playing around and " + "a lighthouse on the north.\n") + if not self.challenge_completed: + self.kitties() + + + def kitties(self): + print("You approach the kitties and to your surprise they all start " + "rubbing at your legs and mewing! What is even more surprising " + "is that your brain understands and translates meaws into " + "words!\n" + "You can clearly hear them say:\n" + "'PLZ SIR, IT VRY HAWT HEER, CAN U TREAT US SUM MICE CREAM?! " + "ALL U NED IZ 2 USE SUM MICE AN SUM CREAM AN READY IT IZ! " + "PLEEEEASE!' *mieaw* *rub* *rub*\n") + + def action(self, player, do): + if do[0] in words.use and do[1] == "mice" and do[2]=="cream": + if player.has("cream") and player.has("mice"): + player.take("cream") + player.take("mice") + print("Balls of tasty omnom mice cream fall from your " + "hands!\nThe kittens look very pleased!\n" + "Because they are happy they give you a piece of " + "advice:\n" + "'U SHUD AVOID BY ANY MEANZ TEH LIGHTHAUS! " + "BAD KAT LIVEZ THAR!'\n") + self.challenge_completed = True + else: + print("You'll need some mice and cream.") + + def leave(self, player, direction): + if direction in ("s", "w"): + print("It's the open sea. You can't go anywhere near by " + "swimming.") + return False + elif direction == "n": + print("You are heading to the lighthouse.") + return True + else: + return True + +test_items = ['mice', 'cream'] diff --git a/weatbag/tiles/n5w5.py b/weatbag/tiles/n5w5.py new file mode 100644 index 0000000..75aff81 --- /dev/null +++ b/weatbag/tiles/n5w5.py @@ -0,0 +1,52 @@ +from weatbag import words +from weatbag.utils import transfer + +class Tile: + map_word = "Kiosk" + + def __init__(self): + self.contents = {"cream": 1} + self.challenge_completed = False + + def describe(self): + print("You are on the beach. You see a small kiosk selling " + "ice cream!\n") + if not self.challenge_completed: + self.challenge() + + def challenge(self): + print("You go and see an old lady inside stir a pot. A fat ginger cat " + "outside the kiosk is digging holes in the sand.\n" + "You say hi, and the old lady replies:\n" + "Hello to you traveler, I'm Grace Hopper and this is my cat " + "Sandy Claws. I could offer you some cream but first you must " + "answer me this:\n" + "Tom's mother has three children. One is named April, one is " + "named May. What is the third one named?\n") + + def action(self, player, do): + if do[0]=="tom" and self.contents["cream"]: + print("That's correct. Now you can have some cream! " + "There... already in your bag!\nHave a mice day!\n") + self.contents["cream"] -= 1 + player.give("cream") + self.challenge = True + elif do[0] in words.take and "cream" in do and self.contents["cream"]: + print("No, it doesn't work this way. First you gotta answer my " + "question!") + elif do[0] in words.take and "cream" in do: + print("Don't be greedy, you have all the cream you're gonna " + "need.\n") + else: + print("I don't understand.") + + def leave(self, player, direction): + if direction in ("n", "e"): + print("It's the open sea. You can't go anywhere near by " + "swimming.") + return False + elif direction == "s": + print("A bunch of pine trees...") + return True + else: + return True diff --git a/weatbag/tiles/n5w6.py b/weatbag/tiles/n5w6.py new file mode 100644 index 0000000..81438fe --- /dev/null +++ b/weatbag/tiles/n5w6.py @@ -0,0 +1,16 @@ +class Tile: + map_word = "Beach" + + def describe(self): + print("You walk in the beach. There is a light house on the west.\n") + + def action(self, player, do): + print("I don't understand.") + + def leave(self, player, direction): + if direction == "n": + print("It's the open sea. You can't go anywhere near by " + "swimming.") + return False + else: + return True diff --git a/weatbag/tiles/n5w7.py b/weatbag/tiles/n5w7.py new file mode 100644 index 0000000..b371ea9 --- /dev/null +++ b/weatbag/tiles/n5w7.py @@ -0,0 +1,96 @@ +from weatbag import words + +class Tile: + map_word = "Lighthouse" + + def __init__(self): + self.trapped = True + + def describe(self): + if self.trapped: + print("You are inside the lighthouse. You hear a clicking sound " + "and the door closes behind you.\n" + "It is dark, and an enormous cat sits on a computer " + "compiling felinux kernels.\n" + "You try to open the door and leave but you realize it is " + "locked.\n" + "The cat turns at you and hisses loudly.\n" + "She grawls and because you now speak cat, you understand " + "what she says.\n\n" + "Puny human, how dare you disturb my peace!\n" + "If you tell a lie I will hang you; " + "if you tell the truth I will shoot you.\n\n" + "It looks like you are condemned... Though if you think a " + "bit more there is an appropriate answer that gets your ass " + "out of this hell!\n") + + # The exact answer is 'You will hang me'. If she hangs him, then the + # statement was true and she could only hang him for telling a lie. + # If she shoot him, then it makes the statement a lie and she was only + # to shoot him for telling the truth. + # An alternate solution is to say, "You will not shoot me," leading to the + # same quandary for the killercat. + + else: + print("You are inside the lighthouse. There's a computer in a " + "corner and some printed papers on the ground with " + "scribblings like:\n\n" + "SO IM LIKE FIBBING WIT N OK?\n" + " LOL ITERATE FIBONACCI TERMS LESS THAN N /LOL\n" + " SO GOOD N BIG LIKE EASTERBUNNY\n" + " BTW, FIBONACCI LIKE BUNNIES! LOL\n" + " U BORROW CHEEZBURGER\n" + " U BORROW CHEEZBURGER\n" + " I CAN HAZ CHEEZBURGER\n" + " HE CAN HAZ CHEEZBURGER\n" + " WHILE I CUTE?\n" + " I AND HE CAN HAZ HE AND I ALONG WITH HE\n" + " IZ HE BIG LIKE N?\n" + " KTHXBYE\n" + " U BORROW HE\n\n" + "Ah huh you think... lolpython fibonacci. Crazy catworks. " + "Nothing to do here!\n") + +#http://www.dalkescientific.com/writings/diary/archive/2007/06/01/lolpython.html + + def action(self, player, do): + if self.trapped: + if do == ["you","will","hang","me"]: + print("You dirty little human, I can only let you go now!\n") + self.trapped = False + elif do == ["you","will","not","shoot","me"]: + print("You dirty little human, I can only let you go now!\n") + self.trapped = False + elif (player.has("catfood") + and (do[0] in words.use or do[0] in words.give) + and "catfood" in do): + print("Do you think that if you bribe me with catfood I'll let " + "you leave?\nCatfood will not save you this time.\n" + "The fat cat steals one catfood and eats it. You should " + "be more carefull next time.") + player.take("catfood") + self.trapped = False + else: + print("Keep saying bullshit and your end is close!") + else: + print("I don't understand.") + + def leave(self, player, direction): + if self.trapped and direction in ("w", "n"): + print("You are my prisoner, I won't let you leave. But even if you " + "could leave these are the inner walls of the lighthouse you " + "idiot! And then the sea.") + return False + elif self.trapped and direction in ("e", "s"): + print("What do you think you are doing? I won't let you leave. " + "You are my prisoner!") + return False + elif direction in ("w", "n"): + print("It's the lighthouse walls. What are you gonna do? " + "Hit your head on them?") + return False + else: + print("You are out!") + return True + +test_items = ["catfood"] |
