renamed some files

This commit is contained in:
Frederik Palmø 2022-03-22 14:35:29 +01:00
parent 5400536dcd
commit bdf333a2f1
9 changed files with 4677 additions and 4693 deletions

View File

@ -1,5 +1,4 @@
{ [
"chestpieces": [
{ {
"id": "no-chestpiece", "id": "no-chestpiece",
"name": "No Item", "name": "No Item",
@ -1641,4 +1640,3 @@
"weight": 8.8 "weight": 8.8
} }
] ]
}

View File

@ -1,5 +1,4 @@
{ [
"gauntlets": [
{ {
"id": "no-gauntlets", "id": "no-gauntlets",
"name": "No Item", "name": "No Item",
@ -737,4 +736,3 @@
"weight": 2.3 "weight": 2.3
} }
] ]
}

View File

@ -1,5 +1,4 @@
{ [
"helmets": [
{ {
"id": "no-helmet", "id": "no-helmet",
"name": "No Item", "name": "No Item",
@ -1335,4 +1334,3 @@
"weight": 3.8 "weight": 3.8
} }
] ]
}

View File

@ -1,5 +1,4 @@
{ [
"leggings": [
{ {
"id": "no-leggings", "id": "no-leggings",
"name": "No Item", "name": "No Item",
@ -841,4 +840,3 @@
"weight": 5.1 "weight": 5.1
} }
] ]
}

View File

@ -1,5 +1,4 @@
{ [
"sets": [
{ {
"id": "alberichs-set", "id": "alberichs-set",
"name": "Alberich's Set", "name": "Alberich's Set",
@ -11,4 +10,3 @@
] ]
} }
] ]
}

View File

@ -1,5 +1,4 @@
{ [
"classes": [
{ {
"name": "Vagabond", "name": "Vagabond",
"level": 9, "level": 9,
@ -51,4 +50,3 @@
"stats": [10, 10, 10, 10, 10, 10, 10, 10] "stats": [10, 10, 10, 10, 10, 10, 10, 10]
} }
] ]
}

View File

@ -1,5 +1,4 @@
{ [
"talismans": [
{ {
"id": "radagons-soreseal", "id": "radagons-soreseal",
"name": "Radagon's Soreseal", "name": "Radagon's Soreseal",
@ -47,4 +46,3 @@
"weight": 0.7 "weight": 0.7
} }
] ]
}

View File

@ -1,18 +1,14 @@
const HELMETS = fetch("/data/armor/helmets.json") const HELMETS = fetch("/data/armor/helmets.json")
.then(response => response.json()) .then(response => response.json())
.then(data => data.helmets)
.catch(error => console.log(error)); .catch(error => console.log(error));
const CHESTPIECES = fetch("/data/armor/chestpieces.json") const CHESTPIECES = fetch("/data/armor/chestpieces.json")
.then(response => response.json()) .then(response => response.json())
.then(data => data.chestpieces)
.catch(error => console.log(error)); .catch(error => console.log(error));
const GAUNTLETS = fetch("/data/armor/gauntlets.json") const GAUNTLETS = fetch("/data/armor/gauntlets.json")
.then(response => response.json()) .then(response => response.json())
.then(data => data.gauntlets)
.catch(error => console.log(error)); .catch(error => console.log(error));
const LEGGINGS = fetch("/data/armor/leggings.json") const LEGGINGS = fetch("/data/armor/leggings.json")
.then(response => response.json()) .then(response => response.json())
.then(data => data.leggings)
.catch(error => console.log(error)); .catch(error => console.log(error));
// armor combination lists // armor combination lists
@ -52,7 +48,7 @@ async function init() {
async function update() { async function update() {
// clamp equip load values to reasonable values // clamp equip load values to reasonable values
[...document.getElementsByName("equip-load")].forEach(el => el.value = Math.max(el.value, 0)); [...document.getElementsByName("equip-load")].forEach(el => el.value = Math.max(el.value, 0.0));
// get budget and sorting order // get budget and sorting order
let budget = equipLoadBudget(); let budget = equipLoadBudget();
@ -85,7 +81,12 @@ function equipLoadBudget() {
break; break;
} }
return (parseInt(document.getElementById("max-equip-load").value) || 0 - parseInt(document.getElementById("current-equip-load").value) || 0) * rollModifier; let max = document.getElementById("max-equip-load").value || 0;
let current = document.getElementById("current-equip-load").value || 0;
let budget = Math.max((max - current) * rollModifier, 0);
return budget;
} }
function currentSortBy() { function currentSortBy() {

View File

@ -1,14 +1,11 @@
const CLASSES = fetch("/data/classes.json") const CLASSES = fetch("/data/classes.json")
.then(response => response.json()) .then(response => response.json())
.then(data => data.classes)
.catch(error => console.log(error)); .catch(error => console.log(error));
const TALISMANS = fetch("/data/talismans.json") const TALISMANS = fetch("/data/talismans.json")
.then(response => response.json()) .then(response => response.json())
.then(data => data.talismans)
.catch(error => console.log(error)); .catch(error => console.log(error));
const HELMETS = fetch("/data/armor/helmets.json") const HELMETS = fetch("/data/armor/helmets.json")
.then(response => response.json()) .then(response => response.json())
.then(data => data.helmets)
.catch(error => console.log(error)); .catch(error => console.log(error));
const STAT_SHORT_NAMES = [ const STAT_SHORT_NAMES = [