Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public bool Move(Unit9 toTarget)
 {
     return(this.Move(toTarget.Position));
 }
Exemplo n.º 3
0
 internal virtual float GetAttackRate(Unit9 target = null)
 {
     return(this.BaseAttackTime / (1 + ((this.GetAttackSpeed(target) - 100) / 100)));
 }
Exemplo n.º 4
0
 public bool IsEnemy(Unit9 unit)
 {
     return(unit.Team == this.EnemyTeam);
 }
Exemplo n.º 5
0
 public bool IsAlly(Unit9 unit)
 {
     return(unit.Team == this.Team);
 }
Exemplo n.º 6
0
 public float GetAttackPoint(Unit9 target = null)
 {
     return(this.BaseAttackAnimationPoint / (1 + ((this.GetAttackSpeed(target) - 100) / 100)));
 }
Exemplo n.º 7
0
 public float GetAttackBackswing(Unit9 target = null)
 {
     return(this.GetAttackRate(target) - this.GetAttackPoint(target));
 }
Exemplo n.º 8
0
 public float GetAngle(Unit9 unit, bool rotationDifference = false)
 {
     return(this.GetAngle(unit.Position, rotationDifference));
 }