Implements PF2e encounter difficulty alongside the existing D&D system. PF2e uses creature level vs party level to derive XP, compares against 5-tier budgets (Trivial/Low/Moderate/Severe/Extreme), and adjusts thresholds for party size. The indicator shows 4 bars in PF2e mode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 lines
617 B
TypeScript
29 lines
617 B
TypeScript
import type { Pf2eCreature } from "@initiative/domain";
|
|
import { creatureId } from "@initiative/domain";
|
|
|
|
let counter = 0;
|
|
|
|
export function buildPf2eCreature(
|
|
overrides?: Partial<Pf2eCreature>,
|
|
): Pf2eCreature {
|
|
const id = ++counter;
|
|
return {
|
|
system: "pf2e",
|
|
id: creatureId(`pf2e-creature-${id}`),
|
|
name: `PF2e Creature ${id}`,
|
|
source: "crb",
|
|
sourceDisplayName: "Core Rulebook",
|
|
level: 1,
|
|
traits: ["humanoid"],
|
|
perception: 5,
|
|
abilityMods: { str: 2, dex: 1, con: 2, int: 0, wis: 1, cha: -1 },
|
|
ac: 15,
|
|
saveFort: 7,
|
|
saveRef: 4,
|
|
saveWill: 5,
|
|
hp: 20,
|
|
speed: "25 ft.",
|
|
...overrides,
|
|
};
|
|
}
|