Skip to main content

✅ Familiar basic action

CategoryAbility
StatusPassing
Testtests/test_abilities_familiars.py::test_familiar_basic_action

A familiar executes its action ability.

Preconditions

  • Lane 0: P1's Abaddon (028) — 15 HP, 6 damage, READIED.

  • Lane 0: P1's Nephilim heart (028_2) familiar — READIED, is_familiar=True.

  • P1 AP: 3.

Action

  • Execute 028_2 ability 1 (Heart of Nephilim: 1 AP, ready, 1x) targeting Abaddon.
from engine.abilities import execute_ability

state = make_game_state()
state.players[Side.PLAYER_1].ap = 3
state.players[Side.PLAYER_1].familiar_deck = ["028_2"]

abaddon = make_demon("028", lane=0, owner=Side.PLAYER_1, damage=6)
state = place_demon(state, abaddon)
abaddon = state.demons[-1]

nephilim = make_familiar_demon("028_2", lane=0, owner=Side.PLAYER_1)
state = place_demon(state, nephilim)
nephilim = state.demons[-1]

# Set state context for Quick ability
state.current_player = Side.PLAYER_1
state.quick_window_open = True

new_state = execute_ability(state, nephilim, 1, targets=[])

# Abaddon damage reduced by 2
abaddon_after = next(d for d in new_state.demons if d.unit_id == "028")

Expected Postconditions

  • Abaddon damage: 4 (was 6, removed 2).

  • P1 AP: 2 (spent 1).

  • Nephilim READIED still (not tap_required).

Assertions

assert abaddon_after.damage == 4, f"Expected Abaddon damage=4, got {abaddon_after.damage}"

# AP spent
assert new_state.players[Side.PLAYER_1].ap == 2, \
f"Expected AP=2 after spending 1, got {new_state.players[Side.PLAYER_1].ap}"