X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fhelpers%2Ftracker.js;h=92508d46f1bc9434b97e641c8132a4fd94f0a095;hb=4e24f36eb5d6907697c106ca15c2c405728d78a8;hp=7cc716f2fcec4b492c8b0ded0df5894f873c25f9;hpb=9b15396c4363a92796cd555f629dffd48fae7ae7;p=alttp.git diff --git a/resources/js/helpers/tracker.js b/resources/js/helpers/tracker.js index 7cc716f..92508d4 100644 --- a/resources/js/helpers/tracker.js +++ b/resources/js/helpers/tracker.js @@ -948,7 +948,7 @@ export const UNDERWORLD_LOCATIONS = [ { id: 'hype-cave-bottom', room: 0x11E, - chest: 4, + chest: 3, }, { id: 'hype-cave-npc', @@ -1140,12 +1140,12 @@ export const UNDERWORLD_LOCATIONS = [ { id: 'paradox-lower-far-right', room: 0xEF, - chest: 4, + chest: 3, }, { id: 'paradox-lower-mid', room: 0xEF, - chest: 5, + chest: 4, }, { id: 'paradox-upper-left', @@ -1607,6 +1607,15 @@ export const hasDungeonPrize = (state, dungeon) => !!state[`${dungeon.id}-prize- export const getDungeonPrize = (state, dungeon) => state[`${dungeon.id}-prize`] || null; +export const isDungeonCleared = (state, dungeon) => { + const cleared = state[`${dungeon.id}-checks`] || 0; + const total = dungeon.items; + const hasItems = cleared >= total; + const hasBoss = !dungeon.boss || hasDungeonBoss(state, dungeon); + const hasPrize = !dungeon.porize || hasDungeonPrize(state, dungeon); + return hasItems && hasBoss && hasPrize; +}; + export const makeEmptyState = () => { const state = {}; BOOLEAN_STATES.forEach(p => {