From e854e74c26731460967321acf93b8f5e5236955c Mon Sep 17 00:00:00 2001 From: Telethar Date: Thu, 21 Jul 2022 15:35:07 -0700 Subject: [PATCH 1/7] show small keys as green when all have been collected --- js/items.js | 127 +++++++++++++++++++++------------------------------- js/track.js | 12 ++++- 2 files changed, 61 insertions(+), 78 deletions(-) diff --git a/js/items.js b/js/items.js index edf83d41..ea4d1906 100644 --- a/js/items.js +++ b/js/items.js @@ -88,6 +88,41 @@ var maxchests10 = flags.doorshuffle === 'C' ? 32 : chests10; var maxchests11 = flags.doorshuffle === 'C' ? 32 : chests11; var maxchests12 = flags.doorshuffle === 'C' ? 32 : chests12; + var range = { + tunic: { min: 1, max: 3 }, + sword: { min: 0, max: 4 }, + shield: { min: 0, max: 3 }, + bottle: { min: 0, max: 4 }, + bow: { min: 0, max: 3 }, + boomerang: { min: 0, max: 3 }, + glove: { min: 0, max: 2 }, + smallkey0: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 0 }, + smallkey1: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, + smallkey2: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, + smallkey3: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 6 }, + smallkey4: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, + smallkey5: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 3 }, + smallkey6: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, + smallkey7: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 2 }, + smallkey8: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 3 }, + smallkey9: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 4 }, + smallkey10: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 4 }, + smallkeyhalf0: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, + smallkeyhalf1: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 2 }, + chest0: { min: 0, max: maxchests0 }, + chest1: { min: 0, max: maxchests1 }, + chest2: { min: 0, max: maxchests2 }, + chest3: { min: 0, max: maxchests3 }, + chest4: { min: 0, max: maxchests4 }, + chest5: { min: 0, max: maxchests5 }, + chest6: { min: 0, max: maxchests6 }, + chest7: { min: 0, max: maxchests7 }, + chest8: { min: 0, max: maxchests8 }, + chest9: { min: 0, max: maxchests9 }, + chest10: { min: 0, max: maxchests10 }, + chest11: { min: 0, max: maxchests11 }, + chest12: { min: 0, max: maxchests12 } + }; window.items = { tunic: 1, @@ -196,83 +231,23 @@ bigkeyhalf0: !flags.wildbigkeys, bigkeyhalf1: !flags.wildbigkeys, - smallkey0: (flags.wildkeys ? 0 : 0), - smallkey1: (flags.wildkeys ? 0 : 1), - smallkey2: (flags.wildkeys ? 0 : 1), - smallkey3: (flags.wildkeys ? 0 : 6), - smallkey4: (flags.wildkeys ? 0 : 1), - smallkey5: (flags.wildkeys ? 0 : 3), - smallkey6: (flags.wildkeys ? 0 : 1), - smallkey7: (flags.wildkeys ? 0 : 2), - smallkey8: (flags.wildkeys ? 0 : 3), - smallkey9: (flags.wildkeys ? 0 : 4), - smallkey10: (flags.wildkeys ? 0 : 4), - smallkeyhalf0: (flags.wildkeys ? 0 : 1), - smallkeyhalf1: (flags.wildkeys ? 0 : 2), + smallkey0: (flags.wildkeys ? 0 : range['smallkey0'].max), + smallkey1: (flags.wildkeys ? 0 : range['smallkey1'].max), + smallkey2: (flags.wildkeys ? 0 : range['smallkey2'].max), + smallkey3: (flags.wildkeys ? 0 : range['smallkey3'].max), + smallkey4: (flags.wildkeys ? 0 : range['smallkey4'].max), + smallkey5: (flags.wildkeys ? 0 : range['smallkey5'].max), + smallkey6: (flags.wildkeys ? 0 : range['smallkey6'].max), + smallkey7: (flags.wildkeys ? 0 : range['smallkey7'].max), + smallkey8: (flags.wildkeys ? 0 : range['smallkey8'].max), + smallkey9: (flags.wildkeys ? 0 : range['smallkey9'].max), + smallkey10: (flags.wildkeys ? 0 : range['smallkey10'].max), + smallkeyhalf0: (flags.wildkeys ? 0 : range['smallkeyhalf0'].max), + smallkeyhalf1: (flags.wildkeys ? 0 : range['smallkeyhalf1'].max), - inc: limit(1, { - tunic: { min: 1, max: 3 }, - sword: { max: 4 }, - shield: { max: 3 }, - bottle: { max: 4 }, - bow: { max: 3 }, - boomerang: { max: 3 }, - glove: { max: 2 }, - smallkey0: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 0 }, - smallkey1: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey2: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey3: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 6 }, - smallkey4: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey5: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 3 }, - smallkey6: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey7: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 2 }, - smallkey8: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 3 }, - smallkey9: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 4 }, - smallkey10: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 4 }, - smallkeyhalf0: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkeyhalf1: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 2 }, - chest0: { min: 0, max: maxchests0 }, - chest1: { min: 0, max: maxchests1 }, - chest2: { min: 0, max: maxchests2 }, - chest3: { min: 0, max: maxchests3 }, - chest4: { min: 0, max: maxchests4 }, - chest5: { min: 0, max: maxchests5 }, - chest6: { min: 0, max: maxchests6 }, - chest7: { min: 0, max: maxchests7 }, - chest8: { min: 0, max: maxchests8 }, - chest9: { min: 0, max: maxchests9 }, - chest10: { min: 0, max: maxchests10 }, - chest11: { min: 0, max: maxchests11 }, - chest12: { min: 0, max: maxchests12 } - }), - dec: limit(-1, { - chest0: { max: maxchests0 }, - chest1: { max: maxchests1 }, - chest2: { max: maxchests2 }, - chest3: { max: maxchests3 }, - chest4: { max: maxchests4 }, - chest5: { max: maxchests5 }, - chest6: { max: maxchests6 }, - chest7: { max: maxchests7 }, - chest8: { max: maxchests8 }, - chest9: { max: maxchests9 }, - chest10: { max: maxchests10 }, - chest11: { max: maxchests11 }, - chest12: { max: maxchests12 }, - smallkey0: { max: flags.doorshuffle === 'C' ? 29 : 0 }, - smallkey1: { max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey2: { max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey3: { max: flags.doorshuffle === 'C' ? 29 : 6 }, - smallkey4: { max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey5: { max: flags.doorshuffle === 'C' ? 29 : 3 }, - smallkey6: { max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey7: { max: flags.doorshuffle === 'C' ? 29 : 2 }, - smallkey8: { max: flags.doorshuffle === 'C' ? 29 : 3 }, - smallkey9: { max: flags.doorshuffle === 'C' ? 29 : 4 }, - smallkey10: { max: flags.doorshuffle === 'C' ? 29 : 4 }, - smallkeyhalf0: { max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkeyhalf1: { max: flags.doorshuffle === 'C' ? 29 : 2 } - }) + range: range, + inc: limit(1, range), + dec: limit(-1, range) }; function limit(delta, limits) { diff --git a/js/track.js b/js/track.js index fbeb3b53..c83f67ae 100644 --- a/js/track.js +++ b/js/track.js @@ -1027,21 +1027,25 @@ if (label.substring(0,12) === 'smallkeyhalf') { if (flags.gametype != 'R') { var value = items.inc(label); + document.getElementById(label).style.color = (value === items.range[label].max) ? "green" : "white"; document.getElementById(label).innerHTML = value; skipkey = true; } else { var value = items.dec(label); + document.getElementById(label).style.color = (value === items.range[label].max) ? "green" : "white"; document.getElementById(label).innerHTML = value; skipkey = true; } } - if (label.substring(0,8) === 'smallkey' && label.substring(0,12) != 'smallkeyhalf') { + else if (label.substring(0,8) === 'smallkey') { if (flags.gametype != 'R') { var value = items.inc(label); + document.getElementById(label).style.color = (value === items.range[label].max) ? "green" : "white"; document.getElementById(label).innerHTML = value; skipkey = true; } else { var value = items.dec(label); + document.getElementById(label).style.color = (value === items.range[label].max) ? "green" : "white"; document.getElementById(label).innerHTML = value; skipkey = true; } @@ -1395,18 +1399,22 @@ if (label.substring(0,12) === 'smallkeyhalf') { if (flags.gametype != 'R') { var value = items.dec(label); + document.getElementById(label).style.color = (value === items.range[label].max) ? "green" : "white"; document.getElementById(label).innerHTML = value; } else { var value = items.inc(label); + document.getElementById(label).style.color = (value === items.range[label].max) ? "green" : "white"; document.getElementById(label).innerHTML = value; } } - if (label.substring(0,8) === 'smallkey' && label.substring(0,12) != 'smallkeyhalf') { + else if (label.substring(0,8) === 'smallkey') { if (flags.gametype != 'R') { var value = items.dec(label); + document.getElementById(label).style.color = (value === items.range[label].max) ? "green" : "white"; document.getElementById(label).innerHTML = value; } else { var value = items.inc(label); + document.getElementById(label).style.color = (value === items.range[label].max) ? "green" : "white"; document.getElementById(label).innerHTML = value; } } From 2c575a2b93ee4c34fd8e6d34b4effb59491c42d6 Mon Sep 17 00:00:00 2001 From: Telethar Date: Thu, 21 Jul 2022 15:40:01 -0700 Subject: [PATCH 2/7] tabs or spaces --- js/items.js | 248 ++++++++++++++++++++++++++-------------------------- 1 file changed, 124 insertions(+), 124 deletions(-) diff --git a/js/items.js b/js/items.js index ea4d1906..c4739790 100644 --- a/js/items.js +++ b/js/items.js @@ -2,24 +2,24 @@ 'use strict'; var query = uri_query(); - - window.flags = { + + window.flags = { gametype: query.f.charAt(0), entrancemode: query.f.charAt(1), - doorshuffle: query.f.charAt(2), - overworldshuffle: query.f.charAt(3), + doorshuffle: query.f.charAt(2), + overworldshuffle: query.f.charAt(3), bossshuffle: query.f.charAt(4), enemyshuffle: query.f.charAt(5), - unknown: query.f.charAt(6), + unknown: query.f.charAt(6), glitches: query.f.charAt(7), - wildmaps: (query.f.charAt(8) === '1' ? true : false), - wildcompasses: (query.f.charAt(9) === '1' ? true : false), - wildkeys: (query.f.charAt(10) === '1' ? true : false), - wildbigkeys: (query.f.charAt(11) === '1' ? true : false), - shopsanity: query.f.charAt(12), - ambrosia: query.f.charAt(13), - nonprogressivebows: (query.f.charAt(14) === 'Y' ? true : false), - activatedflute: (query.f.charAt(15) === 'Y' ? true : false), + wildmaps: (query.f.charAt(8) === '1' ? true : false), + wildcompasses: (query.f.charAt(9) === '1' ? true : false), + wildkeys: (query.f.charAt(10) === '1' ? true : false), + wildbigkeys: (query.f.charAt(11) === '1' ? true : false), + shopsanity: query.f.charAt(12), + ambrosia: query.f.charAt(13), + nonprogressivebows: (query.f.charAt(14) === 'Y' ? true : false), + activatedflute: (query.f.charAt(15) === 'Y' ? true : false), goals: query.f.charAt(16), opentower: query.f.charAt(17), opentowercount: query.f.charAt(18), @@ -29,52 +29,52 @@ mapmode: query.d.charAt(0), spoilermode: query.d.charAt(1), spheresmode: query.d.charAt(2), - autotracking: query.d.charAt(3), - trackingport: query.d.charAt(4) + query.d.charAt(5) + query.d.charAt(6) + query.d.charAt(7), - restreamingcode: query.d.charAt(8) + query.d.charAt(9) + query.d.charAt(10) + query.d.charAt(11) + query.d.charAt(12) + query.d.charAt(13), - restreamer: query.d.charAt(14), - restreamdelay: query.d.charAt(15), - startingitems: query.s, + autotracking: query.d.charAt(3), + trackingport: query.d.charAt(4) + query.d.charAt(5) + query.d.charAt(6) + query.d.charAt(7), + restreamingcode: query.d.charAt(8) + query.d.charAt(9) + query.d.charAt(10) + query.d.charAt(11) + query.d.charAt(12) + query.d.charAt(13), + restreamer: query.d.charAt(14), + restreamdelay: query.d.charAt(15), + startingitems: query.s, sprite: query.p.replace('#','').replace('!',''), }; - - window.maptype = query.map; - - window.startingitems = query.starting; - - var chestmod = 0; - - if (flags.wildmaps) { - chestmod++; - } - - if (flags.wildcompasses) { - chestmod++; - } - - var chestmodcrossed = chestmod; - - if (flags.wildbigkeys) { - chestmod++; - if (flags.wildkeys || flags.gametype === 'R') { - chestmodcrossed++; - } - } - - var chests0 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 3 + chestmod; - var chests1 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 2 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 1 : 0); - var chests2 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 2 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 1 : 0); - var chests3 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 5 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 6 : 0); - var chests4 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 6 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 1 : 0); - var chests5 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 2 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 3 : 0); - var chests6 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 4 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 1 : 0); - var chests7 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 3 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 2 : 0); - var chests8 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 2 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 3 : 0); - var chests9 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 5 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 4 : 0); - var chests10 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 20 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 4 : 0); - var chests11 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 6 + (flags.wildmaps ? 1 : 0) + ((flags.wildkeys || flags.gametype === 'R') ? 1 : 0); - var chests12 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : ((flags.wildkeys || flags.gametype === 'R') ? 2 : 0); - + + window.maptype = query.map; + + window.startingitems = query.starting; + + var chestmod = 0; + + if (flags.wildmaps) { + chestmod++; + } + + if (flags.wildcompasses) { + chestmod++; + } + + var chestmodcrossed = chestmod; + + if (flags.wildbigkeys) { + chestmod++; + if (flags.wildkeys || flags.gametype === 'R') { + chestmodcrossed++; + } + } + + var chests0 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 3 + chestmod; + var chests1 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 2 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 1 : 0); + var chests2 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 2 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 1 : 0); + var chests3 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 5 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 6 : 0); + var chests4 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 6 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 1 : 0); + var chests5 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 2 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 3 : 0); + var chests6 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 4 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 1 : 0); + var chests7 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 3 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 2 : 0); + var chests8 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 2 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 3 : 0); + var chests9 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 5 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 4 : 0); + var chests10 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 20 + chestmod + ((flags.wildkeys || flags.gametype === 'R') ? 4 : 0); + var chests11 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : 6 + (flags.wildmaps ? 1 : 0) + ((flags.wildkeys || flags.gametype === 'R') ? 1 : 0); + var chests12 = flags.doorshuffle === 'C' ? 3 + chestmodcrossed : ((flags.wildkeys || flags.gametype === 'R') ? 2 : 0); + var maxchests0 = flags.doorshuffle === 'C' ? 32 : chests0; var maxchests1 = flags.doorshuffle === 'C' ? 32 : chests1; var maxchests2 = flags.doorshuffle === 'C' ? 32 : chests2; @@ -88,42 +88,42 @@ var maxchests10 = flags.doorshuffle === 'C' ? 32 : chests10; var maxchests11 = flags.doorshuffle === 'C' ? 32 : chests11; var maxchests12 = flags.doorshuffle === 'C' ? 32 : chests12; - var range = { - tunic: { min: 1, max: 3 }, - sword: { min: 0, max: 4 }, - shield: { min: 0, max: 3 }, - bottle: { min: 0, max: 4 }, - bow: { min: 0, max: 3 }, - boomerang: { min: 0, max: 3 }, - glove: { min: 0, max: 2 }, - smallkey0: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 0 }, - smallkey1: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey2: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey3: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 6 }, - smallkey4: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey5: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 3 }, - smallkey6: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey7: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 2 }, - smallkey8: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 3 }, - smallkey9: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 4 }, - smallkey10: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 4 }, - smallkeyhalf0: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkeyhalf1: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 2 }, - chest0: { min: 0, max: maxchests0 }, - chest1: { min: 0, max: maxchests1 }, - chest2: { min: 0, max: maxchests2 }, - chest3: { min: 0, max: maxchests3 }, - chest4: { min: 0, max: maxchests4 }, - chest5: { min: 0, max: maxchests5 }, - chest6: { min: 0, max: maxchests6 }, - chest7: { min: 0, max: maxchests7 }, - chest8: { min: 0, max: maxchests8 }, - chest9: { min: 0, max: maxchests9 }, - chest10: { min: 0, max: maxchests10 }, - chest11: { min: 0, max: maxchests11 }, - chest12: { min: 0, max: maxchests12 } - }; - + var range = { + tunic: { min: 1, max: 3 }, + sword: { min: 0, max: 4 }, + shield: { min: 0, max: 3 }, + bottle: { min: 0, max: 4 }, + bow: { min: 0, max: 3 }, + boomerang: { min: 0, max: 3 }, + glove: { min: 0, max: 2 }, + smallkey0: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 0 }, + smallkey1: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, + smallkey2: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, + smallkey3: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 6 }, + smallkey4: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, + smallkey5: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 3 }, + smallkey6: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, + smallkey7: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 2 }, + smallkey8: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 3 }, + smallkey9: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 4 }, + smallkey10: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 4 }, + smallkeyhalf0: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, + smallkeyhalf1: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 2 }, + chest0: { min: 0, max: maxchests0 }, + chest1: { min: 0, max: maxchests1 }, + chest2: { min: 0, max: maxchests2 }, + chest3: { min: 0, max: maxchests3 }, + chest4: { min: 0, max: maxchests4 }, + chest5: { min: 0, max: maxchests5 }, + chest6: { min: 0, max: maxchests6 }, + chest7: { min: 0, max: maxchests7 }, + chest8: { min: 0, max: maxchests8 }, + chest9: { min: 0, max: maxchests9 }, + chest10: { min: 0, max: maxchests10 }, + chest11: { min: 0, max: maxchests11 }, + chest12: { min: 0, max: maxchests12 } + }; + window.items = { tunic: 1, sword: 0, @@ -160,9 +160,9 @@ flute: false, agahnim: false, agahnim2: false, - bomb: false, - magic: false, - bombfloor: false, + bomb: false, + magic: false, + bombfloor: false, boss0: false, boss1: false, @@ -174,7 +174,7 @@ boss7: false, boss8: false, boss9: false, - + chest0: chests0, chest1: chests1, chest2: chests2, @@ -185,10 +185,10 @@ chest7: chests7, chest8: chests8, chest9: chests9, - chest10: chests10, - chest11: chests11, - chest12: chests12, - + chest10: chests10, + chest11: chests11, + chest12: chests12, + maxchest0: maxchests0, maxchest1: maxchests1, maxchest2: maxchests2, @@ -199,9 +199,9 @@ maxchest7: maxchests7, maxchest8: maxchests8, maxchest9: maxchests9, - maxchest10: maxchests10, - maxchest11: maxchests11, - maxchest12: maxchests12, + maxchest10: maxchests10, + maxchest11: maxchests11, + maxchest12: maxchests12, chestknown0: false, chestknown1: false, @@ -217,20 +217,20 @@ chestknown11: false, chestknown12: false, - bigkey0: !flags.wildbigkeys, - bigkey1: !flags.wildbigkeys, - bigkey2: !flags.wildbigkeys, - bigkey3: !flags.wildbigkeys, - bigkey4: !flags.wildbigkeys, - bigkey5: !flags.wildbigkeys, - bigkey6: !flags.wildbigkeys, - bigkey7: !flags.wildbigkeys, - bigkey8: !flags.wildbigkeys, - bigkey9: !flags.wildbigkeys, - bigkey10: !flags.wildbigkeys, - bigkeyhalf0: !flags.wildbigkeys, - bigkeyhalf1: !flags.wildbigkeys, - + bigkey0: !flags.wildbigkeys, + bigkey1: !flags.wildbigkeys, + bigkey2: !flags.wildbigkeys, + bigkey3: !flags.wildbigkeys, + bigkey4: !flags.wildbigkeys, + bigkey5: !flags.wildbigkeys, + bigkey6: !flags.wildbigkeys, + bigkey7: !flags.wildbigkeys, + bigkey8: !flags.wildbigkeys, + bigkey9: !flags.wildbigkeys, + bigkey10: !flags.wildbigkeys, + bigkeyhalf0: !flags.wildbigkeys, + bigkeyhalf1: !flags.wildbigkeys, + smallkey0: (flags.wildkeys ? 0 : range['smallkey0'].max), smallkey1: (flags.wildkeys ? 0 : range['smallkey1'].max), smallkey2: (flags.wildkeys ? 0 : range['smallkey2'].max), @@ -241,15 +241,15 @@ smallkey7: (flags.wildkeys ? 0 : range['smallkey7'].max), smallkey8: (flags.wildkeys ? 0 : range['smallkey8'].max), smallkey9: (flags.wildkeys ? 0 : range['smallkey9'].max), - smallkey10: (flags.wildkeys ? 0 : range['smallkey10'].max), - smallkeyhalf0: (flags.wildkeys ? 0 : range['smallkeyhalf0'].max), - smallkeyhalf1: (flags.wildkeys ? 0 : range['smallkeyhalf1'].max), - - range: range, + smallkey10: (flags.wildkeys ? 0 : range['smallkey10'].max), + smallkeyhalf0: (flags.wildkeys ? 0 : range['smallkeyhalf0'].max), + smallkeyhalf1: (flags.wildkeys ? 0 : range['smallkeyhalf1'].max), + + range: range, inc: limit(1, range), dec: limit(-1, range) }; - + function limit(delta, limits) { return function(item) { var value = items[item], From cdf6ec317dc6f748ee00be809d90799f6b1caffc Mon Sep 17 00:00:00 2001 From: Telethar Date: Mon, 25 Jul 2022 13:51:35 -0700 Subject: [PATCH 3/7] Update autotracking to also set keys to green. --- js/autot.js | 10 ++++---- js/track.js | 66 ++--------------------------------------------------- 2 files changed, 8 insertions(+), 68 deletions(-) diff --git a/js/autot.js b/js/autot.js index 75f8096a..677931bc 100644 --- a/js/autot.js +++ b/js/autot.js @@ -290,10 +290,12 @@ function autotrackDoTracking(data) { function updatesmallkeys(dungeon, offset) { if (changed(offset)) { - var newkeys = autotrackPrevData === null ? data[offset] : (data[offset] - autotrackPrevData[offset] + items["smallkey" + dungeon]); - if (newkeys > items["smallkey" + dungeon]) { - document.getElementById("smallkey" + dungeon).innerHTML = newkeys; - items["smallkey" + dungeon] = newkeys; + var label = "smallkey" + dungeon; + var newkeys = autotrackPrevData === null ? data[offset] : (data[offset] - autotrackPrevData[offset] + items[label]); + if (newkeys > items[label]) { + document.getElementById(label).style.color = (newkeys === items.range[label].max) ? "green" : "white"; + document.getElementById(label).innerHTML = newkeys; + items[label] = newkeys; updateMapTracker(); } } diff --git a/js/track.js b/js/track.js index c83f67ae..2418888d 100644 --- a/js/track.js +++ b/js/track.js @@ -2599,70 +2599,8 @@ } } - items.inc = limit(1, { - tunic: { min: 1, max: 3 }, - sword: { max: 4 }, - shield: { max: 3 }, - bottle: { max: 4 }, - bow: { max: 3 }, - boomerang: { max: 3 }, - glove: { max: 2 }, - smallkey0: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 0 }, - smallkey1: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 1 }, - smallkey2: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 1 }, - smallkey3: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 6 }, - smallkey4: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 1 }, - smallkey5: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 3 }, - smallkey6: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 1 }, - smallkey7: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 2 }, - smallkey8: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 3 }, - smallkey9: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 4 }, - smallkey10: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 4 }, - smallkeyhalf0: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 1 }, - smallkeyhalf1: { min: 0, max: document.getElementById('doorselect').value === 'C' ? 29 : 2 }, - chest0: { min: 0, max: maxchests0 }, - chest1: { min: 0, max: maxchests1 }, - chest2: { min: 0, max: maxchests2 }, - chest3: { min: 0, max: maxchests3 }, - chest4: { min: 0, max: maxchests4 }, - chest5: { min: 0, max: maxchests5 }, - chest6: { min: 0, max: maxchests6 }, - chest7: { min: 0, max: maxchests7 }, - chest8: { min: 0, max: maxchests8 }, - chest9: { min: 0, max: maxchests9 }, - chest10: { min: 0, max: maxchests10 }, - chest11: { min: 0, max: maxchests11 }, - chest12: { min: 0, max: maxchests12 } - }); - - items.dec = limit(-1, { - chest0: { max: maxchests0 }, - chest1: { max: maxchests1 }, - chest2: { max: maxchests2 }, - chest3: { max: maxchests3 }, - chest4: { max: maxchests4 }, - chest5: { max: maxchests5 }, - chest6: { max: maxchests6 }, - chest7: { max: maxchests7 }, - chest8: { max: maxchests8 }, - chest9: { max: maxchests9 }, - chest10: { max: maxchests10 }, - chest11: { max: maxchests11 }, - chest12: { max: maxchests12 }, - smallkey0: { max: document.getElementById('doorselect').value === 'C' ? 29 : 0 }, - smallkey1: { max: document.getElementById('doorselect').value === 'C' ? 29 : 1 }, - smallkey2: { max: document.getElementById('doorselect').value === 'C' ? 29 : 1 }, - smallkey3: { max: document.getElementById('doorselect').value === 'C' ? 29 : 6 }, - smallkey4: { max: document.getElementById('doorselect').value === 'C' ? 29 : 1 }, - smallkey5: { max: document.getElementById('doorselect').value === 'C' ? 29 : 3 }, - smallkey6: { max: document.getElementById('doorselect').value === 'C' ? 29 : 1 }, - smallkey7: { max: document.getElementById('doorselect').value === 'C' ? 29 : 2 }, - smallkey8: { max: document.getElementById('doorselect').value === 'C' ? 29 : 3 }, - smallkey9: { max: document.getElementById('doorselect').value === 'C' ? 29 : 4 }, - smallkey10: { max: document.getElementById('doorselect').value === 'C' ? 29 : 4 }, - smallkeyhalf0: { max: document.getElementById('doorselect').value === 'C' ? 29 : 1 }, - smallkeyhalf1: { max: document.getElementById('doorselect').value === 'C' ? 29 : 2 } - }); + items.inc = limit(1, items.range); + items.dec = limit(-1, items.range); flags.doorshuffle = document.getElementById('doorselect').value; From 45444946c1f2df5847c8b33bc79e7152e5c75014 Mon Sep 17 00:00:00 2001 From: Telethar Date: Mon, 25 Jul 2022 13:54:22 -0700 Subject: [PATCH 4/7] tabs or spaces... again --- js/autot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/autot.js b/js/autot.js index 677931bc..d8c0c5b3 100644 --- a/js/autot.js +++ b/js/autot.js @@ -290,10 +290,10 @@ function autotrackDoTracking(data) { function updatesmallkeys(dungeon, offset) { if (changed(offset)) { - var label = "smallkey" + dungeon; + var label = "smallkey" + dungeon; var newkeys = autotrackPrevData === null ? data[offset] : (data[offset] - autotrackPrevData[offset] + items[label]); if (newkeys > items[label]) { - document.getElementById(label).style.color = (newkeys === items.range[label].max) ? "green" : "white"; + document.getElementById(label).style.color = (newkeys === items.range[label].max) ? "green" : "white"; document.getElementById(label).innerHTML = newkeys; items[label] = newkeys; updateMapTracker(); From 519887936d8bc0da0b9907356dd695c67d20380e Mon Sep 17 00:00:00 2001 From: Telethar Date: Mon, 25 Jul 2022 13:56:18 -0700 Subject: [PATCH 5/7] fix formatting --- js/autot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/autot.js b/js/autot.js index d8c0c5b3..060b6586 100644 --- a/js/autot.js +++ b/js/autot.js @@ -290,7 +290,7 @@ function autotrackDoTracking(data) { function updatesmallkeys(dungeon, offset) { if (changed(offset)) { - var label = "smallkey" + dungeon; + var label = "smallkey" + dungeon; var newkeys = autotrackPrevData === null ? data[offset] : (data[offset] - autotrackPrevData[offset] + items[label]); if (newkeys > items[label]) { document.getElementById(label).style.color = (newkeys === items.range[label].max) ? "green" : "white"; From ff0f656f36e1835aebf4de4644c471b80981566e Mon Sep 17 00:00:00 2001 From: Telethar Date: Fri, 20 Jan 2023 20:36:21 -0800 Subject: [PATCH 6/7] add pot+drop keys --- dungeontracker.html | 1 + index.html | 4 ++++ js/items.js | 48 +++++++++++++++++++++++++++++++++------------ 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/dungeontracker.html b/dungeontracker.html index 561a9ef5..e42b2575 100644 --- a/dungeontracker.html +++ b/dungeontracker.html @@ -215,6 +215,7 @@

Door Shuffle:

+ diff --git a/index.html b/index.html index 8b09806f..0c0c2686 100644 --- a/index.html +++ b/index.html @@ -207,6 +207,10 @@ + + + +
diff --git a/js/items.js b/js/items.js index c4739790..379ceb43 100644 --- a/js/items.js +++ b/js/items.js @@ -88,6 +88,28 @@ var maxchests10 = flags.doorshuffle === 'C' ? 32 : chests10; var maxchests11 = flags.doorshuffle === 'C' ? 32 : chests11; var maxchests12 = flags.doorshuffle === 'C' ? 32 : chests12; + + var dungeonKeys = { + ep: { chests: 0, pots: 2}, + dp: { chests: 1, pots: 3}, + th: { chests: 1, pots: 0}, + pd: { chests: 6, pots: 0}, + sp: { chests: 1, pots: 5}, + sw: { chests: 3, pots: 2}, + tt: { chests: 1, pots: 2}, + ip: { chests: 2, pots: 4}, + mm: { chests: 3, pots: 3}, + tr: { chests: 4, pots: 2}, + gt: { chests: 4, pots: 4}, + hc: { chests: 1, pots: 3}, + at: { chests: 2, pots: 2}, + }; + + var keyCount = function(dungeonKeyInfo) { + if (flags.doorshuffle === 'C') { return 29; } + return dungeonKeyInfo.chests + (flags.doorshuffle === 'P' ? dungeonKeyInfo.pots : 0); + } + var range = { tunic: { min: 1, max: 3 }, sword: { min: 0, max: 4 }, @@ -96,19 +118,19 @@ bow: { min: 0, max: 3 }, boomerang: { min: 0, max: 3 }, glove: { min: 0, max: 2 }, - smallkey0: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 0 }, - smallkey1: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey2: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey3: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 6 }, - smallkey4: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey5: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 3 }, - smallkey6: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkey7: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 2 }, - smallkey8: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 3 }, - smallkey9: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 4 }, - smallkey10: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 4 }, - smallkeyhalf0: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 1 }, - smallkeyhalf1: { min: 0, max: flags.doorshuffle === 'C' ? 29 : 2 }, + smallkey0: { min: 0, max: keyCount(dungeonKeys.ep) }, + smallkey1: { min: 0, max: keyCount(dungeonKeys.dp) }, + smallkey2: { min: 0, max: keyCount(dungeonKeys.th) }, + smallkey3: { min: 0, max: keyCount(dungeonKeys.pd) }, + smallkey4: { min: 0, max: keyCount(dungeonKeys.sp) }, + smallkey5: { min: 0, max: keyCount(dungeonKeys.sw) }, + smallkey6: { min: 0, max: keyCount(dungeonKeys.tt) }, + smallkey7: { min: 0, max: keyCount(dungeonKeys.ip) }, + smallkey8: { min: 0, max: keyCount(dungeonKeys.mm) }, + smallkey9: { min: 0, max: keyCount(dungeonKeys.tr) }, + smallkey10: { min: 0, max: keyCount(dungeonKeys.gt) }, + smallkeyhalf0: { min: 0, max: keyCount(dungeonKeys.hc) }, + smallkeyhalf1: { min: 0, max: keyCount(dungeonKeys.at) }, chest0: { min: 0, max: maxchests0 }, chest1: { min: 0, max: maxchests1 }, chest2: { min: 0, max: maxchests2 }, From 40a6d896eb6529fd045aaee25a84a6fc5e0e0b8a Mon Sep 17 00:00:00 2001 From: Telethar Date: Wed, 15 Feb 2023 14:16:24 -0800 Subject: [PATCH 7/7] Update Mystery Page with weights --- js/track.js | 167 +++++++++++++++++++++++++++++++++++++++++++++++++++ tracker.html | 111 ++++++++++++++++++++++++++++++---- 2 files changed, 266 insertions(+), 12 deletions(-) diff --git a/js/track.js b/js/track.js index 2c417f7e..5f7bd162 100644 --- a/js/track.js +++ b/js/track.js @@ -2627,6 +2627,172 @@ $('#flagsModal').hide(); } + window.updateMysteryPointTotal = function() { + var worldstate = 0; + switch (document.getElementById("stateselect").value) { + case "O": + case "S": + worldstate = 0; + break; + case "I": + case "R": + worldstate = 20 + break; + } + + var goal = 0; + switch (document.getElementById('goalselect').value) { + case 'G': + case 'F': + goal = 0; + break; + case 'A': + case 'P': + goal = 10; + break; + case 'O': + goal = 20; + break; + } + + var swords = 0; + switch (document.getElementById('swordselect').value) { + case "R": + case "A": + swords = 0; + break; + case "V": + swords = 10; + break; + case "S": + swords = 20; + break; + } + + var itempool = 0; + switch (document.getElementById('itempoolselect').value) { + case "N": + itempool = 0; + break; + case "H": + itempool = 20; + break; + case "E": + itempool = 30; + break; + } + + var accessibility = 0; + switch (document.getElementById('accessibilityselect').value) { + case "100": + accessibility = 0; + break; + case "B": + accessibility = 10; + break; + } + + var opentower = 0; + switch (flags.opentowercount) { + case 0: + case 1: + opentower = 20; + break; + case 2: + case 3: + case 4: + opentower = 10; + break; + default: + opentower = 0; + break; + } + + var ganonvuln = 0; + switch (flags.ganonvulncount) { + case 3: + case 4: + ganonvuln = 10; + break; + default: + ganonvuln = 0; + break; + } + + var hints = 0; + switch (document.getElementById('hintselect').value) { + case "Y": + hints = 10; + break; + case "N": + hints = 0; + break; + } + + var bossshuffle = 0; + switch (document.getElementById('bossselect').value) { + case "N": + bossshuffle = 0; + break; + case "S": + bossshuffle = 20; + break; + case "R": + bossshuffle = 30; + break; + } + + var enemyshuffle = 0; + switch (document.getElementById('enemyselect').value) { + case "N": + enemyshuffle = 0; + break; + case "S": + enemyshuffle = 20; + break; + } + + var enemydamage = 0; + switch (document.getElementById('enemydamageselect').value) { + case "N": + enemydamage = 0; + break; + case "S": + enemydamage = 30; + break; + } + + var enemyhealth = 0; + switch (document.getElementById('enemyhealthselect').value) { + case "N": + enemyhealth = 0; + break; + case "E": + enemyhealth = 20; + break; + case "H": + enemyhealth = 30; + break; + } + + var dungeonitems = 0; + dungeonitems += (document.getElementById('shuffledmaps').checked) ? 10 : 0; + dungeonitems += (document.getElementById('shuffledcompasses').checked) ? 10 : 0; + dungeonitems += (document.getElementById('shuffledkeys').checked) ? 10 : 0; + dungeonitems += (document.getElementById('shuffledbigkeys').checked) ? 10 : 0; + + var startingitems = 0; + startingitems += (document.getElementById('starthookshot').checked) ? 20 : 0; + startingitems += (document.getElementById('startfirerod').checked) ? 20 : 0; + startingitems += (document.getElementById('starticerod').checked) ? 20 : 0; + startingitems += (document.getElementById('startflippers').checked) ? 20 : 0; + startingitems += (document.getElementById('startflute').checked) ? 20 : 0; + startingitems += (document.getElementById('startmirror').checked) ? 20 : 0; + startingitems += (document.getElementById('startboots').checked) ? 0 : 20; + + document.getElementById("mysterypointtotal").innerHTML = (worldstate + goal + swords + itempool + accessibility + opentower + ganonvuln + hints + bossshuffle + enemyshuffle + enemydamage + enemyhealth + dungeonitems + startingitems); + } + window.adjustFlags = function() { //Clean up states and variables before we start click_map(); @@ -3199,6 +3365,7 @@ } } + updateMysteryPointTotal(); $('#flagsModal').hide(); } diff --git a/tracker.html b/tracker.html index 984f22b0..898063ac 100644 --- a/tracker.html +++ b/tracker.html @@ -1174,21 +1174,21 @@

Load Spoiler Log

-