Skip to main content

✅ Cp goes to owner when familiar dies

CategoryRegression
StatusPassing
Testtests/test_abilities_familiars.py::test_cp_goes_to_owner_when_familiar_dies

Regression: CP goes to the OWNER of the dying demon, not the killer.

Preconditions

  • P1 owns Alecto (026_1, CP=2) on field.

  • P2 kills Alecto.

  • P1 CP = 0, P2 CP = 0.

Action

  • resolve_fatally_wounded for Alecto.
state = make_game_state()
state.players[Side.PLAYER_1].cp = 0
state.players[Side.PLAYER_2].cp = 0
state.players[Side.PLAYER_1].familiar_deck = []

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

new_state = resolve_fatally_wounded(state, alecto)

alecto_cp = FAMILIARS["026_1"].cp

Expected Postconditions

  • P1 CP = 2 (OWNER gains CP — bad for P1).

  • P2 CP = 0 (killer gains NOTHING).

Assertions

assert new_state.players[Side.PLAYER_1].cp == alecto_cp, (
f"P1 (owner) should gain {alecto_cp} CP. Got {new_state.players[Side.PLAYER_1].cp}."
)
assert new_state.players[Side.PLAYER_2].cp == 0, (
"P2 (killer) should gain 0 CP. CP is a loss condition on the owner."
)