Repository navigation
Expand file tree
/
Copy pathMain.py
More file actions
299 lines (270 loc) · 6.35 KB
/
Copy pathMain.py
File metadata and controls
299 lines (270 loc) · 6.35 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
import random
import os
import function
import time
Name = input("What is Your Hero's name? ")
HP = 30
MP = 20
HPM = 30
MPM = 20
XP = 0
XPlvl = 10
Lvl = 1
BDAM = 2
Crit = 4
Coins = 10
Slot0 = {"0": 0, "Wood Helmet": 3}
b1 = 0
b2 = 0
b3 = 0
lvlp = 0
#Slots are numbered in the id of the list
Slot1 = {"Shirt": 2}
Slot2 = {"Leggings": 1, "Plated Leggings": 3}
Slot3 = {"Rookie's Sword": 3, "Sword": 8}
SlotBuff = {
"0": 0,
"Crit1": 5,
"Crit2": 10,
"Def1": 5,
"Def2": 15,
"Dam1": 10,
"Dam2": 20
}
#SlotBuff is slot 4,5 and 6
Slot = ["0", "Shirt", "Leggings", "Rookie's Sword", "0", "0", "0"]
DAM = Slot3.get(Slot[3]) + BDAM
DEF = Slot0.get(Slot[0]) + Slot1.get(Slot[1]) + Slot2.get(Slot[2])
BUFF = [
SlotBuff.get(Slot[4]),
SlotBuff.get(Slot[5]),
SlotBuff.get(Slot[6]),
]
def Modbuff():
global b1
global b2
global b3
global BUFF
if BUFF[0] == 0 and BUFF[1] == 0 and BUFF[2] == 0:
b1 = 0
b2 = 0
b3 = 0
else:
if BUFF[0] == 5:
b1 = 5
else:
if BUFF[0] == 10:
b1 = 10
if BUFF[1] == 5:
b2 = 5
else:
if BUFF[1] == 15:
b2 = 15
if BUFF[2] == 10:
b3 = 10
else:
if BUFF[2] == 15:
b3 = 15
def BuffName():
global b1
global b2
global b3
if b1 == 5:
thing1 = "Armour Boost Lvl1"
elif b1 == 10:
thing1 = "Armour Boost Lvl2"
else:
thing1 = "None"
if b2 == 5:
thing2 = "Weapon Boost Lvl1"
elif b2 == 10:
thing2 = "Weapon Boost Lvl2"
else:
thing2 = "None"
if b3 == 5:
thing3 = "Crit Boost Lvl1"
elif b3 == 15:
thing3 = "Crit Boost Lvl2"
else:
thing3 = "None"
return [thing1, thing2, thing3]
def fighttut1():
global HP
global MP
global HPM
global MPM
global DAM
EDAM = 5
EHP = 15
EHPM = 15
DEFmod = 0
print("Enemy: Wolf")
print("Wolf's HP: " + str(EHP) + "/" + str(EHPM))
print()
print(Name + "'s HP: " + str(HP) + "/" + str(HPM))
print(Name + "'s MP: " + str(MP) + "/" + str(MPM))
print("press enter")
input()
os.system("clear")
print("----INFORMATION----")
print("Enemy: Wolf <--Name of enemy")
print("Wolf's HP: " + str(EHP) + "/" + str(EHPM) + " <-- enemy's health")
print()
print(Name + "'s HP: " + str(HP) + "/" + str(HPM) + " <-- Your health ")
print(Name + "'s MP: " + str(MP) + "/" + str(MPM) +
" <-- Your magic(this will be used later in the game)")
print("press enter")
input()
while EHP >= 1:
if HP < 1:
return "LOSE"
os.system("clear")
print("Enemy: Wolf")
print("Wolf's HP: " + str(EHP) + "/" + str(EHPM))
print()
print(Name + "'s HP: " + str(HP) + "/" + str(HPM))
print(Name + "'s MP: " + str(MP) + "/" + str(MPM))
while True:
print("Attack or defend?")
choice = input("1 = Attack, 2 = defend ")
if choice == "1":
os.system("clear")
print("You attack the wolf")
fEHP = EHP
EHP -= DAM + random.randint(-2, 2)
print("You dealt " + str(fEHP - EHP) + " damage")
input()
break
elif choice == "2":
os.system("clear")
print("You brace yourself")
DEFmod = 4
input()
break
else:
print("sorry, unrecognised input")
input()
os.system("clear")
if EHP >= 1:
print("The wolf attacks you!")
cEDAM = EDAM - DEF - DEFmod + random.randint(-2, 2)
if cEDAM <= 0:
DEFmod = 0
print("You laugh, The wolf competely misses")
else:
HP -= cEDAM
DEFmod = 0
print("It dealt " + str(cEDAM) + " damage")
input()
else:
return "WIN"
def BATTLE(name, hp, mp):
global HP
global MP
global HPM
global MPM
global DAM
EName = name
EDAM = 8
EHP = hp
EHPM = hp
EMP = mp
EMPM = mp
DEFmod = 0
print("You encounter a " + str(EName) + "!")
print("Enemy: " + EName)
print(EName + "'s HP: " + str(EHP) + "/" + str(EHPM))
print(EName + "'s MP: " + str(EMP) + "/" + str(EMPM))
print()
print(Name + "'s HP: " + str(HP) + "/" + str(HPM))
print(Name + "'s MP: " + str(MP) + "/" + str(MPM))
print("press enter")
input()
while EHP >= 1:
if HP < 1:
return "LOSE"
os.system("clear")
print("Enemy: " + EName)
print("'s HP: " + str(EHP) + "/" + str(EHPM))
print()
print(Name + "'s HP: " + str(HP) + "/" + str(HPM))
print(Name + "'s MP: " + str(MP) + "/" + str(MPM))
while True:
print("Attack or defend?")
choice = input("1 = Attack, 2 = defend ")
if choice == "1":
os.system("clear")
print("You attack the " + EName)
fEHP = EHP
EHP -= DAM + random.randint(-3, 3)
print("You dealt " + str(fEHP - EHP) + " damage")
input()
break
elif choice == "2":
os.system("clear")
print("You brace yourself")
DEFmod = 4
input()
break
else:
print("sorry, unrecognised input")
input()
os.system("clear")
if EHP >= 1:
print("The " + EName + " attacks you!")
cEDAM = EDAM - DEF - DEFmod + random.randint(-3, 3)
if cEDAM <= 0:
DEFmod = 0
print("You laugh, The " + EName + " competely misses")
else:
HP -= cEDAM
DEFmod = 0
print("It dealt " + str(cEDAM) + " damage")
input()
else:
return "WIN"
buffs = BuffName()
os.system("clear")
print("Hero Stats")
print("Name: " + Name)
print("HP: " + str(HP) + "/" + str(HPM))
print("MP: " + str(MP) + "/" + str(MPM))
print("Lvl: " + str(Lvl))
print("XP: " + str(XP) + "/" + str(XPlvl))
print("Defense: " + str(DEF))
print("Crit chance: " + str(Crit) + "%")
print("Damage: " + str(DAM), "\033[33m")
print("Coins:" + str(Coins), "\033[0m")
print("Main weapon: " + str(Slot[3]))
print("Active buffs: " + buffs[0] + ", " + buffs[1] + ", " + buffs[2])
input("press enter to continue ")
os.system("clear")
print("You wander into the forrest...")
input()
os.system("clear")
print("As you stroll you hear a strange howl...")
input()
os.system("clear")
print("You see a Wolf!")
input()
os.system("clear")
while True:
C = fighttut1()
if C == "WIN":
os.system("clear")
print("You beat the Wolf!")
input()
break
else:
HP = HPM
print("You run to catch the wolf after a short rest.")
os.system("clear")
print("You head back to the town to rest...")
HP = HPM
input()
os.system("clear")
print("You walk outside to the village")
input()
#ideas? put them below
#
#