37 lines
1.4 KiB
C#
37 lines
1.4 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace WL.Player
|
|
{
|
|
/// <summary>
|
|
/// 플레이어 레벨·경험치 수치의 단일 출처(SOT) (PD #727 좌상단 레벨 표기).
|
|
/// 에셋 경로: Assets/WL/Settings/PlayerProgressSettings.asset · 값은 전부 임시(밸런스 확정 전).
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "PlayerProgressSettings", menuName = "WL/Player Progress Settings")]
|
|
public class PlayerProgressSettings : ScriptableObject
|
|
{
|
|
[Header("시작값 (임시)")]
|
|
[Tooltip("시작 레벨")]
|
|
public int startLevel = 1;
|
|
[Tooltip("시작 경험치(현재 레벨 안에서 쌓인 값)")]
|
|
public long startXp = 0;
|
|
|
|
[Header("필요 경험치 곡선 (임시)")]
|
|
[Tooltip("레벨 1 → 2 에 필요한 경험치")]
|
|
public long baseXpToNext = 100;
|
|
[Tooltip("레벨이 1 오를 때마다 필요 경험치에 곱하는 배율")]
|
|
public float xpGrowth = 1.15f;
|
|
|
|
[Header("획득 (임시)")]
|
|
[Tooltip("몬스터 1마리 처치 시 경험치. 0 이면 지급하지 않는다")]
|
|
public long xpPerKill = 10;
|
|
|
|
/// <summary>해당 레벨에서 다음 레벨까지 필요한 경험치.</summary>
|
|
public long XpToNext(int level)
|
|
{
|
|
double v = baseXpToNext * Math.Pow(Mathf.Max(xpGrowth, 1f), Mathf.Max(level - 1, 0));
|
|
return Math.Max(1L, (long)Math.Round(v));
|
|
}
|
|
}
|
|
}
|