48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
|
|
using System;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace TKS.OutGame
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 보물 상자(chests.csv · 기획서 §8 · S8·S15) — 상자 포인트 · 등급 확률(희귀·영웅·전설·신화 · 천기 = 적장 토벌 전용) · 골드·보옥·운철 범위 · 획득처 ·
|
||
|
|
/// 거래 구매 가격(buy_gold · buy_gem · buy_points · 0 = 판매 안 함 · C 단계 추가 열).
|
||
|
|
/// </summary>
|
||
|
|
public class ChestDb : ScriptableObject
|
||
|
|
{
|
||
|
|
/// <summary>확률 열 p_<grade> 순서.</summary>
|
||
|
|
public static readonly string[] ProbGrades = { "rare", "epic", "legend", "myth" };
|
||
|
|
|
||
|
|
[Serializable]
|
||
|
|
public class Chest
|
||
|
|
{
|
||
|
|
public string id;
|
||
|
|
public string nameKo;
|
||
|
|
public int points;
|
||
|
|
[Tooltip("ProbGrades 순서 확률(합 1)")]
|
||
|
|
public float[] p = new float[4];
|
||
|
|
public int goldMin, goldMax;
|
||
|
|
public int gemMin, gemMax;
|
||
|
|
public int ironMin, ironMax;
|
||
|
|
public string source;
|
||
|
|
public int buyGold, buyGem, buyPoints;
|
||
|
|
}
|
||
|
|
|
||
|
|
public List<Chest> chests = new List<Chest>();
|
||
|
|
|
||
|
|
public Chest Get(string id)
|
||
|
|
{
|
||
|
|
foreach (var c in chests)
|
||
|
|
if (c.id == id) return c;
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
public int IndexOf(string id)
|
||
|
|
{
|
||
|
|
for (int i = 0; i < chests.Count; i++)
|
||
|
|
if (chests[i].id == id) return i;
|
||
|
|
return -1;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|