-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathSkeleton.java
More file actions
55 lines (44 loc) · 1.3 KB
/
Skeleton.java
File metadata and controls
55 lines (44 loc) · 1.3 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
package org.project.entity.enemies;
import org.project.entity.Entity;
import org.project.object.weapons.Weapon;
import static java.lang.Math.min;
public class Skeleton extends Enemy {
private boolean Resurrected = false;
public final static int BaseAttack = 25;
//constructor
public Skeleton(int lvl, Weapon weapon) {
super(lvl,1.25, weapon);
}
//Special Ability
@Override
public void Special(Entity target) {
if(super.IsDead && !Resurrected)
{
if(super.getLevel() == 1)
Resurrected = true;
else {
Resurrected = false;
super.setLevel(super.getLevel()/2);
}
super.IsDead = false;
this.heal(super.getMaxHP()/4);
}
}
//get status shows resurrected
@Override
public String getStatus() {
return "Skeleton" + " lvl." + getLevel()+ ": "
+ "HP (" + getHP() + "/" + getMaxHP() + ") |"
+ "Defending : " + "(" + isDefending() + ")" + " | Resurrected: " + Resurrected;
}
@Override
public String toString(){
return "Skeleton" + " lvl." + getLevel();
}
//getter for resurrected
@Override
public boolean isResurrected()
{
return this.Resurrected;
}
}