forked from rabinovichr/Project02
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWolf.java
More file actions
51 lines (45 loc) · 1.44 KB
/
Wolf.java
File metadata and controls
51 lines (45 loc) · 1.44 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
package Project02;
public class Wolf extends People{
/**
* @param nation Stores the String name of a nation
* @param tribe Stores the String name of a player's tribe
* @param lifePoints
*/
public Wolf(String nation, String tribe, int lifePoints) {
super(nation, tribe, PeopleType.SpecialEncounter, lifePoints);
myDescription = "Wolf";
}
@Override
public int encounterStrategy(People otherPerson)
{
int lifepoints = 0;
if (!otherPerson.getNation().equals("Special Scenario"))
{
if (otherPerson.getType().equals(PeopleType.warrior)) {
lifepoints = this.getLifePoints() / 4;
}
if (otherPerson.getType().equals(PeopleType.wizard)) {
lifepoints = this.getLifePoints() / 3;
}
if (otherPerson.getType().equals(PeopleType.healer)) {
lifepoints = this.getLifePoints();
}
}
else
{
if (otherPerson.getTribe().equals("Character"))
{
lifepoints = this.getLifePoints()/3;
}
if (otherPerson.getTribe().equals("Traps"))
{
lifepoints = -this.getLifePoints();
}
if (otherPerson.getTribe().equals("Animals"))
{
lifepoints = this.getLifePoints()/4;
}
}
return lifepoints;
}
}