]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/helpers/tracker.js
alternative dungeon counting
[alttp.git] / resources / js / helpers / tracker.js
index 6307eda6f026824251eb6e36ebdede95728bbcd0..f73aa669823ad24db0e345dcd39bc582dadd3fae 100644 (file)
@@ -84,6 +84,7 @@ export const BOSSES = [
 
 export const CONFIG = {
        bossShuffle: false,
+       checkCalculation: 'room-data',
        glitches: 'none',
        mapLayout: 'horizontal',
        showMap: 'situational',
@@ -1857,6 +1858,8 @@ const collectInventory = (state, data, prizeMap) => {
                state[`${dungeon.id}-compass`] = !!(compass & dungeon.mask);
                state[`${dungeon.id}-small-key`] = data[INV_ADDR.RANDO_KEY_START + dungeon.offset];
                state[`${dungeon.id}-big-key`] = !!(bigKey & dungeon.mask);
+               state[`${dungeon.id}-checks-collected`] =
+                       data[INV_ADDR.RANDO_CHECKS_START + dungeon.offset];
                if (dungeon.prize) {
                        const isCrystal = prizeMap[dungeon.offset].isCrystal;
                        const prizeFlags = data[isCrystal ? INV_ADDR.CRYSTALS : INV_ADDR.PENDANTS];
@@ -1885,11 +1888,15 @@ const getDungeonAmounts = (config, state) => {
        DUNGEONS.forEach(dungeon => {
                let amount = 0;
                let total = dungeon.checks.length;
-               dungeon.checks.forEach(check => {
-                       if (state[check]) {
-                               ++amount;
-                       }
-               });
+               if (config.checkCalculation === 'inventory') {
+                       amount = state[`${dungeon.id}-checks-collected`];
+               } else {
+                       dungeon.checks.forEach(check => {
+                               if (state[check]) {
+                                       ++amount;
+                               }
+                       });
+               }
                if (!config.wildMap && state[`${dungeon.id}-map`]) {
                        --amount;
                        --total;