Implement the 013-hp-status-indicators feature that adds visual HP status indicators to combatant rows with a pure domain function deriving bloodied/unconscious states

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-03-05 23:29:24 +01:00
parent 7d440677be
commit 97d3918cef
12 changed files with 550 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
export type HpStatus = "healthy" | "bloodied" | "unconscious";
export function deriveHpStatus(
currentHp: number | undefined,
maxHp: number | undefined,
): HpStatus | undefined {
if (currentHp === undefined || maxHp === undefined) return undefined;
if (currentHp <= 0) return "unconscious";
if (currentHp < maxHp / 2) return "bloodied";
return "healthy";
}