fix(combat): deed range gating
This commit is contained in:
@@ -192,6 +192,37 @@ def test_tammara_silent_when_grit_exhausted() -> None:
|
||||
assert not any(a.kind == "deed" for a in actions)
|
||||
|
||||
|
||||
def test_tammara_silent_when_target_out_of_deed_range() -> None:
|
||||
tammara = _combatant("tammara", resources={"grit": 3})
|
||||
goblin = _combatant("goblin", hp_max=6)
|
||||
engine, me, _ = _engine(tammara, [])
|
||||
far_goblin = _state(goblin, "monsters", (11, 11), hp=6)
|
||||
engine.states.append(far_goblin)
|
||||
|
||||
actions = default_policy(engine, me)
|
||||
|
||||
assert not any(a.kind == "deed" for a in actions)
|
||||
|
||||
|
||||
def test_tammara_deed_out_of_range_spends_no_grit() -> None:
|
||||
tammara = _combatant("tammara", resources={"grit": 3})
|
||||
goblin = _combatant("goblin", hp_max=6)
|
||||
engine, me, _ = _engine(tammara, [])
|
||||
far_goblin = _state(goblin, "monsters", (11, 11), hp=6)
|
||||
engine.states.append(far_goblin)
|
||||
|
||||
engine._execute(
|
||||
me,
|
||||
Action(
|
||||
kind="deed",
|
||||
target_id=far_goblin.combatant.id,
|
||||
deed_name="up_close_and_deadly",
|
||||
),
|
||||
)
|
||||
|
||||
assert me.resources_left["grit"] == 3
|
||||
|
||||
|
||||
# --- misty: spell_combat + inspire_courage ---
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user