X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fhelpers%2Ftracker.js;h=8b210d2632f266c94e629d204ec2715436badfe9;hb=6a65eac02f94f00fdd2d56ad8feddf5d9476aa1e;hp=4f44d3c50d3b4fac23f28a157fe5f662004fd4e9;hpb=69d9cc4f72b11616642a364827c096ed80e666c7;p=alttp.git diff --git a/resources/js/helpers/tracker.js b/resources/js/helpers/tracker.js index 4f44d3c..8b210d2 100644 --- a/resources/js/helpers/tracker.js +++ b/resources/js/helpers/tracker.js @@ -43,7 +43,10 @@ export const BOOLEAN_STATES = [ ]; export const INTEGER_STATES = [ - 'bottle', + 'bottle-1', + 'bottle-2', + 'bottle-3', + 'bottle-4', 'heart-piece', 'lift', 'mail', @@ -55,6 +58,17 @@ export const INITIAL = { mail: 1, }; +export const BOTTLE_CONTENTS = [ + 'mushroom', + 'bottle', + 'red-potion', + 'green-potion', + 'blue-potion', + 'fairy', + 'bottle-bee', + 'bottle-bee', +]; + export const BOSSES = [ 'armos', 'lanmolas', @@ -1789,19 +1803,10 @@ const collectInventory = (state, data, prizeMap) => { state.duck = !!(data[INV_ADDR.RANDO_FLUTE] & 0x01); state.bugnet = !!data[INV_ADDR.BUGNET]; state.book = !!data[INV_ADDR.BOOK]; - state.bottle = 0; - if (data[INV_ADDR.BOTTLE_1]) { - ++state.bottle; - } - if (data[INV_ADDR.BOTTLE_2]) { - ++state.bottle; - } - if (data[INV_ADDR.BOTTLE_3]) { - ++state.bottle; - } - if (data[INV_ADDR.BOTTLE_4]) { - ++state.bottle; - } + state['bottle-1'] = data[INV_ADDR.BOTTLE_1]; + state['bottle-2'] = data[INV_ADDR.BOTTLE_2]; + state['bottle-3'] = data[INV_ADDR.BOTTLE_3]; + state['bottle-4'] = data[INV_ADDR.BOTTLE_4]; state.somaria = !!data[INV_ADDR.SOMARIA]; state.byrna = !!data[INV_ADDR.BYRNA]; state.cape = !!data[INV_ADDR.CAPE]; @@ -1936,6 +1941,12 @@ export const mergeStates = (autoState, manualState) => { next[loc.id] = true; } }); + // prefer auto + next['bottle-1'] = autoState['bottle-1'] || manualState['bottle-1'] || 0; + next['bottle-2'] = autoState['bottle-2'] || manualState['bottle-2'] || 0; + next['bottle-3'] = autoState['bottle-3'] || manualState['bottle-3'] || 0; + next['bottle-4'] = autoState['bottle-4'] || manualState['bottle-4'] || 0; + // force manual next['mm-medallion'] = manualState['mm-medallion']; next['tr-medallion'] = manualState['tr-medallion']; next['gt-crystals'] = manualState['gt-crystals'];