diff --git a/scripts/core/battle_state.gd b/scripts/core/battle_state.gd index 3447662..a215eed 100644 --- a/scripts/core/battle_state.gd +++ b/scripts/core/battle_state.gd @@ -3190,7 +3190,7 @@ func _move_ai_unit(unit: Dictionary, target_cell: Vector2i) -> bool: unit["moved"] = true _face_unit_from_to(unit, from_cell, target_cell) unit_motion_requested.emit(str(unit.get("id", "")), from_cell, target_cell) - _emit_log("%s, %s?쇰줈 ?뺣컯." % [unit["name"], _format_cell(target_cell)]) + _emit_log("%s, %s으로 접근." % [unit["name"], _format_cell(target_cell)]) _run_events("unit_reaches_tile", str(unit.get("team", "")), turn_number, unit) return battle_status == STATUS_ACTIVE @@ -4957,7 +4957,28 @@ func _manhattan(a: Vector2i, b: Vector2i) -> int: func _format_cell(cell: Vector2i) -> String: - return "(%d, %d)" % [cell.x + 1, cell.y + 1] + if not is_inside(cell): + return "전장 밖" + var terrain_name := get_terrain_name(cell) + var zone_name := _map_zone_label(cell) + if terrain_name.is_empty(): + return zone_name + if zone_name.is_empty(): + return terrain_name + return "%s %s" % [zone_name, terrain_name] + + +func _map_zone_label(cell: Vector2i) -> String: + if not is_inside(cell): + return "전장 밖" + var width := maxi(1, map_size.x) + var left_cut := int(floor(float(width) / 3.0)) + var right_cut := int(ceil(float(width) * 2.0 / 3.0)) + if cell.x < left_cut: + return "서측" + if cell.x >= right_cut: + return "동측" + return "중앙" func _format_cells(cells: Array[Vector2i]) -> String: diff --git a/tools/smoke_chapter_one_polish.gd b/tools/smoke_chapter_one_polish.gd index 76c886b..dd6afe8 100644 --- a/tools/smoke_chapter_one_polish.gd +++ b/tools/smoke_chapter_one_polish.gd @@ -28,6 +28,7 @@ func _init() -> void: _check_event_dialogue_side_passthrough(failures) _check_opening_battle_camp_context(failures) _check_opening_battle_tactical_spacing(failures) + _check_opening_battle_log_location_labels(failures) _check_opening_battle_lure_line_ai_reaction(failures) _check_opening_battle_post_battle_bridge(failures) _check_sishui_gate_camp_context(failures) @@ -712,6 +713,42 @@ func _check_opening_battle_tactical_spacing(failures: Array[String]) -> void: scene.free() +func _check_opening_battle_log_location_labels(failures: Array[String]) -> void: + var state = BattleStateScript.new() + if not state.load_battle("res://data/scenarios/001_yellow_turbans.json"): + failures.append("could not load opening battle for log location labels") + return + + var sample_label := state._format_cell(Vector2i(1, 6)) + if sample_label.contains("(") or sample_label.contains(")") or sample_label.contains(","): + failures.append("battle log location labels should not expose raw coordinates: %s" % sample_label) + if not sample_label.contains("서측"): + failures.append("battle log location labels should include battlefield zones: %s" % sample_label) + + var logs: Array[String] = [] + state.log_added.connect(func(message: String) -> void: + logs.append(message) + ) + if not state.select_unit("cao_cao"): + failures.append("could not select Cao Cao for log location check") + return + var moved := false + for cell in state.get_movement_range("cao_cao"): + if not state.get_unit_at(cell).is_empty(): + continue + if state.try_move_selected(cell, true): + moved = true + break + if not moved: + failures.append("could not move Cao Cao for log location check") + return + var log_text := "\n".join(logs) + if log_text.contains("?") or log_text.contains("(") or log_text.contains(")"): + failures.append("battle movement logs should use polished Korean location text: %s" % log_text) + if not (log_text.contains("서측") or log_text.contains("중앙") or log_text.contains("동측")): + failures.append("battle movement logs should name battlefield zones: %s" % log_text) + + func _check_opening_battle_lure_line_ai_reaction(failures: Array[String]) -> void: var state = BattleStateScript.new() if not state.load_battle("res://data/scenarios/001_yellow_turbans.json"):