Fix critical bug in Combat.tsx: message split was using escaped backslash instead of newline

This commit is contained in:
Joan
2026-01-09 11:39:08 +01:00
parent f986fa18a0
commit 7f42fd6b7f
4 changed files with 7 additions and 7 deletions

View File

@@ -283,7 +283,7 @@ async def combat_action(
else:
# Apply damage to NPC
new_npc_hp = max(0, combat['npc_hp'] - damage)
result_message = create_combat_message("player_attack", origin="player", damage=damage)
result_message = f"You attack for {damage} damage! "
# Apply weapon effects
if weapon_effects and 'bleeding' in weapon_effects:
@@ -304,7 +304,7 @@ async def combat_action(
if new_npc_hp <= 0:
# NPC defeated
result_message += "\n" + create_combat_message("victory", origin="neutral", npc_name=npc_def.name)
result_message += f"Victory! Defeated {get_locale_string(npc_def.name)}"
combat_over = True
player_won = True
@@ -435,7 +435,7 @@ async def combat_action(
# Failed to flee, NPC attacks
npc_damage = random.randint(npc_def.damage_min, npc_def.damage_max)
new_player_hp = max(0, player['hp'] - npc_damage)
result_message = create_combat_message("flee_fail", origin="enemy", npc_name=npc_def.name, damage=npc_damage)
result_message = f"Failed to flee! {get_locale_string(npc_def.name)} attacks for {npc_damage} damage!"
if new_player_hp <= 0:
result_message += "\nYou have been defeated!"