-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
831 lines (758 loc) · 27.2 KB
/
index.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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edit Incremental Adventures Save Game</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/aes.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<meta name="google-site-verification" content="n_xNkjo1eVNAPGVIWuIl2LjZnYelG6D3B7PLtanTtEA">
<style>
html {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
}
body {
display: flex;
flex-direction: column;
padding: 8px;
padding-bottom: 40px;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: hidden;
}
h2 {
margin: 16px 0 8px;
}
td {
padding: 2px 6px;
margin-top: 2px;
}
tr:nth-child(2n) {
background: whitesmoke;
}
table {
border-spacing: 0 5px;
width: 100%;
}
label {
display: block;
margin-top: 2px;
}
h4 {
font-size: 20px;
}
p {
margin: 4px 0 8px;
}
textarea {
width: 100%;
max-width: 100%;
box-sizing: border-box;
}
#resetTimeButton {
margin-bottom: 20px;
}
#json {
height: 666px;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
white-space: nowrap;
}
h4 {
margin-bottom: 4px;
margin-top: 16px
}
.template {
display: none;
}
button {
margin-top: 6px;
}
.left {
flex-basis: 50%;
flex: 1 1;
}
.right {
flex-basis: 50%;
flex: 1 1;
margin-left: 16px;
}
.editor {
display: flex;
}
.editor-area {
overflow: hidden;
}
.tab-area {
display: flex;
overflow-y: auto;
overflow-x: hidden;
}
.flex-column {
display: flex;
flex-direction: column;
}
.flex-row {
display: flex;
flex-direction: row;
}
.tab-bar {
border-bottom: solid 1px;
}
.tab {
margin-left: 8px;
cursor: pointer;
padding: 4px 8px;
border: solid 1px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-color: rgb(100, 100, 100);
color: rgb(100, 100, 100);
border-bottom-color: black;
margin-bottom: -1px;
margin-top: 8px;
}
.tab.active {
border-color: black;
color: black;
cursor: default;
border-bottom-color: white;
}
#json {
margin-top: 8px;
}
.hidden {
display: none;
}
input[type="checkbox"]+label {
display: inline-block;
margin-left: 4px;
margin-top: 0px;
}
input[type="checkbox"] {
width: auto;
}
tr {
text-align: center;
}
input {
text-align: center;
width: 150px;
}
#footer {
position: fixed;
bottom: 0;
width: 100%;
padding: 2px 16px;
border-top: solid 1px;
left: 0;
display: flex;
justify-content: space-between;
box-sizing: border-box;
background: white;
}
div#policy {
position: fixed;
background: #0a0a0aad;
bottom: 0;
top: 0;
left: 0;
right: 0;
padding: 15%;
display: none;
cursor: pointer;
}
#policy>p {
background: white;
margin: 0;
padding: 10px;
}
#showPolicy {
cursor: pointer;
}
#output {
cursor: default;
background-color: rgba(239, 239, 239, 0.3);
color: rgb(84, 84, 84);
border-color: rgba(118, 118, 118, 0.3);
}
@media (max-width: 750px) {
div.left {
flex-basis: 100%;
min-width: 100%;
}
div.right {
flex-basis: 100%;
margin-left: 0;
min-width: 100%;
}
input {
width: 90px !important;
}
div.editor {
flex-wrap: wrap;
}
}
@media (max-width: 450px) {
td {
padding: 2px;
max-width: calc(100vw / 4 - 21px) !important;
}
input {
width: calc(100vw / 4 - 21px) !important;
}
input[type="checkbox"]+label {
word-break: break-all;
}
}
</style>
</head>
<body>
<h2>Incremental Adventures Save Editor</h2>
<p>A save game editor for incremental Adventures</p>
<div class="editor">
<div class="left">
<label for="input">Paste your save game here</label>
<textarea name="" id="input" cols="30" rows="5"></textarea>
</div>
<div class="right">
<label for="output">Copy your new save game</label>
<textarea name="" id="output" cols="30" rows="5" readonly></textarea>
</div>
</div>
<div class="editor-area flex-column">
<div class="flex-row tab-bar">
<h4 class="tab active" data-for="editor-tab">Default Editor</h4>
<h4 class="tab" data-for="json-tab">JSON Editor (advanced)</h4>
</div>
<div id="editor-tab" class="tab-area">
<div class="left">
<h4>Offline time:
<span id="offline"></span>
</h4>
<div>
<label for="">Add:</label>
<button id="offline1h">1h</button>
<button id="offline6h">6h</button>
<button id="offline12h">12h</button>
<button id="offline24h">24h</button>
<button id="offline48h">48h</button>
<button id="offline200h">200h</button>
</div>
<h4>Heros:</h4>
<div>
<label for="highestFloor">Highest Floor (increases stats + count)</label>
<input type="text" id="highestFloor">
<label for="heroLevel">Level</label>
<input type="text" id="heroLevel">
</div>
<h4>Change Gold:</h4>
<div>
<input type="text" id="gold">
</div>
<div>
<h4>Armory:</h4>
<table>
<thead>
<tr>
<th>Warrior</th>
<th>Cleric</th>
<th>Ranger</th>
<th>Paladin</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<label for="sword">Sword</label>
<input type="number" min="0" step="1" id="sword">
</td>
<td>
<label for="staff">Staff</label>
<input type="number" min="0" step="1" id="staff">
</td>
<td>
<label for="Bow">Bow</label>
<input type="number" min="0" step="1" id="Bow">
</td>
<td>
<label for="Hammer">Hammer</label>
<input type="number" min="0" step="1" id="Hammer">
</td>
</tr>
<tr>
<td>
<label for="Shield">Shield</label>
<input type="number" min="0" step="1" id="Shield">
</td>
<td>
<label for="Cape">Cape</label>
<input type="number" min="0" step="1" id="Cape">
</td>
<td>
<label for="Arrows">Arrows</label>
<input type="number" min="0" step="1" id="Arrows">
</td>
<td>
<label for="Banner">Banner</label>
<input type="number" min="0" step="1" id="Banner">
</td>
</tr>
<tr>
<td>
<label for="Trinket">Trinket</label>
<input type="number" min="0" max="10" step="1" id="Trinket">
</td>
<td>
<label for="Book">Book</label>
<input type="number" min="0" max="10" step="1" id="Book">
</td>
<td>
<label for="Quiver">Quiver</label>
<input type="number" min="0" max="10" step="1" id="Quiver">
</td>
<td>
<label for="Ring">Ring</label>
<input type="number" min="0" max="10" step="1" id="Ring">
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="Greaves">
<label for="Greaves">Greaves</label>
</td>
<td>
<input type="checkbox" id="Wand">
<label for="Wand">Wand</label>
</td>
<td>
<input type="checkbox" id="Gloves">
<label for="Gloves">Gloves</label>
</td>
<td>
<input type="checkbox" id="Tome">
<label for="Tome">Tome</label>
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="Challengers">
<label for="Challengers">Heirloom of
Challengers</label>
</td>
<td>
<input type="checkbox" id="Champions">
<label for="Champions">Heirloom of
Champions</label>
</td>
<td>
<input type="checkbox" id="Legends">
<label for="Legends">Heirloom of Legends</label>
</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="right">
<div>
<h4>Ascension Layers:</h4>
<label for="ascPerk">Perk Points</label>
<input type="number" min="0" step="1" id="ascPerk">
<table id="ascTable">
<thead>
<tr>
<th>Layer</th>
<th>Available Points</th>
<th>Upgrade Count</th>
<th>Autobuyer</th>
</tr>
</thead>
<tbody></tbody>
</table>
<button id="addAsc">Unlock Ascension Layer</button>
</div>
<div>
<h4>Transcension Layers:</h4>
<label for="transPerk">Perk Points</label>
<input type="number" min="0" max="1e+25" step="1" id="transPerk">
<table id="transcensionTable">
<thead>
<tr>
<th>Layer</th>
<th>Available Points</th>
<th>Upgrade Count</th>
</tr>
</thead>
<tbody></tbody>
</table>
<button id="addTranscension">Unlock Transcension Layer</button>
</div>
<table class="template">
<tr class="asc-row">
<td class="layer"></td>
<td class="points">
<input type="text">
</td>
<td class="upgrades">
<input type="text">
</td>
<td class="autobuyer">
<input type="checkbox">
</td>
</tr>
</table>
</div>
</div>
<div id="json-tab" class="flex-column tab-area hidden">
<textarea id="json"></textarea>
<div class="flex-row">
<input type="checkbox" id="to-pretty-print-checkbox" checked>
<label for="to-pretty-print-checkbox" style="display:
inline-block">Pretty-print
</label>
</div>
</div>
</div>
<div id="footer">
<div>
<a class="github-button" href="/~https://github.com/fochlac/IncrementalAdventuresSaveEditor/" aria-label="fochlac/IncrementalAdventuresSaveEditor on
GitHub">Repository
</a>
<a class="github-button" href="/~https://github.com/fochlac/IncrementalAdventuresSaveEditor/issues"
data-icon="octicon-issue-opened" aria-label="Issue fochlac/IncrementalAdventuresSaveEditor on
GitHub">Issue
</a>
<a class="github-button" href="/~https://github.com/fochlac/IncrementalAdventuresSaveEditor"
data-icon="octicon-star" aria-label="Star fochlac/IncrementalAdventuresSaveEditor on
GitHub">Star
</a>
</div>
<span id="fc-27822"></span>
<script>
var fcr = Math.floor(Math.random() * 99999999999);
var _fcc = _fcc || [];
_fcc.push(["27822"]);
_fcc.push(["trans"]);
(function () {
var fc = document.createElement("script");
fc.async = true;
fc.src = "https://www.fastcounter.de/fcount.php?rnd=" + fcr;
var sc = document.getElementById("fc-27822");
sc.appendChild(fc);
})();
</script>
<noscript>
<a href="https://www.fastcounter.de/stats/27822/dashboard" rel="nofollow" style="display: none"
target="_blank" title="Echtzeit-Counter">
<img src="https://www.fastcounter.de/fcounter.php?id=27822;" alt="Echtzeit-Counter"
title="Echtzeit-Counter">
</a>
</noscript>
<span id="showPolicy">Privacy Policy</span>
</div>
<div id="policy">
<p>
Unsere Website verwendet den Besucherzähler Fastcounter.
Betreiber von
Fastcounter ist der Stefan Dreher, Tulpenweg 31, 24837
Schleswig,
Deutschland. Fastcounter ist ein kostenloser Besucherzähler,
welcher die
Besucher und Seitenaufrufe auf dieser Internetseite analysiert
und
auswertet. Dabei werden IP-Adresse, Datum und Uhrzeit der
Anfrage,
Browsertyp, Browsersprache, Bildschirmauflösung, Referrer und
Gerätetyp
ausgelesen und an den Betreiber von Fastcounter übertragen. Alle
Daten
werden SSL-verschlüsselt übertragen und selbstverständlich nach
den
Richtlinien der DSVGO vollständig anonymisiert und ausgewertet.
Die
IP-Adresse wird während der Übertragung pseudonymisiert, sodass
keine
personenbezogenen Daten an den Betreiber von Fastcounter
übermittelt
werden.
</p>
<p>
Der Datenerhebung und -speicherung können Sie jederzeit mit
Wirkung für
die Zukunft widersprechen. Um einer Datenerhebung und
-speicherung Ihrer
Besucherdaten für die Zukunft zu widersprechen, können Sie unter
nachfolgendem Link ein Opt-Out-Cookie von Fastcounter beziehen,
dieser
bewirkt, dass zukünftig keine Besucherdaten Ihres Browsers bei
Fastcounter erhoben und gespeichert werden:
<a href="https://www.fastcounter.de/de/privacy/27822.htm">https://www.fastcounter.de/de/privacy/27822.htm
</a>
. Dadurch wird ein Opt-Out-Cookie mit dem Namen "privcookie" von
Fastcounter gesetzt. Bitte löschen Sie diesen Cookie nicht,
solange Sie
Ihren Widerspruch aufrecht erhalten möchten.
</p>
<p>
Weitere Informationen finden Sie in den Datenschutzbestimmungen
von
Fastcounter:
<a href="https://www.fastcounter.de/datenschutz.html">https://www.fastcounter.de/datenschutz.html
</a>
.
</p>
</div>
</body>
<script>
$(".tab").on('click', (e) => {
if (!e.target.classList.contains('active')) {
const id = e.target.dataset.for
$('.tab.active').removeClass('active')
$(e.target).addClass('active')
$('.tab-area').addClass('hidden')
$(`#${id}`).removeClass('hidden')
}
});
$("#showPolicy").on("click", () => {
$("#policy").css("display", "block");
});
$("#policy").on("click", () => {
$("#policy").css("display", "none");
});
const { AES, enc } = CryptoJS;
window.Save = "";
/**
* @type {boolean} [toPrettyPrint] whether to pretty-print or not
*/
let toPrettyPrint = true;
const write = () => {
$("#offline").html(
Math.min(
Math.round((Date.now() - window.Save.lastTimeStamp) / 3600000),
200
)
);
$("#output").val(AES.encrypt(JSON.stringify(window.Save), "gwFgN"));
renderTranscensions();
renderAscensions();
renderJson();
};
function renderAscensions() {
const save = window.Save;
$("#ascTable tbody").html("");
save.ascension &&
save.ascension.forEach((layer, index) => {
const row = $(".template .asc-row").first().clone();
row.find(".layer").html(index + 1);
row.find(".points input").val(layer[0]);
row.find(".upgrades input").val(layer[1]);
row.find(".autobuyer input").prop("checked", layer[2]);
row.find(".points input").on("change", (e) => {
save.ascension[index][0] = e.target.value;
write();
});
row.find(".upgrades input").on("change", (e) => {
save.ascension[index][1] = e.target.value;
write();
});
row.find(".autobuyer input").on("change", (e) => {
save.ascension[index][2] = e.target.checked ? 1 : 0;
write();
});
$("#ascTable tbody").append(row);
});
}
function renderTranscensions() {
const save = window.Save;
$("#transcensionTable tbody").html("");
save.transcension &&
save.transcension.forEach((layer, index) => {
const row = $(".template .asc-row").first().clone();
row.find(".layer").html(index + 1);
row.find(".points input").val(layer[0]);
row.find(".upgrades input").val(layer[1]);
row.find(".autobuyer").remove();
row.find(".points input").on("change", (e) => {
save.transcension[index][0] = e.target.value;
write();
});
row.find(".upgrades input").on("change", (e) => {
save.transcension[index][1] = e.target.value;
write();
});
$("#transcensionTable tbody").append(row);
});
}
function renderJson() {
let json;
if (toPrettyPrint === true) {
json = '{\n'
Object.keys(window.Save).forEach((key) => {
if (['ascension', 'transcension', 'prestige', 'combatLog', 'options', 'stats'].includes(key)) {
json += '\t' + key + ': [\n\t\t'
json += window.Save[key].map((arr) => {
return JSON.stringify(arr)
}).join('\n\t\t')
json += '\n\t]'
}
else if (Array.isArray(window.Save[key]) && (typeof window.Save[key][0] !== 'object' || Array.isArray(window.Save[key][0]))) {
json += '\t' + key + ': ' + JSON.stringify(window.Save[key]);
}
else {
json += '\t' + key + ': ' + JSON.stringify(window.Save[key], null, '\t').split('\n').join('\n\t');
}
json += ',\n'
})
json += '}';
} else {
json = JSON.stringify(window.Save);
}
$("#json").val(json);
}
function updateUi() {
const save = window.Save;
$("#gold").val(save.gold || 0);
$("#highestFloor").val(save.highestFloor || 0);
$("#heroLevel").val(save.level || 0);
$("#ascPerk").val(Number(save.perkPoints || "0"));
$("#transPerk").val(Number(save.transcensionPerkPoints || "0"));
write();
save.armory &&
save.armory.forEach((value, index) => {
const id = "#" + armorySequence[index];
if (index > 11) {
$(id).prop("checked", value === "1");
$(id).on("change", ({ target }) => {
save.armory[index] = target.checked ? "1" : "0";
write();
});
} else {
$(id).val(Number(value));
$(id).on("change", ({ target }) => {
save.armory[index] = String(target.value);
write();
});
}
});
}
const armorySequence = [
"sword",
"staff",
"Bow",
"Hammer",
"Trinket",
"Book",
"Quiver",
"Ring",
"Shield",
"Cape",
"Arrows",
"Banner",
"Greaves",
"Wand",
"Gloves",
"Tome",
"Legends",
"Champions",
"Challengers",
];
$("#input").on("input", ({ target: { value } }) => {
try {
window.Save = JSON.parse(
AES.decrypt(value, "gwFgN").toString(enc.Utf8)
);
console.log(window.Save);
updateUi();
} catch (err) {
alert("Error: Invalid save game!\n\n" + err);
}
});
$("#json").on("change", ({ target: { value } }) => {
try {
window.Save = JSON.parse(value);
console.log(window.Save);
updateUi();
} catch (err) {
alert("Error: Invalid json!\n\n" + err);
}
});
$("#addAsc").on("click", () => {
window.Save.ascension = [
...(window.Save.ascension || []),
[1, 1, 0, 0, 0],
];
write();
});
$("#addTranscension").on("click", () => {
window.Save.transcension = [
...(window.Save.transcension || []),
[1, 1, window.Save.tickClock],
];
write();
});
$("#offline1h").on("click", () => {
window.Save.lastTimeStamp -= 3600000;
write();
});
$("#offline6h").on("click", () => {
window.Save.lastTimeStamp -= 6 * 3600000;
write();
});
$("#offline12h").on("click", () => {
window.Save.lastTimeStamp -= 12 * 3600000;
write();
});
$("#offline24h").on("click", () => {
window.Save.lastTimeStamp -= 24 * 3600000;
write();
});
$("#offline48h").on("click", () => {
window.Save.lastTimeStamp -= 48 * 3600000;
write();
});
$("#offline200h").on("click", () => {
window.Save.lastTimeStamp -= 200 * 3600000;
write();
});
$("#gold").on("change", ({ target }) => {
window.Save.gold = target.value;
write();
});
$("#highestFloor").on("change", ({ target }) => {
window.Save.highestFloor = String(target.value);
write();
});
$("#heroLevel").on("change", ({ target }) => {
window.Save.level = String(target.value);
write();
});
$("#ascPerk").on("change", ({ target }) => {
window.Save.perkPoints = String(target.value);
write();
});
$("#transPerk").on("change", ({ target }) => {
window.Save.transcensionPerkPoints = String(target.value);
write();
});
$("#to-pretty-print-checkbox").on("change", ({ target }) => {
toPrettyPrint = target.checked === true;
renderJson();
});
$("#output").on("click", ({ target }) => {
$(target).select();
});
</script>
</html>