Skip to main content

✅ Foras does not exhaust target if foras not exhausted

CategoryAbility
StatusPassing
Testtests/test_abilities_passive.py::test_foras_does_not_exhaust_target_if_foras_not_exhausted

Foras uses an action WITHOUT exhaust cost (Foras still READIED).

Preconditions

  • Lane 0: P1's Foras (#072) — READIED (no exhaust cost action)

  • Lane 0: P2's Duban (#001) — READIED

Action

  • Fire ABILITY_USED event: source=Foras (READIED), target=Duban
from engine.events import GameEvent, EventType, fire_event

state = make_game_state()
foras = make_demon("072", lane=0, owner=Side.PLAYER_1, state=DemonState.READIED)
duban = make_demon("001", lane=0, owner=Side.PLAYER_2)
state = place_demon(state, foras)
state = place_demon(state, duban)

foras_on_field = next(d for d in state.demons if d.unit_id == "072")
duban_on_field = next(d for d in state.demons if d.unit_id == "001")

event = GameEvent(
event_type=EventType.ABILITY_USED,
source=foras_on_field,
target=duban_on_field,
value=0,
side=Side.PLAYER_1,
lane=0,
)
new_state = fire_event(state, event)

duban_after = next(d for d in new_state.demons if d.unit_id == "001")

Expected Postconditions

  • Duban: still READIED (Foras not exhausted → passive did not trigger)

Assertions

assert duban_after.state == DemonState.READIED, (
f"Expected Duban READIED (Foras not exhausted, passive blocked), got {duban_after.state}"
)