Combat frontend rewrite: Clean architecture with structured messages, animations, and i18n

This commit is contained in:
Joan
2026-01-09 11:14:40 +01:00
parent 2875e72b20
commit f986fa18a0
8 changed files with 381 additions and 200 deletions

View File

@@ -39,18 +39,20 @@ def translate_travel_message(direction: str, location_name: str, lang: str = 'en
import json
def create_combat_message(message_type: str, **data) -> str:
"""Create a structured combat message with type and data.
def create_combat_message(message_type: str, origin: str = "neutral", **data) -> str:
"""Create a structured combat message with type, origin, and data.
Args:
message_type: Type of combat message (combat_start, player_attack, etc.)
origin: Origin of the event - "player", "enemy", or "neutral"
**data: Dynamic data for the message (damage, npc_name, etc.)
Returns:
Dictionary with 'type' and 'data' fields
JSON string with 'type', 'origin', and 'data' fields
"""
return json.dumps({
"type": message_type,
"origin": origin,
"data": data
})