implemented powder buffs on poison damage, QOL change to skill point adjusting, made the nice header nicer

This commit is contained in:
ferricles 2021-01-13 22:58:32 -08:00
parent 9462223eb6
commit 7c52817dfc
5 changed files with 61 additions and 17 deletions

View file

@ -138,6 +138,7 @@ class Build{
// For strength boosts like warscream, vanish, etc. // For strength boosts like warscream, vanish, etc.
this.damageMultiplier = 1.0; this.damageMultiplier = 1.0;
this.defenseMultiplier = 1.0;
// For other external boosts ;-; // For other external boosts ;-;
this.externalStats = externalStats; this.externalStats = externalStats;
@ -212,19 +213,19 @@ class Build{
//EHP //EHP
let ehp = [totalHp, totalHp]; let ehp = [totalHp, totalHp];
let defMult = classDefenseMultipliers.get(this.weapon.get("type")); let defMult = classDefenseMultipliers.get(this.weapon.get("type"));
ehp[0] /= ((1-def_pct)*(1-agi_pct)*(2-defMult)); ehp[0] /= ((1-def_pct)*(1-agi_pct)*(2-defMult)*(2-this.defenseMultiplier));
ehp[1] /= ((1-def_pct)*(2-defMult)); ehp[1] /= ((1-def_pct)*(2-defMult)*(2-this.defenseMultiplier));
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, totalHpr]; let ehpr = [totalHpr, totalHpr];
ehpr[0] /= ((1-def_pct)*(1-agi_pct)*(2-defMult)); ehpr[0] /= ((1-def_pct)*(1-agi_pct)*(2-defMult)*(2-this.defenseMultiplier));
ehpr[1] /= ((1-def_pct)*(2-defMult)); ehpr[1] /= ((1-def_pct)*(2-defMult)*(2-this.defenseMultiplier));
defenseStats.push(ehpr); defenseStats.push(ehpr);
//skp stats //skp stats
defenseStats.push([def_pct*100, agi_pct*100]); defenseStats.push([ (1 - ((1-def_pct) * (2 - this.defenseMultiplier)))*100, agi_pct*100]);
//eledefs - TODO POWDERS //eledefs - TODO POWDERS
let eledefs = [0, 0, 0, 0, 0]; let eledefs = [0, 0, 0, 0, 0];
for(const i in skp_elements){ //kinda jank but ok for(const i in skp_elements){ //kinda jank but ok
@ -251,7 +252,7 @@ class Build{
statMap.set(staticID, 0); statMap.set(staticID, 0);
} }
statMap.set("hp", levelToHPBase(this.level)); //TODO: Add player base health statMap.set("hp", levelToHPBase(this.level)); //TODO: Add player base health
for (const item of this.items){ for (const item of this.items){
for (let [id, value] of item.get("maxRolls")) { for (let [id, value] of item.get("maxRolls")) {
statMap.set(id,(statMap.get(id) || 0)+value); statMap.set(id,(statMap.get(id) || 0)+value);
@ -280,6 +281,8 @@ class Build{
statMap.set("damageBonus", [statMap.get("eDamPct"), statMap.get("tDamPct"), statMap.get("wDamPct"), statMap.get("fDamPct"), statMap.get("aDamPct")]); statMap.set("damageBonus", [statMap.get("eDamPct"), statMap.get("tDamPct"), statMap.get("wDamPct"), statMap.get("fDamPct"), statMap.get("aDamPct")]);
statMap.set("defRaw", [statMap.get("eDam"), statMap.get("tDef"), statMap.get("wDef"), statMap.get("fDef"), statMap.get("aDef")]); statMap.set("defRaw", [statMap.get("eDam"), statMap.get("tDef"), statMap.get("wDef"), statMap.get("fDef"), statMap.get("aDef")]);
statMap.set("defBonus", [statMap.get("eDamPct"), statMap.get("tDefPct"), statMap.get("wDefPct"), statMap.get("fDefPct"), statMap.get("aDefPct")]); statMap.set("defBonus", [statMap.get("eDamPct"), statMap.get("tDefPct"), statMap.get("wDefPct"), statMap.get("fDefPct"), statMap.get("aDefPct")]);
statMap.set("poisonPct", 100);
for (const x of skp_elements) { for (const x of skp_elements) {
this.externalStats.set(x + "DamPct", 0); this.externalStats.set(x + "DamPct", 0);
} }
@ -287,6 +290,7 @@ class Build{
this.externalStats.set("sdPct", 0); this.externalStats.set("sdPct", 0);
this.externalStats.set("damageBonus", [0, 0, 0, 0, 0]); this.externalStats.set("damageBonus", [0, 0, 0, 0, 0]);
this.externalStats.set("defBonus",[0, 0, 0, 0, 0]); this.externalStats.set("defBonus",[0, 0, 0, 0, 0]);
this.externalStats.set("poisonPct", 0);
this.statMap = statMap; this.statMap = statMap;
} }

View file

@ -15,6 +15,7 @@ const BUILD_VERSION = "6.9";
function setTitle() { function setTitle() {
document.getElementById("header").textContent = "WynnBuilder version "+BUILD_VERSION+" (db version "+DB_VERSION+")"; document.getElementById("header").textContent = "WynnBuilder version "+BUILD_VERSION+" (db version "+DB_VERSION+")";
document.getElementById("header").classList.add("funnynumber");
} }
setTitle(); setTitle();
@ -406,6 +407,7 @@ function calculateBuild(save_skp, skp){
//player_build.damageMultiplier -= special.weaponSpecialEffects.get("Damage Boost")[i-1]/100; //player_build.damageMultiplier -= special.weaponSpecialEffects.get("Damage Boost")[i-1]/100;
player_build.externalStats.set("sdPct", player_build.externalStats.get("sdPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]); player_build.externalStats.set("sdPct", player_build.externalStats.get("sdPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]);
player_build.externalStats.set("mdPct", player_build.externalStats.get("mdPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]); player_build.externalStats.set("mdPct", player_build.externalStats.get("mdPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]);
player_build.externalStats.set("poisonPct", player_build.externalStats.get("poisonPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]);
} else if (name === "Air Prison") { } else if (name === "Air Prison") {
player_build.externalStats.set("aDamPct", player_build.externalStats.get("aDamPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]); player_build.externalStats.set("aDamPct", player_build.externalStats.get("aDamPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]);
player_build.externalStats.get("damageBonus")[4] -= special.weaponSpecialEffects.get("Damage Boost")[i-1]; player_build.externalStats.get("damageBonus")[4] -= special.weaponSpecialEffects.get("Damage Boost")[i-1];
@ -525,6 +527,7 @@ function updateStats() {
//player_build.damageMultiplier -= special.weaponSpecialEffects.get("Damage Boost")[i-1]/100; //player_build.damageMultiplier -= special.weaponSpecialEffects.get("Damage Boost")[i-1]/100;
player_build.externalStats.set("sdPct", player_build.externalStats.get("sdPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]); player_build.externalStats.set("sdPct", player_build.externalStats.get("sdPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]);
player_build.externalStats.set("mdPct", player_build.externalStats.get("mdPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]); player_build.externalStats.set("mdPct", player_build.externalStats.get("mdPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]);
player_build.externalStats.set("poisonPct", player_build.externalStats.get("poisonPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]);
} else if (name === "Air Prison") { } else if (name === "Air Prison") {
player_build.externalStats.set("aDamPct", player_build.externalStats.get("aDamPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]); player_build.externalStats.set("aDamPct", player_build.externalStats.get("aDamPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]);
player_build.externalStats.get("damageBonus")[4] -= special.weaponSpecialEffects.get("Damage Boost")[i-1]; player_build.externalStats.get("damageBonus")[4] -= special.weaponSpecialEffects.get("Damage Boost")[i-1];
@ -541,7 +544,21 @@ function updateStats() {
let skillpoints = player_build.total_skillpoints; let skillpoints = player_build.total_skillpoints;
let delta_total = 0; let delta_total = 0;
for (let i in skp_order) { for (let i in skp_order) {
let manual_assigned = getValue(skp_order[i] + "-skp"); let value = document.getElementById(skp_order[i] + "-skp").value;
let manual_assigned = 0;
if (value.includes("+")) {
let skp = value.split("+");
for (const s of skp) {
manual_assigned += parseInt(s,10);
}
} else if (value.includes("-")) {
let skp = value.split("-");
for (const s of skp) {
manual_assigned -= parseInt(s,10);
}
} else {
manual_assigned = parseInt(value,10);
}
let delta = manual_assigned - skillpoints[i]; let delta = manual_assigned - skillpoints[i];
skillpoints[i] = manual_assigned; skillpoints[i] = manual_assigned;
player_build.base_skillpoints[i] += delta; player_build.base_skillpoints[i] += delta;
@ -554,11 +571,18 @@ function updateStats() {
*/ */
function updateBoosts(buttonId) { function updateBoosts(buttonId) {
let elem = document.getElementById(buttonId); let elem = document.getElementById(buttonId);
let name = buttonId.split("-")[0];
if (elem.classList.contains("toggleOn")) { if (elem.classList.contains("toggleOn")) {
player_build.damageMultiplier -= damageMultipliers.get(buttonId.split("-")[0]); player_build.damageMultiplier -= damageMultipliers.get(name);
if (name === "warscream") {
player_build.defenseMultiplier -= .10;
}
elem.classList.remove("toggleOn"); elem.classList.remove("toggleOn");
}else{ }else{
player_build.damageMultiplier += damageMultipliers.get(buttonId.split("-")[0]); player_build.damageMultiplier += damageMultipliers.get(name);
if (name === "warscream") {
player_build.defenseMultiplier += .10;
}
elem.classList.add("toggleOn"); elem.classList.add("toggleOn");
} }
updatePowderSpecials("skip"); //jank pt 1 updatePowderSpecials("skip"); //jank pt 1
@ -585,6 +609,7 @@ function updatePowderSpecials(buttonId){
if (name === "Courage" || name === "Curse") { //courage and curse are universal damage boost if (name === "Courage" || name === "Curse") { //courage and curse are universal damage boost
player_build.externalStats.set("sdPct", player_build.externalStats.get("sdPct") - special.weaponSpecialEffects.get("Damage Boost")[power-1]); player_build.externalStats.set("sdPct", player_build.externalStats.get("sdPct") - special.weaponSpecialEffects.get("Damage Boost")[power-1]);
player_build.externalStats.set("mdPct", player_build.externalStats.get("mdPct") - special.weaponSpecialEffects.get("Damage Boost")[power-1]); player_build.externalStats.set("mdPct", player_build.externalStats.get("mdPct") - special.weaponSpecialEffects.get("Damage Boost")[power-1]);
player_build.externalStats.set("poisonPct", player_build.externalStats.get("poisonPct") - special.weaponSpecialEffects.get("Damage Boost")[power-1]);
//poison? //poison?
} else if (name === "Air Prison") { } else if (name === "Air Prison") {
player_build.externalStats.set("aDamPct", player_build.externalStats.get("aDamPct") - special.weaponSpecialEffects.get("Damage Boost")[power-1]); player_build.externalStats.set("aDamPct", player_build.externalStats.get("aDamPct") - special.weaponSpecialEffects.get("Damage Boost")[power-1]);
@ -603,6 +628,7 @@ function updatePowderSpecials(buttonId){
//player_build.damageMultiplier -= special.weaponSpecialEffects.get("Damage Boost")[i-1]/100; //player_build.damageMultiplier -= special.weaponSpecialEffects.get("Damage Boost")[i-1]/100;
player_build.externalStats.set("sdPct", player_build.externalStats.get("sdPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]); player_build.externalStats.set("sdPct", player_build.externalStats.get("sdPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]);
player_build.externalStats.set("mdPct", player_build.externalStats.get("mdPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]); player_build.externalStats.set("mdPct", player_build.externalStats.get("mdPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]);
player_build.externalStats.set("poisonPct", player_build.externalStats.get("poisonPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]);
} else if (name === "Air Prison") { } else if (name === "Air Prison") {
player_build.externalStats.set("aDamPct", player_build.externalStats.get("aDamPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]); player_build.externalStats.set("aDamPct", player_build.externalStats.get("aDamPct") - special.weaponSpecialEffects.get("Damage Boost")[i-1]);
player_build.externalStats.get("damageBonus")[4] -= special.weaponSpecialEffects.get("Damage Boost")[i-1]; player_build.externalStats.get("damageBonus")[4] -= special.weaponSpecialEffects.get("Damage Boost")[i-1];
@ -635,6 +661,7 @@ function updatePowderSpecials(buttonId){
if (name === "Courage" || name === "Curse") { //courage and curse are is universal damage boost if (name === "Courage" || name === "Curse") { //courage and curse are is universal damage boost
player_build.externalStats.set("sdPct", player_build.externalStats.get("sdPct") + special.weaponSpecialEffects.get("Damage Boost")[power-1]); player_build.externalStats.set("sdPct", player_build.externalStats.get("sdPct") + special.weaponSpecialEffects.get("Damage Boost")[power-1]);
player_build.externalStats.set("mdPct", player_build.externalStats.get("mdPct") + special.weaponSpecialEffects.get("Damage Boost")[power-1]); player_build.externalStats.set("mdPct", player_build.externalStats.get("mdPct") + special.weaponSpecialEffects.get("Damage Boost")[power-1]);
player_build.externalStats.set("poisonPct", player_build.externalStats.get("poisonPct") + special.weaponSpecialEffects.get("Damage Boost")[power-1]);
} else if (name === "Air Prison") { } else if (name === "Air Prison") {
player_build.externalStats.set("aDamPct", player_build.externalStats.get("aDamPct") + special.weaponSpecialEffects.get("Damage Boost")[power-1]); player_build.externalStats.set("aDamPct", player_build.externalStats.get("aDamPct") + special.weaponSpecialEffects.get("Damage Boost")[power-1]);
player_build.externalStats.get("damageBonus")[4] += special.weaponSpecialEffects.get("Damage Boost")[power-1]; player_build.externalStats.get("damageBonus")[4] += special.weaponSpecialEffects.get("Damage Boost")[power-1];
@ -644,7 +671,9 @@ function updatePowderSpecials(buttonId){
} }
displayPowderSpecials(document.getElementById("powder-special-stats"), powderSpecials, player_build); displayPowderSpecials(document.getElementById("powder-special-stats"), powderSpecials, player_build);
calculateBuildStats(); //also make damage boosts apply ;-; if (name !== "skip") {
calculateBuildStats(); //also make damage boosts apply ;-;
}
} }
/* Calculates all build statistics and updates the entire display. /* Calculates all build statistics and updates the entire display.
*/ */

View file

@ -246,6 +246,9 @@ function displayBuildStats(build, parent_id){
if (reversedIDs.filter(e => e !== "atkTier").includes(id)) { if (reversedIDs.filter(e => e !== "atkTier").includes(id)) {
style === "positive" ? style = "negative" : style = "positive"; style === "positive" ? style = "negative" : style = "positive";
} }
if (id === "poison" && id_val > 0) {
id_val = Math.round(id_val*(build.statMap.get("poisonPct") + build.externalStats.get("poisonPct"))/100);
}
displayFixedID(active_elem, id, id_val, elemental_format, style); displayFixedID(active_elem, id, id_val, elemental_format, style);
if (id === "poison" && id_val > 0) { if (id === "poison" && id_val > 0) {
let style = "positive"; let style = "positive";
@ -257,7 +260,7 @@ function displayBuildStats(build, parent_id){
prefix_elem.textContent = "-> With Strength: "; prefix_elem.textContent = "-> With Strength: ";
let number_elem = document.createElement('b'); let number_elem = document.createElement('b');
number_elem.classList.add(style); number_elem.classList.add(style);
number_elem.textContent = (id_val * (1+skillPointsToPercentage(build.total_skillpoints[0]))).toFixed(0) + idSuffixes[id]; number_elem.textContent = (id_val * (1+skillPointsToPercentage(build.total_skillpoints[0])) ).toFixed(0) + idSuffixes[id];
value_elem.append(prefix_elem); value_elem.append(prefix_elem);
value_elem.append(number_elem); value_elem.append(number_elem);
row.appendChild(value_elem); row.appendChild(value_elem);
@ -612,7 +615,7 @@ function displayPoisonDamage(overallparent_elem, build) {
let overallpoisonDamage = document.createElement("p"); let overallpoisonDamage = document.createElement("p");
overallpoisonDamage.classList.add("itemp"); overallpoisonDamage.classList.add("itemp");
let poison_tick = Math.floor(build.statMap.get("poison") * (1+skillPointsToPercentage(build.total_skillpoints[0]))/3); let poison_tick = Math.round(build.statMap.get("poison") * (1+skillPointsToPercentage(build.total_skillpoints[0])) * (build.statMap.get("poisonPct") + build.externalStats.get("poisonPct"))/100 /3);
overallpoisonDamage.textContent = "Poison Tick: " + Math.max(poison_tick,0); overallpoisonDamage.textContent = "Poison Tick: " + Math.max(poison_tick,0);
overallparent_elem.append(overallpoisonDamage); overallparent_elem.append(overallpoisonDamage);
overallparent_elem.append(document.createElement("br")); overallparent_elem.append(document.createElement("br"));

View file

@ -419,7 +419,7 @@
<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><br> <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="string" id="str-skp" name="str-skp" value="0" class="skpInput"/>
</div> </div>
<div id="str-skp-assign"> <div id="str-skp-assign">
Manually Assigned: 0 Manually Assigned: 0
@ -433,7 +433,7 @@
<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><br> <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="string" id="dex-skp" name="dex-skp" value="0" class="skpInput"/>
</div> </div>
<div id="dex-skp-assign"> <div id="dex-skp-assign">
Manually Assigned: 0 Manually Assigned: 0
@ -447,7 +447,7 @@
<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><br> <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="string" id="int-skp" name="int-skp" value="0" class="skpInput"/>
</div> </div>
<div id="int-skp-assign"> <div id="int-skp-assign">
Manually Assigned: 0 Manually Assigned: 0
@ -461,7 +461,7 @@
<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><br> <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="string" id="def-skp" name="def-skp" value="0" class="skpInput"/>
</div> </div>
<div id="def-skp-assign"> <div id="def-skp-assign">
Manually Assigned: 0 Manually Assigned: 0
@ -475,7 +475,7 @@
<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><br> <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="string" id="agi-skp" name="agi-skp" value="0" class="skpInput"/>
</div> </div>
<div id="agi-skp-assign"> <div id="agi-skp-assign">
Manually Assigned: 0 Manually Assigned: 0

View file

@ -261,4 +261,12 @@ input {
button.toggleOn{ button.toggleOn{
background-color:#0a0; background-color:#0a0;
border: 3 px solid rgb(0, 70, 0); border: 3 px solid rgb(0, 70, 0);
}
.funnynumber {
background-image: linear-gradient(to left, #f5f, #a0a, #5ff, #5f5, #ff5, #fa0, #a00); -webkit-background-clip: text;
color: transparent;
display: inline-block;
text-align: center;
transform: translateX(calc(50vw - 50%));
} }