fixed merge issues

This commit is contained in:
ferricles 2021-01-06 08:23:21 -08:00
commit f6e68a74b8
11 changed files with 72153 additions and 71797 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.swp

View file

@ -9,6 +9,9 @@ function skillPointsToPercentage(skp){
//return(-0.0000000066695* Math.pow(Math.E, -0.00924033 * skp + 18.9) + 1.0771).toFixed(3);
}
}
for (i = 0; i < 151; i++) {
console.log(i, ", ",skillPointsToPercentage(i));
}
class Build{

143256
clean.json

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -4,10 +4,22 @@ with open("dump.json", "r") as infile:
data = json.loads(infile.read())
items = data["items"]
del data["request"]
translate_mappings = {
#"name": "name",
#"displayName": "displayName",
#"tier": "tier",
#"set": "set",
"sockets": "slots",
#"type": "type",
# UNUSED? "armorType": "armorType",
"armorColor": "color",
"addedLore": "lore",
#"material": "material",
"dropType": "drop",
#"quest": "quest",
"restrictions": "restrict",
"damage": "nDam",
"fireDamage": "fDam",
"waterDamage": "wDam",
@ -30,8 +42,8 @@ translate_mappings = {
"defense": "defReq",
"healthRegen": "hprPct",
"manaRegen": "mr",
"spellDamage": "spellPct",
"damageBonus": "meleePct",
"spellDamage": "sdPct",
"damageBonus": "mdPct",
"lifeSteal": "ls",
"manaSteal": "ms",
"xpBonus": "xpb",
@ -45,14 +57,14 @@ translate_mappings = {
#"thorns": "thorns",
#"exploding": "expoding",
"speed": "spd",
"attackSpeedBonus": "attackTier",
"attackSpeedBonus": "atkTier",
#"poison": "poison",
"healthBonus": "hpBonus",
"soulPoints": "spRegen",
"emeraldStealing": "stealing",
"emeraldStealing": "eSteal",
"healthRegenRaw": "hprRaw",
"spellDamageRaw": "spellRaw",
"damageBonusRaw": "meleeRaw",
"spellDamageRaw": "sdRaw",
"damageBonusRaw": "mdRaw",
"bonusFireDamage": "fDamPct",
"bonusWaterDamage": "wDamPct",
"bonusAirDamage": "aDamPct",
@ -63,22 +75,28 @@ translate_mappings = {
"bonusAirDefense": "aDefPct",
"bonusThunderDefense": "tDefPct",
"bonusEarthDefense": "eDefPct",
"accessoryType": "type",
"identified": "fixID",
#"skin": "skin",
#"category": "category",
"spellCostPct1": "spellPct1",
"spellCostRaw1": "spellRaw1",
"spellCostPct2": "spellPct2",
"spellCostRaw2": "spellRaw2",
"spellCostPct3": "spellPct3",
"spellCostRaw3": "spellRaw3",
"spellCostPct4": "spellPct4",
"spellCostRaw4": "spellRaw4",
"spellCostPct1": "spPct1",
"spellCostRaw1": "spRaw1",
"spellCostPct2": "spPct2",
"spellCostRaw2": "spRaw2",
"spellCostPct3": "spPct3",
"spellCostRaw3": "spRaw3",
"spellCostPct4": "spPct4",
"spellCostRaw4": "spRaw4",
"rainbowSpellDamageRaw": "rainbowSDRaw",
"rainbowSpellDamageRaw": "rainbowRaw",
"sprint": "sprint",
"sprintRegen": "sprintReg",
"jumpHeight": "jh",
"lootQuality": "lq",
"gatherXpBonus": "gXp",
"gatherSpeed": "gSpd",
}
delete_keys = [
@ -98,6 +116,8 @@ for item in items:
item[v] = item[k]
del item[k]
item["type"] = item["type"].lower()
with open("clean.json", "w") as outfile:
outfile.write(json.dumps(data, indent=2))
with open("compress.json", "w") as outfile:

145
index.html Normal file
View file

@ -0,0 +1,145 @@
<!DOCTYPE html>
<html scroll-behavior="smooth">
<head>
<link rel="stylesheet" href="styles.css">
<link rel="icon" href="favicon.png">
<link rel="manifest" href="manifest.json">
<title>Wynn Clientside</title>
</head>
<body>
<div class="header">
Wynn build calculator
</div>
<div class="equipment">
<div class="center" style="grid-column:1;grid-row:1">
<div>
<label for="helmet-choice">Helmet:</label>
<input list="helmet-items" id="helmet-choice" name="helmet-choice" />
<datalist id="helmet-items">
</datalist>
</div>
<div id="helmet-slots">
X slots
</div>
<div>
<label for="helmet-powder">Powdering:</label>
<input type="text" id="helmet-powder" name="helmet-powder" />
</div>
</div>
<div class="center" style="grid-column:2;grid-row:1">
<div>
<label for="chestplate-choice">Chestplate:</label>
<input list="chestplate-items" id="chestplate-choice" name="chestplate-choice" />
<datalist id="chestplate-items">
</datalist>
</div>
<div id="chestplate-slots">
X slots
</div>
<div>
<label for="chestplate-powder">Powdering:</label>
<input type="text" id="chestplate-powder" name="chestplate-powder" />
</div>
</div>
<div class="center" style="grid-column:3;grid-row:1">
<div>
<label for="leggings-choice">Leggings:</label>
<input list="leggings-items" id="leggings-choice" name="leggings-choice" />
<datalist id="leggings-items">
</datalist>
</div>
<div id="leggings-slots">
X slots
</div>
<div>
<label for="leggings-powder">Powdering:</label>
<input type="text" id="leggings-powder" name="leggings-powder" />
</div>
</div>
<div class="center" style="grid-column:4;grid-row:1">
<div id="boots">
<label for="boots-choice">Boots:</label>
<input list="boots-items" id="boots-choice" name="boots-choice" />
<datalist id="boots-items">
</datalist>
</div>
<div id="boots-slots">
X slots
</div>
<div>
<label for="boots-powder">Powdering:</label>
<input type="text" id="boots-powder" name="boots-powder" />
</div>
</div>
<div class="center" style="grid-column:1;grid-row:2">
<label for="ring1-choice">Ring 1:</label>
<input list="ring1-items" id="ring1-choice" name="ring1-choice" />
<datalist id="ring1-items">
</datalist>
</div>
<div class="center" style="grid-column:2;grid-row:2">
<label for="ring2-choice">Ring 2:</label>
<input list="ring2-items" id="ring2-choice" name="ring2-choice" />
<datalist id="ring2-items">
</datalist>
</div>
<div class="center" style="grid-column:3;grid-row:2">
<label for="bracelet-choice">Bracelet:</label>
<input list="bracelet-items" id="bracelet-choice" name="bracelet-choice" />
<datalist id="bracelet-items">
</datalist>
</div>
<div class="center" style="grid-column:4;grid-row:2">
<label for="necklace-choice">Necklace:</label>
<input list="necklace-items" id="necklace-choice" name="necklace-choice" />
<datalist id="necklace-items">
</datalist>
</div>
<div class="center" style="grid-column:1;grid-row:3">
<label for="weapon-choice">Weapon:</label>
<input list="weapon-items" id="weapon-choice" name="weapon-choice" />
<datalist id="weapon-items">
</datalist>
</div>
<div class="center" style="grid-column:2;grid-row:3">
<div id="weapon-slots">
X slots
</div>
<div>
<label for="weapon-powder">Weapon powder:</label>
<input type="text" id="weapon-powder" name="weapon-powder" />
</div>
</div>
<div class="center" style="grid-column:3;grid-row:3">
Calculate
</div>
<div class="center" style="grid-column:4;grid-row:3">
Reset
</div>
</div>
<div class="skillpoints">
<div class="center" style="grid-column:1;grid-row:1">
<label for="str-skp">Strength:</label>
<input type="text" id="str-skp" name="str-skp" />
</div>
<div class="center" style="grid-column:2;grid-row:1">
<label for="dex-skp">Dexterity:</label>
<input type="text" id="dex-skp" name="dex-skp" />
</div>
<div class="center" style="grid-column:3;grid-row:1">
<label for="int-skp">Intelligence:</label>
<input type="text" id="int-skp" name="int-skp" />
</div>
<div class="center" style="grid-column:4;grid-row:1">
<label for="def-skp">Defense:</label>
<input type="text" id="def-skp" name="def-skp" />
</div>
<div class="center" style="grid-column:5;grid-row:1">
<label for="agi-skp">Agility:</label>
<input type="text" id="agi-skp" name="agi-skp" />
</div>
</div>
<script src="test.js"></script>
</body>
</html>

4
manifest.json Normal file
View file

@ -0,0 +1,4 @@
{
"display": "standalone",
"orientation": "portrait"
}

View file

@ -1 +1,4 @@
#A workspace for processing info/one-time operations
import math
for i in range(151):
print(-0.0000000066695* math.exp(-0.00924033 * i + 18.9) + 1.0771)

View file

@ -1,151 +1,152 @@
a,b
1,0.01
2,0.02
3,0.029
4,0.039
5,0.049
6,0.058
7,0.067
8,0.077
9,0.086
10,0.095
11,0.104
12,0.113
13,0.122
14,0.131
15,0.139
16,0.148
17,0.157
18,0.165
19,0.173
20,0.182
21,0.19
22,0.198
23,0.206
24,0.214
25,0.222
26,0.23
27,0.238
28,0.246
29,0.253
30,0.261
31,0.268
32,0.276
33,0.283
34,0.29
35,0.298
36,0.305
37,0.312
38,0.319
39,0.326
40,0.333
41,0.34
42,0.346
43,0.353
44,0.36
45,0.366
46,0.373
47,0.379
48,0.386
49,0.392
50,0.399
51,0.405
52,0.411
53,0.417
54,0.423
55,0.429
56,0.435
57,0.441
58,0.447
59,0.453
60,0.458
61,0.464
62,0.47
63,0.475
64,0.481
65,0.486
66,0.492
67,0.497
68,0.503
69,0.508
70,0.513
71,0.518
72,0.523
73,0.528
74,0.534
75,0.539
76,0.543
77,0.548
78,0.553
79,0.558
80,0.563
81,0.568
82,0.572
83,0.577
84,0.581
85,0.586
86,0.591
87,0.595
88,0.599
89,0.604
90,0.608
91,0.613
92,0.617
93,0.621
94,0.625
95,0.629
96,0.633
97,0.638
98,0.642
99,0.646
100,0.65
101,0.654
102,0.657
103,0.661
104,0.665
105,0.669
106,0.673
107,0.676
108,0.68
109,0.684
110,0.687
111,0.691
112,0.694
113,0.698
114,0.701
115,0.705
116,0.708
117,0.712
118,0.715
119,0.718
120,0.722
121,0.725
122,0.728
123,0.731
124,0.735
125,0.738
126,0.741
127,0.744
128,0.747
129,0.75
130,0.753
131,0.756
132,0.759
133,0.762
134,0.765
135,0.768
136,0.771
137,0.773
138,0.776
139,0.779
140,0.782
141,0.784
142,0.787
143,0.79
144,0.792
145,0.795
146,0.798
147,0.8
148,0.803
149,0.805
150,0.808
assigned,ingame,calculated
0,0.0,-7.338606692330885e-06
1,0.01,0.009899646251607663
2,0.02,0.019715508948295213
3,0.029,0.029441087603991223
4,0.039,0.03907721263048747
5,0.049,0.048624706801628115
6,0.058,0.05808438532357796
7,0.067,0.06745705590441875
8,0.077,0.0767435188231318
9,0.086,0.08594456699790476
10,0.095,0.09506098605385105
11,0.104,0.10409355439008561
12,0.113,0.11304304324618386
13,0.122,0.12191021676804825
14,0.131,0.13069583207313296
15,0.139,0.13940063931510382
16,0.148,0.1480253817478835
17,0.157,0.1565707957891258
18,0.165,0.16503761108307513
19,0.173,0.17342655056288003
20,0.182,0.18173833051231592
21,0.19,0.189973660626943
22,0.198,0.19813324407471433
23,0.206,0.20621777755599702
24,0.214,0.21422795136307204
25,0.222,0.222164449439068
26,0.23,0.23002794943637184
27,0.238,0.23781912277447081
28,0.246,0.24553863469729353
29,0.253,0.2531871443300058
30,0.261,0.26076530473530024
31,0.268,0.26827376296914185
32,0.276,0.27571316013602587
33,0.283,0.2830841314437169
34,0.29,0.2903873062574822
35,0.298,0.29762330815384075
36,0.305,0.3047927549737901
37,0.312,0.3118962588755717
38,0.319,0.3189344263869339
39,0.326,0.32590785845693104
40,0.333,0.3328171505072183
41,0.34,0.3396628924829026
42,0.346,0.34644566890291206
43,0.353,0.3531660589099016
44,0.36,0.3598246363197136
45,0.366,0.3664219696703567
46,0.373,0.37295862227056087
47,0.379,0.3794351522478696
48,0.386,0.3858521125963057
49,0.392,0.3922100512235729
50,0.399,0.3985095109978487
51,0.405,0.40475102979413424
52,0.411,0.41093514054017843
53,0.417,0.4170623712619905
54,0.423,0.42313324512891115
55,0.429,0.42914828049829257
56,0.435,0.4351079909597534
57,0.441,0.44101288537904015
58,0.447,0.4468634679414628
59,0.453,0.45266023819495316
60,0.458,0.45840369109271695
61,0.464,0.46409431703549175
62,0.47,0.469732601913429
63,0.475,0.47531902714756813
64,0.481,0.4808540697309509
65,0.486,0.4863382022693453
66,0.492,0.4917718930216064
67,0.497,0.49715560593964647
68,0.503,0.5024898007080566
69,0.508,0.5077749327833555
70,0.513,0.5130114534328759
71,0.518,0.5181998097733035
72,0.523,0.5233404448088418
73,0.528,0.528433797469046
74,0.534,0.5334803026462964
75,0.539,0.5384803912329396
76,0.543,0.5434344901580676
77,0.548,0.5483430224239791
78,0.553,0.5532064071422955
79,0.558,0.558025059569744
80,0.563,0.5627993911436221
81,0.568,0.5675298095169159
82,0.572,0.5722167185931156
83,0.577,0.5768605185606984
84,0.581,0.5814616059273056
85,0.586,0.5860203735535872
86,0.591,0.5905372106867532
87,0.595,0.5950125029938078
88,0.599,0.5994466325944774
89,0.604,0.6038399780938442
90,0.608,0.608192914614663
91,0.613,0.6125058138293982
92,0.617,0.6167790439919543
93,0.621,0.6210129699691267
94,0.625,0.6252079532717454
95,0.629,0.6293643520855481
96,0.633,0.6334825213017619
97,0.638,0.6375628125474104
98,0.642,0.6416055742153288
99,0.646,0.6456111514939162
100,0.65,0.6495798863966094
101,0.654,0.6535121177910819
102,0.657,0.6574081814281856
103,0.661,0.6612684099706092
104,0.665,0.6650931330212878
105,0.669,0.6688826771515435
106,0.673,0.6726373659289748
107,0.676,0.676357519945076
108,0.68,0.6800434568426164
109,0.684,0.6836954913427596
110,0.687,0.6873139352719362
111,0.691,0.6908990975884723
112,0.694,0.6944512844089634
113,0.698,0.697970799034416
114,0.701,0.7014579419761423
115,0.705,0.7049130109814256
116,0.708,0.7083363010589336
117,0.712,0.711728104503914
118,0.715,0.7150887109231503
119,0.718,0.7184184072596882
120,0.722,0.7217174778173412
121,0.725,0.724986204284958
122,0.728,0.72822486576048
123,0.731,0.7314337387747685
124,0.735,0.7346130973152214
125,0.738,0.73776321284916
126,0.741,0.7408843543470132
127,0.744,0.7439767883052819
128,0.747,0.7470407787692924
129,0.75,0.7500765873557466
130,0.753,0.7530844732750526
131,0.756,0.7560646933534624
132,0.759,0.7590175020549981
133,0.762,0.7619431515031838
134,0.765,0.7648418915025662
135,0.768,0.7677139695600486
136,0.771,0.7705596309060228
137,0.773,0.7733791185153069
138,0.776,0.7761726731278962
139,0.779,0.7789405332695114
140,0.782,0.78168293527197
141,0.784,0.7844001132933628
142,0.787,0.7870922993380516
143,0.79,0.7897597232764726
144,0.792,0.7924026128647677
145,0.795,0.7950211937642291
146,0.798,0.7976156895605719
147,0.8,0.8001863217830184
148,0.803,0.8027333099232168
149,0.805,0.8052568714539818
150,0.808,0.8077572218478628
1 a assigned b ingame calculated
2 1 0 0.01 0.0 -7.338606692330885e-06
3 2 1 0.02 0.01 0.009899646251607663
4 3 2 0.029 0.02 0.019715508948295213
5 4 3 0.039 0.029 0.029441087603991223
6 5 4 0.049 0.039 0.03907721263048747
7 6 5 0.058 0.049 0.048624706801628115
8 7 6 0.067 0.058 0.05808438532357796
9 8 7 0.077 0.067 0.06745705590441875
10 9 8 0.086 0.077 0.0767435188231318
11 10 9 0.095 0.086 0.08594456699790476
12 11 10 0.104 0.095 0.09506098605385105
13 12 11 0.113 0.104 0.10409355439008561
14 13 12 0.122 0.113 0.11304304324618386
15 14 13 0.131 0.122 0.12191021676804825
16 15 14 0.139 0.131 0.13069583207313296
17 16 15 0.148 0.139 0.13940063931510382
18 17 16 0.157 0.148 0.1480253817478835
19 18 17 0.165 0.157 0.1565707957891258
20 19 18 0.173 0.165 0.16503761108307513
21 20 19 0.182 0.173 0.17342655056288003
22 21 20 0.19 0.182 0.18173833051231592
23 22 21 0.198 0.19 0.189973660626943
24 23 22 0.206 0.198 0.19813324407471433
25 24 23 0.214 0.206 0.20621777755599702
26 25 24 0.222 0.214 0.21422795136307204
27 26 25 0.23 0.222 0.222164449439068
28 27 26 0.238 0.23 0.23002794943637184
29 28 27 0.246 0.238 0.23781912277447081
30 29 28 0.253 0.246 0.24553863469729353
31 30 29 0.261 0.253 0.2531871443300058
32 31 30 0.268 0.261 0.26076530473530024
33 32 31 0.276 0.268 0.26827376296914185
34 33 32 0.283 0.276 0.27571316013602587
35 34 33 0.29 0.283 0.2830841314437169
36 35 34 0.298 0.29 0.2903873062574822
37 36 35 0.305 0.298 0.29762330815384075
38 37 36 0.312 0.305 0.3047927549737901
39 38 37 0.319 0.312 0.3118962588755717
40 39 38 0.326 0.319 0.3189344263869339
41 40 39 0.333 0.326 0.32590785845693104
42 41 40 0.34 0.333 0.3328171505072183
43 42 41 0.346 0.34 0.3396628924829026
44 43 42 0.353 0.346 0.34644566890291206
45 44 43 0.36 0.353 0.3531660589099016
46 45 44 0.366 0.36 0.3598246363197136
47 46 45 0.373 0.366 0.3664219696703567
48 47 46 0.379 0.373 0.37295862227056087
49 48 47 0.386 0.379 0.3794351522478696
50 49 48 0.392 0.386 0.3858521125963057
51 50 49 0.399 0.392 0.3922100512235729
52 51 50 0.405 0.399 0.3985095109978487
53 52 51 0.411 0.405 0.40475102979413424
54 53 52 0.417 0.411 0.41093514054017843
55 54 53 0.423 0.417 0.4170623712619905
56 55 54 0.429 0.423 0.42313324512891115
57 56 55 0.435 0.429 0.42914828049829257
58 57 56 0.441 0.435 0.4351079909597534
59 58 57 0.447 0.441 0.44101288537904015
60 59 58 0.453 0.447 0.4468634679414628
61 60 59 0.458 0.453 0.45266023819495316
62 61 60 0.464 0.458 0.45840369109271695
63 62 61 0.47 0.464 0.46409431703549175
64 63 62 0.475 0.47 0.469732601913429
65 64 63 0.481 0.475 0.47531902714756813
66 65 64 0.486 0.481 0.4808540697309509
67 66 65 0.492 0.486 0.4863382022693453
68 67 66 0.497 0.492 0.4917718930216064
69 68 67 0.503 0.497 0.49715560593964647
70 69 68 0.508 0.503 0.5024898007080566
71 70 69 0.513 0.508 0.5077749327833555
72 71 70 0.518 0.513 0.5130114534328759
73 72 71 0.523 0.518 0.5181998097733035
74 73 72 0.528 0.523 0.5233404448088418
75 74 73 0.534 0.528 0.528433797469046
76 75 74 0.539 0.534 0.5334803026462964
77 76 75 0.543 0.539 0.5384803912329396
78 77 76 0.548 0.543 0.5434344901580676
79 78 77 0.553 0.548 0.5483430224239791
80 79 78 0.558 0.553 0.5532064071422955
81 80 79 0.563 0.558 0.558025059569744
82 81 80 0.568 0.563 0.5627993911436221
83 82 81 0.572 0.568 0.5675298095169159
84 83 82 0.577 0.572 0.5722167185931156
85 84 83 0.581 0.577 0.5768605185606984
86 85 84 0.586 0.581 0.5814616059273056
87 86 85 0.591 0.586 0.5860203735535872
88 87 86 0.595 0.591 0.5905372106867532
89 88 87 0.599 0.595 0.5950125029938078
90 89 88 0.604 0.599 0.5994466325944774
91 90 89 0.608 0.604 0.6038399780938442
92 91 90 0.613 0.608 0.608192914614663
93 92 91 0.617 0.613 0.6125058138293982
94 93 92 0.621 0.617 0.6167790439919543
95 94 93 0.625 0.621 0.6210129699691267
96 95 94 0.629 0.625 0.6252079532717454
97 96 95 0.633 0.629 0.6293643520855481
98 97 96 0.638 0.633 0.6334825213017619
99 98 97 0.642 0.638 0.6375628125474104
100 99 98 0.646 0.642 0.6416055742153288
101 100 99 0.65 0.646 0.6456111514939162
102 101 100 0.654 0.65 0.6495798863966094
103 102 101 0.657 0.654 0.6535121177910819
104 103 102 0.661 0.657 0.6574081814281856
105 104 103 0.665 0.661 0.6612684099706092
106 105 104 0.669 0.665 0.6650931330212878
107 106 105 0.673 0.669 0.6688826771515435
108 107 106 0.676 0.673 0.6726373659289748
109 108 107 0.68 0.676 0.676357519945076
110 109 108 0.684 0.68 0.6800434568426164
111 110 109 0.687 0.684 0.6836954913427596
112 111 110 0.691 0.687 0.6873139352719362
113 112 111 0.694 0.691 0.6908990975884723
114 113 112 0.698 0.694 0.6944512844089634
115 114 113 0.701 0.698 0.697970799034416
116 115 114 0.705 0.701 0.7014579419761423
117 116 115 0.708 0.705 0.7049130109814256
118 117 116 0.712 0.708 0.7083363010589336
119 118 117 0.715 0.712 0.711728104503914
120 119 118 0.718 0.715 0.7150887109231503
121 120 119 0.722 0.718 0.7184184072596882
122 121 120 0.725 0.722 0.7217174778173412
123 122 121 0.728 0.725 0.724986204284958
124 123 122 0.731 0.728 0.72822486576048
125 124 123 0.735 0.731 0.7314337387747685
126 125 124 0.738 0.735 0.7346130973152214
127 126 125 0.741 0.738 0.73776321284916
128 127 126 0.744 0.741 0.7408843543470132
129 128 127 0.747 0.744 0.7439767883052819
130 129 128 0.75 0.747 0.7470407787692924
131 130 129 0.753 0.75 0.7500765873557466
132 131 130 0.756 0.753 0.7530844732750526
133 132 131 0.759 0.756 0.7560646933534624
134 133 132 0.762 0.759 0.7590175020549981
135 134 133 0.765 0.762 0.7619431515031838
136 135 134 0.768 0.765 0.7648418915025662
137 136 135 0.771 0.768 0.7677139695600486
138 137 136 0.773 0.771 0.7705596309060228
139 138 137 0.776 0.773 0.7733791185153069
140 139 138 0.779 0.776 0.7761726731278962
141 140 139 0.782 0.779 0.7789405332695114
142 141 140 0.784 0.782 0.78168293527197
143 142 141 0.787 0.784 0.7844001132933628
144 143 142 0.79 0.787 0.7870922993380516
145 144 143 0.792 0.79 0.7897597232764726
146 145 144 0.795 0.792 0.7924026128647677
147 146 145 0.798 0.795 0.7950211937642291
148 147 146 0.8 0.798 0.7976156895605719
149 148 147 0.803 0.8 0.8001863217830184
150 149 148 0.805 0.803 0.8027333099232168
151 150 149 0.808 0.805 0.8052568714539818
152 150 0.808 0.8077572218478628

24
styles.css Normal file
View file

@ -0,0 +1,24 @@
.header {
padding: 2%;
text-align: center;
}
.equipment {
padding: 4%;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 25px;
grid-auto-rows: minmax(60px, auto);
}
.skillpoints {
padding: 4%;
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 5px;
grid-auto-rows: minmax(60px, auto);
}
.center {
text-align: center;
}

157
test.js Normal file
View file

@ -0,0 +1,157 @@
const DB_VERSION = 1;
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.js
//const item_fields = [ "name", "displayName", "tier", "set", "slots", "type", "armorType", "color", "lore", "material", "drop", "quest", "restrict", "nDam", "fDam", "wDam", "aDam", "tDam", "eDam", "atkSpd", "hp", "fDef", "wDef", "aDef", "tDef", "eDef", "lvl", "classReq", "strReq", "dexReq", "intReq", "agiReq", "defReq", "hprPct", "mr", "sdPct", "mdPct", "ls", "ms", "xpb", "lb", "ref", "str", "dex", "int", "agi", "def", "thorns", "expoding", "spd", "atkTier", "poison", "hpBonus", "spRegen", "eSteal", "hprRaw", "sdRaw", "mdRaw", "fDamPct", "wDamPct", "aDamPct", "tDamPct", "eDamPct", "fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct", "accessoryType", "fixID", "skin", "category", "spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4", "rainbowRaw", "sprint", "sprintReg", "jh", "lq", "gXp", "gSpd" ]
let db;
let items;
let reload = false;
let armorTypes = [ "helmet", "chestplate", "leggings", "boots" ];
let accessoryTypes = [ "ring", "bracelet", "necklace" ];
let weaponTypes = [ "wand", "spear", "bow", "dagger", "relik" ];
let itemTypes = armorTypes.concat(accessoryTypes).concat(weaponTypes);
let itemLists = new Map();
for (const it of itemTypes) {
itemLists.set(it, []);
}
let itemMap = new Map();
function populateItemList(type) {
let item_list = document.getElementById(type+"-items");
for (const item of itemLists.get(type)) {
let el = document.createElement("option");
el.value = item;
item_list.appendChild(el);
}
}
function init() {
console.log(items);
for (const item of items) {
itemLists.get(item.type).push(item.name);
itemMap.set(item.name, item);
}
for (const armorType of armorTypes) {
populateItemList(armorType);
document.getElementById(armorType+"-choice").addEventListener("change", (event) => {
let item = itemMap.get(event.target.value);
if (item !== undefined) {
document.getElementById(armorType+"-slots").textContent = item.slots + " slots";
}
else {
document.getElementById(armorType+"-slots").textContent = "X slots";
}
});
}
let ring1_list = document.getElementById("ring1-items");
let ring2_list = document.getElementById("ring2-items");
for (const ring of itemLists.get("ring")) {
let el1 = document.createElement("option");
let el2 = document.createElement("option");
el1.value = ring;
el2.value = ring;
ring1_list.appendChild(el1);
ring2_list.appendChild(el2);
}
populateItemList("bracelet");
populateItemList("necklace");
let weapon_list = document.getElementById("weapon-items");
for (const weaponType of weaponTypes) {
for (const weapon of itemLists.get(weaponType)) {
let el = document.createElement("option");
el.value = weapon;
weapon_list.appendChild(el);
}
}
document.getElementById("weapon-choice").addEventListener("change", (event) => {
let item = itemMap.get(event.target.value);
if (item !== undefined) {
document.getElementById("weapon-slots").textContent = item.slots + " slots";
}
else {
document.getElementById("weapon-slots").textContent = "X slots";
}
});
}
async function load_local() {
let get_tx = db.transaction('item_db', 'readonly');
let get_store = get_tx.objectStore('item_db');
let request = get_store.getAll();
request.onerror = function(event) {
console.log("Could not read local db...");
}
request.onsuccess = function(event) {
console.log("Successfully read local db.");
items = request.result;
init();
}
await get_tx.complete;
db.close();
}
function clean_item(item) {
if (item.displayName === null) {
item.displayName = item.name;
}
}
async function load() {
let url = "https://hppeng-wynn.github.io/compress.json";
let result = await (await fetch(url)).json();
items = result.items;
// https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/clear
let clear_tx = db.transaction('item_db', 'readwrite');
let clear_store = clear_tx.objectStore('item_db');
await clear_store.clear();
await clear_tx.complete;
let add_tx = db.transaction('item_db', 'readwrite');
let add_store = add_tx.objectStore('item_db');
let add_promises = [];
for (const item of items) {
add_promises.push(add_store.add(item, item.name));
}
add_promises.push(add_tx.complete);
Promise.all(add_promises).then((values) => {
db.close();
init();
});
}
let request = window.indexedDB.open('item_db', DB_VERSION);
request.onerror = function() {
console.log("DB failed to open...");
};
request.onsuccess = function() {
db = request.result;
if (!reload) {
console.log("Using stored data...")
load_local();
}
else {
console.log("Using new data...")
load();
}
}
request.onupgradeneeded = function(e) {
reload = true;
let db = e.target.result;
let objectStore = db.createObjectStore('item_db');
objectStore.createIndex('item', 'item', {unique: false});
console.log("DB setup complete...");
}