Skip to main content

✅ Scorpio pushes target after action

CategoryAbility
StatusPassing
Testtests/test_abilities_passive.py::test_scorpio_pushes_target_after_action

After Scorpio uses an action targeting a demon, the target is

Preconditions

  • Lane 0: P1's Scorpio (#062) — READIED

  • Lane 0: P2's Duban (#001) — READIED (target of Scorpio's action)

Action

  • Fire ABILITY_USED event with source=Scorpio, target=Duban (both in lane 0)
from engine.events import GameEvent, EventType, fire_event

state = make_game_state()
scorpio = make_demon("062", lane=0, owner=Side.PLAYER_1)
duban = make_demon("001", lane=0, owner=Side.PLAYER_2)
state = place_demon(state, scorpio)
state = place_demon(state, duban)

scorpio_on_field = next(d for d in state.demons if d.unit_id == "062")
duban_on_field = next(d for d in state.demons if d.unit_id == "001")

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

scorpio_after = next(d for d in new_state.demons if d.unit_id == "062")
duban_after = next(d for d in new_state.demons if d.unit_id == "001")

# Duban should be pushed at least 1 lane away from Scorpio (lane 0)

Expected Postconditions

  • Duban is pushed away from Scorpio (lane 0): ends up in lane 1 or lane 2

  • Scorpio stays in lane 0

Assertions

assert duban_after.lane > 0, (
f"Expected Duban pushed away from lane 0, got lane {duban_after.lane}"
)
# Scorpio unmoved
assert scorpio_after.lane == 0, f"Scorpio should stay in lane 0, got {scorpio_after.lane}"