public static AIHeroClient GetTarget(float range, TargetSelector2.DamageType damageType, bool ignoreShield = true, IEnumerable <AIHeroClient> ignoredChamps = null, Vector3?rangeCheckFrom = null) { if (_lastTarget == null || !_lastTarget.IsValidTarget() || _lastDamageType != damageType) { var newTarget = TargetSelector2.GetTarget(range, damageType, ignoreShield, ignoredChamps, rangeCheckFrom); _lastTarget = newTarget; _lastDamageType = damageType; return(newTarget); } if (_lastTarget.IsValidTarget(range) && damageType == _lastDamageType) { return(_lastTarget); } var newTarget2 = TargetSelector2.GetTarget(range, damageType, ignoreShield, ignoredChamps, rangeCheckFrom); _lastTarget = newTarget2; _lastDamageType = damageType; return(newTarget2); }
/// <summary> /// Returns the best target found using the current TargetSelector mode. /// Please make sure to set the Spell.DamageType Property to the type of damage this spell does (if not done on /// initialization). /// </summary> public AIHeroClient GetTarget(float extraRange = 0, IEnumerable <AIHeroClient> champsToIgnore = null) { return(TargetSelector2.GetTarget(Range + extraRange, DamageType, true, champsToIgnore, From)); }