49 lines
1.8 KiB
C#
49 lines
1.8 KiB
C#
using UnityEngine;
|
|
|
|
namespace YachtDice.Run
|
|
{
|
|
[CreateAssetMenu(fileName = "RunBalanceConfig", menuName = "YachtDice/Run/Balance Config")]
|
|
public class RunBalanceConfigSO : ScriptableObject
|
|
{
|
|
[Header("Quota")]
|
|
[SerializeField] private int startingBaseQuota = 30;
|
|
[SerializeField] private int quotaGrowthPerCycle = 30;
|
|
|
|
[Header("Stage Targets")]
|
|
[SerializeField] private float[] stageTargetMultipliers = { 1f, 1.5f, 2.5f };
|
|
|
|
[Header("Rewards")]
|
|
[SerializeField] private int stageClearReward = 25;
|
|
[SerializeField] private int cycleStoredRollBonusMultiplier = 10;
|
|
|
|
[Header("Roll Economy")]
|
|
[SerializeField] private int baseRollsPerStage = 3;
|
|
|
|
public int StartingBaseQuota => startingBaseQuota;
|
|
public int QuotaGrowthPerCycle => quotaGrowthPerCycle;
|
|
public int StageClearReward => stageClearReward;
|
|
public int CycleStoredRollBonusMultiplier => cycleStoredRollBonusMultiplier;
|
|
public int BaseRollsPerStage => baseRollsPerStage;
|
|
public int StageCount => stageTargetMultipliers != null ? stageTargetMultipliers.Length : 0;
|
|
|
|
public int GetStageTarget(int baseQuota, int stageIndex)
|
|
{
|
|
if (stageTargetMultipliers == null || stageTargetMultipliers.Length == 0)
|
|
return baseQuota;
|
|
|
|
var clampedIndex = Mathf.Clamp(stageIndex, 0, stageTargetMultipliers.Length - 1);
|
|
return Mathf.CeilToInt(baseQuota * stageTargetMultipliers[clampedIndex]);
|
|
}
|
|
|
|
public int GetNextQuota(int currentQuota)
|
|
{
|
|
return currentQuota + quotaGrowthPerCycle;
|
|
}
|
|
|
|
public static RunBalanceConfigSO CreateDefault()
|
|
{
|
|
return CreateInstance<RunBalanceConfigSO>();
|
|
}
|
|
}
|
|
}
|