forked from jomokojomoko/ICS-PROJECT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SocialCharismaEval.java
81 lines (78 loc) · 1.83 KB
/
SocialCharismaEval.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
public class SocialCharismaEval extends Evaluations
{
public SocialCharismaEval(String name, Player plyr)
{
super(name,plyr);
}
// Calculates mark for social charisma courses
// Uses the social charisma stat
public void calculateMark()
{
double mark = 0;
int grdLvl = super.user.getGrade();
int control = super.user.stats.getSocialCharisma();
int hapCap = super.user.stats.getHappiness();
if (grdLvl <= 10)
{
if (control < 7)
{
mark = 50;
}
else
{
mark = 75;
// Measures to make sure if the player has excessively high stats
// They cannot simply get 100
if (control > 15 && control < 30)
{
mark = mark + (control - 15) * 1;
}
else if (control > 30)
{
mark = mark + (Math.log10(control) * 10);
}
}
}
else if (grdLvl >= 11)
{
if (control < 15)
{
mark = 50;
}
else
{
mark = 70;
if (control > 30 && control < 50)
{
mark = mark + (control - 30) * 1;
}
else if (control > 50)
{
mark = mark + (Math.log10(control) * 10);
}
}
}
// Uses the boost functions of the Evaluations class to modify the mark
mark = super.teacherBoost(super.user.stats.getSocialCharisma(),mark);
mark = super.luckBoost(super.user.stats.getLuck(), mark);
// Ensures no mark over 100
if (mark > 100)
{
mark = 100;
}
// Punishes players for being unhappy
if (hapCap <= 1)
{
mark-=30;
}
else if (hapCap <3)
{
mark-=20;
}
else if (hapCap <5)
{
mark-=10;
}
super.setMark(mark);
}
}