Add description field to CombatMove dataclass
This commit is contained in:
parent
77c2e40e0e
commit
9c1c6a9e22
2 changed files with 11 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ class CombatMove:
|
||||||
command: str = ""
|
command: str = ""
|
||||||
# variant key ("left", "right", "" for simple moves)
|
# variant key ("left", "right", "" for simple moves)
|
||||||
variant: str = ""
|
variant: str = ""
|
||||||
|
description: str = ""
|
||||||
|
|
||||||
|
|
||||||
def load_move(path: Path) -> list[CombatMove]:
|
def load_move(path: Path) -> list[CombatMove]:
|
||||||
|
|
@ -83,6 +84,7 @@ def load_move(path: Path) -> list[CombatMove]:
|
||||||
handler=None,
|
handler=None,
|
||||||
command=base_name,
|
command=base_name,
|
||||||
variant=variant_key,
|
variant=variant_key,
|
||||||
|
description=data.get("description", ""),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return moves
|
return moves
|
||||||
|
|
@ -101,6 +103,7 @@ def load_move(path: Path) -> list[CombatMove]:
|
||||||
handler=None,
|
handler=None,
|
||||||
command=base_name,
|
command=base_name,
|
||||||
variant="",
|
variant="",
|
||||||
|
description=data.get("description", ""),
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,10 @@ async def _show_single_command(
|
||||||
|
|
||||||
lines = [defn.name]
|
lines = [defn.name]
|
||||||
|
|
||||||
|
# Show description first for combat moves (most important context)
|
||||||
|
if move is not None and move.description:
|
||||||
|
lines.append(f" {move.description}")
|
||||||
|
|
||||||
# Always show aliases
|
# Always show aliases
|
||||||
if defn.aliases:
|
if defn.aliases:
|
||||||
aliases_str = ", ".join(defn.aliases)
|
aliases_str = ", ".join(defn.aliases)
|
||||||
|
|
@ -135,6 +139,10 @@ async def _show_variant_overview(
|
||||||
|
|
||||||
lines = [defn.name]
|
lines = [defn.name]
|
||||||
|
|
||||||
|
# Show description from first variant (they all share the same one)
|
||||||
|
if variants and variants[0].description:
|
||||||
|
lines.append(f" {variants[0].description}")
|
||||||
|
|
||||||
# Show type from first variant
|
# Show type from first variant
|
||||||
if variants:
|
if variants:
|
||||||
lines.append(f" type: {variants[0].move_type}")
|
lines.append(f" type: {variants[0].move_type}")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue