OneShotOneKill/Assets/Script/Table/Tables/table_skill.cs

61 lines
1.8 KiB
C#

using CodeStage.AntiCheat.ObscuredTypes;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public enum eSkillType
{
HpUp, // 생명력 증가
AttackUp, // 공격력 증가
PreviousArrow, // 직전 화살
DiagonalArrow, // 사선 화살
ProjectilePierce, // 투사체 관통
Reflect, // 반사
Knockback, // 넉백
DoubleShot, // 더블샷
Explosion, // 폭파
Stun, // 기절
Bounce, // 튕김
ArrowUpDown, // 상/하 화살
ArrowLeftRight, // 좌/우 화살
ImpactArrow, // 충격 화살
AttackSpeedUp // 공격 속도 증가
}
public class SkillTableData : TableDataBase
{
public eSkillType e_SkillType;
public string s_Name, s_Desc, s_Value;
public int n_ImageIndex;
ObscuredFloat _Value; public float f_Value { get { return _Value; } set { _Value = value; _Value.RandomizeCryptoKey(); } }
}
public class table_skill : table_base
{
public static table_skill Ins;
List<SkillTableData> tableDatas;
protected override void Awake()
{
Ins = this;
base.Awake();
}
protected override void Start()
{
tableDatas = JsonConvert.DeserializeObject<List<SkillTableData>>(json_last);
for (int i = 0; i < tableDatas.Count; i++)
{
var temp = tableDatas[i];
temp.f_Value = Get_Value(temp.s_Value);
}
base.Start();
}
public List<SkillTableData> Get_DataList() { return tableDatas; }
public SkillTableData Get_Data(eSkillType skillType) { return tableDatas.Find(f => f.e_SkillType == skillType); }
public List<SkillTableData> Get_ThreeDatas() { return tableDatas.OrderBy(_ => Random.value).Take(3).ToList(); }
}