示例#1
0
        internal Damage GetRawAttackDamage(
            Unit9 target,
            DamageValue damageValue        = DamageValue.Minimum,
            float physCritMultiplier       = 1f,
            float additionalPhysicalDamage = 0)
        {
            var damage = new Damage();

            var multipliedPhysDamage = 0f;

            switch (damageValue)
            {
            case DamageValue.Minimum:
                multipliedPhysDamage += this.BaseUnit.MinimumDamage;
                break;

            case DamageValue.Average:
                multipliedPhysDamage += this.BaseUnit.DamageAverage;
                break;

            case DamageValue.Maximum:
                multipliedPhysDamage += this.BaseUnit.MaximumDamage;
                break;
            }

            if (this.IsIllusion && !this.CanUseAbilities)
            {
                //todo improve illusion damage ?
                multipliedPhysDamage *= 0.25f;
            }
            else
            {
                multipliedPhysDamage += this.BaseUnit.BonusDamage;
            }

            if (multipliedPhysDamage <= 0)
            {
                return(damage);
            }

            foreach (var passive in this.passiveDamageAbilities)
            {
                if (!passive.IsValid)
                {
                    continue;
                }

                foreach (var passiveDamage in passive.GetRawDamage(target))
                {
                    if (passive.MultipliedByCrit && passiveDamage.Key == DamageType.Physical)
                    {
                        multipliedPhysDamage += passiveDamage.Value;
                    }
                    else
                    {
                        damage[passiveDamage.Key] += passiveDamage.Value;
                    }
                }
            }

            damage[DamageType.Physical] += (multipliedPhysDamage * physCritMultiplier) + additionalPhysicalDamage;
            damage[DamageType.Physical] *= DamageExtensions.GetMeleeDamageMultiplier(this, target);

            return(damage);
        }
示例#2
0
 public bool Move(Unit9 toTarget)
 {
     return(this.Move(toTarget.Position));
 }
示例#3
0
 internal virtual float GetAttackRate(Unit9 target = null)
 {
     return(this.BaseAttackTime / (1 + ((this.GetAttackSpeed(target) - 100) / 100)));
 }
示例#4
0
 public bool IsEnemy(Unit9 unit)
 {
     return(unit.Team == this.EnemyTeam);
 }
示例#5
0
 public bool IsAlly(Unit9 unit)
 {
     return(unit.Team == this.Team);
 }
示例#6
0
 public float GetAttackPoint(Unit9 target = null)
 {
     return(this.BaseAttackAnimationPoint / (1 + ((this.GetAttackSpeed(target) - 100) / 100)));
 }
示例#7
0
 public float GetAttackBackswing(Unit9 target = null)
 {
     return(this.GetAttackRate(target) - this.GetAttackPoint(target));
 }
示例#8
0
 public float GetAngle(Unit9 unit, bool rotationDifference = false)
 {
     return(this.GetAngle(unit.Position, rotationDifference));
 }