-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlastoise.java
131 lines (118 loc) · 3.22 KB
/
Blastoise.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
public class Blastoise extends Adventurer{
private int ppCount, ppMax;
public Blastoise(){
super("Blastoise", 40, "Water");
this.ppCount = 40;
this.ppMax = 40;
}
public Blastoise(String name){
super(name, 40, "Water");
this.ppCount = 40;
this.ppMax = 40;
}
public String getSpecialName() {
return "PP";
}
public int getSpecial() {
return ppCount;
}
public int getSpecialMax() {
return ppMax;
}
public void setSpecial(int n) {
ppCount = n;
}
public String attack(Adventurer other) {
int baseDmg = 2;
int sleep = (int)(Math.random() * 101);
if(this.getSleepStatus() == true && sleep < 75){
return this.toString() + " is asleep!";
}
this.setSleepStatus(false);
if(other.getProtect() == true){
baseDmg = 0;
other.setProtectStatus(false);
}
if(this.getHH() == true){
baseDmg*=2;
this.setHHStatus(false);
}
if(getSpecial() != getSpecialMax()) {
setSpecial(getSpecial() + 1);
}
if (other.getType().equals("Fire")){
other.applyDamage(baseDmg * 2);
return this.toString() + " used Aqua Tail! It's super effective! It did "+ baseDmg*2 +" dmg!";
}
if (other.getType().equals("Grass")){
other.applyDamage(baseDmg);
return this.toString() + " used Aqua Tail! It's not very effective... It did "+baseDmg/2+" dmg...";
}
other.applyDamage(baseDmg);
return this.toString() + " used Aqua Tail! It did "+baseDmg+" dmg!";
}
public String support(Adventurer other) {
// protect
int sleep = (int)(Math.random() * 101);
if(this.getSleepStatus() == true && sleep < 75){
return this.toString() + " is asleep!";
}
this.setSleepStatus(false);
if (getSpecial()-2 > 0){
other.setProtectStatus(true);
setSpecial(getSpecial() - 2);
if (other.toString().equals(this.toString())){
return this.toString() + " used Protect on itself!";
}
else{
return this.toString() + " used Protect! " + other.toString() + " was protected!";
}
}
else{
return "Not enough PP!";
}
}
public String support() {
// haze
int sleep = (int)(Math.random() * 101);
if(this.getSleepStatus() == true && sleep < 75){
return this.toString() + " is asleep!";
}
this.setSleepStatus(false);
if (getSpecial()-2 > 0){
for(int i = 0; i < 3; i++) {
if(Math.random() > 0.25) {
getFoe(i).setSleepStatus(false);
getFriend(i).setSleepStatus(false);
getFoe(i).setPoisonStatus(false);
getFriend(i).setPoisonStatus(false);
getFoe(i).setSeededStatus(false);
getFriend(i).setSeededStatus(false);
getFoe(i).setBurnStatus(false);
getFriend(i).setBurnStatus(false);
}
}
setSpecial(getSpecial() - 2);
return this.toString() + " used Haze! All status effects are cleared!";
}
else{
return "Not enough PP!";
}
}
public String specialAttack(Adventurer other) {
// helping hand
int sleep = (int)(Math.random() * 101);
if(this.getSleepStatus() == true && sleep < 75){
return this.toString() + " is asleep!";
}
this.setSleepStatus(false);
if (getSpecial()-5 > 0){
other.setHHStatus(true);
setSpecial(getSpecial() - 5);
return this.toString() + " used Helping Hand! " + this.toString() + " is ready to help " + other.toString() + "!";
}
else{
return "Not enough PP!";
}
}
}