X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fhelpers%2Ftracker.js;h=902a1bfc9ba9d11f84d744d12936a538fb7ba137;hb=3603709307e0777958cd18134ad4178cef410d14;hp=707e3f708e59f86d2c49cc0f1d622336bd9fa312;hpb=b5a50d74cf042fa7fc874d8184dc37ae20bb74dd;p=alttp.git diff --git a/resources/js/helpers/tracker.js b/resources/js/helpers/tracker.js index 707e3f7..902a1bf 100644 --- a/resources/js/helpers/tracker.js +++ b/resources/js/helpers/tracker.js @@ -1588,6 +1588,16 @@ export const highestActive = (state, names) => { return null; }; +export const clearAll = names => state => { + const changes = names.reduce((acc, cur) => ({ ...acc, [cur]: true }), {}); + return { ...state, ...changes }; +}; + +export const unclearAll = names => state => { + const changes = names.reduce((acc, cur) => ({ ...acc, [cur]: false }), {}); + return { ...state, ...changes }; +}; + export const hasDungeonBoss = (state, dungeon) => !!state[`${dungeon.id}-boss-defeated`]; export const getDungeonBoss = (state, dungeon) => @@ -1620,6 +1630,14 @@ export const makeEmptyState = () => { state[`${dungeon.id}-prize-acquired`] = false; } }); + OVERWORLD_LOCATIONS.forEach(location => { + state[location.id] = false; + }); + UNDERWORLD_LOCATIONS.forEach(location => { + state[location.id] = false; + }); + state['mm-medallion'] = null; + state['tr-medallion'] = null; return state; };