Skip to main content

✅ Gear available when window open

CategoryAbility
StatusPassing
Testtests/test_response_windows.py::TestGearWindow::test_gear_available_when_window_open

Tests interaction between Sabnock.

Preconditions

  • P1 Main Phase (current_player=P1)

  • gear_window_open = True

  • P2's demon with a hypothetical Gear ability

Action

See code below.

from engine.action_timing import _can_perform_for_ability

demon = make_demon("003", lane=0, owner=Side.PLAYER_2)
state = _make_state(demon)
state.gear_window_open = True

gear_ability = {"type": "Action", "timing": "gear", "ap_cost": 0,
"tap_required": False, "one_time_use": False}
ok, reason = _can_perform_for_ability(
state, state.demons[0], gear_ability, AbilityTiming.GEAR
)

Expected Postconditions

  • Gear timing check passes (not blocked)

Assertions

assert ok, f"Gear should be allowed when gear_window_open=True. Got: {reason}"