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