fixed merge issues
This commit is contained in:
commit
f6e68a74b8
11 changed files with 72153 additions and 71797 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
*.swp
|
3
build.js
3
build.js
|
@ -9,6 +9,9 @@ function skillPointsToPercentage(skp){
|
||||||
//return(-0.0000000066695* Math.pow(Math.E, -0.00924033 * skp + 18.9) + 1.0771).toFixed(3);
|
//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{
|
class Build{
|
||||||
|
|
143256
clean.json
143256
clean.json
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
50
compress.py
50
compress.py
|
@ -4,10 +4,22 @@ with open("dump.json", "r") as infile:
|
||||||
data = json.loads(infile.read())
|
data = json.loads(infile.read())
|
||||||
|
|
||||||
items = data["items"]
|
items = data["items"]
|
||||||
|
del data["request"]
|
||||||
|
|
||||||
translate_mappings = {
|
translate_mappings = {
|
||||||
|
#"name": "name",
|
||||||
|
#"displayName": "displayName",
|
||||||
|
#"tier": "tier",
|
||||||
|
#"set": "set",
|
||||||
"sockets": "slots",
|
"sockets": "slots",
|
||||||
|
#"type": "type",
|
||||||
|
# UNUSED? "armorType": "armorType",
|
||||||
|
"armorColor": "color",
|
||||||
"addedLore": "lore",
|
"addedLore": "lore",
|
||||||
|
#"material": "material",
|
||||||
|
"dropType": "drop",
|
||||||
|
#"quest": "quest",
|
||||||
|
"restrictions": "restrict",
|
||||||
"damage": "nDam",
|
"damage": "nDam",
|
||||||
"fireDamage": "fDam",
|
"fireDamage": "fDam",
|
||||||
"waterDamage": "wDam",
|
"waterDamage": "wDam",
|
||||||
|
@ -30,8 +42,8 @@ translate_mappings = {
|
||||||
"defense": "defReq",
|
"defense": "defReq",
|
||||||
"healthRegen": "hprPct",
|
"healthRegen": "hprPct",
|
||||||
"manaRegen": "mr",
|
"manaRegen": "mr",
|
||||||
"spellDamage": "spellPct",
|
"spellDamage": "sdPct",
|
||||||
"damageBonus": "meleePct",
|
"damageBonus": "mdPct",
|
||||||
"lifeSteal": "ls",
|
"lifeSteal": "ls",
|
||||||
"manaSteal": "ms",
|
"manaSteal": "ms",
|
||||||
"xpBonus": "xpb",
|
"xpBonus": "xpb",
|
||||||
|
@ -45,14 +57,14 @@ translate_mappings = {
|
||||||
#"thorns": "thorns",
|
#"thorns": "thorns",
|
||||||
#"exploding": "expoding",
|
#"exploding": "expoding",
|
||||||
"speed": "spd",
|
"speed": "spd",
|
||||||
"attackSpeedBonus": "attackTier",
|
"attackSpeedBonus": "atkTier",
|
||||||
#"poison": "poison",
|
#"poison": "poison",
|
||||||
"healthBonus": "hpBonus",
|
"healthBonus": "hpBonus",
|
||||||
"soulPoints": "spRegen",
|
"soulPoints": "spRegen",
|
||||||
"emeraldStealing": "stealing",
|
"emeraldStealing": "eSteal",
|
||||||
"healthRegenRaw": "hprRaw",
|
"healthRegenRaw": "hprRaw",
|
||||||
"spellDamageRaw": "spellRaw",
|
"spellDamageRaw": "sdRaw",
|
||||||
"damageBonusRaw": "meleeRaw",
|
"damageBonusRaw": "mdRaw",
|
||||||
"bonusFireDamage": "fDamPct",
|
"bonusFireDamage": "fDamPct",
|
||||||
"bonusWaterDamage": "wDamPct",
|
"bonusWaterDamage": "wDamPct",
|
||||||
"bonusAirDamage": "aDamPct",
|
"bonusAirDamage": "aDamPct",
|
||||||
|
@ -63,22 +75,28 @@ translate_mappings = {
|
||||||
"bonusAirDefense": "aDefPct",
|
"bonusAirDefense": "aDefPct",
|
||||||
"bonusThunderDefense": "tDefPct",
|
"bonusThunderDefense": "tDefPct",
|
||||||
"bonusEarthDefense": "eDefPct",
|
"bonusEarthDefense": "eDefPct",
|
||||||
|
"accessoryType": "type",
|
||||||
"identified": "fixID",
|
"identified": "fixID",
|
||||||
|
#"skin": "skin",
|
||||||
|
#"category": "category",
|
||||||
|
|
||||||
"spellCostPct1": "spellPct1",
|
"spellCostPct1": "spPct1",
|
||||||
"spellCostRaw1": "spellRaw1",
|
"spellCostRaw1": "spRaw1",
|
||||||
"spellCostPct2": "spellPct2",
|
"spellCostPct2": "spPct2",
|
||||||
"spellCostRaw2": "spellRaw2",
|
"spellCostRaw2": "spRaw2",
|
||||||
"spellCostPct3": "spellPct3",
|
"spellCostPct3": "spPct3",
|
||||||
"spellCostRaw3": "spellRaw3",
|
"spellCostRaw3": "spRaw3",
|
||||||
"spellCostPct4": "spellPct4",
|
"spellCostPct4": "spPct4",
|
||||||
"spellCostRaw4": "spellRaw4",
|
"spellCostRaw4": "spRaw4",
|
||||||
|
|
||||||
"rainbowSpellDamageRaw": "rainbowSDRaw",
|
"rainbowSpellDamageRaw": "rainbowRaw",
|
||||||
"sprint": "sprint",
|
"sprint": "sprint",
|
||||||
"sprintRegen": "sprintReg",
|
"sprintRegen": "sprintReg",
|
||||||
"jumpHeight": "jh",
|
"jumpHeight": "jh",
|
||||||
"lootQuality": "lq",
|
"lootQuality": "lq",
|
||||||
|
|
||||||
|
"gatherXpBonus": "gXp",
|
||||||
|
"gatherSpeed": "gSpd",
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_keys = [
|
delete_keys = [
|
||||||
|
@ -98,6 +116,8 @@ for item in items:
|
||||||
item[v] = item[k]
|
item[v] = item[k]
|
||||||
del item[k]
|
del item[k]
|
||||||
|
|
||||||
|
item["type"] = item["type"].lower()
|
||||||
|
|
||||||
with open("clean.json", "w") as outfile:
|
with open("clean.json", "w") as outfile:
|
||||||
outfile.write(json.dumps(data, indent=2))
|
outfile.write(json.dumps(data, indent=2))
|
||||||
with open("compress.json", "w") as outfile:
|
with open("compress.json", "w") as outfile:
|
||||||
|
|
145
index.html
Normal file
145
index.html
Normal 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
4
manifest.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"display": "standalone",
|
||||||
|
"orientation": "portrait"
|
||||||
|
}
|
|
@ -1 +1,4 @@
|
||||||
#A workspace for processing info/one-time operations
|
#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)
|
303
skillpoints.csv
303
skillpoints.csv
|
@ -1,151 +1,152 @@
|
||||||
a,b
|
assigned,ingame,calculated
|
||||||
1,0.01
|
0,0.0,-7.338606692330885e-06
|
||||||
2,0.02
|
1,0.01,0.009899646251607663
|
||||||
3,0.029
|
2,0.02,0.019715508948295213
|
||||||
4,0.039
|
3,0.029,0.029441087603991223
|
||||||
5,0.049
|
4,0.039,0.03907721263048747
|
||||||
6,0.058
|
5,0.049,0.048624706801628115
|
||||||
7,0.067
|
6,0.058,0.05808438532357796
|
||||||
8,0.077
|
7,0.067,0.06745705590441875
|
||||||
9,0.086
|
8,0.077,0.0767435188231318
|
||||||
10,0.095
|
9,0.086,0.08594456699790476
|
||||||
11,0.104
|
10,0.095,0.09506098605385105
|
||||||
12,0.113
|
11,0.104,0.10409355439008561
|
||||||
13,0.122
|
12,0.113,0.11304304324618386
|
||||||
14,0.131
|
13,0.122,0.12191021676804825
|
||||||
15,0.139
|
14,0.131,0.13069583207313296
|
||||||
16,0.148
|
15,0.139,0.13940063931510382
|
||||||
17,0.157
|
16,0.148,0.1480253817478835
|
||||||
18,0.165
|
17,0.157,0.1565707957891258
|
||||||
19,0.173
|
18,0.165,0.16503761108307513
|
||||||
20,0.182
|
19,0.173,0.17342655056288003
|
||||||
21,0.19
|
20,0.182,0.18173833051231592
|
||||||
22,0.198
|
21,0.19,0.189973660626943
|
||||||
23,0.206
|
22,0.198,0.19813324407471433
|
||||||
24,0.214
|
23,0.206,0.20621777755599702
|
||||||
25,0.222
|
24,0.214,0.21422795136307204
|
||||||
26,0.23
|
25,0.222,0.222164449439068
|
||||||
27,0.238
|
26,0.23,0.23002794943637184
|
||||||
28,0.246
|
27,0.238,0.23781912277447081
|
||||||
29,0.253
|
28,0.246,0.24553863469729353
|
||||||
30,0.261
|
29,0.253,0.2531871443300058
|
||||||
31,0.268
|
30,0.261,0.26076530473530024
|
||||||
32,0.276
|
31,0.268,0.26827376296914185
|
||||||
33,0.283
|
32,0.276,0.27571316013602587
|
||||||
34,0.29
|
33,0.283,0.2830841314437169
|
||||||
35,0.298
|
34,0.29,0.2903873062574822
|
||||||
36,0.305
|
35,0.298,0.29762330815384075
|
||||||
37,0.312
|
36,0.305,0.3047927549737901
|
||||||
38,0.319
|
37,0.312,0.3118962588755717
|
||||||
39,0.326
|
38,0.319,0.3189344263869339
|
||||||
40,0.333
|
39,0.326,0.32590785845693104
|
||||||
41,0.34
|
40,0.333,0.3328171505072183
|
||||||
42,0.346
|
41,0.34,0.3396628924829026
|
||||||
43,0.353
|
42,0.346,0.34644566890291206
|
||||||
44,0.36
|
43,0.353,0.3531660589099016
|
||||||
45,0.366
|
44,0.36,0.3598246363197136
|
||||||
46,0.373
|
45,0.366,0.3664219696703567
|
||||||
47,0.379
|
46,0.373,0.37295862227056087
|
||||||
48,0.386
|
47,0.379,0.3794351522478696
|
||||||
49,0.392
|
48,0.386,0.3858521125963057
|
||||||
50,0.399
|
49,0.392,0.3922100512235729
|
||||||
51,0.405
|
50,0.399,0.3985095109978487
|
||||||
52,0.411
|
51,0.405,0.40475102979413424
|
||||||
53,0.417
|
52,0.411,0.41093514054017843
|
||||||
54,0.423
|
53,0.417,0.4170623712619905
|
||||||
55,0.429
|
54,0.423,0.42313324512891115
|
||||||
56,0.435
|
55,0.429,0.42914828049829257
|
||||||
57,0.441
|
56,0.435,0.4351079909597534
|
||||||
58,0.447
|
57,0.441,0.44101288537904015
|
||||||
59,0.453
|
58,0.447,0.4468634679414628
|
||||||
60,0.458
|
59,0.453,0.45266023819495316
|
||||||
61,0.464
|
60,0.458,0.45840369109271695
|
||||||
62,0.47
|
61,0.464,0.46409431703549175
|
||||||
63,0.475
|
62,0.47,0.469732601913429
|
||||||
64,0.481
|
63,0.475,0.47531902714756813
|
||||||
65,0.486
|
64,0.481,0.4808540697309509
|
||||||
66,0.492
|
65,0.486,0.4863382022693453
|
||||||
67,0.497
|
66,0.492,0.4917718930216064
|
||||||
68,0.503
|
67,0.497,0.49715560593964647
|
||||||
69,0.508
|
68,0.503,0.5024898007080566
|
||||||
70,0.513
|
69,0.508,0.5077749327833555
|
||||||
71,0.518
|
70,0.513,0.5130114534328759
|
||||||
72,0.523
|
71,0.518,0.5181998097733035
|
||||||
73,0.528
|
72,0.523,0.5233404448088418
|
||||||
74,0.534
|
73,0.528,0.528433797469046
|
||||||
75,0.539
|
74,0.534,0.5334803026462964
|
||||||
76,0.543
|
75,0.539,0.5384803912329396
|
||||||
77,0.548
|
76,0.543,0.5434344901580676
|
||||||
78,0.553
|
77,0.548,0.5483430224239791
|
||||||
79,0.558
|
78,0.553,0.5532064071422955
|
||||||
80,0.563
|
79,0.558,0.558025059569744
|
||||||
81,0.568
|
80,0.563,0.5627993911436221
|
||||||
82,0.572
|
81,0.568,0.5675298095169159
|
||||||
83,0.577
|
82,0.572,0.5722167185931156
|
||||||
84,0.581
|
83,0.577,0.5768605185606984
|
||||||
85,0.586
|
84,0.581,0.5814616059273056
|
||||||
86,0.591
|
85,0.586,0.5860203735535872
|
||||||
87,0.595
|
86,0.591,0.5905372106867532
|
||||||
88,0.599
|
87,0.595,0.5950125029938078
|
||||||
89,0.604
|
88,0.599,0.5994466325944774
|
||||||
90,0.608
|
89,0.604,0.6038399780938442
|
||||||
91,0.613
|
90,0.608,0.608192914614663
|
||||||
92,0.617
|
91,0.613,0.6125058138293982
|
||||||
93,0.621
|
92,0.617,0.6167790439919543
|
||||||
94,0.625
|
93,0.621,0.6210129699691267
|
||||||
95,0.629
|
94,0.625,0.6252079532717454
|
||||||
96,0.633
|
95,0.629,0.6293643520855481
|
||||||
97,0.638
|
96,0.633,0.6334825213017619
|
||||||
98,0.642
|
97,0.638,0.6375628125474104
|
||||||
99,0.646
|
98,0.642,0.6416055742153288
|
||||||
100,0.65
|
99,0.646,0.6456111514939162
|
||||||
101,0.654
|
100,0.65,0.6495798863966094
|
||||||
102,0.657
|
101,0.654,0.6535121177910819
|
||||||
103,0.661
|
102,0.657,0.6574081814281856
|
||||||
104,0.665
|
103,0.661,0.6612684099706092
|
||||||
105,0.669
|
104,0.665,0.6650931330212878
|
||||||
106,0.673
|
105,0.669,0.6688826771515435
|
||||||
107,0.676
|
106,0.673,0.6726373659289748
|
||||||
108,0.68
|
107,0.676,0.676357519945076
|
||||||
109,0.684
|
108,0.68,0.6800434568426164
|
||||||
110,0.687
|
109,0.684,0.6836954913427596
|
||||||
111,0.691
|
110,0.687,0.6873139352719362
|
||||||
112,0.694
|
111,0.691,0.6908990975884723
|
||||||
113,0.698
|
112,0.694,0.6944512844089634
|
||||||
114,0.701
|
113,0.698,0.697970799034416
|
||||||
115,0.705
|
114,0.701,0.7014579419761423
|
||||||
116,0.708
|
115,0.705,0.7049130109814256
|
||||||
117,0.712
|
116,0.708,0.7083363010589336
|
||||||
118,0.715
|
117,0.712,0.711728104503914
|
||||||
119,0.718
|
118,0.715,0.7150887109231503
|
||||||
120,0.722
|
119,0.718,0.7184184072596882
|
||||||
121,0.725
|
120,0.722,0.7217174778173412
|
||||||
122,0.728
|
121,0.725,0.724986204284958
|
||||||
123,0.731
|
122,0.728,0.72822486576048
|
||||||
124,0.735
|
123,0.731,0.7314337387747685
|
||||||
125,0.738
|
124,0.735,0.7346130973152214
|
||||||
126,0.741
|
125,0.738,0.73776321284916
|
||||||
127,0.744
|
126,0.741,0.7408843543470132
|
||||||
128,0.747
|
127,0.744,0.7439767883052819
|
||||||
129,0.75
|
128,0.747,0.7470407787692924
|
||||||
130,0.753
|
129,0.75,0.7500765873557466
|
||||||
131,0.756
|
130,0.753,0.7530844732750526
|
||||||
132,0.759
|
131,0.756,0.7560646933534624
|
||||||
133,0.762
|
132,0.759,0.7590175020549981
|
||||||
134,0.765
|
133,0.762,0.7619431515031838
|
||||||
135,0.768
|
134,0.765,0.7648418915025662
|
||||||
136,0.771
|
135,0.768,0.7677139695600486
|
||||||
137,0.773
|
136,0.771,0.7705596309060228
|
||||||
138,0.776
|
137,0.773,0.7733791185153069
|
||||||
139,0.779
|
138,0.776,0.7761726731278962
|
||||||
140,0.782
|
139,0.779,0.7789405332695114
|
||||||
141,0.784
|
140,0.782,0.78168293527197
|
||||||
142,0.787
|
141,0.784,0.7844001132933628
|
||||||
143,0.79
|
142,0.787,0.7870922993380516
|
||||||
144,0.792
|
143,0.79,0.7897597232764726
|
||||||
145,0.795
|
144,0.792,0.7924026128647677
|
||||||
146,0.798
|
145,0.795,0.7950211937642291
|
||||||
147,0.8
|
146,0.798,0.7976156895605719
|
||||||
148,0.803
|
147,0.8,0.8001863217830184
|
||||||
149,0.805
|
148,0.803,0.8027333099232168
|
||||||
150,0.808
|
149,0.805,0.8052568714539818
|
||||||
|
150,0.808,0.8077572218478628
|
|
24
styles.css
Normal file
24
styles.css
Normal 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
157
test.js
Normal 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...");
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue