Skip to main content

✅ Perfect defense status expires end of phase

CategoryRegression
StatusPassing
Testtests/test_abilities_complex.py::TestDecarabiaPerfectDefense::test_perfect_defense_status_expires_end_of_phase

Regression: Confusion #9 — Status effects expire end of main phase (NOT permanent).

Preconditions

  • Decarabia used Perfect Defense (+15 DEF status on itself)

  • Status expires_phase == phase_counter (active this phase)

Action

  • phase_counter advances (end of main phase)

  • expire_status_effects() called

result = execute_ability(state, decarabia_p, ability_idx=1)
dec_after = next(d for d in result.demons if d.unit_id == "008")
effects_before = get_active_effects_on(result, dec_after)

Expected Postconditions

  • Decarabia has NO active DEF status effects after phase advances

Assertions

assert any(e.stat == "def" for e in effects_before), "Status must be active before phase end"
# Advance phase and expire
result2 = expire_status_effects(result)
dec_final = next(d for d in result2.demons if d.unit_id == "008")
effects_after = get_active_effects_on(result2, dec_final)
assert not any(e.stat == "def" for e in effects_after), "Status must expire"