Rename newsystem -> fvtt-ts-react-boilerplate, install fvtt-types for real typing throughout (DataModelConfig augmentation, typed sheet overrides), wire up i18n (lang/en.json was an empty directory and fr.json was empty), add MIT license, eslint/prettier/vitest tooling, GitHub Actions CI, and extensive docs/ covering the architecture, adding content, styling, localization, testing, and how to rename this again for a new system.
7 lines
387 B
TypeScript
7 lines
387 B
TypeScript
// Pure game-logic helpers, deliberately kept free of any Foundry global.
|
|
// Code that touches `actor`/`ChatMessage`/etc. needs a running Foundry instance
|
|
// and isn't realistically unit-testable — this is the boundary to keep that out.
|
|
export const modifier = (score: number) => Math.floor((score - 10) / 2);
|
|
|
|
export const fmtMod = (mod: number) => (mod >= 0 ? `+${mod}` : `${mod}`);
|