repl.it
@JamesMacdonald1/

Project 8 - Final Project-4

Python

Pokemon Battler: Pick a team and battle it out with the computer!

fork
loading
Files
  • main.py
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
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# Intro to Computer Science: Final Project Template
import random
water={"Pokemon":["Blastoise","Azumarill","Walrein","Empoleon","Seismitoad","Greninja","Araquanid","Ludicolo","Lanturn"],"Moves":["Hydropump","Surf","Scald","Waterfall","Liquidation"],"Weak":["grass","electric"],"Resist":["water","ice","fire"],"Immune":[]}

ice={"Pokemon":["Jynx","Mamoswine","Walrein","Froslass","Vanilluxe","Aurorus","Crabominable","Weavile","Glaceon"],"Moves":["Ice Beam","Blizzard","Frost Breath","Ice Punch","Ice Fang","Freeze-Dry","Ice Hammer"],"Weak":["fire","rock","fighting"],"Resist":["ice"],"Immune":[]}

fire={"Pokemon":["Charizard","Houndoom","Camerupt","Infernape","Chandelure","Pyroar","Salazzle","Talonflame","Magcargo"],"Moves":["Flamethrower","Inferno","Lava Plume","Flare Blitz","Flame Burst","Fire Fang","Fire Punch","Fire Blast"],"Weak":["water","ground","rock"],"Resist":["ice","fire","steel","grass","bug","fairy"],"Immune":[]}

ground={"Pokemon":["Dugtrio","Gliscor","Camerupt","Mamoswine","Seismitoad","Diggersby","Palossand","Garchomp","Claydol"],"Moves":["Earthquake","Bulldoze","Earth Power","Dig"],"Weak":["water","ice","grass"],"Resist":["rock","poison"],"Immune":["electric"]}

rock={"Pokemon":["Aerodactyl","Magcargo","Aggron","Rampardos","Crustle","Aurorus","Lycanroc","Tyranitar","Tyrantrum"],"Moves":["Rock Tomb","Stone Edge","Rock Slide","Ancient Power","Head Smash","Rock Wrecker","Power Gem"],"Weak":["water","ground","steel","grass"],"Resist":["fire","poison","flying","normal"],"Immune":[]}

steel={"Pokemon":["Magnezone","Skarmory","Aggron","Empoleon","Ferrothorn","Aegislash","Lucario","Bisharp","Metagross"],"Moves":["Flash Cannon","Iron Head","Metal Claw","Steel Wing","Iron Tail","Meteor Mash"],"Weak":["fire","ground","fighting"],"Resist":["ice","rock","steel","psychic","grass","bug","fairy","flying","dragon","normal"],"Immune":["poison"]}

fighting={"Pokemon":["Machamp","Heracross","Breloom","Infernape","Mienshao","Hawlucha","Crabominable","Lucario","Gallade"],"Moves":["Brick Break","Wake-Up Slap","Close Combat","Sky Uppercut","Hammer Arm","Sacred Sword","Aura Sphere","Superpower","Jump Kick","Flying Press","Low Sweep"],"Weak":["psychic","flying","fairy"],"Resist":["rock","dark","bug"],"Immune":[]}

psychic={"Pokemon":["Jynx","Claydol","Gallade","Swoobat","Meowstic","Oranguru","Metagross","Alakazam"],"Moves":["Extrasensory","Zen Headbutt","Psychic","Psycho Cut","Psybeam","Psyshock"],"Weak":["dark","ghost","bug"],"Resist":["fighting","psychic"],"Immune":[]}

dark={"Pokemon":["Umbreon","Houndoom","Absol","Weavile","Zoroark","Greninja","Hydreigon","Tyranitar","Bisharp"],"Moves":["Dark Pulse","Brutal Swing","Night Slash","Bite","Crunch","Knock Off","Payback"],"Weak":["fighting","bug","fairy"],"Resist":["dark","ghost"],"Immune":["psychic"]}

ghost={"Pokemon":["Gengar","Mismagius","Dusknoir","Drifblim","Chandelure","Aegislash","Palossand","Mimikyu","Trevenant"],"Moves":["Shadow Ball","Astonish","Shadow Claw","Phantom Force","Shadow Punch"],"Weak":["dark","ghost"],"Resist":["poison","bug"],"Immune":["fighting","normal"]}

