forked from justinszaro/WarringNations
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathElizabethHealer.java
More file actions
43 lines (38 loc) · 1.5 KB
/
ElizabethHealer.java
File metadata and controls
43 lines (38 loc) · 1.5 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
/**
* The Elizabeth Healer is a healer, based on the opponent type, the cleric will heal or fight
* @author Max Schuman, Elizabeth Vicente, Tanishq Iyer, Justin Szaro
* @version 3.0
* @since 2021-04-11
*/
public class ElizabethHealer extends People {
public ElizabethHealer(String nation, String tribe, int lifePoints) {
super(nation, tribe, PeopleType.cleric, lifePoints, "Elizabeth's Healer");
myDescription = "\tElizabeth Healer";
}
/*** If we are from the same nation and I have more life ponts than them, return a negative value
* If we are from different nations
* Encounter Wizard- Run Away
* Encounter Warrior- Run Away
* Encounter Healer- Fight with half*/
@Override
public int encounterStrategy(People otherPerson) {
int numberOfLifePoints = 0;
if(this.getNation().equals(otherPerson.getNation())){
if(this.getLifePoints() > otherPerson.getLifePoints()){
numberOfLifePoints = -(this.getLifePoints()/3);
}
}
else{
if(otherPerson.getType() == PeopleType.wizard){
numberOfLifePoints = -this.getLifePoints();
}
else if(otherPerson.getType() == PeopleType.warrior) {
numberOfLifePoints = -this.getLifePoints();
}
else if(otherPerson.getType() == PeopleType.cleric){
numberOfLifePoints = this.getLifePoints()/2;
}
}
return numberOfLifePoints;
}
}