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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user