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)
15 lines
349 B
TOML
15 lines
349 B
TOML
name = "punch"
|
|
move_type = "attack"
|
|
stamina_cost = 5.0
|
|
timing_window_ms = 800
|
|
damage_pct = 0.15
|
|
|
|
[variants.left]
|
|
aliases = ["pl"]
|
|
telegraph = "{attacker} winds up a left hook!"
|
|
countered_by = ["dodge right", "parry high"]
|
|
|
|
[variants.right]
|
|
aliases = ["pr"]
|
|
telegraph = "{attacker} winds up a right hook!"
|
|
countered_by = ["dodge left", "parry high"]
|