poison={"Pokemon":["Gengar","Seviper","Dustox","Roserade","Garbodor","Dragalge","Salazzle","Venusaur","Weezing"],"Moves":["Poison Jab","Sludge Bomb","Venoshock","Belch","Sludge Wave"],"Weak":["ground","psychic"],"Resist":["fighting","poison","grass","bug"],"Immune":[]}

grass={"Pokemon":["Venusaur","Meganium","Ludicolo","Roserade","Ferrothorn","Trevenant","Lurantis","Breloom","Sceptile"],"Moves":["Energy Ball","Solar Beam","Giga Drain","Power Whip","Seed Bomb","Magical Leaf","Wood Hammer","Petal Dance","Frenzy Plant","Solar Blade","Leaf Blade"],"Weak":["ice","fire","poison","bug","flying"],"Resist":["water","ground","grass","electric"],"Immune":[]}

bug={"Pokemon":["Pinsir","Heracross","Dustox","Kricketune","Crustle","Galvantuala","Araquanid","Ribombee","Volbeat"],"Moves":["Leech Life","X-Scissor","Signal Beam","Megahorn","Silver Wind","Bug Buzz","Pollen Puff"],"Weak":["fire","rock","flying"],"Resist":["ground","fighting","grass"],"Immune":[]}

fairy={"Pokemon":["Clefable","Azumarill","Dedenne","Mimikyu","Ribombee","Togekiss","Wigglytuff","Granbull","Sylveon"],"Moves":["Play Rough","Dazzling Gleam","Draining Kiss","Disarming Voice","Moonblast"],"Weak":["steel","poison"],"Resist":["fighting","dark","bug"],"Immune":["dragon"]}

flying={"Pokemon":["Charizard","Skarmory","Salamance","Drifblim","Swoobat","Talonflame","Aerodactyl","Hawlucha","Togekiss"],"Moves":["Aerial Ace","Air Slash","Acrobatics","Brave Bird","Bounce","Fly","Sky Attack"],"Weak":["ice","rock","electric"],"Resist":["fighting","grass","bug"],"Immune":[]}

dragon={"Pokemon":["Salamence","Garchomp","Hydreigon","Tyrantrum","Drampa","Dragalge","Goodra","Haxorus","Druddigon"],"Moves":["Dragon Pulse","Draco Meteor","Dragon Claw","Dragon Tail","Outrage","Dragon Rush"],"Weak":["ice","fairy","dragon"],"Resist":["water","fire","grass","electric"],"Immune":[]}

normal={"Pokemon":["Wigglytuff","Furret","Exploud","Snorlax","Stoutland","Pyroar","Oranguru","Diggersby","Drampa"],"Moves":["Take Down","Explosion","Hyper Voice","Giga Impact","Hyper Beam"],"Weak":["fighting"],"Resist":[],"Immune":["ghost"]}

electric={"Pokemon":["Magnezone","Lanturn","Manectric","Electivire","Galvantula","Dedenne","Raichu","Eelektross","Ampharos"],"Moves":["Discharge","Thunder Punch","Wild Charge","Thunder Fang","Charge Beam","Thunderbolt","Thunder","Volt Tackle"],"Weak":["ground"],"Resist":["steel","flying","electric"],"Immune":[]}

