Advertisement
Guest User

Untitled

a guest
Jun 26th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.27 KB | None | 0 0
  1. def enter(self):
  2. print "This scene is not yet configured. Subclass it and implement enter()."
  3. exit(1)
  4.  
  5. def __init__(self, scene_map):
  6. self.scene_map = scene_map
  7.  
  8. def play(self):
  9. current_scene = self.scene_map.opening_scene()
  10. last_scene = self.scene_map.next_scene('finished')
  11.  
  12. while current_scene != 'last_scene':
  13. next_scene_name = current_scene.enter()
  14. current_scene = self.scene_map.next_scene(next_scene_name)
  15.  
  16. #be sure to print ou the last scene
  17. current_scene.enter() # de current_scene, no caso vai ate aqui central corridor, pega a funcao enter e chame sem parametros.
  18.  
  19. quips = [
  20. "You died. You Kinda suck at this.",
  21. "Your mom would be proud...if she were smarter.",
  22. "Such a luser.",
  23. "I have a small puppy that's better than this."
  24. ]
  25.  
  26. def enter(self):
  27. print Death.quips[randint(0, len(self.quips)-1)]
  28. exit(1)
  29.  
  30. def enter(self):
  31. print "The Gothons of Planet Percal #25 have invaded your ship and destroyed"
  32. print "your entire crew. You are the last surviving member and your last"
  33. print "mission is to get the neutron destruct bomb from the Weapons Armory,"
  34. print "put it in the bridge, and blow the ship up after getting into an "
  35. print "escape pod."
  36. print "n"
  37. print "You're running down the central corridor to the Weapons Armory when"
  38. print "a Gothon jumps out, red scaly skin, dark grimy teeth, and evil clown costume"
  39. print "flowing around his hate filled body. He's blocking the door to the"
  40. print "Armory and about to pull a weapon to blast you."
  41.  
  42. action = raw_input("> ")
  43.  
  44. if action == "shoot!":
  45. print "Quick on the draw you yank out your blaster and fire it at the Gothon."
  46. print "His clown costume is flowing and moving arond his body, which throws"
  47. print "off your aim. Your lase hits his costume but misses him entirely. This"
  48. print "completely ruins his brand new costume his mother bought him, which"
  49. print "makes him fly into an insane rage and blast you repetedly in the face until"
  50. print "you are dead. Then he eats you."
  51. return 'death'
  52.  
  53. elif action == "dodge!":
  54. print "Like a world class boxer you dodge, wave, slip and slid right"
  55. print "as the Gothon's blaster craanks a laser past you head."
  56. print "In the middle of you artful dodge you foot slips and you"
  57. print "bang your head on the metal wall and pass out."
  58. print "You wake up shortly after only to die as the Gothon stomps on"
  59. print "your head and eats you."
  60. return 'death'
  61.  
  62. elif 'tell' and 'joke' in action:
  63. print "Lucky for you they made you lean Gothon insults in the academy."
  64. print "You tell the one Gothon hoke you know:"
  65. print "Lbhe zbgure vf fb sng, jura fur fvgf nebhaq gur ubhfr, fur fvgf nebhaq gur ubhfr."
  66. print "The Gothon stops, tries not to laugh, then busts out laughing and can't move."
  67. print "While he's laughing you run up and shoot him square in the head"
  68. print "putting him down, then jump through the Weapon Armory door."
  69. return 'laser_weapon_armory'
  70.  
  71. elif 'talk' in action or 'try to speak' in action:
  72. print "Gothon don't understanding what do you talking"
  73. print "and shoots you on your head."
  74. print "You die until you know what's happening."
  75. return 'death'
  76.  
  77. else:
  78. print "DOES NOT COMPUTE!"
  79. return 'central_corridor'
  80.  
  81. def enter(self):
  82. print "You do a dive roll into the Weapon Armory, crouch and scan the room"
  83. print "for more Gothons that might be hiding. It's dead quiet, too quiet."
  84. print "You stand up and run to the far side of the room and find the"
  85. print "neutron bomb in its container. There's a keypad lock on the box"
  86. print "and you need the code to get the bomb out. If you get the code"
  87. print "wrong 10 times then the lock closes forever and you can't"
  88. print "get the bomb. The code is 3 digits."
  89. code = "%d%d%d" % (randint(1,9), randint(1,9), randint(1,9))
  90. print code
  91. guess = raw_input("[keypad]> ")
  92. guesses = 1
  93.  
  94. while guess != code and guesses < 10:
  95. print "BZZZZEDDD!"
  96. if guess > code:
  97. print 'Very high.'
  98. elif guess < code:
  99. print 'Very low.'
  100. guesses += 1
  101. guess = raw_input("[keypad]> ")
  102. if guess == code:
  103. print "The container clicks open and the seal breaks, letting gas out."
  104. print "You grab the neutron bomb and run as gast as you can to the"
  105. print "bridge where you must place it in the right spot."
  106. return 'the_bridge'
  107. else:
  108. print "The lock buzzes one last time and then you hear a sickning"
  109. print "melting sound as the mechanism is gused together."
  110. print "You decide to sit there, and finally the Gothons blow up the"
  111. print "ship from their ship and you die."
  112. return 'death'
  113.  
  114. def enter(self):
  115. print "You burst onto the Bridge with the netron destruct bomb"
  116. print "under your arm and surprise 5 Gothons who are trying to"
  117. print "take control of the ship. Each of them has an even uglier"
  118. print "clown costume than the last. They haven't pulled their"
  119. print "weapons out yet, as they see the active bomb under your"
  120. print "arm and don't want to set it off."
  121.  
  122. action = raw_input("> ")
  123.  
  124. if action == "throw the bomb":
  125. print "In a panic you throw the bomb at the group of Gothons"
  126. print "and make a leap for the door. Right as you drop it a"
  127. print "Gothon shoots you right in the back killing you."
  128. print "As you die you see another Gothon frantically try to disarm"
  129. print "the bomb. You die knowing they will probably blow up when"
  130. print "it goes off."
  131. return 'death'
  132.  
  133. elif action == "slowly place the bomb":
  134. print "You point your blaster at the bomb under your arm"
  135. print "and the Gothons put their hands up and starts to sweat."
  136. print "You inch backward to the door, open it, and then carefully"
  137. print "place the bomb on the floor, pointing your blaster at it."
  138. print "You then jump back through the door, punch the close button"
  139. print "and blast the lock so the Gothon can't get out."
  140. print "Now that tha bomb is placed you run to the escape pod to"
  141. print "get off this tin can."
  142. return 'escape_pod'
  143. else:
  144. print "DOES NOT COMPUTE"
  145. return "the_bridge"
  146.  
  147. def enter(self):
  148. print "You rush through the ship desperately trying to make it to"
  149. print "the escape pod before the whole ship explodes. It seems like"
  150. print "hardly any Gothons are on the ship, so your run is clear of"
  151. print "interference. You get to the chamber with the escape pods, and"
  152. print "now need to pick one to take. Some of them coud be dameged"
  153. print "but you don't have time to look. There's 3 pods, wich one"
  154. print "do you take?"
  155.  
  156. good_pod = randint(1,3)
  157. guess = raw_input("[pod #]> ")
  158. guesses = 0
  159.  
  160.  
  161. while int(guess) != good_pod and guesses < 2:
  162. print "This pod doesn't work. Try again."
  163. guesses += 1
  164. guess = raw_input("[pod #]> ")
  165. if int(guess) == good_pod:
  166. print "You jump into pod %s and hit the eject button." % guess
  167. print "The pod easily slides out into space heading to"
  168. print "the planet below. As it flies to the planet, you look"
  169. print "back and see your ship implode then explode like a"
  170. print "bright star, taking out the Gothon ship at the same"
  171. print "time. You won!"
  172.  
  173. return 'finished'
  174. else:
  175. print "You jump into pod %s and hit the eject button." % guess
  176. print "The pod escapes out into the void of space, then"
  177. print "implodes as the hull ruptures, crushing your body"
  178. print "into jam jelly."
  179. return 'death'
  180.  
  181. def enter(self):
  182. print "You won! Good job."
  183. return 'finished'
  184.  
  185. scenes = {
  186. 'central_corridor': CentralCorridor(),
  187. 'laser_weapon_armory': LaserWeaponArmory(),
  188. 'the_bridge': TheBridge(),
  189. 'escape_pod': EscapePod(),
  190. 'death': Death(),
  191. 'finished': Finished(),
  192. }
  193.  
  194. def __init__(self, start_scene):
  195. self.start_scene = start_scene
  196.  
  197. def next_scene(self, scene_name):
  198. val = Map.scenes.get(scene_name)
  199. return val
  200.  
  201. def opening_scene(self):
  202. return self.next_scene(self.start_scene)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement