-
Notifications
You must be signed in to change notification settings - Fork 0
/
study16.py
132 lines (117 loc) · 4.27 KB
/
study16.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
123
124
125
126
127
128
129
130
131
132
from sys import argv, exit
script, file_txt = argv
txt = open(file_txt)
def path():
print "This is your first mission as a normal soldier."
print "Your dream is to become a Space Marine."
print "You see 3 enemies."
enemies = 3
print "What do you do."
while True:
choice = raw_input("> ")
if choice == "shoot enemies":
print "You start to fire like a maniac and get wounded."
wounded()
elif choice == "take cover":
print "You took cover. What now?"
elif choice == "take one down" and enemies == 3:
print "You took one enemy down."
print "They are looking for you."
enemies -= 1
elif choice == "change cover" and enemies == 2:
print "You change cover. The enemies spoted you. What now?"
elif choice == "throw a flashbang" and enemies == 2:
print "You threw a flashbang and blinded the enemies."
print "You then were able to shoot them bouth."
enemies -= 2
victory()
else:
print "You can't '%s' ." % choice
def wounded():
print "You wake up in the enemy headquarter."
print "You learn that the men who shoot you are called: Bob,Lee,Yu"
enemies = ['Bob', 'Lee', 'Yu']
print "You are stranded to a chair."
print "A light vision apears in front of you and a Chaos Gods says:"
print "Swear loyalty to me and i will set you free."
bob = True
lee = True
yu = True
answear = True
print "What is your anwear?"
while answear:
choice = raw_input("> ")
if choice == "i swear":
answear = False
else:
exit("You remained loyal to the Emperor!")
print "You feel huge power rising in your body and a urge to kill something."
print "There are 3 enemies who do you want to take out first?"
remain = 3
while remain > 0:
print enemies
choice = raw_input("> ")
if choice == "Bob" and bob:
remain -= 1
print "You killed Bob. There are now %d enemies" % remain
enemies.remove('Bob')
bob = False
elif choice == "Lee" and lee:
remain -= 1
print "You killed Lee. There are now %d enemies" % remain
enemies.remove('Lee')
lee = False
elif choice == "Yu" and yu:
remain -= 1
print "You killed Yu. There are now %d enemies" % remain
enemies.remove('Yu')
yu = False
else:
print "Try again."
print "Congratulation! You are now!"
line = txt.readlines()
print line[1]
def victory():
print "After succesfully infiltrating the base!"
print "You are faced with the great evil boss!"
print "You have 10 seconds to kill him and difuse the bomb"
print "What do you do?"
boss_hp = 100
your_hp = 100
for i in range(10):
print "Seconds past:", i + 1
print "Boss HP: %d" % boss_hp
print "Your HP: %d" % your_hp
choice = raw_input("> ")
if choice == "shoot him" and your_hp > 0 and boss_hp > 0:
print "You shoot the boss -30 hp"
boss_hp -= 30
print "He shoots back -40 hp"
your_hp -= 40
elif choice == "throw granade" and your_hp > 0 and boss_hp > 0:
print "You threw a granade at the boss -40 hp"
boss_hp -= 40
print "He rolled after the explosion and punched you in the face -20 hp"
your_hp -= 20
elif choice == "cut him" and your_hp < 0 and boss_hp < 0:
print "You cut the boss -20"
boss_hp -= 20
print "He cuts you back -50"
your_hp -= 50
elif choice == "difuse bomb" and boss_hp > 0:
print "The boss impales you from behind -100 hp"
your_hp -= 100
elif choice == "difuse bomb" and boss_hp <= 0:
print "You difused the bomb!"
final()
exit(0)
elif your_hp <= 0:
exit('You are dead...May the Emperor protect us now!')
else:
print "You are wasing time!"
def final():
print "You were victorious!"
print "Mission succesfull!"
line = txt.readlines()
print "You became a", line[0]
path()