2021-01-07 00:36:11 +00:00
/ *
* TESTING SECTION
* /
2021-01-07 10:23:54 +00:00
const url _base = location . href . split ( "#" ) [ 0 ] ;
const url _tag = location . hash . slice ( 1 ) ;
console . log ( url _base ) ;
console . log ( url _tag ) ;
2021-01-07 00:36:11 +00:00
/ *
* END testing section
* /
2021-01-07 00:04:16 +00:00
2021-01-09 23:35:32 +00:00
const BUILD _VERSION = "3.0" ;
2021-01-07 10:30:23 +00:00
document . getElementById ( "header" ) . textContent = "Wynn build calculator " + BUILD _VERSION + " (db version " + DB _VERSION + ")" ;
2021-01-07 00:04:16 +00:00
let player _build ;
2021-01-06 22:51:02 +00:00
// Set up item lists for quick access later.
2021-01-06 12:48:41 +00:00
let armorTypes = [ "helmet" , "chestplate" , "leggings" , "boots" ] ;
let accessoryTypes = [ "ring" , "bracelet" , "necklace" ] ;
let weaponTypes = [ "wand" , "spear" , "bow" , "dagger" , "relik" ] ;
2021-01-09 03:53:57 +00:00
// THIS IS SUPER DANGEROUS, WE SHOULD NOT BE KEEPING THIS IN SO MANY PLACES
2021-01-09 11:15:28 +00:00
let item _fields = [ "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" , "hprPct" , "mr" , "sdPct" , "mdPct" , "ls" , "ms" , "xpb" , "lb" , "ref" , "str" , "dex" , "int" , "agi" , "def" , "thorns" , "expd" , "spd" , "atkTier" , "poison" , "hpBonus" , "spRegen" , "eSteal" , "hprRaw" , "sdRaw" , "mdRaw" , "fDamPct" , "wDamPct" , "aDamPct" , "tDamPct" , "eDamPct" , "fDefPct" , "wDefPct" , "aDefPct" , "tDefPct" , "eDefPct" , "fixID" , "category" , "spPct1" , "spRaw1" , "spPct2" , "spRaw2" , "spPct3" , "spRaw3" , "spPct4" , "spRaw4" , "rainbowRaw" , "sprint" , "sprintReg" , "jh" , "lq" , "gXp" , "gSpd" , "id" ] ;
2021-01-09 08:52:58 +00:00
let skp _order = [ "str" , "dex" , "int" , "def" , "agi" ] ;
let skpReqs = skp _order . map ( x => x + "Req" ) ;
2021-01-08 20:17:37 +00:00
2021-01-09 03:53:57 +00:00
let equipment _fields = [
"helmet" ,
"chestplate" ,
"leggings" ,
"boots" ,
"ring1" ,
"ring2" ,
"bracelet" ,
"necklace" ,
"weapon"
] ;
let equipment _names = [
"Helmet" ,
"Chestplate" ,
"Leggings" ,
"Boots" ,
"Ring 1" ,
"Ring 2" ,
"Bracelet" ,
"Necklace" ,
"Weapon"
] ;
let equipmentInputs = equipment _fields . map ( x => x + "-choice" ) ;
let buildFields = equipment _fields . map ( x => "build-" + x ) ;
2021-01-08 20:17:37 +00:00
let powderIDs = new Map ( ) ;
let powderNames = new Map ( ) ;
let _powderID = 0 ;
for ( const x of [ 'e' , 't' , 'w' , 'f' , 'a' ] ) {
for ( let i = 1 ; i <= 6 ; ++ i ) {
// Support both upper and lowercase, I guess.
powderIDs . set ( x . toUpperCase ( ) + i , _powderID ) ;
powderIDs . set ( x + i , _powderID ) ;
powderNames . set ( _powderID , x + i ) ;
_powderID ++ ;
}
}
let powderInputs = [
"helmet-powder" ,
"chestplate-powder" ,
"leggings-powder" ,
"boots-powder" ,
"weapon-powder" ,
] ;
// Ordering: [dmgMin, dmgMax, convert, defPlus, defMinus (+6 mod 5)]
2021-01-09 00:56:07 +00:00
class Powder {
constructor ( min , max , convert , defPlus , defMinus ) {
this . min = min ;
this . max = max ;
this . convert = convert ;
this . defPlus = defPlus ;
this . defMinus = defMinus ;
}
}
function _p ( a , b , c , d , e ) { return new Powder ( a , b , c , d , e ) ; }
2021-01-08 20:17:37 +00:00
let powderStats = [
2021-01-09 00:56:07 +00:00
_p ( 3 , 6 , 17 , 2 , 1 ) , _p ( 6 , 9 , 21 , 4 , 2 ) , _p ( 8 , 14 , 25 , 8 , 3 ) , _p ( 11 , 16 , 31 , 14 , 5 ) , _p ( 15 , 18 , 38 , 22 , 9 ) , _p ( 18 , 22 , 46 , 30 , 13 ) ,
_p ( 1 , 8 , 9 , 3 , 1 ) , _p ( 1 , 13 , 11 , 5 , 1 ) , _p ( 2 , 18 , 14 , 9 , 2 ) , _p ( 3 , 24 , 17 , 14 , 4 ) , _p ( 3 , 32 , 22 , 20 , 7 ) , _p ( 5 , 40 , 28 , 28 , 10 ) ,
_p ( 3 , 4 , 13 , 3 , 1 ) , _p ( 4 , 7 , 15 , 6 , 1 ) , _p ( 6 , 10 , 17 , 11 , 2 ) , _p ( 8 , 12 , 21 , 18 , 4 ) , _p ( 11 , 14 , 26 , 28 , 7 ) , _p ( 13 , 17 , 32 , 40 , 10 ) ,
_p ( 2 , 5 , 14 , 3 , 1 ) , _p ( 4 , 8 , 16 , 5 , 2 ) , _p ( 6 , 10 , 19 , 9 , 3 ) , _p ( 9 , 13 , 24 , 16 , 5 ) , _p ( 12 , 16 , 30 , 25 , 9 ) , _p ( 15 , 19 , 37 , 36 , 13 ) ,
_p ( 2 , 6 , 11 , 3 , 1 ) , _p ( 4 , 9 , 14 , 6 , 2 ) , _p ( 7 , 10 , 17 , 10 , 3 ) , _p ( 9 , 13 , 22 , 16 , 5 ) , _p ( 13 , 18 , 28 , 24 , 9 ) , _p ( 16 , 18 , 35 , 34 , 13 )
2021-01-08 20:17:37 +00:00
] ;
2021-01-06 12:48:41 +00:00
let itemTypes = armorTypes . concat ( accessoryTypes ) . concat ( weaponTypes ) ;
let itemLists = new Map ( ) ;
for ( const it of itemTypes ) {
itemLists . set ( it , [ ] ) ;
}
let itemMap = new Map ( ) ;
2021-01-07 10:23:54 +00:00
let idMap = new Map ( ) ;
2021-01-06 12:48:41 +00:00
2021-01-06 22:51:02 +00:00
/ *
* Function that takes an item list and populates its corresponding dropdown .
* Used for armors and bracelet / necklace .
* /
2021-01-06 12:48:41 +00:00
function populateItemList ( type ) {
let item _list = document . getElementById ( type + "-items" ) ;
for ( const item of itemLists . get ( type ) ) {
let el = document . createElement ( "option" ) ;
el . value = item ;
item _list . appendChild ( el ) ;
}
}
2021-01-06 22:51:02 +00:00
/ *
* Populate dropdowns , add listeners , etc .
* /
2021-01-06 12:48:41 +00:00
function init ( ) {
2021-01-06 22:46:00 +00:00
let noneItems = [
2021-01-08 04:31:29 +00:00
[ "armor" , "helmet" , "No Helmet" ] ,
[ "armor" , "chestplate" , "No Chestplate" ] ,
[ "armor" , "leggings" , "No Leggings" ] ,
[ "armor" , "boots" , "No Boots" ] ,
[ "accessory" , "ring" , "No Ring 1" ] ,
[ "accessory" , "ring" , "No Ring 2" ] ,
[ "accessory" , "bracelet" , "No Bracelet" ] ,
[ "accessory" , "necklace" , "No Necklace" ] ,
[ "weapon" , "wand" , "No Weapon" ] ,
2021-01-07 06:41:41 +00:00
] ;
for ( let i = 0 ; i < 9 ; i ++ ) {
let item = Object ( ) ;
for ( const field of item _fields ) {
item [ field ] = 0 ;
}
2021-01-08 04:31:29 +00:00
item . category = noneItems [ i ] [ 0 ] ;
item . type = noneItems [ i ] [ 1 ] ;
item . name = noneItems [ i ] [ 2 ] ;
2021-01-07 06:41:41 +00:00
item . displayName = item . name ;
item . set = null ;
item . quest = null ;
item . skillpoints = [ 0 , 0 , 0 , 0 , 0 ] ;
item . has _negstat = false ;
item . reqs = [ 0 , 0 , 0 , 0 , 0 ] ;
2021-01-08 01:16:06 +00:00
item . fixID = true ;
item . tier = " " ; //do not get rid of this @hpp
2021-01-07 10:23:54 +00:00
item . id = 10000 + i ;
2021-01-08 20:17:37 +00:00
item . nDam = "0-0" ;
item . eDam = "0-0" ;
item . tDam = "0-0" ;
item . wDam = "0-0" ;
item . fDam = "0-0" ;
item . aDam = "0-0" ;
2021-01-07 06:41:41 +00:00
noneItems [ i ] = item ;
}
2021-01-06 23:31:35 +00:00
items = items . concat ( noneItems ) ;
2021-01-06 12:48:41 +00:00
console . log ( items ) ;
for ( const item of items ) {
2021-01-06 22:51:02 +00:00
itemLists . get ( item . type ) . push ( item . displayName ) ;
itemMap . set ( item . displayName , item ) ;
2021-01-07 10:23:54 +00:00
idMap . set ( item . id , item . displayName ) ;
2021-01-06 12:48:41 +00:00
}
for ( const armorType of armorTypes ) {
populateItemList ( armorType ) ;
2021-01-06 22:51:02 +00:00
// Add change listener to update armor slots.
2021-01-06 12:48:41 +00:00
document . getElementById ( armorType + "-choice" ) . addEventListener ( "change" , ( event ) => {
let item = itemMap . get ( event . target . value ) ;
if ( item !== undefined ) {
document . getElementById ( armorType + "-slots" ) . textContent = item . slots + " slots" ;
}
else {
document . getElementById ( armorType + "-slots" ) . textContent = "X slots" ;
}
} ) ;
}
let ring1 _list = document . getElementById ( "ring1-items" ) ;
let ring2 _list = document . getElementById ( "ring2-items" ) ;
for ( const ring of itemLists . get ( "ring" ) ) {
let el1 = document . createElement ( "option" ) ;
let el2 = document . createElement ( "option" ) ;
el1 . value = ring ;
el2 . value = ring ;
ring1 _list . appendChild ( el1 ) ;
ring2 _list . appendChild ( el2 ) ;
}
populateItemList ( "bracelet" ) ;
populateItemList ( "necklace" ) ;
let weapon _list = document . getElementById ( "weapon-items" ) ;
for ( const weaponType of weaponTypes ) {
for ( const weapon of itemLists . get ( weaponType ) ) {
let el = document . createElement ( "option" ) ;
el . value = weapon ;
weapon _list . appendChild ( el ) ;
}
}
2021-01-06 22:51:02 +00:00
// Add change listener to update weapon slots.
2021-01-06 12:48:41 +00:00
document . getElementById ( "weapon-choice" ) . addEventListener ( "change" , ( event ) => {
let item = itemMap . get ( event . target . value ) ;
if ( item !== undefined ) {
document . getElementById ( "weapon-slots" ) . textContent = item . slots + " slots" ;
}
else {
document . getElementById ( "weapon-slots" ) . textContent = "X slots" ;
}
} ) ;
2021-01-07 10:23:54 +00:00
populateFromURL ( ) ;
}
/ *
* Populate fields based on url , and calculate build .
* /
function populateFromURL ( ) {
if ( url _tag ) {
2021-01-09 03:53:57 +00:00
let equipment = [ null , null , null , null , null , null , null , null , null ] ;
2021-01-08 20:17:37 +00:00
let powdering = [ "" , "" , "" , "" , "" ] ;
2021-01-07 10:30:23 +00:00
let info = url _tag . split ( "_" ) ;
2021-01-07 10:23:54 +00:00
let version = info [ 0 ] ;
2021-01-09 08:52:58 +00:00
let save _skp = false ;
let skillpoints = [ 0 , 0 , 0 , 0 , 0 ] ;
if ( version === "0" || version === "1" || version === "2" ) {
2021-01-07 10:23:54 +00:00
let equipments = info [ 1 ] ;
2021-01-09 03:53:57 +00:00
for ( let i = 0 ; i < 9 ; ++ i ) {
equipment [ i ] = idMap . get ( Base64 . toInt ( equipments . slice ( i * 3 , i * 3 + 3 ) ) ) ;
}
2021-01-07 10:23:54 +00:00
}
2021-01-08 20:17:37 +00:00
if ( version === "1" ) {
let powder _info = info [ 1 ] . slice ( 27 ) ;
console . log ( powder _info ) ;
// TODO: Make this run in linear instead of quadratic time...
for ( let i = 0 ; i < 5 ; ++ i ) {
let powders = "" ;
let n _blocks = Base64 . toInt ( powder _info . charAt ( 0 ) ) ;
console . log ( n _blocks + " blocks" ) ;
powder _info = powder _info . slice ( 1 ) ;
for ( let j = 0 ; j < n _blocks ; ++ j ) {
let block = powder _info . slice ( 0 , 5 ) ;
console . log ( block ) ;
let six _powders = Base64 . toInt ( block ) ;
for ( let k = 0 ; k < 6 && six _powders != 0 ; ++ k ) {
powders += powderNames . get ( ( six _powders & 0x1f ) - 1 ) ;
six _powders >>>= 5 ;
}
powder _info = powder _info . slice ( 5 ) ;
}
powdering [ i ] = powders ;
}
}
2021-01-09 08:52:58 +00:00
if ( version === "2" ) {
save _skp = true ;
let skillpoint _info = info [ 1 ] . slice ( 27 , 37 ) ;
for ( let i = 0 ; i < 5 ; ++ i ) {
2021-01-09 09:09:47 +00:00
skillpoints [ i ] = Base64 . toIntSigned ( skillpoint _info . slice ( i * 2 , i * 2 + 2 ) ) ;
2021-01-09 08:52:58 +00:00
}
let powder _info = info [ 1 ] . slice ( 37 ) ;
console . log ( powder _info ) ;
// TODO: Make this run in linear instead of quadratic time...
for ( let i = 0 ; i < 5 ; ++ i ) {
let powders = "" ;
let n _blocks = Base64 . toInt ( powder _info . charAt ( 0 ) ) ;
console . log ( n _blocks + " blocks" ) ;
powder _info = powder _info . slice ( 1 ) ;
for ( let j = 0 ; j < n _blocks ; ++ j ) {
let block = powder _info . slice ( 0 , 5 ) ;
console . log ( block ) ;
let six _powders = Base64 . toInt ( block ) ;
for ( let k = 0 ; k < 6 && six _powders != 0 ; ++ k ) {
powders += powderNames . get ( ( six _powders & 0x1f ) - 1 ) ;
six _powders >>>= 5 ;
}
powder _info = powder _info . slice ( 5 ) ;
}
powdering [ i ] = powders ;
}
}
2021-01-07 10:23:54 +00:00
2021-01-09 03:53:57 +00:00
for ( let i in powderInputs ) {
setValue ( powderInputs [ i ] , powdering [ i ] ) ;
}
for ( let i in equipment ) {
setValue ( equipmentInputs [ i ] , equipment [ i ] ) ;
}
2021-01-09 08:52:58 +00:00
calculateBuild ( save _skp , skillpoints ) ;
2021-01-07 10:23:54 +00:00
}
}
function encodeBuild ( ) {
if ( player _build ) {
2021-01-09 08:52:58 +00:00
let build _string = "2_" + Base64 . fromIntN ( player _build . helmet . get ( "id" ) , 3 ) +
2021-01-09 00:56:07 +00:00
Base64 . fromIntN ( player _build . chestplate . get ( "id" ) , 3 ) +
Base64 . fromIntN ( player _build . leggings . get ( "id" ) , 3 ) +
Base64 . fromIntN ( player _build . boots . get ( "id" ) , 3 ) +
Base64 . fromIntN ( player _build . ring1 . get ( "id" ) , 3 ) +
Base64 . fromIntN ( player _build . ring2 . get ( "id" ) , 3 ) +
Base64 . fromIntN ( player _build . bracelet . get ( "id" ) , 3 ) +
Base64 . fromIntN ( player _build . necklace . get ( "id" ) , 3 ) +
Base64 . fromIntN ( player _build . weapon . get ( "id" ) , 3 ) ;
2021-01-07 10:23:54 +00:00
2021-01-09 08:52:58 +00:00
for ( const skp of skp _order ) {
2021-01-09 09:09:47 +00:00
build _string += Base64 . fromIntN ( getValue ( skp + "-skp" ) , 2 ) ; // Maximum skillpoints: 2048
2021-01-09 08:52:58 +00:00
}
2021-01-08 20:17:37 +00:00
for ( const _powderset of player _build . powders ) {
let n _bits = Math . ceil ( _powderset . length / 6 ) ;
build _string += Base64 . fromIntN ( n _bits , 1 ) ; // Hard cap of 378 powders.
// Slice copy.
let powderset = _powderset . slice ( ) ;
while ( powderset . length != 0 ) {
let firstSix = powderset . slice ( 0 , 6 ) . reverse ( ) ;
let powder _hash = 0 ;
for ( const powder of firstSix ) {
powder _hash = ( powder _hash << 5 ) + 1 + powder ; // LSB will be extracted first.
}
build _string += Base64 . fromIntN ( powder _hash , 5 ) ;
powderset = powderset . slice ( 6 ) ;
}
}
2021-01-07 10:23:54 +00:00
return build _string ;
}
return "" ;
2021-01-06 12:48:41 +00:00
}
2021-01-09 08:52:58 +00:00
function calculateBuild ( save _skp , skp ) {
save _skp = ( typeof save _skp !== 'undefined' ) ? save _skp : false ;
2021-01-06 23:31:35 +00:00
/ * T O D O : i m p l e m e n t l e v e l c h a n g i n g
Make this entire function prettier
* /
2021-01-09 03:53:57 +00:00
let equipment = [ null , null , null , null , null , null , null , null , null ] ;
for ( let i in equipment ) {
let equip = getValue ( equipmentInputs [ i ] ) ;
if ( equip === "" ) equip = "No " + equipment _names [ i ] ;
equipment [ i ] = equip ;
2021-01-06 23:31:35 +00:00
}
2021-01-08 20:17:37 +00:00
let powderings = [ ] ;
for ( const i in powderInputs ) {
// read in two characters at a time.
// TODO: make this more robust.
let input = getValue ( powderInputs [ i ] ) ;
let powdering = [ ] ;
while ( input ) {
let first = input . slice ( 0 , 2 ) ;
powdering . push ( powderIDs . get ( first ) ) ;
input = input . slice ( 2 ) ;
}
powderings . push ( powdering ) ;
}
2021-01-09 03:53:57 +00:00
console . log ( equipment ) ;
player _build = new Build ( 106 , equipment , powderings ) ;
2021-01-06 22:46:00 +00:00
console . log ( player _build . toString ( ) ) ;
2021-01-07 06:41:41 +00:00
2021-01-07 08:34:31 +00:00
let equip _order _text = "Equip order: <br>" ;
for ( const item of player _build . equip _order ) {
2021-01-09 00:56:07 +00:00
equip _order _text += item . get ( "displayName" ) + "<br>" ;
2021-01-07 08:34:31 +00:00
}
setHTML ( "build-order" , equip _order _text ) ;
2021-01-09 11:21:46 +00:00
const assigned = player _build . base _skillpoints ;
const skillpoints = player _build . total _skillpoints ;
for ( let i in skp _order ) { //big bren
if ( assigned [ i ] <= 100 ) {
setText ( skp _order [ i ] + "-skp-base" , "Original Value: " + skillpoints [ i ] ) ;
} else {
setHTML ( skp _order [ i ] + "-skp-base" , "Original Value: " + skillpoints [ i ] + "<br>WARNING: cannot assign " + assigned [ i ] + " skillpoints naturally." ) ;
}
}
2021-01-09 08:52:58 +00:00
if ( save _skp ) {
// TODO: reduce duplicated code, @updateStats
let skillpoints = player _build . total _skillpoints ;
let delta _total = 0 ;
for ( let i in skp _order ) {
let manual _assigned = skp [ i ] ;
let delta = manual _assigned - skillpoints [ i ] ;
skillpoints [ i ] = manual _assigned ;
player _build . base _skillpoints [ i ] += delta ;
delta _total += delta ;
}
player _build . assigned _skillpoints += delta _total ;
}
2021-01-07 08:17:53 +00:00
2021-01-09 08:52:58 +00:00
calculateBuildStats ( ) ;
}
function updateStats ( ) {
let skillpoints = player _build . total _skillpoints ;
let delta _total = 0 ;
for ( let i in skp _order ) {
let manual _assigned = getValue ( skp _order [ i ] + "-skp" ) ;
let delta = manual _assigned - skillpoints [ i ] ;
skillpoints [ i ] = manual _assigned ;
player _build . base _skillpoints [ i ] += delta ;
delta _total += delta ;
}
player _build . assigned _skillpoints += delta _total ;
calculateBuildStats ( ) ;
}
function calculateBuildStats ( ) {
2021-01-08 05:36:57 +00:00
const assigned = player _build . base _skillpoints ;
const skillpoints = player _build . total _skillpoints ;
2021-01-08 20:14:23 +00:00
let skp _effects = [ "% more damage dealt." , "% chance to crit." , "% spell cost reduction." , "% less damage taken." , "% chance to dodge." ] ;
for ( let i in skp _order ) { //big bren
2021-01-09 11:21:46 +00:00
setText ( skp _order [ i ] + "-skp-assign" , "Manually Assigned: " + assigned [ i ] ) ;
2021-01-08 20:14:23 +00:00
setValue ( skp _order [ i ] + "-skp" , skillpoints [ i ] ) ;
2021-01-08 20:21:31 +00:00
setText ( skp _order [ i ] + "-skp-pct" , ( skillPointsToPercentage ( skillpoints [ i ] ) * 100 ) . toFixed ( 1 ) . concat ( skp _effects [ i ] ) ) ;
2021-01-08 20:14:23 +00:00
}
2021-01-09 08:52:58 +00:00
2021-01-08 20:14:23 +00:00
if ( player _build . assigned _skillpoints > levelToSkillPoints ( player _build . level ) ) {
setHTML ( "summary-box" , "Summary: Assigned " + player _build . assigned _skillpoints + " skillpoints.<br>" + "WARNING: Too many skillpoints need to be assigned!<br> For level " + player _build . level + ", there are only " + levelToSkillPoints ( player _build . level ) + " skill points available." ) ;
} else {
setText ( "summary-box" , "Summary: Assigned " + player _build . assigned _skillpoints + " skillpoints." ) ;
}
2021-01-07 08:34:31 +00:00
2021-01-09 03:53:57 +00:00
for ( let i in player _build . items ) {
displayExpandedItem ( player _build . items [ i ] , buildFields [ i ] ) ;
}
2021-01-08 20:17:37 +00:00
2021-01-09 12:47:25 +00:00
displayBuildStats ( player _build , "build-overall-stats" ) ;
2021-01-09 23:30:05 +00:00
let parent _elem = document . getElementById ( "build-melee-stats" ) ;
2021-01-08 02:34:07 +00:00
let meleeStats = player _build . getMeleeStats ( ) ;
2021-01-09 23:30:05 +00:00
displayMeleeDamage ( parent _elem , meleeStats ) ;
2021-01-09 12:47:25 +00:00
//let defenseStats = "";
2021-01-08 20:14:23 +00:00
2021-01-09 12:47:25 +00:00
//setHTML("build-defense-stats", "".concat(defenseStats));
2021-01-09 08:52:58 +00:00
let spells = spell _table [ player _build . weapon . get ( "type" ) ] ;
for ( let i = 0 ; i < 4 ; ++ i ) {
let parent _elem = document . getElementById ( "spell" + i + "-info" ) ;
displaySpellDamage ( parent _elem , player _build , spells [ i ] , i + 1 ) ;
}
2021-01-07 10:23:54 +00:00
location . hash = encodeBuild ( ) ;
2021-01-07 08:11:54 +00:00
}
2021-01-08 03:15:02 +00:00
2021-01-06 20:54:15 +00:00
function resetFields ( ) {
2021-01-09 03:53:57 +00:00
for ( let i in powderInputs ) {
setValue ( powderInputs [ i ] , "" ) ;
}
2021-01-09 08:52:58 +00:00
for ( let i in equipmentInputs ) {
2021-01-09 03:53:57 +00:00
setValue ( equipmentInputs [ i ] , "" ) ;
}
2021-01-07 10:23:54 +00:00
setValue ( "str-skp" , "0" ) ;
setValue ( "dex-skp" , "0" ) ;
setValue ( "int-skp" , "0" ) ;
setValue ( "def-skp" , "0" ) ;
setValue ( "agi-skp" , "0" ) ;
2021-01-08 01:16:06 +00:00
location . hash = "" ;
2021-01-06 22:46:00 +00:00
}
2021-01-07 00:08:19 +00:00
load _init ( init ) ;
2021-01-08 01:16:06 +00:00