using System;
using System.Collections.Generic;
using UnityEngine;
namespace TKS.OutGame
{
///
/// 명장 등용(뽑기 · gacha.csv key,value + gacha_pool.csv + gacha_banners.csv · 기획서 §4 · PD 2026-11-13 배너 5 = 픽업 1 + 국가별 상시 4).
/// 병사 유닛 = ★ 풀(§4) · 픽업 영웅 = 배너 표 featured(픽업 배너에서 ★★★ 의 pickup_share).
///
public class GachaConfig : ScriptableObject
{
public const string TypePickup = "pickup";
public const string TypeStanding = "standing";
public const string PoolAll = "all";
[Serializable]
public class PoolEntry
{
public string heroId;
public bool inPool = true;
}
/// 등용 배너 1줄(gacha_banners.csv · 줄 순서 = 화면 순서).
[Serializable]
public class Banner
{
public string id;
[Tooltip("pickup = 기간 한정 · 주요 영웅 확률 상승 / standing = 상시(국가별)")]
public string type;
[Tooltip("상시 배너의 진영(wei · shu · wu · other · 깃발 버튼)")]
public string faction;
public string nameKo;
public string descKo;
[Tooltip("나오는 진영(heroes.csv faction · all = 전 진영)")]
public List pool = new List();
[Tooltip("병사 유닛(★ 풀)이 나오는가")]
public bool soldiers;
[Tooltip("배너에 세우는 주요 영웅(픽업 = 확률 상승 대상)")]
public List featured = new List();
[Tooltip("천장을 같이 쓰는 묶음 이름")]
public string pityGroup;
[Tooltip("시작일 yyyy-MM-dd(UTC) · 빈 칸 = 기간 없음")]
public string start;
[Tooltip("기간(일) · 0 = 기간 없음")]
public int days;
[Tooltip("배너 그림(테마 아이콘 id)")]
public string art;
public bool IsPickup
{
get { return type == TypePickup; }
}
}
public KeyValueList values = new KeyValueList();
public List pool = new List();
public List banners = new List();
public int CostSingle { get { return values.I("cost_single"); } }
public int CostTen { get { return values.I("cost_ten"); } }
public int Pity { get { return values.I("pity"); } }
public float PickupShare { get { return values.F("pickup_share"); } }
/// 픽업 영웅은 픽업 배너에서만 나온다(상시 배너 풀에서 뺌).
public bool PickupExclusive { get { return values.I("pickup_exclusive") > 0; } }
public bool FreeFirstTen { get { return values.I("free_first_ten") > 0; } }
public int TenCount { get { return values.I("ten_count"); } }
public int TenGuaranteeRarity { get { return values.I("ten_guarantee_rarity"); } }
/// 희귀도 등급(1~3) 확률 p_r1~p_r3.
public float P(int rarity)
{
return values.F("p_r" + rarity);
}
public Banner Get(string id)
{
foreach (var b in banners)
if (b.id == id) return b;
return null;
}
public static readonly string[] RequiredKeys =
{
"cost_single", "cost_ten", "p_r3", "p_r2", "p_r1", "pity", "pickup_share", "pickup_exclusive", "free_first_ten", "ten_count", "ten_guarantee_rarity",
};
}
}