37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
|
|
using System;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace TKS.OutGame
|
||
|
|
{
|
||
|
|
/// <summary>챕터별 스테이지 보상·별 조건(stage_rewards.csv · 기획서 §6).</summary>
|
||
|
|
public class RewardTable : ScriptableObject
|
||
|
|
{
|
||
|
|
[Serializable]
|
||
|
|
public class Row
|
||
|
|
{
|
||
|
|
public int chapter;
|
||
|
|
public int goldBase;
|
||
|
|
public int expBase;
|
||
|
|
public int gemFirst;
|
||
|
|
public int gemBoss;
|
||
|
|
[Range(0f, 1f)] public float gearDropPct;
|
||
|
|
[Tooltip("드랍 장비 등급 상한(gear_items grade)")]
|
||
|
|
public string gearGradeMax;
|
||
|
|
[Tooltip("별 ③ = 이 턴 수 이내 클리어")]
|
||
|
|
public int starTurns;
|
||
|
|
}
|
||
|
|
|
||
|
|
public List<Row> rows = new List<Row>();
|
||
|
|
|
||
|
|
/// <summary>챕터 no 의 행(없으면 가장 가까운 아래 챕터 · 그것도 없으면 첫 행).</summary>
|
||
|
|
public Row For(int chapter)
|
||
|
|
{
|
||
|
|
Row best = null;
|
||
|
|
foreach (var r in rows)
|
||
|
|
if (r.chapter <= chapter && (best == null || r.chapter > best.chapter)) best = r;
|
||
|
|
return best ?? (rows.Count > 0 ? rows[0] : null);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|