Polish battle log location text

This commit is contained in:
2026-06-20 11:40:50 +09:00
parent 9bfe8aa154
commit d8e5e3d562
2 changed files with 60 additions and 2 deletions

View File

@@ -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: