Skip to main content

✅ Conformity replace skips fatally wounded target

CategoryAbility
StatusPassing
Testtests/test_abilities_familiars.py::test_conformity_replace_skips_fatally_wounded_target

Conformity A's replace trigger does NOT fire on a Fatally Wounded target.

Preconditions

  • Lane 0: P1's Conformity A (117_1) — 12 HP, 0 damage, READIED.

  • Lane 0: P2's Duban (001) — 6 HP, 6 damage (Fatally Wounded).

  • P1's familiar_deck = ["117_2"].

Action

  • Fire ABILITY_USED event targeting the Fatally Wounded Duban.
from engine.events import fire_event

state = make_game_state()
state.players[Side.PLAYER_1].familiar_deck = ["117_2"]

conformity = make_familiar_demon("117_1", lane=0, owner=Side.PLAYER_1)
state = place_demon(state, conformity)
conformity = state.demons[-1]

# Duban fatally wounded: damage=6 >= hp=6
duban = make_demon("001", lane=0, owner=Side.PLAYER_2, damage=6)
duban.fatally_wounded = True
state = place_demon(state, duban)
duban = state.demons[-1]

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

# Duban should still be on field (FW targets are exempt from replace)
duban_on_field = [d for d in new_state.demons if d.unit_id == "001"]

Expected Postconditions

  • Duban is still on field (not replaced — FW targets are skipped).

  • P1's familiar_deck still contains "117_2".

Assertions

assert len(duban_on_field) == 1, (
"Fatally Wounded Duban should NOT be replaced by Conformity ability."
)

# familiar_deck unchanged
assert "117_2" in new_state.players[Side.PLAYER_1].familiar_deck, (
"familiar_deck should be unchanged when FW target is skipped."
)