Merge changes

This commit is contained in:
b 2021-01-10 19:43:15 -06:00
commit 94634a0461
3 changed files with 38 additions and 9 deletions

View file

@ -204,16 +204,18 @@ class Build{
if (totalHp < 5) totalHp = 5; if (totalHp < 5) totalHp = 5;
defenseStats.push(totalHp); defenseStats.push(totalHp);
//EHP //EHP
let ehp = totalHp; let ehp = [totalHp, totalHp];
let defMult = classDefenseMultipliers.get(this.weapon.get("type")); let defMult = classDefenseMultipliers.get(this.weapon.get("type"));
ehp /= ((1-def_pct)*(1-agi_pct)*(2-defMult)); ehp[0] /= ((1-def_pct)*(1-agi_pct)*(2-defMult));
ehp[1] /= ((1-def_pct)*(2-defMult));
defenseStats.push(ehp); defenseStats.push(ehp);
//HPR //HPR
let totalHpr = rawToPct(stats.get("hprRaw"), stats.get("hprPct")/100.); let totalHpr = rawToPct(stats.get("hprRaw"), stats.get("hprPct")/100.);
defenseStats.push(totalHpr); defenseStats.push(totalHpr);
//EHPR //EHPR
let ehpr = totalHpr; let ehpr = [totalHpr, totalHpr];
ehpr /= ((1-def_pct)*(1-agi_pct)*(2-defMult)); ehpr[0] /= ((1-def_pct)*(1-agi_pct)*(2-defMult));
ehpr[1] /= ((1-def_pct)*(2-defMult));
defenseStats.push(ehpr); defenseStats.push(ehpr);
//skp stats //skp stats
defenseStats.push([def_pct*100, agi_pct*100]); defenseStats.push([def_pct*100, agi_pct*100]);
@ -224,7 +226,7 @@ class Build{
} }
defenseStats.push(eledefs); defenseStats.push(eledefs);
//[total hp, ehp, total hpr, ehpr, [def%, agi%], [edef,tdef,wdef,fdef,adef]] //[total hp, [ehp w/ agi, ehp w/o agi], total hpr, [ehpr w/ agi, ehpr w/o agi], [def%, agi%], [edef,tdef,wdef,fdef,adef]]
return defenseStats; return defenseStats;
} }

View file

@ -669,12 +669,26 @@ function displayDefenseStats(parent_elem,defenseStats){
ehp.textContent = "Effective HP:"; ehp.textContent = "Effective HP:";
boost = document.createElement("td"); boost = document.createElement("td");
boost.textContent = stats[1]; boost.textContent = stats[1][0];
boost.classList.add("right"); boost.classList.add("right");
ehpRow.appendChild(ehp); ehpRow.appendChild(ehp);
ehpRow.append(boost); ehpRow.append(boost);
statsTable.append(ehpRow); statsTable.append(ehpRow);
ehpRow = document.createElement("tr");
ehp = document.createElement("td");
ehp.classList.add("left");
ehp.textContent = "Effective HP (no agi):";
boost = document.createElement("td");
boost.textContent = stats[1][1];
boost.classList.add("right");
ehpRow.appendChild(ehp);
ehpRow.append(boost);
statsTable.append(ehpRow);
//total HPR //total HPR
let hprRow = document.createElement("tr"); let hprRow = document.createElement("tr");
let hpr = document.createElement("td"); let hpr = document.createElement("td");
@ -695,7 +709,20 @@ function displayDefenseStats(parent_elem,defenseStats){
ehpr.textContent = "Effective HP Regen:"; ehpr.textContent = "Effective HP Regen:";
boost = document.createElement("td"); boost = document.createElement("td");
boost.textContent = stats[3]; boost.textContent = stats[3][0];
boost.classList.add("right");
ehprRow.appendChild(ehpr);
ehprRow.append(boost);
statsTable.append(ehprRow);
ehprRow = document.createElement("tr");
ehpr = document.createElement("td");
ehpr.classList.add("left");
ehpr.textContent = "Effective HP Regen (no agi):";
boost = document.createElement("td");
boost.textContent = stats[3][1];
boost.classList.add("right"); boost.classList.add("right");
ehprRow.appendChild(ehpr); ehprRow.appendChild(ehpr);
@ -713,7 +740,7 @@ function displayDefenseStats(parent_elem,defenseStats){
eledefTitle.classList.add(damageClasses[i+1]); eledefTitle.classList.add(damageClasses[i+1]);
let defense = document.createElement("b"); let defense = document.createElement("b");
defense.textContent = " Defense: "; defense.textContent = " Def: ";
eledef.appendChild(eledefTitle); eledef.appendChild(eledefTitle);
eledef.appendChild(defense); eledef.appendChild(defense);

View file

@ -9,7 +9,7 @@
} }
th, td { th, td {
padding-right: 20px; padding-right: 10px;
} }
.nomargin { .nomargin {