Files
gcsim-translater/lib/translator/build.ts
T
gunshiz 73efb513d2
CI / verify (push) Successful in 42s
CI / build-and-deploy (push) Successful in 1m57s
feat : add import from gcsim and roation translater
2026-09-13 15:22:31 +07:00

10 lines
1.0 KiB
TypeScript

import { rollKeys, type Build, type Catalog, type CatalogItem, type RollKey } from "./types";
const emptyRolls = Object.fromEntries(rollKeys.map((key) => [key, 0])) as Record<RollKey, number>;
export function createBuild(catalog: Catalog, character: CatalogItem, id: string): Build {
const weapon = catalog.weapons.find((item) => !character.weaponType || item.weaponType === character.weaponType) ?? catalog.weapons[0];
const artifact = catalog.artifacts[0];
return { id, characterId: character.id, characterKey: character.key, characterName: character.name, characterImageUrl: character.imageUrl, level: 90, maxLevel: 90, constellation: 0, talents: [9, 9, 9], weaponId: weapon.id, weaponKey: weapon.key, weaponName: weapon.name, weaponLevel: 90, weaponMaxLevel: 90, refinement: 1, artifactMode: "4pc", artifactOneId: artifact.id, artifactOneKey: artifact.key, artifactOneName: artifact.name, artifactTwoId: "", artifactTwoKey: "", artifactTwoName: "", sands: "atk%", goblet: "atk%", circlet: "cr", rolls: { ...emptyRolls } };
}