Clean up customizer files, fix negtative id

This commit is contained in:
b 2021-06-19 02:06:46 -07:00
parent 6247ffd7fb
commit 2aaf103d4b
4 changed files with 98 additions and 82 deletions

View file

@ -2,23 +2,23 @@
"items": [ "items": [
{ {
"name": "Black Catalyst", "name": "Black Catalyst",
"lore": "Even simply looking at these odd rings gives way to a compulsion to wear two of them, despite all better judgement.",
"type": "ring", "type": "ring",
"tier": "Set", "tier": "Set",
"category": "accessory", "category": "accessory",
"displayName": "Black Catalyst", "displayName": "Black Catalyst",
"set": "Black Catalyst",
"hp": -325, "hp": -325,
"lvl": 83, "lvl": 83,
"xpb": -5, "sdPct": 8,
"xpb": 15,
"str": -2, "str": -2,
"dex": -2, "dex": -2,
"int": -2, "int": -2,
"agi": -2, "agi": -2,
"def": -2, "def": -2,
"id": 628,
"spRegen": -5, "spRegen": -5,
"fixID": true, "fixID": true,
"id": 628 "set": "Black Catalyst"
}, },
{ {
"name": "Blue Mask", "name": "Blue Mask",
@ -34,6 +34,7 @@
"int": 12, "int": 12,
"agi": 12, "agi": 12,
"def": 12, "def": 12,
"fixID": true,
"id": 393 "id": 393
}, },
{ {
@ -55,6 +56,7 @@
"int": 9, "int": 9,
"agi": 9, "agi": 9,
"def": 9, "def": 9,
"fixID": true,
"spPct2": -1, "spPct2": -1,
"id": 1022 "id": 1022
}, },
@ -83,9 +85,9 @@
"aDamPct": -65, "aDamPct": -65,
"tDamPct": 40, "tDamPct": 40,
"eDamPct": -65, "eDamPct": -65,
"fixID": true,
"id": 1259, "id": 1259,
"set": "Fire Hive", "set": "Fire Hive",
"fixID": true,
"hideSet": true "hideSet": true
}, },
{ {
@ -94,13 +96,8 @@
"tier": "Rare", "tier": "Rare",
"category": "weapon", "category": "weapon",
"displayName": "King of Hearts", "displayName": "King of Hearts",
"poison": -10000000,
"slots": 2, "slots": 2,
"nDam": "0-0",
"fDam": "0-0",
"wDam": "0-0",
"aDam": "0-0",
"tDam": "0-0",
"eDam": "0-0",
"atkSpd": "NORMAL", "atkSpd": "NORMAL",
"lvl": 97, "lvl": 97,
"intReq": 60, "intReq": 60,
@ -108,7 +105,10 @@
"mr": 3, "mr": 3,
"hpBonus": 3692, "hpBonus": 3692,
"hprRaw": 200, "hprRaw": 200,
"sdRaw": -10000000,
"mdRaw": -10000000,
"wDamPct": 100, "wDamPct": 100,
"spRaw1": -6,
"id": 1533 "id": 1533
}, },
{ {
@ -124,6 +124,8 @@
"lvl": 82, "lvl": 82,
"dexReq": 15, "dexReq": 15,
"agiReq": 50, "agiReq": 50,
"sdPct": -15,
"mdPct": -20,
"ms": 1, "ms": 1,
"ref": 30, "ref": 30,
"dex": 15, "dex": 15,
@ -144,6 +146,7 @@
"lvl": 97, "lvl": 97,
"strReq": 70, "strReq": 70,
"dexReq": 70, "dexReq": 70,
"mdPct": -45,
"ref": 1, "ref": 1,
"agi": -20, "agi": -20,
"def": -20, "def": -20,
@ -165,11 +168,13 @@
"tDef": 50, "tDef": 50,
"lvl": 86, "lvl": 86,
"dexReq": 65, "dexReq": 65,
"mr": -3,
"mdPct": 15, "mdPct": 15,
"ms": 3, "ms": 3,
"dex": 12, "dex": 12,
"sdRaw": 205, "sdRaw": 205,
"mdRaw": 230, "mdRaw": 230,
"wDamPct": -20,
"tDamPct": 15, "tDamPct": 15,
"id": 3160 "id": 3160
}, },
@ -197,17 +202,17 @@
"def": -6, "def": -6,
"tDamPct": 30, "tDamPct": 30,
"eDamPct": 30, "eDamPct": 30,
"fixID": true,
"id": 1253, "id": 1253,
"set": "Earth Hive", "set": "Earth Hive",
"fixID": true,
"hideSet": true "hideSet": true
}, },
{ {
"name": "Breakdown", "name": "Breakdown",
"displayName": "Nycthemeron",
"type": "helmet", "type": "helmet",
"tier": "Unique", "tier": "Unique",
"category": "armor", "category": "armor",
"displayName": "Nychthemeron",
"slots": 3, "slots": 3,
"hp": 2375, "hp": 2375,
"wDef": -50, "wDef": -50,
@ -222,6 +227,8 @@
"ms": 2, "ms": 2,
"str": 10, "str": 10,
"dex": 10, "dex": 10,
"atkTier": -10,
"spRegen": -15,
"tDamPct": 15, "tDamPct": 15,
"eDamPct": 15, "eDamPct": 15,
"id": 3595 "id": 3595
@ -232,14 +239,7 @@
"tier": "Rare", "tier": "Rare",
"category": "weapon", "category": "weapon",
"displayName": "Arkhalis", "displayName": "Arkhalis",
"basedps": 212,
"slots": 3, "slots": 3,
"nDam": "0-0",
"fDam": "0-0",
"wDam": "0-0",
"aDam": "0-0",
"tDam": "127-297",
"eDam": "0-0",
"atkSpd": "SUPER_FAST", "atkSpd": "SUPER_FAST",
"lvl": 98, "lvl": 98,
"dexReq": 60, "dexReq": 60,
@ -248,8 +248,10 @@
"dex": 15, "dex": 15,
"spd": 15, "spd": 15,
"atkTier": -1, "atkTier": -1,
"hpBonus": -1350,
"mdRaw": 425, "mdRaw": 425,
"tDamPct": 15, "tDamPct": 15,
"eDefPct": -30,
"id": 145 "id": 145
}, },
{ {
@ -343,6 +345,8 @@
"ls": 300, "ls": 300,
"ref": 10, "ref": 10,
"dex": 10, "dex": 10,
"atkTier": -10,
"hpBonus": -800,
"mdRaw": 2700, "mdRaw": 2700,
"tDamPct": 23, "tDamPct": 23,
"id": 2987 "id": 2987
@ -401,10 +405,12 @@
"lvl": 96, "lvl": 96,
"dexReq": 55, "dexReq": 55,
"intReq": 60, "intReq": 60,
"mdPct": -20,
"ms": 2, "ms": 2,
"int": 5, "int": 5,
"expd": 12, "expd": 12,
"sdRaw": 277, "sdRaw": 277,
"tDefPct": -20,
"id": 3597 "id": 3597
}, },
{ {
@ -419,6 +425,8 @@
"lvl": 89, "lvl": 89,
"strReq": 55, "strReq": 55,
"dexReq": 55, "dexReq": 55,
"hprPct": -30,
"sdPct": -30,
"mdPct": 8, "mdPct": 8,
"ls": 170, "ls": 170,
"str": 10, "str": 10,
@ -433,14 +441,7 @@
"tier": "Legendary", "tier": "Legendary",
"category": "weapon", "category": "weapon",
"displayName": "Hashr Claw", "displayName": "Hashr Claw",
"basedps": 42.5,
"slots": 2, "slots": 2,
"nDam": "10-15",
"fDam": "0-0",
"wDam": "0-0",
"aDam": "0-0",
"tDam": "10-50",
"eDam": "0-0",
"atkSpd": "SUPER_FAST", "atkSpd": "SUPER_FAST",
"lvl": 39, "lvl": 39,
"dexReq": 30, "dexReq": 30,
@ -467,11 +468,14 @@
"intReq": 60, "intReq": 60,
"defReq": 60, "defReq": 60,
"sdPct": 17, "sdPct": 17,
"mdPct": -25,
"ls": -450,
"ms": 3, "ms": 3,
"int": 6, "int": 6,
"def": 6, "def": 6,
"spd": 13, "spd": 13,
"sdRaw": 170, "sdRaw": 170,
"mdRaw": -225,
"id": 3589 "id": 3589
}, },
{ {
@ -490,6 +494,7 @@
"sdPct": 19, "sdPct": 19,
"ms": 1, "ms": 1,
"str": 10, "str": 10,
"spd": -15,
"hprRaw": 155, "hprRaw": 155,
"mdRaw": 330, "mdRaw": 330,
"eDamPct": 15, "eDamPct": 15,
@ -576,14 +581,7 @@
"tier": "Mythic", "tier": "Mythic",
"category": "weapon", "category": "weapon",
"displayName": "Collapse", "displayName": "Collapse",
"basedps": 827.5,
"slots": 3, "slots": 3,
"nDam": "40-65",
"fDam": "0-310",
"wDam": "0-310",
"aDam": "0-310",
"tDam": "0-310",
"eDam": "0-310",
"atkSpd": "VERY_SLOW", "atkSpd": "VERY_SLOW",
"lvl": 97, "lvl": 97,
"strReq": 35, "strReq": 35,
@ -595,8 +593,36 @@
"ms": 4, "ms": 4,
"str": 45, "str": 45,
"expd": 250, "expd": 250,
"fDefPct": -65,
"wDefPct": -65,
"aDefPct": -65,
"tDefPct": -65,
"eDefPct": -65,
"id": 1693 "id": 1693
}, },
{
"name": "Singularity",
"type": "wand",
"tier": "Mythic",
"category": "weapon",
"displayName": "Singularity",
"slots": 15,
"atkSpd": "SUPER_SLOW",
"lvl": 99,
"strReq": 42,
"dexReq": 42,
"intReq": 42,
"agiReq": 42,
"defReq": 42,
"sdPct": 10,
"mdPct": 15,
"dex": 35,
"spd": -40,
"hprRaw": 250,
"sdRaw": 222,
"mdRaw": 444,
"id": 1715
},
{ {
"name": "Nona", "name": "Nona",
"tier": "Legendary", "tier": "Legendary",
@ -52769,41 +52795,6 @@
"spPct3": -55, "spPct3": -55,
"id": 1716 "id": 1716
}, },
{
"name": "Singularity",
"tier": "Mythic",
"type": "wand",
"material": "269:19",
"category": "weapon",
"slots": 15,
"lore": "The existence of all things is reflected in the otherworldly jewels of this grand staff, dense enough to have its own gravitational pull. Users have reported their limbs being stretched after usage.",
"drop": "NORMAL",
"nDam": "0-0",
"fDam": "125-275",
"wDam": "150-250",
"aDam": "100-300",
"tDam": "75-375",
"eDam": "175-225",
"atkSpd": "SUPER_SLOW",
"lvl": 99,
"strReq": 42,
"dexReq": 42,
"intReq": 42,
"agiReq": 42,
"defReq": 42,
"sdPct": 10,
"mdPct": 15,
"str": 0,
"dex": 35,
"int": 0,
"agi": 0,
"def": 0,
"spd": -40,
"hprRaw": 250,
"sdRaw": 222,
"mdRaw": 444,
"id": 1715
},
{ {
"name": "Stardew", "name": "Stardew",
"tier": "Mythic", "tier": "Mythic",

File diff suppressed because one or more lines are too long

View file

@ -222,9 +222,18 @@ class Custom{
this.statMap.set("custom", true); this.statMap.set("custom", true);
for (const n of ["nDam","eDam","tDam","wDam","fDam","aDam"]) { if (weaponTypes.includes(this.statMap.get("type"))) {
if (!(this.statMap.has(n) && this.statMap.get(n))) { for (const n of ["nDam","eDam","tDam","wDam","fDam","aDam"]) {
this.statMap.set(n,"0-0"); if (!(this.statMap.has(n) && this.statMap.get(n))) {
this.statMap.set(n,"0-0");
}
}
}
else {
for (const n of ["nDam","eDam","tDam","wDam","fDam","aDam"]) {
if (this.statMap.has(n)) {
this.statMap.delete(n);
}
} }
} }

View file

@ -185,12 +185,12 @@ function calculateCustom() {
let custom_str = encodeCustom(player_custom_item.statMap, true); let custom_str = encodeCustom(player_custom_item.statMap, true);
location.hash = custom_str; location.hash = custom_str;
player_custom_item.setHash(custom_str); player_custom_item.setHash(custom_str);
console.log(player_custom_item.statMap.get("hash")); //console.log(player_custom_item.statMap.get("hash"));
displayExpandedItem(player_custom_item.statMap, "custom-stats"); displayExpandedItem(player_custom_item.statMap, "custom-stats");
console.log(player_custom_item.statMap); //console.log(player_custom_item.statMap);
}catch (error) { }catch (error) {
//USE THE ERROR <p>S! //USE THE ERROR <p>S!
@ -235,7 +235,7 @@ function decodeCustom(custom_url_tag) {
} }
while (tag !== "") { while (tag !== "") {
let id = ci_save_order[Base64.toInt(tag.slice(0,2))]; let id = ci_save_order[Base64.toInt(tag.slice(0,2))];
console.log(tag.slice(0, 2) + ": " + id); //console.log(tag.slice(0, 2) + ": " + id);
let len = Base64.toInt(tag.slice(2,4)); let len = Base64.toInt(tag.slice(2,4));
if (rolledIDs.includes(id)) { if (rolledIDs.includes(id)) {
let sign = parseInt(tag.slice(4,5),10); let sign = parseInt(tag.slice(4,5),10);
@ -628,7 +628,6 @@ function _init_customizer() {
function saveAsJSON() { function saveAsJSON() {
let CI = {}; let CI = {};
for (const [id, val] of player_custom_item.statMap) { for (const [id, val] of player_custom_item.statMap) {
console.log(id);
let skipIds = ["minRolls", "maxRolls", "skillpoints", "reqs", "custom", "crafted", "restrict", "hash", let skipIds = ["minRolls", "maxRolls", "skillpoints", "reqs", "custom", "crafted", "restrict", "hash",
"nDam_", "tDam_", "eDam_", "wDam_", "fDam_", "aDam_", "nDam_", "tDam_", "eDam_", "wDam_", "fDam_", "aDam_",
"powders", "durability", "duration" ] "powders", "durability", "duration" ]
@ -638,22 +637,33 @@ function saveAsJSON() {
val ? CI[reversetranslations.get(id) ? reversetranslations.get(id) : id] = val : "" ; val ? CI[reversetranslations.get(id) ? reversetranslations.get(id) : id] = val : "" ;
} }
} }
let is_fixid = true;
if (player_custom_item.statMap.get("minRolls")) { if (player_custom_item.statMap.get("minRolls")) {
for (const [id, min] of player_custom_item.statMap.get("minRolls")) { for (let [id, min] of player_custom_item.statMap.get("minRolls")) {
const max = player_custom_item.statMap.get("maxRolls").get(id); let max = player_custom_item.statMap.get("maxRolls").get(id);
if (min && max) { if (min && max) {
console.log(reversetranslations); let tmp = Math.min(min, max);
max = Math.max(min, max);
min = tmp;
if (min != max) {
is_fixid = false;
}
// console.log(reversetranslations);
let base = full_range_to_base(min, max); let base = full_range_to_base(min, max);
if (base === null) { if (base === null) {
CI[reversetranslations.get(id) ? reversetranslations.get(id) : id] = [min,max]; CI[reversetranslations.get(id) ? reversetranslations.get(id) : id] = [min,max];
} else if (base) { } else if (base) {
CI[reversetranslations.get(id) ? reversetranslations.get(id) : id] = base; CI[reversetranslations.get(id) ? reversetranslations.get(id) : id] = base;
} }
else {
console.log("CONVERSION ERROR: " + id);
}
} }
} }
} }
CI["identified"] = is_fixid
console.log(CI); console.log(JSON.stringify(CI, null, 0));
//yuck //yuck
copyTextToClipboard(JSON.stringify(CI, null, 0)); copyTextToClipboard(JSON.stringify(CI, null, 0));
document.getElementById("json-button").textContent = "Copied!"; document.getElementById("json-button").textContent = "Copied!";
@ -696,6 +706,13 @@ function full_range_to_base(min, max) {
} else { } else {
//both should be same sign - now do math //both should be same sign - now do math
if (min < 0) { if (min < 0) {
let minPossible = (max - 0.5) / neg_range[1];
let maxPossible = (max + 0.5) / neg_range[1];
for (let i = Math.floor(minPossible); i < Math.ceil(maxPossible); i++) {
if (checkBase(i, min, max)) {
return i;
}
}
} else { } else {
let minPossible = (max - 0.5) / pos_range[1]; let minPossible = (max - 0.5) / pos_range[1];
@ -712,5 +729,4 @@ function full_range_to_base(min, max) {
} }
} }
load_init(_init_customizer); load_init(_init_customizer);