forked from justinszaro/WarringNations
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathElizabethWizard.java
More file actions
46 lines (39 loc) · 1.76 KB
/
ElizabethWizard.java
File metadata and controls
46 lines (39 loc) · 1.76 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
/**
* The Elizabeth Wizard is a wizard, that will fight an opponent warrior , and wizard
* heal their members and steal health from healers
* @author Max Schuman, Elizabeth Vicente, Tanishq Iyer, Justin Szaro
* @version 3.0
* @since 2021-04-11
*/
public class ElizabethWizard extends People {
public ElizabethWizard(String nation, String tribe, int lifePoints) {
super(nation, tribe, PeopleType.wizard, lifePoints, "Elizabeth's Wizard");
myDescription = "\tElizabeth Wizard";
}
/** 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- fight
* Encounter Warrior- fight
* Encounter Healer- Take all their lifepoints*/
@Override
public int encounterStrategy(People otherPerson) {
int numberOfLifePoints = 0;
if(this.getNation().equals(otherPerson.getNation())){ //if we're from the same nation
if(this.getLifePoints() > otherPerson.getLifePoints()){ //if I have more lifePoints than them returning a negative value
numberOfLifePoints = (otherPerson.getLifePoints()/3 - this.getLifePoints()/4);
}
}
else{ //different nations
if(otherPerson.getType() == PeopleType.wizard){
numberOfLifePoints = (this.getLifePoints()/2)-3; //when Liz Wiz encounters wizard
}
else if(otherPerson.getType() == PeopleType.warrior) { //when Liz Wiz encounters wizard
numberOfLifePoints = (this.getLifePoints()-10);
}
else if(otherPerson.getType() == PeopleType.cleric){
numberOfLifePoints = this.getLifePoints();
}
}
return numberOfLifePoints;
}
}