✅ Insanity on exhausted enemy
| Category | Interaction |
| Status | Passing |
| Test | tests/test_abilities_complex.py::TestOseInsanity::test_insanity_on_exhausted_enemy |
Ose uses Insanity on an EXHAUSTED enemy. The enemy gets
Preconditions
-
P1 Main Phase, P1 has 6 AP, P2 has 6 AP
-
Lane 0: P1's Ose (#089) — READIED
-
Lane 0: P2's Sabnock (#003) — EXHAUSTED
-
Lane 0: P1's Flauros (#013) — READIED
Action
-
Ose uses Insanity targeting exhausted Sabnock
-
ignore_exhaust allows Sabnock to perform despite being exhausted
from engine.abilities import execute_ability
from engine.rng import DeterministicRNG
import engine.abilities_actions
importlib.reload(engine.abilities_actions)
ose = make_demon("089", lane=0, owner=Side.PLAYER_1)
sabnock = make_demon("003", lane=0, owner=Side.PLAYER_2)
flauros = make_demon("013", lane=0, owner=Side.PLAYER_1)
state, placed = _make_state_with_demons(ose, sabnock, flauros, ap=6)
ose_p, sabnock_p, flauros_p = placed
# Exhaust Sabnock before Insanity
sabnock_p.state = DemonState.EXHAUSTED
rng = DeterministicRNG(42)
result = execute_ability(
state, ose_p, ability_idx=0,
targets=[sabnock_p],
rng=rng,
)
# ignore_exhaust should be consumed (bonus action used it)
from engine.status_effects import get_stat_modifier
sabnock_after = next(
(d for d in result.demons if d.unit_id == "003"), None
)
Expected Postconditions
-
Bonus action executed (ignore_exhaust bypassed exhaustion)
-
ignore_exhaust consumed
Assertions
assert sabnock_after is not None, "Sabnock should still be on field"
ie = get_stat_modifier(result, sabnock_after, "ignore_exhaust")
assert ie == 0, (
f"ignore_exhaust should be consumed after bonus action on exhausted demon. Got {ie}"
)