pokemon={"Blastoise":[165,110,["Hydropump","Earthquake","Ice Beam","Dark Pulse"]],"Azumarill":[185,80,["Surf","Play Rough","Brick Break","Ice Beam"]],"Walrein":[195,95,["Blizzard","Surf","Earthquake","Rock Tomb"]],"Empoleon":[170,90,["Scald","Flash Cannon","Aerial Ace","Earthquake"]],"Seismitoad":[190,105,["Muddy Water","Earthquake","Poison Jab","Brick Break"]],"Greninja":[155,155,["Dark Pulse","Waterfall","Aerial Ace","Extrasensory"]],"Araquanid":[150,75,["Liquidation","Leech Life","Frost Breath","Poison Jab"]],"Ludicolo":[165,100,["Surf","Energy Ball","Ice Beam","Zen Headbutt"]],"Lanturn":[210,95,["Discharge","Surf","Ice Beam","Dazzling Gleam"]],"Jynx":[150,125,["Ice Punch","Psychic","Shadow Ball","Wake-Up Slap"]],"Mamoswine":[195,110,["Ice Fang","Earthquake","Stone Edge","Take Down"]],"Froslass":[155,140,["Shadow Ball","Blizzard","Draining Kiss","Psychic"]],"Vanilluxe":[155,110,["Ice Beam","Flash Cannon","Astonish","Explosion"]],"Aurorus":[205,90,["Freeze-Dry","Stone Edge","Earthquake","Psychic"]],"Crabominable":[180,75,["Ice Hammer","Close Combat","Brutal Swing","Iron Head"]],"Weavile":[155,155,["Night Slash","Metal Claw","Aerial Ace","Ice Beam"]],"Glaceon":[150,95,["Blizzard","Ice Beam","Shadow Ball","Bite"]],"Charizard":[160,130,["Flamethrower","Air Slash","Earthquake","Thunder Punch"]],"Houndoom":[160,125,["Inferno","Crunch","Solar Beam","Sludge Bomb"]],"Camerupt":[155,70,["Lava Plume","Earthquake","Solar Beam","Flash Cannon"]],"Infernape":[160,140,["Close Combat","Flare Blitz","Acrobatics","Rock Slide"]],"Chandelure":[145,110,["Flame Burst","Shadow Ball","Energy Ball","Psychic"]],"Pyroar":[170,135,["Flamethrower", "Hyper Voice","Wild Charge","Bulldoze"]],"Salazzle":[150,145,["Flamethrower","Sludge Bomb","Leech Life","Dragon Pulse"]],"Talonflame":["Brave Bird","Flare Blitz","Steel Wing","Giga Impact"],"Magcargo":[145,60,["Lava Plume","Ancient Power","Solar Beam","Explosion"]],"Dugtrio":[120,150,["Earthquake","Sludge Bomb","Rock Slide","Flash Cannon"]],"Gliscor":[160,125,["Earthquake","Acrobatics","Thunder Fang","Sky Uppercut"]],"Diggersby":[170,110,["Earthquake","Hammer Arm","Bounce","Wild Charge"]],"Palossand":[170,65,["Earth Power","Shadow Ball","Giga Drain","Rock Slide"]],"Garchomp":[190,135,["Earthquake","Draco Meteor","Poison Jab","Stone Edge"]],"Claydol":[145,105,["Psychic","Earthquake","Stone Edge","Dazzling Gleam"]],"Aerodactyl":[165,160,["Stone Edge","Fly","Earthquake","Dragon Claw"]],"Aggron":[155,80,["Iron Tail","Stone Edge","Shadow Claw","Dragon Claw"]],"Rampardos":[180,90,["Head Smash","Zen Headbutt","Earthquake","Dragon Tail"]],"Crustle":[155,75,["Rock Wrecker","X-Scissor","Solar Beam","Bulldoze"]],"Lycanroc":[160,115,"Stone Edge","Fire Fang","Crunch","Brick Break"],"Tyranitar":[185,90,["Crunch","Stone Edge","Ice Beam","Dragon Claw"]],"Tyrantrum":[170,100,["Head Smash","Outrage","Brick Break","Earthquake"]],"Magnezone":[155,90,["Zap Cannon","Flash Cannon","Signal Beam","Explosion"]],"Skarmory":[150,100,["Steel Wing","Air Slash","Rock Slide","Night Slash"]],"Ferrothorn":[160,50,["Power Whip","Iron Head","Bulldoze","Aerial Ace"]],"Aegislash":[145,90,["Shadow Claw","Iron Head","Sacred Sword","Rock Slide"]],"Lucario":[155,120,["Aura Sphere","Flash Cannon","Earthquake","Dragon Pulse"]],"Bisharp":[150,100,["Iron Head","Night Slash","Aerial Ace","Stone Edge"]],"Metagross":[165,100,["Meteor Mash","Psychic","Hammer Arm","Earthquake"]],"Machamp":[175,85,["Superpower","Thunder Punch","Poison Jab","Knock Off"]],"Heracross":[165,115,["Megahorn","Close Combat","Stone Edge","Venoshock"]],"Breloom":[145,100,["Sky Uppercut","Seed Bomb","Stone Edge","Iron Tail"]],"Mienshao":[150,135,["Jump Kick","Rock Tomb","Payback","Poison Jab"]],"Hawlucha":[160,150,["Flying Press","Sky Attack","Rock Slide","Poison Jab"]],"Gallade":[150,110,["Psycho Cut","Close Combat","Poison Jab","Dazzling Gleam"]],"Swoobat":[150,145,["Psychic","Air Slash","Shadow Ball","Charge Beam"]],"Meowstic":[160,135,["Psychic","Disarming Voice","Shadow Ball","Magical Leaf"]],"Oranguru":[175,90,["Zen Headbutt","Energy","Brutal Swing","Charge Beam"]],"Alakazam":[140,150,["Psychic","Dazzling Gleam","Shadow Ball","Hyper Beam"]],"Umbreon":[180,95,["Dark Pulse","Psychic","Shadow Ball","Hyper Beam"]],"Absol":[150,105,["Night Slash","Psycho Cut","Ice Beam","Thunderbolt"]],"Zoroark":[145,135,["Night Slash","Shadow Claw","Low Sweep","Flamethrower"]],"Hydreigon":[175,130,["Dragon Rush","Crunch","Earthquake","Steel Wing"]],"Gengar":[145,140,["Shadow Ball","Dazzling Gleam","Sludge Bomb","Ice Punch"]],"Mismagius":[145,135,["Phantom Force","Dazzling Gleam","Energy Ball","Charge Beam"]],"Dusknoir":[130,75,["Shadow Punch","Fire Punch","Ice Punch","Thunder Punch"]],"Drifblim":[235,110,["Shadow Ball","Fly","Thunderbolt","Psychic"]],"Mimikyu":[140,125,["Shadow Claw","Play Rough","Thunderbolt","X-Scissor"]],"Trevenant":[170,85,["Wood Hammer","Phantom Force","Earthquake","Focus Blast"]],"Seviper":[155,95,["Belch","Crunch","X-Scissor","Dragon Tail"]],"Dustox":[145,95,["Sludge Bomb","Silver Wind","Energy Ball","Shadow Ball"]],"Roserade":[145,120,["Energy Ball","Sludge Bomb","Shadow Ball","Dazzling Gleam"]],"Garbodor":[165,105,["Belch","Explosion","Solar Beam","Dark Pulse"]],"Dragalge":[150,75,["Sludge Bomb","Dragon Pulse","Hydro Pump","Thunder"]],"Venusaur":[165,110,["Solar Beam","Sludge Bomb","Earthquake","Outrage"]],"Weezing":[150,90,["Sludge Bomb","Dark Pulse","Psybeam","Explosion"]],"Meganium":[165,110,["Petal Dance","Earthquake","Frenzy Plant","Iron Tail"]],"Lurantis":[155,75,["Solar Blade","X-Scissor","Brick Break","Poison Jab"]],"Sceptile":[155,150,["Leaf Blade","Rock Slide","Earthquake","Dragon Claw"]],"Pinsir":[150,135,["X-Scissor","Superpower","Earthquake","Stone Edge"]],"Kricketune":[160,95,["Bug Buzz","Brick Break","Night Slash","Aerial Ace"]],"Galvantula":[155,140,["Bug Buzz","Discharge","Energy Ball","Poison Jab"]],"Ribombee":[145,155,["Pollen Puff","Dazzling Gleam","Energy Ball","Psychic"]],"Volbeat":[150,115,["Bug Buzz","Play Rough","Thunderbolt","Brick Break"]],"Clefable":[180,90,["Moonblast","Psychic","Fire Blast","Ice Beam"]],"Dedenne":[150,130,["Discharge","Play Rough","Aerial Ace","Charge Beam"]],"Togekiss":[170,110,["Metronome","Aura Sphere","Dazzling Gleam","Sky Attack"]],"Wigglytuff":[225,75,["Play Rough","Fire Blast","Psychic","Shadow Ball"]],"Granbull":[175,75,["Play Rough","Outrage","Earthquake","Crunch"]],"Sylveon":[180,90,["Moonblast","Psyshock","Shadow Ball","Dig"]],"Salamence":[180,130,["Draco Meteor","Fly","Steel Wing","Fire Blast"]],"Drampa":[160,65,["Dragon Pulse","Fly","Steel Wing","Energy Ball"]],"Goodra":[175,110,["Outrage","Sludge Wave","Focus Blast","Muddy Water"]],"Haxorus":[160,125,["Outrage","Poison Jab","Brick Break","Earthquake"]],"Druddigon":[160,80,["Dragon Claw","Rock Tomb","Sludge Bomb","Shadow Claw"]],"Furret":[170,120,["Surf","Thunderbolt","Shadowball","Flamethrower"]],"Exploud":[190,100,["Boomburst","Crunch","Ice Beam","Solar Beam"]],"Snorlax":[245,60,["Hyper Beam","Superpower","Earthquake","Blizzard"]],"Stoutland":[170,110,["Giga Impact","Fire Fang","Thunder Fang","Ice Fang"]],"Manectric":[155,135,["Wild Charge","Ice Fang","Fire Fang","Iron Tail"]],"Electivire":[160,125,["Thunder","Ice Punch","Focus Blast","Rock Slide"]],"Raichu":[145,140,["Volt Tackle","Surf","Iron Tail","Brick Break"]],"Eelektross":[170,80,["Zap Cannon","Flash Cannon","Dragon Claw","Flamethrower"]],"Ampharos":[175,85,["Zap Cannon","Dragon Pulse","Fire Punch","Power Gem"]]}

