update: game core flow pages

This commit is contained in:
Vick Scarlet
2026-08-16 20:06:16 +08:00
committed by 神戸小鳥
parent 25bd9ce2b7
commit 0c0fac5bfd
34 changed files with 890 additions and 768 deletions
+15 -5
View File
@@ -10,6 +10,15 @@ import type { Talent } from '@remake/data/talent'
const pickedAtom = atom(new Set<Talent['id']>())
const replacedAtom = atom<TalentsPickedResult | null>(null)
export const useTalentReset = () => {
const setPicked = useSetAtom(pickedAtom)
const setReplaced = useSetAtom(replacedAtom)
return useCallback(() => {
setPicked(new Set())
setReplaced(null)
}, [setPicked, setReplaced])
}
export const usePicked = () => {
const picked = useAtomValue(pickedAtom)
if (!picked) throw new Error('No talents picked')
@@ -26,11 +35,12 @@ export const useTalentPuller = () => {
const [profile] = useProfile()
const [pulled, setPulled] = useState<Talent['id'][] | null>(null)
const puller = useCallback(
(rng?: RNG) => setPulled(pull(p, profile, rng)),
// (rng?: RNG) =>
// setPulled([
// 1142, 1143, 1144, 1145, 1146, 1086, 1122, 1111, 1130, 1048,
// ]),
// (rng?: RNG) => setPulled(pull(p, profile, rng)),
(rng?: RNG) =>
setPulled([
1142, 1143, 1144, 1145, 1146, 1086, 1122, 1111, 1130, 1048,
1033,
]),
[p, profile, setPulled],
)
return [pulled, puller] as const