add: achievement, game

This commit is contained in:
Vick Scarlet
2026-08-16 20:06:16 +08:00
committed by 神戸小鳥
parent 32f703be0f
commit bcfd24bbba
10 changed files with 355 additions and 73 deletions
+8 -5
View File
@@ -63,6 +63,13 @@ export function createState(
talentTriggers: new Map(),
}
}
export function summary({ props }: GameState) {
const { age, ...others } = props.highest
const s = sum(Object.values(others))
return Math.floor(s * 2 + age / 2)
}
export interface FlatState {
AGE: GameState['props']['current']['age']
CHR: GameState['props']['current']['charm']
@@ -131,11 +138,7 @@ const FlatMappers = {
AEVT: state => state.profile.events,
ATLT: state => state.profile.talents,
AACH: state => state.profile.achievements,
SUM: ({ game: { props } }) => {
const { age, ...others } = props.highest
const s = sum(Object.values(others))
return Math.floor(s * 2 + age / 2)
},
SUM: ({ game }) => summary(game),
} as { [Key in FlatStateKey]: FlatMapper<Key> }
export const SupportedFlatStateKeys = new Set(Object.keys(FlatMappers))