forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormulas.cs
More file actions
70 lines (63 loc) · 2.83 KB
/
Copy pathFormulas.cs
File metadata and controls
70 lines (63 loc) · 2.83 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
using System;
namespace L2dotNET.Models.Player.Basic
{
public class Formulas
{
public static readonly int MaxStatValue = 100;
public static readonly double[] StrBonus = new double[MaxStatValue];
public static readonly double[] IntBonus = new double[MaxStatValue];
public static readonly double[] DexBonus = new double[MaxStatValue];
public static readonly double[] ConBonus = new double[MaxStatValue];
public static readonly double[] WitBonus = new double[MaxStatValue];
public static readonly double[] MenBonus = new double[MaxStatValue];
public static readonly double[] BaseEvasionAccuracy = new double[MaxStatValue];
public static readonly double[] SqrtMenBonus = new double[MaxStatValue];
public static readonly double[] SqrtConBonus = new double[MaxStatValue];
private static readonly double[] StrCompute = {
1.036,
34.845
};
private static readonly double[] IntCompute = {
1.020,
31.375
};
private static readonly double[] DexCompute = {
1.009,
19.360
};
private static readonly double[] WitCompute = {
1.050,
20.000
};
private static readonly double[] ConCompute = {
1.030,
27.632
};
private static readonly double[] MenCompute = {
1.010,
-0.060
};
static Formulas()
{
for (int i = 0; i < StrBonus.Length; i++)
StrBonus[i] = Math.Floor(Math.Pow(StrCompute[0], i - StrCompute[1]) * 100 + .5d) / 100;
for (int i = 0; i < IntBonus.Length; i++)
IntBonus[i] = Math.Floor(Math.Pow(IntCompute[0], i - IntCompute[1]) * 100 + .5d) / 100;
for (int i = 0; i < DexBonus.Length; i++)
DexBonus[i] = Math.Floor(Math.Pow(DexCompute[0], i - DexCompute[1]) * 100 + .5d) / 100;
for (int i = 0; i < WitBonus.Length; i++)
WitBonus[i] = Math.Floor(Math.Pow(WitCompute[0], i - WitCompute[1]) * 100 + .5d) / 100;
for (int i = 0; i < ConBonus.Length; i++)
ConBonus[i] = Math.Floor(Math.Pow(ConCompute[0], i - ConCompute[1]) * 100 + .5d) / 100;
for (int i = 0; i < MenBonus.Length; i++)
MenBonus[i] = Math.Floor(Math.Pow(MenCompute[0], i - MenCompute[1]) * 100 + .5d) / 100;
for (int i = 0; i < BaseEvasionAccuracy.Length; i++)
BaseEvasionAccuracy[i] = Math.Sqrt(i) * 6;
// Precompute square root values
for (int i = 0; i < SqrtConBonus.Length; i++)
SqrtConBonus[i] = Math.Sqrt(ConBonus[i]);
for (int i = 0; i < SqrtMenBonus.Length; i++)
SqrtMenBonus[i] = Math.Sqrt(MenBonus[i]);
}
}
}