87 lines
2.4 KiB
C#
87 lines
2.4 KiB
C#
using CodeStage.AntiCheat.ObscuredTypes;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
[Serializable]
|
|
public class PetUpgradeTableData : TableDataBase
|
|
{
|
|
// 강화 레벨
|
|
ObscuredInt _UpgradeLv;
|
|
public int n_UpgradeLv
|
|
{
|
|
get { return _UpgradeLv; }
|
|
set { _UpgradeLv = value; _UpgradeLv.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
// 낮은 등급 펫의 강화 당 조각 요구량
|
|
ObscuredInt _LowPetCost;
|
|
public int n_LowPetCost
|
|
{
|
|
get { return _LowPetCost; }
|
|
set { _LowPetCost = value; _LowPetCost.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
// 보통 등급 펫의 강화 당 조각 요구량
|
|
ObscuredInt _MidPetCost;
|
|
public int n_MidPetCost
|
|
{
|
|
get { return _MidPetCost; }
|
|
set { _MidPetCost = value; _MidPetCost.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
// 상위 등급 펫의 강화 당 조각 요구량
|
|
ObscuredInt _HighPetCost;
|
|
public int n_HighPetCost
|
|
{
|
|
get { return _HighPetCost; }
|
|
set { _HighPetCost = value; _HighPetCost.RandomizeCryptoKey(); }
|
|
}
|
|
|
|
|
|
public int Get_PetCost(int grade)
|
|
{
|
|
int amount = n_HighPetCost;
|
|
if (grade < 4) amount = n_LowPetCost;
|
|
else if (grade < 7) amount = n_MidPetCost;
|
|
|
|
return amount;
|
|
}
|
|
|
|
public float Get_Price(int grade, int lv)
|
|
{
|
|
int id = table_GlobalValue.Ins.Get_Int("n_PetReinforcePriceOptionID3");
|
|
if (grade < 4) id = table_GlobalValue.Ins.Get_Int("n_PetReinforcePriceOptionID1");
|
|
else if (grade < 7) id = table_GlobalValue.Ins.Get_Int("n_PetReinforcePriceOptionID2");
|
|
|
|
return table_optionconfig.Ins.Get_Data(id).Get_Value(lv);
|
|
}
|
|
}
|
|
|
|
public class table_petupgrade : table_missionbase
|
|
{
|
|
public static table_petupgrade Ins;
|
|
List<PetUpgradeTableData> tableDatas;
|
|
Dictionary<int, PetUpgradeTableData> dic_Data = new Dictionary<int, PetUpgradeTableData>();
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
Ins = this;
|
|
}
|
|
|
|
protected override void Start()
|
|
{
|
|
tableDatas = JsonConvert.DeserializeObject<List<PetUpgradeTableData>>(json_last);
|
|
for (int i = 0; i < Get_DataList().Count; i++)
|
|
{
|
|
var temp = Get_DataList()[i];
|
|
dic_Data.Add(temp.n_UpgradeLv, temp);
|
|
}
|
|
|
|
base.Start();
|
|
}
|
|
|
|
public PetUpgradeTableData Get_Data_orNull(int lv) { if (lv < 1) lv = 1; return dic_Data[lv]; }
|
|
public List<PetUpgradeTableData> Get_DataList() { return tableDatas; }
|
|
} |