using System; using System.Collections.Generic; using UnityEngine; namespace TKS.OutGame { /// /// 컨텐츠별 재화 배치 표 4장(PD 2026-11-24 · 개발 요청서 「재화배치」 §1) — chest_drop(수급처 × 구간별 보물 상자 등급 가중치) · /// chest_loot(상자 등급별 더해지는 내용 줄) · hard_mode(장별 출정 하드 난이도) · hero_unlock(태생 ★ → 영입 조각). /// 임포트 = TKS/Import OutGame Data(OutGameTables.Goods.cs · 참조 오류가 있으면 자산 불변) · 규칙 = GoodsRules. /// public class GoodsDb : ScriptableObject { /// 상자가 나왔을 때의 등급 가중치 한 줄(s_source · n_from~n_to 구간 · f_<상자 id> 칸). [Serializable] public class ChestDrop { public string source = ""; public int from; public int to; public string[] chests = new string[0]; public float[] weights = new float[0]; } /// 상자를 열 때 더해지는 내용 한 줄(확률 % · 수량 범위) — 보물 굴림 · 골드는 chests 표 그대로. [Serializable] public class ChestLoot { public string chest = ""; public string item = ""; public float pct; public int min; public int max; } /// 출정 하드 난이도 한 장(등급 가중치 · 군량 · 스테이지당 하루 횟수 · 적 능력치 배율 · 골드 · 경험 배율 · 보스 조각 % · 보물 상자 %). [Serializable] public class HardMode { public int chapter; public string[] grades = new string[0]; public float[] weights = new float[0]; public int stamina; public int staminaBoss; public int dailyPerStage; public float enemyMult = 1f; public float goldExpMult = 1f; public float bossShardPct; public float chestPct; } [Serializable] public class HeroUnlock { public int rarity; public int shards; } public const string SourceStage = "stage_normal"; public const string SourceHard = "stage_hard"; public const string SourcePatrol = "patrol"; public const string SourceBandit = "bandit"; public static readonly string[] Sources = { SourceStage, SourceHard, SourcePatrol, SourceBandit }; public List chestDrops = new List(); public List chestLoots = new List(); public List hardModes = new List(); public List heroUnlocks = new List(); /// 그 수급처 · 구간(장 또는 단계)의 등급 줄 — 구간 밖이면 가장 가까운 줄(표 끝을 넘는 장 = 마지막 구간) · 수급처가 없으면 null. public ChestDrop DropFor(string source, int band) { ChestDrop best = null; int bestGap = int.MaxValue; foreach (var c in chestDrops) { if (c.source != source) continue; int gap = band < c.from ? c.from - band : band > c.to ? band - c.to : 0; if (gap < bestGap) { bestGap = gap; best = c; } } return best; } public List LootOf(string chest) { var res = new List(); foreach (var l in chestLoots) if (l.chest == chest) res.Add(l); return res; } /// 그 장의 하드 난이도 줄(없으면 null = 하드 없음). public HardMode HardFor(int chapter) { foreach (var h in hardModes) if (h.chapter == chapter) return h; return null; } /// 태생 ★ 영웅을 조각으로 영입하는 데 드는 조각(표에 없으면 0 = 영입 불가). public int UnlockShards(int rarity) { foreach (var u in heroUnlocks) if (u.rarity == rarity) return u.shards; return 0; } } }