-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpokemongame.py
More file actions
161 lines (147 loc) · 5.08 KB
/
Copy pathpokemongame.py
File metadata and controls
161 lines (147 loc) · 5.08 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
import random
import sys
bulb = "Bulbasaur"
char = "Charmander"
sqrt = "Squirtle"
pidgeyHP = 80
pokemon = input("A wild Pidgey appears! Who would you like to send out?: (Bulbasaur/Charmander/Squirtle) ")
i =0
while i == 0:
if pokemon == bulb:
print('Go,', bulb + '!')
pokeHP = 100
i += 1
elif pokemon == char:
print('Go,', char + '!')
pokeHP = 110
i+=1
elif pokemon == sqrt:
print('Go,', sqrt + '!')
pokeHP = 95
i+=1
else:
pokemon = input("You do not have " + pokemon + ". Please pick Bulbasaur/Charmander/Squirtle: ")
def bulbAttackList(x):
bulbMov = input('Select a move: (Vine Whip/Razor Leaf/Headbutt/Pound) ')
global pidgeyHP
i = 0
while i == 0:
if x == "Vine Whip":
pidgeyHP -= random.randint(10, 15)
i += 1
elif x == "Razor Leaf":
pidgeyHP -= random.randint(20, 24)
i += 1
elif x == "Headbutt":
pidgeyHP -= random.randint(13, 15)
i += 1
elif x == "Pound":
pidgeyHP -= random.randint(8, 30)
i += 1
else:
print("You do not have that attack. Please pick another: ")
return pidgeyHP
def charAttackList(x):
global pidgeyHP
i = 0
while i == 0:
if x == 'Ember':
pidgeyHP -= random.randint(13, 18)
i += 1
elif x == 'Scratch':
pidgeyHP -= random.randint(10, 14)
i += 1
elif x == 'Metal Claw':
pidgeyHP -= random.randint(10, 20)
i += 1
elif x == "Flamethrower":
pidgeyHP -= random.randint(20, 23)
i += 1
else:
print("You do not have that attack. Please pick another: ")
return pidgeyHP
def sqrtAttackList(x):
global pidgeyHP
i = 0
while i == 0:
if x == 'Water Gun':
pidgeyHP -= random.randint(8, 20)
i += 1
if x == 'Bubblebeam':
pidgeyHP -= random.randint(6, 23)
i += 1
if x == 'Return':
pidgeyHP -= random.randint(5, 37)
i += 1
if x == 'Tackle':
pidgeyHP -= random.randint(10, 15)
i += 1
else:
print("You do not have that attack. Please pick another: ")
return pidgeyHP
def pidgeyAttackList(x):
global pokeHP
if x == "Gust":
pokeHP -= random.randint(10, 15)
elif x == "Peck":
pokeHP -= random.randint(8, 10)
elif x == "Quick Attack":
pokeHP -= random.randint(10, 15)
return pokeHP
def pidgeyBot():
global pokemon
global pokeHP
global pidgeyHP
if pidgeyHP > 0:
print('Pidgey used', randomPidgey,'\n')
pidgeyAttackList(randomPidgey)
if pokeHP <= 0:
print(pokemon, 'fainted!')
else:
print(pokemon, 'has', pokeHP, 'HP left\n')
pidgeyList = ["Gust", "Peck", "Quick Attack"]
sqrtList = ['Water Gun', 'Bubblebeam', 'Return', 'Tackle']
charList = ['Ember', 'Scratch', 'Metal Claw', 'Flamethrower']
bulbMove = ["Vine Whip", "Razor Leaf", "Headbutt", "Pound"]
selectMove = input("What would you like to do? (Attack/Run): ")
randomPidgey = pidgeyList[random.randint(0, 2)]
while True:
if selectMove.lower() == 'run':
print('Got away safely!')
while pidgeyHP > 0 and pokeHP > 0:
randomPidgey = pidgeyList[random.randint(0, 2)]
if selectMove.lower() == 'attack':
if pokemon == bulb:
if pokeHP > 0:
if bulbMov in bulbMove:
print('Bulbasaur used', bulbMov + '!\n')
bulbAttackList(bulbMov)
if pidgeyHP <= 0:
print("Pidgey fainted!")
else:
print("Pidgey now has", pidgeyHP, 'HP left.\n')
pidgeyBot()
else:
i = 0
elif pokemon == char:
charMove = input('Select a move: (Ember/Scratch/Metal Claw/Flamethrower) ')
if pokeHP > 0:
if charMove in charList:
print('Charmander used', charMove + '!\n')
charAttackList(charMove)
if pidgeyHP <= 0:
print("Pidgey fainted!")
else:
print("Pidgey now has", pidgeyHP, 'HP left.\n')
pidgeyBot()
elif pokemon == sqrt:
sqrtMove = input('Select a move: (Water Gun/Bubblebeam/Return/Tackle) ')
if pokeHP > 0:
if sqrtMove in sqrtList:
print('Squirtle used', sqrtMove + '!\n')
sqrtAttackList(sqrtMove)
if pidgeyHP <= 0:
print("Pidgey fainted!")
else:
print("Pidgey now has", pidgeyHP, 'HP left.\n')
pidgeyBot()