175 lines
5.9 KiB
C#
175 lines
5.9 KiB
C#
|
|
using CodeStage.AntiCheat.ObscuredTypes;
|
||
|
|
using Newtonsoft.Json;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class StatusOptionSetActorData
|
||
|
|
{
|
||
|
|
public Actor m_Actor;
|
||
|
|
public StatusOptionSetTableData m_TData;
|
||
|
|
public StatusConditionsListTableData m_sclData;
|
||
|
|
ObscuredBool _isset; public bool IsSet { get { return _isset; } set { _isset = value; _isset.RandomizeCryptoKey(); } }
|
||
|
|
ObscuredInt _Value; public int Value { get { return _Value; } set { _Value = value; _Value.RandomizeCryptoKey(); } }
|
||
|
|
}
|
||
|
|
|
||
|
|
public class StatusOptionSetTableData : TableDataBase
|
||
|
|
{
|
||
|
|
public int n_StatusID;
|
||
|
|
public eStatusConditionsType e_StatusConditionsType;
|
||
|
|
public string s_SkillTarget, s_Icon;
|
||
|
|
public eActiveConditions e_ActiveConditions;
|
||
|
|
public eStat e_Stat1, e_Stat2;
|
||
|
|
public eBuffType e_BuffType;
|
||
|
|
public bool b_DotDmg;
|
||
|
|
|
||
|
|
public string s_ActiveConditionsValue, s_DefaultStatValuePara1, s_DefaultStatValuePara2,
|
||
|
|
s_UpgradeStatValuePara1, s_UpgradeStatValuePara2;
|
||
|
|
|
||
|
|
ObscuredFloat _ActiveConditionsValue;
|
||
|
|
public float f_ActiveConditionsValue
|
||
|
|
{
|
||
|
|
get { return _ActiveConditionsValue; }
|
||
|
|
set { _ActiveConditionsValue = value; _ActiveConditionsValue.RandomizeCryptoKey(); }
|
||
|
|
}
|
||
|
|
ObscuredFloat _DefaultStatValuePara1;
|
||
|
|
public float f_DefaultStatValuePara1
|
||
|
|
{
|
||
|
|
get { return _DefaultStatValuePara1; }
|
||
|
|
set { _DefaultStatValuePara1 = value; _DefaultStatValuePara1.RandomizeCryptoKey(); }
|
||
|
|
}
|
||
|
|
|
||
|
|
ObscuredFloat _DefaultStatValuePara2;
|
||
|
|
public float f_DefaultStatValuePara2
|
||
|
|
{
|
||
|
|
get { return _DefaultStatValuePara2; }
|
||
|
|
set { _DefaultStatValuePara2 = value; _DefaultStatValuePara2.RandomizeCryptoKey(); }
|
||
|
|
}
|
||
|
|
|
||
|
|
ObscuredFloat _UpgradeStatValuePara1;
|
||
|
|
public float f_UpgradeStatValuePara1
|
||
|
|
{
|
||
|
|
get { return _UpgradeStatValuePara1; }
|
||
|
|
set { _UpgradeStatValuePara1 = value; _UpgradeStatValuePara1.RandomizeCryptoKey(); }
|
||
|
|
}
|
||
|
|
|
||
|
|
ObscuredFloat _UpgradeStatValuePara2;
|
||
|
|
public float f_UpgradeStatValuePara2
|
||
|
|
{
|
||
|
|
get { return _UpgradeStatValuePara2; }
|
||
|
|
set { _UpgradeStatValuePara2 = value; _UpgradeStatValuePara2.RandomizeCryptoKey(); }
|
||
|
|
}
|
||
|
|
|
||
|
|
public float Get_Rate_orValue() { return f_ActiveConditionsValue; }
|
||
|
|
public float Get_StatValue1(int lv = 0, int mul = 1)
|
||
|
|
{
|
||
|
|
return f_DefaultStatValuePara1 + (f_UpgradeStatValuePara1 * lv * mul);
|
||
|
|
}
|
||
|
|
public float Get_StatValue2(int lv = 0, int mul = 1)
|
||
|
|
{
|
||
|
|
return f_DefaultStatValuePara2 + (f_UpgradeStatValuePara2 * lv * mul);
|
||
|
|
}
|
||
|
|
|
||
|
|
public override string Get_Name()
|
||
|
|
{
|
||
|
|
return table_StatusConditionsList.Ins.Get_Data_orNull(e_StatusConditionsType).Get_Name();
|
||
|
|
}
|
||
|
|
public override string Get_Desc()
|
||
|
|
{
|
||
|
|
return table_StatusConditionsList.Ins.Get_Data_orNull(e_StatusConditionsType).Get_Desc();
|
||
|
|
}
|
||
|
|
|
||
|
|
public List<Actor> Get_Targets(Actor caster, Actor target, eRole myrole)
|
||
|
|
{
|
||
|
|
List<Actor> targets = new List<Actor>();
|
||
|
|
switch (s_SkillTarget)
|
||
|
|
{
|
||
|
|
case "Enemy":
|
||
|
|
default:
|
||
|
|
if (target != null)
|
||
|
|
{
|
||
|
|
if (!target.IsDead())
|
||
|
|
targets.Add(target);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
var enemy = InGameInfo.Ins.Get_Enemy_orNull(myrole);
|
||
|
|
if (enemy != null) targets.Add(enemy);
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
|
||
|
|
case "Self":
|
||
|
|
if (caster != null && !caster.IsDead())
|
||
|
|
targets.Add(caster);
|
||
|
|
break;
|
||
|
|
|
||
|
|
case "Ally":
|
||
|
|
targets.AddRange(InGameInfo.Ins.Get_Ally(myrole));
|
||
|
|
break;
|
||
|
|
|
||
|
|
case "Ally_Random":
|
||
|
|
{
|
||
|
|
var allies = InGameInfo.Ins.Get_Ally(myrole);
|
||
|
|
if (allies.Count > 0)
|
||
|
|
targets.Add(allies[Random.Range(0, allies.Count)]);
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
|
||
|
|
case "Ally_Front":
|
||
|
|
{
|
||
|
|
//var allyFront = InGameInfo.Ins.Get_AllyFront(Get_Data().m_Role);
|
||
|
|
//if (allyFront != null)
|
||
|
|
// targets.Add(allyFront);
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
|
||
|
|
case "Ally_Back":
|
||
|
|
{
|
||
|
|
//var allyMiddle = InGameInfo.Ins.Get_AllyMiddle(Get_Data().m_Role);
|
||
|
|
//if (allyMiddle != null)
|
||
|
|
// targets.Add(allyMiddle);
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
return targets;
|
||
|
|
}
|
||
|
|
public Actor Get_Target(Actor caster, Actor target, eRole myrole)
|
||
|
|
{ // 타겟들 중 하나
|
||
|
|
var targets = Get_Targets(caster, target, myrole);
|
||
|
|
return targets[Random.Range(0, targets.Count)];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public class table_StatusOptionSet : table_base
|
||
|
|
{
|
||
|
|
public static table_StatusOptionSet Ins;
|
||
|
|
|
||
|
|
List<StatusOptionSetTableData> tableDatas;
|
||
|
|
Dictionary<int, StatusOptionSetTableData> dic_Data = new Dictionary<int, StatusOptionSetTableData>();
|
||
|
|
|
||
|
|
protected override void Awake()
|
||
|
|
{
|
||
|
|
Ins = this;
|
||
|
|
base.Awake();
|
||
|
|
}
|
||
|
|
|
||
|
|
protected override void Start()
|
||
|
|
{
|
||
|
|
tableDatas = JsonConvert.DeserializeObject<List<StatusOptionSetTableData>>(json_last);
|
||
|
|
for (int i = 0; i < tableDatas.Count; i++)
|
||
|
|
{
|
||
|
|
var temp = tableDatas[i];
|
||
|
|
|
||
|
|
temp.f_ActiveConditionsValue = Get_Value(temp.s_ActiveConditionsValue);
|
||
|
|
temp.f_DefaultStatValuePara1 = Get_Value(temp.s_DefaultStatValuePara1);
|
||
|
|
temp.f_DefaultStatValuePara2 = Get_Value(temp.s_DefaultStatValuePara2);
|
||
|
|
temp.f_UpgradeStatValuePara1 = Get_Value(temp.s_UpgradeStatValuePara1);
|
||
|
|
temp.f_UpgradeStatValuePara2 = Get_Value(temp.s_UpgradeStatValuePara2);
|
||
|
|
|
||
|
|
dic_Data.Add(temp.n_StatusID, temp);
|
||
|
|
}
|
||
|
|
base.Start();
|
||
|
|
}
|
||
|
|
|
||
|
|
public List<StatusOptionSetTableData> Get_DataList() { return tableDatas; }
|
||
|
|
public StatusOptionSetTableData Get_Data(int id) { return dic_Data[id]; }
|
||
|
|
}
|