]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/helpers/logic.js
separate bottle tracking
[alttp.git] / resources / js / helpers / logic.js
index 2484dc007a08d3e05636d0c1fb606b1a35869fe4..175494178041d689479fcbd43e796d969ab6b407 100644 (file)
@@ -52,6 +52,9 @@ const hasPendants = n => (...args) => countPendants(...args) >= n;
 
 // Equipment
 
+const countBottles = (config, dungeons, state) =>
+       ['bottle-1', 'bottle-2', 'bottle-3', 'bottle-4'].filter(b => !!state[b]).length;
+
 const hasBig = dungeon => (config, dungeons, state) =>
        !config.wildBig || !!state[`${dungeon}-big-key`];
 
@@ -65,7 +68,7 @@ const hasBoom = (config, dungeons, state) => !!(state['blue-boomerang'] || state
 
 const hasBoots = (config, dungeons, state) => !!state['boots'];
 
-const hasBottle = n => (config, dungeons, state) => state['bottle'] >= (n || 1);
+const hasBottle = n => (...args) => countBottles(...args) >= (n || 1);
 
 const hasBow = (config, dungeons, state) => !!state['bow'];