Skip to main content

✅ Alecto survives fatal wound

CategoryAbility
StatusPassing
Testtests/test_abilities_familiars.py::test_alecto_survives_fatal_wound

Alecto would be Fatally Wounded but instead exhausts and heals.

Preconditions

  • Lane 0: P1's Alecto (026_1) — 7 HP, 7 damage (Fatally Wounded), READIED.

  • P1 CP: 0.

Action

  • Fire FATALLY_WOUNDED event targeting Alecto.
state = make_game_state()
state.players[Side.PLAYER_1].cp = 0

alecto = make_familiar_demon("026_1", lane=0, owner=Side.PLAYER_1, damage=7)
state = place_demon(state, alecto)
alecto = state.demons[-1]

Expected Postconditions

  • Alecto is EXHAUSTED (not removed from field).

  • Alecto damage = 0.

  • P1 CP = 2 (Alecto's CP value).

  • Alecto still on field.

Assertions

assert check_fatally_wounded(state, alecto), "Alecto should be fatally wounded before event."

new_state = fire_event(
state,
GameEvent(
event_type=EventType.FATALLY_WOUNDED,
source=None,
target=alecto,
value=0,
side=Side.PLAYER_1,
lane=0,
),
)

# Alecto still on field
alecto_after = next((d for d in new_state.demons if d.unit_id == "026_1"), None)
assert alecto_after is not None, "Alecto should still be on field (not die)."
assert alecto_after.state == DemonState.EXHAUSTED, "Alecto should be exhausted."
assert alecto_after.damage == 0, "Alecto damage should be cleared."

# P1 gains CP = Alecto's CP
alecto_data = FAMILIARS["026_1"]
assert new_state.players[Side.PLAYER_1].cp == alecto_data.cp, (
f"P1 should gain CP={alecto_data.cp} when Alecto triggers survival."
)