moves={"Hydropump":120,"Surf":90,"Scald":80,"Waterfall":80,"Muddy Water":90,"Liquidation":85,"Ice Beam":90,"Blizzard":110,"Frost Breath":60,"Ice Punch":75,"Ice Fang":65,"Freeze-Dry":70,"Ice Hammer":100,"Flamethrower":90,"Inferno":100,"Lava Plume":80,"Flare Blitz":120,"Flame Burst":70,"Fire Fang":65,"Fire Punch":75,"Fire Blast":110,"Earthquake":100,"Bulldoze":60,"Earth Power":90,"Dig":80,"Rock Tomb":60,"Stone Edge":100,"Rock Slide":75,"Ancient Power":60,"Head Smash":150,"Rock Wrecker":150,"Power Gem":80,"Flash Cannon":80,"Iron Head":80,"Metal Claw":50,"Steel Wing":70,"Iron Tail":100,"Meteor Mash":90,"Brick Break":75,"Wake-Up Slap":70,"Close Combat":120,"Sky Uppercut":85,"Hammer Arm":100,"Sacred Sword":90,"Aura Sphere":80,"Superpower":120,"Jump Kick":100,"Flying Press":100,"Low Sweep":65,"Focus Blast":120,"Extrasensory":80,"Zen Headbutt":80,"Psychic":90,"Psycho Cut":70,"Psybeam":65,"Psyshock":80,"Dark Pulse":80,"Brutal Swing":60,"Night Slash":70,"Bite":60,"Crunch":80,"Knock Off":65,"Payback":50,"Shadow Ball":80,"Astonish":30,"Shadow Claw":70,"Phantom Force":90,"Shadow Punch":60,"Poison Jab":80,"Sludge Bomb":90,"Venoshock":65,"Belch":120,"Sludge Wave":95,"Energy Ball":90,"Solar Beam":120,"Giga Drain":75,"Power Whip":120,"Seed Bomb":80,"Magical Leaf":60,"Wood Hammer":120,"Petal Dance":120,"Frenzy Plant":150,"Solar Blade":125,"Leaf Blade":90,"Leech Life":80,"X-Scissor":80,"Signal Beam":75,"Megahorn":120,"Silver Wind":60,"Bug Buzz":90,"Pollen Puff":90,"Play Rough":90,"Dazzling Gleam":80,"Draining Kiss":50,"Disarming Voice":40,"Moonblast":95,"Aerial Ace":60,"Air Slash":75,"Acrobatics":55,"Brave Bird":120,"Bounce":"85","Fly":90,"Sky Attack":140,"Dragon Pulse":85,"Draco Meteor":130,"Dragon Claw":80,"Dragon Tail":60,"Outrage":120,"Dragon Rush":100,"Take Down":90,"Explosion":250,"Hyper Voice":90,"Giga Impact":150,"Hyper Beam":150,"Discharge":80,"Thunder Punch":75,"Wild Charge":90,"Thunder Fang":65,"Zap Cannon":120,"Charge Beam":50,"Thunderbolt":90,"Thunder":110,"Volt Tackle":120}

