Compare commits

...

5 Commits

Author SHA1 Message Date
Lukas
5cb5721a6f Redesign PF2e action icons with diamond-parallel geometry
All checks were successful
CI / check (push) Successful in 2m27s
CI / build-image (push) Successful in 18s
Align cutout edges to 45° angles parallel to outer diamond shape.
Multi-action icons use outlined diamonds with matched border width.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 01:07:45 +02:00
Lukas
48795071f7 Hide concentration UI in PF2e mode
All checks were successful
CI / check (push) Successful in 2m26s
CI / build-image (push) Successful in 18s
PF2e uses action-based spell sustaining, not damage-triggered
concentration checks. The Brain icon, purple border accent, and
damage pulse animation are now hidden when PF2e is active, and
the freed gutter column is reclaimed for row content. Concentration
state is preserved so switching back to D&D restores it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 00:25:54 +02:00
Lukas
f721d7e5da Allow /commit skill to be invoked by other skills
All checks were successful
CI / check (push) Successful in 2m26s
CI / build-image (push) Successful in 5s
Remove disable-model-invocation so /ship can delegate to /commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 00:13:59 +02:00
Lukas
e7930a1431 Add /ship skill for commit, tag, and push workflow
All checks were successful
CI / check (push) Successful in 2m27s
CI / build-image (push) Successful in 18s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 00:09:03 +02:00
Lukas
553e09f280 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>
2026-04-09 00:04:47 +02:00
9 changed files with 224 additions and 44 deletions

View File

@@ -1,7 +1,6 @@
--- ---
name: commit name: commit
description: Create a git commit with pre-commit hooks (bypasses sandbox restrictions). description: Create a git commit with pre-commit hooks (bypasses sandbox restrictions).
disable-model-invocation: true
allowed-tools: Bash(git *), Bash(pnpm *) allowed-tools: Bash(git *), Bash(pnpm *)
--- ---

View File

@@ -0,0 +1,54 @@
---
name: ship
description: Commit, tag with the next version, and push to remote.
disable-model-invocation: true
allowed-tools: Bash(git *), Bash(pnpm *), Skill
---
## Instructions
Commit current changes, create the next version tag, and push everything to remote.
### Step 1 — Commit
Use the `/commit` skill to stage and commit changes. Pass along any user arguments as the commit message.
```
/commit $ARGUMENTS
```
### Step 2 — Tag
Get the latest tag and increment the patch number (e.g., `0.9.27``0.9.28`). Create the tag:
```bash
git tag --sort=-v:refname | head -1
```
```bash
git tag <next-version>
```
### Step 3 — Push
Push the commit and tag to remote:
```bash
git push && git push --tags
```
### Step 4 — Verify
Confirm the tag exists on the pushed commit:
```bash
git log --oneline -1 --decorate
```
## User arguments
```text
$ARGUMENTS
```
If the user provided arguments, treat them as the commit message or guidance for what to commit.

View File

