-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVenusaur.java
156 lines (138 loc) · 3.81 KB
/
Venusaur.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
public class Venusaur extends Adventurer{
private int ppCount, ppMax;
public Venusaur(){
super("Venusaur", 50, "Grass");
this.ppCount = 40;
this.ppMax = 40;
}
public Venusaur(String s){
super(s, 50, "Grass");
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) {
// vine whip
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 (other.getType().equals("Water")){
other.applyDamage(baseDmg * 2);
if(getSpecial() != getSpecialMax()) {
setSpecial(getSpecial() + 1);
}
return this.toString() + " used Vine Whip! It's super effective! It did "+ baseDmg *2 +" dmg!";
}
if (other.getType().equals("Fire")){
other.applyDamage(baseDmg/2);
if(getSpecial() != getSpecialMax()) {
setSpecial(getSpecial() + 1);
}
return this.toString() + " used Vine Whip! It's not very effective... It did "+ baseDmg/2 +" dmg...";
}
other.applyDamage(baseDmg);
if(getSpecial() != getSpecialMax()) {
setSpecial(getSpecial() + 1);
}
return this.toString() + " used Vine Whip! It did "+ baseDmg +" dmg!";
}
public String support(Adventurer other) {
// leech seed
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.setSeededStatus(true);
setSpecial(getSpecial() - 2);
return this.toString() + " used Leech Seed! Seeds were planted on " + other.toString() + "!";
}
else{
return "Not enough PP!";
}
}
public String support() {
// sleep powder
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 < foeCount(); i++) {
if(Math.random() > 0.25) {
if (getFoe(i).getHP() != 0){
getFoe(i).setSleepStatus(true);
return this.toString() + " used Sleep Powder! " + getFoe(i).toString() + " has fallen asleep!";
}
}
}
setSpecial(getSpecial() - 2);
return this.toString() + " used Sleep Powder!";
}
else{
return "Not enough PP!";
}
}
public String specialAttack(Adventurer other) {
//sludge bomb
int sleep = (int)(Math.random() * 101);
if(this.getSleepStatus() == true && sleep < 75){
return this.toString() + " is asleep!";
}
this.setSleepStatus(false);
if (getSpecial()-5 > 0){
int baseDmg = 4;
if(other.getProtect() == true){
baseDmg = 0;
other.setProtectStatus(false);
}
if(this.getHH() == true){
baseDmg*=2;
this.setHHStatus(false);
}
setSpecial(getSpecial() - 5);
if(baseDmg != 0) {
if(Math.random() > 0.25) {
other.setPoisonStatus(true);
}
}
if (other.getType().equals("Water")){
other.applyDamage(baseDmg * 2);
return this.toString() + " used Sludge Bomb! It's super effective! It did "+ baseDmg*2+ " dmg!";
}
if (other.getType().equals("Fire")){
other.applyDamage(baseDmg/2);
return this.toString() + " used Sludge Bomb! It's not very effective... It did " + baseDmg/2 + " dmg...";
}
other.applyDamage(baseDmg);
return this.toString() + " used Sludge Bomb! It did " + baseDmg + " dmg!";
}
else{
return "Not enough PP!";
}
}
}