Add PF2e encounter difficulty calculation with 5-tier budget system
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>
This commit is contained in:
28
apps/web/src/__tests__/factories/build-pf2e-creature.ts
Normal file
28
apps/web/src/__tests__/factories/build-pf2e-creature.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
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,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user