Fix skillpoint display and display health regen

This commit is contained in:
b 2021-01-11 17:43:04 -06:00
parent 2d42ea65f9
commit fe4350f8ee
3 changed files with 11 additions and 8 deletions

View file

@ -775,7 +775,7 @@ function displayDefenseStats(parent_elem, build, insertSummary){
mock_item.set("fixID", true); mock_item.set("fixID", true);
let mock_minRolls = new Map(); let mock_minRolls = new Map();
mock_item.set("minRolls", mock_minRolls); mock_item.set("minRolls", mock_minRolls);
const stats = ["hp", "hpBonus", "fDef", "wDef", "aDef", "tDef", "eDef", const stats = ["hp", "hpBonus", "hprRaw", "hprPct", "fDef", "wDef", "aDef", "tDef", "eDef",
"fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct"]; "fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct"];
for (const stat of stats) { for (const stat of stats) {
if (rolledIDs.includes(stat)) { if (rolledIDs.includes(stat)) {

View file

@ -208,7 +208,7 @@
<div class="skillpoints"> <div class="skillpoints">
<div class="center" style="grid-column:1;grid-row:1"> <div class="center" style="grid-column:1;grid-row:1">
<div> <div>
<label for="str-skp" class="skpLabel" id="str-skp-label">Strength:</label> <label for="str-skp" class="skpLabel" id="str-skp-label">Strength:</label><br>
<input class="skp-input" type="number" id="str-skp" name="str-skp" value="0" class="skpInput"/> <input class="skp-input" type="number" id="str-skp" name="str-skp" value="0" class="skpInput"/>
</div> </div>
<div id="str-skp-assign"> <div id="str-skp-assign">
@ -222,7 +222,7 @@
</div> </div>
<div class="center" style="grid-column:2;grid-row:1"> <div class="center" style="grid-column:2;grid-row:1">
<div> <div>
<label for="dex-skp" class="skpLabel" id="dex-skp-label">Dexterity:</label> <label for="dex-skp" class="skpLabel" id="dex-skp-label">Dexterity:</label><br>
<input class="skp-input" type="number" id="dex-skp" name="dex-skp" value="0" class="skpInput"/> <input class="skp-input" type="number" id="dex-skp" name="dex-skp" value="0" class="skpInput"/>
</div> </div>
<div id="dex-skp-assign"> <div id="dex-skp-assign">
@ -236,7 +236,7 @@
</div> </div>
<div class="center" style="grid-column:3;grid-row:1"> <div class="center" style="grid-column:3;grid-row:1">
<div> <div>
<label for="int-skp" class="skpLabel" id="int-skp-label">Intelligence:</label> <label for="int-skp" class="skpLabel" id="int-skp-label">Intelligence:</label><br>
<input class="skp-input" type="number" id="int-skp" name="int-skp" value="0" class="skpInput"/> <input class="skp-input" type="number" id="int-skp" name="int-skp" value="0" class="skpInput"/>
</div> </div>
<div id="int-skp-assign"> <div id="int-skp-assign">
@ -250,7 +250,7 @@
</div> </div>
<div class="center" style="grid-column:4;grid-row:1"> <div class="center" style="grid-column:4;grid-row:1">
<div> <div>
<label for="def-skp" class="skpLabel" id="def-skp-label">Defense:</label> <label for="def-skp" class="skpLabel" id="def-skp-label">Defense:</label><br>
<input class="skp-input" type="number" id="def-skp" name="def-skp" value="0" class="skpInput"/> <input class="skp-input" type="number" id="def-skp" name="def-skp" value="0" class="skpInput"/>
</div> </div>
<div id="def-skp-assign"> <div id="def-skp-assign">
@ -264,7 +264,7 @@
</div> </div>
<div class="center" style="grid-column:5;grid-row:1"> <div class="center" style="grid-column:5;grid-row:1">
<div> <div>
<label for="agi-skp" class="skpLabel" id="agi-skp-label">Agility:</label> <label for="agi-skp" class="skpLabel" id="agi-skp-label">Agility:</label><br>
<input class="skp-input" type="number" id="agi-skp" name="agi-skp" value="0" class="skpInput"/> <input class="skp-input" type="number" id="agi-skp" name="agi-skp" value="0" class="skpInput"/>
</div> </div>
<div id="agi-skp-assign"> <div id="agi-skp-assign">

View file

@ -11,7 +11,7 @@ console.log(url_tag);
* END testing section * END testing section
*/ */
const BUILD_VERSION = "6.7"; const BUILD_VERSION = "6.8";
document.getElementById("header").textContent = "WynnBuilder version "+BUILD_VERSION+" (db version "+DB_VERSION+")"; document.getElementById("header").textContent = "WynnBuilder version "+BUILD_VERSION+" (db version "+DB_VERSION+")";
@ -423,6 +423,9 @@ function calculateBuild(save_skp, skp){
const assigned = player_build.base_skillpoints; const assigned = player_build.base_skillpoints;
const skillpoints = player_build.total_skillpoints; const skillpoints = player_build.total_skillpoints;
for (let i in skp_order){ //big bren
setText(skp_order[i] + "-skp-base", "Original Value: " + skillpoints[i]);
}
if (save_skp) { if (save_skp) {
// TODO: reduce duplicated code, @updateStats // TODO: reduce duplicated code, @updateStats
@ -467,7 +470,7 @@ function calculateBuildStats() {
setValue(skp_order[i] + "-skp", skillpoints[i]); setValue(skp_order[i] + "-skp", skillpoints[i]);
let linebreak = document.createElement("br"); let linebreak = document.createElement("br");
linebreak.classList.add("itemp"); linebreak.classList.add("itemp");
document.getElementById(skp_order[i] + "-skp-label").append(document.createElement("br")); document.getElementById(skp_order[i] + "-skp-label");
setText(skp_order[i] + "-skp-pct", (skillPointsToPercentage(skillpoints[i])*100).toFixed(1).concat(skp_effects[i])); setText(skp_order[i] + "-skp-pct", (skillPointsToPercentage(skillpoints[i])*100).toFixed(1).concat(skp_effects[i]));
if (assigned[i] > 100) { if (assigned[i] > 100) {
let skp_warning = document.createElement("p"); let skp_warning = document.createElement("p");