forked from justinszaro/WarringNations
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathElizabethArtifact.java
More file actions
66 lines (59 loc) · 2.99 KB
/
ElizabethArtifact.java
File metadata and controls
66 lines (59 loc) · 2.99 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* The Elizabeth Artificat is an angel, based on the type and dice value, the angel will heal
* @author Max Schuman, Elizabeth Vicente, Tanishq Iyer, Justin Szaro
* @version 3.0
* @since 2021-04-11
*/
public class ElizabethArtifact extends People {
public ElizabethArtifact(String nation, String tribe, int lifePoints) {
super(nation, tribe, PeopleType.angel, lifePoints, "Angel");
myDescription = "\tAngel Heals a player!";
turnsAvailable = lifePoints;
}
private int turnsAvailable;
/**
* If we are from different nations. If its a wizard and the lifepoint is divisible by 3 set a certain life point of
* numberOfLifePoints = otherPerson.getLifePoints() * damageValue; as well as this lifePoint (turnsAvailable) --;
* Other wise Modify the opponents lifepoints to be .modifyLifePoints(diceRollOfTurn.rollFaces(4) * turnsAvailable);
* <p>
* If its a warrior. If its divisible by 2, get a certain lifepoint by int damageValue = diceRollOfTurn.rollFaces(10);
* numberOfLifePoints = (int) Math.pow(otherPerson.getLifePoints(), damageValue); as well as this lifePoint (turnsAvailable) --;
* Not divisible by 2, then subtract one opponent life point by 1 at most 20 times.
* <p>
* If its a cleric, set this lifePoint (turnsAvailable) to 100 and return complete health
*/
@Override
public int encounterStrategy(People otherPerson) {
int numberOfLifePoints = 100;
Dice diceRollOfTurn = new Dice();
//different nations
if (otherPerson.getType() == PeopleType.wizard) {
if (turnsAvailable + otherPerson.getLifePoints() % 3 == 0) {
int damageValue = diceRollOfTurn.rollFaces(15);
numberOfLifePoints = otherPerson.getLifePoints() * damageValue;
turnsAvailable++;
}
otherPerson.modifyLifePoints(diceRollOfTurn.rollFaces(4) * turnsAvailable);
} else if (otherPerson.getType() == PeopleType.warrior) {
if (turnsAvailable * otherPerson.getLifePoints() % 2 == 0) {
int damageValue = diceRollOfTurn.rollFaces(10);
numberOfLifePoints = (int) Math.pow(otherPerson.getLifePoints(), damageValue);
turnsAvailable++;
} else {
int howManyTimesToGo = diceRollOfTurn.rollFaces(20);
while (howManyTimesToGo != 0) {
int lifePoints = otherPerson.getLifePoints() - 1;
otherPerson.modifyLifePoints(lifePoints);
howManyTimesToGo--;
}
numberOfLifePoints *= howManyTimesToGo;
}
} else if (otherPerson.getType() == PeopleType.cleric) {
numberOfLifePoints = -100;
while (turnsAvailable <= 100) {
turnsAvailable++;
}
}
return numberOfLifePoints;
}
}