From 70e73e8b54db783c1bfd26a80c8ef837aa727a3a Mon Sep 17 00:00:00 2001 From: b Date: Mon, 13 Sep 2021 12:29:15 -0700 Subject: [PATCH] Add base spell cost --- build.js | 9 +++++---- display.js | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build.js b/build.js index 934a53b..5e2c54c 100644 --- a/build.js +++ b/build.js @@ -388,13 +388,14 @@ class Build{ /* Getters */ - /* Get total health for build. - */ - getSpellCost(spellIdx, cost) { + return Math.max(1, this.getBaseSpellCost(spellIdx, cost); + } + + getBaseSpellCost(spellIdx, cost) { cost = Math.ceil(cost * (1 - skillPointsToPercentage(this.total_skillpoints[2]))); cost += this.statMap.get("spRaw"+spellIdx); - return Math.max(1, Math.floor(cost * (1 + this.statMap.get("spPct"+spellIdx) / 100))); + return Math.floor(cost * (1 + this.statMap.get("spPct"+spellIdx) / 100)); } diff --git a/display.js b/display.js index 5c9c759..5a7c14b 100644 --- a/display.js +++ b/display.js @@ -2019,7 +2019,7 @@ function displaySpellDamage(parent_elem, overallparent_elem, build, spell, spell let third = document.createElement("b"); - third.textContent = ")"; + third.textContent = ") [Base: " + build.getSpellCost(spellIdx, spell.cost) + " ]"; title_elem.appendChild(third.cloneNode(true)); title_elemavg.appendChild(third); }