tried minor fixes, now website doens't update to newer code

This commit is contained in:
ferricles 2021-01-08 09:30:36 -08:00
parent 7fa03c8dd4
commit 24de737a4b
3 changed files with 28 additions and 54 deletions

View file

@ -139,7 +139,7 @@ class Build{
getMeleeStats(){
const stats = this.statMap;
// Array of neutral + ewtf damages. Each entry is a pair (min, max).
// Array of neutral + ewtfa damages. Each entry is a pair (min, max).
let damages = [];
for (const damage_string of stats.get("damageRaw")) {
const damage_vals = damage_string.split("-").map(Number);

View file

@ -38,7 +38,17 @@ function expandItem(item){
expandedItem.set("maxRolls",maxRolls);
return expandedItem;
}
/*An independent helper function that rounds a rolled ID to the nearest integer OR brings the roll away from 0.
* @param id
*/
function idRound(id){
rounded = Math.round(id);
if(rounded == 0){
return 1;
}else{
return rounded;
}
}
function displayExpandedItem(item, parent_id){
// Commands to "script" the creation of nice formatting.
// #commands create a new element.

68
test.js
View file

@ -288,13 +288,12 @@ function calculateBuild(){
setText("int-skp-base", "Original Value: " + skillpoints[2]);
setText("def-skp-base", "Original Value: " + skillpoints[3]);
setText("agi-skp-base", "Original Value: " + skillpoints[4]);
console.log(skillpoints);
setHTML("str-skp-pct", skillPointsToPercentage(skillpoints[0])*100 );
setHTML("dex-skp-pct", skillPointsToPercentage(skillpoints[1])*100 );
setHTML("int-skp-pct", skillPointsToPercentage(skillpoints[2])*100 );
setHTML("def-skp-pct", skillPointsToPercentage(skillpoints[3])*100 );
setHTML("agi-skp-pct", skillPointsToPercentage(skillpoints[4])*100 );
console.log("????");
setHTML("str-skp-pct", (skillPointsToPercentage(skillpoints[0])*100).toFixed(1).concat("% more damage dealt."));
setHTML("dex-skp-pct", (skillPointsToPercentage(skillpoints[1])*100).toFixed(1).concat("% chance to crit."));
setHTML("int-skp-pct", (skillPointsToPercentage(skillpoints[2])*100).toFixed(1).concat("% spell cost reduction."));
setHTML("def-skp-pct", (skillPointsToPercentage(skillpoints[3])*100).toFixed(1).concat("% less damage taken."));
setHTML("agi-skp-pct", (skillPointsToPercentage(skillpoints[4])*100).toFixed(1).concat("% chance to dodge."));
setText("summary-box", "Summary: Assigned "+player_build.assigned_skillpoints+" skillpoints.");
@ -313,44 +312,19 @@ function calculateBuild(){
meleeSummary = meleeSummary.concat("<h1><u>Melee Stats</u></h1>");
meleeSummary = meleeSummary.concat("<h2>Average DPS: ",Math.round(meleeStats[10]),"</h2> <br><br>");
meleeSummary = meleeSummary.concat("<b>Non-Crit Stats: </b><br>");
if(meleeStats[0][0] > 0){
meleeSummary = meleeSummary.concat("Neutral Damage: ",meleeStats[0][0]," -> ",meleeStats[0][1],"<br>");
}
if(meleeStats[1][0] > 0){
meleeSummary = meleeSummary.concat("Earth Damage: ",meleeStats[1][0]," -> ",meleeStats[1][1],"<br>");
}
if(meleeStats[2][0] > 0){
meleeSummary = meleeSummary.concat("Thunder Damage: ",meleeStats[2][0]," -> ",meleeStats[2][1],"<br>");
}
if(meleeStats[3][0] > 0){
meleeSummary = meleeSummary.concat("Water Damage: ",meleeStats[3][0]," -> ",meleeStats[3][1],"<br>");
}
if(meleeStats[4][0] > 0){
meleeSummary = meleeSummary.concat("Fire Damage: ",meleeStats[4][0]," -> ",meleeStats[4][1],"<br>");
}
if(meleeStats[5][0] > 0){
meleeSummary = meleeSummary.concat("Air Damage: ",meleeStats[5][0]," -> ",meleeStats[5][1],"<br>");
let damagePrefixes = ["Neutral Damage: ","Earth Damage: ","Thunder Damage: ","Water Damage: ","Fire Damage: ","Air Damage: "];
for (const i in meleeStats){
if(meleeStats[i][0] > 0){
meleeSummary = meleeSummary.concat(damagePrefixes[i],meleeStats[i][0]," -> ",meleeStats[i][1],"<br>");
}
}
meleeSummary = meleeSummary.concat("<br>Total Damage: ",meleeStats[6][0]," -> ",meleeStats[6][1],"<br>");
meleeSummary = meleeSummary.concat("Normal DPS: ",Math.round(meleeStats[8]),"<br><br>");
meleeSummary = meleeSummary.concat("<b>Crit Stats: </b><br>");
if(meleeStats[0][2] > 0){
meleeSummary = meleeSummary.concat("Neutral Damage: ",meleeStats[0][2]," -> ",meleeStats[0][3],"<br>");
}
if(meleeStats[1][2] > 0){
meleeSummary = meleeSummary.concat("Earth Damage: ",meleeStats[1][2]," -> ",meleeStats[1][3],"<br>");
}
if(meleeStats[2][2] > 0){
meleeSummary = meleeSummary.concat("Thunder Damage: ",meleeStats[2][2]," -> ",meleeStats[2][3],"<br>");
}
if(meleeStats[3][2] > 0){
meleeSummary = meleeSummary.concat("Water Damage: ",meleeStats[3][2]," -> ",meleeStats[3][3],"<br>");
}
if(meleeStats[4][2] > 0){
meleeSummary = meleeSummary.concat("Fire Damage: ",meleeStats[4][2]," -> ",meleeStats[4][3],"<br>");
}
if(meleeStats[5][2] > 0){
meleeSummary = meleeSummary.concat("Air Damage: ",meleeStats[5][2]," -> ",meleeStats[5][3],"<br>");
for (const i in meleeStats){
if(meleeStats[i][2] > 0){
meleeSummary = meleeSummary.concat(damagePrefixes[i],meleeStats[i][2]," -> ",meleeStats[i][3],"<br>");
}
}
meleeSummary = meleeSummary.concat("<br>Total Damage: ",meleeStats[7][0]," -> ",meleeStats[7][1],"<br>");
meleeSummary = meleeSummary.concat("Crit DPS: ",Math.round(meleeStats[9]),"<br><br>");
@ -358,17 +332,7 @@ function calculateBuild(){
location.hash = encodeBuild();
}
/*An independent helper function that rounds a rolled ID to the nearest integer OR brings the roll away from 0.
* @param id
*/
function idRound(id){
rounded = Math.round(id);
if(rounded == 0){
return 1;
}else{
return rounded;
}
}