Merge branch 'dev' into master

This commit is contained in:
hppeng-wynn 2021-01-09 21:39:13 -06:00 committed by GitHub
commit ad61401ee5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 3145 additions and 267 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
*.swp
sets/

View file

@ -57,7 +57,7 @@ class Build{
*/
constructor(level,equipment, powders){
// NOTE: powders is just an array of arrays of powder IDs. Not powder objects.
this.powders = powders
this.powders = powders;
if(itemMap.get(equipment[0]) && itemMap.get(equipment[0]).type === "helmet") {
const helmet = itemMap.get(equipment[0]);
this.powders[0] = this.powders[0].slice(0,helmet.slots);
@ -88,25 +88,25 @@ class Build{
}
if(itemMap.get(equipment[4]).type === "ring") {
const ring = itemMap.get(equipment[4]);
this.ring1 = expandItem(ring, [])
this.ring1 = expandItem(ring, []);
}else{
throw new TypeError("No such ring named ", equipment[4]);
}
if(itemMap.get(equipment[5]).type === "ring") {
const ring = itemMap.get(equipment[5]);
this.ring2 = expandItem(ring, [])
this.ring2 = expandItem(ring, []);
}else{
throw new TypeError("No such ring named ", equipment[5]);
}
if(itemMap.get(equipment[6]).type === "bracelet") {
const bracelet = itemMap.get(equipment[6]);
this.bracelet = expandItem(bracelet, [])
this.bracelet = expandItem(bracelet, []);
}else{
throw new TypeError("No such bracelet named ", equipment[6]);
}
if(itemMap.get(equipment[7]).type === "necklace") {
const necklace = itemMap.get(equipment[7]);
this.necklace = expandItem(necklace, [])
this.necklace = expandItem(necklace, []);
}else{
throw new TypeError("No such necklace named ", equipment[7]);
}

1700
clean.json

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -6,6 +6,21 @@ with open("dump.json", "r") as infile:
items = data["items"]
del data["request"]
import os
sets = dict()
item_set_map = dict()
for filename in os.listdir('sets'):
if "json" not in filename:
continue
set_name = filename[1:].split(".")[0].replace("+", " ").replace("%27", "'")
with open("sets/"+filename) as set_info:
set_obj = json.load(set_info)
for item in set_obj["items"]:
item_set_map[item] = set_name
sets[set_name] = set_obj
data["sets"] = sets
translate_mappings = {
#"name": "name",
#"displayName": "displayName",
@ -131,6 +146,8 @@ for item in items:
item["id"] = id_map[item["name"]]
item["type"] = item["type"].lower()
if item["name"] in item_set_map:
item["set"] = item_set_map[item["name"]]
with open("id_map.json","w") as id_mapfile:
json.dump(id_map, id_mapfile, indent=2)

5
compress_json.py Normal file
View file

@ -0,0 +1,5 @@
import sys
import json
infile = sys.argv[1]
outfile = sys.argv[2]
json.dump(json.load(open(infile)), open(outfile, "w"))

View file

@ -64,7 +64,7 @@ function calculateSpellDamage(stats, spellConversions, rawModifier, pctModifier,
}
for (let i in damages) {
let damageBoost = 1 + skillBoost[i] + staticBoost;
let damageBoost = Math.max(1 + skillBoost[i] + staticBoost, 0);
damages_results.push([
Math.max(damages[i][0] * damageBoost * damageMult, 0), // Normal min
Math.max(damages[i][1] * damageBoost * damageMult, 0), // Normal max
@ -80,6 +80,10 @@ function calculateSpellDamage(stats, spellConversions, rawModifier, pctModifier,
damages_results[0][1] += rawModifier;
damages_results[0][2] += rawModifier;
damages_results[0][3] += rawModifier;
if (totalDamNorm[0] < 0) totalDamNorm[0] = 0;
if (totalDamNorm[1] < 0) totalDamNorm[1] = 0;
if (totalDamCrit[0] < 0) totalDamCrit[0] = 0;
if (totalDamCrit[1] < 0) totalDamCrit[1] = 0;
return [totalDamNorm, totalDamCrit, damages_results];
}

View file

@ -1,7 +1,7 @@
let nonRolledIDs = ["name", "displayName", "tier", "set", "slots", "type", "material", "drop", "quest", "restrict", "nDam", "fDam", "wDam", "aDam", "tDam", "eDam", "atkSpd", "hp", "fDef", "wDef", "aDef", "tDef", "eDef", "lvl", "classReq", "strReq", "dexReq", "intReq", "defReq", "agiReq","str", "dex", "int", "agi", "def", "fixID", "category", "id", "skillpoints", "reqs", "nDam_", "fDam_", "wDam_", "aDam_", "tDam_", "eDam_"];
let rolledIDs = ["hprPct", "mr", "sdPct", "mdPct", "ls", "ms", "xpb", "lb", "ref", "thorns", "expd", "spd", "atkTier", "poison", "hpBonus", "spRegen", "eSteal", "hprRaw", "sdRaw", "mdRaw", "fDamPct", "wDamPct", "aDamPct", "tDamPct", "eDamPct", "fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct", "spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4", "rainbowRaw", "sprint", "sprintReg", "jh", "lq", "gXp", "gSpd"];
let reversedIDs = [ "spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4" ];
let reversedIDs = [ "atkTier", "spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4" ];
function expandItem(item, powders){
let minRolls = new Map();
@ -43,13 +43,15 @@ function expandItem(item, powders){
expandedItem.set("powders", powders);
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;
return 1; //this is a hack, will need changing along w/ rest of ID system if anything changes
}else{
return rounded;
}
@ -260,7 +262,12 @@ function displayExpandedItem(item, parent_id){
else {
let id = command;
if(nonRolledIDs.includes(id) && item.get(id)){//nonRolledID & non-0/non-null/non-und ID
displayFixedID(active_elem, id, item.get(id), elemental_format);
let p_elem = displayFixedID(active_elem, id, item.get(id), elemental_format);
if (id === "slots") {
// HACK TO MAKE POWDERS DISPLAY NICE!! TODO
p_elem.textContent = idPrefixes[id].concat(item.get(id), idSuffixes[id]) +
" [ " + item.get("powders").map(x => powderNames.get(x)) + " ]";
}
}
else if(rolledIDs.includes(id)&& item.get("minRolls").get(id)){ // && item.get("maxRolls").get(id) ){//rolled ID & non-0/non-null/non-und ID
let style = "positive";
@ -268,12 +275,7 @@ function displayExpandedItem(item, parent_id){
style = "negative";
}
if (fix_id) {
let p_elem = displayFixedID(active_elem, id, item.get("minRolls").get(id), elemental_format, style);
if (id === "slots") {
// HACK TO MAKE POWDERS DISPLAY NICE!! TODO
p_elem.textContent = idPrefixes[id].concat(value, idSuffixes[id]) +
" [ " + item.get("powders").map(x => powderNames.get(x)) + " ]";
}
displayFixedID(active_elem, id, item.get("minRolls").get(id), elemental_format, style);
}
else {
let row = document.createElement('tr');
@ -349,7 +351,99 @@ function displayFixedID(active, id, value, elemental_format, style) {
return p_elem;
}
}
function displayMeleeDamage(parent_elem, meleeStats){
let attackSpeeds = ["Super Slow", "Very Slow", "Slow", "Normal", "Fast", "Very Fast", "Super Fast"];
let damagePrefixes = ["Neutral Damage: ","Earth Damage: ","Thunder Damage: ","Water Damage: ","Fire Damage: ","Air Damage: "];
parent_elem.textContent = "";
const stats = meleeStats.slice();
for (let i = 0; i < 6; ++i) {
for (let j in stats[i]) {
stats[i][j] = stats[i][j].toFixed(2);
}
}
for (let i = 6; i < 8; ++i) {
for (let j in stats[i]) {
stats[i][j] = stats[i][j].toFixed(2);
}
}
for (let i = 8; i < 11; ++i){
stats[i] = stats[i].toFixed(2);
}
//title
let title_elem = document.createElement("p");
title_elem.classList.add("center");
title_elem.textContent = "Melee Stats";
parent_elem.append(title_elem);
parent_elem.append(document.createElement("br"));
//average DPS
let averageDamage = document.createElement("p");
averageDamage.classList.add("center");
averageDamage.textContent = "Average DPS: " + stats[10];
parent_elem.append(averageDamage);
//attack speed
let atkSpd = document.createElement("p");
atkSpd.classList.add("center");
atkSpd.textContent = "Attack Speed: " + attackSpeeds[stats[11]];
parent_elem.append(atkSpd);
parent_elem.append(document.createElement("br"));
//Non-Crit: n->elem, total dmg, DPS
let nonCritStats = document.createElement("p");
nonCritStats.classList.add("center");
nonCritStats.textContent = "Non-Crit Stats: ";
nonCritStats.append(document.createElement("br"));
let dmg = document.createElement("p");
for (let i = 0; i < 6; i++){
if(stats[i][0] > 0){
dmg.textContent = damagePrefixes[i] + stats[i][0] + " - " + stats[i][1];
nonCritStats.append(dmg);
}
}
let normalDamage = document.createElement("p");
normalDamage.textContent = "Total Damage: " + stats[6][0] + " - " + stats[6][1];
nonCritStats.append(normalDamage);
let normalDPS = document.createElement("p");
normalDPS.textContent = "Normal DPS: " + stats[8];
normalDPS.append(document.createElement("br"));
normalDPS.append(document.createElement("br"));
nonCritStats.append(normalDPS);
parent_elem.append(nonCritStats);
parent_elem.append(document.createElement("br"));
//Crit: n->elem, total dmg, DPS
let critStats = document.createElement("p");
critStats.classList.add("center");
critStats.textContent = "Crit Stats: ";
critStats.append(document.createElement("br"));
dmg = document.createElement("p");
for (let i = 0; i < 6; i++){
if(stats[i][2] > 0){
dmg.textContent = damagePrefixes[i] + stats[i][2] + " - " + stats[i][3];
critStats.append(dmg);
}
}
normalDamage = document.createElement("p");
normalDamage.textContent = "Total Damage: " + stats[7][0] + " - " + stats[7][1];
critStats.append(normalDamage);
normalDPS = document.createElement("p");
normalDPS.textContent = "Crit DPS: " + stats[9];
normalDPS.append(document.createElement("br"));
normalDPS.append(document.createElement("br"));
critStats.append(normalDPS);
parent_elem.append(critStats);
parent_elem.append(document.createElement("br"));
}
function displaySpellDamage(parent_elem, build, spell, spellIdx) {
parent_elem.textContent = "";

BIN
favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -15,11 +15,11 @@
Wynn build calculator
</div>
<div class="center" id="header2">
<p>Made by: hppeng and ferricles (JavaScript required to function, nothing works without js)</p>
<p>Made by <b class = "hppeng">hppeng</b> and <b class = "ferricles">ferricles</b> with Atlas Inc (JavaScript required to function, nothing works without js)</p>
<p>Hard refresh the page (Ctrl+Shift+R on windows/chrome) if it isn't updating correctly.</p>
</div>
<div class="center" id="credits">
<a href="credits.txt">Additional credits</a>
<a href="credits.txt" class="link">Additional credits</a>
</div>
<div class="equipment">
<div class="right" style="grid-column:1;grid-row:1">
@ -28,56 +28,56 @@
<br>
<div>
<label for="helmet-choice">Helmet:</label>
<input list="helmet-items" id="helmet-choice" name="helmet-choice" value="No Helmet"/>
<input list="helmet-items" id="helmet-choice" name="helmet-choice" placeholder="No Helmet"/>
<datalist id="helmet-items">
</datalist>
</div>
<br>
<div>
<label for="chestplate-choice">Chestplate:</label>
<input list="chestplate-items" id="chestplate-choice" name="chestplate-choice" value="No Chestplate"/>
<input list="chestplate-items" id="chestplate-choice" name="chestplate-choice" placeholder="No Chestplate"/>
<datalist id="chestplate-items">
</datalist>
</div>
<br>
<div>
<label for="leggings-choice">Leggings:</label>
<input list="leggings-items" id="leggings-choice" name="leggings-choice" value="No Leggings"/>
<input list="leggings-items" id="leggings-choice" name="leggings-choice" placeholder="No Leggings"/>
<datalist id="leggings-items">
</datalist>
</div>
<br>
<div id="boots">
<label for="boots-choice">Boots:</label>
<input list="boots-items" id="boots-choice" name="boots-choice" value="No Boots"/>
<input list="boots-items" id="boots-choice" name="boots-choice" placeholder="No Boots"/>
<datalist id="boots-items">
</datalist>
</div>
<br>
<div>
<label for="ring1-choice">Ring 1:</label>
<input list="ring1-items" id="ring1-choice" name="ring1-choice" value="No Ring 1"/>
<input list="ring1-items" id="ring1-choice" name="ring1-choice" placeholder="No Ring 1"/>
<datalist id="ring1-items">
</datalist>
</div>
<br>
<div>
<label for="ring2-choice">Ring 2:</label>
<input list="ring2-items" id="ring2-choice" name="ring2-choice" value="No Ring 2"/>
<input list="ring2-items" id="ring2-choice" name="ring2-choice" placeholder="No Ring 2"/>
<datalist id="ring2-items">
</datalist>
</div>
<br>
<div>
<label for="bracelet-choice">Bracelet:</label>
<input list="bracelet-items" id="bracelet-choice" name="bracelet-choice" value="No Bracelet"/>
<input list="bracelet-items" id="bracelet-choice" name="bracelet-choice" placeholder="No Bracelet"/>
<datalist id="bracelet-items">
</datalist>
</div>
<br>
<div>
<label for="necklace-choice">Necklace:</label>
<input list="necklace-items" id="necklace-choice" name="necklace-choice" value="No Necklace"/>
<input list="necklace-items" id="necklace-choice" name="necklace-choice" placeholder="No Necklace"/>
<datalist id="necklace-items">
</datalist>
</div>
@ -250,14 +250,14 @@
<div class = "center build-weapon" id = "build-weapon" style = "grid-column:1;grid-row:3">
<div class = "center" id = "build-weapon-stats"></div>
</div>
<div class = "center build-order" id = "build-order" style = "grid-column:2;grid-row:3">
</div>
<div class = "center" id = "build-melee-stats" style = "grid-column:3;grid-row:3">
</div>
<div class = "center build-overall" id = "build-overall" style = "grid-column:4;grid-row:3">
<p class="itemcenter">Overall Build Stats:<p>
<div class = "center" id = "build-overall-stats"></div>
</div>
<div class = "center build-melee-stats" id = "build-melee-stats" style = "grid-column:3;grid-row:3">
</div>
<div class = "center build-order" id = "build-order" style = "grid-column:2;grid-row:3">
</div>
<!--div class = "center" id = "build-defense-stats" style = "grid-column:4;grid-row:3">
</div-->
</div>

61
load.js
View file

@ -1,24 +1,44 @@
const DB_VERSION = 5;
const DB_VERSION = 7;
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.js
let db;
let reload = false;
let items;
let sets;
/*
* Load item set from local DB. Calls init() on success.
*/
async function load_local(init_func) {
let get_tx = db.transaction('item_db', 'readonly');
let get_tx = db.transaction(['item_db', 'set_db'], 'readonly');
let sets_store = get_tx.objectStore('set_db');
let get_store = get_tx.objectStore('item_db');
let request = get_store.getAll();
request.onerror = function(event) {
console.log("Could not read local db...");
console.log("Could not read local item db...");
}
request.onsuccess = function(event) {
console.log("Successfully read local db.");
console.log("Successfully read local item db.");
items = request.result;
init_func();
let request2 = sets_store.openCursor();
sets = {};
request2.onerror = function(event) {
console.log("Could not read local set db...");
}
request2.onsuccess = function(event) {
let cursor = event.target.result;
if (cursor) {
sets[cursor.primaryKey] = cursor.value;
cursor.continue();
}
else {
console.log("Successfully read local set db.");
console.log(sets);
init_func();
}
}
}
await get_tx.complete;
db.close();
@ -43,20 +63,27 @@ async function load(init_func) {
let url = "https://hppeng-wynn.github.io/compress.json";
let result = await (await fetch(url)).json();
items = result.items;
sets = result.sets;
// https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/clear
let clear_tx = db.transaction('item_db', 'readwrite');
let clear_store = clear_tx.objectStore('item_db');
let clear_tx = db.transaction(['item_db', 'set_db'], 'readwrite');
let clear_items = clear_tx.objectStore('item_db');
let clear_sets = clear_tx.objectStore('item_db');
await clear_store.clear();
await clear_items.clear();
await clear_sets.clear();
await clear_tx.complete;
let add_tx = db.transaction('item_db', 'readwrite');
let add_store = add_tx.objectStore('item_db');
let add_tx = db.transaction(['item_db', 'set_db'], 'readwrite');
let items_store = add_tx.objectStore('item_db');
let add_promises = [];
for (const item of items) {
clean_item(item);
add_promises.push(add_store.add(item, item.name));
add_promises.push(items_store.add(item, item.name));
}
let sets_store = add_tx.objectStore('set_db');
for (const set in sets) {
add_promises.push(sets_store.add(sets[set], set));
}
add_promises.push(add_tx.complete);
Promise.all(add_promises).then((values) => {
@ -93,11 +120,17 @@ function load_init(init_func) {
db.deleteObjectStore('item_db');
}
catch (error) {
console.log("Could not delete DB. This is probably fine");
console.log("Could not delete item DB. This is probably fine");
}
try {
db.deleteObjectStore('set_db');
}
catch (error) {
console.log("Could not delete set DB. This is probably fine");
}
let objectStore = db.createObjectStore('item_db');
objectStore.createIndex('item', 'item', {unique: false});
db.createObjectStore('item_db');
db.createObjectStore('set_db');
console.log("DB setup complete...");
}

39
sets/_Adventurer%27s.json Normal file
View file

@ -0,0 +1,39 @@
{
"items": [
"Adventurer's Cap",
"Adventurer's Boots",
"Adventurer's Pants",
"Adventurer's Tunic"
],
"bonuses": [
{},
{
"sdPct": 4,
"mdPct": 4,
"xpb": 10,
"lb": 5,
"spd": 2,
"hpBonus": 15,
"spRegen": 5
},
{
"sdPct": 12,
"mdPct": 12,
"xpb": 20,
"lb": 10,
"spd": 5,
"hpBonus": 40,
"spRegen": 15
},
{
"mr": 2,
"sdPct": 25,
"mdPct": 25,
"xpb": 50,
"lb": 30,
"spd": 15,
"hpBonus": 175,
"spRegen": 50
}
]
}

30
sets/_Air+Relic.json Normal file
View file

@ -0,0 +1,30 @@
{
"items": [
"Air Relic Helmet",
"Air Relic Boots",
"Air Relic Leggings",
"Air Relic Chestplate"
],
"bonuses": [
{},
{
"xpb": 5,
"lb": 10,
"spd": 10,
"hpBonus": 60
},
{
"xpb": 10,
"lb": 25,
"spd": 20,
"hpBonus": 190
},
{
"xpb": 25,
"lb": 50,
"agi": 20,
"spd": 60,
"hpBonus": 400
}
]
}

26
sets/_Bandit%27s.json Normal file
View file

@ -0,0 +1,26 @@
{
"items": [
"Bandit's Locket",
"Bandit's Bangle",
"Bandit's Knuckle",
"Bandit's Ring"
],
"bonuses": [
{},
{
"xpb": 3,
"lb": 4,
"eSteal": 1
},
{
"xpb": 7,
"lb": 9,
"eSteal": 3
},
{
"xpb": 12,
"lb": 15,
"eSteal": 6
}
]
}

14
sets/_Beachside.json Normal file
View file

@ -0,0 +1,14 @@
{
"items": [
"Beachside Headwrap",
"Beachside Conch"
],
"bonuses": [
{},
{
"lb": 20,
"wDamPct": 35,
"wDefPct": 25
}
]
}

15
sets/_Bear.json Normal file
View file

@ -0,0 +1,15 @@
{
"items": [
"Bear Mask",
"Bear Head",
"Bear Body"
],
"bonuses": [
{},
{
"mdPct": 14,
"hpBonus": 30,
"mdRaw": 20
}
]
}

19
sets/_Black+Catalyst.json Normal file
View file

@ -0,0 +1,19 @@
{
"items": [
"Black Catalyst"
],
"bonuses": [
{
"xpb": -5
},
{
"mr": 1,
"sdPct": 10,
"xpb": 30,
"expd": 10,
"hpBonus": 325,
"spRegen": 10,
"sdRaw": 90
}
]
}

29
sets/_Black.json Normal file
View file

@ -0,0 +1,29 @@
{
"items": [
"Black Cap",
"Black Boots",
"Black Pants",
"Black Tunic"
],
"bonuses": [
{},
{
"ms": 1,
"dex": 2,
"sdRaw": 15,
"mdRaw": 5
},
{
"ms": 1,
"dex": 6,
"sdRaw": 35,
"mdRaw": 10
},
{
"ms": 3,
"dex": 20,
"sdRaw": 65,
"mdRaw": 70
}
]
}

14
sets/_Blue+Team.json Normal file
View file

@ -0,0 +1,14 @@
{
"items": [
"Blue Team Boots",
"Blue Team Leggings",
"Blue Team Chestplate",
"Blue Team Helmet"
],
"bonuses": [
{},
{},
{},
{}
]
}

14
sets/_Bony.json Normal file
View file

@ -0,0 +1,14 @@
{
"items": [
"Bony Circlet",
"Bony Bow"
],
"bonuses": [
{},
{
"agi": 8,
"mdRaw": 45,
"aDamPct": 15
}
]
}

20
sets/_Builder%27s.json Normal file
View file

@ -0,0 +1,20 @@
{
"items": [
"Builder's Helmet",
"Builder's Boots",
"Builder's Trousers",
"Builder's Breastplate"
],
"bonuses": [
{},
{
"xpb": 5
},
{
"xpb": 10
},
{
"xpb": 15
}
]
}

21
sets/_Champion.json Normal file
View file

@ -0,0 +1,21 @@
{
"items": [
"Champion Helmet",
"Champion Boots",
"Champion Leggings",
"Champion Chestplate"
],
"bonuses": [
{},
{},
{},
{
"mr": 5,
"sdPct": 75,
"mdPct": 75,
"ms": 5,
"ls": 400,
"hprRaw": 600
}
]
}

58
sets/_Clock.json Normal file
View file

@ -0,0 +1,58 @@
{
"items": [
"Clock Helm",
"Clock Amulet",
"Watch Bracelet",
"Clockwork Ring",
"Time Ring",
"Clock Boots",
"Clock Leggings",
"Clock Mail"
],
"bonuses": [
{},
{
"fDamPct": 15,
"wDamPct": 6,
"aDamPct": 5,
"tDamPct": 18,
"eDamPct": 8
},
{
"fDamPct": 14,
"wDamPct": 12,
"aDamPct": 13
},
{
"fDamPct": 13,
"wDamPct": 18,
"aDamPct": 20,
"tDamPct": 18,
"eDamPct": 14
},
{
"fDamPct": 12,
"wDamPct": 24,
"aDamPct": 28
},
{
"fDamPct": 11,
"wDamPct": 24,
"aDamPct": 24,
"tDamPct": 18,
"eDamPct": 22
},
{
"fDamPct": 10,
"wDamPct": 24,
"aDamPct": 19
},
{
"fDamPct": 9,
"wDamPct": 24,
"aDamPct": 14,
"tDamPct": 18,
"eDamPct": 34
}
]
}

24
sets/_Corrupted+Nii.json Normal file
View file

@ -0,0 +1,24 @@
{
"items": [
"Corrupted Nii Mukluk",
"Corrupted Nii Plate",
"Corrupted Nii Shako"
],
"bonuses": [
{},
{
"int": 3,
"def": 3,
"hprRaw": 60
},
{
"mr": 4,
"int": 15,
"def": 15,
"hpBonus": 1500,
"hprRaw": 270,
"fDefPct": 60,
"wDefPct": 60
}
]
}

24
sets/_Corrupted+Uth.json Normal file
View file

@ -0,0 +1,24 @@
{
"items": [
"Corrupted Uth Sandals",
"Corrupted Uth Belt",
"Corrupted Uth Plume"
],
"bonuses": [
{},
{
"ls": 125,
"agi": 3,
"def": 3
},
{
"ls": 375,
"ref": 70,
"agi": 15,
"def": 15,
"thorns": 70,
"fDefPct": 75,
"aDefPct": 75
}
]
}

44
sets/_Cosmic.json Normal file
View file

@ -0,0 +1,44 @@
{
"items": [
"Cosmic Visor",
"Cosmic Walkers",
"Cosmic Ward",
"Cosmic Vest"
],
"bonuses": [
{},
{
"xpb": 15,
"lb": 15,
"ref": 5,
"spRegen": 15,
"fDefPct": 10,
"wDefPct": 10,
"aDefPct": 10,
"tDefPct": 10,
"eDefPct": 10
},
{
"xpb": 35,
"lb": 35,
"ref": 15,
"spRegen": 35,
"fDefPct": 20,
"wDefPct": 20,
"aDefPct": 20,
"tDefPct": 20,
"eDefPct": 20
},
{
"xpb": 50,
"lb": 50,
"ref": 30,
"spRegen": 50,
"fDefPct": 30,
"wDefPct": 30,
"aDefPct": 30,
"tDefPct": 30,
"eDefPct": 30
}
]
}

30
sets/_Earth+Relic.json Normal file
View file

@ -0,0 +1,30 @@
{
"items": [
"Earth Relic Helmet",
"Earth Relic Boots",
"Earth Relic Leggings",
"Earth Relic Chestplate"
],
"bonuses": [
{},
{
"mdPct": 10,
"xpb": 5,
"lb": 10,
"hpBonus": 65
},
{
"mdPct": 20,
"xpb": 10,
"lb": 25,
"hpBonus": 200
},
{
"mdPct": 45,
"xpb": 25,
"lb": 50,
"str": 20,
"hpBonus": 425
}
]
}

33
sets/_Elf.json Normal file
View file

@ -0,0 +1,33 @@
{
"items": [
"Elf Cap",
"Elf Shoes",
"Elf Pants",
"Elf Robe"
],
"bonuses": [
{},
{
"hprPct": 10,
"lb": 8,
"agi": 5,
"def": 5,
"spd": 6
},
{
"hprPct": 20,
"lb": 16,
"agi": 7,
"def": 7,
"spd": 14
},
{
"hprPct": 45,
"lb": 32,
"agi": 10,
"def": 10,
"spd": 20,
"hprRaw": 45
}
]
}

30
sets/_Fire+Relic.json Normal file
View file

@ -0,0 +1,30 @@
{
"items": [
"Fire Relic Helmet",
"Fire Relic Boots",
"Fire Relic Leggings",
"Fire Relic Chestplate"
],
"bonuses": [
{},
{
"xpb": 5,
"lb": 10,
"hpBonus": 90,
"hprRaw": 12
},
{
"xpb": 10,
"lb": 25,
"hpBonus": 270,
"hprRaw": 40
},
{
"xpb": 25,
"lb": 50,
"def": 20,
"hpBonus": 570,
"hprRaw": 100
}
]
}

22
sets/_Flashfire.json Normal file
View file

@ -0,0 +1,22 @@
{
"items": [
"Flashfire Gauntlet",
"Flashfire Knuckle"
],
"bonuses": [
{},
{
"spd": 8,
"atkTier": 1,
"wDamPct": -15,
"wDefPct": -15
},
{
"spd": 16,
"atkTier": 1,
"fDamPct": 12,
"wDamPct": -15,
"wDefPct": -15
}
]
}

20
sets/_GM%27s.json Normal file
View file

@ -0,0 +1,20 @@
{
"items": [
"GM's Helmet",
"GM's Boots",
"GM's Trousers",
"GM's Breastplate"
],
"bonuses": [
{},
{
"xpb": 5
},
{
"xpb": 10
},
{
"xpb": 15
}
]
}

35
sets/_Ghostly.json Normal file
View file

@ -0,0 +1,35 @@
{
"items": [
"Ghostly Cap",
"Ghostly Boots",
"Ghostly Pants",
"Ghostly Tunic"
],
"bonuses": [
{},
{
"mr": -1,
"ms": 2,
"sdRaw": 35,
"wDamPct": 5,
"tDamPct": 5,
"eDamPct": -34
},
{
"mr": -2,
"ms": 4,
"sdRaw": 100,
"wDamPct": 10,
"tDamPct": 10,
"eDamPct": -67
},
{
"mr": -3,
"ms": 6,
"sdRaw": 195,
"wDamPct": 25,
"tDamPct": 25,
"eDamPct": -100
}
]
}

30
sets/_Goblin.json Normal file
View file

@ -0,0 +1,30 @@
{
"items": [
"Goblin Hood",
"Goblin Runners",
"Goblin Cloak"
],
"bonuses": [
{
"sdPct": -6,
"mdPct": -6,
"sdRaw": 15,
"mdRaw": 10
},
{
"sdPct": -12,
"mdPct": -12,
"ls": 22,
"sdRaw": 55,
"mdRaw": 45
},
{
"sdPct": -23,
"mdPct": -23,
"ls": 51,
"ms": 2,
"sdRaw": 130,
"mdRaw": 105
}
]
}

14
sets/_Hallowynn+2016.json Normal file
View file

@ -0,0 +1,14 @@
{
"items": [
"Treat",
"Trick"
],
"bonuses": [
{},
{
"xpb": 15,
"spRegen": 10,
"eSteal": 5
}
]
}

16
sets/_Horse.json Normal file
View file

@ -0,0 +1,16 @@
{
"items": [
"Horse Mask",
"Horse Hoof"
],
"bonuses": [
{},
{
"mdPct": 11,
"xpb": 10,
"spd": 20,
"aDamPct": 15,
"eDamPct": 15
}
]
}

37
sets/_Jester.json Normal file
View file

@ -0,0 +1,37 @@
{
"items": [
"Jester Necklace",
"Jester Bracelet",
"Jester Ring"
],
"bonuses": [
{
"xpb": -25,
"lb": -25
},
{
"xpb": -50,
"lb": -50,
"spd": -10,
"hpBonus": 300,
"sdRaw": -110,
"mdRaw": 60
},
{
"xpb": -75,
"lb": -75,
"spd": 5,
"hpBonus": -150,
"sdRaw": 100,
"mdRaw": -75
},
{
"xpb": -100,
"lb": -100,
"spd": 5,
"hpBonus": -150,
"sdRaw": 100,
"mdRaw": -75
}
]
}

17
sets/_Kaerynn%27s.json Normal file
View file

@ -0,0 +1,17 @@
{
"items": [
"Kaerynn's Mind",
"Kaerynn's Body"
],
"bonuses": [
{},
{
"mr": 2,
"xpb": 12,
"str": 4,
"hpBonus": 400,
"sdRaw": 100,
"mdRaw": 50
}
]
}

29
sets/_Leaf.json Normal file
View file

@ -0,0 +1,29 @@
{
"items": [
"Leaf Cap",
"Leaf Boots",
"Leaf Pants",
"Leaf Tunic"
],
"bonuses": [
{},
{
"hprPct": 5,
"thorns": 7,
"hpBonus": 10,
"hprRaw": 1
},
{
"hprPct": 12,
"thorns": 18,
"hpBonus": 20,
"hprRaw": 3
},
{
"hprPct": 25,
"thorns": 35,
"hpBonus": 60,
"hprRaw": 7
}
]
}

73
sets/_Morph.json Normal file
View file

@ -0,0 +1,73 @@
{
"items": [
"Morph-Stardust",
"Morph-Ruby",
"Morph-Amethyst",
"Morph-Emerald",
"Morph-Topaz",
"Morph-Gold",
"Morph-Iron",
"Morph-Steel"
],
"bonuses": [
{},
{
"xpb": 5,
"lb": 5
},
{
"mr": 1,
"xpb": 10,
"lb": 10,
"spRaw2": -1,
"hpBonus": 125
},
{
"mr": 1,
"xpb": 15,
"lb": 15,
"spRaw2": -1,
"hpBonus": 425
},
{
"mr": 2,
"xpb": 35,
"lb": 35,
"hpBonus": 1325,
"spRaw2": -1,
"spRaw4": -1
},
{
"mr": 2,
"xpb": 55,
"lb": 55,
"hpBonus": 2575,
"spRaw2": -1,
"spRaw4": -1
},
{
"mr": 3,
"xpb": 80,
"lb": 80,
"hpBonus": 4450,
"spRaw1": -1,
"spRaw2": -1,
"spRaw4": -1
},
{
"mr": 4,
"xpb": 100,
"lb": 100,
"str": 21,
"dex": 21,
"int": 21,
"agi": 21,
"def": 21,
"hpBonus": 6800,
"spRaw1": -1,
"spRaw2": -1,
"spRaw3": -1,
"spRaw4": -1
}
]
}

33
sets/_Nether.json Normal file
View file

@ -0,0 +1,33 @@
{
"items": [
"Nether Cap",
"Nether Boots",
"Nether Pants",
"Nether Tunic"
],
"bonuses": [
{},
{
"ls": 5,
"expd": 2,
"hprRaw": -1,
"fDamPct": 2,
"wDamPct": -10
},
{
"ls": 15,
"expd": 10,
"hprRaw": -2,
"fDamPct": 8,
"wDamPct": -25
},
{
"ls": 50,
"def": 15,
"expd": 60,
"hprRaw": -20,
"fDamPct": 42,
"wDamPct": -45
}
]
}

29
sets/_Outlaw.json Normal file
View file

@ -0,0 +1,29 @@
{
"items": [
"Outlaw Cap",
"Outlaw Boots",
"Outlaw Pants",
"Outlaw Tunic"
],
"bonuses": [
{},
{
"ls": 11,
"xpb": 5,
"agi": 4,
"eSteal": 2
},
{
"ls": 22,
"xpb": 10,
"agi": 8,
"eSteal": 4
},
{
"ls": 45,
"xpb": 25,
"agi": 28,
"eSteal": 8
}
]
}

13
sets/_Pigman.json Normal file
View file

@ -0,0 +1,13 @@
{
"items": [
"Pigman Helmet",
"Pigman Battle Hammer"
],
"bonuses": [
{},
{
"str": 20,
"eDamPct": 40
}
]
}

14
sets/_Red+Team.json Normal file
View file

@ -0,0 +1,14 @@
{
"items": [
"Red Team Boots",
"Red Team Leggings",
"Red Team Chestplate",
"Red Team Helmet"
],
"bonuses": [
{},
{},
{},
{}
]
}

46
sets/_Relic.json Normal file
View file

@ -0,0 +1,46 @@
{
"items": [
"Relic Helmet",
"Relic Boots",
"Relic Leggings",
"Relic Chestplate"
],
"bonuses": [
{},
{
"xpb": 10,
"lb": 10,
"hpBonus": 65,
"fDamPct": 5,
"wDamPct": 5,
"aDamPct": 5,
"tDamPct": 5,
"eDamPct": 5
},
{
"xpb": 25,
"lb": 25,
"hpBonus": 200,
"fDamPct": 12,
"wDamPct": 12,
"aDamPct": 12,
"tDamPct": 12,
"eDamPct": 12
},
{
"xpb": 50,
"lb": 50,
"str": 8,
"dex": 8,
"int": 8,
"agi": 8,
"def": 8,
"hpBonus": 425,
"fDamPct": 25,
"wDamPct": 25,
"aDamPct": 25,
"tDamPct": 25,
"eDamPct": 25
}
]
}

38
sets/_Saint%27s.json Normal file
View file

@ -0,0 +1,38 @@
{
"items": [
"Saint's Shawl",
"Saint's Sandals",
"Saint's Leggings",
"Saint's Tunic"
],
"bonuses": [
{},
{
"mr": 1,
"sdPct": -5,
"mdPct": -10,
"def": 5,
"spRegen": 5,
"wDamPct": 10,
"aDamPct": 10
},
{
"mr": 3,
"sdPct": -10,
"mdPct": -20,
"def": 10,
"spRegen": 10,
"wDamPct": 20,
"aDamPct": 20
},
{
"mr": 5,
"sdPct": -15,
"mdPct": -35,
"def": 30,
"spRegen": 100,
"wDamPct": 35,
"aDamPct": 35
}
]
}

17
sets/_Silverfish.json Normal file
View file

@ -0,0 +1,17 @@
{
"items": [
"Silverfish Helm",
"Silverfish Boots"
],
"bonuses": [
{
"spd": 5
},
{
"agi": 10,
"thorns": 20,
"spd": 20,
"poison": 290
}
]
}

24
sets/_Skien%27s.json Normal file
View file

@ -0,0 +1,24 @@
{
"items": [
"Skien Boots",
"Skien Leggings",
"Skien's Fatigues"
],
"bonuses": [
{},
{
"sdPct": -10,
"mdPct": 12,
"sdRaw": -40,
"mdRaw": 30
},
{
"sdPct": -35,
"mdPct": 30,
"dex": 15,
"spd": 8,
"sdRaw": -90,
"mdRaw": 125
}
]
}

17
sets/_Slime.json Normal file
View file

@ -0,0 +1,17 @@
{
"items": [
"Slime Boots",
"Slime Plate"
],
"bonuses": [
{},
{
"hprPct": 35,
"thorns": 15,
"spd": -6,
"poison": 300,
"hpBonus": 600,
"jh": 1
}
]
}

38
sets/_Snail.json Normal file
View file

@ -0,0 +1,38 @@
{
"items": [
"Snail Helm",
"Snail Boots",
"Snail Leggings",
"Snail Mail"
],
"bonuses": [
{},
{
"str": 7,
"agi": -5,
"thorns": 10,
"spd": -5,
"poison": 880,
"hpBonus": 1100,
"hprRaw": 125
},
{
"str": 14,
"agi": -10,
"thorns": 20,
"spd": -10,
"poison": 2650,
"hpBonus": 2675,
"hprRaw": 275
},
{
"str": 21,
"agi": -15,
"thorns": 40,
"spd": -15,
"poison": 5500,
"hpBonus": 5500,
"hprRaw": 575
}
]
}

32
sets/_Snow.json Normal file
View file

@ -0,0 +1,32 @@
{
"items": [
"Snow Helmet",
"Snow Boots",
"Snow Pants",
"Snow Tunic"
],
"bonuses": [
{},
{
"hprPct": -10,
"mr": 1,
"sdPct": 4,
"ref": 10,
"thorns": 8
},
{
"hprPct": -20,
"mr": 2,
"sdPct": 12,
"ref": 30,
"thorns": 24
},
{
"hprPct": -35,
"mr": 4,
"sdPct": 28,
"ref": 70,
"thorns": 55
}
]
}

24
sets/_Spider.json Normal file
View file

@ -0,0 +1,24 @@
{
"items": [
"Spinneret",
"Abdomen",
"Cephalothorax"
],
"bonuses": [
{},
{
"xpb": 10,
"dex": 2,
"agi": 2,
"spd": 7,
"poison": 35
},
{
"xpb": 25,
"dex": 6,
"agi": 6,
"spd": 19,
"poison": 130
}
]
}

14
sets/_Spore.json Normal file
View file

@ -0,0 +1,14 @@
{
"items": [
"Spore Cap",
"Spore Shortsword"
],
"bonuses": [
{},
{
"ls": 20,
"expd": 20,
"poison": 70
}
]
}

View file

@ -0,0 +1,42 @@
{
"items": [
"Thanos Legionnaire Helm",
"Thanos Legionnaire Greaves",
"Thanos Legionnaire Leggings",
"Thanos Legionnaire Plate"
],
"bonuses": [
{},
{
"str": 1,
"dex": -1,
"int": -1,
"agi": 1,
"def": 1,
"spd": 2,
"hprRaw": 60,
"mdRaw": 60
},
{
"str": 4,
"dex": -4,
"int": -4,
"agi": 4,
"def": 4,
"spd": 8,
"hprRaw": 180,
"mdRaw": 180
},
{
"str": 15,
"dex": -15,
"int": -15,
"agi": 15,
"def": 15,
"spd": 20,
"atkTier": 1,
"hprRaw": 480,
"mdRaw": 480
}
]
}

30
sets/_Thunder+Relic.json Normal file
View file

@ -0,0 +1,30 @@
{
"items": [
"Thunder Relic Helmet",
"Thunder Relic Boots",
"Thunder Relic Leggings",
"Thunder Relic Chestplate"
],
"bonuses": [
{},
{
"xpb": 5,
"lb": 10,
"hpBonus": 55,
"mdRaw": 12
},
{
"xpb": 10,
"lb": 25,
"hpBonus": 180,
"mdRaw": 32
},
{
"xpb": 25,
"lb": 50,
"dex": 20,
"hpBonus": 380,
"mdRaw": 105
}
]
}

27
sets/_Tribal.json Normal file
View file

@ -0,0 +1,27 @@
{
"items": [
"Tribal Cap",
"Tribal Boots",
"Tribal Pants",
"Tribal Tunic"
],
"bonuses": [
{},
{
"str": 2,
"spd": 5
},
{
"str": 5,
"agi": 2,
"spd": 10
},
{
"sdPct": -15,
"str": 10,
"agi": 5,
"spd": 15,
"atkTier": 1
}
]
}

35
sets/_Ultramarine.json Normal file
View file

@ -0,0 +1,35 @@
{
"items": [
"Ultramarine Crown",
"Ultramarine Boots",
"Ultramarine Belt",
"Ultramarine Cape"
],
"bonuses": [
{},
{
"mr": 2,
"mdPct": -24,
"int": 5,
"wDamPct": 10,
"tDamPct": -8,
"wDefPct": 16
},
{
"mr": 5,
"mdPct": -54,
"int": 15,
"wDamPct": 20,
"tDamPct": -18,
"wDefPct": 36
},
{
"mr": 8,
"mdPct": -90,
"int": 25,
"wDamPct": 40,
"tDamPct": -30,
"wDefPct": 56
}
]
}

15
sets/_Veekhat%27s.json Normal file
View file

@ -0,0 +1,15 @@
{
"items": [
"Veekhat's Horns",
"Veekhat's Udders"
],
"bonuses": [
{},
{
"mdPct": 30,
"ms": 2,
"spd": 25,
"spPct2": -40
}
]
}

16
sets/_Vexing.json Normal file
View file

@ -0,0 +1,16 @@
{
"items": [
"Mask of the Dark Vexations",
"Staff of the Dark Vexations"
],
"bonuses": [
{},
{
"mr": 2,
"sdPct": 15,
"mdPct": -15,
"sdRaw": 30,
"spPct2": -50
}
]
}

14
sets/_Villager.json Normal file
View file

@ -0,0 +1,14 @@
{
"items": [
"Villager Pants",
"Villager Mail"
],
"bonuses": [
{},
{
"xpb": 20,
"lb": 60,
"eSteal": 8
}
]
}

35
sets/_Visceral.json Normal file
View file

@ -0,0 +1,35 @@
{
"items": [
"Visceral Skullcap",
"Visceral Toe",
"Visceral Legs",
"Visceral Chest"
],
"bonuses": [
{},
{
"hprPct": 30,
"mdPct": 10,
"ls": 45,
"hpBonus": -1000,
"hprRaw": 35,
"mdRaw": 40
},
{
"hprPct": 100,
"mdPct": 25,
"ls": 90,
"hpBonus": -2500,
"hprRaw": 75,
"mdRaw": 80
},
{
"hprPct": 350,
"mdPct": 50,
"ls": 180,
"hpBonus": -4000,
"hprRaw": 145,
"mdRaw": 165
}
]
}

30
sets/_Water+Relic.json Normal file
View file

@ -0,0 +1,30 @@
{
"items": [
"Water Relic Helmet",
"Water Relic Boots",
"Water Relic Leggings",
"Water Relic Chestplate"
],
"bonuses": [
{},
{
"mr": 1,
"xpb": 5,
"lb": 10,
"hpBonus": 55
},
{
"mr": 2,
"xpb": 10,
"lb": 25,
"hpBonus": 170
},
{
"mr": 4,
"xpb": 25,
"lb": 50,
"int": 20,
"hpBonus": 360
}
]
}

View file

@ -35,7 +35,7 @@ function calculate_skillpoints(equipment, weapon) {
let applied = [0, 0, 0, 0, 0];
let total = 0;
for (let i = 0; i < 5; i++) {
if (item.get("skillpoints")[i] < 0 && skillpoint_filter[i]) {
if (item.get("skillpoints")[i] < 0 && skillpoint_filter[i] === true) {
applied[i] -= item.get("skillpoints")[i];
total -= item.get("skillpoints")[i];
}
@ -121,7 +121,8 @@ function calculate_skillpoints(equipment, weapon) {
// }
// }
// }
result = apply_to_fit(skillpoints, weapon, allFalse);
let pre = skillpoints.slice();
result = apply_to_fit(skillpoints, weapon, allFalse.slice());
needed_skillpoints = result[0];
total_diff = result[1];
for (let i = 0; i < 5; ++i) {
@ -133,6 +134,8 @@ function calculate_skillpoints(equipment, weapon) {
total_applied += total_diff;
if (total_applied < best_total) {
console.log(pre);
console.log(skillpoints);
best = permutation;
final_skillpoints = skillpoints;
best_skillpoints = skillpoints_applied;
@ -143,7 +146,7 @@ function calculate_skillpoints(equipment, weapon) {
}
else {
best_total = 0;
result = apply_to_fit(final_skillpoints, weapon);
result = apply_to_fit(final_skillpoints, weapon, allFalse.slice());
needed_skillpoints = result[0];
total_diff = result[1];
for (let i = 0; i < 5; ++i) {

View file

@ -23,7 +23,19 @@
gap: 5px;
grid-auto-rows: minmax(60px, auto);
}
.equipment, .skillpoints, .center, .header, .all{
background: #110110;
color: #aaa;
}
.hppeng{
color: #20c2b6;
}
.ferricles{
color: #5be553;
}
a.link{
color: #A5FDFF;
}
.center {
text-align: center;
}
@ -37,28 +49,21 @@
}
.build, .spells {
padding: 1%;
padding: 2%;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
gap: 20px;
grid-auto-rows: minmax(60px, auto);
width: 98%;
width: 94%;
background: #110110;
}
.spell-info {
.build-helmet, .build-chestplate, .build-leggings, .build-boots, .build-ring1, .build-ring2, .build-bracelet, .build-necklace, .build-weapon, .build-order, .build-overall, .build-melee-stats, .spell-info {
color: #aaa;
background: #110110;
border: 2px solid black;
border: 3px solid #BCBCBC;
border-radius: 3px;
width: 100%;
}
.build-helmet, .build-chestplate, .build-leggings, .build-boots, .build-ring1, .build-ring2, .build-bracelet, .build-necklace, .build-weapon, .build-order, .build-overall {
color: #aaa;
background: #110110;
border: 2px solid black;
border-radius: 3px;
width: 100%;
width: 96%;
}
.itemcenter {
@ -73,7 +78,7 @@
.itemtable {
margin: 2px 2%;
width: 96%;
width: 94%;
margin-bottom: 16px;
}
@ -160,3 +165,27 @@
display: block;
margin: auto;
}
/*Scrollbar*/
/* width */
::-webkit-scrollbar {
width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
box-shadow: inset 0 0 5px #BCBCBC;
border: #BCBCBC;
border-radius: 5px;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #aaa;
border-radius: 10px;
}
/* Ugly Corner */
::-webkit-scrollbar-corner{
background: #110110;
}

40
test.js
View file

@ -11,7 +11,7 @@ console.log(url_tag);
* END testing section
*/
const BUILD_VERSION = "2.9";
const BUILD_VERSION = "3.2";
document.getElementById("header").textContent = "Wynn build calculator "+BUILD_VERSION+" (db version "+DB_VERSION+")";
@ -424,41 +424,11 @@ function calculateBuildStats() {
displayBuildStats(player_build, "build-overall-stats");
let parent_elem = document.getElementById("build-melee-stats");
let meleeStats = player_build.getMeleeStats();
//nDamAdj,eDamAdj,tDamAdj,wDamAdj,fDamAdj,aDamAdj,totalDamNorm,totalDamCrit,normDPS,critDPS,avgDPS
for (let i = 0; i < 6; ++i) {
for (let j in meleeStats[i]) {
meleeStats[i][j] = Math.round(meleeStats[i][j]);
}
}
for (let i = 6; i < 8; ++i) {
for (let j in meleeStats[i]) {
meleeStats[i][j] = Math.round(meleeStats[i][j]);
}
}
let meleeSummary = "";
meleeSummary = meleeSummary.concat("<h1><u>Melee Stats</u></h1>");
meleeSummary = meleeSummary.concat("<h2>Average DPS: ",Math.round(meleeStats[10]),"</h2> <br>");
let attackSpeeds = ["SUPER SLOW", "VERY SLOW", "SLOW", "NORMAL", "FAST", "VERY FAST", "SUPER FAST"];
meleeSummary = meleeSummary.concat("<b>Attack Speed: ",attackSpeeds[meleeStats[11]],"</b><br><br>");
meleeSummary = meleeSummary.concat("<b>Non-Crit Stats: </b><br>");
let damagePrefixes = ["Neutral Damage: ","Earth Damage: ","Thunder Damage: ","Water Damage: ","Fire Damage: ","Air Damage: "];
for (let i = 0; i < 6; i++){
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>");
for (let i = 0; i < 6; i++){
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>");
setHTML("build-melee-stats", "".concat(meleeSummary)); //basically complete function
displayMeleeDamage(parent_elem,meleeStats);
//let defenseStats = "";
//setHTML("build-defense-stats", "".concat(defenseStats));