Skip to main content

✅ Berith stacks up to 3 times per main phase

CategoryAbility
StatusPassing
Testtests/test_abilities_passive.py::test_berith_stacks_up_to_3_times_per_main_phase

3 enemy actions → Berith has +3 PWR / -3 AP Cost stacked.

Preconditions

  • Lane 0: P1's Berith (#070, base PWR=4)

  • Lane 1: P2's Duban (#001)

Action

  • Fire ABILITY_USED 4 times (side=PLAYER_2)
from engine.events import GameEvent, EventType, fire_event
from engine.operations import get_effective_pwr
from engine.status_effects import get_stat_modifier

state = make_game_state()
berith = make_demon("070", lane=0, owner=Side.PLAYER_1)
duban = make_demon("001", lane=1, owner=Side.PLAYER_2)
state = place_demon(state, berith)
state = place_demon(state, duban)

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

for i in range(4):
event = GameEvent(
event_type=EventType.ABILITY_USED,
source=duban_on_field,
target=None,
value=0,
side=Side.PLAYER_2,
lane=1,
)
state = fire_event(state, event)
duban_on_field = next(d for d in state.demons if d.unit_id == "001")

berith_after = next(d for d in state.demons if d.unit_id == "070")
pwr = get_effective_pwr(state, berith_after)
ap_mod = get_stat_modifier(state, berith_after, "ap_cost")
counter = berith_after.abilities_used_this_turn.get("0", 0)

Expected Postconditions

  • After 3 fires: Berith PWR = 4 + 3 = 7, ap_cost mod = -3, counter = 3

  • After 4th fire: Berith PWR still 7, ap_cost mod still -3, counter still 3

Assertions

assert pwr == 7, f"Capped at 3 stacks → PWR = 4 + 3 = 7. Got {pwr}"
assert ap_mod == -3, f"Capped at 3 stacks → ap_cost mod = -3. Got {ap_mod}"
assert counter == 3, f"Counter capped at 3. Got {counter}"