forked from rabinovichr/Project02
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMerchant.java
46 lines (43 loc) · 1.27 KB
/
Merchant.java
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
package Project02;
public class Merchant 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 Merchant(String nation, String tribe, int lifePoints) {
super(nation, tribe, PeopleType.SpecialEncounter, lifePoints);
myDescription = "Merchant";
}
@Override
public int encounterStrategy(People otherPerson)
{
int lifepoints = 0;
if (otherPerson.getNation().equals("Special Scenario"))
{
if (otherPerson.getTribe().equals("Character"))
{
return lifepoints;
}
if (otherPerson.getTribe().equals("Animals"))
{
lifepoints = -this.getLifePoints();
return lifepoints;
}
}
else
{
if (otherPerson.getType().equals(PeopleType.healer))
{
lifepoints = (this.getLifePoints() - otherPerson.getLifePoints())/2;
return lifepoints;
}
else
{
lifepoints = -this.getLifePoints();
return lifepoints;
}
}
return lifepoints;
}
}