Antique-localize battle briefings and camp UI

This commit is contained in:
2026-06-19 05:48:39 +09:00
parent dc3dc06eb0
commit 30ac2479c4
11 changed files with 717 additions and 540 deletions

View File

@@ -271,12 +271,14 @@ func _normalized_camp_conversations(source) -> Array:
var label := str(entry.get("label", conversation_id.capitalize())).strip_edges()
if label.is_empty():
label = conversation_id.capitalize()
var speaker := str(entry.get("speaker", "")).strip_edges()
var display_speaker := str(entry.get("display_speaker", speaker)).strip_edges()
result.append({
"id": conversation_id,
"group": str(entry.get("group", "topic")).strip_edges(),
"officer_id": str(entry.get("officer_id", "")).strip_edges(),
"label": label,
"speaker": str(entry.get("speaker", "")).strip_edges(),
"speaker": display_speaker,
"summary": str(entry.get("summary", "")).strip_edges(),
"lines": lines,
"effects": _normalized_camp_conversation_effects(entry.get("effects", []))
@@ -1309,7 +1311,7 @@ func end_player_turn() -> void:
selected_unit_id = ""
current_team = TEAM_ENEMY
_emit_log("Enemy phase begins.")
_emit_log("적군 차례가 열렸습니다.")
_reset_team_actions(TEAM_ENEMY)
if battle_status == STATUS_ACTIVE:
_run_events("turn_start", current_team, turn_number)
@@ -2068,13 +2070,21 @@ func can_player_act() -> bool:
func get_status_text() -> String:
if battle_status == STATUS_VICTORY:
return "Victory"
return "승전"
if battle_status == STATUS_DEFEAT:
return "Defeat"
return "패전"
var turn_limit := get_turn_limit()
if turn_limit > 0:
return "Turn %d/%d - %s" % [turn_number, turn_limit, current_team.capitalize()]
return "Turn %d - %s" % [turn_number, current_team.capitalize()]
return "%d/%d · %s" % [turn_number, turn_limit, _team_status_text(current_team)]
return "%d턴 · %s" % [turn_number, _team_status_text(current_team)]
func _team_status_text(team: String) -> String:
if team == TEAM_PLAYER:
return "아군"
if team == TEAM_ENEMY:
return "적군"
return team.capitalize()
func get_turn_limit() -> int:
@@ -2793,7 +2803,7 @@ func _run_enemy_turn() -> void:
if battle_status == STATUS_ACTIVE:
turn_number += 1
current_team = TEAM_PLAYER
_emit_log("Player phase begins.")
_emit_log("아군 차례가 열렸습니다.")
_reset_team_actions(TEAM_PLAYER)
if battle_status == STATUS_ACTIVE:
_run_events("turn_start", current_team, turn_number)
@@ -3494,9 +3504,9 @@ func _append_all_units_progress_line(result: Array[String], team: String, mode:
return
var living := _count_living_deployed_units(team)
if mode == "defeat":
_append_progress_line(result, "%s remaining %d/%d" % [_condition_team_label(team), living, total], pending)
_append_progress_line(result, "%s 잔존 %d/%d" % [_condition_team_label(team), living, total], pending)
return
_append_progress_line(result, "%s defeated %d/%d" % [_condition_team_label(team), total - living, total], pending)
_append_progress_line(result, "%s 격파 %d/%d" % [_condition_team_label(team), total - living, total], pending)
func _append_target_units_progress_line(result: Array[String], unit_ids, mode: String, pending := false) -> void:
@@ -3507,11 +3517,11 @@ func _append_target_units_progress_line(result: Array[String], unit_ids, mode: S
var defeated := int(counts.get("defeated", 0))
if mode == "defeat" and total == 1:
var unit_name := _condition_unit_display_name(unit_ids[0])
var status := "defeated" if defeated > 0 else "safe"
var status := "퇴각" if defeated > 0 else "건재"
_append_progress_line(result, "%s %s" % [unit_name, status], pending)
return
var label := "Protected losses" if mode == "defeat" else "Target units defeated"
var suffix := " (defeat at 1)" if mode == "defeat" else ""
var label := "호위 손실" if mode == "defeat" else "격파 표식"
var suffix := " (1 이상이면 패전)" if mode == "defeat" else ""
_append_progress_line(result, "%s %d/%d%s" % [label, defeated, total, suffix], pending)
@@ -3529,11 +3539,11 @@ func _append_target_officers_progress_line(
var defeated := int(counts.get("defeated", 0))
if mode == "defeat" and total == 1:
var officer_name := _condition_officer_display_name(str(officer_ids[0]), team)
var status := "defeated" if defeated > 0 else "safe"
var status := "퇴각" if defeated > 0 else "건재"
_append_progress_line(result, "%s %s" % [officer_name, status], pending)
return
var label := "Officer losses" if mode == "defeat" else "Target officers defeated"
var suffix := " (defeat at 1)" if mode == "defeat" else ""
var label := "장수 손실" if mode == "defeat" else "대상 장수 격파"
var suffix := " (1 이상이면 패전)" if mode == "defeat" else ""
_append_progress_line(result, "%s %d/%d%s" % [label, defeated, total, suffix], pending)
@@ -3541,8 +3551,8 @@ func _append_destination_progress_line(result: Array[String], condition: Diction
var targets := _condition_cells(condition)
if targets.is_empty():
return
var status := "reached" if _unit_reaches_tile(condition) else "not reached"
_append_progress_line(result, "Destination %s: %s" % [_format_cells(targets), status], pending)
var status := "도달" if _unit_reaches_tile(condition) else "미도달"
_append_progress_line(result, "목표 지점 %s: %s" % [_format_cells(targets), status], pending)
func _append_turn_limit_progress_line(result: Array[String]) -> void:
@@ -3550,7 +3560,7 @@ func _append_turn_limit_progress_line(result: Array[String]) -> void:
if limit <= 0:
return
var turns_left: int = maxi(0, limit - turn_number + 1)
_append_progress_line(result, "Turns left %d" % turns_left)
_append_progress_line(result, "남은 턴 %d" % turns_left)
func _append_after_event_progress_line(result: Array[String], event_id: String) -> void:
@@ -3566,15 +3576,15 @@ func _append_after_event_progress_line(result: Array[String], event_id: String)
elif trigger_type == "turn_start":
var target_turn := int(when.get("turn", 0))
if target_turn > 0:
_append_progress_line(result, "Objective unlocks on Turn %d" % target_turn)
_append_progress_line(result, "%d턴에 전공 갱신" % target_turn)
func _append_event_destination_progress_line(result: Array[String], when: Dictionary) -> void:
var targets := _condition_cells(when)
if targets.is_empty():
return
var status := "reached" if _unit_reaches_tile(when) else "not reached"
_append_progress_line(result, "Reach %s: %s" % [_format_cells(targets), status])
var status := "도달" if _unit_reaches_tile(when) else "미도달"
_append_progress_line(result, "목표 지점 %s: %s" % [_format_cells(targets), status])
func _append_turn_condition_progress_line(result: Array[String], condition: Dictionary, mode: String, pending := false) -> void:
@@ -3583,7 +3593,7 @@ func _append_turn_condition_progress_line(result: Array[String], condition: Dict
var limit := int(condition.get("turn", condition.get("limit", 0)))
if limit <= 0:
return
_append_progress_line(result, "Turns left %d" % maxi(0, limit - turn_number + 1), pending)
_append_progress_line(result, "남은 턴 %d" % maxi(0, limit - turn_number + 1), pending)
elif condition_type == "turn_reached":
var target_turn := int(condition.get("turn", 0))
if target_turn <= 0:
@@ -3591,16 +3601,16 @@ func _append_turn_condition_progress_line(result: Array[String], condition: Dict
if mode == "defeat":
var target_team := str(condition.get("team", ""))
var limit_turn := target_turn - 1 if target_team == TEAM_PLAYER else target_turn
_append_progress_line(result, "Turns left %d" % maxi(0, limit_turn - turn_number + 1), pending)
_append_progress_line(result, "남은 턴 %d" % maxi(0, limit_turn - turn_number + 1), pending)
return
_append_progress_line(result, "Turn %d/%d" % [min(turn_number, target_turn), target_turn], pending)
_append_progress_line(result, "%d/%d" % [min(turn_number, target_turn), target_turn], pending)
func _append_progress_line(result: Array[String], text: String, pending := false) -> void:
if text.is_empty():
return
if pending:
text += " (pending)"
text += " (대기)"
if not result.has(text):
result.append(text)
@@ -3700,10 +3710,10 @@ func _condition_officer_display_name(officer_id: String, team := "") -> String:
func _condition_team_label(team: String) -> String:
if team == TEAM_ENEMY:
return "Enemies"
return "적군"
if team == TEAM_PLAYER:
return "Allies"
return "Units"
return "아군"
return "부대"
func _event_by_id(event_id: String) -> Dictionary:
@@ -4157,11 +4167,12 @@ func _normalize_dialogue_line(line) -> Dictionary:
if text.is_empty():
return {}
var speaker := str(line.get("speaker", ""))
var display_speaker := str(line.get("display_speaker", speaker))
var portrait := str(line.get("portrait", ""))
if portrait.is_empty():
portrait = data_catalog.get_portrait_for_speaker(speaker)
return {
"speaker": speaker,
"speaker": display_speaker,
"text": text,
"portrait": portrait,
"side": _normalize_dialogue_side(line.get("side", "left"))