X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fhelpers%2Flogic.js;h=175494178041d689479fcbd43e796d969ab6b407;hb=6a65eac02f94f00fdd2d56ad8feddf5d9476aa1e;hp=2484dc007a08d3e05636d0c1fb606b1a35869fe4;hpb=d2e89b06bd80faa5085c454709c7e48c829cc6f2;p=alttp.git diff --git a/resources/js/helpers/logic.js b/resources/js/helpers/logic.js index 2484dc0..1754941 100644 --- a/resources/js/helpers/logic.js +++ b/resources/js/helpers/logic.js @@ -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'];