Simplify auto attack hover text

This commit is contained in:
2026-06-20 10:19:32 +09:00
parent ea49df2629
commit 428b91b59d
3 changed files with 55 additions and 18 deletions

View File

@@ -6699,11 +6699,12 @@ func _append_auto_attack_target_marker_entries(result: Array[Dictionary], select
result.append({
"cell": target_cell,
"target_id": target_id,
"text": "행공",
"text": "진격",
"kind": marker_kind,
"icon": _target_preview_badge_icon_kind(marker_kind),
"panel": _target_marker_panel_key(),
"origin_panel": _target_marker_panel_key(),
"tooltip": _format_auto_attack_target_hint(preview),
"origin": attack_origin,
"requires_move": true,
"damage": int(preview.get("damage", 0)),
@@ -8210,12 +8211,43 @@ func _auto_attack_target_preview_badge_for_origin(selected: Dictionary, target:
if preview.is_empty():
return {}
var target_cell: Vector2i = preview.get("target_cell", Vector2i(-1, -1))
var badge := _make_target_preview_badge_at(
_format_auto_attack_target_badge_text(preview),
_auto_attack_preview_badge_kind(preview),
target_cell
)
badge["tooltip"] = _format_auto_attack_target_hint(preview)
badge["advance_origin"] = attack_origin
return badge
func _format_auto_attack_target_badge_text(preview: Dictionary) -> String:
var damage := int(preview.get("damage", 0))
var hit_chance := int(preview.get("hit_chance", 0))
var result_text := "행공 퇴각" if bool(preview.get("would_defeat", false)) else "행공 -%d" % damage
var result_text := "퇴각" if bool(preview.get("would_defeat", false)) else "-%d" % damage
var directional_text := _format_directional_badge_suffix(preview)
var counter_text := _format_auto_attack_counter_badge_suffix(preview)
return _make_target_preview_badge_at("%s%s %d%%%s" % [result_text, directional_text, hit_chance, counter_text], _auto_attack_preview_badge_kind(preview), target_cell)
return "%s%s %d%%%s" % [result_text, directional_text, hit_chance, counter_text]
func _format_auto_attack_target_hint(preview: Dictionary) -> String:
var parts: Array[String] = ["이동 후 공격"]
var origin: Vector2i = preview.get("origin", Vector2i(-1, -1))
if state.is_inside(origin):
parts.append("진입 위치 %d,%d" % [origin.x + 1, origin.y + 1])
parts.append("피해 %d, 명중 %d%%" % [
int(preview.get("damage", 0)),
int(preview.get("hit_chance", 0))
])
if bool(preview.get("counter_in_range", false)):
var counter_text := "반격 %d, 명중 %d%%" % [
int(preview.get("counter_damage", 0)),
int(preview.get("counter_hit_chance", 0))
]
if bool(preview.get("counter_would_defeat", false)):
counter_text += ", 아군 퇴각 위험"
parts.append(counter_text)
return "\n".join(parts)
func _auto_attack_preview_for_origin(selected: Dictionary, target: Dictionary, attack_origin: Vector2i) -> Dictionary:
@@ -9961,16 +9993,16 @@ func _format_auto_attack_forecast_text(selected: Dictionary, target: Dictionary)
int(preview.get("counter_hit_chance", 0)),
counter_defeat
]
return "전황: 행공 진 %d,%d 이동 %d\n피해 %d%s, 명중 %d%%, 적 병력 %d/%d.%s%s" % [
origin.x + 1,
origin.y + 1,
move_distance,
return "전황: 진격 공격\n피해 %d%s, 명중 %d%%, 적 병력 %d/%d.%s\n진입 위치 %d,%d, 이동 %d%s" % [
int(preview.get("damage", 0)),
directional_text,
int(preview.get("hit_chance", 0)),
int(preview.get("target_hp_after", 0)),
int(target.get("max_hp", 1)),
defeat_text,
origin.x + 1,
origin.y + 1,
move_distance,
counter_text
]