-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBoss.java
66 lines (54 loc) · 1.92 KB
/
Boss.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
import java.util.Random;
public class Boss extends Adventurer {
int shellSpinsMax, shellSpins;
int shellShocker;
public Boss(){
super("Bowser", 35);
shellSpinsMax = 3;
shellSpins = shellSpinsMax;
}
public String getSpecialName(){
return "shell spins";
}
public int getSpecial(){
return shellSpins;
}
public int getSpecialMax(){
return shellSpinsMax;
}
public void setSpecial(int n){
shellSpins = n;
}
public String attack(Adventurer other){
int damage = (int) (2 * (Math.random() + 3));
other.applyDamage(damage);
return this.getName() + " smashes " + other.getName() + " , dealing " + damage + " points of damage. ";
}
//attack all adventurers
public String attack(Adventurer[] adventurers){
String txt = "Bowser uses Bowser SMASH! ";
for (Adventurer marioChar : adventurers){
txt += attack(marioChar);
}
return txt;
}
public String support(Adventurer other){
// N/A???
return null;
}
public String support(){
int healing = (int) (Math.random() + 1);
this.heal(healing);
return this.getName() + " uses the powerful singing powers of the turtle, healing " + healing + " points of damage.";
}
public String specialAttack(Adventurer other){
if (this.getSpecial() <= 0) return this.getName() + " wasted a turn looking for shell spins he doesn't have";
if (this.getSpecial() > 0){
// smth with the status effect
setSpecial(getSpecial() - 1);
return this.getName() + " crawls into his shell and spins, assuming a more vulnerable state that deals more damage, consuming one " + this.getSpecialName() + ". ";
}
// smth with the status effect
return "Unable to use this move due to insufficient " + this.getSpecialName();
}
}