@mdjb4/

007 mission 45637

Python

You must get to the end to stop the nuclear missiles going off and destroying the world.

fork
loading
Files
  • main.py
  • flow.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import sys, random, time
from replit import clear as c
class Room():
  def __init__(self): pass
  def play(self):
    print('This room hasnt been initialized yet.')

class Game_Over(Room):
  def play(self, c='lose'):
    time.sleep(5)
    a = {
      'lose': [
        'You have failed.',
        'You are now dead because of your mistake.',
        "You don't deserve to be a spy"
        "You're awful!"
        'You are not worthy to save the plannet.'
      ]
    }
    print(random.choice(a[c]))
    time.sleep(3)
    print('Game Over!')
    sys.exit()

class Win(Room):
  def play(self):
    time.sleep(5)
    a = [
      'You have done well',
      'Good job',
      'Well done',
      'Well done agent 007'
    ]
    print(random.choice(a))
    time.sleep(3)
    print('Game Over!')
    sys.exit()

class Intro(Room):
  def play(self):
    c()
     
    if not input('Ready? [y/n]: ') == 'y': sys.exit()
    c()
    print('You have reached the evil lair. You have managed to reach the front gate, without spotting any guards. Hopefully, this streak of good luck continues until you escape the lair.You look around the place deciding what to do when an guard walks out of a corridor. You put a hand on your gun.\nYour options are:\n\t1. Shoot\n\t2. Pretend your a guard too\n\t3. Run for your life')
    o = input('Move? [1, 2, 3]: ')
    c()
    if o == '1':
      print('You pull out your gun and shoot the guard. Unfortunatlly the guard has a bullet proof vest on. He sees you,pulls out a gun, and shoots you in the head. You have determined the fate of thousands of inoccent people on earth.')
      return 'game over. Plannet goes boom!'
    elif o == '2':
      print('You pretend to be guard by hiding your face, and the guard walks past you, leaving the gate open, which you rush through.')
      return 'corridor'
    elif o == '3':
      print("You quickly scan your surroundings, for an exit. You turn around and attempt to exit the way you came in, but the guard shoots you dead as soon as you attempt to run.  You're dead")
      return 'game over'

class Corridor(Room):
  def play(self):
    print('You are running in the dark corridor. You reach the end and turn on your flashlight. You turn and see two doors in front of you. Which one will lead you to the bomb?\nYou can choose between the left one or the right one.\n\t1. Left\n\t2. Right')
    o = input('Room? [1, 2]: ')
    c()
    if o == '1':
      print('You enter the left room. It is full of poisnonous gas which immediately kills you. Goodbye')
      return 'game over'
    elif o == '2':
      return 'bomb hold'

class Bomb_Hold(Room):
  def play(self):
    print("You enter the right room. You see a well furnished desk. On it you see what looks like a secret pannel. You open it, only to find a keepad on to of a secret stairway. You approach the keypad. You have six tries to guess the 1 digit password. That's easy!")
    password = random.randint(0, 9)
    for _ in range(6):
      if input('[keypad]: ') == str(password):
        c()
        print('Bing! The doorway opens and you slide down to the secret stairway, which you quickly descend. You then see the bomb after climbing down all the stariwall. You pick it up (as it is a small but deadly bomb) and then exit back in the corridor, and run across to the other end of the corrdior, where you see the get-away-car waiting outside. Hopefully, you manage to escape and take the bomb to MI5. You notice the timer for the bomb has already started, it reads [9:35]. 9 minutes, to escape.')
        return 'bridge'
      else:
        c()
        print('BEEEEEEEEEEEP. "Incorrect!" is displayed on the screen.')
    print('An alarm goes off and the desk lid shuts. It is then yanked open 1 minute later by 20 armed guards, who shoot you dead. DEAD')
    return 'game over'

class Bridge(Room):
  def play(self):
    print('You climb up the stairwall and out of the desk only to find the evil crime boss himself there, MR BIG. He and a few technicians. UGH, You forgot the CCTV. They are all armed to the teeth. You glance at the timer again [6:12]. You need to act fast. \nYour options are to:\n\t1. Place the bomb and run\n\t2. Run\n\t3. Place the bomb slowly on the ground and threaten to set it off with MR BIG there')
    o = input('Move? [1, 2, 3]: ')
    if o == '1':
      print('You place the bomb down, slow enough so that it doesnt explode, and turn around. You attempt to run back into the corridor to the main room when two evil scientists working for MR BIG drop to there feet and enter a password to disabalize the bomb. The other aims his gun and shoots you down! Running never works when the enemies have guns!.')
      return 'game over'
    elif o == '2':
      print('You keep a firm grip on the bomb and turn around. You attempt to escape the way you come in, but one of them shoots you with his gun. In a few minutes they probably will have disarmed the bomb. Running never works when then enemies have guns.')
      return 'game over'
    elif o == '3':
      print("You aim your blaster at the bomb, and MR BIG and the scientists raise their hands above their heads. You pause to think, and glance at the keypad. [6:00]. You have just 6 minutes to get to the get-a-way car, which as a bomb disposal man in it. So you keep your gun on the bomb as you back ou the room. When you out of their sight, you quickly lock the door and you see 4 doors, where one of them is the way out.")
      return 'escape room'

class EscapeRoom(Room):
  def play(self):
    print('You walk up to 4 doors, you know the clock is ticking and do not have time to check if any are wrong, for they each take an age to open. Which door do you choose?')
    p = input('Pod? [1, 2, 3, 4]: ')
    if int(p) == random.randint(1, 4):
      print('You open door ' + p + '. You step ou next to the get-away-car. You did it! You get in quickly and hand the bomb to your bomb disposal friend Charlie, who neutralises it. Well done for saving the day! You get promoted from 007 to 008! World saved!')
      return 'win'
    else:
      print('You you open door' + p +'. That door lead to the barracks to the soldiers. You are captured and the world explodes. BAD LUCK! ')
      return 'game over'

engine = {
  'game over': Game_Over(),
  'intro': Intro(),
  'corridor': Corridor(),
  'bomb hold': Bomb_Hold(),
  'bridge': Bridge(),
  'escape room': EscapeRoom(),
  'win': Win()
}

room = engine['intro'].play()
while True:
  room = engine[room]
  room = room.play()