From c0f91b0bb441a5bc364f03291f3350bef17223bc Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 14 Apr 2024 16:11:36 -0400 Subject: [PATCH] Free Trade Agreement prepped. (#33) The option is not selectable yet, but it's prepped for it. --- package-lock.json | 4 +- package.json | 2 +- .../components/levels/1-japes/Kasplats.tsx | 18 ++++-- .../components/levels/2-aztec/Kasplats.tsx | 17 +++--- .../components/levels/3-factory/Kasplats.tsx | 19 ++++-- .../components/levels/4-galleon/Kasplats.tsx | 18 +++--- .../components/levels/5-forest/Kasplats.tsx | 6 +- .../components/levels/6-caves/Kasplats.tsx | 23 ++++--- .../components/levels/7-castle/Kasplats.tsx | 18 ++++-- src/renderer/src/hooks/aztec/index.ts | 30 ++++++++- src/renderer/src/hooks/castle/index.ts | 27 +++++++- src/renderer/src/hooks/caves/index.ts | 44 ++++++++++++- src/renderer/src/hooks/factory/index.ts | 43 ++++++++++--- src/renderer/src/hooks/forest/index.ts | 36 ++++++++--- src/renderer/src/hooks/galleon/index.ts | 40 ++++++++++-- src/renderer/src/hooks/isles/index.ts | 28 ++++++--- src/renderer/src/hooks/japes/index.ts | 41 +++++++++++-- src/renderer/src/hooks/kongs.ts | 61 +++++++++++++++++++ src/renderer/src/hooks/settings.ts | 6 ++ src/renderer/src/store/common.ts | 6 ++ src/renderer/src/store/settings.ts | 3 +- 21 files changed, 396 insertions(+), 94 deletions(-) diff --git a/package-lock.json b/package-lock.json index 54aee64..03377b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lanky-tracker", - "version": "3.3.2", + "version": "3.3.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lanky-tracker", - "version": "3.3.2", + "version": "3.3.3", "hasInstallScript": true, "dependencies": { "@electron-toolkit/preload": "^3.0.0", diff --git a/package.json b/package.json index a7757d8..aa9a912 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lanky-tracker", - "version": "3.3.2", + "version": "3.3.3", "description": "An DK 64 Rando Tracker Electron application with React and TypeScript", "main": "./out/main/index.js", "author": "wolfman2000", diff --git a/src/renderer/src/components/levels/1-japes/Kasplats.tsx b/src/renderer/src/components/levels/1-japes/Kasplats.tsx index 2f02e60..e2c214a 100644 --- a/src/renderer/src/components/levels/1-japes/Kasplats.tsx +++ b/src/renderer/src/components/levels/1-japes/Kasplats.tsx @@ -1,10 +1,16 @@ import KasplatPool from '@renderer/components/pools/Kasplats' -import { useArena, useChunkyUndergroundGb, useGateKasplat } from '@renderer/hooks/japes' +import { + useArena, + useChunkyUndergroundGb, + useDiddyKasplat, + useDkKasplat, + useLankyKasplat, + useTinyKasplat +} from '@renderer/hooks/japes' import { useShuffleKasplats } from '@renderer/hooks/settings' import JapesCheck from './JapesCheck' const Vanilla: React.FC = () => { - const kasplat = useGateKasplat() const under = useChunkyUndergroundGb() return ( <> @@ -12,25 +18,25 @@ const Vanilla: React.FC = () => { id={1050} name="Japes Kasplat: Hive Tunnel Lower" region="Hive Tunnel Area" - canGetLogic={kasplat} + canGetLogic={useDkKasplat()} /> { - const aztecBack = useAztecBack() - const lava = useAztecLlamaLava() + const lava = useLlamaLavaKasplat() const coconut = useCoconutKasplat() const chunky = useChunky5DoorGb() const oasis = useOasisKasplat() + const tunnel = useTunnelKasplat() return ( <> { name="Aztec Kasplat: Llama Temple Lava" region="Llama Temple" canGetLogic={lava.in} - canGetBreak={logicBreak(lava)} + canGetBreak={lava.out} /> { id={3050} name="Factory Kasplat: Upper Production Pipe" region="Production Room" - canGetLogic={useProductionKasplat()} + canGetLogic={useProductionTopKasplat()} /> ) diff --git a/src/renderer/src/components/levels/4-galleon/Kasplats.tsx b/src/renderer/src/components/levels/4-galleon/Kasplats.tsx index c4cc80e..6c3aaeb 100644 --- a/src/renderer/src/components/levels/4-galleon/Kasplats.tsx +++ b/src/renderer/src/components/levels/4-galleon/Kasplats.tsx @@ -1,19 +1,17 @@ import KasplatPool from '@renderer/components/pools/Kasplats' import { + useCactusKasplat, useCannonKasplat, - useGalleonCavernTop, - useGalleonLighthouseArea, - useGalleonOutskirts, useGeneralThing, - useTreasureKasplat + useLighthouseKasplat, + useTreasureKasplat, + useVineKasplat } from '@renderer/hooks/galleon' import { useShuffleKasplats } from '@renderer/hooks/settings' -import { logicBreak } from '@renderer/hooks/world' import GalleonCheck from './GalleonCheck' const Vanilla: React.FC = () => { - const galleonTop = useGalleonCavernTop() - const outskirts = useGalleonOutskirts() + const galleonTop = useVineKasplat() const cannon = useCannonKasplat() const treasure = useTreasureKasplat() @@ -30,7 +28,7 @@ const Vanilla: React.FC = () => { id={4051} name="Galleon Kasplat: Lighthouse Alcove" region="Lighthouse Area" - canGetLogic={useGalleonLighthouseArea()} + canGetLogic={useLighthouseKasplat()} /> { name="Galleon Kasplat: Past Vines" region="Galleon Caverns" canGetLogic={galleonTop.in} - canGetBreak={logicBreak(galleonTop)} + canGetBreak={galleonTop.out} /> ) diff --git a/src/renderer/src/components/levels/5-forest/Kasplats.tsx b/src/renderer/src/components/levels/5-forest/Kasplats.tsx index 529451b..58e2901 100644 --- a/src/renderer/src/components/levels/5-forest/Kasplats.tsx +++ b/src/renderer/src/components/levels/5-forest/Kasplats.tsx @@ -2,6 +2,8 @@ import KasplatPool from '@renderer/components/pools/Kasplats' import { useBarnKasplat, useGeneralThing, + useMushExteriorKasplat, + useMushInteriorKasplat, useNightKasplat, useOwlKasplat } from '@renderer/hooks/forest' @@ -23,7 +25,7 @@ const Vanilla: React.FC = () => { id={5051} name="Forest Kasplat: Inside Giant Mushroom" region="Giant Mushroom Insides" - canGetLogic={useGeneralThing()} + canGetLogic={useMushInteriorKasplat()} /> { id={5053} name="Forest Kasplat: Low Mushroom Exterior" region="Giant Mushroom Exterior" - canGetLogic={useGeneralThing()} + canGetLogic={useMushExteriorKasplat()} /> { - const pillar = useCavesPillar() - const miniFunky = useCavesMiniFunky() - const thing = useGeneralThing() + const pillar = usePillarKasplat() + const miniFunky = useFunkyKasplat() return ( <> { id={6053} name="Caves Kasplat: By the Far Warp 2 (Cabins)" region="Cabins Area" - canGetLogic={thing} + canGetLogic={useCabinKasplat()} /> ) diff --git a/src/renderer/src/components/levels/7-castle/Kasplats.tsx b/src/renderer/src/components/levels/7-castle/Kasplats.tsx index 4f7d1aa..cc59f10 100644 --- a/src/renderer/src/components/levels/7-castle/Kasplats.tsx +++ b/src/renderer/src/components/levels/7-castle/Kasplats.tsx @@ -1,10 +1,16 @@ import KasplatPool from '@renderer/components/pools/Kasplats' -import { useGeneralThing, useTreeKasplat } from '@renderer/hooks/castle' +import { + useDungeonKasplat, + useGeneralThing, + useLonelyKasplat, + useMausoleumKasplat, + usePathKasplat, + useTreeKasplat +} from '@renderer/hooks/castle' import { useShuffleKasplats } from '@renderer/hooks/settings' import CastleCheck from './CastleCheck' const Vanilla: React.FC = () => { - const kasplat = useGeneralThing() return ( <> { id={7051} name="Castle Kasplat: Lower Cave Center" region="Castle Underground" - canGetLogic={kasplat} + canGetLogic={useMausoleumKasplat()} /> ) diff --git a/src/renderer/src/hooks/aztec/index.ts b/src/renderer/src/hooks/aztec/index.ts index 03d1451..a112df9 100644 --- a/src/renderer/src/hooks/aztec/index.ts +++ b/src/renderer/src/hooks/aztec/index.ts @@ -12,6 +12,10 @@ import { useCoconut, useDive, useFeather, + useFtaDkBanana, + useFtaLankyBlueprint, + useFtaTinyBanana, + useFtaTinyBlueprint, useGrape, useGuitar, useHunky, @@ -25,6 +29,7 @@ import { useShockwave, useStand, useStrong, + useTiny, useTriangle, useTrombone, useTwirl, @@ -302,7 +307,7 @@ export const useDkTunnelGb = (): LogicBool => { const strong = useStrong() return { in: tunnel.in && strong, - out: logicBreak(tunnel) + out: useFtaDkBanana() && logicBreak(tunnel) } } @@ -431,9 +436,10 @@ export const useTinyBeetleGb = (): LogicBool => { export const useTinyLavaGb = (): LogicBool => { const lava = useAztecLlamaLava() const canSlam = useSlamAztec() + const tiny = useTiny() return { - in: lava.in && canSlam, - out: logicBreak(lava) + in: lava.in && tiny && canSlam, + out: useFtaTinyBanana() && logicBreak(lava) } } @@ -523,3 +529,21 @@ export const useOasisKasplat = (): LogicBool => { out: rocket && thing.out } } + +export const useLlamaLavaKasplat = (): LogicBool => { + const lava = useAztecLlamaLava() + const kong = useFtaLankyBlueprint() + return { + in: kong && lava.in, + out: kong && lava.out + } +} + +export const useTunnelKasplat = (): LogicBool => { + const back = useAztecBack() + const kong = useFtaTinyBlueprint() + return { + in: kong && back.in, + out: kong && back.out + } +} diff --git a/src/renderer/src/hooks/castle/index.ts b/src/renderer/src/hooks/castle/index.ts index e8d7399..ccc2a25 100644 --- a/src/renderer/src/hooks/castle/index.ts +++ b/src/renderer/src/hooks/castle/index.ts @@ -13,6 +13,11 @@ import { useDiddy, useDk, useFeather, + useFtaChunkyBlueprint, + useFtaDiddyBlueprint, + useFtaLankyBlueprint, + useFtaTinyBanana, + useFtaTinyBlueprint, useGone, useGrab, useGrape, @@ -239,7 +244,7 @@ export const useTinyMausoleumGb = (): LogicBool => { const dk = useDk() return { in: inStage && feather && canSlam && twirl, - out: inStage && (feather || grape) && canSlam && (dk || twirl) + out: useFtaTinyBanana() && inStage && (feather || grape) && canSlam && (dk || twirl) } } @@ -287,3 +292,23 @@ export const useTreeKasplat = (): boolean => { const coconut = useCoconut() return tree && coconut } + +export const useMausoleumKasplat = (): boolean => { + const inStage = usePlayCastle() + return useFtaDiddyBlueprint() && inStage +} + +export const usePathKasplat = (): boolean => { + const inStage = usePlayCastle() + return useFtaLankyBlueprint() && inStage +} + +export const useLonelyKasplat = (): boolean => { + const inStage = usePlayCastle() + return useFtaTinyBlueprint() && inStage +} + +export const useDungeonKasplat = (): boolean => { + const inStage = usePlayCastle() + return useFtaChunkyBlueprint() && inStage +} diff --git a/src/renderer/src/hooks/caves/index.ts b/src/renderer/src/hooks/caves/index.ts index 0348722..c0d7988 100644 --- a/src/renderer/src/hooks/caves/index.ts +++ b/src/renderer/src/hooks/caves/index.ts @@ -14,6 +14,13 @@ import { useDiddy, useDk, useFeather, + useFtaChunkyBlueprint, + useFtaDiddyBanana, + useFtaDiddyBlueprint, + useFtaDkBlueprint, + useFtaLankyBlueprint, + useFtaTinyBanana, + useFtaTinyBlueprint, useGone, useGuitar, useHighGrab, @@ -170,7 +177,7 @@ export const useDiddyWaterfallGb = (): LogicBool => { const twirl = useTwirl() return { in: inStage && rocket, - out: inStage && (dk || twirl) + out: useFtaDiddyBanana() && inStage && (dk || twirl) } } @@ -268,7 +275,7 @@ export const useTinyCaveGb = (): boolean => { const inStage = usePlayCaves() const mini = useMini() const warpAll = useBananaportAll() - return inStage && (mini || warpAll) + return useFtaTinyBanana() && inStage && (mini || warpAll) } export const useTinyPortGb = (): LogicBool => { @@ -337,3 +344,36 @@ export const useCabinFairy = (): LogicBool => { out: thing.out && camera } } + +export const useIceCastleKasplat = (): boolean => { + const inStage = usePlayCaves() + return useFtaDkBlueprint() && inStage +} + +export const useFunkyKasplat = (): LogicBool => { + const miniFunky = useCavesMiniFunky() + const kong = useFtaDiddyBlueprint() + return { + in: kong && miniFunky.in, + out: kong && miniFunky.out + } +} + +export const usePillarKasplat = (): LogicBool => { + const pillar = useCavesPillar() + const kong = useFtaLankyBlueprint() + return { + in: kong && pillar.in, + out: kong && pillar.out + } +} + +export const useCabinKasplat = (): boolean => { + const inStage = usePlayCaves() + return useFtaTinyBlueprint() && inStage +} + +export const useIglooKasplat = (): boolean => { + const inStage = usePlayCaves() + return useFtaChunkyBlueprint() && inStage +} diff --git a/src/renderer/src/hooks/factory/index.ts b/src/renderer/src/hooks/factory/index.ts index b60abdd..3915df4 100644 --- a/src/renderer/src/hooks/factory/index.ts +++ b/src/renderer/src/hooks/factory/index.ts @@ -13,6 +13,15 @@ import { useDiddy, useDk, useFeather, + useFtaChunkyBlueprint, + useFtaDiddyBanana, + useFtaDiddyBlueprint, + useFtaDkBanana, + useFtaDkBlueprint, + useFtaLankyBanana, + useFtaLankyBlueprint, + useFtaTinyBanana, + useFtaTinyBlueprint, useGrab, useGuitar, useHighGrab, @@ -130,7 +139,7 @@ export const useDiddyBlockGb = (): LogicBool => { const highGrab = useHighGrab() return { in: testing && spring, - out: testing && highGrab + out: useFtaDiddyBanana() && testing && highGrab } } @@ -215,7 +224,7 @@ export const useDkProdGb = (): LogicBool => { const diddy = useDiddy() return { in: production && strong, - out: production && (dk || diddy) + out: useFtaDkBanana() && production && (dk || diddy) } } @@ -225,7 +234,7 @@ export const useLankyTestingGb = (): LogicBool => { const anyKong = useAnyKong() return { in: testing && balloon, - out: testing && anyKong + out: useFtaLankyBanana() && testing && anyKong } } @@ -272,7 +281,7 @@ export const useLankyProductionGb = (): LogicBool => { const tiny = useTiny() return { in: production && canSlam && stand, - out: production && (stand || tiny) + out: useFtaLankyBanana() && production && (stand || tiny) } } @@ -302,7 +311,7 @@ export const useTinyProductionGb = (): LogicBool => { const dk = useDk() return { in: production && canSlam && twirl, - out: production && (twirl || dk) + out: useFtaTinyBanana() && production && (twirl || dk) } } @@ -355,7 +364,27 @@ export const useDartFairy = (): boolean => { return banana && camera } -export const useProductionKasplat = (): boolean => { +export const useProductionTopKasplat = (): boolean => { const production = useFactoryProductionTop() - return useAnyKong() && production + return useFtaDkBlueprint() && production +} + +export const useProductionBaseKasplat = (): boolean => { + const inStage = usePlayFactory() + return useFtaDiddyBlueprint() && inStage +} + +export const useResearchKasplat = (): boolean => { + const inStage = usePlayFactory() + return useFtaLankyBlueprint() && inStage +} + +export const useStorageKasplat = (): boolean => { + const inStage = usePlayFactory() + return useFtaTinyBlueprint() && inStage +} + +export const useBlockKasplat = (): boolean => { + const inStage = usePlayFactory() + return useFtaChunkyBlueprint() && inStage } diff --git a/src/renderer/src/hooks/forest/index.ts b/src/renderer/src/hooks/forest/index.ts index 07c56b3..73bbbac 100644 --- a/src/renderer/src/hooks/forest/index.ts +++ b/src/renderer/src/hooks/forest/index.ts @@ -14,6 +14,13 @@ import { useDiddy, useDk, useFeather, + useFtaChunkyBlueprint, + useFtaDiddyBanana, + useFtaDiddyBlueprint, + useFtaDkBlueprint, + useFtaLankyBlueprint, + useFtaTinyBanana, + useFtaTinyBlueprint, useGrab, useGrape, useGuitar, @@ -225,7 +232,7 @@ export const useDiddyTopGb = (): LogicBool => { const stand = useStand() return { in: inStage && rocket, - out: inStage && (diddy || tiny) && (tiny || stand) + out: useFtaDiddyBanana() && inStage && (diddy || tiny) && (tiny || stand) } } @@ -256,7 +263,7 @@ export const useDiddyRaftersGb = (): LogicBool => { const highGrab = useHighGrab() return { in: inStage && night.in && spring && guitar, - out: inStage && logicBreak(night) && (spring || highGrab) + out: useFtaDiddyBanana() && inStage && logicBreak(night) && (spring || highGrab) } } @@ -358,16 +365,16 @@ export const useTinyAntGb = (): boolean => { return owl && mini && sax } -// TODO: Free Trade Agreement will be a pain. export const useTinySpiderGb = (): LogicBool => { const spider = useForestSpiderBoss() const dusk = useForestDusk() const feather = useFeather() const pineapple = usePineapple() const anyGun = useAnyGun() + const kong = useFtaTinyBanana() return { - in: spider.in && ((dusk && (feather || pineapple)) || (!dusk && feather)), - out: logicBreak(spider) && anyGun + in: kong && spider.in && ((dusk && (feather || pineapple)) || (!dusk && feather)), + out: kong && logicBreak(spider) && anyGun } } @@ -429,20 +436,31 @@ export const useBarnKasplat = (): LogicBool => { const inStage = usePlayForest() const night = useForestNight() const anyGun = useAnyGun() + const kong = useFtaDkBlueprint() return { - in: inStage && night.in && anyGun, - out: inStage && (night.in || night.out) + in: kong && inStage && night.in && anyGun, + out: kong && inStage && (night.in || night.out) } } export const useOwlKasplat = (): boolean => { const inStage = useForestOwl() const anyKong = useAnyKong() - return inStage && anyKong + return useFtaLankyBlueprint() && inStage && anyKong } export const useNightKasplat = (): boolean => { const inStage = useForestMushroomTop() const anyKong = useAnyKong() - return inStage && anyKong + return useFtaChunkyBlueprint() && inStage && anyKong +} + +export const useMushInteriorKasplat = (): boolean => { + const inStage = usePlayForest() + return useFtaDiddyBlueprint() && inStage +} + +export const useMushExteriorKasplat = (): boolean => { + const inStage = usePlayForest() + return useFtaTinyBlueprint() && inStage } diff --git a/src/renderer/src/hooks/galleon/index.ts b/src/renderer/src/hooks/galleon/index.ts index 3ed7532..15eef18 100644 --- a/src/renderer/src/hooks/galleon/index.ts +++ b/src/renderer/src/hooks/galleon/index.ts @@ -13,6 +13,13 @@ import { useDiddy, useDive, useDk, + useFtaChunkyBlueprint, + useFtaDiddyBanana, + useFtaDiddyBlueprint, + useFtaDkBlueprint, + useFtaLankyBanana, + useFtaLankyBlueprint, + useFtaTinyBlueprint, useGrab, useGuitar, useHighGrab, @@ -253,7 +260,7 @@ export const useDiddyGoldGb = (): LogicBool => { const highGrab = useHighGrab() return { in: treasure.in && spring, - out: logicBreak(treasure) && (spring || highGrab) + out: useFtaDiddyBanana() && logicBreak(treasure) && (spring || highGrab) } } @@ -313,7 +320,7 @@ export const useLankyGoldGb = (): LogicBool => { const highGrab = useHighGrab() return { in: treasure.in && balloon, - out: logicBreak(treasure) && (balloon || highGrab) + out: useFtaLankyBanana() && logicBreak(treasure) && (balloon || highGrab) } } @@ -423,17 +430,38 @@ export const useTreasureKasplat = (): LogicBool => { const treasure = useGalleonTreasureRoom() const spring = useSpring() const highGrab = useHighGrab() + const dk = useFtaDkBlueprint() return { - in: treasure.in && spring, - out: logicBreak(treasure) && (spring || highGrab) + in: dk && treasure.in && spring, + out: dk && logicBreak(treasure) && (spring || highGrab) } } +export const useLighthouseKasplat = (): boolean => { + const lighthouse = useGalleonLighthouseArea() + return useFtaDiddyBlueprint() && lighthouse +} + export const useCannonKasplat = (): LogicBool => { const highTide = useGalleonHighTide() const cannon = useGalleonCannon() + const kong = useFtaLankyBlueprint() return { - in: cannon && highTide, - out: cannon + in: kong && cannon && highTide, + out: kong && cannon } } + +export const useVineKasplat = (): LogicBool => { + const kasplat = useGalleonCavernTop() + const kong = useFtaTinyBlueprint() + return { + in: kong && kasplat.in, + out: kong && kasplat.out + } +} + +export const useCactusKasplat = (): boolean => { + const outskirts = useGalleonOutskirts() + return useFtaChunkyBlueprint() && outskirts +} diff --git a/src/renderer/src/hooks/isles/index.ts b/src/renderer/src/hooks/isles/index.ts index 5323f9b..5967c47 100644 --- a/src/renderer/src/hooks/isles/index.ts +++ b/src/renderer/src/hooks/isles/index.ts @@ -26,6 +26,14 @@ import { useDive, useDk, useFeather, + useFtaChunkyBlueprint, + useFtaDiddyBanana, + useFtaDiddyBlueprint, + useFtaDkBanana, + useFtaDkBlueprint, + useFtaLankyBanana, + useFtaLankyBlueprint, + useFtaTinyBlueprint, useGone, useGrab, useGrape, @@ -376,7 +384,7 @@ export const useCheckDkCavesLobby = (): LogicBool => { const orange = useOrange() return { in: playCaves && punch && strong, - out: playCaves && punch && (twirl || orange) + out: useFtaDkBanana() && playCaves && punch && (twirl || orange) } } @@ -390,7 +398,7 @@ export const useCheckDiddySnide = (): LogicBool => { const twirl = useTwirl() return { in: kremAscent && ((autoBonus && anyKong) || spring), - out: kremAscent && ((boulderTech && highGrab) || twirl) + out: useFtaDiddyBanana() && kremAscent && ((boulderTech && highGrab) || twirl) } } @@ -413,7 +421,7 @@ export const useCheckDiddySummit = (): LogicBool => { const twirl = useTwirl() return { in: fungiIsland && islesUpper && boulderTech && target && rocket, - out: fungiIsland && twirl + out: useFtaDiddyBanana() && fungiIsland && twirl } } @@ -436,7 +444,7 @@ export const useCheckLankyPrison = (): LogicBool => { const dk = useDk() return { in: sprint, - out: dk + out: useFtaLankyBanana() && dk } } @@ -454,7 +462,7 @@ export const useCheckLankyCastle = (): LogicBool => { const tiny = useTiny() return { in: playCastle && boulderTech && balloon, - out: playCastle && tiny + out: useFtaLankyBanana() && playCastle && tiny } } @@ -645,30 +653,30 @@ export const useHelmKasplat = (): LogicBool => { const twirl = useTwirl() return { in: playHelm && sniper && coconut, - out: playHelm && twirl + out: useFtaDkBlueprint() && playHelm && twirl } } export const useCastleKasplat = (): boolean => { const playCastle = usePlayCastle() const coconut = useCoconut() - return playCastle && coconut + return useFtaDiddyBlueprint() && playCastle && coconut } export const useCavesKasplat = (): boolean => { const playCaves = usePlayCaves() const punch = usePunch() - return playCaves && punch + return useFtaLankyBlueprint() && playCaves && punch } export const useFactoryKasplat = (): boolean => { const playFactory = usePlayFactory() const punch = usePunch() - return playFactory && punch + return useFtaTinyBlueprint() && playFactory && punch } export const useGalleonKasplat = (): boolean => { const playGalleon = usePlayGalleon() const anyKong = useAnyKong() - return playGalleon && anyKong + return useFtaChunkyBlueprint() && playGalleon && anyKong } diff --git a/src/renderer/src/hooks/japes/index.ts b/src/renderer/src/hooks/japes/index.ts index 57ed83f..c6f3621 100644 --- a/src/renderer/src/hooks/japes/index.ts +++ b/src/renderer/src/hooks/japes/index.ts @@ -14,6 +14,13 @@ import { useDiddy, useDk, useFeather, + useFtaChunkyBanana, + useFtaDiddyBanana, + useFtaDiddyBlueprint, + useFtaDkBlueprint, + useFtaLankyBanana, + useFtaLankyBlueprint, + useFtaTinyBlueprint, useGrape, useHighGrab, useHunky, @@ -195,7 +202,7 @@ export const useChunkyUndergroundGb = (): LogicBool => { const diddy = useDiddy() return { in: under && pineapple && vine, - out: under && (dk || twirl || ((tiny || diddy) && vine)) + out: useFtaChunkyBanana() && under && (dk || twirl || ((tiny || diddy) && vine)) } } @@ -209,12 +216,12 @@ export const useDiddyCagedGb = (): boolean => { export const useDiddyMountainGb = (): boolean => { const mine = useJapesMine() const canSlam = useSlamJapes() - return mine && canSlam + return useFtaDiddyBanana() && mine && canSlam } export const useDiddyTunnelGb = (): boolean => { const side = useJapesSideArea() - return side + return useFtaDiddyBanana() && side } export const useDiddyMinecartGb = (): LogicBool => { @@ -228,6 +235,12 @@ export const useDiddyMinecartGb = (): LogicBool => { } } +/** + * Can we grab the item in front of the Diddy Kong Cage? + * + * This location is likely not restricted to FTA. + * @returns true if this item can be attained. + */ export const useDkFreebieGb = (): boolean => { const inStage = usePlayJapes() const anyKong = useAnyKong() @@ -295,7 +308,7 @@ export const useLankySlopeGb = (): LogicBool => { const anyKong = useAnyKong() return { in: tunnel && stand, - out: tunnel && anyKong + out: useFtaLankyBanana() && tunnel && anyKong } } @@ -393,3 +406,23 @@ export const useGateKasplat = (): boolean => { const anyKong = useAnyKong() return kongGates && anyKong } + +export const useDkKasplat = (): boolean => { + const gate = useGateKasplat() + return useFtaDkBlueprint() && gate +} + +export const useDiddyKasplat = (): boolean => { + const gate = useGateKasplat() + return useFtaDiddyBlueprint() && gate +} + +export const useLankyKasplat = (): boolean => { + const gate = useGateKasplat() + return useFtaLankyBlueprint() && gate +} + +export const useTinyKasplat = (): boolean => { + const gate = useGateKasplat() + return useFtaTinyBlueprint() && gate +} diff --git a/src/renderer/src/hooks/kongs.ts b/src/renderer/src/hooks/kongs.ts index f7c2ef8..56a8940 100644 --- a/src/renderer/src/hooks/kongs.ts +++ b/src/renderer/src/hooks/kongs.ts @@ -1,5 +1,6 @@ import useDonkStore from '@renderer/store' import { useShallow } from 'zustand/react/shallow' +import { useFreeTradeFull, useFreeTradeRestricted } from './settings' /** * Can we use Donkey? @@ -340,3 +341,63 @@ export const useShockwave = (): boolean => { const move = useDonkStore((state) => state.moves.shockwave) return anyKong && move } + +export const useFtaDkBanana = (): boolean => { + const kong = useDk() + const free = useFreeTradeRestricted() + return kong || free +} + +export const useFtaDiddyBanana = (): boolean => { + const kong = useDiddy() + const free = useFreeTradeRestricted() + return kong || free +} + +export const useFtaLankyBanana = (): boolean => { + const kong = useLanky() + const free = useFreeTradeRestricted() + return kong || free +} + +export const useFtaTinyBanana = (): boolean => { + const kong = useTiny() + const free = useFreeTradeRestricted() + return kong || free +} + +export const useFtaChunkyBanana = (): boolean => { + const kong = useChunky() + const free = useFreeTradeRestricted() + return kong || free +} + +export const useFtaDkBlueprint = (): boolean => { + const kong = useDk() + const free = useFreeTradeFull() + return kong || free +} + +export const useFtaDiddyBlueprint = (): boolean => { + const kong = useDiddy() + const free = useFreeTradeFull() + return kong || free +} + +export const useFtaLankyBlueprint = (): boolean => { + const kong = useLanky() + const free = useFreeTradeFull() + return kong || free +} + +export const useFtaTinyBlueprint = (): boolean => { + const kong = useTiny() + const free = useFreeTradeFull() + return kong || free +} + +export const useFtaChunkyBlueprint = (): boolean => { + const kong = useChunky() + const free = useFreeTradeFull() + return kong || free +} diff --git a/src/renderer/src/hooks/settings.ts b/src/renderer/src/hooks/settings.ts index 14c9ab1..ae72884 100644 --- a/src/renderer/src/hooks/settings.ts +++ b/src/renderer/src/hooks/settings.ts @@ -227,3 +227,9 @@ export const useShuffledArenas = (): boolean => export const useShuffledShops = (): boolean => useDonkStore(useShallow((state) => state.settings.shuffleShops)) + +export const useFreeTradeRestricted = (): boolean => + useDonkStore(useShallow((state) => state.settings.freeTrade)) != 0 + +export const useFreeTradeFull = (): boolean => + useDonkStore(useShallow((state) => state.settings.freeTrade)) == 2 diff --git a/src/renderer/src/store/common.ts b/src/renderer/src/store/common.ts index 25f0b9f..c5b0099 100644 --- a/src/renderer/src/store/common.ts +++ b/src/renderer/src/store/common.ts @@ -636,6 +636,12 @@ interface SettingCollection { * Note that all keys are still required to fight K. Rool. */ openLobbies: boolean + /** + * What is the status of the Free Trade Agreement? + * + * 0: No Free Trade. 1: Free Trade, No Blueprints 2: Free Trade, No Restrictions + */ + freeTrade: BananaportRange } export interface SettingState { diff --git a/src/renderer/src/store/settings.ts b/src/renderer/src/store/settings.ts index 66e2480..29e18d3 100644 --- a/src/renderer/src/store/settings.ts +++ b/src/renderer/src/store/settings.ts @@ -35,7 +35,8 @@ export const initialSettings: SettingState = { poolDrops: false, shuffleEnemies: true, hardShooting: false, - openLobbies: false + openLobbies: false, + freeTrade: 2 } }