private void Drawing_OnDraw(EventArgs args) { if (!FillEnabled && !KillableEnabled) { return; } foreach (var enemy in Heroes.GetEnemies(Range)) { // Get damage to unit var damage = _damageToUnitDelegate(enemy); // Continue on 0 damage if (damage <= 0) { continue; } if ((damage > enemy.Health) && KillableEnabled) { EloBuddy.Drawing.DrawText(enemy.HPBarPosition.X + 10, enemy.HPBarPosition.Y + 3, Killable, "Killable"); } if (FillEnabled) { Unit = enemy; var hpPosNow = GetHpPosAfterDmg(0); var hpPosAfter = GetHpPosAfterDmg(damage); fillHPBar(hpPosNow, hpPosAfter, new ColorBGRA(Fill.B, Fill.G, Fill.R, 200)); //var damagePercentage = ((enemy.Health - damage) > 0 ? (enemy.Health - damage) : 0) / enemy.MaxHealth; //var currentHealthPercentage = enemy.Health / enemy.MaxHealth; //var startPoint = new Vector2( // (int)(enemy.HPBarPosition.X + BarOffset.X + damagePercentage * Width), // (int)(enemy.HPBarPosition.Y + BarOffset.Y) - 5); //var endPoint = // new Vector2( // (int)(enemy.HPBarPosition.X + BarOffset.X + currentHealthPercentage * Width) + 1, // (int)(enemy.HPBarPosition.Y + BarOffset.Y) - 5); // Draw the line EloBuddy.Drawing.DrawLine(startPoint, endPoint, Thinkness, Fill); // if (_debugger) Console.WriteLine($"GeassLib: {enemy.Name} {startPoint} {endPoint}"); } } }
public static IOrderedEnumerable <AIHeroClient> OrderTargets(Spell spell) { var damageType = spell.DamageType == TargetSelector.DamageType.Physical; return(damageType? Heroes.GetEnemies(spell.Range).Where(ValidChampion).OrderBy(hp => hp.Health / hp.PercentArmorMod) : Heroes.GetEnemies(spell.Range).Where(ValidChampion).OrderBy(hp => hp.Health / hp.PercentMagicReduction)); }