fix(combat): channel energy targets living vs undead

This commit is contained in:
2026-09-05 00:16:17 +02:00
parent 7591614460
commit 22d76e9677
7 changed files with 124 additions and 27 deletions
+6 -2
View File
@@ -37,15 +37,19 @@ def test_monte_carlo_caster_pc_casts_spell() -> None:
"""oni (cleric) casts against data/spells/ once it drops below 50% HP.
oni's known spells overlap the registry's heal spells (Cure Light/Moderate
Wounds); with enough damage taken it heals via cast_spell. The Monte Carlo
Wounds); with enough damage taken it heals via cast_spell. Channel energy is
stripped from the resource pool: it now heals living creatures in the burst,
so below 50% HP oni self-heals by channeling and never reaches the spell
branch — this test stays a pure spell-wiring check. The Monte Carlo
loop mirrors run_encounter: build fresh states and one CombatEngine per run
with the registry from SPELLS_DIR.
"""
oni = load_combatant(ONI).model_copy(update={"resources": {}})
spec = EncounterSpec(
map=load_map(MAP),
round_cap=100,
sides=(
Side(name="players", combatants=(load_combatant(ONI),), zone="A"),
Side(name="players", combatants=(oni,), zone="A"),
Side(name="monsters", combatants=(load_combatant(GOBLIN),) * 4, zone="B"),
),
)