From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/ProjectDamageResult.cs | 150 +++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/ProjectDamageResult.cs (limited to 'Client/Assets/Scripts/XMainClient/ProjectDamageResult.cs') diff --git a/Client/Assets/Scripts/XMainClient/ProjectDamageResult.cs b/Client/Assets/Scripts/XMainClient/ProjectDamageResult.cs new file mode 100644 index 00000000..19b1e5e5 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/ProjectDamageResult.cs @@ -0,0 +1,150 @@ +using System; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class ProjectDamageResult : XDataBase + { + public double DefOriginalRatio { get; set; } + + public CombatEffectHelper EffectHelper + { + get + { + return this._EffectHelper; + } + } + + public double TrueDamage + { + get + { + return this.m_TrueDamage; + } + set + { + this.m_Value -= this.m_TrueDamage; + this.m_TrueDamage = value; + bool flag = this.m_TrueDamage < 0.0; + if (flag) + { + this.m_TrueDamage = 0.0; + } + this.m_Value += this.m_TrueDamage; + } + } + + public double AbsorbDamage + { + get + { + return this.m_AbsorbDamage; + } + set + { + this.m_Value += this.m_AbsorbDamage; + this.m_AbsorbDamage = value; + bool flag = this.Value > this.m_AbsorbDamage; + if (flag) + { + this.Value -= this.m_AbsorbDamage; + } + else + { + this.Value = 0.0; + } + } + } + + public double Value + { + get + { + return this.m_Value; + } + set + { + bool flag = value < this.m_Value && this.TrueDamage > 0.0; + if (flag) + { + this.TrueDamage -= this.m_Value - value; + } + this.m_Value = value; + } + } + + public double BasicDamage + { + get + { + return this.Value - this.TrueDamage; + } + } + + public int Flag { get; set; } + + public DamageType Type { get; set; } + + public DamageElement ElementType { get; set; } + + public bool IsTargetDead { get; set; } + + public ulong Caster { get; set; } + + public int ComboCount { get; set; } + + public bool Accept; + + public ProjectResultType Result; + + private CombatEffectHelper _EffectHelper; + + private double m_TrueDamage; + + private double m_AbsorbDamage; + + private double m_Value; + + public bool IsCritical() + { + int num = XFastEnumIntEqualityComparer.ToInt(DamageFlag.DMGFLAG_CRITICAL); + return (this.Flag & num) != 0; + } + + public ProjectDamageResult() + { + this.Init(); + } + + public void SetResult(ProjectResultType r) + { + bool flag = r < this.Result; + if (flag) + { + this.Result = r; + } + } + + public override void Init() + { + base.Init(); + this.Accept = true; + this.Result = ProjectResultType.PJRES_BEHIT; + this.Type = DamageType.DMG_INVALID; + this.Value = 0.0; + this.AbsorbDamage = 0.0; + this.TrueDamage = 0.0; + this.IsTargetDead = false; + this.Flag = XFastEnumIntEqualityComparer.ToInt(DamageFlag.DMGFLAG_NONE); + this.Caster = 0UL; + this.ComboCount = 0; + this._EffectHelper = XDataPool.GetData(); + } + + public override void Recycle() + { + this._EffectHelper.Recycle(); + XDataPool.Recycle(this); + } + } +} -- cgit v1.1-26-g67d0