Add PF2e persistent damage condition tags
Persistent damage displayed as compact tags with damage type icon and formula (e.g., Flame + "2d6"). Supports fire, bleed, acid, cold, electricity, poison, and mental types. One instance per type, added via sub-picker in the condition picker. PF2e only, persists across reload. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
20
packages/application/src/add-persistent-damage-use-case.ts
Normal file
20
packages/application/src/add-persistent-damage-use-case.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import {
|
||||
addPersistentDamage,
|
||||
type CombatantId,
|
||||
type DomainError,
|
||||
type DomainEvent,
|
||||
type PersistentDamageType,
|
||||
} from "@initiative/domain";
|
||||
import type { EncounterStore } from "./ports.js";
|
||||
import { runEncounterAction } from "./run-encounter-action.js";
|
||||
|
||||
export function addPersistentDamageUseCase(
|
||||
store: EncounterStore,
|
||||
combatantId: CombatantId,
|
||||
damageType: PersistentDamageType,
|
||||
formula: string,
|
||||
): DomainEvent[] | DomainError {
|
||||
return runEncounterAction(store, (encounter) =>
|
||||
addPersistentDamage(encounter, combatantId, damageType, formula),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user