Add announce and resolve templates to combat moves

This commit is contained in:
Jared Miller 2026-02-13 23:21:50 -05:00
parent 2b21257d26
commit 15cc0d1ae0
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C
4 changed files with 45 additions and 4 deletions

View file

@ -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"]

View file

@ -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"]

View file

@ -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"]

View file

@ -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"),
)
]