Implement the 018-combatant-concentration feature that adds a per-combatant concentration toggle with Brain icon, purple border accent, and damage pulse animation in the encounter tracker

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-03-06 14:34:28 +01:00
parent febe892e15
commit e59fd83292
19 changed files with 779 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ import {
setAcUseCase,
setHpUseCase,
setInitiativeUseCase,
toggleConcentrationUseCase,
toggleConditionUseCase,
} from "@initiative/application";
import type {
@@ -204,6 +205,19 @@ export function useEncounter() {
[makeStore],
);
const toggleConcentration = useCallback(
(id: CombatantId) => {
const result = toggleConcentrationUseCase(makeStore(), id);
if (isDomainError(result)) {
return;
}
setEvents((prev) => [...prev, ...result]);
},
[makeStore],
);
return {
encounter,
events,
@@ -217,5 +231,6 @@ export function useEncounter() {
adjustHp,
setAc,
toggleCondition,
toggleConcentration,
} as const;
}