-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMove.java
More file actions
58 lines (46 loc) · 1.26 KB
/
Copy pathMove.java
File metadata and controls
58 lines (46 loc) · 1.26 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
public class Move
{
// Private constants
// private static final int MAX_DAMAGE = 25;
private int power;
private String name;
private String type;
private double accuracy;
private int pp;
private boolean physical;
public Move(int power, String name, String type, double accuracy, int pp, boolean physical) {
this.power = power;
this.name = name;
this.type = type;
this.accuracy = accuracy;
this.pp = pp;
this.physical = physical;
}
public String getName() {
return name;
}
public String getType() {
return type;
}
public int getPower() {
return power;
}
public double getAccuracy() {
return accuracy;
}
public boolean isPhysical() {
return physical;
}
public int getPP() {
return pp;
}
public void useMove() {
pp--;
}
public String toString() {
return getName() + " (" + getPower() + " Damage, " + (int)(getAccuracy() * 100) + "% Accuracy, " + getPP() + " PP, " + (isPhysical() ? "Physical" : "Special") + ") -- " + getType();
}
public boolean equals(Move other) {
return this.name.equals(other.name) && this.power == other.power;
}
}