]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/helpers/tracker.js
interactive map
[alttp.git] / resources / js / helpers / tracker.js
index 707e3f708e59f86d2c49cc0f1d622336bd9fa312..902a1bfc9ba9d11f84d744d12936a538fb7ba137 100644 (file)
@@ -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;
 };