117 lines
3.3 KiB
C#
117 lines
3.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using CodeStage.AntiCheat.ObscuredTypes;
|
|
using Newtonsoft.Json;
|
|
|
|
[Serializable]
|
|
public class GachaConfigTableData : TableDataBase
|
|
{
|
|
protected ObscuredInt _ID;
|
|
public int n_ID
|
|
{
|
|
get { return _ID; }
|
|
set { _ID = value; _ID.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
public int n_Title;
|
|
public string s_Banner;
|
|
public bool b_StageLv;
|
|
|
|
protected ObscuredInt _GachaPrice;
|
|
public int n_GachaPrice
|
|
{
|
|
get { return _GachaPrice; }
|
|
set { _GachaPrice = value; _GachaPrice.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _GachaGoodsID;
|
|
public int n_GachaGoodsID
|
|
{
|
|
get { return _GachaGoodsID; }
|
|
set { _GachaGoodsID = value; _GachaGoodsID.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _GachaTicketID;
|
|
public int n_GachaTicketID
|
|
{
|
|
get { return _GachaTicketID; }
|
|
set { _GachaTicketID = value; _GachaTicketID.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _NormalRandombag;
|
|
public int n_NormalRandombag
|
|
{
|
|
get { return _NormalRandombag; }
|
|
set { _NormalRandombag = value; _NormalRandombag.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _Extra10_Randombag;
|
|
public int n_Extra10_Randombag
|
|
{
|
|
get { return _Extra10_Randombag; }
|
|
set { _Extra10_Randombag = value; _Extra10_Randombag.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _PickupReward;
|
|
public int n_PickupReward
|
|
{
|
|
get { return _PickupReward; }
|
|
set { _PickupReward = value; _PickupReward.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
protected ObscuredInt _RepeatRewardPoint;
|
|
public int n_RepeatRewardPoint
|
|
{
|
|
get { return _RepeatRewardPoint; }
|
|
set { _RepeatRewardPoint = value; _RepeatRewardPoint.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
public Dictionary<int, int> dic_randomgbag = new Dictionary<int, int>();
|
|
public bool isSkillGacha;
|
|
|
|
public void Check_SkillGacha()
|
|
{
|
|
isSkillGacha = false;
|
|
|
|
var bags = table_gacharandombag.Ins.Get_DataList(n_NormalRandombag, 1);
|
|
for (int i = 0; i < bags.Count; i++)
|
|
{
|
|
if (table_itemlist.Ins.Get_Data(bags[i].n_RewardID).e_ItemType == eItem.Skill)
|
|
{
|
|
isSkillGacha = true;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public class table_gachaconfig : table_missionbase
|
|
{
|
|
public static table_gachaconfig Ins;
|
|
List<GachaConfigTableData> tableDatas;
|
|
Dictionary<int, GachaConfigTableData> dic_Data = new Dictionary<int, GachaConfigTableData>();
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
Ins = this;
|
|
}
|
|
|
|
protected override void Start()
|
|
{
|
|
tableDatas = JsonConvert.DeserializeObject<List<GachaConfigTableData>>(json_last);
|
|
for (int i = 0; i < Get_DataList().Count; i++)
|
|
{
|
|
var temp = Get_DataList()[i];
|
|
temp.dic_randomgbag.Add(1, temp.n_NormalRandombag);
|
|
temp.dic_randomgbag.Add(10, temp.n_Extra10_Randombag);
|
|
dic_Data.Add(temp.n_ID, temp);
|
|
}
|
|
|
|
base.Start();
|
|
}
|
|
|
|
public void Check_SkillGacha() { tableDatas.ForEach(f => f.Check_SkillGacha()); }
|
|
public GachaConfigTableData Get_Data_orNull(int id) { return dic_Data.ContainsKey(id) ? dic_Data[id] : null; }
|
|
public List<GachaConfigTableData> Get_DataList() { return tableDatas; }
|
|
} |