types=[water,ice,fire,ground,rock,steel,fighting,psychic,dark,ghost,poison,grass,bug,fairy,flying,dragon,normal,electric]

typelist=["water","ice","fire","ground","rock","steel","fighting","psychic","dark","ghost","poison","grass","bug","fairy","flying","dragon","normal","electric"]

#Name: Apply STAB (short for Same Type Attack Bonus)
#Description: This function checks to see if the selected move is the same type as the active Pokemon 
def apply_STAB(base,atk,attack):
  typ=''
  typ1=''
  typ2=''
  for cat in types:
    if attack in cat["Pokemon"]:
      if typ1=='':
        typ1=cat
      else:
        typ2=cat
  for cat in types:
    if atk in cat["Moves"]:
      typ=cat
  if typ==typ1 or typ==typ2:
    base+=base//2
  return base

def apply_weakness(base,atk,defend):
  typ=''
  typ1=''
  typ2=''
  for cat in types:
    if defend in cat["Pokemon"]:
      if typ1=='':
        typ1=cat
      else:
        typ2=cat
  for cat in types:
    if atk in cat["Moves"]:
      typdex=types.index(cat)
      typ=typelist[typdex]
  if typ in typ1["Weak"]:
    base+=base
  if typ2!='':
    if typ in typ2["Weak"]:
      base+=base
  return base

