Fix crafted item weapons deleting damage

This commit is contained in:
b 2021-06-19 03:40:47 -07:00
parent b49d976a47
commit 76e6ba8986
5 changed files with 38 additions and 26 deletions

View file

@ -6,18 +6,17 @@
"tier": "Set",
"category": "accessory",
"displayName": "Black Catalyst",
"spRegen": -5,
"hp": -325,
"lvl": 83,
"sdPct": 8,
"xpb": 15,
"str": -2,
"dex": -2,
"int": -2,
"agi": -2,
"def": -2,
"id": 628,
"spRegen": -5,
"fixID": true,
"id": 628,
"set": "Black Catalyst"
},
{
@ -581,7 +580,14 @@
"tier": "Mythic",
"category": "weapon",
"displayName": "Collapse",
"basedps": 827.5,
"slots": 3,
"nDam": "40-65",
"fDam": "0-310",
"wDam": "0-310",
"aDam": "0-310",
"tDam": "0-310",
"eDam": "0-310",
"atkSpd": "VERY_SLOW",
"lvl": 97,
"strReq": 35,
@ -606,7 +612,14 @@
"tier": "Mythic",
"category": "weapon",
"displayName": "Singularity",
"basedps": 1025,
"slots": 15,
"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,
@ -65617,9 +65630,9 @@
"slots": 3,
"drop": "NORMAL",
"nDam": "0-0",
"fDam": "0-0",
"fDam": "150-177",
"wDam": "150-177",
"aDam": "150-177",
"aDam": "220-260",
"tDam": "0-0",
"eDam": "0-0",
"atkSpd": "SLOW",
@ -112603,4 +112616,4 @@
]
}
}
}
}

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,3 @@
const ci_save_order = ["name", "lore", "tier", "set", "slots", "type", "material", "drop", "quest", "nDam", "fDam", "wDam", "aDam", "tDam", "eDam", "atkSpd", "hp", "fDef", "wDef", "aDef", "tDef", "eDef", "lvl", "classReq", "strReq", "dexReq", "intReq", "defReq", "agiReq","str", "dex", "int", "agi", "def", "id", "skillpoints", "reqs", "nDam_", "fDam_", "wDam_", "aDam_", "tDam_", "eDam_", "majorIds", "hprPct", "mr", "sdPct", "mdPct", "ls", "ms", "xpb", "lb", "ref", "thorns", "expd", "spd", "atkTier", "poison", "hpBonus", "spRegen", "eSteal", "hprRaw", "sdRaw", "mdRaw", "fDamPct", "wDamPct", "aDamPct", "tDamPct", "eDamPct", "fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct", "spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4", "rainbowRaw", "sprint", "sprintReg", "jh", "lq", "gXp", "gSpd","durability","duration","charges"];
const nonRolled_strings = ["name","lore", "tier","set","type","material","drop","quest","majorIds","classReq","atkSpd","displayName", "nDam", "fDam", "wDam", "aDam", "tDam", "eDam", "nDam_", "fDam_", "wDam_", "aDam_", "tDam_", "eDam_", "durability", "duration"];
//omitted restrict - it's always "Custom Item"
@ -222,21 +220,6 @@ class Custom{
this.statMap.set("custom", true);
if (weaponTypes.includes(this.statMap.get("type"))) {
for (const n of ["nDam","eDam","tDam","wDam","fDam","aDam"]) {
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);
}
}
}
for (const id of ci_save_order) {
if (rolledIDs.includes(id)) {
if (!(this.statMap.get("minRolls").has(id) && this.statMap.get("minRolls").get(id))) {
@ -255,6 +238,22 @@ class Custom{
}
}
}
let type = this.statMap.get("type").toLowerCase();
console.log(type);
if (weaponTypes.includes(type)) {
for (const n of ["nDam","eDam","tDam","wDam","fDam","aDam"]) {
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);
}
}
}
if (this.statMap.get("type")) {
this.statMap.set("type",this.statMap.get("type").toLowerCase());

View file

@ -1,4 +1,4 @@
const DB_VERSION = 48;
const DB_VERSION = 49;
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.jsA
let db;

View file

@ -1,4 +1,4 @@
const DB_VERSION = 48;
const DB_VERSION = 49;
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.jsA
let db;