import { ABILITY_LABELS, SKILL_LABELS, fmtMod } from '../lib/format'; import type { Ability, SaveBonuses, SkillBonuses } from '../api/types'; import { Rollable } from './Rollable'; const ABILITIES: Ability[] = ['STR', 'DEX', 'CON', 'INT', 'WIS', 'CHA']; // Saving throws, skills and passive scores in one compact block: what the DM // asks for mid-fight. Proficient lines are marked ● and expertise ◆. Used by // the character panel and the encounter screen, so they always agree. A click // on a line rolls it in the dice roller, under `who`'s name. export function SheetNumbers({ who, saves, skills, passives, }: { who: string; saves: SaveBonuses; skills: SkillBonuses; passives: { perception: number; investigation: number; insight: number }; }) { return (
Saving throws
{ABILITIES.map((a) => ( {a} {fmtMod(saves[a].bonus)} ))}
Skills
{Object.entries(skills).map(([skill, detail]) => ( {SKILL_LABELS[skill]}{' '} {detail.ability} {fmtMod(detail.bonus)} ))}
Passive Perception {passives.perception} Passive Investigation {passives.investigation} Passive Insight {passives.insight}

● proficient · ◆ expertise · click a line to roll it

); }