internal static void Drawing_OnDraw(EventArgs args) { var target = TargetSelector.GetTarget(Tristana.E.Range, TargetSelector.DamageType.Magical); if (target == null) { return; } foreach (var unit in HeroManager.Enemies.Where(h => h.IsValid && h.IsHPBarRendered)) { var barPos = unit.HPBarPosition; var damage = DamageHandler.DamageToUnit(unit); var percentHealthAfterDamage = Math.Max(0, unit.Health - damage) / unit.MaxHealth; var yPos = barPos.Y + YOffset; var xPosDamage = barPos.X + XOffset + Width * percentHealthAfterDamage; var xPosCurrentHp = barPos.X + XOffset + Width * unit.Health / unit.MaxHealth; if (damage > unit.Health) { Text.X = (int)barPos.X + XOffset; Text.Y = (int)barPos.Y + YOffset - 13; Text.text = "Killable With Combo Rotation " + (unit.Health - damage); Text.OnEndScene(); } Drawing.DrawLine(xPosDamage, yPos, xPosDamage, yPos + Height, 1, _color); var differenceInHp = xPosCurrentHp - xPosDamage; var pos1 = barPos.X + 9 + (107 * percentHealthAfterDamage); for (var i = 0; i < differenceInHp; i++) { Drawing.DrawLine(pos1 + i, yPos, pos1 + i, yPos + Height, 1, _fillColor); } } }
private static void ECast() { var target = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical); if (target != null && R.IsReady()) { if (DamageHandler.EDamage(target) + R.GetDamage(target) > target.Health) { R.Cast(target); } } }