From c1de1022b110168491c1630eb261b941b511851b Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 14 Apr 2024 08:06:48 -0400 Subject: [PATCH] All but Helm refactored. Minor logic updates. (#31) There's still more to do, but we're getting there. --- package-lock.json | 4 +- package.json | 4 +- .../components/levels/3-factory/Arenas.tsx | 13 +-- .../components/levels/3-factory/Crates.tsx | 26 ++---- .../src/components/levels/3-factory/Dirt.tsx | 24 ++--- .../components/levels/3-factory/Fairies.tsx | 30 ++----- .../components/levels/3-factory/Kasplats.tsx | 34 +++---- .../components/levels/4-galleon/Arenas.tsx | 11 +-- .../components/levels/4-galleon/Crates.tsx | 23 ++--- .../src/components/levels/4-galleon/Dirt.tsx | 34 ++----- .../components/levels/4-galleon/Fairies.tsx | 30 ++----- .../components/levels/4-galleon/Kasplats.tsx | 47 ++++------ .../src/components/levels/5-forest/Arenas.tsx | 12 +-- .../src/components/levels/5-forest/Crates.tsx | 46 ++++------ .../src/components/levels/5-forest/Dirt.tsx | 26 ++---- .../components/levels/5-forest/Fairies.tsx | 49 +++-------- .../components/levels/5-forest/Kasplats.tsx | 39 ++++---- .../src/components/levels/6-caves/Arenas.tsx | 17 +--- .../src/components/levels/6-caves/Crates.tsx | 19 +--- .../src/components/levels/6-caves/Dirt.tsx | 37 ++------ .../src/components/levels/6-caves/Fairies.tsx | 43 ++------- .../components/levels/6-caves/Kasplats.tsx | 35 +++----- .../src/components/levels/7-castle/Arenas.tsx | 12 +-- .../src/components/levels/7-castle/Crates.tsx | 23 ++--- .../src/components/levels/7-castle/Dirt.tsx | 24 ++--- .../components/levels/7-castle/Fairies.tsx | 45 ++-------- .../components/levels/7-castle/Kasplats.tsx | 31 +++---- src/renderer/src/hooks/aztec/index.ts | 7 +- src/renderer/src/hooks/castle/index.ts | 44 ++++++++++ src/renderer/src/hooks/caves/index.ts | 50 +++++++++-- src/renderer/src/hooks/factory/index.ts | 56 ++++++++++++ src/renderer/src/hooks/forest/index.ts | 88 +++++++++++++++++-- src/renderer/src/hooks/galleon/index.ts | 87 ++++++++++++++++-- 33 files changed, 512 insertions(+), 558 deletions(-) diff --git a/package-lock.json b/package-lock.json index 13c12e7..54aee64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lanky-tracker", - "version": "3.3.1", + "version": "3.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lanky-tracker", - "version": "3.3.1", + "version": "3.3.2", "hasInstallScript": true, "dependencies": { "@electron-toolkit/preload": "^3.0.0", diff --git a/package.json b/package.json index f4ee1c3..a7757d8 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "lanky-tracker", - "version": "3.3.1", + "version": "3.3.2", "description": "An DK 64 Rando Tracker Electron application with React and TypeScript", "main": "./out/main/index.js", "author": "wolfman2000", - "homepage": "https://electron-vite.org", + "homepage": "https://wolfman2000.github.io/", "scripts": { "format": "prettier --write .", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix", diff --git a/src/renderer/src/components/levels/3-factory/Arenas.tsx b/src/renderer/src/components/levels/3-factory/Arenas.tsx index 87d7083..71486d6 100644 --- a/src/renderer/src/components/levels/3-factory/Arenas.tsx +++ b/src/renderer/src/components/levels/3-factory/Arenas.tsx @@ -1,23 +1,16 @@ import ArenaPool from '@renderer/components/pools/Arenas' -import { useFactoryTesting, usePlayFactory } from '@renderer/hooks/factory' -import { useAnyKong, useGrab } from '@renderer/hooks/kongs' +import { useArena, useGeneralThing } from '@renderer/hooks/factory' import { useShuffledArenas } from '@renderer/hooks/settings' import FactoryCheck from './FactoryCheck' const Vanilla: React.FC = () => { - const inStage = useFactoryTesting() - const grab = useGrab() - return ( - - ) + return } const Shuffled: React.FC = () => { - const inStage = usePlayFactory() - const anyKong = useAnyKong() return ( <> - + ) } diff --git a/src/renderer/src/components/levels/3-factory/Crates.tsx b/src/renderer/src/components/levels/3-factory/Crates.tsx index baa9038..b854588 100644 --- a/src/renderer/src/components/levels/3-factory/Crates.tsx +++ b/src/renderer/src/components/levels/3-factory/Crates.tsx @@ -1,47 +1,33 @@ import CratePool from '@renderer/components/pools/Crates' -import { useFactoryTesting, usePlayFactory } from '@renderer/hooks/factory' -import { useAnyKong } from '@renderer/hooks/kongs' +import { useGeneralTest, useGeneralThing } from '@renderer/hooks/factory' import { useShuffleCrates } from '@renderer/hooks/settings' import FactoryCheck from './FactoryCheck' const Vanilla: React.FC = () => { - const inStage = usePlayFactory() - const anyKong = useAnyKong() - const testing = useFactoryTesting() return ( <> ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayFactory() - + const thing = useGeneralThing() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/3-factory/Dirt.tsx b/src/renderer/src/components/levels/3-factory/Dirt.tsx index fcc72eb..34a2198 100644 --- a/src/renderer/src/components/levels/3-factory/Dirt.tsx +++ b/src/renderer/src/components/levels/3-factory/Dirt.tsx @@ -1,39 +1,25 @@ import RainbowCoinPool from '@renderer/components/pools/RainbowCoins' -import { usePlayFactory } from '@renderer/hooks/factory' -import { useAnyKong, usePunch, useShockwave } from '@renderer/hooks/kongs' +import { useFactoryDirt, useGeneralDirt } from '@renderer/hooks/factory' import { useShuffleDirt } from '@renderer/hooks/settings' import FactoryCheck from './FactoryCheck' const VanillaDirtLocations: React.FC = () => { - const inStage = usePlayFactory() - const shockwave = useShockwave() - const punch = usePunch() return ( ) } const ShuffledDirtLocations: React.FC = () => { - const anyKong = useAnyKong() - const shockwave = useShockwave() - const inStage = usePlayFactory() + const dirt = useGeneralDirt() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/3-factory/Fairies.tsx b/src/renderer/src/components/levels/3-factory/Fairies.tsx index 426c6ba..b5524ff 100644 --- a/src/renderer/src/components/levels/3-factory/Fairies.tsx +++ b/src/renderer/src/components/levels/3-factory/Fairies.tsx @@ -1,51 +1,33 @@ import FairyPool from '@renderer/components/pools/Fairies' -import { useFactoryTesting, usePlayFactory, useSlamFactory } from '@renderer/hooks/factory' -import { useAnyKong, useCamera, useFeather, useMini } from '@renderer/hooks/kongs' +import { useDartFairy, useGeneralFairy, useNumberFairy } from '@renderer/hooks/factory' import { useShuffleFairies } from '@renderer/hooks/settings' import FactoryCheck from './FactoryCheck' const Vanilla: React.FC = () => { - const testing = useFactoryTesting() - const camera = useCamera() - const anyKong = useAnyKong() - const mini = useMini() - const feather = useFeather() - const canSlam = useSlamFactory() return ( <> ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayFactory() - const camera = useCamera() - + const thing = useGeneralFairy() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/3-factory/Kasplats.tsx b/src/renderer/src/components/levels/3-factory/Kasplats.tsx index 3809165..dc04b4a 100644 --- a/src/renderer/src/components/levels/3-factory/Kasplats.tsx +++ b/src/renderer/src/components/levels/3-factory/Kasplats.tsx @@ -1,62 +1,54 @@ import KasplatPool from '@renderer/components/pools/Kasplats' -import { useFactoryProductionTop, useFactoryTesting, usePlayFactory } from '@renderer/hooks/factory' -import { useAnyKong } from '@renderer/hooks/kongs' +import { useGeneralTest, useGeneralThing, useProductionKasplat } from '@renderer/hooks/factory' import { useShuffleKasplats } from '@renderer/hooks/settings' import FactoryCheck from './FactoryCheck' const Vanilla: React.FC = () => { - const inStage = usePlayFactory() - const production = useFactoryProductionTop() - const testing = useFactoryTesting() - const anyKong = useAnyKong() - return ( <> ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayFactory() - + const kasplat = useGeneralThing() return ( <> - - - - - + + + + + ) } diff --git a/src/renderer/src/components/levels/4-galleon/Arenas.tsx b/src/renderer/src/components/levels/4-galleon/Arenas.tsx index f0608c1..37d6087 100644 --- a/src/renderer/src/components/levels/4-galleon/Arenas.tsx +++ b/src/renderer/src/components/levels/4-galleon/Arenas.tsx @@ -1,28 +1,23 @@ import ArenaPool from '@renderer/components/pools/Arenas' -import { usePlayGalleon } from '@renderer/hooks/galleon' -import { useAnyKong, usePunch } from '@renderer/hooks/kongs' +import { useArena, useGeneralThing } from '@renderer/hooks/galleon' import { useShuffledArenas } from '@renderer/hooks/settings' import GalleonCheck from './GalleonCheck' const Vanilla: React.FC = () => { - const inStage = usePlayGalleon() - const punch = usePunch() return ( ) } const Shuffled: React.FC = () => { - const inStage = usePlayGalleon() - const anyKong = useAnyKong() return ( <> - + ) } diff --git a/src/renderer/src/components/levels/4-galleon/Crates.tsx b/src/renderer/src/components/levels/4-galleon/Crates.tsx index 46573d8..cab8be6 100644 --- a/src/renderer/src/components/levels/4-galleon/Crates.tsx +++ b/src/renderer/src/components/levels/4-galleon/Crates.tsx @@ -1,40 +1,27 @@ import CratePool from '@renderer/components/pools/Crates' -import { useGalleonOutskirts, usePlayGalleon } from '@renderer/hooks/galleon' -import { useAnyKong } from '@renderer/hooks/kongs' +import { useGeneralOutskirts, useGeneralThing } from '@renderer/hooks/galleon' import { useShuffleCrates } from '@renderer/hooks/settings' import GalleonCheck from './GalleonCheck' const Vanilla: React.FC = () => { - const outskirts = useGalleonOutskirts() - const anyKong = useAnyKong() return ( <> ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayGalleon() - + const thing = useGeneralThing() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/4-galleon/Dirt.tsx b/src/renderer/src/components/levels/4-galleon/Dirt.tsx index 6dcb5ad..037c50d 100644 --- a/src/renderer/src/components/levels/4-galleon/Dirt.tsx +++ b/src/renderer/src/components/levels/4-galleon/Dirt.tsx @@ -1,49 +1,29 @@ import RainbowCoinPool from '@renderer/components/pools/RainbowCoins' -import { - useGalleonHighTide, - useGalleonLighthouseArea, - usePlayGalleon, - useSlamGalleon -} from '@renderer/hooks/galleon' -import { useAnyKong, useDk, useShockwave } from '@renderer/hooks/kongs' +import { useGeneralDirt, useLighthouseDirt } from '@renderer/hooks/galleon' import { useShuffleDirt } from '@renderer/hooks/settings' import GalleonCheck from './GalleonCheck' const VanillaDirtLocations: React.FC = () => { - const lighthouseArea = useGalleonLighthouseArea() - const canSlam = useSlamGalleon() - const shockwave = useShockwave() - const dk = useDk() - const highTide = useGalleonHighTide() + const dirt = useLighthouseDirt() return ( <> ) } const ShuffledDirtLocations: React.FC = () => { - const anyKong = useAnyKong() - const shockwave = useShockwave() - const inStage = usePlayGalleon() + const thing = useGeneralDirt() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/4-galleon/Fairies.tsx b/src/renderer/src/components/levels/4-galleon/Fairies.tsx index 5a5db03..f74d478 100644 --- a/src/renderer/src/components/levels/4-galleon/Fairies.tsx +++ b/src/renderer/src/components/levels/4-galleon/Fairies.tsx @@ -1,51 +1,33 @@ import FairyPool from '@renderer/components/pools/Fairies' -import { useGalleonOutskirts, usePlayGalleon } from '@renderer/hooks/galleon' -import { useAnyKong, useCamera, useDive, usePunch, useSax } from '@renderer/hooks/kongs' +import { useChestFairy, useGeneralFairy, useShipFairy } from '@renderer/hooks/galleon' import { useShuffleFairies } from '@renderer/hooks/settings' import GalleonCheck from './GalleonCheck' const Vanilla: React.FC = () => { - const camera = useCamera() - const punch = usePunch() - const inStage = usePlayGalleon() - const outskirts = useGalleonOutskirts() - const sax = useSax() - const dive = useDive() return ( <> ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayGalleon() - const camera = useCamera() - + const thing = useGeneralFairy() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/4-galleon/Kasplats.tsx b/src/renderer/src/components/levels/4-galleon/Kasplats.tsx index a0b7b9f..5039429 100644 --- a/src/renderer/src/components/levels/4-galleon/Kasplats.tsx +++ b/src/renderer/src/components/levels/4-galleon/Kasplats.tsx @@ -1,30 +1,21 @@ import KasplatPool from '@renderer/components/pools/Kasplats' import { - useGalleonCannon, + useCannonKasplat, useGalleonCavernTop, - useGalleonHighTide, useGalleonLighthouseArea, - useGalleonLowTide, useGalleonOutskirts, - useGalleonTreasureRoom, - usePlayGalleon + useGeneralThing, + useTreasureKasplat } from '@renderer/hooks/galleon' -import { useAnyKong, useHighGrab, useSpring } from '@renderer/hooks/kongs' import { useShuffleKasplats } from '@renderer/hooks/settings' import { logicBreak } from '@renderer/hooks/world' import GalleonCheck from './GalleonCheck' const Vanilla: React.FC = () => { - const inStage = usePlayGalleon() const galleonTop = useGalleonCavernTop() const outskirts = useGalleonOutskirts() - const treasure = useGalleonTreasureRoom() - const lighthouseArea = useGalleonLighthouseArea() - const lowTide = useGalleonLowTide() - const highTide = useGalleonHighTide() - const cannon = useGalleonCannon() - const spring = useSpring() - const highGrab = useHighGrab() + const cannon = useCannonKasplat() + const treasure = useTreasureKasplat() return ( <> @@ -32,28 +23,28 @@ const Vanilla: React.FC = () => { id={4050} name="Galleon Kasplat Diddy Gold Tower" region="Treasure Room" - canGetLogic={treasure.in && spring} - canGetBreak={logicBreak(treasure) && highGrab} + canGetLogic={treasure.in} + canGetBreak={treasure.out} /> { } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayGalleon() - + const thing = useGeneralThing() return ( <> - - - - - + + + + + ) } diff --git a/src/renderer/src/components/levels/5-forest/Arenas.tsx b/src/renderer/src/components/levels/5-forest/Arenas.tsx index 7461610..5e93795 100644 --- a/src/renderer/src/components/levels/5-forest/Arenas.tsx +++ b/src/renderer/src/components/levels/5-forest/Arenas.tsx @@ -1,28 +1,24 @@ import ArenaPool from '@renderer/components/pools/Arenas' -import { usePlayForest } from '@renderer/hooks/forest' -import { useAnyKong } from '@renderer/hooks/kongs' +import { useArena, useGeneralThing } from '@renderer/hooks/forest' import { useShuffledArenas } from '@renderer/hooks/settings' import ForestCheck from './ForestCheck' const Vanilla: React.FC = () => { - const inStage = usePlayForest() - const anyKong = useAnyKong() return ( ) } const Shuffled: React.FC = () => { - const inStage = usePlayForest() - const anyKong = useAnyKong() + const thing = useGeneralThing() return ( <> - + ) } diff --git a/src/renderer/src/components/levels/5-forest/Crates.tsx b/src/renderer/src/components/levels/5-forest/Crates.tsx index 99c853b..eeee79f 100644 --- a/src/renderer/src/components/levels/5-forest/Crates.tsx +++ b/src/renderer/src/components/levels/5-forest/Crates.tsx @@ -1,67 +1,55 @@ import CratePool from '@renderer/components/pools/Crates' -import { useForestNight, useForestOwl, usePlayForest, useSlamForest } from '@renderer/hooks/forest' -import { usePlayJapes } from '@renderer/hooks/japes' -import { useAnyKong, useDk, useStrong } from '@renderer/hooks/kongs' +import { + useDkBarnGb, + useForestNight, + useForestOwl, + useGeneralThing +} from '@renderer/hooks/forest' +import { useShuffleCrates } from '@renderer/hooks/settings' import JapesCheck from '../1-japes/JapesCheck' import ForestCheck from './ForestCheck' -import { useShuffleCrates } from '@renderer/hooks/settings' const Vanilla: React.FC = () => { - const inStage = usePlayForest() - const anyKong = useAnyKong() - const owlTree = useForestOwl() const night = useForestNight() - const dk = useDk() - const strong = useStrong() - const canSlam = useSlamForest() + const barn = useDkBarnGb() return ( <> ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayJapes() - + const thing = useGeneralThing() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/5-forest/Dirt.tsx b/src/renderer/src/components/levels/5-forest/Dirt.tsx index 8bc7f35..6fa75a9 100644 --- a/src/renderer/src/components/levels/5-forest/Dirt.tsx +++ b/src/renderer/src/components/levels/5-forest/Dirt.tsx @@ -1,47 +1,33 @@ import RainbowCoinPool from '@renderer/components/pools/RainbowCoins' -import { useForestBean, usePlayForest } from '@renderer/hooks/forest' -import { useAnyKong, useShockwave } from '@renderer/hooks/kongs' +import { useBeanDirt, useGeneralDirt } from '@renderer/hooks/forest' import { useShuffleDirt } from '@renderer/hooks/settings' import ForestCheck from './ForestCheck' const VanillaDirtLocations: React.FC = () => { - const beanstalk = useForestBean() - const shockwave = useShockwave() - const inStage = usePlayForest() return ( <> ) } const ShuffledDirtLocations: React.FC = () => { - const anyKong = useAnyKong() - const shockwave = useShockwave() - const inStage = usePlayForest() + const dirt = useGeneralDirt() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/5-forest/Fairies.tsx b/src/renderer/src/components/levels/5-forest/Fairies.tsx index af5c6a4..766a1f5 100644 --- a/src/renderer/src/components/levels/5-forest/Fairies.tsx +++ b/src/renderer/src/components/levels/5-forest/Fairies.tsx @@ -1,66 +1,37 @@ - import FairyPool from '@renderer/components/pools/Fairies' -import { useForestNight, usePlayForest, useSlamForest } from '@renderer/hooks/forest' -import { - useAnyKong, - useCamera, - useDk, - useGuitar, - useHighGrab, - useSpring, - useStrong -} from '@renderer/hooks/kongs' +import { useBarnFairy, useGeneralFairy, useRaftersFairy } from '@renderer/hooks/forest' import { useShuffleFairies } from '@renderer/hooks/settings' -import { logicBreak } from '@renderer/hooks/world' import ForestCheck from './ForestCheck' const Vanilla: React.FC = () => { - const inStage = usePlayForest() - const camera = useCamera() - const night = useForestNight() - const guitar = useGuitar() - const spring = useSpring() - const highGrab = useHighGrab() - const canSlam = useSlamForest() - const dk = useDk() - const strong = useStrong() + const barn = useBarnFairy() + const rafters = useRaftersFairy() return ( <> ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayForest() - const camera = useCamera() - + const thing = useGeneralFairy() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/5-forest/Kasplats.tsx b/src/renderer/src/components/levels/5-forest/Kasplats.tsx index 29e96ba..1d85625 100644 --- a/src/renderer/src/components/levels/5-forest/Kasplats.tsx +++ b/src/renderer/src/components/levels/5-forest/Kasplats.tsx @@ -1,63 +1,62 @@ import KasplatPool from '@renderer/components/pools/Kasplats' -import { useForestNight, useForestOwl, usePlayForest } from '@renderer/hooks/forest' -import { useAnyGun, useAnyKong } from '@renderer/hooks/kongs' +import { + useBarnKasplat, + useGeneralThing, + useNightKasplat, + useOwlKasplat +} from '@renderer/hooks/forest' import { useShuffleKasplats } from '@renderer/hooks/settings' import ForestCheck from './ForestCheck' const Vanilla: React.FC = () => { - const inStage = usePlayForest() - const night = useForestNight() - const anyGun = useAnyGun() - const anyKong = useAnyKong() - const owlTree = useForestOwl() + const barn = useBarnKasplat() return ( <> ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayForest() + const thing = useGeneralThing() return ( <> - - - - - + + + + + ) } diff --git a/src/renderer/src/components/levels/6-caves/Arenas.tsx b/src/renderer/src/components/levels/6-caves/Arenas.tsx index 25247e1..ec7c7b9 100644 --- a/src/renderer/src/components/levels/6-caves/Arenas.tsx +++ b/src/renderer/src/components/levels/6-caves/Arenas.tsx @@ -1,29 +1,18 @@ import ArenaPool from '@renderer/components/pools/Arenas' -import { useAnyKong, useBongos, useSlam } from '@renderer/hooks/kongs' +import { useDkRotateGb, useGeneralThing } from '@renderer/hooks/caves' import { useShuffledArenas } from '@renderer/hooks/settings' import CavesCheck from './CavesCheck' -import { usePlayCaves } from '@renderer/hooks/caves' const Vanilla: React.FC = () => { - const inStage = usePlayCaves() - const bongos = useBongos() - const slam = useSlam() return ( - + ) } const Shuffled: React.FC = () => { - const inStage = usePlayCaves() - const anyKong = useAnyKong() return ( <> - + ) } diff --git a/src/renderer/src/components/levels/6-caves/Crates.tsx b/src/renderer/src/components/levels/6-caves/Crates.tsx index 8876aca..e7bf22d 100644 --- a/src/renderer/src/components/levels/6-caves/Crates.tsx +++ b/src/renderer/src/components/levels/6-caves/Crates.tsx @@ -1,27 +1,16 @@ import CratePool from '@renderer/components/pools/Crates' -import { usePlayCaves } from '@renderer/hooks/caves' -import { useAnyKong } from '@renderer/hooks/kongs' +import { useGeneralThing } from '@renderer/hooks/caves' import { useShuffleCrates } from '@renderer/hooks/settings' import CavesCheck from './CavesCheck' const Vanilla: React.FC = () => null const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayCaves() - + const thing = useGeneralThing() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/6-caves/Dirt.tsx b/src/renderer/src/components/levels/6-caves/Dirt.tsx index 3275fc3..4a155b0 100644 --- a/src/renderer/src/components/levels/6-caves/Dirt.tsx +++ b/src/renderer/src/components/levels/6-caves/Dirt.tsx @@ -1,50 +1,27 @@ import RainbowCoinPool from '@renderer/components/pools/RainbowCoins' -import { usePlayCaves } from '@renderer/hooks/caves' -import { - useAnyKong, - useBarrel, - useHunky, - useMonkeyport, - usePunch, - useShockwave -} from '@renderer/hooks/kongs' +import { useGeneralDirt, useKoshaDirt } from '@renderer/hooks/caves' import { useShuffleDirt } from '@renderer/hooks/settings' import CavesCheck from './CavesCheck' const VanillaDirtLocations: React.FC = () => { - const inStage = usePlayCaves() - const shockwave = useShockwave() - const port = useMonkeyport() - const punch = usePunch() - const hunky = useHunky() - const barrel = useBarrel() + const dirt = useKoshaDirt() return ( ) } const ShuffledDirtLocations: React.FC = () => { - const anyKong = useAnyKong() - const shockwave = useShockwave() - const inStage = usePlayCaves() + const dirt = useGeneralDirt() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/6-caves/Fairies.tsx b/src/renderer/src/components/levels/6-caves/Fairies.tsx index 0dbdbfe..d6cf24b 100644 --- a/src/renderer/src/components/levels/6-caves/Fairies.tsx +++ b/src/renderer/src/components/levels/6-caves/Fairies.tsx @@ -1,62 +1,35 @@ - import FairyPool from '@renderer/components/pools/Fairies' -import { usePlayCaves } from '@renderer/hooks/caves' -import { - useAnyKong, - useCamera, - useGuitar, - useRocket, - useSax, - useSlam, - useSpring -} from '@renderer/hooks/kongs' +import { useCabinFairy, useGenericFairy, useIglooFairy } from '@renderer/hooks/caves' import { useShuffleFairies } from '@renderer/hooks/settings' import CavesCheck from './CavesCheck' const Vanilla: React.FC = () => { - const inStage = usePlayCaves() - const camera = useCamera() - const sax = useSax() - const slam = useSlam() - const rocket = useRocket() - const guitar = useGuitar() - const spring = useSpring() + const cabin = useCabinFairy() return ( <> ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayCaves() - const camera = useCamera() - + const thing = useGenericFairy() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/6-caves/Kasplats.tsx b/src/renderer/src/components/levels/6-caves/Kasplats.tsx index ccaf537..1813459 100644 --- a/src/renderer/src/components/levels/6-caves/Kasplats.tsx +++ b/src/renderer/src/components/levels/6-caves/Kasplats.tsx @@ -1,22 +1,20 @@ import KasplatPool from '@renderer/components/pools/Kasplats' -import { useCavesMiniFunky, useCavesPillar, usePlayCaves } from '@renderer/hooks/caves' -import { useAnyKong } from '@renderer/hooks/kongs' +import { useCavesMiniFunky, useCavesPillar, useGeneralThing } from '@renderer/hooks/caves' import { useShuffleKasplats } from '@renderer/hooks/settings' import { logicBreak } from '@renderer/hooks/world' import CavesCheck from './CavesCheck' const Vanilla: React.FC = () => { - const inStage = usePlayCaves() const pillar = useCavesPillar() - const anyKong = useAnyKong() const miniFunky = useCavesMiniFunky() + const thing = useGeneralThing() return ( <> { canGetLogic={pillar.in} canGetBreak={pillar.out} /> - - + + ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayCaves() + const thing = useGeneralThing() return ( <> - - - - - + + + + + ) } diff --git a/src/renderer/src/components/levels/7-castle/Arenas.tsx b/src/renderer/src/components/levels/7-castle/Arenas.tsx index bf69cdd..6c6402c 100644 --- a/src/renderer/src/components/levels/7-castle/Arenas.tsx +++ b/src/renderer/src/components/levels/7-castle/Arenas.tsx @@ -1,29 +1,23 @@ import ArenaPool from '@renderer/components/pools/Arenas' -import { usePlayCastle, useSlamCastle } from '@renderer/hooks/castle' -import { useAnyKong, useLanky } from '@renderer/hooks/kongs' +import { useGeneralThing, useLankyGreenhouseGb } from '@renderer/hooks/castle' import { useShuffledArenas } from '@renderer/hooks/settings' import CastleCheck from './CastleCheck' const Vanilla: React.FC = () => { - const inStage = usePlayCastle() - const lanky = useLanky() - const canSlam = useSlamCastle() return ( ) } const Shuffled: React.FC = () => { - const inStage = usePlayCastle() - const anyKong = useAnyKong() return ( <> - + ) } diff --git a/src/renderer/src/components/levels/7-castle/Crates.tsx b/src/renderer/src/components/levels/7-castle/Crates.tsx index 95dfdf6..72f2260 100644 --- a/src/renderer/src/components/levels/7-castle/Crates.tsx +++ b/src/renderer/src/components/levels/7-castle/Crates.tsx @@ -1,40 +1,27 @@ import CratePool from '@renderer/components/pools/Crates' -import { usePlayCastle } from '@renderer/hooks/castle' -import { useAnyKong } from '@renderer/hooks/kongs' +import { useGeneralThing } from '@renderer/hooks/castle' import { useShuffleCrates } from '@renderer/hooks/settings' import CastleCheck from './CastleCheck' const Vanilla: React.FC = () => { - const inStage = usePlayCastle() - const anyKong = useAnyKong() return ( <> ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayCastle() - + const thing = useGeneralThing() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/7-castle/Dirt.tsx b/src/renderer/src/components/levels/7-castle/Dirt.tsx index b082c9d..b39d987 100644 --- a/src/renderer/src/components/levels/7-castle/Dirt.tsx +++ b/src/renderer/src/components/levels/7-castle/Dirt.tsx @@ -1,41 +1,27 @@ import RainbowCoinPool from '@renderer/components/pools/RainbowCoins' -import { usePlayCastle } from '@renderer/hooks/castle' -import { useAnyKong, useShockwave } from '@renderer/hooks/kongs' +import { useGeneralDirt } from '@renderer/hooks/castle' import { useShuffleDirt } from '@renderer/hooks/settings' import CastleCheck from './CastleCheck' const VanillaDirtLocations: React.FC = () => { - const inStage = usePlayCastle() - const anyKong = useAnyKong() - const shockwave = useShockwave() return ( <> ) } const ShuffledDirtLocations: React.FC = () => { - const anyKong = useAnyKong() - const shockwave = useShockwave() - const inStage = usePlayCastle() + const dirt = useGeneralDirt() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/7-castle/Fairies.tsx b/src/renderer/src/components/levels/7-castle/Fairies.tsx index 8bb5fc9..4a46511 100644 --- a/src/renderer/src/components/levels/7-castle/Fairies.tsx +++ b/src/renderer/src/components/levels/7-castle/Fairies.tsx @@ -1,64 +1,35 @@ - import FairyPool from '@renderer/components/pools/Fairies' -import { useCastleTree, usePlayCastle, useSlamCastle } from '@renderer/hooks/castle' -import { - useAnyKong, - useCamera, - useChunky, - useCoconut, - useDiddy, - useMonkeyport, - useSniper -} from '@renderer/hooks/kongs' +import { useGeneralFairy, useRoomFairy, useTreeFairy } from '@renderer/hooks/castle' import { useShuffleFairies } from '@renderer/hooks/settings' import CastleCheck from './CastleCheck' const Vanilla: React.FC = () => { - const inStage = usePlayCastle() - const tree = useCastleTree() - const coconut = useCoconut() - const camera = useCamera() - const sniper = useSniper() - const diddy = useDiddy() - const port = useMonkeyport() - const canSlam = useSlamCastle() - const chunky = useChunky() + const room = useRoomFairy() return ( <> ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayCastle() - const camera = useCamera() - + const fairy = useGeneralFairy() return ( <> - - + + ) } diff --git a/src/renderer/src/components/levels/7-castle/Kasplats.tsx b/src/renderer/src/components/levels/7-castle/Kasplats.tsx index dd5001c..a01f01f 100644 --- a/src/renderer/src/components/levels/7-castle/Kasplats.tsx +++ b/src/renderer/src/components/levels/7-castle/Kasplats.tsx @@ -1,61 +1,56 @@ import KasplatPool from '@renderer/components/pools/Kasplats' -import { useCastleTree, usePlayCastle } from '@renderer/hooks/castle' -import { useAnyKong, useCoconut } from '@renderer/hooks/kongs' +import { useGeneralThing, useTreeKasplat } from '@renderer/hooks/castle' import { useShuffleKasplats } from '@renderer/hooks/settings' import CastleCheck from './CastleCheck' const Vanilla: React.FC = () => { - const inStage = usePlayCastle() - const tree = useCastleTree() - const coconut = useCoconut() - const anyKong = useAnyKong() + const kasplat = useGeneralThing() return ( <> ) } const Shuffled: React.FC = () => { - const anyKong = useAnyKong() - const inStage = usePlayCastle() + const kasplat = useGeneralThing() return ( <> - - - - - + + + + + ) } diff --git a/src/renderer/src/hooks/aztec/index.ts b/src/renderer/src/hooks/aztec/index.ts index 6dfbd0e..03d1451 100644 --- a/src/renderer/src/hooks/aztec/index.ts +++ b/src/renderer/src/hooks/aztec/index.ts @@ -138,10 +138,13 @@ export const useAztecLlamaTemple = (): LogicBool => { const llama1 = useAztecLlamaCoconutSwitch() const llama2 = useAztecLlamaGrapeSwitch() const llama3 = useAztecLlamaFeatherSwitch() + const blast = useBlast() + const barrier = useDonkStore(useShallow((state) => state.removeBarriers.aztecLlamaTemple)) + const entry = blast || barrier const properGun = llama1 || llama2 || llama3 return { - in: aztecBack.in && properGun, - out: logicBreak(aztecBack) && properGun + in: aztecBack.in && entry && properGun, + out: logicBreak(aztecBack) && entry && properGun } } diff --git a/src/renderer/src/hooks/castle/index.ts b/src/renderer/src/hooks/castle/index.ts index 6547b02..e8d7399 100644 --- a/src/renderer/src/hooks/castle/index.ts +++ b/src/renderer/src/hooks/castle/index.ts @@ -1,11 +1,14 @@ import { usePlayLevel, useSlamLevel } from '../isles' import { useAnyGun, + useAnyKong, useAnyMusic, useBalloon, useBlast, useBoulderTech, + useCamera, useCharge, + useChunky, useCoconut, useDiddy, useDk, @@ -22,6 +25,7 @@ import { usePunch, useRocket, useSax, + useShockwave, useSniper, useSprint, useStrong, @@ -243,3 +247,43 @@ export const useTinyChasmGb = (): boolean => { const twirl = useTwirl() return usePlayCastle() && twirl } + +export const useGeneralThing = (): boolean => { + const inStage = usePlayCastle() + return useAnyKong() && inStage +} + +export const useGeneralDirt = (): boolean => { + const inStage = useGeneralThing() + return useShockwave() && inStage +} + +export const useGeneralFairy = (): boolean => { + const inStage = useGeneralThing() + return useCamera() && inStage +} + +export const useTreeFairy = (): boolean => { + const tree = useTreeKasplat() + const camera = useCamera() + return tree && camera +} + +export const useRoomFairy = (): LogicBool => { + const slam = useSlamCastle() + const inStage = usePlayCastle() + const diddy = useDiddy() + const port = useMonkeyport() + const camera = useCamera() + const chunky = useChunky() + return { + in: inStage && slam && camera && diddy && port, + out: inStage && slam && camera && chunky + } +} + +export const useTreeKasplat = (): boolean => { + const tree = useCastleTree() + const coconut = useCoconut() + return tree && coconut +} diff --git a/src/renderer/src/hooks/caves/index.ts b/src/renderer/src/hooks/caves/index.ts index b92ca72..0348722 100644 --- a/src/renderer/src/hooks/caves/index.ts +++ b/src/renderer/src/hooks/caves/index.ts @@ -3,11 +3,13 @@ import { useShallow } from 'zustand/react/shallow' import { usePlayLevel, useSlamLevel } from '../isles' import { useAnyGun, + useAnyKong, useBalloon, useBarrel, useBlast, useBongos, useBoulderTech, + useCamera, useCoconut, useDiddy, useDk, @@ -270,14 +272,11 @@ export const useTinyCaveGb = (): boolean => { } export const useTinyPortGb = (): LogicBool => { - const inStage = usePlayCaves() - const mini = useMini() + const funky = useCavesMiniFunky() const port = useMonkeyport() - const warpAll = useBananaportAll() - const twirl = useTwirl() return { - in: inStage && mini && port, - out: inStage && twirl && warpAll && port + in: funky.in && port, + out: funky.out && port } } @@ -299,3 +298,42 @@ export const useTinyCabinGb = (): LogicBool => { out: inStage && sax && shockwave && feather } } + +export const useGeneralThing = (): boolean => { + const inStage = usePlayCaves() + return useAnyKong() && inStage +} + +export const useGeneralDirt = (): boolean => { + const inStage = usePlayCaves() + return useShockwave() && inStage +} + +export const useKoshaDirt = (): LogicBool => { + const igloo = useChunkyClearGb() + const port = useMonkeyport() + const shock = useShockwave() + return { + in: igloo.in && port && shock, + out: igloo.out && port && shock + } +} + +export const useGenericFairy = (): boolean => { + const inStage = usePlayCaves() + return useCamera() && inStage +} + +export const useIglooFairy = (): boolean => { + const thing = useTinyIglooGb() + return useCamera() && thing +} + +export const useCabinFairy = (): LogicBool => { + const thing = useDiddyCandleGb() + const camera = useCamera() + return { + in: thing.in && camera, + out: thing.out && camera + } +} diff --git a/src/renderer/src/hooks/factory/index.ts b/src/renderer/src/hooks/factory/index.ts index 00544f6..b60abdd 100644 --- a/src/renderer/src/hooks/factory/index.ts +++ b/src/renderer/src/hooks/factory/index.ts @@ -6,6 +6,7 @@ import { useAnyKong, useBalloon, useBlast, + useCamera, useCharge, useChunky, useCoconut, @@ -19,6 +20,7 @@ import { useLanky, useMini, usePunch, + useShockwave, useSlam, useSpring, useStand, @@ -303,3 +305,57 @@ export const useTinyProductionGb = (): LogicBool => { out: production && (twirl || dk) } } + +export const useGeneralThing = (): boolean => { + const inStage = usePlayFactory() + const anyKong = useAnyKong() + return inStage && anyKong +} + +export const useArena = (): boolean => { + const inStage = useFactoryTesting() + const grab = useGrab() + return inStage && grab +} + +export const useGeneralTest = (): boolean => { + const inStage = useFactoryTesting() + const anyKong = useAnyKong() + return inStage && anyKong +} + +export const useGeneralDirt = (): boolean => { + const thing = useGeneralThing() + const dirt = useShockwave() + return thing && dirt +} + +export const useFactoryDirt = (): boolean => { + const inStage = usePlayFactory() + const shockwave = useShockwave() + const punch = usePunch() + return inStage && punch && shockwave +} + +export const useGeneralFairy = (): boolean => { + const thing = useGeneralThing() + const camera = useCamera() + return thing && camera +} + +export const useNumberFairy = (): boolean => { + const testing = useFactoryTesting() + const camera = useCamera() + return testing && camera +} + +export const useDartFairy = (): boolean => { + const banana = useTinyDartGb() + const camera = useCamera() + return banana && camera +} + +export const useProductionKasplat = (): boolean => { + const production = useFactoryProductionTop() + return useAnyKong() && production +} diff --git a/src/renderer/src/hooks/forest/index.ts b/src/renderer/src/hooks/forest/index.ts index 37df893..07c56b3 100644 --- a/src/renderer/src/hooks/forest/index.ts +++ b/src/renderer/src/hooks/forest/index.ts @@ -8,6 +8,7 @@ import { useAnyKong, useBlast, useBoulderTech, + useCamera, useCharge, useChunky, useDiddy, @@ -26,6 +27,7 @@ import { usePunch, useRocket, useSax, + useShockwave, useSlam, useSpring, useSprint, @@ -128,10 +130,10 @@ export const useForestSpiderBoss = (): LogicBool => { * * Due to recent logic changes, this is always possible. * However, the future may put restrictions on again. - * @returns true. This is always possible. + * @returns true (as long as we're in the stage). This is always possible. */ export const useForestMushroomTop = (): boolean => { - return true + return usePlayForest() } /** @@ -285,19 +287,27 @@ export const useDkMillGb = (): LogicBool => { } } -export const useDkBarnGb = (): LogicBool => { +export const useForestBarn = (): LogicBool => { const inStage = usePlayForest() const night = useForestNight() const canSlam = useSlamForest() const dk = useDk() const strong = useStrong() - const vine = useVine() return { - in: inStage && night.in && canSlam && strong && vine, + in: inStage && night.in && canSlam && strong, out: inStage && logicBreak(night) && dk && canSlam } } +export const useDkBarnGb = (): LogicBool => { + const barn = useForestBarn() + const vine = useVine() + return { + in: barn.in && vine, + out: logicBreak(barn) + } +} + export const useLankyMillGb = (): LogicBool => { const inStage = usePlayForest() const night = useForestNight() @@ -368,3 +378,71 @@ export const useTinyBeanGb = (): boolean => { const sax = useSax() return beanstalk && bean && mini && sax } + +export const useGeneralThing = (): boolean => { + const inStage = usePlayForest() + const anyKong = useAnyKong() + return inStage && anyKong +} + +export const useArena = (): boolean => { + const top = useForestMushroomTop() + const anyKong = useAnyKong() + return top && anyKong +} + +export const useBeanDirt = (): boolean => { + const beanstalk = useForestBean() + return useShockwave() && beanstalk +} + +export const useGeneralDirt = (): boolean => { + const inStage = usePlayForest() + return useShockwave() && inStage +} + +export const useBarnFairy = (): LogicBool => { + const barn = useForestBarn() + const camera = useCamera() + return { + in: barn.in && camera, + out: barn.out && camera + } +} + +export const useRaftersFairy = (): LogicBool => { + const rafters = useDiddyRaftersGb() + const camera = useCamera() + return { + in: rafters.in && camera, + out: rafters.out && camera + } +} + +export const useGeneralFairy = (): boolean => { + const thing = useGeneralThing() + const camera = useCamera() + return thing && camera +} + +export const useBarnKasplat = (): LogicBool => { + const inStage = usePlayForest() + const night = useForestNight() + const anyGun = useAnyGun() + return { + in: inStage && night.in && anyGun, + out: inStage && (night.in || night.out) + } +} + +export const useOwlKasplat = (): boolean => { + const inStage = useForestOwl() + const anyKong = useAnyKong() + return inStage && anyKong +} + +export const useNightKasplat = (): boolean => { + const inStage = useForestMushroomTop() + const anyKong = useAnyKong() + return inStage && anyKong +} diff --git a/src/renderer/src/hooks/galleon/index.ts b/src/renderer/src/hooks/galleon/index.ts index 1914fea..3ed7532 100644 --- a/src/renderer/src/hooks/galleon/index.ts +++ b/src/renderer/src/hooks/galleon/index.ts @@ -4,10 +4,12 @@ import { useCurrentPearlCount } from '../consumables' import { useFastMermaid } from '../fast-checks' import { usePlayLevel, useSlamLevel } from '../isles' import { + useAnyKong, useBalloon, useBlast, useBongos, useBoulderTech, + useCamera, useDiddy, useDive, useDk, @@ -19,6 +21,7 @@ import { usePunch, useRocket, useSax, + useShockwave, useSlam, useSpring, useTiny, @@ -103,6 +106,16 @@ export const useGalleonLighthousePlatform = (): LogicBool => { } } +export const useGalleonLighthouseInside = (): LogicBool => { + const canSlam = useSlamGalleon() + const lighthousePlatform = useGalleonLighthousePlatform() + const dk = useDk() + return { + in: lighthousePlatform.in && canSlam && dk, + out: lighthousePlatform.out && canSlam && dk + } +} + /** * Can we board the ship summoned by turning on the Lighthouse in Galleon? * @returns a truthy statement if we can board the ship. @@ -179,15 +192,12 @@ export const useGalleonTreasureRoom = (): LogicBool => { } export const useDkLighthouseGb = (): LogicBool => { - const canSlam = useSlamGalleon() - const lighthouseArea = useGalleonLighthouseArea() - const highTide = useGalleonHighTide() - const dk = useDk() const grab = useGrab() + const inside = useGalleonLighthousePlatform() const seasick = useDonkStore(useShallow((state) => state.removeBarriers.galleonSeasick)) return { - in: lighthouseArea && highTide && canSlam && dk && (seasick || grab), - out: lighthouseArea && canSlam && dk && (seasick || grab) + in: inside.in && (seasick || grab), + out: inside.out && (seasick || grab) } } @@ -362,3 +372,68 @@ export const useTinyClams = (): LogicBool => { out: treasure.out && mini } } + +export const useGeneralThing = (): boolean => { + const inStage = usePlayGalleon() + return useAnyKong() && inStage +} + +export const useArena = (): boolean => { + const inStage = usePlayGalleon() + return usePunch() && inStage +} + +export const useGeneralOutskirts = (): boolean => { + const inStage = useGalleonOutskirts() + return useAnyKong() && inStage +} + +export const useLighthouseDirt = (): LogicBool => { + const inside = useGalleonLighthouseInside() + const dirt = useShockwave() + return { + in: inside.in && dirt, + out: inside.out && dirt + } +} + +export const useGeneralDirt = (): boolean => { + const thing = useGeneralThing() + return useShockwave() && thing +} + +export const useChestFairy = (): boolean => { + const thing = useChunkyChestGb() + const fairy = useCamera() + return thing && fairy +} + +export const useShipFairy = (): boolean => { + const ship = useTiny5DoorShipGb() + const fairy = useCamera() + return ship && fairy +} + +export const useGeneralFairy = (): boolean => { + const thing = useGeneralThing() + return useCamera() && thing +} + +export const useTreasureKasplat = (): LogicBool => { + const treasure = useGalleonTreasureRoom() + const spring = useSpring() + const highGrab = useHighGrab() + return { + in: treasure.in && spring, + out: logicBreak(treasure) && (spring || highGrab) + } +} + +export const useCannonKasplat = (): LogicBool => { + const highTide = useGalleonHighTide() + const cannon = useGalleonCannon() + return { + in: cannon && highTide, + out: cannon + } +}