From fe124b4b0f3f04db4ddeeb720ac4b60453b21660 Mon Sep 17 00:00:00 2001 From: ferricles Date: Thu, 21 Jan 2021 13:15:05 -0800 Subject: [PATCH] implemented incorrect material tier system, raw and percent hpr now display in build stats --- craft.js | 59 ++++++++++++++++++++++++++++++++++++++++++------------ display.js | 1 + 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/craft.js b/craft.js index 166d800..83a75d2 100644 --- a/craft.js +++ b/craft.js @@ -86,11 +86,57 @@ class Craft{ statMap.set("atkSpd",this.atkSpd); } statMap.set("powders",""); + /* Change certain IDs based on material tier. healthOrDamage changes. duration and durability change. (but not basicDuration) */ + let matmult = 1; + let sorted = this.mat_tiers.sort(); + //TODO - idfk how this works + if( sorted[0] == 1 && sorted[1] == 1) { + matmult = 1; + } else if( sorted[0] == 1 && sorted[1] == 2) { + matmult = 1.079; + }else if( sorted[0] == 1 && sorted[1] == 3) { + matmult = 1.15; + }else if( sorted[0] == 2 && sorted[1] == 2) { + matmult = 1.24; + }else if( sorted[0] == 2 && sorted[1] == 3) { + matmult = 1.3; + }else if( sorted[0] == 3 && sorted[1] == 3) { + matmult = 1.4; + } + let low = this.recipe.get("healthOrDamage")[0]; + let high = this.recipe.get("healthOrDamage")[1]; + if (statMap.get("category") === "consumable") { + //duration modifier + if(statMap.has("hp")) { //hack + statMap.set("hp", Math.floor( low * matmult )+ "-" + Math.floor( high * matmult )); + } else { + statMap.set("duration", [Math.floor( statMap.get("duration")[0] * matmult ), Math.floor( statMap.get("duration")[1] * matmult )]); + } + } else { + //durability modifier + statMap.set("durability", [Math.floor( statMap.get("durability")[0] * matmult ), Math.floor( statMap.get("durability")[1] * matmult )]); + } + if (statMap.get("category") === "weapon") { + //attack damages oh boy + let ratio = 2.05; //UNSURE IF THIS IS HOW IT'S DONE. MIGHT BE DONE WITH SKETCHY FLOORING. + if (this.atkSpd === "SLOW") { + ratio /= 1.5; + } else if (this.atkSpd === "NORMAL") { + ratio = 1; + } else if (this.atkSpd = "FAST") { + ratio /= 2.5; + } + low *= ratio*matmult; + high *= ratio*matmult; + this.recipe.get("healthOrDamage")[0] = low; + this.recipe.get("healthOrDamage")[1] = high; + } + /* END SECTION */ //calc ingredient effectivenesses -> see https://wynndata.tk/cr/585765168 let eff = [[100,100],[100,100],[100,100]]; @@ -142,19 +188,6 @@ class Craft{ } } } - //apply material tiers - the good thing is that this should be symmetric. - let matmult = 1; - for (const mat of this.mat_tiers) { - - } - if (statMap.get("category") === "consumable") { - //duration modifier - } else { - //durability modifier - } - if (statMap.get("category") === "weapon") { - //attack damages oh boy - } //apply ingredient effectivness - on ids, and reqs (itemIDs). NOT on durability, duration, or charges. let eff_flat = eff.flat(); diff --git a/display.js b/display.js index dde97a8..28e999d 100644 --- a/display.js +++ b/display.js @@ -249,6 +249,7 @@ function displayBuildStats(parent_id,build){ "#table", "str", "dex", "int", "def", "agi", "mr", "ms", + "hprRaw", "hprPct", "sdRaw", "sdPct", "mdRaw", "mdPct", "ref", "thorns",