forked from jomokojomoko/ICS-PROJECT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Evaluations.java
88 lines (76 loc) · 1.63 KB
/
Evaluations.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
abstract class Evaluations
{
// This class is responsible for simulating the marks for a player
// Has children who are evaluations for specific stats
// They are evaluted a little bit differently from each other and use the corresponding stat to calculate the mark
// Variables
private String name;
private int minCharisma;
private double mark;
Player user;
// constructor
public Evaluations(String eval, Player plyr)
{
name = eval;
user = plyr;
minCharisma = calcCharis();
}
// accesors and mutators
public String getName()
{
return name;
}
public void setName(String nm)
{
name = nm;
}
public int getMinCharisma()
{
return minCharisma;
}
public void setMinCharisma(int charis)
{
minCharisma = charis;
}
public double getMark()
{
return mark;
}
public void setMark(double mrk)
{
mark = mrk;
}
// calculate independent minimum charisma
private int calcCharis()
{
int charis;
charis =(int)( Math.random() * 10 + 5);
return charis;
}
// calculates the boost for a teacher
public double teacherBoost(int playerCharis, double mark)
{
if (playerCharis > minCharisma)
{
mark = mark + (Math.random()*5);
}
else
{
mark = mark - (Math.random()*8);
}
return mark;
}
// calculates the boost for current luck
public double luckBoost(int playerLuck, double mark)
{
int luck = playerLuck;
int choose = (int) Math.random()*10;
if (luck > choose)
{
mark = mark + (Math.random()*3);
}
return mark;
}
// calculates independent mark
abstract void calculateMark();
}