CalculateDamage() 공개 정적인 메소드

Calculates and returns damage totally done to the target
public static CalculateDamage ( Obj_AI_Base target, bool useQ, bool useR ) : float
target Obj_AI_Base The Target
useQ bool Include Q in Calculations?
useR bool Include R in Calculations?
리턴 float
예제 #1
0
        private static void Drawing_OnDraw(EventArgs args)
        {
            if (!Program.DrawMenu["draw.Damage"].Cast <CheckBox>().CurrentValue)
            {
                return;
            }

            foreach (var aiHeroClient in EntityManager.Heroes.Enemies)
            {
                if (!aiHeroClient.IsHPBarRendered)
                {
                    continue;
                }

                var pos = new Vector2(
                    aiHeroClient.HPBarPosition.X + XOffset,
                    aiHeroClient.HPBarPosition.Y + YOffset);

                var fullbar = (BarLength) * (aiHeroClient.HealthPercent / 100);

                var drawQ = Program.DrawMenu["draw.Q"].Cast <CheckBox>().CurrentValue;

                var drawW = Program.DrawMenu["draw.W"].Cast <CheckBox>().CurrentValue;

                var drawE = Program.DrawMenu["draw.E"].Cast <CheckBox>().CurrentValue;

                var drawR = Program.DrawMenu["draw.R"].Cast <CheckBox>().CurrentValue;

                var damage = (BarLength)
                             * ((DamageLibrary.CalculateDamage(aiHeroClient, drawQ, drawW, drawE, drawR)
                                 / aiHeroClient.MaxHealth) > 1
                                    ? 1
                                    : (DamageLibrary.CalculateDamage(
                                           aiHeroClient,
                                           drawQ,
                                           drawW,
                                           drawE,
                                           drawR) / aiHeroClient.MaxHealth));

                Line.DrawLine(
                    Color.FromArgb(100, Color.Black),
                    9f,
                    new Vector2(pos.X, pos.Y),
                    new Vector2(pos.X + (damage > fullbar ? fullbar : damage), pos.Y));

                Line.DrawLine(
                    Color.Black,
                    3,
                    new Vector2(pos.X + (damage > fullbar ? fullbar : damage), pos.Y),
                    new Vector2(pos.X + (damage > fullbar ? fullbar : damage), pos.Y));
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: volder1/EloBuddy
        /// <summary>
        /// Does KillSteal
        /// </summary>
        private static void KillSteal()
        {
            if (KillStealMenu["useQ"].Cast <CheckBox>().CurrentValue)
            {
                if (Q.IsReady())
                {
                    var enemies =
                        EntityManager.Heroes.Enemies.Where(
                            t =>
                            t.IsValidTarget() && Q.IsInRange(t) &&
                            DamageLibrary.CalculateDamage(t, true, false, false, false) >= t.Health + t.AllShield);

                    // Resharper op
                    foreach (
                        var pred in
                        enemies.Select(t => Q.GetPrediction(t))
                        .Where(pred => pred != null)
                        .Where(
                            pred =>
                            pred.HitChancePercent >= KillStealMenu["qSlider"].Cast <Slider>().CurrentValue))
                    {
                        Q.Cast(pred.CastPosition);
                    }
                }
                else
                {
                    return;
                }
            }
            if (KillStealMenu["useE"].Cast <CheckBox>().CurrentValue)
            {
                if (E.IsReady() && LuxEObject == null)
                {
                    var enemies =
                        EntityManager.Heroes.Enemies.Where(
                            t =>
                            t.IsValidTarget() && E.IsInRange(t) &&
                            DamageLibrary.CalculateDamage(t, false, false, true, false) >= t.Health + t.AllShield);

                    foreach (var pred in enemies.Select(t => E.GetPrediction(t)).Where(pred => pred != null).Where(pred => pred.HitChancePercent >= KillStealMenu["eSlider"].Cast <Slider>().CurrentValue))
                    {
                        E.Cast(pred.CastPosition);
                    }
                }
                else if (!E.IsReady() && LuxEObject != null)
                {
                    var enemies =
                        EntityManager.Heroes.Enemies.Where(
                            t =>
                            t.IsValidTarget() && t.Distance(LuxEObject.Position) <= LuxEObject.BoundingRadius &&
                            DamageLibrary.CalculateDamage(t, false, false, true, false) >= t.Health + t.AllShield);

                    if (enemies.Any() && LuxEObject != null)
                    {
                        E2.Cast();
                    }
                }
            }
            if (KillStealMenu["useR"].Cast <CheckBox>().CurrentValue)
            {
                if (R.IsReady())
                {
                    var enemies =
                        EntityManager.Heroes.Enemies.Where(
                            t =>
                            t.IsValidTarget() && R.IsInRange(t) &&
                            DamageLibrary.CalculateDamage(t, false, false, false, true) >= t.Health + t.AllShield);

                    foreach (
                        var pred in
                        enemies.Select(t => R.GetPrediction(t))
                        .Where(pred => pred != null)
                        .Where(
                            pred =>
                            pred.HitChancePercent >= KillStealMenu["rSlider"].Cast <Slider>().CurrentValue))
                    {
                        R.Cast(pred.CastPosition);
                    }
                }
            }
        }