OneShotOneKill/Assets/Script/Table/Tables/table_SealList.cs

64 lines
2.4 KiB
C#
Raw Normal View History

2026-01-07 21:27:42 +00:00
using CodeStage.AntiCheat.ObscuredTypes;
using Newtonsoft.Json;
using System.Collections.Generic;
public enum eSealType { Magic, Reaper, Lightning, Flame, Holy, Blade, Pierce, AoE, Heal, Haste, Critical, Sacrifice }
public enum eElement { Fire, Water, Wind, Light, Earth, Dark }
public class SealListTableData : TableDataBase
{
public eSealType e_SealType;
public eElement e_Element;
public eSpecialEffect e_SpecialEffect1, e_SpecialEffect2;
public string s_Value1, s_Value2;
public bool b_PercentValue1, b_PercentValue2;
public int n_Desc1, n_Desc2;
ObscuredInt _ID; public int n_ID { get { return _ID; } set { _ID = value; _ID.RandomizeCryptoKey(); } }
ObscuredInt _Star; public int n_Star { get { return _Star; } set { _Star = value; _Star.RandomizeCryptoKey(); } }
ObscuredFloat _Value1; public float f_Value1 { get { return _Value1; } set { _Value1 = value; _Value1.RandomizeCryptoKey(); } }
ObscuredFloat _Value2; public float f_Value2 { get { return _Value2; } set { _Value2 = value; _Value2.RandomizeCryptoKey(); } }
public string Get_Desc1()
{
return table_localtext.Ins.Get_Text(n_Desc1, b_PercentValue1 ? f_Value1 * 100 : f_Value1);
}
public string Get_Desc2()
{
return table_localtext.Ins.Get_Text(n_Desc2, b_PercentValue2 ? f_Value2 * 100 : f_Value2);
}
}
public class table_SealList : table_base
{
public static table_SealList Ins;
List<SealListTableData> tableDatas;
Dictionary<int, List<SealListTableData>> dic_Datas = new Dictionary<int, List<SealListTableData>>();
protected override void Awake()
{
Ins = this;
base.Awake();
}
protected override void Start()
{
tableDatas = JsonConvert.DeserializeObject<List<SealListTableData>>(json_last);
for (int i = 0; i < tableDatas.Count; i++)
{
var temp = tableDatas[i];
temp.f_Value1 = Get_Value(temp.s_Value1);
temp.f_Value2 = Get_Value(temp.s_Value2);
if (!dic_Datas.ContainsKey(temp.n_ID)) dic_Datas.Add(temp.n_ID, new List<SealListTableData>());
dic_Datas[temp.n_ID].Add(temp);
}
base.Start();
}
public List<SealListTableData> Get_DataList() { return tableDatas; }
public List<SealListTableData> Get_DataList(int id) { return dic_Datas[id]; }
public SealListTableData Get_Data(SD_SealData data) { return dic_Datas[data.TableID].Find(f=>f.n_Star == data.Lv); }
}