-
Notifications
You must be signed in to change notification settings - Fork 121
/
aklevel.html
338 lines (330 loc) · 16.4 KB
/
aklevel.html
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Arknights Recruitment Calculator</title>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css'>
<link rel="stylesheet" href="css/multilingual.css">
<link rel="stylesheet" href="css/ak.css">
<style type="text/css">
.levelformcontainer label {
margin-bottom: 0px;
margin-top: 10px;
}
</style>
<script src='https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js'></script>
<script src='https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js'></script>
<script src='https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js'></script>
<script src="js/multilingual.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-159317757-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-159317757-1');
</script>
</head>
<body>
<div id="loadingOverlay" style="width: 100vw; height: 150%; background-color: #111111; position: absolute; z-index: 9999; top:0px;">
<div class="d-flex justify-content-center" style="margin-top: 50vh">
<div class="spinner-border" role="status" style="border-color: #0098DC; border-right-color: transparent; width: 4rem; height: 4rem;">
</div>
</div>
<div style="width: 100%; text-align: center; margin-top: 13px;">
<div class='loadtext'>Loading Toolbox</div>
<div></div>
<div class="loadforce" onclick="hideload()"><a>Click here if stuck on loading</a></div>
</div>
</div>
<script>
$(function(){
$('#nav-placeholder').load('nav.html');
});
$(window).on("load", function () {
setTimeout(function () {
$("#loadingOverlay").fadeOut();
}, 1000);
});
</script>
<button class="btn btn-sm btn-primary goToTag" style="position:fixed;bottom:15px ;right: 0px;size:70px 70px;padding: 10px;z-index: 10000" id="to-tag" type="button">^ </button>
<nav id="aknav" class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark" style="background-image: linear-gradient(#222222ff 70%,#222222ff , #111111aa );">
<img src="https://raw.githubusercontent.com/Aceship/Arknight-Images/main/factions/logo_rhodes.png" width="40" height="40" style="transform:scale(1.2,1.2)translate(-8px,1px)"class="d-inline-block align-top" alt="">
<a class="navbar-brand" href="#" translate-id="topbar-1">Arknights Toolbox</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="展开">
<span class="navbar-toggler-icon"></span>
</button>
</nav>
<div id='acedonate'></div>
<div style="padding-bottom:50px"></div>
<div class="container col-12 levelformcontainer" style="margin:auto; max-width: 1200px; margin-top: 30px;">
<div class="row">
<div class="col-md-6 col-sm-12">
<div class="alert alert-dark">
<div class="row">
<div class="col">
<label for="star">Rarity★</label>
<select id="star" class="form-control form-control-sm">
<option selected>6</option>
<option>5</option>
<option>4</option>
<option>3</option>
<option>2</option>
<option>1</option>
</select>
</div>
</div>
<div class="row">
<div class="col">
<label for="lslevel">EXP Card Map</label>
<select id="lslevel" class="form-control form-control-sm">
<option selected>LS-5</option>
<!--<option>LS-4</option>
<option>LS-3</option>
<option>LS-2</option>
<option>LS-1</option>-->
</select>
</div>
<div class="col">
<label for="lslevel">Lungmen Coin Map</label>
<select id="lslevel" class="form-control form-control-sm">
<option selected>CE-5</option>
<!--<option>CE-4</option>
<option>CE-3</option>
<option>CE-2</option>
<option>CE-1</option>-->
</select>
</div>
</div>
<div class="row">
<div class="col">
<label for="current-evolve">Current Elite</label>
<select id="current-evolve" class="form-control form-control-sm">
<option selected>0</option>
<option>1</option>
<option>2</option>
</select>
</div>
<div class="col">
<label for="target-evolve">Target Elite</label>
<select id="target-evolve" class="form-control form-control-sm">
<option selected>0</option>
<option>1</option>
<option>2</option>
</select>
</div>
</div>
<div class="row">
<div class="col">
<label for="current-level">Current Level</label>
<input type="text" class="form-control form-control-sm" id="current-level" value="1">
</div>
<div class="col">
<label for="target-level">Target Level</label>
<input type="text" class="form-control form-control-sm" id="target-level" value="1">
</div>
</div>
<div class="row">
<div class="col">
<label for="current-exp">Current Exp</label>
<input type="text" class="form-control form-control-sm" id="current-exp" value="0">
</div>
</div>
<div class="row">
<div style="width: 100%; display: inline-block; padding: 5px; font-weight: bold; font-size: 1.2em; margin-top: 10px;"><span>Resources currently have:</span></div>
</div>
<div class="row">
<div class="col">
<label for="gold-asset">LMD</label>
<input type="text" class="form-control form-control-sm" id="gold-asset" value="0">
</div>
<div class="col">
<label for="book-basic">Green Exp Card</label>
<input type="text" class="form-control form-control-sm" id="book-basic" value="0">
</div>
<div class="col">
<label for="book-primary">Blue Exp Card</label>
<input type="text" class="form-control form-control-sm" id="book-primary" value="0">
</div>
</div>
<div class="row">
<div class="col">
<label for="book-middle">Yellow Exp Card</label>
<input type="text" class="form-control form-control-sm" id="book-middle" value="0">
</div>
<div class="col">
<label for="book-advanced">Gold Exp Card</label>
<input type="text" class="form-control form-control-sm" id="book-advanced" value="0">
</div>
</div>
</div>
<div class="row">
<button class="btn btn-success col-10 text-center" id="btn-calculate" style="margin:auto;">Calculate</button>
</div>
</div>
<div class="col-md-6 col-sm-12">
<table class="table ak-table table-striped my-3">
<thead class="thead-dark">
<tr>
<th scope="col" width="40%" class="text-right">Resource</th>
<th scope="col" width="60%">Demand</th>
</tr>
</thead>
<tbody id="tbody-result"></tbody>
</table>
</div>
</div>
<div class="col-12 alert alert-danger mt-3" id="error-info" role="alert" style="display:none"></div>
<div class="row">
</div>
<hr />
<div class="row col-12 tutorial ak-mid" style="margin:auto">
<div class="col-12 col-sm-6 text-left">
<p><b>Maximum level of each star</b></p>
<p>1★:30</p>
<p>2★:30</p>
<p>3★:40/55</p>
<p>4★:45/60/70</p>
<p>5★:50/70/80</p>
<p>6★:50/80/90</p>
</div>
<div class="col-12 col-sm-6 text-left">
<p><b>Exp Card yields:</b></p>
<p>Green Card:200<sub></sub></p>
<p>Blue Card:400</p>
<p>Yellow Card:1000</p>
<p>Gold Card:2000</p>
</div>
</div>
</div>
<div class="row col-12 ak-footer">
<div class="col-12 text-center">
<p>This module was originally forked from <a href = "https://graueneko.github.io/akhr.html">Graueneko web</a></p>
<div class="col-12 text-center"></div>
<p><a href="https://github.com/Aceship/AN-EN-Tags/issues">Bug Report and Suggestions</a></p>
<p>Developed and Maintained by: Aceship and Faryzal2020</p>
</div>
</div>
<script src='js/arrive.min.js'></script>
<script src="js/aknav.js"></script>
<script>
$(document).ready(function () {
showCurrentLang();
let lang = getLang();
document.title = { 'cn': '明日方舟升级计算器', 'en': 'Arknights Levelup Cost Calculator' }[lang];
let maxLevel = [];
let charExpMap = [];
let charUpCostMap = [];
let evolveGoldCost = [];
$.getJSON("./json/aklevel.json", function (data) {
maxLevel = data['maxLevel'];
charExpMap = data['characterExpMap'];
charUpCostMap = data['characterUpgradeCostMap'];
evolveGoldCost = data['evolveGoldCost'];
});
$("#star").change(function () {
let star = $(this).val();
let maxEvolve = maxLevel[star - 1].length;
$("#current-evolve").html("");
$("#target-evolve").html("");
for (let i = 0; i < maxEvolve; i++) {
$("#current-evolve").append("<option>" + i + "</option>");
$("#target-evolve").append("<option>" + i + "</option>");
}
$("#current-evolve").val(0);
$("#target-evolve").val(0);
});
$(document).on('click', '#btn-calculate', function () {
$("#error-info").hide();
$("#tbody-result").html("");
let star = parseInt($("#star").val());
let cev = parseInt($("#current-evolve").val());
let cl = parseInt($("#current-level").val());
let ce = parseInt($("#current-exp").val());
let te = parseInt($("#target-evolve").val());
let tl = parseInt($("#target-level").val());
let ga = parseInt($("#gold-asset").val());
let bb = parseInt($("#book-basic").val());
let bp = parseInt($("#book-primary").val());
let bm = parseInt($("#book-middle").val());
let ba = parseInt($("#book-advanced").val());
if (isNaN(cl) || isNaN(tl)) {
$("#error-info").html("The rating must be a number from 1 to 90.");
$("#error-info").show();
return;
}
if (isNaN(ga) || isNaN(bb) || isNaN(bp) || isNaN(bm) || isNaN(ba)) {
$("#error-info").html("The input for gold coins/experience books available can only be numbers.");
$("#error-info").show();
return;
}
if (te < cev || (te === cev && tl <= cl)) {
$("#error-info").html("The target level cannot be lower than or equal to the current level.");
$("#error-info").show();
return;
}
if (cl > maxLevel[star - 1][cev] || tl > maxLevel[star - 1][te]) {
$("#error-info").html("The level is beyond the scope of the elite stage.");
$("#error-info").show();
return;
}
if (isNaN(ce) || ce < 0) {
$("#error-info").html("Current experience must be a positive integer");
$("#error-info").show();
return;
} else if ((cl === maxLevel[star - 1][cev] && ce !== 0) || ((cl !== maxLevel[star - 1][cev] && ce >= charExpMap[cev][cl - 1]))) {
$("#error-info").html("The current experience is outside the possible range, please check the input.");
$("#error-info").show();
return;
}
let es = cl === maxLevel[star - 1][cev] ? 0 : charExpMap[cev][cl - 1] - ce;
let cs = cl === maxLevel[star - 1][cev] ? 0 : charUpCostMap[cev][cl - 1] * es / (charExpMap[cev][cl - 1]);
cl++;
for (let i = cev, j = cl; i <= te; i++) {
while (i < te && j < maxLevel[star - 1][i]) {
es += charExpMap[i][j - 1];
cs += charUpCostMap[i][j - 1];
j++;
}
while (i === te && j < tl) {
es += charExpMap[i][j - 1];
cs += charUpCostMap[i][j - 1];
j++;
}
j = 1;
}
let ea = 0;
for (let i = cev; i < te; i++) {
ea += evolveGoldCost[star - 1][i];
}
let bs = bb * 200 + bp * 400 + bm * 1000 + ba * 2000;
let eb = es - bs;
if (eb < 0) eb = 0;
let gs = (cs + ea).toFixed(1);
let gn = gs - ga;
if (gn < 0) gn = 0;
let lsn = Math.ceil((eb / 7500).toFixed(1));
let cen = Math.ceil((gn / 7500).toFixed(1));
$.each([
['Total Sanity Cost', "<b>" + (lsn + cen) * 30 + "</b> <sub>= " + lsn * 30 + " + " + cen * 30 + "</sub>"],
['Exp', "<b>" + eb + "</b> <sub>= " + es + " - " + bs + "</sub>"],
['LS Sanity <sub>Cost</sub>', "<b>" + lsn * 30 + "</b> <sub>= 30 * " + lsn + "</sub>"],
['Coins', "<b>" + gn + "</b> <sub>= " + gs + " - " + ga + "</sub>"],
['CE Sanity <sub>Cost</sub>', "<b>" + cen * 30 + "</b> <sub>= 30 * " + cen + "</sub>"],
['Coins for Leveling', cs.toFixed(1)],
['Coins for Elite', ea],
], function (_, v) {
$("#tbody-result").append('<tr><th scope="row" class="text-right">' + v[0] + '</th><td>' + v[1] + '</td></tr>');
});
});
});
$(document).arrive("#regionDropdown", function(){
$("#navitemRegion").addClass('ak-disable2');
$("#navitemLanguage").addClass('ak-disable2');
});
</script>
</body>
</html>