79 lines
2.9 KiB
C#
79 lines
2.9 KiB
C#
|
|
using Newtonsoft.Json;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
|
||
|
|
public class PCListTableData : ActorTableDataBase
|
||
|
|
{
|
||
|
|
public int n_Specificity1_Effect, n_Specificity2_Effect, n_Specificity3_Effect, n_Specificity4_Effect;
|
||
|
|
public int n_Specificity1_Target, n_Specificity2_Target, n_Specificity3_Target, n_Specificity4_Target;
|
||
|
|
public string s_Element, s_SlotElement;
|
||
|
|
|
||
|
|
public eAttackType e_AttackType;
|
||
|
|
public override eAttackType Get_AttackType()
|
||
|
|
{
|
||
|
|
return e_AttackType;
|
||
|
|
}
|
||
|
|
public override string Get_ImagePath(eActorStatus actorStatus)
|
||
|
|
{
|
||
|
|
switch (actorStatus)
|
||
|
|
{
|
||
|
|
default: return $"PC/{s_Image}.png";
|
||
|
|
case eActorStatus.Hit: return $"PC/{s_Image}_hit.png";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public List<int> list_Specificity_Effect = new List<int>();
|
||
|
|
public List<int> list_Specificity_Target = new List<int>();
|
||
|
|
public List<eElement> list_element = new List<eElement>();
|
||
|
|
public List<eElement> list_slotelement = new List<eElement>();
|
||
|
|
}
|
||
|
|
|
||
|
|
public class table_pclist : table_base
|
||
|
|
{
|
||
|
|
public static table_pclist Ins;
|
||
|
|
|
||
|
|
List<PCListTableData> tableDatas;
|
||
|
|
Dictionary<int, PCListTableData> dic_data = new Dictionary<int, PCListTableData>();
|
||
|
|
|
||
|
|
protected override void Awake()
|
||
|
|
{
|
||
|
|
Ins = this;
|
||
|
|
base.Awake();
|
||
|
|
}
|
||
|
|
|
||
|
|
protected override void Start()
|
||
|
|
{
|
||
|
|
tableDatas = JsonConvert.DeserializeObject<List<PCListTableData>>(json_last);
|
||
|
|
for (int i = 0; i < tableDatas.Count; i++)
|
||
|
|
{
|
||
|
|
var temp = tableDatas[i];
|
||
|
|
|
||
|
|
temp.m_Role = eRole.PC;
|
||
|
|
temp.f_Cri *= 0.01f;
|
||
|
|
temp.f_CriDmg *= 0.01f;
|
||
|
|
dic_data.Add(temp.n_ID, temp);
|
||
|
|
|
||
|
|
temp.list_Specificity_Effect.Add(temp.n_Specificity1_Effect);
|
||
|
|
temp.list_Specificity_Effect.Add(temp.n_Specificity2_Effect);
|
||
|
|
temp.list_Specificity_Effect.Add(temp.n_Specificity3_Effect);
|
||
|
|
temp.list_Specificity_Effect.Add(temp.n_Specificity4_Effect);
|
||
|
|
|
||
|
|
temp.list_Specificity_Target.Add(temp.n_Specificity1_Target);
|
||
|
|
temp.list_Specificity_Target.Add(temp.n_Specificity2_Target);
|
||
|
|
temp.list_Specificity_Target.Add(temp.n_Specificity3_Target);
|
||
|
|
temp.list_Specificity_Target.Add(temp.n_Specificity4_Target);
|
||
|
|
|
||
|
|
var split_element = temp.s_Element.Split("^");
|
||
|
|
for (int j = 0; j < split_element.Length; j++)
|
||
|
|
temp.list_element.Add(DSUtil.StringToEnum<eElement>(split_element[j]));
|
||
|
|
|
||
|
|
var split_slotelement = temp.s_SlotElement.Split("^");
|
||
|
|
for (int j = 0; j < split_slotelement.Length; j++)
|
||
|
|
temp.list_slotelement.Add(DSUtil.StringToEnum<eElement>(split_slotelement[j]));
|
||
|
|
}
|
||
|
|
|
||
|
|
base.Start();
|
||
|
|
}
|
||
|
|
|
||
|
|
public List<PCListTableData> Get_DataList() { return tableDatas; }
|
||
|
|
public PCListTableData Get_Data_orNull(int id) { return dic_data.ContainsKey(id) ? dic_data[id] : null; }
|
||
|
|
}
|