diff --git a/Assets/Resources/Board/battlefield_01.png b/Assets/Resources/Board/battlefield_01.png index 2d927f82..2d1a7e23 100644 Binary files a/Assets/Resources/Board/battlefield_01.png and b/Assets/Resources/Board/battlefield_01.png differ diff --git a/Assets/Resources/Board/bg_ev_sishui.png b/Assets/Resources/Board/bg_ev_sishui.png index 8677f33d..1c8122b0 100644 Binary files a/Assets/Resources/Board/bg_ev_sishui.png and b/Assets/Resources/Board/bg_ev_sishui.png differ diff --git a/Assets/Resources/Skills/ib_ui.csv b/Assets/Resources/Skills/ib_ui.csv index 86baf0d7..2dae311c 100644 --- a/Assets/Resources/Skills/ib_ui.csv +++ b/Assets/Resources/Skills/ib_ui.csv @@ -69,11 +69,32 @@ edge_fog_in,0.8,구름이 배경 그림 끝에서 안쪽으로 들어오는 폭( edge_fog_out,6,구름 조각을 배경 그림 끝 밖으로 까는 폭(월드 · 그보다 먼 곳은 edge_fog_base 색) edge_fog_drift,0.18,구름 띠가 천천히 흔들리는 폭(월드 · 0 = 멈춤) edge_fog_drift_sec,9,구름 띠가 한 번 흔들리는 시간(초) +edge_fog_board_in,0.4,테두리 선이 없는 그림 판(board_border_on_art 0)에서 구름이 전장 끝 안쪽으로 덮는 폭(월드 · 여분 없는 그림의 끝 직선과 그 밖 빈 틈을 가림 · 여분 있는 그림은 그림 바깥 끝부터라 영향 없음 · 구름은 유닛 아래 · PD 2026-11-24) +board_border_on_art,0,전장 테두리 금색 선을 배경 그림이 있는 판에도 그리는가(PD 2026-11-24 「전장의 화면 가장자리에 알 수 없는 경계선이 드러나는데 보이지 않도록」 · 0 = 그림 판은 선 없음(바깥 여분 그림 · 목책이 경계) · 1 = 그림 · 그림 없는 도형 판은 늘 그림 · 벽 콜라이더는 그대로) range_style,2,사거리 원 모양(PD 2026-11-23 「해상도가 떨어지는 굵은 베이지색 원형 선 → 개선」 · 0 = 예전 그림 고리 · 1 = 또렷한 점선 고리 + 아주 옅은 바탕 · 2 = 실선 + 가장자리가 진한 은은한 원판 · 3 = 실선 + 안쪽 눈금 + 공격 가능한 적 방향 꺾쇠) · 선 = 벡터(화면 두께 일정) range_line_px,5,사거리 원 선 두께(기준 1080×1920 화면 px · UI 와 같이 화면 크기에 맞춰 커짐) range_color,#FFF3D6E6,사거리 원 색(공격 가능한 적 없음 · 따뜻한 흰색) range_color_attack,#FF5A3CF2,사거리 원 색(사정거리 안에 공격 가능한 적이 있음 = 조준 공격 화살표와 같은 붉은색 · PD 2026-11-23 2차 「사정거리 내 공격 가능한 적이 있을 때 변화」) range_dash_px,22,점선 한 칸 길이(화면 px · 모양 1) +range_power_follow,1,조준 중 사거리 원 · 원판이 지금 파워(화살표 길이 = 나갈 거리)로 줄고 늘어나는가(PD 2026-11-24 「슬링샷 파워에 따라 원형 반경이 조절 · 내 파워가 정확히 어느 위치까지 갈지」 · 1 = 켬 · 0 = 늘 최대 거리) +range_power_max_px,2,조준 중 최대 거리를 남기는 옅은 가는 선 두께(기준 1080×1920 화면 px · 0 = 안 그림) +range_power_max_color,#FFF3D673,조준 중 최대 거리 옅은 선 색(따뜻한 흰색 · 반투명) +danger_fill,#E61F1A38,적 위험 범위 면 색(PD 2026-11-24 「적의 사정거리 범위 · 붉은색 영역 · On / Off」 · DangerZone · 붉은 반투명) +danger_edge,#F2261FE6,적 위험 범위 바깥 테두리 색(합집합의 바깥 선만 · 진한 붉은색) +danger_edge_w,0.12,적 위험 범위 테두리 두께(월드) +danger_ppu,12,적 위험 범위 그림 해상도(월드 1 당 텍셀 · 높을수록 매끈 · 다시 굽는 비용 ↑) +team_ring_on,1,진영 발판(PD 2026-11-24 「유저가 아군과 적을 잘 구분하지 못함」 · 발밑 진영 색 옅은 원판 + 테 · UnitView) · 1 = 켬 · 0 = 끔 +team_ring_ally,#4594FF,아군 발판 색(파랑) +team_ring_enemy,#FF4538,적 발판 색(빨강) +team_ring_scale,0.85,발판 폭 = 선택 원 지름 × 이 값 +team_ring_squash,0.5,발판 세로 ÷ 가로(납작한 타원 = 땅에 깔린 느낌) +team_disc_alpha,0.45,발판 원판 진하기 +team_ring_alpha,0.9,발판 테 진하기 +team_hp_on,1,체력 바 색 = 진영 색(1 = 아군 · 적 고정색 · 남은 양 = 바 길이 · 0 = 예전 남은 비율 초록 · 노랑 · 빨강) +team_hp_ally,#5CD65A,아군 체력 바 색(초록) +team_hp_enemy,#EB3D33,적 체력 바 색(빨강) +team_name_ally,#DCEBFF,아군 이름표 글자 색(옅은 파랑) +team_name_enemy,#FFDAD4,적 이름표 글자 색(옅은 분홍) range_dash_fill,0.6,점선 한 칸 중 선 비율(모양 1) range_fill_alpha,0.08,모양 1 바탕 원판 불투명도 range_disc_alpha,0.15,모양 2 원판 가장자리 불투명도(가운데 투명 → 가장자리) diff --git a/Assets/Resources/UI/Battle/battle_hud.csv b/Assets/Resources/UI/Battle/battle_hud.csv index 64c3fb81..f645e73f 100644 --- a/Assets/Resources/UI/Battle/battle_hud.csv +++ b/Assets/Resources/UI/Battle/battle_hud.csv @@ -12,6 +12,8 @@ turn_pop,0.2|1.12,턴이 바뀔 때 크기 튐 시간(초)|최대 배율 minimap,TR|868|112|196|261,미니맵 칸(틀 바깥 · 지도 높이 = 전장 비율) minimap_art,bt_minimap_frame|3|8|#2A2019F2,틀 그림(9 분할 · 가운데 뚫림)|9 분할 배율|안쪽 여백(지도 = 칸 − 여백 × 2)|지도 바탕 색(어두운 고동 · 남색 폐기 4차) minimap_dot,1.5|#141414C0,유닛 점 테두리 두께|색 +danger_btn,TR|868|12|196|60,위험 범위 켬/끔 단추(미니맵 바로 아래 · y = 미니맵 틀 아래끝에서 떨어지는 간격(미니맵 높이 = 전장 비율이라 코드가 아래끝을 구함) · PD 2026-11-24 「적의 사정거리 범위 · On / Off」 · 비우면 단추 없음) +danger_btn_art,bt_b_pill_w|#C8473A|#5A5048|2|24,그림(흰 알약 · 색 곱)|켬 색(붉은 옻칠)|끔 색(어두운 회갈)|9 분할 배율|글자 minimap_view,#F0D9A833||0|#FFFFFF2E,시야 사각형 색(따뜻한 밝은 반투명)|테 색|테 두께(0 = 없음 · uGUI 외곽선 효과는 면 전체를 겹쳐 그려 밝은 덩어리가 됨)|가운데 선 색 msg_toast,TS|24|208|832|56,안내 한 줄(행동 결과 · 스킬 · 변진 안내 · 미니맵 왼쪽까지 · 몇 초만) msg_toast_art,chip|chip_dark|28|20|3,칩 스킨|색|글자|최소|보이는 초(새 문장마다 다시) @@ -89,6 +91,8 @@ passive_tray_art,bt_b_panel_pas|#FFFFFF|2,그림|틴트|9 분할 배율 passive_icon_frame,bt_b_tile_cream|3|2|4,타일 덮개(크림 귀 + 고동 테 + 입술)|바깥 여백|9 분할 배율|아래 입술 passive_label,BL|204|1774|90|32,「패시브」 붉은 알약 passive_label_art,bt_b_pill_w|#E2584C|2|24|0,그림|색|9 분할 배율|글자|글자 테 +active_label_art,#2E8A63,「액티브」 알약 색(패시브 칸에 액티브를 띄울 때 · 붉은 패시브와 구분 = 옥색 · PD 2026-11-24) +active_slot_grow,78,패시브 칸에 띄운 액티브 설명이 최소 글자(passive_desc_font 최소)로도 넘칠 때 판을 위로 늘리는 폭(= 판 위끝 1762 − 능력치 알약 위끝 1694 + 알약 위로 솟은 아이콘 8 + 여유 2 · 능력치 줄을 다 덮음 · 패시브는 늘리지 않음) desk_text,#4A2E1A|#FFF4DC|1,종이 위 글자 색(먹)|밝은 테 색|테 두께(얇게 · PD 5차) stat_chip_art,bt_b_pill_sl|#FFFFFF|2|_pill,능력치 알약 기본 그림(맞춤 그림이 없을 때)|틴트|9 분할 배율|맞춤 알약 뒷붙이(아이콘 이름 + 이 값 = 왼끝을 그 아이콘 실루엣 밑에서 끝나게 깎은 알약 · 아트 pill_fit.py · 아이콘 크기 · 알약 높이 · 아이콘 그림을 바꾸면 다시 뽑기 · PD 「튀어나온 부분」 · 「라운딩 된 부분이 보이지 않게」) desk_rule,BL|72|1744|584|2,나눔선(능력치 ↔ 패시브 · B안 모래 진한 선 · 왼쪽 기준 고정 = 좁은 화면에서도 알약 줄 오른끝 656 · QA r8 B3) @@ -119,4 +123,5 @@ atk_type_icon,BL|576|1628|44|44,공격 유형 아이콘 atk_type_value,BL|624|1632|124|38,공격 유형 글자(진홍) atk_type_art,bt_atk_|#7A5A3A|#B03832|24,아이콘 앞붙이(+ 병종 소문자 · bt_atk_infantry …)|라벨 색|값 색|글자 desk_keep_layout,1,스킬 · 패시브가 없어도 같은 레이아웃(PD 「스킬이 없는 경우에도 UI 기본 레이아웃은 동일」 · 적 · 액티브 없음 = 스킬 칸 보이기만 · 누름 = 아군 + 액티브 있음만) +unit_hp_cls,0.34|-0.15|1,전장 유닛 체력 바 왼쪽 병종 아이콘 크기(월드 · 0 = 없음)|체력 바와 간격(월드 · 음수 = 바 왼쪽 끝을 덮음 · −0.15 = 아이콘이 바 끝을 덮고 딱 붙음 · PD 2026-11-24 「병종 아이콘과 HP가 딱 붙어 · HP바의 좌측 가장자리가 가려지도록」)|발밑 이름표 숨김(1 = 숨김 · 0 = 보임) · PD 2026-11-24 「각 병졸의 HP바 왼쪽에 각 병종 아이콘을 배치하고 이름 정보는 제거 · 적군 포함」 unit_name_cls,0.42|0.03,전장 유닛 이름표 병종 아이콘 크기(월드 · 0 = 예전 글자 「·보」)|이름과 간격(월드) · 아이콘 = 이름 왼쪽 · PD 2026-11-22 「병종 아이콘이 필요한 모든 위치」 diff --git a/Assets/Resources/UI/Battle/battle_text.csv b/Assets/Resources/UI/Battle/battle_text.csv index 2c13459b..1149b2f6 100644 --- a/Assets/Resources/UI/Battle/battle_text.csv +++ b/Assets/Resources/UI/Battle/battle_text.csv @@ -65,3 +65,8 @@ battle.atk_type.strategist,폭파,,책사 공격 유형(PD 원문 「승병」 = battle.skill.none,스킬 없음,,액티브 없는 유닛 스킬 이름판(PD 2026-11-21 「스킬이 없는 경우에도 UI 기본 레이아웃은 동일」) battle.skill.none_btn,없음,,액티브 없는 유닛 회색 단추 battle.passive.none,패시브 없음,,패시브 없는 유닛 패시브 판 +battle.active.label,액티브,,지휘 탁자 패시브 칸에 액티브를 띄울 때 알약(PD 2026-11-24 「액티브를 선택하면 스킬 정보가 패시브 스킬 영역에」) +battle.skill.active_line,{0} Lv{1},,패시브 칸 액티브 이름({0} = 이름 · {1} = Lv · 쿨 없음) +battle.skill.active_line_cool,{0} Lv{1} · 쿨 {2}턴,,패시브 칸 액티브 이름({2} = 쿨 턴) +battle.danger.on,위험 범위 ON,,미니맵 아래 단추(켬 = 적 공격이 닿을 수 있는 곳을 붉게 · PD 2026-11-24) +battle.danger.off,위험 범위 OFF,,미니맵 아래 단추(끔) diff --git a/Assets/Scripts/Runtime/BattleHUD.cs b/Assets/Scripts/Runtime/BattleHUD.cs index ee8a7415..b1870428 100644 --- a/Assets/Scripts/Runtime/BattleHUD.cs +++ b/Assets/Scripts/Runtime/BattleHUD.cs @@ -57,6 +57,11 @@ namespace TKS // 위 전황 띠 RectTransform pauseBtn; // 설정 버튼(오른쪽 끝 톱니 · 누름 = 중단 팝업) + RectTransform dangerBtn; // 위험 범위 켬/끔(미니맵 아래) + Image dangerArt; + Text dangerText; + DangerZone dangerZone; + bool dangerShownOn = true; // 단추 글자 · 색을 마지막으로 그린 상태(처음엔 다르게 = 첫 갱신에 그림) Text stageText; Text stageSub; Text allyCount; @@ -102,6 +107,9 @@ namespace TKS Text extraText; RectTransform passiveLine; Image passiveIcon; + Image passiveLabel; // 「패시브」 알약(액티브를 띄우면 「액티브」 · 표 active_label_art 색) + Text passiveLabelText; + RectTransform passiveTray; Text skillPassive; Text passiveDesc; RectTransform passiveGroup; @@ -406,6 +414,18 @@ namespace TKS if (pi != null) OutGame.UiKit.DropShadow(pi, 3f); pauseBtn.gameObject.SetActive(false); + // 위험 범위 켬/끔 단추(미니맵 아래 · PD 2026-11-24 「적의 사정거리 범위 · On / Off」 · 전장 붉은 면 = DangerZone) + if (L("danger_btn").Length > 0) + { + dangerBtn = Box(transform, "danger_btn", "DangerToggle"); + dangerArt = Art(dangerBtn, S("danger_btn_art", 0, "bt_b_pill_w"), N("danger_btn_art", 3, 2f), Color.white); + dangerText = Fit(Txt(dangerBtn, "Text", (int)N("danger_btn_art", 4, 24f), Color.white, TextAnchor.MiddleCenter, 2f), (int)N("danger_btn_art", 4, 24f), 14); + dangerText.rectTransform.offsetMin = new Vector2(8f, 2f); + dangerText.rectTransform.offsetMax = new Vector2(-8f, -2f); + dangerBtn.gameObject.SetActive(false); + PlaceDangerBtn(); + } + // 스테이지 제목(Info) = 큰 제목 + 회색 부제(아웃게임 제목 띠 「임무 일일 · 주간 · 업적」 방식) var sb = Box(info, "stage_title", "Stage"); float th = N("stage_title", 4, 104f); @@ -497,6 +517,8 @@ namespace TKS var mrt = new GameObject("Minimap", typeof(RectTransform)).GetComponent(); mrt.SetParent(transform, false); Place(mrt, anchor, x + pad, y + pad, mmW, mmH); + minimapBottom = y + pad * 2f + mmH; // 틀 아래끝(지도 높이 = 전장 비율 · 위험 범위 단추가 그 밑에 붙음) + PlaceDangerBtn(); minimapBg = mrt.gameObject.AddComponent(); minimapBg.color = C("minimap_art", 3, new Color(0.08f, 0.11f, 0.2f, 0.85f)); minimapBg.raycastTarget = false; @@ -686,7 +708,10 @@ namespace TKS rl.raycastTarget = false; } if (S("passive_tray_art", 0).Length > 0) // 비움 = 받침 없음(1안 = 먹선 한 줄로 나눔) - Art(Box(passiveGroup, "passive_tray", "Tray"), S("passive_tray_art", 0), N("passive_tray_art", 2, 0.6f), C("passive_tray_art", 1, new Color(0.08f, 0.1f, 0.2f))); + { + passiveTray = Box(passiveGroup, "passive_tray", "Tray"); + Art(passiveTray, S("passive_tray_art", 0), N("passive_tray_art", 2, 0.6f), C("passive_tray_art", 1, new Color(0.08f, 0.1f, 0.2f))); + } var pib = Box(passiveGroup, "passive_icon", "PassiveIcon"); passiveIcon = pib.gameObject.AddComponent(); passiveIcon.preserveAspect = true; @@ -695,10 +720,11 @@ namespace TKS if (S("passive_icon_frame", 0).Length > 0) Art(OutGame.UiKit.Fill("Frame", pib, -pf, -pf, -pf, -pf - N("passive_icon_frame", 3, 0f)), S("passive_icon_frame", 0), N("passive_icon_frame", 2, 1.5f), Color.white); // 칸 4 = 아래 입술(B안 타일) var lab = Box(passiveGroup, "passive_label", "Label"); - Art(lab, S("passive_label_art", 0, "tre_tag"), N("passive_label_art", 2, 1.3f), C("passive_label_art", 1, new Color(0.72f, 0.21f, 0.16f))); + passiveLabel = Art(lab, S("passive_label_art", 0, "tre_tag"), N("passive_label_art", 2, 1.3f), C("passive_label_art", 1, new Color(0.72f, 0.21f, 0.16f))); float keepCap2 = strokeCap; if (N("passive_label_art", 4, -1f) >= 0f) strokeCap = N("passive_label_art", 4, 0f); // 도장 글자 테(0 = 없음) var lt = Fit(Txt(lab, "Text", (int)N("passive_label_art", 3, 20f), Color.white, TextAnchor.MiddleCenter, 2f), (int)N("passive_label_art", 3, 20f), 14); + passiveLabelText = lt; strokeCap = keepCap2; lt.rectTransform.offsetMin = new Vector2(8f, 2f); lt.rectTransform.offsetMax = new Vector2(-8f, 0f); @@ -1026,7 +1052,7 @@ namespace TKS /// 스킬 설명 칸이 떠 있는가 · 그 글(시험 · 캡처). public string SkillDescText { - get { return descPanel != null && descPanel.gameObject.activeSelf ? descName.text + " | " + descText.text : ""; } + get { return descPanel != null && descPanel.gameObject.activeSelf ? descName.text + " | " + descText.text : slotActive != null ? skillPassive.text + " | " + passiveDesc.text : ""; } } /// @@ -1055,14 +1081,29 @@ namespace TKS return true; } if (armedUnit != null) armedUnit = null; // 다른 곳 터치 = 취소 - if (skillPassive != null && skillPassive.text.Length > 0 && Hit(passiveLine, screen)) - { - ShowTimed(DescKind.Passive); - return true; - } + // (패시브 줄 누름 = 위 두루마리에 패시브 설명 · 폐지 PD 2026-11-24 — 패시브 설명은 칸에 늘 보이고 두루마리는 전장의 유닛을 가림 · 칸 누름 = TryDeskTap) return false; } + /// + /// 지휘 탁자(아래 정보판) 위 터치 = 전장으로 넘기지 않는다(영웅 선택 유지 · PD 2026-11-24 「영웅을 선택한 후 UI 영역은 터치해도 영웅 선택이 해제되지 않도록」) · + /// 스킬 정보 칸(패시브 칸)에 액티브가 떠 있을 때 그 칸 누름 = 액티브 발동 대기만 취소(예약 · 지점 선택 = 취소 · 쿨 소모 없음 / 즉시 시전 「한 번 더 터치」 대기 = 풀림 / 쿨 중 잠깐 보인 설명 = 닫음) → 칸 = 다시 패시브 + /// (「패시브 정보와 액티브 정보를 번갈아 보기 편하도록」 · 스킬 단추 = 액티브 · 칸 = 패시브). 탭 처리 = true(슬링샷 입력은 건너뜀). + /// + public bool TryDeskTap(Vector2 screen) + { + if (battle == null || desk == null || !desk.gameObject.activeInHierarchy || !Hit(desk, screen)) return false; + var slot = passiveTray != null ? passiveTray : passiveLine; + if (slotActive != null && selected != null && slot != null && slot.gameObject.activeInHierarchy && Hit(slot, screen)) + { + var st = battle.Skills != null ? battle.Skills.StateOf(selected) : SkillSystem.ActiveState.None; + if (st == SkillSystem.ActiveState.Reserved || st == SkillSystem.ActiveState.Targeting) PressSkill(); // 스킬 단추를 다시 누른 것과 같음(예약 취소 · 쿨 소모 없음) + armedUnit = null; + timedUntil = 0f; + } + return true; + } + /// 두 번 터치로 발동할 스킬인가 — 즉시 시전 · 지금 쓸 수 있음(쿨 · 행동 완료 · 잠김이면 첫 터치 = 설명만). bool NeedsSecondTap(Unit u) { @@ -1185,6 +1226,49 @@ namespace TKS if (giveUpPopup != null && (battle.Phase == BattlePhase.StageClear || battle.Phase == BattlePhase.Defeat)) CloseGiveUp(); // 그사이 전투가 끝남 } + // ---------- 위험 범위(PD 2026-11-24 · DangerZone) ---------- + + float minimapBottom = -1f; + + /// 단추 = 미니맵 틀 아래끝 + 표 danger_btn y(간격) · x · 폭 · 높이 = 표 · 미니맵이 아직 없으면 표 y 를 그대로(미니맵이 생길 때 다시 놓음). + void PlaceDangerBtn() + { + if (dangerBtn == null) return; + float gap = N("danger_btn", 2, 12f); + Place(dangerBtn, S("danger_btn", 0, "TR"), N("danger_btn", 1, 868f), minimapBottom >= 0f ? minimapBottom + gap : gap, N("danger_btn", 3, 196f), N("danger_btn", 4, 60f)); + } + + bool DangerVisible(BattlePhase phase) + { + return dangerBtn != null && (phase == BattlePhase.PlayerTurn || phase == BattlePhase.EnemyTurn || phase == BattlePhase.Resolving); + } + + void RefreshDanger(BattlePhase phase) + { + if (dangerBtn == null) return; + if (dangerZone == null && battle.Board != null) dangerZone = DangerZone.Create(battle); + bool vis = DangerVisible(phase); + Show(dangerBtn, vis); + bool on = DangerZone.On; + if (on == dangerShownOn) return; + dangerShownOn = on; + dangerText.text = T(on ? "battle.danger.on" : "battle.danger.off"); + dangerArt.color = on ? C("danger_btn_art", 1, new Color(0.78f, 0.22f, 0.18f)) : C("danger_btn_art", 2, new Color(0.35f, 0.31f, 0.28f)); + } + + /// 위험 범위 단추 위를 눌렀으면 켬/끔을 바꾸고 true. + public bool TryDangerTap(Vector2 screen) + { + if (dangerBtn == null || !dangerBtn.gameObject.activeInHierarchy) return false; + if (!RectTransformUtility.RectangleContainsScreenPoint(dangerBtn, screen, uiCam)) return false; + DangerZone.On = !DangerZone.On; + RefreshDanger(battle.Phase); + return true; + } + + /// 위험 범위(시험 · 캡처). + public DangerZone Danger { get { return dangerZone; } } + /// 중단 버튼 위를 눌렀으면 팝업을 띄우고 true. public bool TryGiveUpTap(Vector2 screen) { @@ -1304,6 +1388,7 @@ namespace TKS RefreshToast(phase, now); RefreshRetreat(); RefreshGiveUp(); + RefreshDanger(phase); RefreshDesk(phase, now); RefreshSkill(phase, now); @@ -1493,27 +1578,89 @@ namespace TKS float g = acted ? N("portrait_art", 4, 0.5f) : 1f; portraitArt.color = new Color(g, g, g, 1f); - var s = battle.Skills != null ? battle.Skills.Of(u) : null; - var pas = s != null ? s.Passive : null; - skillPassive.text = pas != null ? F("battle.skill.passive_line", s.PassiveMult > 1f ? F("battle.skill.passive_boost", pas.NameKo) : pas.NameKo) : ""; - bool keepLayout = N("desk_keep_layout", 0, 0f) > 0.5f; - Show(passiveGroup, pas != null || keepLayout); - if (pas == null && keepLayout) skillPassive.text = T("battle.passive.none"); // 패시브 없는 유닛도 같은 판(PD 2026-11-21) - var psp = pas != null ? SkillSprite(pas, u) : null; - if (passiveIcon.sprite != psp) passiveIcon.sprite = psp; - Show(passiveIcon, psp != null); - // 패시브 설명(스킬 표 desc_ko · 바뀔 때만 찾음 · PD 2026-11-21 2차) - string pid = pas != null ? pas.Id : ""; - if (pid != shownPassiveId) - { - shownPassiveId = pid; - var db = OutGame.OutGameData.Default; - passiveDesc.text = pas != null && db != null && db.Skills != null ? OutGame.SkillInfoDb.DisplayDesc(db.Skills.Get(pid)) : ""; - } - Show(passiveDesc, passiveDesc.text.Length > 0); + // 패시브 칸 = RefreshDesc 끝의 RefreshPassiveSlot(액티브를 고르면 같은 칸에 액티브 정보 · PD 2026-11-24) } - string shownPassiveId; + string shownSlotKey; + SkillDef slotActive; // 패시브 칸에 띄운 액티브(없음 = 패시브) + + /// 패시브 칸 = 평소 패시브(아이콘 · 붉은 「패시브」 · 이름 · 설명) · 액티브 예약 · 지점 선택 · 즉시 시전 대기 · 쿨 중 누름 = 같은 칸에 액티브(아이콘 · 「액티브」 · 이름 Lv · 쿨 · 설명) + /// — PD 2026-11-24 「액티브를 선택하면 스킬 정보가 패시브 스킬 영역에 보여지도록」(위 두루마리 설명 칸이 전장의 내 유닛을 가림). + void RefreshPassiveSlot(Unit u, UnitSkills s, SkillDef active, int activeLv) + { + slotActive = active; + var pas = s != null ? s.Passive : null; + bool keepLayout = N("desk_keep_layout", 0, 0f) > 0.5f; + Show(passiveGroup, active != null || pas != null || keepLayout); + var show = active ?? pas; + string key = active != null ? "A|" + active.Id + "|" + activeLv + : pas != null ? "P|" + pas.Id + "|" + (s.PassiveMult > 1f) + : "N"; + if (key == shownSlotKey) return; + shownSlotKey = key; + + passiveLabelText.text = T(active != null ? "battle.active.label" : "battle.passive.label"); + passiveLabel.color = active != null ? C("active_label_art", 0, new Color(0.18f, 0.54f, 0.39f)) : C("passive_label_art", 1, new Color(0.72f, 0.21f, 0.16f)); + if (active != null) + skillPassive.text = active.Cooldown > 0 ? F("battle.skill.active_line_cool", active.NameKo, activeLv, active.Cooldown) : F("battle.skill.active_line", active.NameKo, activeLv); + else if (pas != null) + skillPassive.text = F("battle.skill.passive_line", s.PassiveMult > 1f ? F("battle.skill.passive_boost", pas.NameKo) : pas.NameKo); + else + skillPassive.text = keepLayout ? T("battle.passive.none") : ""; // 패시브 없는 유닛도 같은 판(PD 2026-11-21) + var psp = show != null ? SkillSprite(show, u) : null; + if (passiveIcon.sprite != psp) passiveIcon.sprite = psp; + Show(passiveIcon, psp != null); + // 설명(스킬 표 desc_ko · 바뀔 때만 찾음 · PD 2026-11-21 2차) + var db = OutGame.OutGameData.Default; + passiveDesc.text = show != null && db != null && db.Skills != null ? OutGame.SkillInfoDb.DisplayDesc(db.Skills.Get(show.Id)) : ""; + Show(passiveDesc, passiveDesc.text.Length > 0); + // 액티브 설명이 최소 글자로도 넘치면 판을 위로 늘림(표 active_slot_grow 만큼 = 능력치 줄을 다 덮음 · 반만 덮여 잘린 알약이 보이지 않게) — 패시브는 늘 보이는 판이라 그대로(능력치를 가리지 않음) + SetSlotGrow(0f); + if (active != null && passiveDesc.text.Length > 0 && SlotOverflow() > 0f) SetSlotGrow(N("active_slot_grow", 0, 68f)); + } + + RectTransform[] slotRts; + float[] slotBaseY, slotBaseH; + float slotGrow; + + /// 패시브 칸을 위로 g 만큼 늘림(아래 기준 칸 = 판 · 설명은 높이 + g · 아이콘 · 알약 · 이름은 위로 g). + void SetSlotGrow(float g) + { + if (slotRts == null) + { + slotRts = new[] { passiveTray, passiveDesc.rectTransform.parent as RectTransform, passiveIcon.rectTransform, passiveLabel.rectTransform, passiveLine }; + slotBaseY = new float[slotRts.Length]; + slotBaseH = new float[slotRts.Length]; + for (int i = 0; i < slotRts.Length; i++) + if (slotRts[i] != null) + { + slotBaseY[i] = slotRts[i].anchoredPosition.y; + slotBaseH[i] = slotRts[i].sizeDelta.y; + } + } + if (Mathf.Abs(g - slotGrow) < 0.5f) return; + slotGrow = g; + for (int i = 0; i < slotRts.Length; i++) + { + var rt = slotRts[i]; + if (rt == null) continue; + if (i < 2) rt.sizeDelta = new Vector2(rt.sizeDelta.x, slotBaseH[i] + g); + else rt.anchoredPosition = new Vector2(rt.anchoredPosition.x, slotBaseY[i] + g); + } + } + + /// 설명을 최소 글자 크기로 썼을 때 칸 높이를 넘는 양(UI 단위 · 0 이하 = 들어감). + float SlotOverflow() + { + var t = passiveDesc; + var rt = t.rectTransform; + var set = t.GetGenerationSettings(new Vector2(rt.rect.width, 0f)); + set.resizeTextForBestFit = false; + set.fontSize = t.resizeTextMinSize; + set.verticalOverflow = VerticalWrapMode.Overflow; + float need = t.cachedTextGeneratorForLayout.GetPreferredHeight(t.text, set) / Mathf.Max(0.01f, t.pixelsPerUnit); + return need - rt.rect.height; + } static Sprite SkillSprite(SkillDef d, Unit u) { @@ -1689,6 +1836,10 @@ namespace TKS def = previewDef; kind = previewDef.IsActive ? DescKind.Active : DescKind.Passive; } + // 액티브 = 아래 패시브 칸에 띄움 · 위 두루마리 칸 = 패시브 줄을 눌렀을 때만(PD 2026-11-24 「내 캐릭터가 액티브 스킬 정보에 가려지는 현상」) + var slotDef = kind == DescKind.Active ? def : null; + if (full && u != null) RefreshPassiveSlot(u, s, slotDef, slotDef != null && s != null ? s.ActiveLv : 0); + if (kind == DescKind.Active) def = null; Show(descPanel, def != null); if (def == null) { diff --git a/Assets/Scripts/Runtime/Board.cs b/Assets/Scripts/Runtime/Board.cs index 27df3daf..b8d24953 100644 --- a/Assets/Scripts/Runtime/Board.cs +++ b/Assets/Scripts/Runtime/Board.cs @@ -67,13 +67,17 @@ namespace TKS mid.transform.localScale = new Vector3(w, 0.06f, 1f); } - // 테두리 - var borderColor = new Color(0.85f, 0.75f, 0.45f); - const float t = 0.16f; - MakeBorder("BorderTop", new Vector2(0f, h * 0.5f + t * 0.5f), new Vector2(w + t * 2f, t), borderColor); - MakeBorder("BorderBottom", new Vector2(0f, -h * 0.5f - t * 0.5f), new Vector2(w + t * 2f, t), borderColor); - MakeBorder("BorderLeft", new Vector2(-w * 0.5f - t * 0.5f, 0f), new Vector2(t, h), borderColor); - MakeBorder("BorderRight", new Vector2(w * 0.5f + t * 0.5f, 0f), new Vector2(t, h), borderColor); + // 테두리 = 도형 판만(그림 판 = 전장 밖 여분 그림 위로 금색 선이 가로질러 「알 수 없는 경계선」 · PD 2026-11-24 · 표 ib_ui board_border_on_art) + borderOn = !HasArt || IbUi.Num("board_border_on_art", 0f) > 0.5f; + if (borderOn) + { + var borderColor = new Color(0.85f, 0.75f, 0.45f); + const float t = 0.16f; + MakeBorder("BorderTop", new Vector2(0f, h * 0.5f + t * 0.5f), new Vector2(w + t * 2f, t), borderColor); + MakeBorder("BorderBottom", new Vector2(0f, -h * 0.5f - t * 0.5f), new Vector2(w + t * 2f, t), borderColor); + MakeBorder("BorderLeft", new Vector2(-w * 0.5f - t * 0.5f, 0f), new Vector2(t, h), borderColor); + MakeBorder("BorderRight", new Vector2(w * 0.5f + t * 0.5f, 0f), new Vector2(t, h), borderColor); + } // 벽 콜라이더 (바깥쪽 1 단위 두께) const float wallT = 1f; @@ -87,6 +91,7 @@ namespace TKS SpriteRenderer background; Sprite defaultArt; EdgeFog fog; + bool borderOn; // 전장 테두리 금색 선을 그렸는가(그림 판 = 안 그림 → 구름이 그림 끝을 조금 덮음 · EdgeFog) Rect bgRect, eventRect, fogRect; /// 지금 보이는 배경 그림이 덮는 범위(바깥 여분 포함 · 여분이 없는 그림 = 전장과 같음). @@ -105,7 +110,7 @@ namespace TKS if (fog != null && fogRect == ArtRect) return; if (fog != null) Destroy(fog.gameObject); fogRect = ArtRect; - fog = EdgeFog.Build(transform, Rect, fogRect); + fog = EdgeFog.Build(transform, Rect, fogRect, borderOn); } struct ArtMargin diff --git a/Assets/Scripts/Runtime/DangerZone.cs b/Assets/Scripts/Runtime/DangerZone.cs new file mode 100644 index 00000000..dc47a081 --- /dev/null +++ b/Assets/Scripts/Runtime/DangerZone.cs @@ -0,0 +1,145 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace TKS +{ + /// + /// 적 위험 범위(PD 2026-11-24 「적의 사정거리 범위가 어디인지 알 수 있는 옵션 · On / Off · 턴제 SRPG 처럼 붉은색 영역으로 위험 범위」) — + /// 다음 적 턴에 적의 공격이 닿을 수 있는 곳 = 적마다 원의 합집합을 붉은 반투명 면 + 바깥 테두리 선으로 전장 위(유닛 아래)에 깐다. 아군 차례에만 보인다. + /// 원 반지름: 근접 · 기병 = 슬링 최대 거리(SkillMods.SlingMax · 스킬 반영) + 적 몸 반지름 + 아군 몸 반지름 · 궁병 · 책사 = 사거리(SkillMods.Range) + 아군 몸 반지름(쏘거나 옮기거나 한 번). + /// 빼는 적 = 다음 차례를 쉬는 적(기절 · 행동 불가) · 공격력 0(허수아비) · 연출이 숨긴 적 · NPC. 벽 · 장애물로 막히는 길은 계산하지 않는다(원 = 닿을 수 있는 최대 범위). + /// 켬/끔 = HUD 「위험 범위」 단추(BattleHUD.TryDangerTap) · 기억 = PlayerPrefs · 값 = 표 ib_ui danger_*(C45). + /// + public class DangerZone : MonoBehaviour + { + const string Pref = "tks_danger_zone"; + const int Order = -13; // 배경(−20) · 구름(−15) 위 · 사거리 원판(−11) · 선(−9 · −8) · 유닛 아래 + + public static bool On + { + get { return PlayerPrefs.GetInt(Pref, 0) == 1; } + set { PlayerPrefs.SetInt(Pref, value ? 1 : 0); } + } + + BattleManager battle; + SpriteRenderer sr; + Texture2D tex; + string sig = ""; + + /// 지금 보이는가(시험 · 캡처). + public bool Shown { get { return sr != null && sr.enabled; } } + + /// 지금 그린 원 수(시험 · 캡처). + public int Circles { get; private set; } + + public static DangerZone Create(BattleManager b) + { + if (b == null || b.Board == null) return null; + var go = new GameObject("DangerZone"); + go.transform.SetParent(b.Board.transform, false); + var z = go.AddComponent(); + z.battle = b; + z.sr = go.AddComponent(); + z.sr.sortingOrder = Order; + z.sr.enabled = false; + return z; + } + + /// 적 하나의 위험 원 반지름(월드 · 원의 중심 = 적 위치). + public static float Reach(Unit e, float allyRadius) + { + if (UnitTypeInfo.IsRanged(e.Type)) return Mathf.Max(0f, SkillMods.Range(e)) + allyRadius; + return Mathf.Max(0f, SkillMods.SlingMax(e)) + e.Radius + allyRadius; + } + + static bool Counts(Unit e) + { + return e != null && e.IsAlive && !e.Npc && e.Atk > 0 && !ScenarioEvent.Absent(e) && !SkillStatus.Stunned(e); + } + + void LateUpdate() + { + bool show = On && battle != null && battle.Board != null && battle.Phase == BattlePhase.PlayerTurn; + if (!show) + { + if (sr.enabled) sr.enabled = false; + return; + } + float allyR = 0f; + foreach (var a in battle.AliveUnits(Faction.Player)) allyR = Mathf.Max(allyR, a.Radius); + // 바뀔 때만 다시 굽는다(적 위치 · 반지름 · 수) + var sb = new System.Text.StringBuilder(); + foreach (var e in battle.AliveUnits(Faction.Enemy)) + { + if (!Counts(e)) continue; + sb.Append(Mathf.RoundToInt(e.Position.x * 20f)).Append(',').Append(Mathf.RoundToInt(e.Position.y * 20f)).Append(',') + .Append(Mathf.RoundToInt(Reach(e, allyR) * 20f)).Append(';'); + } + string s = sb.ToString(); + if (s != sig) + { + sig = s; + Rebuild(allyR); + } + if (!sr.enabled) sr.enabled = Circles > 0; + } + + void Rebuild(float allyR) + { + var rect = battle.Board.Rect; + float ppu = Mathf.Clamp(IbUi.Num("danger_ppu", 12f), 4f, 32f); + int w = Mathf.Max(4, Mathf.CeilToInt(rect.width * ppu)), h = Mathf.Max(4, Mathf.CeilToInt(rect.height * ppu)); + var cs = new List(); + foreach (var e in battle.AliveUnits(Faction.Enemy)) + if (Counts(e)) cs.Add(new Vector3(e.Position.x, e.Position.y, Reach(e, allyR))); + Circles = cs.Count; + if (tex == null || tex.width != w || tex.height != h) + { + if (tex != null) Destroy(tex); + tex = new Texture2D(w, h, TextureFormat.RGBA32, false) { filterMode = FilterMode.Bilinear, wrapMode = TextureWrapMode.Clamp }; + } + Color fill = IbUi.Col("danger_fill", new Color(0.9f, 0.12f, 0.1f, 0.22f)); + Color edge = IbUi.Col("danger_edge", new Color(0.95f, 0.15f, 0.12f, 0.9f)); + float edgeW = Mathf.Max(0.01f, IbUi.Num("danger_edge_w", 0.12f)); + float aa = 1f / ppu; // 가장자리 부드럽게(1 텍셀) + var px = new Color32[w * h]; + for (int y = 0; y < h; y++) + { + float wy = rect.yMin + (y + 0.5f) / ppu; + for (int x = 0; x < w; x++) + { + float wx = rect.xMin + (x + 0.5f) / ppu; + float d = float.NegativeInfinity; // 합집합 안쪽 깊이(+ = 안) + for (int i = 0; i < cs.Count; i++) + { + float dx = wx - cs[i].x, dy = wy - cs[i].y; + float v = cs[i].z - Mathf.Sqrt(dx * dx + dy * dy); + if (v > d) d = v; + } + Color c; + if (d <= -aa) c = new Color(0f, 0f, 0f, 0f); + else + { + float inside = Mathf.Clamp01((d + aa) / (2f * aa)); // 바깥 → 안 경계 부드럽게 + float ring = Mathf.Clamp01((edgeW - d) / aa); // 경계에서 edgeW 안쪽까지 = 테두리 + c = Color.Lerp(fill, edge, ring); + c.a *= inside; + } + px[y * w + x] = c; + } + } + tex.SetPixels32(px); + tex.Apply(false); + if (sr.sprite != null) Destroy(sr.sprite); + sr.sprite = Sprite.Create(tex, new Rect(0, 0, w, h), new Vector2(0.5f, 0.5f), ppu); + transform.localPosition = new Vector3(rect.center.x, rect.center.y, 0f); + transform.localScale = new Vector3(rect.width / (w / ppu), rect.height / (h / ppu), 1f); + } + + void OnDestroy() + { + if (sr != null && sr.sprite != null) Destroy(sr.sprite); + if (tex != null) Destroy(tex); + } + } +} diff --git a/Assets/Scripts/Runtime/DangerZone.cs.meta b/Assets/Scripts/Runtime/DangerZone.cs.meta new file mode 100644 index 00000000..1cb4fca6 --- /dev/null +++ b/Assets/Scripts/Runtime/DangerZone.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3f0190f0808a0504e822e65492fb4aa1 \ No newline at end of file diff --git a/Assets/Scripts/Runtime/EdgeFog.cs b/Assets/Scripts/Runtime/EdgeFog.cs index 03a6a761..c0f5ad6e 100644 --- a/Assets/Scripts/Runtime/EdgeFog.cs +++ b/Assets/Scripts/Runtime/EdgeFog.cs @@ -20,16 +20,17 @@ namespace TKS float drift, driftSec; /// board = 전장 · art = 지금 보이는 배경 그림이 덮는 범위(여분 포함 · 여분이 없으면 전장과 같음). 둘 다 parent 기준 좌표. - public static EdgeFog Build(Transform parent, Rect board, Rect art) + /// border = 전장 테두리 금색 선이 있는가(없으면 구름이 전장 끝을 표 edge_fog_board_in 만큼 덮어 그림 끝 직선 · 그 밖 빈 틈을 가림 · PD 2026-11-24 「알 수 없는 경계선」). + public static EdgeFog Build(Transform parent, Rect board, Rect art, bool border = true) { var go = new GameObject("EdgeFog"); go.transform.SetParent(parent, false); var f = go.AddComponent(); - f.Make(board, art); + f.Make(board, art, border ? Keep : -Mathf.Max(0f, IbUi.Num("edge_fog_board_in", 0.4f))); return f; } - void Make(Rect board, Rect art) + void Make(Rect board, Rect art, float keep) { float size = Mathf.Max(0.5f, IbUi.Num("edge_fog_size", 3.2f)); float fin = Mathf.Max(0f, IbUi.Num("edge_fog_in", 0.8f)); @@ -40,8 +41,8 @@ namespace TKS // 구름이 시작되는 선 = 그림 끝에서 fin 안쪽 · 다만 전장 테두리 밖 var r0 = Rect.MinMaxRect( - Mathf.Min(art.xMin + fin, board.xMin - Keep), Mathf.Min(art.yMin + fin, board.yMin - Keep), - Mathf.Max(art.xMax - fin, board.xMax + Keep), Mathf.Max(art.yMax - fin, board.yMax + Keep)); + Mathf.Min(art.xMin + fin, board.xMin - keep), Mathf.Min(art.yMin + fin, board.yMin - keep), + Mathf.Max(art.xMax - fin, board.xMax + keep), Mathf.Max(art.yMax - fin, board.yMax + keep)); BuildBase(Grow(r0, size * 0.55f), fout + 60f, IbUi.Col("edge_fog_base", new Color(0.93f, 0.91f, 0.94f, 1f))); diff --git a/Assets/Scripts/Runtime/RangeIndicator.cs b/Assets/Scripts/Runtime/RangeIndicator.cs index 7dcedc8b..c7a8c8a1 100644 --- a/Assets/Scripts/Runtime/RangeIndicator.cs +++ b/Assets/Scripts/Runtime/RangeIndicator.cs @@ -140,6 +140,66 @@ namespace TKS disc.gameObject.SetActive(false); skillVec = VectorRing.Create(transform, "SkillRangeVec", -7); skillVec.gameObject.SetActive(false); + maxVec = VectorRing.Create(transform, "SlingMaxVec", -10); + maxVec.gameObject.SetActive(false); + } + + // ---------- 파워에 따른 원(PD 2026-11-24 「슬링샷 파워(화살표 길이)에 따라 원형 반경이 조절 · 내 파워가 정확히 어느 위치까지 갈지」) ---------- + // 조준 중 = 사거리 원 · 원판이 지금 화살표 길이(나갈 거리)로 줄고 늘어남 · 최대 거리 = 옅은 가는 선으로 남김 · 조준을 거두면 최대 거리로 돌아감 · 표 ib_ui range_power_* + VectorRing maxVec; + float maxRadius; + bool powerOn; + + /// 조준 중인가(원 = 지금 파워 거리). + public bool PowerShown { get { return powerOn; } } + + /// 지금 원 반지름(월드 · 조준 중 = 파워 거리 · 아니면 최대 거리). + public float Radius { get { return radius; } } + + /// 조준 중: 원 반지름 = r(지금 화살표 길이 · 월드). + public void SetPower(float r) + { + if (target == null || !VectorVisible || IbUi.Num("range_power_follow", 1f) < 0.5f) return; + if (!powerOn) + { + powerOn = true; + maxRadius = radius; + if (maxVec != null && IbUi.Num("range_power_max_px", 2f) > 0f) + { + maxVec.Indicator = false; + maxVec.LineColor = IbUi.Col("range_power_max_color", new Color(1f, 0.95f, 0.84f, 0.45f)); + maxVec.UnderColor = new Color(0f, 0f, 0f, 0f); + maxVec.LinePx = IbUi.Num("range_power_max_px", 2f); + maxVec.UnderPx = 0f; + maxVec.DiscAlpha = 0f; + maxVec.gameObject.SetActive(true); + maxVec.SetRadius(maxRadius); + } + } + ApplyRadius(Mathf.Clamp(r, 0.05f, Mathf.Max(maxRadius, r))); + } + + /// 조준을 거둠: 원 = 다시 최대 거리. + public void ClearPower() + { + if (!powerOn) return; + powerOn = false; + if (maxVec != null) maxVec.gameObject.SetActive(false); + ApplyRadius(maxRadius); + } + + void ApplyRadius(float r) + { + radius = r; + for (int i = 0; i < Segs; i++) + { + float a = i * Mathf.PI * 2f / Segs; + var p = new Vector3(Mathf.Cos(a) * r, Mathf.Sin(a) * r, 0f); + line.SetPosition(i, p); + under.SetPosition(i, p); + } + disc.transform.localScale = new Vector3(r * 2f, r * 2f, 1f); + UpdateVector(); } VectorRing skillVec; @@ -154,6 +214,8 @@ namespace TKS { style = StyleOverride >= 0 ? StyleOverride : Mathf.RoundToInt(IbUi.Num("range_style", 1f)); radius = r; + powerOn = false; + if (maxVec != null) maxVec.gameObject.SetActive(false); bool on = style > 0 && line != null; if (ring != null) ring.gameObject.SetActive(!on); if (line == null) return; @@ -253,6 +315,8 @@ namespace TKS void HideVector() { + powerOn = false; + if (maxVec != null) maxVec.gameObject.SetActive(false); if (line != null) line.gameObject.SetActive(false); if (disc != null) disc.gameObject.SetActive(false); foreach (var t in ticks) t.gameObject.SetActive(false); diff --git a/Assets/Scripts/Runtime/SlingshotInput.cs b/Assets/Scripts/Runtime/SlingshotInput.cs index 5a57d7f0..6ad9b5c7 100644 --- a/Assets/Scripts/Runtime/SlingshotInput.cs +++ b/Assets/Scripts/Runtime/SlingshotInput.cs @@ -696,6 +696,9 @@ namespace TKS return; } + if (hud != null && hud.TryDangerTap(screen)) return; // 위험 범위 켬/끔(미니맵 아래 단추 · PD 2026-11-24) + if (hud != null && hud.TryDeskTap(screen)) return; // 아래 정보판 위 = 전장으로 넘기지 않음(영웅 선택 유지 · 스킬 정보 칸 = 발동 대기만 취소 · PD 2026-11-24) + Vector2 mapWorld; if (hud != null && camCtrl != null && hud.TryMinimapTap(screen, out mapWorld)) { @@ -967,6 +970,7 @@ namespace TKS void ShowAim(Unit u, Vector2 target) { if (ibArrow != null) ibArrow.Aim(u, target - u.Position, (target - u.Position).magnitude / Mathf.Max(0.001f, AimMax(u))); + if (range != null && range.Target == u) range.SetPower((target - u.Position).magnitude); // 사거리 원 = 지금 파워(화살표 길이)로 나갈 거리(PD 2026-11-24) RefreshSkillShape(u, target); } @@ -992,6 +996,7 @@ namespace TKS { if (ibArrow != null) ibArrow.End(); if (skillShape != null) skillShape.Hide(); + if (range != null) range.ClearPower(); // 사거리 원 = 다시 최대 거리 } /// @@ -1154,6 +1159,7 @@ namespace TKS tipTarget = null; if (ibArrow != null) ibArrow.SetAttack(false); if (skillShape != null) skillShape.Hide(); + if (range != null) range.ClearPower(); if (battle != null && battle.Gimmicks != null) battle.Gimmicks.Preview.Hide(); } diff --git a/Assets/Scripts/Runtime/UnitView.cs b/Assets/Scripts/Runtime/UnitView.cs index 80e4bf43..ab364dbc 100644 --- a/Assets/Scripts/Runtime/UnitView.cs +++ b/Assets/Scripts/Runtime/UnitView.cs @@ -29,6 +29,25 @@ namespace TKS SpriteRenderer bossRing; SpriteRenderer selectRing; SpriteRenderer highlightRing; + SpriteRenderer hpClassIcon; // 체력 바 왼쪽 병종 아이콘(PD 2026-11-24) + + /// 체력 바 왼쪽 병종 아이콘이 있는가 · 이름표가 보이는가(시험 · 캡처). + public bool HpClassIconShown { get { return hpClassIcon != null && hpClassIcon.gameObject.activeInHierarchy; } } + public bool NameShown { get { return nameLabel != null && nameLabel.gameObject.activeSelf; } } + + SpriteRenderer teamDisc; // 진영 발판(아군 파랑 · 적 빨강 · PD 2026-11-24 「아군과 적을 잘 구분하지 못함」) + SpriteRenderer teamRing; + + /// 진영 발판이 있는가(시험 · 캡처). + public bool TeamMarkShown { get { return teamRing != null && teamRing.gameObject.activeSelf; } } + + /// 체력 바 색 = 진영 색(표 ib_ui team_hp_on = 1 · 아군 · 적 고정색 · 남은 양 = 바 길이) · 0 = 예전(남은 비율로 초록 · 노랑 · 빨강). + Color HpColor(float ratio, Color hi, Color mid, Color low) + { + if (IbUi.Num("team_hp_on", 1f) > 0.5f) + return unit.Faction == Faction.Player ? IbUi.Col("team_hp_ally", hi) : IbUi.Col("team_hp_enemy", new Color(0.92f, 0.24f, 0.2f)); + return ratio > 0.5f ? hi : ratio > 0.25f ? mid : low; + } SpriteRenderer overwatchArea; SpriteRenderer hpBg; SpriteRenderer hpFill; @@ -196,6 +215,20 @@ namespace TKS highlightRing.transform.localPosition = ringPos; highlightRing.enabled = false; + // 진영 발판(PD 2026-11-24 「유저가 아군과 적을 잘 구분하지 못함」) = 발밑 진영 색 옅은 원판 + 테(아군 파랑 · 적 빨강 · 납작한 타원) · 선택 · 강조 원 아래 · 표 ib_ui team_* + if (IbUi.Num("team_ring_on", 1f) > 0.5f) + { + bool ally = u.Faction == Faction.Player; + var tc = IbUi.Col(ally ? "team_ring_ally" : "team_ring_enemy", ally ? new Color(0.27f, 0.58f, 1f) : new Color(1f, 0.27f, 0.22f)); + float tw = ringD * IbUi.Num("team_ring_scale", 0.85f), sq = IbUi.Num("team_ring_squash", 0.5f); + teamDisc = ProceduralSprites.NewSprite(transform, "TeamDisc", ProceduralSprites.SoftDisc, new Color(tc.r, tc.g, tc.b, IbUi.Num("team_disc_alpha", 0.45f)), 1f, ringOrder - 2); + teamDisc.transform.localPosition = ringPos; + teamDisc.transform.localScale = new Vector3(tw, tw * sq, 1f); + teamRing = ProceduralSprites.NewSprite(transform, "TeamRing", ProceduralSprites.Ring, new Color(tc.r, tc.g, tc.b, IbUi.Num("team_ring_alpha", 0.9f)), 1f, ringOrder - 1); + teamRing.transform.localPosition = ringPos; + teamRing.transform.localScale = new Vector3(tw, tw * sq, 1f); + } + // HP 바 = 도형이면 원 위 · 아트면 머리 위(발 = −0.55 R · 세로 ArtHeight) — 얼굴을 가리지 않게(PD #1081 첨부 캡처) float topY = anim != null ? -u.Radius * 0.55f + u.ArtHeight + 0.12f : u.Radius + 0.22f; hpBg = ProceduralSprites.NewSprite(transform, "HpBg", ProceduralSprites.Square, new Color(0.08f, 0.08f, 0.08f, 0.9f), 1f, 2); @@ -226,7 +259,8 @@ namespace TKS // 이름표 병종 = 글자 「·보」 대신 병종 아이콘(PD 2026-11-22 「병종 아이콘이 필요한 모든 위치」 · 표 unit_name_cls = 크기(월드 · 0 = 글자 그대로)|이름과 간격 · 이름 왼쪽 · 아이콘 + 이름 묶음이 유닛 가운데) float clsSize = anim != null ? BattleHUD.TableValue("unit_name_cls", 0, 0f) : 0f; var clsSp = clsSize > 0f ? UISkin.Icon(OutGame.UiKit.TypeSymbolId(u.Type)) : null; - nameLabel = TextUtil.CreateWorldText(transform, anim != null && clsSp == null ? u.DisplayName + "·" + UnitTypeInfo.Mark(u.Type) : u.DisplayName, 0.26f, new Color(0.95f, 0.95f, 0.9f), 4); + var nameCol = IbUi.Col(u.Faction == Faction.Player ? "team_name_ally" : "team_name_enemy", new Color(0.95f, 0.95f, 0.9f)); // 이름표 = 진영 옅은 색(PD 2026-11-24 아군 · 적 구분) + nameLabel = TextUtil.CreateWorldText(transform, anim != null && clsSp == null ? u.DisplayName + "·" + UnitTypeInfo.Mark(u.Type) : u.DisplayName, 0.26f, nameCol, 4); float clsShift = 0f; if (clsSp != null) { @@ -246,6 +280,23 @@ namespace TKS var strokeC = UISkin.Col("stroke", new Color(0.12f, 0.15f, 0.21f)); float strokeD = BattleHUD.TableValue("unit_name_outline", 0, 0f); TextUtil.WorldOutline(nameLabel, strokeC, strokeD); + // 체력 바 왼쪽 병종 아이콘 · 발밑 이름표 없앰(PD 2026-11-24 「각 병졸의 HP바 왼쪽에 각 병종 아이콘을 배치하고 이름 정보는 제거 · 적군 포함」 · + // 표 unit_hp_cls = 아이콘 크기(월드 · 0 = 없음)|체력 바와 간격|이름표 숨김(1)) — 아트 없는 도형 유닛 = 몸 위 병종 글자 그대로 + float hpCls = BattleHUD.TableValue("unit_hp_cls", 0, 0f); + var hpClsSp = anim != null && hpCls > 0f ? UISkin.Icon(OutGame.UiKit.TypeSymbolId(u.Type)) : null; + if (hpClsSp != null) + { + var hg = new GameObject("HpClassIcon"); + hg.transform.SetParent(transform, false); + hpClassIcon = hg.AddComponent(); + hpClassIcon.sprite = hpClsSp; + hpClassIcon.sortingOrder = 4; + float k = hpCls * hpClsSp.pixelsPerUnit / Mathf.Max(1f, hpClsSp.rect.height); + hg.transform.localScale = new Vector3(k, k, 1f); + float barHalf = (packHp ? HpBarWidth + 0.1f : HpBarWidth) * 0.5f; + hg.transform.localPosition = new Vector3(-(barHalf + BattleHUD.TableValue("unit_hp_cls", 1, 0.02f) + hpCls * 0.5f), topY, 0f); + } + if (BattleHUD.TableValue("unit_hp_cls", 2, 0f) > 0.5f) nameLabel.gameObject.SetActive(false); badge = TextUtil.CreateWorldText(transform, "추가 이동", 0.22f, new Color(1f, 0.95f, 0.4f), 5); badge.transform.localPosition = new Vector3(0f, topY + 0.24f, 0f); TextUtil.WorldOutline(badge, strokeC, strokeD); // 머리 위 표시도 같은 외곽선(QA r1 F4 · 모래 바탕에 묻힘) @@ -285,13 +336,13 @@ namespace TKS hpFill.enabled = w > 0.045f; hpFill.size = new Vector2(Mathf.Max(0.045f, w), 0.13f); hpFill.transform.localPosition = new Vector3(-HpBarWidth * 0.5f + w * 0.5f, hpBg.transform.localPosition.y + 0.015f, 0f); - hpFill.color = ratio > 0.5f ? UISkin.Col("hp_hi", Color.green) : ratio > 0.25f ? UISkin.Col("hp_mid", Color.yellow) : UISkin.Col("hp_low", Color.red); + hpFill.color = HpColor(ratio, UISkin.Col("hp_hi", Color.green), UISkin.Col("hp_mid", Color.yellow), UISkin.Col("hp_low", Color.red)); } else { hpFill.transform.localScale = new Vector3(HpBarWidth * ratio, 0.12f, 1f); hpFill.transform.localPosition = new Vector3(-HpBarWidth * 0.5f + HpBarWidth * ratio * 0.5f, hpBg.transform.localPosition.y, 0f); - hpFill.color = ratio > 0.5f ? new Color(0.35f, 0.9f, 0.35f) : (ratio > 0.25f ? new Color(0.95f, 0.8f, 0.2f) : new Color(0.95f, 0.3f, 0.2f)); + hpFill.color = HpColor(ratio, new Color(0.35f, 0.9f, 0.35f), new Color(0.95f, 0.8f, 0.2f), new Color(0.95f, 0.3f, 0.2f)); } bool dim = unit.Faction == Faction.Player && unit.ActedThisTurn && ((!unit.Npc && !ScenarioEvent.Running) || (unit.Downed && SkillStatus.Stunned(unit))); // 연출 중 = 행동을 마친 유닛도 밝게(대화에 참여 · 2026-11-19 PD 2막 「마을 사람들을 구한 관우는 어두워지지 않고」) // 구출 대상은 흐리게 하지 않는다 · 기절한 구출 대상 = 계속 행동 마침(2026-11-18 PD) · 기절하기 전(시작 연출)은 밝게(2026-11-19 PD 「유비가 어두운 상태로 보이게 하지 말고」)