Skip to main content

✅ Marchosias aoe only one redirect

CategoryInteraction
StatusPassing
Testtests/test_abilities_passive.py::test_marchosias_aoe_only_one_redirect

AoE ability hits multiple allies in Marchosias's lane.

Preconditions

  • Lane 0: P1's Duban (#001), P1's Naberius (#045), P1's Marchosias (#087)

  • Lane 0: P2's attacker (not relevant — testing targeting helper directly)

Action

  • AoE targeting both Duban and Naberius

  • Marchosias can intercept — but only 1 target redirected

from engine.abilities_passive import apply_marchosias_target_redirect
from engine.constants import Range

state = make_game_state()

duban = make_demon("001", lane=0, owner=Side.PLAYER_1)
state = place_demon(state, duban)
duban_p = state.demons[-1]

naberius = make_demon("045", lane=0, owner=Side.PLAYER_1)
state = place_demon(state, naberius)
naberius_p = state.demons[-1]

marchosias = make_demon("087", lane=0, owner=Side.PLAYER_1)
state = place_demon(state, marchosias)
march_p = state.demons[-1]

camio = make_demon("098", lane=0, owner=Side.PLAYER_2)
state = place_demon(state, camio)
camio_p = state.demons[-1]

new_targets, did_redirect = apply_marchosias_target_redirect(
state, camio_p, [duban_p, naberius_p], Range.LOCAL
)

Expected Postconditions

  • New targets: [Marchosias, Naberius] — first target (Duban) replaced

Assertions

assert did_redirect is True, "Should have redirected"
assert len(new_targets) == 2, f"Target count should stay 2. Got {len(new_targets)}"

# Exactly one target should be Marchosias
march_count = sum(1 for t in new_targets if t.unit_id == "087")
assert march_count == 1, f"Exactly 1 target should be Marchosias. Got {march_count}"