@@ -10,6 +10,7 @@ import { Brain, Pencil, X } from "lucide-react";
import { type Ref, useCallback, useEffect, useRef, useState } from "react"; import { type Ref, useCallback, useEffect, useRef, useState } from "react";
import { useEncounterContext } from "../contexts/encounter-context.js"; import { useEncounterContext } from "../contexts/encounter-context.js";
import { useInitiativeRollsContext } from "../contexts/initiative-rolls-context.js"; import { useInitiativeRollsContext } from "../contexts/initiative-rolls-context.js";
import { useRulesEditionContext } from "../contexts/rules-edition-context.js";
import { useSidePanelContext } from "../contexts/side-panel-context.js"; import { useSidePanelContext } from "../contexts/side-panel-context.js";
import { useLongPress } from "../hooks/use-long-press.js"; import { useLongPress } from "../hooks/use-long-press.js";
import { cn } from "../lib/utils.js"; import { cn } from "../lib/utils.js";
@@ -415,12 +416,14 @@ function InitiativeDisplay({
function rowBorderClass( function rowBorderClass(
isActive: boolean, isActive: boolean,
isConcentrating: boolean | undefined, isConcentrating: boolean | undefined,
isPf2e: boolean,
): string { ): string {
if (isActive && isConcentrating) const showConcentration = isConcentrating && !isPf2e;
if (isActive && showConcentration)
return "border border-l-2 border-active-row-border border-l-purple-400 bg-active-row-bg card-glow"; return "border border-l-2 border-active-row-border border-l-purple-400 bg-active-row-bg card-glow";
if (isActive) if (isActive)
return "border border-l-2 border-active-row-border bg-active-row-bg card-glow"; return "border border-l-2 border-active-row-border bg-active-row-bg card-glow";
if (isConcentrating) if (showConcentration)
return "border border-l-2 border-transparent border-l-purple-400"; return "border border-l-2 border-transparent border-l-purple-400";
return "border border-l-2 border-transparent"; return "border border-l-2 border-transparent";
} }
@@ -455,6 +458,8 @@ export function CombatantRow({
const { selectedCreatureId, showCreature, toggleCollapse } = const { selectedCreatureId, showCreature, toggleCollapse } =
useSidePanelContext(); useSidePanelContext();
const { handleRollInitiative } = useInitiativeRollsContext(); const { handleRollInitiative } = useInitiativeRollsContext();
const { edition } = useRulesEditionContext();
const isPf2e = edition === "pf2e";
// Derive what was previously conditional props // Derive what was previously conditional props
const isStatBlockOpen = combatant.creatureId === selectedCreatureId; const isStatBlockOpen = combatant.creatureId === selectedCreatureId;
@@ -495,12 +500,16 @@ export function CombatantRow({
const tempHpDropped = const tempHpDropped =
prevTempHp !== undefined && (combatant.tempHp ?? 0) < prevTempHp; prevTempHp !== undefined && (combatant.tempHp ?? 0) < prevTempHp;
if ((realHpDropped || tempHpDropped) && combatant.isConcentrating) { if (
(realHpDropped || tempHpDropped) &&
combatant.isConcentrating &&
!isPf2e
) {
setIsPulsing(true); setIsPulsing(true);
clearTimeout(pulseTimerRef.current); clearTimeout(pulseTimerRef.current);
pulseTimerRef.current = setTimeout(() => setIsPulsing(false), 1200); pulseTimerRef.current = setTimeout(() => setIsPulsing(false), 1200);
} }
}, [currentHp, combatant.tempHp, combatant.isConcentrating]); }, [currentHp, combatant.tempHp, combatant.isConcentrating, isPf2e]);
useEffect(() => { useEffect(() => {
if (!combatant.isConcentrating) { if (!combatant.isConcentrating) {
@@ -518,24 +527,33 @@ export function CombatantRow({
ref={ref} ref={ref}
className={cn( className={cn(
"group rounded-lg pr-3 transition-colors", "group rounded-lg pr-3 transition-colors",
rowBorderClass(isActive, combatant.isConcentrating), rowBorderClass(isActive, combatant.isConcentrating, isPf2e),
isPulsing && "animate-concentration-pulse", isPulsing && "animate-concentration-pulse",
)} )}
> >
<div className="grid grid-cols-[2rem_3rem_auto_1fr_auto_2rem] items-center gap-1.5 py-3 sm:grid-cols-[2rem_3.5rem_auto_1fr_auto_2rem] sm:gap-3 sm:py-2"> <div
{/* Concentration */} className={cn(
<button "grid items-center gap-1.5 py-3 sm:gap-3 sm:py-2",
type="button" isPf2e
onClick={() => toggleConcentration(id)} ? "grid-cols-[3rem_auto_1fr_auto_2rem] pl-3 sm:grid-cols-[3.5rem_auto_1fr_auto_2rem]"
title="Concentrating" : "grid-cols-[2rem_3rem_auto_1fr_auto_2rem] sm:grid-cols-[2rem_3.5rem_auto_1fr_auto_2rem]",
aria-label="Toggle concentration" )}
className={cn( >
"-my-2 -ml-[2px] flex w-full items-center justify-center self-stretch pl-[14px] transition-opacity hover:text-hover-neutral hover:opacity-100", {/* Concentration — hidden in PF2e mode */}
concentrationIconClass(combatant.isConcentrating, dimmed), {!isPf2e && (
)} <button
> type="button"
<Brain size={16} /> onClick={() => toggleConcentration(id)}
</button> title="Concentrating"
aria-label="Toggle concentration"
className={cn(
"-my-2 -ml-[2px] flex w-full items-center justify-center self-stretch pl-[14px] transition-opacity hover:text-hover-neutral hover:opacity-100",
concentrationIconClass(combatant.isConcentrating, dimmed),
)}
>
<Brain size={16} />
</button>
)}
{/* Initiative */} {/* Initiative */}
<div className="rounded-md bg-muted/30 px-1"> <div className="rounded-md bg-muted/30 px-1">

View File

@@ -162,20 +162,35 @@ export function ConditionPicker({
<span className="min-w-5 rounded-full bg-accent px-1.5 py-0.5 text-center font-medium text-primary-foreground text-xs"> <span className="min-w-5 rounded-full bg-accent px-1.5 py-0.5 text-center font-medium text-primary-foreground text-xs">
{editing.value} {editing.value}
</span> </span>
<button {(() => {
type="button" const atMax =
className="rounded p-0.5 text-foreground hover:bg-accent/40" def.maxValue !== undefined &&
onMouseDown={(e) => e.preventDefault()} editing.value >= def.maxValue;
onClick={(e) => { return (
e.stopPropagation(); <button
setEditing({ type="button"
...editing, className={cn(
value: editing.value + 1, "rounded p-0.5",
}); atMax
}} ? "cursor-not-allowed text-muted-foreground opacity-50"
> : "text-foreground hover:bg-accent/40",
<Plus className="h-3 w-3" /> )}
</button> disabled={atMax}
onMouseDown={(e) => e.preventDefault()}
onClick={(e) => {
e.stopPropagation();
if (!atMax) {
setEditing({
...editing,
value: editing.value + 1,
});
}
}}
>
<Plus className="h-3 w-3" />
</button>
);
})()}
<button <button
type="button" type="button"
className="ml-0.5 rounded p-0.5 text-foreground hover:bg-accent/40" className="ml-0.5 rounded p-0.5 text-foreground hover:bg-accent/40"

View File

@@ -61,11 +61,13 @@ function TraitSegments({
); );
} }
const ACTION_DIAMOND = "M50 2 L96 50 L50 98 L4 50 Z M48 28 L78 50 L48 72 Z"; const ACTION_DIAMOND = "M50 2 L96 50 L50 98 L4 50 Z M48 27 L71 50 L48 73 Z";
const ACTION_DIAMOND_SOLID = "M50 2 L96 50 L50 98 L4 50 Z"; const ACTION_DIAMOND_SOLID = "M50 2 L96 50 L50 98 L4 50 Z";
const ACTION_DIAMOND_OUTLINE =
"M90 2 L136 50 L90 98 L44 50 Z M90 29 L111 50 L90 71 L69 50 Z";
const FREE_ACTION_DIAMOND = const FREE_ACTION_DIAMOND =
"M50 2 L96 50 L50 98 L4 50 Z M50 12 L12 50 L50 88 L88 50 Z"; "M50 2 L96 50 L50 98 L4 50 Z M50 12 L12 50 L50 88 L88 50 Z";
const FREE_ACTION_CHEVRON = "M48 28 L78 50 L48 72 Z"; const FREE_ACTION_CHEVRON = "M48 27 L71 50 L48 73 Z";
const REACTION_ARROW = const REACTION_ARROW =
"M75 15 A42 42 0 1 0 85 55 L72 55 A30 30 0 1 1 65 25 L65 40 L92 20 L65 0 L65 15 Z"; "M75 15 A42 42 0 1 0 85 55 L72 55 A30 30 0 1 1 65 25 L65 40 L92 20 L65 0 L65 15 Z";
@@ -101,7 +103,7 @@ function ActivityIcon({ activity }: Readonly<{ activity: ActivityCost }>) {
<svg aria-hidden="true" className={cls} viewBox="0 0 140 100"> <svg aria-hidden="true" className={cls} viewBox="0 0 140 100">
<path d={ACTION_DIAMOND_SOLID} fill="currentColor" /> <path d={ACTION_DIAMOND_SOLID} fill="currentColor" />
<path <path
d="M90 2 L136 50 L90 98 L44 50 Z M88 28 L118 50 L88 72 Z" d={ACTION_DIAMOND_OUTLINE}
fill="currentColor" fill="currentColor"
fillRule="evenodd" fillRule="evenodd"
/> />
@@ -113,7 +115,7 @@ function ActivityIcon({ activity }: Readonly<{ activity: ActivityCost }>) {
<path d={ACTION_DIAMOND_SOLID} fill="currentColor" /> <path d={ACTION_DIAMOND_SOLID} fill="currentColor" />
<path d="M90 2 L136 50 L90 98 L44 50 Z" fill="currentColor" /> <path d="M90 2 L136 50 L90 98 L44 50 Z" fill="currentColor" />
<path <path
d="M130 2 L176 50 L130 98 L84 50 Z M128 28 L158 50 L128 72 Z" d="M130 2 L176 50 L130 98 L84 50 Z M130 29 L151 50 L130 71 L109 50 Z"
fill="currentColor" fill="currentColor"
fillRule="evenodd" fillRule="evenodd"
/> />

View File

@@ -169,6 +169,60 @@ describe("setConditionValue", () => {
); );
expectDomainError(result, "unknown-condition"); expectDomainError(result, "unknown-condition");
}); });
it("clamps value to maxValue for capped conditions", () => {
const e = enc([makeCombatant("A")]);
const result = setConditionValue(e, combatantId("A"), "dying", 6);
if (isDomainError(result)) throw new Error(result.message);
expect(result.encounter.combatants[0].conditions).toEqual([
{ id: "dying", value: 4 },
]);
expect(result.events[0]).toMatchObject({
type: "ConditionAdded",
value: 4,
});
});
it("allows value at exactly the max", () => {
const e = enc([makeCombatant("A")]);
const result = setConditionValue(e, combatantId("A"), "doomed", 3);
if (isDomainError(result)) throw new Error(result.message);
expect(result.encounter.combatants[0].conditions).toEqual([
{ id: "doomed", value: 3 },
]);
});
it("allows value below the max", () => {
const e = enc([makeCombatant("A")]);
const result = setConditionValue(e, combatantId("A"), "wounded", 2);
if (isDomainError(result)) throw new Error(result.message);
expect(result.encounter.combatants[0].conditions).toEqual([
{ id: "wounded", value: 2 },
]);
});
it("does not cap conditions without a maxValue", () => {
const e = enc([makeCombatant("A")]);
const result = setConditionValue(e, combatantId("A"), "frightened", 10);
if (isDomainError(result)) throw new Error(result.message);
expect(result.encounter.combatants[0].conditions).toEqual([
{ id: "frightened", value: 10 },
]);
});
it("clamps when updating an existing capped condition", () => {
const e = enc([makeCombatant("A", [{ id: "slowed-pf2e", value: 2 }])]);
const result = setConditionValue(e, combatantId("A"), "slowed-pf2e", 5);
if (isDomainError(result)) throw new Error(result.message);
expect(result.encounter.combatants[0].conditions).toEqual([
{ id: "slowed-pf2e", value: 3 },
]);
});
}); });
describe("decrementCondition", () => { describe("decrementCondition", () => {

View File

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

View File

@@ -92,7 +92,11 @@ export function setConditionValue(
const { combatant: target } = found; const { combatant: target } = found;
const current = target.conditions ?? []; const current = target.conditions ?? [];
if (value <= 0) { const def = CONDITION_DEFINITIONS.find((d) => d.id === conditionId);
const clampedValue =
def?.maxValue === undefined ? value : Math.min(value, def.maxValue);
if (clampedValue <= 0) {
const filtered = current.filter((c) => c.id !== conditionId); const filtered = current.filter((c) => c.id !== conditionId);
const newConditions = filtered.length > 0 ? filtered : undefined; const newConditions = filtered.length > 0 ? filtered : undefined;
return { return {
@@ -106,7 +110,7 @@ export function setConditionValue(
const existing = current.find((c) => c.id === conditionId); const existing = current.find((c) => c.id === conditionId);
if (existing) { if (existing) {
const updated = current.map((c) => const updated = current.map((c) =>
c.id === conditionId ? { ...c, value } : c, c.id === conditionId ? { ...c, value: clampedValue } : c,
); );
return { return {
encounter: applyConditions(encounter, combatantId, updated), encounter: applyConditions(encounter, combatantId, updated),
@@ -115,17 +119,25 @@ export function setConditionValue(
type: "ConditionAdded", type: "ConditionAdded",
combatantId, combatantId,
condition: conditionId, condition: conditionId,
value, value: clampedValue,
}, },
], ],
}; };
} }
const added = sortByDefinitionOrder([...current, { id: conditionId, value }]); const added = sortByDefinitionOrder([
...current,
{ id: conditionId, value: clampedValue },
]);
return { return {
encounter: applyConditions(encounter, combatantId, added), encounter: applyConditions(encounter, combatantId, added),
events: [ events: [
{ type: "ConditionAdded", combatantId, condition: conditionId, value }, {
type: "ConditionAdded",
combatantId,
condition: conditionId,
value: clampedValue,
},
], ],
}; };
} }

View File

@@ -260,6 +260,8 @@ Acceptance scenarios:
4. **Given** concentration is active and the row is not hovered, **Then** the Brain icon remains visible. 4. **Given** concentration is active and the row is not hovered, **Then** the Brain icon remains visible.
5. **Given** concentration is active, **When** the user clicks the Brain icon again, **Then** concentration deactivates and the icon hides (unless the row is still hovered). 5. **Given** concentration is active, **When** the user clicks the Brain icon again, **Then** concentration deactivates and the icon hides (unless the row is still hovered).
6. **Given** the Brain icon is visible, **When** the user hovers over it, **Then** a tooltip reading "Concentrating" appears. 6. **Given** the Brain icon is visible, **When** the user hovers over it, **Then** a tooltip reading "Concentrating" appears.
7. **Given** the game system is Pathfinder 2e, **When** viewing any combatant row (hovered or not), **Then** the Brain icon is not shown — even if `isConcentrating` is true.
8. **Given** a combatant has `isConcentrating` true and the game system is PF2e, **When** the user switches to a D&D system, **Then** the Brain icon appears with active styling (concentration state was preserved).
**Story CC-6 — Visual Feedback for Concentration (P2)** **Story CC-6 — Visual Feedback for Concentration (P2)**
As a DM, I want concentrating combatants to have a visible row accent so I can identify them at a glance without interacting. As a DM, I want concentrating combatants to have a visible row accent so I can identify them at a glance without interacting.
@@ -268,6 +270,7 @@ Acceptance scenarios:
1. **Given** concentration is active, **When** viewing the encounter tracker, **Then** the combatant row shows a colored left border accent (`border-l-purple-400`). 1. **Given** concentration is active, **When** viewing the encounter tracker, **Then** the combatant row shows a colored left border accent (`border-l-purple-400`).
2. **Given** concentration is inactive, **Then** no concentration accent is shown. 2. **Given** concentration is inactive, **Then** no concentration accent is shown.
3. **Given** concentration is toggled off, **Then** the left border accent disappears immediately. 3. **Given** concentration is toggled off, **Then** the left border accent disappears immediately.
4. **Given** the game system is Pathfinder 2e and a combatant has `isConcentrating` true, **When** viewing the encounter tracker, **Then** no purple left border accent is shown on that row.
**Story CC-7 — Damage Pulse Alert (P3)** **Story CC-7 — Damage Pulse Alert (P3)**
As a DM, I want a visual alert when a concentrating combatant takes damage so I remember to call for a concentration check. As a DM, I want a visual alert when a concentrating combatant takes damage so I remember to call for a concentration check.
@@ -277,6 +280,7 @@ Acceptance scenarios:
2. **Given** a combatant is concentrating, **When** the combatant is healed, **Then** no pulse/flash occurs. 2. **Given** a combatant is concentrating, **When** the combatant is healed, **Then** no pulse/flash occurs.
3. **Given** a combatant is NOT concentrating, **When** damage is taken, **Then** no pulse/flash occurs. 3. **Given** a combatant is NOT concentrating, **When** damage is taken, **Then** no pulse/flash occurs.
4. **Given** a concentrating combatant takes damage, **When** the animation completes, **Then** the row returns to its normal concentration-active appearance. 4. **Given** a concentrating combatant takes damage, **When** the animation completes, **Then** the row returns to its normal concentration-active appearance.
5. **Given** the game system is Pathfinder 2e and a combatant has `isConcentrating` true, **When** the combatant takes damage, **Then** no pulse/flash animation occurs.
**Story CC-8 — Game System Setting (P2)** **Story CC-8 — Game System Setting (P2)**
As a DM who runs games across D&D 5e, 5.5e, and Pathfinder 2e, I want to choose which game system the tracker uses so that conditions, bestiary search, stat block layout, and initiative calculation all match the game I am running. As a DM who runs games across D&D 5e, 5.5e, and Pathfinder 2e, I want to choose which game system the tracker uses so that conditions, bestiary search, stat block layout, and initiative calculation all match the game I am running.
@@ -310,6 +314,16 @@ Acceptance scenarios:
9. **Given** a combatant has Clumsy 3, **When** the user hovers over the condition icon, **Then** the tooltip shows the condition name, the current value, and the PF2e rules description. 9. **Given** a combatant has Clumsy 3, **When** the user hovers over the condition icon, **Then** the tooltip shows the condition name, the current value, and the PF2e rules description.
10. **Given** a valued condition counter is showing, **When** the user clicks a different valued condition, **Then** the previous counter is replaced (only one counter at a time). 10. **Given** a valued condition counter is showing, **When** the user clicks a different valued condition, **Then** the previous counter is replaced (only one counter at a time).
**Story CC-10 — Condition Value Maximums (P2)**
As a DM running a PF2e encounter, I want valued conditions to be capped at their rule-defined maximum so I cannot accidentally increment them beyond their meaningful range.
Acceptance scenarios:
1. **Given** the game system is Pathfinder 2e, **When** a valued condition reaches its maximum (dying 4, doomed 3, wounded 3, slowed 3), **Then** the `[+]` button in the condition picker counter is disabled.
2. **Given** a combatant has Dying 4, **When** the user opens the condition picker, **Then** the counter shows 4 and `[+]` is disabled; `[-]` and `[✓]` remain active.
3. **Given** a combatant has Slowed 3, **When** the user clicks the Slowed icon tag on the row, **Then** the value decrements to 2 (decrement is unaffected by the cap).
4. **Given** the game system is D&D (5e or 5.5e), **When** interacting with conditions, **Then** no maximum enforcement is applied.
5. **Given** a PF2e valued condition without a defined maximum (e.g., Frightened, Clumsy), **When** incrementing, **Then** no cap is enforced — the value can increase without limit.
### Requirements ### Requirements
- **FR-032**: When a D&D game system is active, the system MUST support the following 15 standard D&D 5e/5.5e conditions: blinded, charmed, deafened, exhaustion, frightened, grappled, incapacitated, invisible, paralyzed, petrified, poisoned, prone, restrained, stunned, unconscious. When Pathfinder 2e is active, the system MUST support the PF2e condition set (see FR-103). - **FR-032**: When a D&D game system is active, the system MUST support the following 15 standard D&D 5e/5.5e conditions: blinded, charmed, deafened, exhaustion, frightened, grappled, incapacitated, invisible, paralyzed, petrified, poisoned, prone, restrained, stunned, unconscious. When Pathfinder 2e is active, the system MUST support the PF2e condition set (see FR-103).
@@ -360,6 +374,11 @@ Acceptance scenarios:
- **FR-105**: For PF2e valued conditions, the condition icon tag MUST display the current value as a small numeric badge (e.g., "2" next to the Frightened icon). Non-valued PF2e conditions display without a badge. - **FR-105**: For PF2e valued conditions, the condition icon tag MUST display the current value as a small numeric badge (e.g., "2" next to the Frightened icon). Non-valued PF2e conditions display without a badge.
- **FR-106**: The condition data model MUST use `ConditionEntry` objects (`{ id: ConditionId, value?: number }`) instead of bare `ConditionId` values. D&D conditions MUST be stored without a `value` field (backwards-compatible). - **FR-106**: The condition data model MUST use `ConditionEntry` objects (`{ id: ConditionId, value?: number }`) instead of bare `ConditionId` values. D&D conditions MUST be stored without a `value` field (backwards-compatible).
- **FR-107**: Switching the game system MUST NOT clear existing combatant conditions. Conditions from the previous game system that are not valid in the new system remain stored but are hidden from display until the user switches back. - **FR-107**: Switching the game system MUST NOT clear existing combatant conditions. Conditions from the previous game system that are not valid in the new system remain stored but are hidden from display until the user switches back.
- **FR-108**: The following PF2e valued conditions MUST have maximum values enforced: dying (max 4), doomed (max 3), wounded (max 3), slowed (max 3). All other valued conditions have no enforced maximum.
- **FR-109**: When a PF2e valued condition is at its maximum value, the `[+]` increment button in the condition picker counter MUST be disabled (visually dimmed and non-interactive).
- **FR-110**: Maximum value enforcement MUST only apply when the Pathfinder 2e game system is active. D&D conditions are unaffected.
- **FR-111**: When Pathfinder 2e is the active game system, the concentration UI (Brain icon toggle, purple left border accent, damage pulse animation) MUST be hidden entirely. The Brain icon MUST NOT be shown on hover or at rest, and the concentration toggle MUST NOT be interactive.
- **FR-112**: Switching the game system MUST NOT clear or modify `isConcentrating` state on any combatant. The state MUST be preserved in storage and restored to the UI when switching back to a D&D game system.
### Edge Cases ### Edge Cases
@@ -375,8 +394,9 @@ Acceptance scenarios:
- The settings modal is app-level UI; it does not interact with encounter state. - The settings modal is app-level UI; it does not interact with encounter state.
- When the game system is switched from D&D to PF2e, existing D&D conditions on combatants are hidden (not deleted). Switching back to D&D restores them. - When the game system is switched from D&D to PF2e, existing D&D conditions on combatants are hidden (not deleted). Switching back to D&D restores them.
- PF2e valued condition at value 0 is treated as removed — it MUST NOT appear on the row. - PF2e valued condition at value 0 is treated as removed — it MUST NOT appear on the row.
- Dying 4 in PF2e has special mechanical significance (death), but the system does not enforce this automatically — it displays the value only. - Dying, doomed, wounded, and slowed have enforced maximum values in PF2e (4, 3, 3, 3 respectively). The `[+]` button is disabled at the cap. The dynamic dying cap based on doomed value (dying max = 4 doomed) is not enforced — only the static maximum applies.
- Persistent damage is excluded from the PF2e MVP condition set. It can be added as a follow-up feature. - Persistent damage is excluded from the PF2e MVP condition set. It can be added as a follow-up feature.
- When PF2e is active, concentration state (`isConcentrating`) is preserved in storage but the entire concentration UI is hidden. Switching back to D&D restores Brain icons, purple borders, and pulse behavior without data loss.
--- ---