def apply_resistance(base,atk,defend):
  typ=''
  typ1=''
  typ2=''
  for cat in types:
    if defend in cat["Pokemon"]:
      if typ1=='':
        typ1=cat
      else:
        typ2=cat
  for cat in types:
    if atk in cat["Moves"]:
      typdex=types.index(cat)
      typ=typelist[typdex]
  if typ in typ1["Resist"]:
    base=base//2
  if typ2!='':
    if typ in typ2["Resist"]:
      base=base//2
  return base

def apply_immunity(base,atk,defend):
  typ=''
  typ1=''
  typ2=''
  for cat in types:
    if defend in cat["Pokemon"]:
      if typ1=='':
        typ1=cat
      else:
        typ2=cat
  for cat in types:
    if atk in cat["Moves"]:
      typdex=types.index(cat)
      typ=typelist[typdex]
  if typ in typ1["Immune"]:
    base=0
  if typ2!='':
    if typ in typ2["Immune"]:
      base=0
  return base

def who_dat(pokerman):
  for cat in types:
    if pokerman in cat["Pokemon"]:
      index=types.index(cat)
      print(pokerman+" has "+str(pokemon[pokerman][0])+" Health, "+str(pokemon[pokerman][1])+" Speed, is a "+typelist[index]+" type, and knows these moves: "+str(pokemon[pokerman][2]))
  for move in pokemon[pokerman][2]:
    for cat in types:
      if move in cat["Moves"]:
        index=types.index(cat)
        print(move+" does "+str(moves[move])+" base damage and is a "+typelist[index]+" type move.")

playing=True
choices=[]
for key in pokemon:
  choices.append(key)
helptext="Say 'add' to add a Pokemon to your team, 'help' to bring up your options, or 'who' to get details on a specific Pokemon."
battlehelp=" Your goal is to defeat every Pokemon on your enemy's team. Say 'fight' to select an attack, 'switch' to change your active Pokemon, 'help' to bring up your options. After choosing 'fight', 'details' shows what your Pokemon's moves do. After choosing 'switch', 'details' shows what Pokemon you have and what they can do. Choosing 'quit' ends the game prematurely."
team=[]
enemy=[]
for i in range(7):
  enemy.append(choices[random.randint(0,len(choices))])
backup={}

print("Welcome to the wonderful world of Pokemon! My name is Hazel, but people in the Pacifica Region call me the Pokemon Professor! Here in the Pacifica Region, trainers are given a team of Pokemon for scheduled battles. You will be one of these trainers. First, you must select a team from the given Pokemon.")
print("The pokemon available to you are "+str(choices))
print(helptext)

