Skip to main content

✅ Question passive deals 11 damage on attack

CategoryAbility
StatusPassing
Testtests/test_abilities_familiars.py::test_question_passive_deals_11_damage_on_attack

A demon attacks Question while Question has an unrevealed card.

Preconditions

  • Lane 0: P1's Question (120_3) with hidden_card="120_2" (Lie), is_familiar=True.

  • Lane 0: P2's Murmur (002) — 12 HP, 0 damage, READIED.

  • P1 CP = 0, P2 CP = 0.

Action

  • Fire DAMAGE_RECEIVED event targeting Question with source=Murmur, value=2.

  • Question's passive should fire: 11 Fixed Damage to Murmur, Question removed.

from engine.events import fire_event

state = make_game_state()
state.players[Side.PLAYER_1].cp = 0
state.players[Side.PLAYER_2].cp = 0

question = make_familiar_demon("120_3", lane=0, owner=Side.PLAYER_1, current_hp=1)
question.abilities_used_this_turn = {"hidden_card": "120_2"}
state = place_demon(state, question)
question = state.demons[-1]

murmur = make_demon("002", lane=0, owner=Side.PLAYER_2)
state = place_demon(state, murmur)
murmur = state.demons[-1]

# Simulate: Murmur attacks Question (DAMAGE_RECEIVED event on Question)
event = GameEvent(
event_type=EventType.DAMAGE_RECEIVED,
source=murmur,
target=question,
value=2,
side=Side.PLAYER_2,
lane=0,
)
new_state = fire_event(state, event)

# Murmur takes 11 Fixed Damage retaliation
murmur_after = next((d for d in new_state.demons if d.unit_id == "002"), None)

Expected Postconditions

  • Murmur has damage = 11 (not FW since HP=12 > 11).

  • Question is removed from field.

  • No CP change (Question is not dead).

Assertions

assert murmur_after is not None, "Murmur should still be on field (11 damage < 12 HP)."
assert murmur_after.damage == 11, (
f"Murmur should have 11 damage from Question's 11 Fixed Damage passive. "
f"Got {murmur_after.damage}."
)

# Question removed from field (no death — not CP/graveyard)
question_on_field = [d for d in new_state.demons if d.unit_id == "120_3"]
assert len(question_on_field) == 0, (
"Question should be removed from field after its passive fires (hidden card revealed)."
)

# No CP gained (Truth/Lie not considered dead)
assert new_state.players[Side.PLAYER_1].cp == 0, "P1 gains no CP — Question is not dead."
assert new_state.players[Side.PLAYER_2].cp == 0, "P2 gains no CP."