Project_WL/Assets/Script/Table/Farm/table_fruit.cs

93 lines
2.4 KiB
C#
Raw Permalink Normal View History

2024-12-18 04:17:10 +00:00
using CodeStage.AntiCheat.ObscuredTypes;
2024-12-15 01:39:39 +00:00
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
[Serializable]
public class FruitTableData : TableDataBase
{
2024-12-18 04:17:10 +00:00
ObscuredInt _FruitID;
public int n_FruitID
{
get { return _FruitID; }
set { _FruitID = value; _FruitID.RandomizeCryptoKey(); }
} // <20><><EFBFBD><EFBFBD> ID
ObscuredInt _STR;
public int n_STR
{
get { return _STR; }
set { _STR = value; _STR.RandomizeCryptoKey(); }
} // STR
ObscuredInt _DEX;
public int n_DEX
{
get { return _DEX; }
set { _DEX = value; _DEX.RandomizeCryptoKey(); }
} // DEX
ObscuredInt _INT;
public int n_INT
{
get { return _INT; }
set { _INT = value; _INT.RandomizeCryptoKey(); }
} // INT
ObscuredInt _LUK;
public int n_LUK
{
get { return _LUK; }
set { _LUK = value; _LUK.RandomizeCryptoKey(); }
} // LUK
2024-12-15 01:39:39 +00:00
public string Get_Desc()
{
var str_STR = table_localtext.Ins.Get_Text(40001);
var str_DEX = table_localtext.Ins.Get_Text(40003);
var str_INT = table_localtext.Ins.Get_Text(40005);
var str_LUK = table_localtext.Ins.Get_Text(40007);
if (n_STR > 0 && n_DEX > 0 && n_INT > 0)
return DSUtil.Format(314, str_STR, str_DEX, str_INT);
else if (n_STR > 0)
return DSUtil.Format(315, str_STR);
else if (n_DEX > 0)
return DSUtil.Format(315, str_DEX);
else if (n_INT > 0)
return DSUtil.Format(315, str_INT);
else if (n_LUK > 0)
return DSUtil.Format(315, str_LUK);
return "";
}
}
public class table_fruit : table_missionbase
{
public static table_fruit Ins;
List<FruitTableData> tableDatas;
Dictionary<int, FruitTableData> dic_Data = new Dictionary<int, FruitTableData>();
protected override void Awake()
{
base.Awake();
Ins = this;
}
protected override void Start()
{
tableDatas = JsonConvert.DeserializeObject<List<FruitTableData>>(json_last);
for (int i = 0; i < Get_DataList().Count; i++)
{
var temp = Get_DataList()[i];
dic_Data.Add(temp.n_FruitID, temp);
}
base.Start();
}
public FruitTableData Get_Data_orNull(int id) { return dic_Data[id]; }
public List<FruitTableData> Get_DataList() { return tableDatas; }
}