From 15cc0d1ae0158a1c218bd44481891c4f0194f599 Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Fri, 13 Feb 2026 23:21:50 -0500 Subject: [PATCH] Add announce and resolve templates to combat moves --- content/combat/punch.toml | 10 ++++++++-- content/combat/roundhouse.toml | 5 ++++- content/combat/sweep.toml | 5 ++++- src/mudlib/combat/moves.py | 29 +++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 4 deletions(-) diff --git a/content/combat/punch.toml b/content/combat/punch.toml index 2a7f0fa..88dc0d5 100644 --- a/content/combat/punch.toml +++ b/content/combat/punch.toml @@ -6,9 +6,15 @@ timing_window_ms = 1800 damage_pct = 0.15 [variants.left] -telegraph = "{attacker} winds up a left hook!" +telegraph = "{attacker} retracts {his} left arm..." +announce = "{attacker} throw{s} a left hook at {defender}!" +resolve_hit = "{attacker} connect{s} with a left hook!" +resolve_miss = "{defender} dodge{s} {attacker}'s left hook!" countered_by = ["dodge right", "parry high"] [variants.right] -telegraph = "{attacker} winds up a right hook!" +telegraph = "{attacker} retracts {his} right arm..." +announce = "{attacker} throw{s} a right hook at {defender}!" +resolve_hit = "{attacker} connect{s} with a right hook!" +resolve_miss = "{defender} dodge{s} {attacker}'s right hook!" countered_by = ["dodge left", "parry high"] diff --git a/content/combat/roundhouse.toml b/content/combat/roundhouse.toml index 4827ec5..b805111 100644 --- a/content/combat/roundhouse.toml +++ b/content/combat/roundhouse.toml @@ -2,7 +2,10 @@ name = "roundhouse" description = "a spinning kick that sacrifices speed for devastating power" move_type = "attack" stamina_cost = 8.0 -telegraph = "{attacker} spins into a roundhouse kick!" +telegraph = "{attacker} shifts {his} weight back..." +announce = "{attacker} launch{es} a roundhouse kick at {defender}!" +resolve_hit = "{attacker}'s roundhouse slams into {defender}!" +resolve_miss = "{defender} counter{s} {attacker}'s roundhouse!" timing_window_ms = 2000 damage_pct = 0.25 countered_by = ["duck", "parry high", "parry low"] diff --git a/content/combat/sweep.toml b/content/combat/sweep.toml index 78627f5..c88f3aa 100644 --- a/content/combat/sweep.toml +++ b/content/combat/sweep.toml @@ -2,7 +2,10 @@ name = "sweep" description = "a low kick targeting the legs, designed to take an opponent off balance" move_type = "attack" stamina_cost = 6.0 -telegraph = "{attacker} drops low for a leg sweep!" +telegraph = "{attacker} drops low..." +announce = "{attacker} sweep{s} at {defender}'s legs!" +resolve_hit = "{attacker}'s sweep catches {defender}'s legs!" +resolve_miss = "{defender} jump{s} over {attacker}'s sweep!" timing_window_ms = 1800 damage_pct = 0.18 countered_by = ["jump", "parry low"] diff --git a/src/mudlib/combat/moves.py b/src/mudlib/combat/moves.py index f75e338..57a4a4c 100644 --- a/src/mudlib/combat/moves.py +++ b/src/mudlib/combat/moves.py @@ -30,6 +30,13 @@ class CombatMove: # variant key ("left", "right", "" for simple moves) variant: str = "" description: str = "" + # Three-beat output templates + announce: str = "" # POV template for announce beat + resolve_hit: str = "" # POV template for hit (wrong/no defense) + resolve_miss: str = "" # POV template for successful counter + telegraph_color: str = "dim" # color tag for telegraph + announce_color: str = "" # color tag for announce (default/none) + resolve_color: str = "bold" # color tag for resolve def load_move(path: Path) -> list[CombatMove]: @@ -85,6 +92,22 @@ def load_move(path: Path) -> list[CombatMove]: command=base_name, variant=variant_key, description=data.get("description", ""), + announce=variant_data.get("announce", data.get("announce", "")), + resolve_hit=variant_data.get( + "resolve_hit", data.get("resolve_hit", "") + ), + resolve_miss=variant_data.get( + "resolve_miss", data.get("resolve_miss", "") + ), + telegraph_color=variant_data.get( + "telegraph_color", data.get("telegraph_color", "dim") + ), + announce_color=variant_data.get( + "announce_color", data.get("announce_color", "") + ), + resolve_color=variant_data.get( + "resolve_color", data.get("resolve_color", "bold") + ), ) ) return moves @@ -104,6 +127,12 @@ def load_move(path: Path) -> list[CombatMove]: command=base_name, variant="", description=data.get("description", ""), + announce=data.get("announce", ""), + resolve_hit=data.get("resolve_hit", ""), + resolve_miss=data.get("resolve_miss", ""), + telegraph_color=data.get("telegraph_color", "dim"), + announce_color=data.get("announce_color", ""), + resolve_color=data.get("resolve_color", "bold"), ) ]