forked from rabinovichr/Project02
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFireKeeper.java
More file actions
31 lines (26 loc) · 1003 Bytes
/
FireKeeper.java
File metadata and controls
31 lines (26 loc) · 1003 Bytes
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
package Project02;
public class FireKeeper extends People {
FireKeeper(String nation, String tribe, int lifePoints)
{
super(nation, tribe, PeopleType.SpecialEncounter, lifePoints);
myDescription = "\tFireKeeper";
}
public int encounterStrategy(People otherPerson) {
if (otherPerson.getNation() != this.getNation()) // if the otherPerson isn't another special encounter
{
if (otherPerson.getType().equals(PeopleType.healer)) // if otherPerson is a wizard, heal
{
return -10;
}
else if (otherPerson.getType().equals(PeopleType.warrior)) // if otherPerson is a warrior, attack
{
return -15;
}
else if (otherPerson.getType().equals(PeopleType.wizard)) // if otherPerson == wizard, ignore
{
return -5;
}
}
return 0; // if otherPerson is another special encounter, do nothing
}
}