133 lines
3.8 KiB
C#
133 lines
3.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using CodeStage.AntiCheat.ObscuredTypes;
|
|
using Newtonsoft.Json;
|
|
|
|
[Serializable]
|
|
public class GachaRateTableData : TableDataBase
|
|
{
|
|
protected ObscuredInt _ID;
|
|
public int n_ID
|
|
{
|
|
get { return _ID; }
|
|
set { _ID = value; _ID.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _GachaLevel;
|
|
public int n_GachaLevel
|
|
{
|
|
get { return _GachaLevel; }
|
|
set { _GachaLevel = value; _GachaLevel.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _Grade1;
|
|
public int n_Grade1
|
|
{
|
|
get { return _Grade1; }
|
|
set { _Grade1 = value; _Grade1.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _Grade2;
|
|
public int n_Grade2
|
|
{
|
|
get { return _Grade2; }
|
|
set { _Grade2 = value; _Grade2.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _Grade3;
|
|
public int n_Grade3
|
|
{
|
|
get { return _Grade3; }
|
|
set { _Grade3 = value; _Grade3.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _Grade4;
|
|
public int n_Grade4
|
|
{
|
|
get { return _Grade4; }
|
|
set { _Grade4 = value; _Grade4.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _Grade5;
|
|
public int n_Grade5
|
|
{
|
|
get { return _Grade5; }
|
|
set { _Grade5 = value; _Grade5.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _Grade6;
|
|
public int n_Grade6
|
|
{
|
|
get { return _Grade6; }
|
|
set { _Grade6 = value; _Grade6.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _Grade7;
|
|
public int n_Grade7
|
|
{
|
|
get { return _Grade7; }
|
|
set { _Grade7 = value; _Grade7.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _Grade8;
|
|
public int n_Grade8
|
|
{
|
|
get { return _Grade8; }
|
|
set { _Grade8 = value; _Grade8.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _Grade9;
|
|
public int n_Grade9
|
|
{
|
|
get { return _Grade9; }
|
|
set { _Grade9 = value; _Grade9.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
public List<float> list_rate = new List<float>();
|
|
public int Get_RandomGrade() { return DSUtil.Get_RandomIndex(list_rate) + 1; }
|
|
}
|
|
|
|
public class table_gacharate : table_missionbase
|
|
{
|
|
public static table_gacharate Ins;
|
|
List<GachaRateTableData> tableDatas;
|
|
Dictionary<int, List<GachaRateTableData>> dic_data = new Dictionary<int, List<GachaRateTableData>>();
|
|
// (temp.n_ID, n_GachaLevel)
|
|
Dictionary<(int, int), GachaRateTableData> dic_datas = new Dictionary<(int, int), GachaRateTableData>();
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
Ins = this;
|
|
}
|
|
|
|
protected override void Start()
|
|
{
|
|
tableDatas = JsonConvert.DeserializeObject<List<GachaRateTableData>>(json_last);
|
|
for (int i = 0; i < Get_DataList().Count; i++)
|
|
{
|
|
var temp = Get_DataList()[i];
|
|
temp.list_rate.Add(temp.n_Grade1 * 0.0000001f);
|
|
temp.list_rate.Add(temp.n_Grade2 * 0.0000001f);
|
|
temp.list_rate.Add(temp.n_Grade3 * 0.0000001f);
|
|
temp.list_rate.Add(temp.n_Grade4 * 0.0000001f);
|
|
temp.list_rate.Add(temp.n_Grade5 * 0.0000001f);
|
|
temp.list_rate.Add(temp.n_Grade6 * 0.0000001f);
|
|
temp.list_rate.Add(temp.n_Grade7 * 0.0000001f);
|
|
temp.list_rate.Add(temp.n_Grade8 * 0.0000001f);
|
|
temp.list_rate.Add(temp.n_Grade9 * 0.0000001f);
|
|
|
|
if (!dic_data.ContainsKey(temp.n_ID))
|
|
dic_data.Add(temp.n_ID, new List<GachaRateTableData>());
|
|
dic_data[temp.n_ID].Add(temp);
|
|
|
|
dic_datas.Add((temp.n_ID, temp.n_GachaLevel), temp);
|
|
}
|
|
|
|
base.Start();
|
|
}
|
|
|
|
public List<GachaRateTableData> Get_DataList() { return tableDatas; }
|
|
public List<GachaRateTableData> Get_DataList(int id) { return dic_data[id]; }
|
|
public GachaRateTableData Get_Data(int id, int lv) { return dic_datas[(id, lv)]; }
|
|
} |