From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/XCombatStatisticsInfo.cs | 142 +++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XCombatStatisticsInfo.cs (limited to 'Client/Assets/Scripts/XMainClient/XCombatStatisticsInfo.cs') diff --git a/Client/Assets/Scripts/XMainClient/XCombatStatisticsInfo.cs b/Client/Assets/Scripts/XMainClient/XCombatStatisticsInfo.cs new file mode 100644 index 00000000..790bcb65 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XCombatStatisticsInfo.cs @@ -0,0 +1,142 @@ +using System; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XCombatStatisticsInfo : XDataBase, IComparable + { + public uint id; + + public string name; + + public int count; + + public double value; + + public float percent; + + public void CutName() + { + bool flag = this.name != null && this.name.Length > 5; + if (flag) + { + this.name = this.name.Substring(0, 4) + ".."; + } + } + + public bool Set(XSecuritySkillInfo.SkillInfo skillInfo, XEntity entity, XSecuritySkillInfo.SkillInfo resetInfo) + { + return this.Set(skillInfo._SkillID, skillInfo._CastCount, (double)skillInfo._AttackTotal, entity, resetInfo); + } + + public bool Set(uint _id, int _count, double _value, XEntity entity, XSecuritySkillInfo.SkillInfo resetInfo) + { + this.id = _id; + this.value = _value; + this.count = _count; + bool flag = resetInfo != null && resetInfo._SkillID == this.id; + if (flag) + { + this.value -= (double)resetInfo._AttackTotal; + this.count -= resetInfo._CastCount; + } + bool flag2 = this.value < 0.0010000000474974513; + bool result; + if (flag2) + { + result = false; + } + else + { + uint preSkill = XSingleton.singleton.GetPreSkill(this.id, entity.SkillCasterTypeID); + bool flag3 = preSkill > 0u; + if (flag3) + { + this.id = preSkill; + } + SkillList.RowData skillConfig = XSingleton.singleton.GetSkillConfig(this.id, 1u, entity.SkillCasterTypeID); + bool flag4 = skillConfig != null; + if (flag4) + { + this.name = skillConfig.ScriptName; + } + this.CutName(); + result = true; + } + return result; + } + + public bool Set(XSecurityMobInfo.MobInfo mobInfo, XEntity entity, XSecurityMobInfo.MobInfo resetInfo) + { + return this.Set(mobInfo._TemplateID, mobInfo._CastCount, (double)mobInfo._AttackTotal, entity, resetInfo); + } + + public bool Set(uint _id, int _count, double _value, XEntity entity, XSecurityMobInfo.MobInfo resetInfo) + { + this.id = _id; + this.value = _value; + this.count = _count; + bool flag = resetInfo != null && resetInfo._TemplateID == this.id; + if (flag) + { + this.value -= (double)resetInfo._AttackTotal; + this.count -= resetInfo._CastCount; + } + bool flag2 = this.value < 0.0010000000474974513; + bool result; + if (flag2) + { + result = false; + } + else + { + XEntityStatistics.RowData byID = XSingleton.singleton.EntityStatistics.GetByID(this.id); + bool flag3 = byID != null; + if (flag3) + { + this.name = byID.Name; + } + this.CutName(); + result = true; + } + return result; + } + + public void MergeValue(XCombatStatisticsInfo other) + { + this.value += other.value; + } + + public int CompareTo(XCombatStatisticsInfo other) + { + int num = -this.value.CompareTo(other.value); + bool flag = num == 0; + if (flag) + { + num = -this.count.CompareTo(other.count); + } + bool flag2 = num == 0; + if (flag2) + { + num = this.id.CompareTo(other.id); + } + return num; + } + + public override void Init() + { + base.Init(); + this.id = 0u; + this.name = string.Empty; + this.count = 0; + this.value = 0.0; + this.percent = 0f; + } + + public override void Recycle() + { + base.Recycle(); + XDataPool.Recycle(this); + } + } +} -- cgit v1.1-26-g67d0