Skip to main content

✅ Sabnock pink haze quick response prevents damage

CategoryAbility
StatusPassing
Testtests/test_abilities_actions.py::test_sabnock_pink_haze_quick_response_prevents_damage

Tests interaction between Sabnock.

Preconditions

  • P2 Main Phase, P2 has 3 AP

  • Lane 0: P1's Sabnock (#003) — 15 HP, 0 damage, READIED, has 2 AP

  • Lane 0: P2's attacker demon — PWR=2, READIED

  • No status effects active

Action

  • P2 declares attack on Sabnock with their 2 PWR demon

  • Quick window opens — P1 responds with Sabnock's Pink Haze targeting attacker

  • Pink Haze resolves FIRST: attacker gets -3 PWR status

  • THEN the attack resolves: attacker effective PWR = max(0, 2-3) = 0

  • Sabnock takes 0 damage

from engine.operations import deal_damage, get_effective_pwr, get_effective_def

sabnock = make_demon("003", lane=0, owner=Side.PLAYER_1)
attacker = make_demon("003", lane=0, owner=Side.PLAYER_2)
state, placed = _state_with_demons(sabnock, attacker, ap_p1=3, ap_p2=3)
sabnock_p, attacker_p = placed

state_after_quick = execute_ability(state, sabnock_p, ability_idx=0, targets=[attacker_p])

attacker_after_quick = next(d for d in state_after_quick.demons if d.instance_id == attacker_p.instance_id)
attacker_pwr = get_effective_pwr(state_after_quick, attacker_after_quick)

Expected Postconditions

  • Attacker: has status "pwr" -3 (from Pink Haze)

  • Attacker: effective PWR = 0 (2 base - 3 status)

  • Sabnock: 0 damage (attack dealt 0 after debuff)

  • Sabnock: EXHAUSTED (Pink Haze costs exhaust)

  • P1 AP reduced by 1 (Pink Haze cost)

  • Quick resolves BEFORE triggering action — this is the core rule

Assertions

assert attacker_pwr == 0, (
f"Attacker PWR should be 0 after Pink Haze (2 base - 3 debuff, floored). Got {attacker_pwr}"
)

sabnock_after_quick = next(d for d in state_after_quick.demons if d.instance_id == sabnock_p.instance_id)
state_after_attack = deal_damage(state_after_quick, attacker_after_quick, sabnock_after_quick, attacker_pwr)

sabnock_final = next(d for d in state_after_attack.demons if d.instance_id == sabnock_p.instance_id)
assert sabnock_final.damage == 0, (
f"Sabnock should take 0 damage — attacker PWR debuffed to 0 by Pink Haze Quick response. "
f"Got {sabnock_final.damage}. Quick resolves BEFORE the triggering action."
)