OneShotOneKill/Assets/Script/My/MyClass.cs

179 lines
4.4 KiB
C#
Raw Permalink Normal View History

2026-01-07 21:27:42 +00:00
using CodeStage.AntiCheat.ObscuredTypes;
using System;
using System.Collections.Generic;
using UnityEngine;
using Random = UnityEngine.Random;
public class ObjectPool<T> where T : new()
{
private Stack<T> pool = new Stack<T>();
public T Get()
{
return pool.Count > 0 ? pool.Pop() : new T();
}
public void Release(T obj)
{
pool.Push(obj);
}
}
[Serializable]
public class TableDataBase
{
public virtual string Get_Name() { return "no name"; }
public virtual string Get_Desc() { return "no desc"; }
public virtual string Get_ImagePath(eActorStatus actorStatus = eActorStatus.Idle) { return ""; }
public virtual float Get_Value(int lv, float balance, float defaultval, float perlv, bool abandon = false)
{
if (lv <= 0) return 0f;
float val;
if (Mathf.Approximately(0f, balance))
val = lv * perlv;
else
val = Mathf.Pow(lv * perlv, balance * Mathf.Sqrt(lv));
val *= 0.0001f;
val += defaultval;
if (abandon) val = Mathf.Floor(val); // 소수점 이하 모두 버림
return val;
}
}
public class ActorTableDataBase : TableDataBase
{
public eRole m_Role;
ObscuredInt _id;
public int n_ID
{
get { return _id; }
set { _id = value; _id.RandomizeCryptoKey(); }
}
ObscuredFloat _AttackCoolTime;
public float f_AttackCoolTime
{
get { return _AttackCoolTime; }
set { _AttackCoolTime = value; _AttackCoolTime.RandomizeCryptoKey(); }
}
ObscuredInt _atkMin;
public int n_AttackMin
{
get { return _atkMin; }
set { _atkMin = value; _atkMin.RandomizeCryptoKey(); }
}
ObscuredInt _atkMax;
public int n_AttackMax
{
get { return _atkMax; }
set { _atkMax = value; _atkMax.RandomizeCryptoKey(); }
}
ObscuredFloat _cri;
public float f_Cri
{
get { return _cri; }
set { _cri = value; _cri.RandomizeCryptoKey(); }
}
ObscuredFloat _criDmg;
public float f_CriDmg
{
get { return _criDmg; }
set { _criDmg = value; _criDmg.RandomizeCryptoKey(); }
}
ObscuredInt _hp;
public int n_HP
{
get { return _hp; }
set { _hp = value; _hp.RandomizeCryptoKey(); }
}
ObscuredInt _shield;
public int n_Shield
{
get { return _shield; }
set { _shield = value; _shield.RandomizeCryptoKey(); }
}
ObscuredFloat _Avoid_Meele;
public float n_Avoid_Meele
{
get { return _Avoid_Meele; }
set { _Avoid_Meele = value; _Avoid_Meele.RandomizeCryptoKey(); }
}
ObscuredFloat _Avoid_Range;
public float n_Avoid_Range
{
get { return _Avoid_Range; }
set { _Avoid_Range = value; _Avoid_Range.RandomizeCryptoKey(); }
}
ObscuredInt _Specificity1;
public int n_Specificity1
{
get { return _Specificity1; }
set { _Specificity1 = value; _Specificity1.RandomizeCryptoKey(); }
}
ObscuredInt _Specificity2;
public int n_Specificity2
{
get { return _Specificity2; }
set { _Specificity2 = value; _Specificity2.RandomizeCryptoKey(); }
}
ObscuredInt _Specificity3;
public int n_Specificity3
{
get { return _Specificity3; }
set { _Specificity3 = value; _Specificity3.RandomizeCryptoKey(); }
}
ObscuredInt _Specificity4;
public int n_Specificity4
{
get { return _Specificity4; }
set { _Specificity4 = value; _Specificity4.RandomizeCryptoKey(); }
}
public int n_Name;
public string s_Projectile, s_Image;
public virtual eAttackType Get_AttackType() { return eAttackType.Max; }
public override string Get_Name() { return table_localtext.Ins.Get_Text(n_Name); }
public virtual bool IsBoss() { return false; }
}
public class StatTableDataBase : TableDataBase
{
public eStat Stat;
public ObscuredDouble BaseValue, ValuePerLv;
public ObscuredInt MaxLv, CostBase, CostIncrease;
public string Icon;
public double Get_Cost(int lv)
{
return CostBase + CostIncrease * lv;
}
}
public class ItemSimpleData
{
ObscuredInt _itemid;
ObscuredDouble _amount;
public int itemid
{
get { return _itemid; }
set { _itemid = value; _itemid.RandomizeCryptoKey(); }
}
public double amount
{
get { return _amount; }
set { _amount = value; _amount.RandomizeCryptoKey(); }
}
}