Improve PF2e stat block action icons, triggers, and tag handling

- Replace unicode action cost chars with custom SVG icons (diamond
  with chevron for actions, outlined diamond for free, curved arrow
  for reaction) rendered inline via ActivityCost on TraitBlock
- Add activity icons to attacks (all Strikes default to single action)
- Add trigger/effect rendering for reaction abilities (bold labels)
- Fix nested tag stripping ({@b ...{@spell ...}...}) by looping
- Move icon after ability name to match AoN format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-04-08 10:36:30 +02:00
parent 57278e0c82
commit 0c235112ee
7 changed files with 187 additions and 44 deletions

View File

@@ -14,8 +14,15 @@ export interface TraitListItem {
readonly text: string;
}
export interface ActivityCost {
readonly number: number;
readonly unit: "action" | "free" | "reaction";
}
export interface TraitBlock {
readonly name: string;
readonly activity?: ActivityCost;
readonly trigger?: string;
readonly segments: readonly TraitSegment[];
}

View File

@@ -24,6 +24,7 @@ export {
createPlayerCharacter,
} from "./create-player-character.js";
export {
type ActivityCost,
type AnyCreature,
type BestiaryIndex,
type BestiaryIndexEntry,