fork download
  1. from sys import exit
  2.  
  3. times_in_exchange_path = 0
  4. asked_for_help = 0
  5. haunted = False
  6. cthulhu_dead = False
  7.  
  8. def exchange_path():
  9. print "Hola! You are about to get to the very dangerous point, kid!"
  10. print "You are independent from now. With luck..."
  11.  
  12. action = raw_input('...')
  13.  
  14. if 'what' in action:
  15. print 'I said you are on your own now. No one is gonna help you',
  16. print "with anything..."
  17. exchange_path()
  18. elif 'creepy' in action:
  19. print "I found it creepy, too. Kid. Take me out of here with you."
  20. print "Is that OK?"
  21.  
  22.  
  23. decision = raw_input()
  24.  
  25. if decision == 'agree':
  26. print "Finally. I'm free!"
  27. global times_in_exchange_path
  28. global haunted
  29. haunted = True
  30. times_in_exchange_path += 1
  31. start()
  32. else:
  33. dead("I will make you know what pain really is!!?! >:(")
  34.  
  35. else:
  36. dead("A shadow barged into you, and you broke your neck.")
  37.  
  38. def gold_room():
  39. print "This room is full of gold. How much do you take?"
  40.  
  41. choice = raw_input("> ")
  42. try:
  43. how_much = int(choice)
  44. except:
  45. dead("Man, learn to type a number.")
  46.  
  47. if how_much < 50:
  48. print "Nice, you're not greedy, you win!"
  49.  
  50. if haunted:
  51. print "\nHowever... I can't just let you get away easily like this."
  52. print '"Why??" - I asked'
  53. print "You belong to the gold mine now!!"
  54. print '"What do you mean??" - I replied in fear'
  55. print "Power requires sacrifice. Muhahahhaha!"
  56. dead(" ")
  57. else:
  58. exit(0)
  59.  
  60. else:
  61. dead("You greedy bastard! It's a trap for you!")
  62.  
  63. def bear_room():
  64. print "There is a bear here."
  65. print "The bear has a bunch of honey."
  66. print "The fat bear is in front of another door."
  67. print "How are you going to move the bear?\n"
  68. bear_moved = False
  69.  
  70. if haunted:
  71. print "...Wait. The bear suddenly shouts at you, break the window",
  72. print "and runs far far away."
  73. print ''' "Let's go to the door, kid..."\n\n '''
  74. gold_room()
  75. else:
  76. while True:
  77. choice = raw_input("> ")
  78.  
  79. if choice == "take honey":
  80. dead("The bear looks at you then slaps your face off.")
  81. elif choice == "taunt bear" and not bear_moved:
  82. print "The bear has moved from the door. You can go through",
  83. print "it now."
  84. bear_moved = True
  85. elif choice == "taunt bear" and bear_moved:
  86. dead("The bear gets pissed off and chews your leg off.")
  87. elif choice == "open door" and bear_moved:
  88. gold_room()
  89. else:
  90. print "I got no idea what that means."
  91.  
  92. def cthulhu_room():
  93. global cthulhu_dead
  94. print "Here you see the great evil Cthulhu."
  95. print "He, it, whatever stares at you and goes insane."
  96. print "Do you flee for your life or he eats your head?"
  97.  
  98. choice = raw_input("> ")
  99.  
  100. if cthulhu_dead:
  101. print "There's nothing here, kid. Except of the light and a dead body."
  102. print "Let's go!\n...\n\n"
  103. start()
  104. else:
  105.  
  106. if "flee" in choice:
  107. start()
  108. elif "head" in choice:
  109. dead("Well that was tasty!")
  110. elif "fight" in choice:
  111.  
  112. if haunted:
  113. print "With mysterious distraction, the Cthulhu turns his back",
  114. print "at you. You use the shiny magical spear nearby to kill",
  115. print "the monster."
  116. cthulhu_dead = True
  117. print "\n...\n"
  118. start()
  119. else:
  120. dead("Awesome tasty head you have!")
  121.  
  122. else:
  123. cthulhu_room()
  124.  
  125. def dead(why):
  126. print why, "\n\nGood job! You died."
  127. exit(0)
  128.  
  129. def first_assist():
  130. global asked_for_help
  131. asked_for_help += 1
  132.  
  133. if asked_for_help in range(4, 6):
  134. print '"Stop! You are attracting them!" - comes the voice'
  135. print "A portal shows up and you are walking into it...\n\n"
  136. elif asked_for_help > 5:
  137. dead("Those demons rise from the ground. And burn you down!")
  138. else:
  139. print "Hi! I am your beautiful assistance."
  140. print "As you got lost in here, I will show you the way."
  141. print "You have to know that all three paths are dangerous, and there",
  142. print "is no way out of here, unless you complete the quest..."
  143. print "So, try to survive with glory."
  144. print '"left", "right" and "front" are the first three spells you use.'
  145. print "There's a mighty power near here. Have a pure heart, and know",
  146. print "that you will never have to touch that evil power..."
  147. print "Good luck from here... Be wise.\n...\n"
  148.  
  149. start()
  150.  
  151. def start():
  152. print "You are in a dark room."
  153. print "There is a door to your right and left."
  154. print 'And a middle path, full of darkness, in front of you.'
  155. print "Which one do you dare to take?"
  156.  
  157. choice = raw_input("> ")
  158.  
  159. if choice == "left":
  160. bear_room()
  161. elif choice == "right":
  162. cthulhu_room()
  163. elif choice == "front":
  164.  
  165. if times_in_exchange_path == 0:
  166. exchange_path()
  167. else:
  168. print "You feel something stopping you from entering this place. \n"
  169. start()
  170.  
  171. elif "help" in choice:
  172. first_assist()
  173. else:
  174. dead("You stumble around the room until you starve.")
  175.  
  176. start()
Runtime error #stdin #stdout #stderr 0.01s 9016KB
stdin
Standard input is empty
stdout
You are in a dark room.
There is a door to your right and left.
And a middle path, full of darkness, in front of you.
Which one do you dare to take?
> 
stderr
Traceback (most recent call last):
  File "prog.py", line 176, in <module>
  File "prog.py", line 157, in start
EOFError: EOF when reading a line