110 lines
3.5 KiB
C#
110 lines
3.5 KiB
C#
using CodeStage.AntiCheat.ObscuredTypes;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
public enum eAwakenUpgradeOptionType
|
|
{
|
|
STR_ADD, DEX_ADD, INT_ADD, LUK_ADD, HP_ADD, ATK_ADD, DEF_ADD, GOLD_Multiplier, EXP_Multiplier, ITEM_Multiplier,
|
|
}
|
|
|
|
[Serializable]
|
|
public class AwakenConfigTableData : TableDataBase
|
|
{
|
|
// 강화할 스텟 타입
|
|
public eStat e_UpgradeStatType { get; set; }
|
|
|
|
// 강화 순서 (로테이션)
|
|
ObscuredInt _UpgradeOrder;
|
|
public int n_UpgradeOrder
|
|
{
|
|
get { return _UpgradeOrder; }
|
|
set { _UpgradeOrder = value; _UpgradeOrder.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
// 업그레이드로 증가할 능력치 Enum 값
|
|
public eAwakenUpgradeOptionType e_UpgradeOptionType { get; set; }
|
|
|
|
// 1레벨의 능력치 기본 값
|
|
ObscuredInt _DefaultUpgradeValue;
|
|
public int n_DefaultUpgradeValue
|
|
{
|
|
get { return _DefaultUpgradeValue; }
|
|
set { _DefaultUpgradeValue = value; _DefaultUpgradeValue.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
// 레벨당 능력치 증가량
|
|
ObscuredFloat _LevelPerUpgradeValue;
|
|
public float f_LevelPerUpgradeValue
|
|
{
|
|
get { return _LevelPerUpgradeValue; }
|
|
set { _LevelPerUpgradeValue = value; _LevelPerUpgradeValue.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
// 밸런스 상수 K값
|
|
ObscuredFloat _BalanceConstant;
|
|
public float f_BalanceConstant
|
|
{
|
|
get { return _BalanceConstant; }
|
|
set { _BalanceConstant = value; _BalanceConstant.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
|
|
public float Get_Value(int lv)
|
|
{
|
|
return base.Get_Value(lv, f_BalanceConstant, n_DefaultUpgradeValue, f_LevelPerUpgradeValue);
|
|
}
|
|
|
|
public eStat Get_SlotStat()
|
|
{
|
|
switch (e_UpgradeOptionType)
|
|
{
|
|
case eAwakenUpgradeOptionType.STR_ADD:
|
|
return eStat.STR;
|
|
case eAwakenUpgradeOptionType.DEX_ADD:
|
|
return eStat.DEX;
|
|
case eAwakenUpgradeOptionType.INT_ADD:
|
|
return eStat.INT;
|
|
case eAwakenUpgradeOptionType.LUK_ADD:
|
|
return eStat.LUK;
|
|
case eAwakenUpgradeOptionType.HP_ADD:
|
|
return eStat.MaxHP;
|
|
case eAwakenUpgradeOptionType.ATK_ADD:
|
|
return eStat.ATK;
|
|
case eAwakenUpgradeOptionType.DEF_ADD:
|
|
return eStat.DEF;
|
|
}
|
|
return eStat.None;
|
|
}
|
|
}
|
|
|
|
public class table_awakenconfig : table_missionbase
|
|
{
|
|
public static table_awakenconfig Ins;
|
|
List<AwakenConfigTableData> tableDatas;
|
|
Dictionary<eStat, List<AwakenConfigTableData>> dic_StatList = new Dictionary<eStat, List<AwakenConfigTableData>>();
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
Ins = this;
|
|
}
|
|
|
|
protected override void Start()
|
|
{
|
|
tableDatas = JsonConvert.DeserializeObject<List<AwakenConfigTableData>>(json_last);
|
|
for (int i = 0; i < Get_DataList().Count; i++)
|
|
{
|
|
var temp = Get_DataList()[i];
|
|
if (!dic_StatList.ContainsKey(temp.e_UpgradeStatType))
|
|
dic_StatList.Add(temp.e_UpgradeStatType, new List<AwakenConfigTableData>());
|
|
dic_StatList[temp.e_UpgradeStatType].Add(temp);
|
|
}
|
|
|
|
base.Start();
|
|
}
|
|
|
|
public AwakenConfigTableData Get_Data(eStat stat, int order) { return Get_DataList(stat).Find(f => f.n_UpgradeOrder == order); }
|
|
public List<AwakenConfigTableData> Get_DataList() { return tableDatas; }
|
|
public List<AwakenConfigTableData> Get_DataList(eStat stat) { return dic_StatList[stat]; }
|
|
} |