2024-12-15 01:39:39 +00:00
|
|
|
using CodeStage.AntiCheat.ObscuredTypes;
|
|
|
|
|
using MiniJSON;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class SelectSkillTableData : TableDataBase
|
|
|
|
|
{
|
|
|
|
|
public eEffect SkillEffect, PreSkill;
|
|
|
|
|
public eStat Stat;
|
|
|
|
|
public string Name, Desc, Icon;
|
|
|
|
|
public ObscuredFloat ValueBase;
|
|
|
|
|
public ObscuredInt EnableStage;
|
|
|
|
|
public bool PetSkill;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class table_selectskill : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public static table_selectskill Ins;
|
|
|
|
|
|
|
|
|
|
public TextAsset m_json;
|
|
|
|
|
|
|
|
|
|
private List<TableDataBase> list_Data = new List<TableDataBase>();
|
|
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
|
|
|
|
Ins = this;
|
|
|
|
|
|
|
|
|
|
Dictionary<string, object> jsonData = Json.Deserialize(m_json.text) as Dictionary<string, object>;
|
|
|
|
|
|
|
|
|
|
// ["items"]은 items.txt 안의 items를 가리킨다. 툴 우측 하단 파일 종류란에서 설정 가능.
|
|
|
|
|
List<object> obj = jsonData[GetType().Name] as List<object>;
|
|
|
|
|
|
|
|
|
|
foreach (object objt in obj)
|
|
|
|
|
{
|
|
|
|
|
var temp = new SelectSkillTableData();
|
|
|
|
|
Dictionary<string, object> json = objt as Dictionary<string, object>;
|
|
|
|
|
|
|
|
|
|
temp.ID = int.Parse(json["ID"].ToString());
|
|
|
|
|
temp.SkillEffect = DSUtil.StringToEnum<eEffect>(json["SkillEffect"].ToString());
|
|
|
|
|
temp.PreSkill = DSUtil.StringToEnum<eEffect>(json["PreSkill"].ToString());
|
|
|
|
|
temp.Stat = DSUtil.StringToEnum<eStat>(json["Stat"].ToString());
|
|
|
|
|
|
|
|
|
|
temp.ValueBase = float.Parse(json["ValueBase"].ToString());
|
|
|
|
|
temp.EnableStage = int.Parse(json["EnableStage"].ToString());
|
|
|
|
|
temp.PetSkill = bool.Parse(json["PetSkill"].ToString());
|
|
|
|
|
|
|
|
|
|
temp.Icon = json["Icon"].ToString();
|
|
|
|
|
temp.Name = json["Name"].ToString();
|
|
|
|
|
temp.Desc = json["Desc"].ToString();
|
|
|
|
|
|
|
|
|
|
list_Data.Add(temp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<TableDataBase> Get_DataList() { return list_Data; }
|
|
|
|
|
public List<TableDataBase> Get_DataList(int _count)
|
|
|
|
|
{
|
2024-12-20 06:30:58 +00:00
|
|
|
var curstage = 1;
|
2024-12-15 01:39:39 +00:00
|
|
|
var dicObtainSkill = InGameInfo.Ins.Get_SelectSkills();
|
|
|
|
|
var lstid = new List<int>();
|
|
|
|
|
for (int i = 0; i < list_Data.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
var temp = list_Data[i] as SelectSkillTableData;
|
|
|
|
|
//if (temp.ID > 100) continue; // 테스트
|
|
|
|
|
if (!dicObtainSkill.ContainsKey(list_Data[i].ID) && temp.EnableStage <= curstage) // 테스트
|
|
|
|
|
{
|
|
|
|
|
if (temp.PreSkill == eEffect.None)
|
|
|
|
|
lstid.Add(list_Data[i].ID);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in dicObtainSkill)
|
|
|
|
|
{
|
|
|
|
|
var sstd = Get_Data(item.Key);
|
|
|
|
|
if (sstd.SkillEffect == temp.PreSkill)
|
|
|
|
|
{
|
|
|
|
|
lstid.Add(list_Data[i].ID);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var shuffle = lstid.OrderBy(o => Guid.NewGuid()).ToList();
|
|
|
|
|
var rtnlst = new List<TableDataBase>();
|
|
|
|
|
for (int i = 0; i < _count; i++)
|
|
|
|
|
rtnlst.Add(Get_Data(shuffle[i]));
|
|
|
|
|
return rtnlst;
|
|
|
|
|
}
|
|
|
|
|
public SelectSkillTableData Get_Data(int _skillid) { return list_Data.Find(f => f.ID == _skillid) as SelectSkillTableData; }
|
|
|
|
|
public SelectSkillTableData Get_Data(eEffect _sskill) { return list_Data.Find(f => (f as SelectSkillTableData).SkillEffect == _sskill) as SelectSkillTableData; }
|
|
|
|
|
}
|