96 lines
4.5 KiB
C#
96 lines
4.5 KiB
C#
using CodeStage.AntiCheat.ObscuredTypes;
|
|
using Newtonsoft.Json;
|
|
using System.Collections.Generic;
|
|
|
|
public enum eAwakenUIPosition { Left, Center, Right };
|
|
|
|
public class PCAwakeningTableData : TableDataBase
|
|
{
|
|
public int n_Step, n_NextID1, n_NextID2, n_NextID3, n_Name, n_Desc;
|
|
public eAwakenUIPosition e_Position;
|
|
public eStat e_Stat1, e_Stat2;
|
|
public string s_Icon, s_Value1, s_UpgradeStatValuePara1, s_Value2, s_UpgradeStatValuePara2;
|
|
ObscuredInt _PCID; public int n_PCID { get { return _PCID; } set { _PCID = value; _PCID.RandomizeCryptoKey(); } }
|
|
ObscuredInt _ID; public int n_ID { get { return _ID; } set { _ID = value; _ID.RandomizeCryptoKey(); } }
|
|
ObscuredInt _MaxLv; public int n_MaxLv { get { return _MaxLv; } set { _MaxLv = value; _MaxLv.RandomizeCryptoKey(); } }
|
|
ObscuredInt _NeedSoul; public int n_NeedSoul { get { return _NeedSoul; } set { _NeedSoul = value; _NeedSoul.RandomizeCryptoKey(); } }
|
|
|
|
ObscuredFloat _Value1; public float f_Value1 { get { return _Value1; } set { _Value1 = value; _Value1.RandomizeCryptoKey(); } }
|
|
public float Get_Value1() { return f_Value1 + (f_Value1PerLv * MyValue.sdata.Get_PCAwakenLv(n_ID)); }
|
|
ObscuredFloat _Value1PerLv; public float f_Value1PerLv { get { return _Value1PerLv; } set { _Value1PerLv = value; _Value1PerLv.RandomizeCryptoKey(); } }
|
|
|
|
ObscuredFloat _Value2; public float f_Value2 { get { return _Value2; } set { _Value2 = value; _Value2.RandomizeCryptoKey(); } }
|
|
public float Get_Value2() { return f_Value2 + (f_Value2PerLv * MyValue.sdata.Get_PCAwakenLv(n_ID)); }
|
|
ObscuredFloat _Value2PerLv; public float f_Value2PerLv { get { return _Value2PerLv; } set { _Value2PerLv = value; _Value2PerLv.RandomizeCryptoKey(); } }
|
|
|
|
public override string Get_Name() { return table_localtext.Ins.Get_Text(n_Name); }
|
|
public override string Get_Desc() { return table_localtext.Ins.Get_Text(n_Desc,
|
|
MyText.Get_StatValueText(e_Stat1, Get_Value1(), true), MyText.Get_StatValueText(e_Stat2, Get_Value2(), true)); }
|
|
}
|
|
|
|
public class table_PCAwakening : table_base
|
|
{
|
|
public static table_PCAwakening Ins;
|
|
|
|
List<PCAwakeningTableData> tableDatas;
|
|
Dictionary<int, PCAwakeningTableData> dic_Datas = new Dictionary<int, PCAwakeningTableData>();
|
|
Dictionary<int, List<PCAwakeningTableData>> dic_Datas_PC = new Dictionary<int, List<PCAwakeningTableData>>();
|
|
public List<List<List<PCAwakeningTableData>>> list_PCStep = new List<List<List<PCAwakeningTableData>>>();
|
|
|
|
protected override void Awake()
|
|
{
|
|
Ins = this;
|
|
base.Awake();
|
|
}
|
|
|
|
protected override void Start()
|
|
{
|
|
tableDatas = JsonConvert.DeserializeObject<List<PCAwakeningTableData>>(json_last);
|
|
for (int i = 0; i < tableDatas.Count; i++)
|
|
{
|
|
var temp = tableDatas[i];
|
|
temp.f_Value1 = Get_Value(temp.s_Value1);
|
|
temp.f_Value1PerLv = Get_Value(temp.s_UpgradeStatValuePara1);
|
|
temp.f_Value2 = Get_Value(temp.s_Value2);
|
|
temp.f_Value2PerLv = Get_Value(temp.s_UpgradeStatValuePara2);
|
|
|
|
dic_Datas.Add(temp.n_ID, temp);
|
|
if (!dic_Datas_PC.ContainsKey(temp.n_PCID))
|
|
dic_Datas_PC.Add(temp.n_PCID, new List<PCAwakeningTableData>());
|
|
dic_Datas_PC[temp.n_PCID].Add(temp);
|
|
}
|
|
|
|
// PC 갯수 찾기
|
|
int pcid = 0, pccount = 0;
|
|
foreach (var d in tableDatas)
|
|
if (d.n_PCID != pcid)
|
|
{
|
|
pcid = d.n_PCID;
|
|
++pccount;
|
|
}
|
|
|
|
// PCID 길이에 맞게 초기화
|
|
list_PCStep = new List<List<List<PCAwakeningTableData>>>(pccount);
|
|
|
|
for (int i = 0; i < pccount; i++)
|
|
list_PCStep.Add(new List<List<PCAwakeningTableData>>());
|
|
|
|
// Step 최대값 동적으로 확장하면서 추가
|
|
foreach (var temp in tableDatas)
|
|
{
|
|
// Step 인덱스 부족하면 채우기
|
|
while (list_PCStep[temp.n_PCID - 6001].Count <= temp.n_Step)
|
|
list_PCStep[temp.n_PCID - 6001].Add(new List<PCAwakeningTableData>());
|
|
|
|
// 넣기
|
|
list_PCStep[temp.n_PCID - 6001][temp.n_Step].Add(temp);
|
|
}
|
|
|
|
base.Start();
|
|
}
|
|
|
|
public List<PCAwakeningTableData> Get_DataList() { return tableDatas; }
|
|
public PCAwakeningTableData Get_Data(int id) { return dic_Datas[id]; }
|
|
public List<PCAwakeningTableData> Get_Datas(int pcid) { return dic_Datas_PC[pcid]; }
|
|
public List<List<PCAwakeningTableData>> Get_UIDatas(int pcid) { return list_PCStep[pcid - 6001]; }
|
|
} |