<!DOCTYPE html>
<html>
<body>
<h2>하이퍼버닝 달성률 계산기</h2>
<pre id="complete_rate" style="font-size: 16px;">여기에 달성률 출력</pre>
<script>
const exp_table_to_250 = [ // 0부터 250까지의 경험치 테이블
0,
15,
34,
57,
92,
135,
372,
560,
840,
1242,
1242,
1242,
1242,
1242,
1242,
1490,
1788,
2145,
2574,
3088,
3705,
4446,
5335,
6402,
7682,
9218,
11061,
13273,
15927,
19112,
19112,
19112,
19112,
19112,
19112,
22934,
27520,
33024,
39628,
47553,
51357,
55465,
59902,
64694,
69869,
75458,
81494,
88013,
95054,
102658,
110870,
119739,
129318,
139663,
150836,
162902,
175934,
190008,
205208,
221624,
221624,
221624,
221624,
221624,
221624,
238245,
256113,
275321,
295970,
318167,
342029,
367681,
395257,
424901,
456768,
488741,
522952,
559558,
598727,
640637,
685481,
733464,
784806,
839742,
898523,
961419,
1028718,
1100728,
1177778,
1260222,
1342136,
1429374,
1522283,
1621231,
1726611,
1838840,
1958364,
2085657,
2221224,
2365603,
2365603,
2365603,
2365603,
2365603,
2365603,
2519367,
2683125,
2857528,
3043267,
3241079,
3451749,
3676112,
3915059,
4169537,
4440556,
4729192,
5036589,
5363967,
5712624,
6083944,
6479400,
6900561,
7349097,
7826788,
8335529,
8877338,
9454364,
10068897,
10723375,
11420394,
12162719,
12953295,
13795259,
14691950,
15646926,
16663976,
17747134,
18900697,
20129242,
21437642,
22777494,
24201087,
25713654,
27320757,
29028304,
30842573,
32770233,
34818372,
36994520,
39306677,
41763344,
44373553,
47146900,
50093581,
53224429,
56550955,
60085389,
63840725,
67830770,
72070193,
76574580,
81360491,
86445521,
91848366,
97588888,
103688193,
110168705,
117054249,
124370139,
132143272,
138750435,
145687956,
152972353,
160620970,
168652018,
177084618,
185938848,
195235790,
204997579,
215247457,
226009829,
237310320,
249175836,
261634627,
274716358,
288452175,
302874783,
318018522,
333919448,
350615420,
368146191,
386553500,
405881175,
426175233,
447483994,
469858193,
493351102,
518018657,
543919589,
571115568,
2207026470,
2471869646,
2768494003,
3100713283,
3472798876,
3889534741,
4356278909,
4879032378,
5464516263,
6120258214,
9792413142,
10869578587,
12065232231,
13392407776,
14865572631,
19325244420,
21064516417,
22960322894,
25026751954,
27279159629,
43646655406,
46701921284,
49971055773,
53469029677,
57211861754,
74375420280,
78094191294,
81998900858,
86098845900,
90403788195,
144646061112,
148985442945,
153455006233,
158058656419,
162800416111,
211640540944,
217989757172,
224529449887,
231265333383,
238203293384,
381125269414,
392559027496,
404335798320,
416465872269,
428959848437,
557647802968,
574377237057,
591608554168,
609356810793,
627637515116]
function calc_whole_of_hyperburning_exp_amount(start_level){ // 시작레벨 부터의 하이퍼버닝 경험치 총량 반환 함수
let whole_of_hyperburning_exp_amount = 0 //
for(let i = parseInt(start_level); i < 250; i += 3){
whole_of_hyperburning_exp_amount += exp_table_to_250[i]
}
return whole_of_hyperburning_exp_amount
}
function calc_hyperburning_complete_rate(start_level, cur_level, cur_exp_rate) {
if(cur_level >= 250){ // 현재 레벨이 250이상일 때, 문자열을 반환 후 함수 종료
return "하이퍼버닝이 종료되었습니다"
}
if((cur_level - start_level) % 3 != 0){ // 시작 레벨과 현재 레벨이 유효하지 않은 값일 때
return "시작 레벨과 현재 레벨이 유효하지 않은 값입니다"
}
let cur_exp_amount = exp_table_to_250[parseInt(cur_level)] * (parseFloat(cur_exp_rate) * 0.01); // 현재 경험치량
let whole_of_hyperburning_exp_amount = calc_whole_of_hyperburning_exp_amount(start_level); // 하이퍼버닝 경험치 총량
let gained_exp = cur_exp_amount; // 현재까지 얻은 경험치량
for( let i = parseInt(start_level); i < parseInt(cur_level); i += 3 ){
gained_exp += exp_table_to_250[i];
}
let complete_rate = (gained_exp / whole_of_hyperburning_exp_amount) * 100; // 달성률
return String(complete_rate.toFixed(2))+"%" // 반환
}
</script>
<p>시작 레벨 <input type="number" id="start_level" min="1" max="300" value="10"></p>
<p>현재 레벨 <input type="number" id="cur_level" min="1" max="300"></p>
<p>현재 경험치 <input type="number" id="cur_exp_rate" min="1" max="300">%</p>
<button type="button" onclick='document.getElementById("complete_rate").innerHTML = calc_hyperburning_complete_rate(document.getElementById("start_level").value, document.getElementById("cur_level").value, document.getElementById("cur_exp_rate").value)'>계산</button>
</body>
</html>