-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculator.js
70 lines (70 loc) · 2.01 KB
/
calculator.js
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
<script>
function logic() {
//console.clear();
var formula1 = 20000 / 8;
var formula2 = +abilityScore.value + +incenseDays.value;
var formula3 = +abilityScore.value + +mentorDays.value;
var formula4 = +abilityScore.value + +uniDays.value;
var formulaD = formula1 / +abilityScore.value;
var formulaE = formula1 / formula2;
var formulaF = formula1 / formula3;
var formulaG = formula1 / formula4;
var formulaI = 1 / formulaD;
var formulaJ = +daysAlone.value * formulaI;
var formulaL = 1 / formulaE;
var formulaM = +daysIncense.value * formulaL;
var formulaO = 1 / formulaF;
var formulaP = +daysMentor.value * formulaO;
var formulaQ = 1 / formulaG;
var formulaR = +daysUni.value * formulaQ;
var formulaS = (+daysAlone.value + +daysIncense.value + +daysMentor.value + +daysUni.value);
var formulaT = formulaJ + formulaM + formulaP + formulaR;
//console.log(formula1);
//console.log(formula2);
//console.log(formula3);
//console.log(formula4);
//console.log(formulaD);
//console.log(formulaE);
//console.log(formulaF);
//console.log(formulaG);
//console.log(formulaI);
//console.log(formulaJ);
//console.log(formulaL);
//console.log(formulaM);
//console.log(formulaO);
//console.log(formulaP);
//console.log(formulaQ);
if (abilityScore.value == "") {
percentComplete.value = "";
} else {
skill.value = 100 * formulaT;
percentComplete.value = `${(formulaT * 100).toFixed()}%`;
{
if (formulaS > 0) {
totalDays.value = "";
} else {
totalDays.value = formulaS;
}
}
{
if (incenseDays.value == "") {
costIncense.value = "0";
} else {
costIncense.value = 50 * +daysIncense.value;
}
if (mentorDays.value == "") {
costMentor.value = "0";
} else {
costMentor.value = 5 * +daysMentor.value;
if (uniDays.value == "") {
costUni.value = "0";
} else {
costUni.value = 55 * +daysUni.value;
}
}
}
}
}
setInterval(logic, 1000);
logic();
</script>