feat(cli): add --simple-monster-death option to kill monsters at hp <= 0

This commit is contained in:
2026-09-11 12:48:43 +02:00
parent b7c80babfd
commit d6c8f88f77
5 changed files with 365 additions and 4 deletions
+6
View File
@@ -169,6 +169,7 @@ def run_encounter(
policy: Policy | None = None,
spell_registry: dict[str, SpellSpec] | None = None,
capture_first_transcript: bool = False,
monsters_die_at_zero: bool = False,
) -> EncounterReport:
"""Run `runs` battles (one SeededRng per run) and aggregate balance metrics.
@@ -177,6 +178,10 @@ def run_encounter(
When ``capture_first_transcript`` is True, the turn-by-turn log of the
first battle (``seed + 0``) is stored in ``report.transcript``.
``monsters_die_at_zero`` enables the optional simple monster-death rule
(CLI ``--simple-monster-death``): monsters die at hp <= 0; PCs keep the
PF1e hp <= -CON rule. Default False keeps behavior bit-identical.
"""
if runs <= 0:
msg = "runs must be positive"
@@ -202,6 +207,7 @@ def run_encounter(
round_cap=spec.round_cap,
policy=policy,
spell_registry=spell_registry,
monsters_die_at_zero=monsters_die_at_zero,
).run()
if capture_first_transcript and index == 0:
transcript = result.transcript