-
Notifications
You must be signed in to change notification settings - Fork 0
/
Move.java
204 lines (203 loc) · 5.76 KB
/
Move.java
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
/*
Name: Vinod Vairavaraj and Thomas Nghiem
Email: [email protected], [email protected]
Sources used: StackOverflow, GeeksForGeeks
This file is for all of the moves in the game.
*/
import java.lang.Math;
/**
* This class creates all of the moves in the game
*/
public class Move {
String name;
String type;
int attack;
//Creates all of the move objects for the game
public Move(String str)
{
//Charmander moves
if(str.equalsIgnoreCase("Scratch"))
{
name = "Scratch";
type = "Normal";
int range = 2;
attack = (int) (Math.random() * range) + 1;
}
if(str.equalsIgnoreCase("Ember"))
{
name = "Ember";
type = "Fire";
int range = 2;
attack = (int) (Math.random() * range) + 3;
}
if(str.equalsIgnoreCase("Fire Fang"))
{
name = "Fire Fang";
type = "Fire";
int range = 3;
attack = (int) (Math.random() * range) + 3;
}
if(str.equalsIgnoreCase("Flamethrower"))
{
name = "Flamethrower";
type = "Fire";
int range = 2;
attack = (int) (Math.random() * range) + 4;
}
//Bulbasaur moves
if(str.equalsIgnoreCase("Tackle"))
{
name = "Tackle";
type = "Normal";
int range = 2;
attack = (int) (Math.random() * range) + 1;
}
if(str.equalsIgnoreCase("Vine Whip"))
{
name = "Vine Whip";
type = "Grass";
int range = 2;
attack = (int) (Math.random() * range) + 3;
}
if(str.equalsIgnoreCase("Razor Leaf"))
{
name = "Razor Leaf";
type = "Grass";
int range = 3;
attack = (int) (Math.random() * range) + 3;
}
if(str.equalsIgnoreCase("Solar Beam"))
{
name = "Solar Beam";
type = "Grass";
int range = 2;
attack = (int) (Math.random() * range) + 4;
}
//Squirtle Moves
if(str.equalsIgnoreCase("Tail Whip"))
{
name = "Tail Whip";
type = "Normal";
int range = 2;
attack = (int) (Math.random() * range) + 1;
}
if(str.equalsIgnoreCase("Water Gun"))
{
name = "Water Gun";
type = "Water";
int range = 2;
attack = (int) (Math.random() * range) + 3;
}
if(str.equalsIgnoreCase("Water Pulse"))
{
name = "Water Pulse";
type = "Water";
int range = 3;
attack = (int) (Math.random() * range) + 3;
}
if(str.equalsIgnoreCase("Hydro Pump"))
{
name = "Hydro Pump";
type = "Water";
int range = 2;
attack = (int) (Math.random() * range) + 4;
}
//Snorlax Moves
if(str.equalsIgnoreCase("Belly Drum"))
{
name = "Belly Drum";
type = "Normal";
int range = 2;
attack = (int) (Math.random() * range) + 1;
}
//Tackle Already Present
if(str.equalsIgnoreCase("Body Slam"))
{
name = "Body Slam";
type = "Normal";
int range = 3;
attack = (int) (Math.random() * range) + 3;
}
if(str.equalsIgnoreCase("Giga Impact"))
{
name = "Giga Impact";
type = "Normal";
int range = 2;
attack = (int) (Math.random() * range) + 6;
}
//Eevee Moves
//Tail Whip already present
//Tackle already present
if(str.equalsIgnoreCase("Swift"))
{
name = "Swift";
type = "Normal";
int range = 3;
attack = (int) (Math.random() * range) + 3;
}
if(str.equalsIgnoreCase("Take Down"))
{
name = "Take Down";
type = "Normal";
int range = 2;
attack = (int) (Math.random() * range) + 4;
}
//Pikachu Moves
//Tail Whip already present
if(str.equalsIgnoreCase("Thunder Shock"))
{
name = "Thunder Shock";
type = "Electric";
int range = 2;
attack = (int) (Math.random() * range) + 2;
}
if(str.equalsIgnoreCase("Electro Ball"))
{
name = "Electro Ball";
type = "Electric";
int range = 3;
attack = (int) (Math.random() * range) + 3;
}
if(str.equalsIgnoreCase("Thunder"))
{
name = "Thunder";
type = "Electric";
int range = 2;
attack = (int) (Math.random() * range) + 4;
}
//Mewtwo Moves
if(str.equalsIgnoreCase("Disable"))
{
name = "Disable";
type = "Normal";
int range = 2;
attack = (int) (Math.random() * range) + 3;
}
if(str.equalsIgnoreCase("Psycho Cut"))
{
name = "Psycho Cut";
type = "Psychic";
int range = 2;
attack = (int) (Math.random() * range) + 5;
}
if(str.equalsIgnoreCase("Psychic"))
{
name = "Psychic";
type = "Psychic";
int range = 3;
attack = (int) (Math.random() * range) + 6;
}
if(str.equalsIgnoreCase("Psystrike"))
{
name = "Psystrike";
type = "Psychic";
int range = 2;
attack = (int) (Math.random() * range) + 12;
}
}
//Returns name of the Pokemon when printed
public String toString()
{
return name;
}
}