Skip to main content

✅ Start contract phase draws and gains ap

CategoryAbility
StatusPassing
Testtests/test_turn_sequence.py::test_start_contract_phase_draws_and_gains_ap

start_contract_phase draws 1 card and adds 3 AP for each player.

Preconditions

  • P1 timekeeping_deck = ["001", "002", "003"], P1 hand = [], P1 AP = 2.

  • P2 timekeeping_deck = ["009", "012"], P2 hand = ["011"], P2 AP = 0.

  • phase = Phase.CONTRACT, cycle = 1.

Action

  • start_contract_phase(state)

Expected Postconditions

  • P1 hand = ["001"] (drew 1 from timekeeping).

  • P1 timekeeping_deck = ["002", "003"] (popped front).

  • P1 AP = 5 (was 2, added 3 — ADDITIVE, not reset).

  • P2 hand = ["011", "009"] (drew 1 from timekeeping, appended).

  • P2 timekeeping_deck = ["012"] (popped front).

  • P2 AP = 3 (was 0, added 3).

  • contracted_demons cleared to {P1: None, P2: None}.

  • phase = Phase.CONTRACT.

Assertions

assert p1.hand == ["001"]
assert p1.timekeeping_deck == ["002", "003"]
assert p1.ap == 5
assert p2.hand == ["011", "009"]
assert p2.timekeeping_deck == ["012"]
assert p2.ap == 3
assert result.contracted_demons[Side.PLAYER_1] is None
assert result.contracted_demons[Side.PLAYER_2] is None
assert result.phase == Phase.CONTRACT
assert state.players[Side.PLAYER_1].ap == 2 # original not mutated