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"; }