The DREAMBOOK always described "punch right/left [target]" as one command with a direction argument, but the implementation had separate TOML files and multi-word command names that the dispatcher couldn't reach (it only matches the first word). Aliases like "pr" also couldn't pass targets because the shared handler tried to re-derive the move from args. Changes: - Merge punch_left/right, dodge_left/right, parry_high/low into single TOML files with [variants] sections - Add command/variant fields to CombatMove for tracking move families - load_move() now returns list[CombatMove], expanding variants - Handlers bound to moves via closures at registration time: variant handler for base commands (punch → parses direction from args), direct handler for aliases and simple moves (pr → move already known) - Core logic in do_attack/do_defend takes a resolved move - Combat doc rewritten as rst with architecture details - Simplify mud.tin aliases (pr/pl/etc are built-in MUD commands now)
10 lines
148 B
TOML
10 lines
148 B
TOML
name = "dodge"
|
|
move_type = "defense"
|
|
stamina_cost = 3.0
|
|
timing_window_ms = 800
|
|
|
|
[variants.left]
|
|
aliases = ["dl"]
|
|
|
|
[variants.right]
|
|
aliases = ["dr"]
|