ThreeKingdomsSlingshot/Assets/Scripts/OutGame/Data/CostumeDb.cs

136 lines
4.2 KiB
C#
Raw Normal View History

성장 · 임무 · 출정 · 외형 · 정보 일괄 — 임무(미션) 메뉴 · 영웅 각성 · 진화(진영 비서) · 스킬 강화(영웅 조각 + 만능 조각) · 각성 칸 = 승급 장비 등급 · 장비 등급 7(불멸 red · 신화 rainbow) · 병종 장비 210 · 장별 드랍 · 영웅 Lv100 · 출정 = 로비 편성(학습 판 = 연의 전기만) · 보스 말풍선만 · 1장 레벨디자인 · 외형(코스튬) 꾸미기 레이어 · 영웅 정보(능력치 · 열전) - 임무: 일일 · 주간 · 업적 · 카운터 36 · 우편 · 로비 버튼(MissionTests) - 각성 · 진화: 표 11장 · 진화 = ★ 최대 레벨 + 진영 비서 + 골드 · 비서 교환 · 각성 굴림 · 잠금 · 칸 = 승급 장비 등급(AwakenTests) - 스킬 강화: skill_upgrade · skill_config(최고 Lv10 · 상한 = 영웅 레벨 10 단위) · 만능 조각 확인 팝업 - 장비: gear_grades · gear_kinds · gear_drop_chapters · gear_drop_stages · 승급 7단계 · 무지개 7색 순환(UiRainbow) · TKS/Import Gear(GearTests) - 출정: 학습 판 = 연의 전기 서장만(WantsTutorialPlan) · boss_intro_config talk_main · 1장 표 · 1-4 가시덤불 정정(MainStageTests · TutorialTests [Ignore]) - 외형: 부위 4(외형 = 추후) · 꾸미기 9 · 기준점 · 알파 경계 · 전투 · UI 레이어 · 미리보기 · 상세(CostumeTests) - 정보: 능력치(기본 + 성장 = 합계 · HeroRules 그대로) · 전투 능력치 7 · 성장 내역 · 내역 창 · 열전(HeroInfoTests) - 같은 작업 트리의 다른 세션 미커밋 변경(스킬 이펙트 · 전투 해석기 · 보급전 표 · 스킬 표 등)은 넣지 않음 PD 2026-11-20 「지금까지 본 PC에서 구현된 모든 성장 관련 기능을 다른 세션에서 확인할 수 있도록 푸시까지 진행해」 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:15:36 +00:00
using System;
using System.Collections.Generic;
using System.Globalization;
using UnityEngine;
namespace TKS.OutGame
{
/// <summary>
/// 외형(코스튬) 표 4장(2026-11-20 개발요청_코스튬 §1 · 기획 tables/ 사본) — costume_slots(부위 4 · 그리는 순서 · 기준점 · 외형 = 추후) · costume_items(꾸미기 9) ·
/// costume_config · costume_anchors(유닛별 기준점 · 그림 비율 · 왼쪽 위 0) + 유닛 그림 알파 경계(frames · 임포트가 PNG 에서 계산 · 프레임 윗선 이동 · 자동 기준점).
/// 임포트 = TKS/Import Costume → Resources/OutGame/CostumeDb.asset · 값은 전부 표(C45).
/// </summary>
public class CostumeDb : ScriptableObject
{
[Serializable]
public class Slot
{
public string slot = "";
public int order;
public string nameKo = "";
public int layer;
public string anchor = "";
public bool open;
}
[Serializable]
public class Item
{
public string id = "";
public string slot = "";
public string nameKo = "";
public string rarity = "";
public string source = "";
public string sourceKo = "";
public string art = "";
}
[Serializable]
public class Anchor
{
public string unit = "";
public string anchor = "";
public float x;
public float y;
public float scale = 1f;
public float rot;
}
/// <summary>유닛 그림 한 프레임의 알파 경계(px · 왼쪽 위 0 · 프레임 크기 w × h).</summary>
[Serializable]
public class Frame
{
public string art = "";
public string clip = "";
public int index;
public int w;
public int h;
public int left;
public int top;
public int right;
public int bottom;
}
[Serializable]
public class KV
{
public string key = "";
public string value = "";
}
public List<Slot> slots = new List<Slot>();
public List<Item> items = new List<Item>();
public List<Anchor> anchors = new List<Anchor>();
public List<KV> config = new List<KV>();
public List<Frame> frames = new List<Frame>();
Dictionary<string, Frame> frameIndex;
public string Cfg(string key)
{
foreach (var c in config)
if (c.key == key) return c.value;
return "";
}
public Slot SlotOf(string s)
{
foreach (var x in slots)
if (x.slot == s) return x;
return null;
}
public Item ItemOf(string id)
{
foreach (var x in items)
if (x.id == id) return x;
return null;
}
public Anchor AnchorOf(string unit, string anchor)
{
foreach (var a in anchors)
if (a.unit == unit && a.anchor == anchor) return a;
return null;
}
public Frame FrameOf(string art, string clip, int index)
{
if (frameIndex == null || frameIndex.Count != frames.Count)
{
frameIndex = new Dictionary<string, Frame>();
foreach (var f in frames) frameIndex[f.art + "/" + f.clip + "/" + f.index] = f;
}
Frame r;
return frameIndex.TryGetValue(art + "/" + clip + "/" + index, out r) ? r : null;
}
/// <summary>costume_config rarity_color(Normal:white;…) → 등급 키(gear_grades · ui_theme gear_*).</summary>
public string RarityGrade(string rarity)
{
foreach (var p in Cfg("rarity_color").Split(';'))
{
var kv = p.Split(':');
if (kv.Length == 2 && kv[0] == rarity) return kv[1];
}
return "white";
}
public static float F(string s)
{
float v;
return float.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out v) ? v : 0f;
}
}
}