-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCalculateFormulas.java
More file actions
114 lines (104 loc) · 2.88 KB
/
CalculateFormulas.java
File metadata and controls
114 lines (104 loc) · 2.88 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/**
* Created by James Page on 2/24/2016.
*/
package Main;
public class CalculateFormulas
{
CalculateFormulas()
{}
//******************************************************************
public int GetHpBaseLine(int base, int nextLevel, int gradient)
{
return base + ((nextLevel - 1) * gradient);
}
public int GetMpBaseLine(int base, int nextLevel, int gradient)
{
return base + (((nextLevel - 1) * gradient) / 10);
}
public int GetMpBaseGain(int nextLevel, int gradient)
{
return ((nextLevel * gradient) / 10) - (((nextLevel - 1) * gradient) / 10);
}
public int GetDifference(int randomNumber, int baseLine, int currentStatNumber)
{
int minDifference = 0;
int maxDifference = 11;
int difference;
difference = randomNumber + ((int)( 100 * (baseLine / (double)currentStatNumber)) - 100);
if (difference < minDifference)
{
return minDifference;
}
else if (difference > maxDifference)
{
return maxDifference;
}
return difference;
}
public double GetHpStatIncreasePercentage(int difference)
{
switch (difference)
{
case 0:
return 0.40;
case 1:
return 0.50;
case 2:
return 0.50;
case 3:
return 0.60;
case 4:
return 0.70;
case 5:
return 0.80;
case 6:
return 0.90;
case 7:
return 1.00;
case 8:
return 1.10;
case 9:
return 1.20;
case 10:
return 1.30;
case 11:
return 1.50;
default:
System.out.println("Difference " + difference + "is not a valid value!");
return -1;
}
}
public double GetMpStatIncreasePercentage(int difference)
{
switch (difference)
{
case 0:
return 0.20;
case 1:
return 0.30;
case 2:
return 0.30;
case 3:
return 0.50;
case 4:
return 0.70;
case 5:
return 0.80;
case 6:
return 0.90;
case 7:
return 1.00;
case 8:
return 1.10;
case 9:
return 1.20;
case 10:
return 1.40;
case 11:
return 1.60;
default:
System.out.println("Difference " + difference + "is not a valid value!");
return -1;
}
}
}