fix(combat): Thread 5-10-5 diagonal parity through all budget-consuming paths
The greedy move/run/flee/charge descent helpers hardcoded diagonal parity 0, letting a speed-30 walker cover 6 diagonal cells (cell-count budget). Under 5-10-5 (SRD Movement, Tactical) the same walker covers only 4 cells (1+2+1+2=6 squares). Threading the running diagonal count: - _best_move_step / _best_flee_step: accept diagonals_used param - _descend_path / _run_line_path / _flee_path: track and pass parity - _charge_end: use _path_cost_5105() instead of len(path) for max check - _path_cost_5105: new helper; computes total 5-10-5 cost of any path Updated golden paths in test_aoo_limit_one_per_round (5-cell path now takes an orthogonal detour to avoid expensive 2nd diagonal), test_run_* (speed-30 diagonal move stops at 4 cells), and staggered_withdraw (single-speed diagonal withdraw stops at 4 cells).
This commit is contained in:
@@ -358,7 +358,9 @@ def test_run_toward_target_outreaches_normal_move() -> None:
|
||||
)
|
||||
eng2.run()
|
||||
move_hero = eng2._states[0]
|
||||
assert move_hero.pos == (6, 6) # only 6 cells of the 15-cell path
|
||||
# 5-10-5: 4 diagonal cells cost 1+2+1+2 = 6 = the speed budget; the old
|
||||
# cell-count budget let a speed-30 walker cover 6 diagonal cells.
|
||||
assert move_hero.pos == (4, 4) # only 4 diagonal cells of the 15-cell path
|
||||
assert grid.distance(run_hero.pos, foe.pos) < grid.distance(move_hero.pos, foe2.pos)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user