Enforce maximum values for PF2e numbered conditions

Cap dying (4), doomed (3), wounded (3), and slowed (3) at their
rule-defined maximums. The domain clamps values in setConditionValue
and the condition picker disables the [+] button at the cap.

Closes #31

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-04-09 00:04:47 +02:00
parent 1c107a500b
commit 553e09f280
5 changed files with 120 additions and 20 deletions

View File

@@ -57,6 +57,8 @@ export interface ConditionDefinition {
/** When set, the condition only appears in these systems' pickers. */
readonly systems?: readonly RulesEdition[];
readonly valued?: boolean;
/** Rule-defined maximum value for PF2e valued conditions. */
readonly maxValue?: number;
}
export function getConditionDescription(
@@ -329,6 +331,7 @@ export const CONDITION_DEFINITIONS: readonly ConditionDefinition[] = [
color: "red",
systems: ["pf2e"],
valued: true,
maxValue: 3,
},
{
id: "drained",
@@ -353,6 +356,7 @@ export const CONDITION_DEFINITIONS: readonly ConditionDefinition[] = [
color: "red",
systems: ["pf2e"],
valued: true,
maxValue: 4,
},
{
id: "enfeebled",
@@ -475,6 +479,7 @@ export const CONDITION_DEFINITIONS: readonly ConditionDefinition[] = [
color: "sky",
systems: ["pf2e"],
valued: true,
maxValue: 3,
},
{
id: "stupefied",
@@ -510,6 +515,7 @@ export const CONDITION_DEFINITIONS: readonly ConditionDefinition[] = [
color: "red",
systems: ["pf2e"],
valued: true,
maxValue: 3,
},
] as const;