while len(team)<6:
  option=input("What would you like to do? ")
  if option=="add":
    choice=input("Which Pokemon would you like to add? ")
    team.append(choice)
    print("You have "+str(6-len(team))+" spots left in your team.")

  elif option=="who":
    choice=input("Which Pokemon would you like to learn more about? ")
    who_dat(choice)

  elif option=="help":
    print(helptext)
  else:
    print("Please enter a valid option!")

active=team[random.randint(0,5)]
activeHP=pokemon[active][0]
bactive=enemy[random.randint(0,5)]
bactiveHP=pokemon[bactive][0]

choice=input("Would you like to hear how battles work? ['yes', 'no'] ")
if choice=="yes":
  print(battlehelp)
print("Your opponent engages!")
print("Opponent sends out "+bactive+"!")
print("Go, "+active+"!")

while playing or team!=[] or enemy!=[]:
  print(active+" has "+str(activeHP)+" Health left!")
  print(bactive+" is at "+str(bactiveHP)+" Health left!")
  choice=input("What will you do? ['fight', 'switch', 'help', 'quit'] ")
  if choice=="fight":
    choice=input("Choose a move: "+str(pokemon[active][2])+" ")
    if choice in pokemon[active][2]:
      if pokemon[active][1]>pokemon[bactive][1]:
        if choice=="Metronome":
          print(active+" used Metronome!")
          choice=random.choice(list(moves.keys()))
        print(active+" used "+choice+"!")
        damage=moves[choice]
        damage=apply_STAB(damage,choice,active)
        damage=apply_weakness(damage,choice,bactive)
        damage=apply_resistance(damage,choice,bactive)
        damage=apply_immunity(damage,choice,bactive)
        
        if bactiveHP-damage>=0:
          bactiveHP=bactiveHP-damage
          bchoice=pokemon[bactive][2][random.randint(0,3)]
          if bchoice=="Metronome":
            print(bactive+" used Metronome!")
            bchoice=random.choice(list(moves.keys()))
          bdamage=moves[bchoice]
          bdamage=apply_STAB(bdamage,bchoice,bactive)
          bdamage=apply_weakness(bdamage,bchoice,active)
          bdamage=apply_resistance(bdamage,bchoice,active)
          bdamage=apply_immunity(bdamage,bchoice,active)
          print(bactive+" used "+bchoice+"!")
          if activeHP-bdamage>=0:
            activeHP=activeHP-bdamage
          else:
            activeHP=0
            print(active+" fainted! Good job out there, pal!")
        else:
          bactiveHP=0
          print(bactive+" was knocked out!")
          
      elif pokemon[active][1]<pokemon[bactive][1]:
        bchoice=pokemon[bactive][2][random.randint(0,3)]
        if bchoice=="Metronome":
          print(bactive+" used Metronome!")
          bchoice=random.choice(list(moves.keys()))
        bdamage=moves[bchoice]
        bdamage=apply_STAB(bdamage,bchoice,bactive)
        bdamage=apply_weakness(bdamage,bchoice,active)
        bdamage=apply_resistance(bdamage,bchoice,active)
        bdamage=apply_immunity(bdamage,bchoice,active)
        print(bactive+" used "+bchoice+"!")
        
        if choice=="Metronome":
          print(active+" used Metronome!")
          choice=random.choice(list(moves.keys()))
        print(active+" used "+choice+"!")
        damage=moves[choice]
        damage=apply_STAB(damage,choice,active)
        damage=apply_weakness(damage,choice,bactive)
        damage=apply_resistance(damage,choice,bactive)
        damage=apply_immunity(damage,choice,bactive)
        if activeHP-bdamage>=0:
            activeHP=activeHP-bdamage
            if bactiveHP-damage>=0:
              bactiveHP=bactiveHP-damage
            else:
              bactiveHP=0
              print(bactive+" was knocked out!")
        else:
          activeHP=0
          print(active+" fainted! Good job out there, pal!")
      
      elif pokemon[active][1]==pokemon[bactive][1]:
        first=random.randint(0,2)
        if first==0:
          
          if choice=="Metronome":
            print(active+" used Metronome!")
            choice=random.choice(list(moves.keys()))
          print(active+" used "+choice+"!")
          damage=moves[choice]
          damage=apply_STAB(damage,choice,active)
          damage=apply_weakness(damage,choice,bactive)
          damage=apply_resistance(damage,choice,bactive)
          damage=apply_immunity(damage,choice,bactive)
          print(active+" used "+choice+"!")
        
          if bactiveHP-damage>=0:
            bactiveHP=bactiveHP-damage
            bchoice=pokemon[bactive][2][random.randint(0,3)]
            if bchoice=="Metronome":
              print(bactive+" used Metronome!")
              bchoice=random.choice(list(moves.keys()))
            bdamage=moves[choice]
            bdamage=apply_STAB(bdamage,bchoice,bactive)
            bdamage=apply_weakness(bdamage,bchoice,active)
            bdamage=apply_resistance(bdamage,bchoice,active)
            bdamage=apply_immunity(bdamage,bchoice,active)
            print(bactive+" used "+bchoice+"!")
            if activeHP-bdamage>=0:
              activeHP=activeHP-bdamage
            else:
              activeHP=0
              print(active+" fainted! Good job out there, pal!")
          else:
            bactiveHP=0
            print(bactive+" was knocked out!")
        
        elif first==1:
          bchoice=pokemon[bactive][2][random.randint(0,3)]
          if bchoice=="Metronome":
            print(bactive+" used Metronome!")
            bchoice=random.choice(list(moves.keys()))
          bdamage=moves[bchoice]
          bdamage=apply_STAB(bdamage,bchoice,bactive)
          bdamage=apply_weakness(bdamage,bchoice,active)
          bdamage=apply_resistance(bdamage,bchoice,active)
          bdamage=apply_immunity(bdamage,bchoice,active)
          print(bactive+" used "+bchoice+"!")
        else:
          damage=moves[choice]
          if choice=="Metronome":
            print(active+" used Metronome!")
            choice=random.choice(list(moves.keys()))
          print(active+" used "+choice+"!")
          damage=moves[choice]
          damage=apply_STAB(damage,choice,active)
          damage=apply_weakness(damage,choice,bactive)
          damage=apply_resistance(damage,choice,bactive)
          damage=apply_immunity(damage,choice,bactive)
        if activeHP-bdamage>=0:
          activeHP=activeHP-bdamage
          if bactiveHP-damage>=0:
            bactiveHP=bactiveHP-damage
          else:
            bactiveHP=0
          print(bactive+" was knocked out!")
        else:
          activeHP=0
          print(active+" fainted! Good job out there, pal!")
        
      if choice=="Explosion":
        activeHP=0
        print(active+" fainted! Good job out there, pal!")
      
      if activeHP==0:
        team.remove(active)
        if team==[]:
          break
        while active not in team:
          active=input("Choose your next Pokemon. "+str(team)+" Or say 'who' for details. ")
          
          if active=="who":
            choice=input("Which Pokemon would you like to learn more about? ")
            who_dat(choice)

        print(active+", I choose you!")
        activeHP=pokemon[active][0]

      if bactiveHP==0:
        enemy.remove(bactive)
        if enemy==[]:
          break
        bactive=enemy[random.randint(0,len(enemy)-1)]
        bactiveHP=pokemon[bactive][0]
        print("Opponent sent out "+bactive+"!")

  elif choice=="switch":
    available=[]
    available=team
    available.remove(active)
    option=""
    while option not in available:
      option=input("Which Pokemon do you want to switch to? "+str(available)+" Or say 'who' for details. ") 
      if option=="who":
        choice=input("Which Pokemon would you like to learn more about? ")
        who_dat(choice)
    backup[active]=activeHP
    team.append(active)
    print("Come back, "+active+"! Now, come on out "+option+"!")
    active=option
    if option in backup:
      activeHP=backup[option]
    else:
      activeHP=pokemon[active][0]
    
  elif choice=="help":
    print(battlehelp)
  
  elif choice=="quit":
    playing=False

if team==[]:
  print("Opponent has won!")
elif enemy==[]:
  print("You win!")
print("Thank you for playing!")
?