fix(rules): allow a free weapon draw with a move at BAB +1
SRD 'Move Actions': 'If you have a base attack bonus of +1 or higher, you may draw a weapon as a free action combined with a regular move.' _filter_turn_actions computes free_draw (BAB >= 1 AND a move action in the turn sequence) and threads it through _effective_slot/_action_economy_filter/_staggered_filter: retrieve_weapon then occupies the free slot instead of the move slot. Static classification stays 'move' (repair_weapon and no-move draws unchanged). Filter-level and engine-level (BAB +2 vs BAB 0) tests added. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -362,6 +362,33 @@ def test_staggered_filter_keeps_withdraw_as_restricted_standard() -> None:
|
||||
assert _staggered_filter((_foe("withdraw"), _foe("attack"))) == (_foe("withdraw"),)
|
||||
|
||||
|
||||
def test_free_draw_with_a_move_at_bab_plus1() -> None:
|
||||
# SRD "Move Actions": "If you have a base attack bonus of +1 or higher,
|
||||
# you may draw a weapon as a free action combined with a regular move."
|
||||
# With the engine's free_draw flag set (BAB >= 1 AND a move in sequence),
|
||||
# retrieve_weapon does not consume the move slot — the standard stays
|
||||
# available for the attack.
|
||||
actions = (_foe("move"), _foe("retrieve_weapon"), _foe("attack"))
|
||||
assert _action_economy_filter(actions, free_draw=True) == actions
|
||||
# Without the free draw the retrieve spends the move slot, converts the
|
||||
# standard slot (move-slot conversion) and the attack is surplus.
|
||||
kept_no_free = _action_economy_filter(actions, free_draw=False)
|
||||
assert tuple(a.kind for a in kept_no_free) == ("move", "retrieve_weapon")
|
||||
# A second standard after a free draw is surplus: the move slot was
|
||||
# taken by the move, the standard by the first attack.
|
||||
kept = _action_economy_filter(
|
||||
(_foe("move"), _foe("retrieve_weapon"), _foe("attack"), _foe("attack")),
|
||||
free_draw=True,
|
||||
)
|
||||
assert tuple(a.kind for a in kept) == ("move", "retrieve_weapon", "attack")
|
||||
# Without a move in the sequence the engine never sets free_draw; the
|
||||
# retrieve then spends the move slot itself and the attack is surplus.
|
||||
kept_no_move = _action_economy_filter(
|
||||
(_foe("retrieve_weapon"), _foe("attack")), free_draw=False
|
||||
)
|
||||
assert tuple(a.kind for a in kept_no_move) == ("retrieve_weapon", "attack")
|
||||
|
||||
|
||||
def test_nauseated_after_budget_keeps_single_move() -> None:
|
||||
# (move, attack, move): the budget drops the second move; the nauseated
|
||||
# filter then keeps only the first move and drops the standard attack.
|
||||
|
||||
Reference in New Issue
Block a user