Skip to main content

✅ Locust gluttony buffs beelzebub

CategoryAbility
StatusPassing
Testtests/test_abilities_familiars.py::test_locust_gluttony_buffs_beelzebub

Gluttony marks Locust fatally wounded and buffs Beelzebub.

Preconditions

  • Lane 0: P1's Beelzebub (058) — 12 HP, 8 damage, READIED.

  • Lane 0: P1's Locusts A (058_1) — READIED.

  • P1 AP: 5.

Action

  • Execute Locusts A ability 0 (Gluttony: 0 AP, 1x).

  • After execute_ability returns, manually call resolve_fatally_wounded

from engine.abilities import execute_ability
from engine.operations import check_fatally_wounded

state = make_game_state()
state.players[Side.PLAYER_1].ap = 5
state.players[Side.PLAYER_1].familiar_deck = []
state.current_player = Side.PLAYER_1
state.quick_window_open = True

beelzebub = make_demon("058", lane=0, owner=Side.PLAYER_1, damage=8)
state = place_demon(state, beelzebub)
beelzebub = state.demons[-1]

locust = make_familiar_demon("058_1", lane=0, owner=Side.PLAYER_1)
state = place_demon(state, locust)
locust = state.demons[-1]

# Execute Gluttony — locust is marked fatally wounded but not yet resolved
state_after = execute_ability(state, locust, 0, targets=[])

# Verify Locust is now fatally wounded
locust_after = next((d for d in state_after.demons if d.unit_id == "058_1"), None)

Expected Postconditions

  • Locusts A is marked fatally wounded during ability.

  • After resolve_fatally_wounded: Locusts A removed from field, in P1 familiar_deck.

  • Beelzebub damage reduced by 3 (from 8 to 5).

  • Beelzebub has +2 PWR status.

  • Beelzebub has -1 AP Cost status.

  • Beelzebub has "cannot_ready" status.

  • P1 AP = 5 (0 AP cost for Gluttony).

Assertions

assert locust_after is not None, "Locust should still be on field (not resolved yet)."
assert check_fatally_wounded(state_after, locust_after), "Locust should be fatally wounded."

# Beelzebub buffs applied
bee_after = next(d for d in state_after.demons if d.unit_id == "058")
assert bee_after.damage == 5, f"Beelzebub should have 5 damage (8-3), got {bee_after.damage}"

pwr_mod = get_stat_modifier(state_after, bee_after, "pwr")
assert pwr_mod == 2, f"Beelzebub should have +2 PWR status, got {pwr_mod}"

ap_mod = get_stat_modifier(state_after, bee_after, "ap_cost")
assert ap_mod == -1, f"Beelzebub should have -1 AP Cost status, got {ap_mod}"

cannot_ready = get_stat_modifier(state_after, bee_after, "cannot_ready")
assert cannot_ready == 1, "Beelzebub should have cannot_ready status."

# Simulate game loop: resolve the fatal wound
state_resolved = resolve_fatally_wounded(state_after, locust_after)

locusts_on_field = [d for d in state_resolved.demons if d.unit_id == "058_1"]
assert len(locusts_on_field) == 0, "Locust should be off field after resolve."
assert "058_1" in state_resolved.players[Side.PLAYER_1].familiar_deck
assert "058_1" not in state_resolved.players[Side.PLAYER_1].graveyard