当前位置: 首页>>代码示例>>C#>>正文


C# Geometry.Polygon.Rectangle.IsInside方法代码示例

本文整理汇总了C#中LeagueSharp.Common.Geometry.Polygon.Rectangle.IsInside方法的典型用法代码示例。如果您正苦于以下问题:C# Geometry.Polygon.Rectangle.IsInside方法的具体用法?C# Geometry.Polygon.Rectangle.IsInside怎么用?C# Geometry.Polygon.Rectangle.IsInside使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LeagueSharp.Common.Geometry.Polygon.Rectangle的用法示例。


在下文中一共展示了Geometry.Polygon.Rectangle.IsInside方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AutoUlti

        public static void AutoUlti()
        {
            // Hoes code below
            if (GetBool("wardinsec", typeof(KeyBind))) return;

            var target =
                HeroManager.Enemies.Where(x => x.Distance(Player) < R.Range && !x.IsDead && x.IsValidTarget(R.Range))
                    .OrderBy(x => x.Distance(Player)).FirstOrDefault();
            if (target == null || Player.IsDead)
            {
                UltPoly = null;
                _ultPolyExpectedPos = null;
                return;
            }

            UltPoly = new Geometry.Polygon.Rectangle(Player.ServerPosition,
                Player.ServerPosition.Extend(target.Position, 1100),
                target.BoundingRadius + 10);

            var counts =
                HeroManager.Enemies.Where(x => x.Distance(Player) < 1100 && x.IsValidTarget(1100))
                    .Count(h => h.NetworkId != target.NetworkId && UltPoly.IsInside(h.ServerPosition));

            if (counts >= GetValue("autoron") && R.IsReady())
            {
                R.Cast(target);
            }
        }
开发者ID:Faqer,项目名称:LeagueSharp-3,代码行数:28,代码来源:AutoUlt.cs

示例2: GetPredictedHealth

        /// <summary>
        ///     Gets the predicted health of a unit.
        /// </summary>
        /// <param name="target">Target</param>
        /// <param name="time">Time in miliseconds</param>
        /// <returns>Predicted Health.</returns>
        public static float GetPredictedHealth(Obj_AI_Base target, float time)
        {
            var health = target.Health;

            foreach (var missile in Missiles)
            {
                var missileArriveTime = 1000 * missile.Position.Distance(target.ServerPosition) / missile.SData.MissileSpeed;
                var missileRectangle = new Geometry.Polygon.Rectangle(missile.StartPosition, missile.EndPosition, missile.SData.LineWidth);

                if (missileRectangle.IsInside(target) && missileArriveTime >= time)
                {
                    health -= (float) missile.SpellCaster.GetSpellDamage(target, missile.SData.Name);
                }
            }

            return health;
        }
开发者ID:uio25371555,项目名称:ChewyMoonScripts,代码行数:23,代码来源:MissileHealthPrediction.cs

示例3: AutoUlt

        private static void AutoUlt()
        {
            // Hoes code below
            if (GetBool("wardinsec", typeof (KeyBind))) return;

            var target =
                HeroManager.Enemies.Where(x => x.Distance(Player) < R.Range && !x.IsDead && x.IsValidTarget(R.Range))
                    .OrderBy(x => x.Distance(Player)).FirstOrDefault();
            if (target == null || Player.IsDead)
            {
                ultPoly = null;
                ultPolyExpectedPos = null;
                return;
            }

            ultPoly = new Geometry.Polygon.Rectangle(Player.ServerPosition,
                Player.ServerPosition.Extend(target.Position, 1100),
                target.BoundingRadius + 10);

            var counts =
                HeroManager.Enemies.Where(x => x.Distance(Player) < 1100 && x.IsValidTarget(1100))
                    .Count(h => h.NetworkId != target.NetworkId && ultPoly.IsInside(h.ServerPosition));

            if (counts >= GetValue("autoron") && R.IsReady())
            {
                R.Cast(target);
            }

            //// HyunMi code here
            //var enemies = Playerpos.GetEnemiesInRange(2800);
            //byte minEnemHitConstraint = (byte)Config.Item("xeminhit").GetValue<Slider>().Value;

            //if (enemies.Count < minEnemHitConstraint) return;

            //bool xeallowFlash = Config.Item("xeflash").GetValue<bool>();
            //bool allowWard = Config.Item("xeward").GetValue<bool>();

            //bool canUseWard = false, canUseFlash = false;
            //if (FlashSlot.IsReady() && FlashSlot != SpellSlot.Unknown && xeallowFlash)
            //{
            //    canUseFlash = true;
            //}

            ////TODO: check if player has a ward and w is ready if so canUseWard == true only if AllowWard = true
        }
开发者ID:agonizt,项目名称:LeagueSharp,代码行数:45,代码来源:LeeSin.cs

示例4: OnProcessSpell

        private static void OnProcessSpell(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {

                if (args.Target is Obj_AI_Minion || !(sender is Obj_AI_Hero))
                    return;
                if (_MainMenu.Item("Janna_AutoE").GetValue<bool>() && _E.IsReady())
                {
                    if (sender.IsEnemy)
                    {                        
                        var StartPos = args.Start;
                        var EndPos = args.End;
                        var NonTRange = new Geometry.Polygon.Rectangle(StartPos, EndPos, sender.BoundingRadius + 30);
                        var Target = HeroManager.Allies.FirstOrDefault(f => f.Position.Distance(Player.Position) <= _E.Range && NonTRange.IsInside(f.Position));
                        if (Target == Player && _MainMenu.Item("Janna_AutoE1").GetValue<bool>()) return;
                        if (Target != null)
                        {
                            _E.CastOnUnit(Target, true);
                            return;
                        }
                        if (args.Target != null && args.Target.Position.Distance(Player.Position) <= _E.Range && args.Target is Obj_AI_Hero)
                        {
                            var ShieldTarget = HeroManager.Allies.FirstOrDefault(f => f.Position.Distance(args.Target.Position) <= 10);
                            _E.CastOnUnit(ShieldTarget, true);
                            return;
                        }
                    }
                    if (sender.IsAlly && args.Target is Obj_AI_Hero)
                    {
                        if (sender.Position.Distance(Player.Position) <= _E.Range && args.Target != null && args.SData.Name.ToLower().Contains("attack"))
                        {
                            _E.CastOnUnit(sender, true);
                            return;
                        }
                    }
                }
            }
            catch (Exception)
            {
                if (NowTime() > ErrorTime)
                {
                    Game.PrintChat(ChampName + " in FreshBooster isn't Load. Error Code 08");
                    ErrorTime = TickCount(10000);
                }
            }

        }
开发者ID:NaviFly,项目名称:LeagueSharp,代码行数:48,代码来源:Janna.cs

示例5: OnSpells

        private static void OnSpells(EventArgs args)
        {
            if (Player.IsDead) return;

            if (ultPoly != null && GetBool("rpolygon", typeof(bool)))
            {
                ultPoly.Draw(Color.Red);
            }

            if (RCombo != null && GetBool("rpolygon", typeof(bool))) Render.Circle.DrawCircle((Vector3) RCombo, 100, Color.Red, 5, true);

            if (GetBool("counthitr", typeof (bool)))
            {
                var getresults = Mathematics.GetPositions(Player, 1125, (byte) 3, HeroManager.Enemies);
                if (getresults.Count > 1)
                {
                    var Getposition = Mathematics.SelectBest(getresults, Player);
                    Render.Circle.DrawCircle(Getposition, 100, Color.Red, 3, true);
                }
            }

            Render.Circle.DrawCircle(Player.Position, 1125, Color.DarkViolet);
            if (!GetBool("spellsdraw", typeof (bool))) return;
            if (!GetBool("ovdrawings", typeof (bool))) return;
            if (GetBool("qrange", typeof (bool)) && Q.Level > 0)
            {
                var color = Q.IsReady() ? Color.DodgerBlue : Color.Red;
                Render.Circle.DrawCircle(Player.Position, Q.Range, color);
            }

            if (GetBool("wrange", typeof (bool)) && W.Level > 0)
            {
                var colorw = W.IsReady() ? Color.BlueViolet : Color.Red;
                Render.Circle.DrawCircle(Player.Position, W.Range, colorw);
            }

            if (GetBool("erange", typeof (bool)) && E.Level > 0)
            {
                var colore = E.IsReady() ? Color.Plum : Color.Red;
                Render.Circle.DrawCircle(Player.Position, E.Range, colore);
            }

            if (GetBool("rrange", typeof (bool)) && R.Level > 0)
            {
                var colorr = R.IsReady() ? Color.LawnGreen : Color.Red;
                Render.Circle.DrawCircle(Player.Position, R.Range, colorr);
            }
            var target =
                HeroManager.Enemies.Where(x => x.Distance(Player) < R.Range && !x.IsDead && x.IsValidTarget(R.Range))
                    .OrderBy(x => x.Distance(Player)).FirstOrDefault();
            if (target == null || Player.IsDead)
            {
                ultPoly = null;
                ultPolyExpectedPos = null;
                return;
            }

            ultPoly = new Geometry.Polygon.Rectangle(Player.ServerPosition,
                Player.ServerPosition.Extend(target.Position, 1100),
                target.BoundingRadius + 20);
            if (GetBool("counthitr", typeof (bool)))
            {
                var counts =
                    HeroManager.Enemies.Where(x => x.Distance(Player) < 1200 && x.IsValidTarget(1200))
                        .Count(h => h.NetworkId != target.NetworkId && ultPoly.IsInside(h.ServerPosition));

                Drawing.DrawText(Drawing.WorldToScreen(Player.Position).X, Drawing.WorldToScreen(Player.Position).Y,
                    Color.Magenta, "Ult Will Hit " + counts);
            }
        }
开发者ID:agonizt,项目名称:LeagueSharp,代码行数:70,代码来源:LeeSin.cs

示例6: ELogicFarm

        private void ELogicFarm(List<Obj_AI_Base> targets, HitChance hitChance, int minHits)
        {
            try
            {
                var input = new PredictionInput
                {
                    Range = ELength,
                    Delay = E.Delay,
                    Radius = E.Width,
                    Speed = E.Speed,
                    Type = E.Type
                };
                var input2 = new PredictionInput
                {
                    Range = E.Range + ELength,
                    Delay = E.Delay,
                    Radius = E.Width,
                    Speed = E.Speed,
                    Type = E.Type
                };
                var startPos = Vector3.Zero;
                var endPos = Vector3.Zero;
                var hits = 0;
                targets = targets.Where(t => t.IsValidTarget((E.Range + ELength + E.Width) * 1.1f)).ToList();
                var targetCount = targets.Count;

                foreach (var target in targets)
                {
                    var lTarget = target;
                    if (target.ServerPosition.Distance(Player.ServerPosition) <= E.Range)
                    {
                        var cCastPos = target.ServerPosition;
                        foreach (var t in targets.Where(t => t.NetworkId != lTarget.NetworkId))
                        {
                            var count = 1;
                            input.Unit = t;
                            input.From = cCastPos;
                            input.RangeCheckFrom = cCastPos;
                            var pred = Prediction.GetPrediction(input);
                            var rect = new Geometry.Polygon.Rectangle(
                                cCastPos.To2D(), cCastPos.Extend(pred.CastPosition, ELength).To2D(), E.Width);
                            foreach (var c in targets.Where(c => c.NetworkId != lTarget.NetworkId))
                            {
                                input.Unit = c;
                                var cPredPos = c.Position;
                                if (
                                    new Geometry.Polygon.Circle(
                                        cPredPos, (c.IsMoving ? (c.BoundingRadius / 2f) : (c.BoundingRadius) * 0.9f))
                                        .Points.Any(p => rect.IsInside(p)))
                                {
                                    count++;
                                }
                            }
                            if (pred.Hitchance >= (hitChance - 1))
                            {
                                count++;
                                if (count > hits)
                                {
                                    hits = count;
                                    startPos = cCastPos;
                                    endPos = cCastPos.Extend(pred.CastPosition, ELength);
                                    if (hits == targetCount)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                        if (endPos.Equals(Vector3.Zero))
                        {
                            startPos = cCastPos;
                            if (IsSpellUpgraded(E))
                            {
                                if (target.Path.Length > 0)
                                {
                                    var newPos = target.Path[0];
                                    if (target.Path.Length > 1 && newPos.Distance(target.ServerPosition) <= 150)
                                    {
                                        newPos = newPos.Extend(target.Path[1], 50);
                                    }
                                    startPos = target.ServerPosition.Extend(newPos, -(lTarget.BoundingRadius * 0.85f));
                                }
                                else if (target.IsFacing(Player))
                                {
                                    startPos = target.ServerPosition.Extend(
                                        Player.ServerPosition, -(lTarget.BoundingRadius * 0.85f));
                                }
                                else
                                {
                                    startPos = cCastPos;
                                }
                            }
                            if (startPos.Distance(Player.ServerPosition) > E.Range)
                            {
                                startPos = Player.ServerPosition.Extend(startPos, E.Range);
                            }
                            if (target.Path.Length > 0)
                            {
                                endPos = startPos.Extend(target.Path[0], ELength);
                            }
//.........这里部分代码省略.........
开发者ID:zombiesing,项目名称:LeagueSharp-Standalones,代码行数:101,代码来源:Viktor.cs

示例7: CastQ

        private void CastQ(string source)
        {

            if (!Q.IsReady())
                return;

            var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);

            if (target != null && target.IsValidTarget(Q.Range))
            {
                SpellCastManager.CastBasicSkillShot(Q, Q.Range, TargetSelector.DamageType.Magical, HitChanceManager.GetQHitChance(source));
            }

            target = TargetSelector.GetTarget(QExtend.Range, TargetSelector.DamageType.Physical);

            if (target == null)
                return;

            var pred = QExtend.GetPrediction(target, true);
            var collisions = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);

            if (!collisions.Any())
                return;

            foreach (var minion in collisions)
            {
                var poly = new Geometry.Polygon.Rectangle(Player.ServerPosition, Player.ServerPosition.Extend(minion.ServerPosition, QExtend.Range), QExtend.Width);

                if (poly.IsInside(pred.UnitPosition))
                {
                    if (Q.Cast(minion) == Spell.CastStates.SuccessfullyCasted)
                    {
                        Q.LastCastAttemptT = Utils.TickCount;
                        return;
                    }
                }
            }
        }
开发者ID:leenam0910,项目名称:LSharp,代码行数:38,代码来源:Lissandra.cs

示例8: ExtendedQ

        /// <summary>
        ///     TODO The extended q.
        /// </summary>
        /// <param name="mode">
        ///     TODO The mode.
        /// </param>
        private static void ExtendedQ(Mode mode)
        {
            if (
                !MenuHelper.IsMenuEnabled(
                    "com.idzlucian." + MenuHelper.GetFullNameFromMode(mode).ToLowerInvariant() + ".useextendedq")
                || ObjectManager.Player.ManaPercent
                < MenuHelper.GetSliderValue(
                    "com.idzlucian.manamanager.qmana" + MenuHelper.GetStringFromMode(mode).ToLowerInvariant()))
            {
                return;
            }

            var target = TargetSelector.GetTarget(Spells[SpellSlot.Q].Range, TargetSelector.DamageType.Physical);
            var targetExtended = TargetSelector.GetTarget(qExtended.Range, TargetSelector.DamageType.Physical);
            if (target.IsValidTarget(Spells[SpellSlot.Q].Range) || !targetExtended.IsValidTarget(qExtended.Range)
                || (HasPassive() && Orbwalking.InAutoAttackRange(target)))
            {
                return;
            }

            var targetPrediction = qExtended.GetPrediction(targetExtended).UnitPosition.To2D();
            var minions = MinionManager.GetMinions(
                player.ServerPosition, 
                Spells[SpellSlot.Q].Range, 
                MinionTypes.All, 
                MinionTeam.NotAlly);

            if (!minions.Any() || !targetExtended.IsMoving)
            {
                return;
            }

            if (MenuHelper.IsMenuEnabled("com.idzlucian.misc.noextq." + targetExtended.ChampionName.ToLowerInvariant()) && mode == Mode.Harass)
            {
                return;
            }

            // Credits xSalice
            foreach (var minion in minions)
            {
                var polygon = new Geometry.Polygon.Rectangle(
                    player.ServerPosition, 
                    player.ServerPosition.Extend(minion.ServerPosition, qExtended.Range), 
                    qExtended.Width);

                if (polygon.IsInside(targetPrediction)
                    && Spells[SpellSlot.Q].Cast(minion) == Spell.CastStates.SuccessfullyCasted)
                {
                    Spells[SpellSlot.Q].LastCastAttemptT = Environment.TickCount;
                }
            }
        }
开发者ID:firas500,项目名称:LSharpDZiJava,代码行数:58,代码来源:iDZLucian.cs

示例9: OnGameUpdate

        private static void OnGameUpdate(EventArgs args)
        {
            try
            {
                if (Player.IsDead) return;
                var QTarget = TargetSelector.GetTarget(_Q.Range, TargetSelector.DamageType.Magical);
                var WTarget = TargetSelector.GetTarget(_W.Range, TargetSelector.DamageType.Magical);
                var RTarget = TargetSelector.GetTarget(_R.Range, TargetSelector.DamageType.Magical);
                // Flee
                if (_MainMenu.Item("Nami_Flee").GetValue<KeyBind>().Active)
                {
                    MovingPlayer(Game.CursorPos);
                    if (_E.IsReady())
                        _E.CastOnUnit(Player, true);
                    if (_Q.IsReady() && QTarget != null && _Q.GetPrediction(QTarget).Hitchance >= HitChance.Low)
                        _Q.CastIfHitchanceEquals(QTarget, _Q.GetPrediction(QTarget).Hitchance, true);
                }

                // Auto W Heal
                if (_MainMenu.Item("Nami_HealWMinEnable").GetValue<bool>())
                {
                    var Ally = HeroManager.Allies.FirstOrDefault(f => f.Position.Distance(Player.Position) <= _W.Range && !f.IsDead
                    && f.HealthPercent <= _MainMenu.Item("Nami_HealWMin").GetValue<Slider>().Value
                    && !f.InFountain(Utility.FountainType.OwnFountain));
                    if (Ally != null && !Ally.IsRecalling())
                    {
                        _W.CastOnUnit(Ally, true);
                        //Game.PrintChat("local 1");
                    }
                        
                }

                //KillSteal
                if (_MainMenu.Item("Nami_KUse_W").GetValue<bool>())
                    if (_W.IsReady() && WTarget != null)
                        if (WTarget.Health < _W.GetDamage(WTarget))
                            _W.CastOnUnit(WTarget, true);
                if (_MainMenu.Item("Nami_KUse_Q").GetValue<bool>())
                    if (_Q.IsReady() && QTarget != null)
                        if (QTarget.Health < _Q.GetDamage(QTarget))
                            if (_Q.GetPrediction(QTarget).Hitchance >= HitChance.Medium)
                                _Q.CastIfHitchanceEquals(QTarget, HitChance.Medium, true);
                //Auto R 
                if (_MainMenu.Item("Nami_CUse_MinR1").GetValue<bool>() && _R.IsReady())
                {
                    var Enemy = HeroManager.Enemies.OrderBy(f => f.Distance(Player.Position));
                    if (Enemy != null)
                    {
                        foreach (var item in Enemy)
                        {
                            if (item.Position.Distance(Player.Position) < _R.Range && !item.IsDead)
                            {
                                var RRange = new Geometry.Polygon.Rectangle(Player.Position, Player.Position.Extend(item.Position, +1200), 250);
                                var Count = HeroManager.Enemies.Where(f => f.Distance(Player.Position) <= 1500).Count(f => RRange.IsInside(f.Position));
                                if (Count >= _MainMenu.Item("Nami_CUse_MinR").GetValue<Slider>().Value)
                                {
                                    _R.Cast(item.Position, true);
                                    return;
                                }
                            }
                        }
                    }
                }

                // Combo
                if (_MainMenu.Item("CKey").GetValue<KeyBind>().Active)
                {
                    if (_MainMenu.Item("Nami_CUse_Q").GetValue<bool>())
                        if (QTarget != null)
                            if (_Q.IsReady())
                                if (_Q.GetPrediction(QTarget).Hitchance >= HitChance.Medium)
                                {
                                    _Q.CastIfHitchanceEquals(QTarget, _Q.GetPrediction(QTarget).Hitchance, true);
                                    return;
                                }
                    if (_MainMenu.Item("Nami_CUse_W").GetValue<bool>() && _W.IsReady())
                    {
                        // W to Ally 
                        foreach (var item in HeroManager.Allies.OrderByDescending(f => f.Health))
                        {
                            if (item.Position.Distance(Player.Position) <= _W.Range)
                                if ((HeroManager.Enemies.FirstOrDefault(f => f.Position.Distance(item.Position) <= _W.Range - 50 && !f.IsDead) != null))
                                {
                                    _W.CastOnUnit(item, true);
                                    //Game.PrintChat("local 2");
                                    return;
                                }
                        }
                        if (WTarget != null && WTarget.Position.Distance(Player.Position) <= _W.Range)
                        {
                            _W.CastOnUnit(WTarget, true);
                            //Game.PrintChat("local 3");
                        }                            
                    }
                    if (_MainMenu.Item("Nami_CUse_R").GetValue<bool>() && _R.IsReady() && RTarget != null)
                        if (RTarget.Distance(Player.Position) <= 1300)
                            if (_R.GetPrediction(RTarget).Hitchance >= HitChance.Medium)
                                _R.CastIfHitchanceEquals(RTarget, _R.GetPrediction(RTarget).Hitchance);
                }

//.........这里部分代码省略.........
开发者ID:NaviFly,项目名称:LeagueSharp,代码行数:101,代码来源:Nami.cs

示例10: OnProcessSpell

        private static void OnProcessSpell(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {
                if (!(sender is Obj_AI_Hero) || Player.IsRecalling())
                    return;
                // Auto W
                if (_MainMenu.Item("Braum_AutoW").GetValue<bool>() && _W.IsReady())
                {
                    if (!(sender is Obj_AI_Hero) || !sender.IsEnemy)
                        return;
                    if (args.Target != null)
                        if (args.SData.Name.ToLower().Contains("attack") && args.Target.Position.Distance(Player.Position) < _W.Range)
                            if (args.Target.IsAlly && args.Target is Obj_AI_Hero)
                            {
                                if (args.Target.IsMe && Player.HealthPercent < 20)
                                {
                                    _W.CastOnUnit((Obj_AI_Base)args.Target, true);
                                }
                                else
                                {
                                    _W.CastOnUnit((Obj_AI_Base)args.Target, true);
                                }
                            }
                }
                // Auto E
                if (_MainMenu.Item("Braum_AutoE").GetValue<bool>() && _E.IsReady())
                {
                    if (!(sender is Obj_AI_Hero) || !sender.IsEnemy || !Orbwalking.CanAttack())
                        return;
                    var enemyskill = new Geometry.Polygon.Rectangle(args.Start, args.End, args.SData.BounceRadius + 20);
                    var myteam = HeroManager.Allies.Where(f => f.Distance(Player.Position) < 200);
                    var count = myteam.Count(f => enemyskill.IsInside(f.Position));
                    if (args.Target != null && args.Target.Position.Distance(Player.Position) < 200)
                    {
                        if (args.Target.Name == Player.Name && Player.HealthPercent < 20)
                        {
                            _E.Cast(sender.Position, true);
                        }
                        else if (args.Target.Position.Distance(Player.Position) < 200 && args.Target is Obj_AI_Hero)
                        {
                            if (_W.IsReady() && args.Target.Position.Distance(Player.Position) < _W.Range)
                                _W.CastOnUnit((Obj_AI_Base)args.Target, true);
                            _E.Cast(sender.Position, true);
                        }
                    }
                    else if (args.Target == null)
                    {
                        if (Player.HealthPercent < 20 && count == 1)
                        {
                            _E.Cast(sender.Position, true);
                        }
                        else if (count >= 2)
                        {
                            _E.Cast(sender.Position, true);
                        }
                    }
                }
            }
            catch (Exception)
            {
                if (NowTime() > ErrorTime)
                {
                    Game.PrintChat(ChampName + " in FreshBooster isn't Load. Error Code 08");
                    ErrorTime = TickCount(10000);
                }
            }

        }
开发者ID:NaviFly,项目名称:LeagueSharp,代码行数:69,代码来源:Braum.cs

示例11: AutoKick

        private static void AutoKick()
        {
            if (MainMenu._MainMenu.Item("AutoKick").GetValue<Slider>().Value == 0 || MainMenu._MainMenu.Item("InsecKick").GetValue<KeyBind>().Active) return;

            var target =
                HeroManager.Enemies.Where(x => x.Distance(Player) < 375 && !x.IsDead && x.IsValidTarget(375))
                    .OrderBy(x => x.Distance(Player)).FirstOrDefault();
            if (target == null) return;

            var ultPoly = new Geometry.Polygon.Rectangle(Player.ServerPosition,
                Player.ServerPosition.Extend(target.Position, 1100),
                target.BoundingRadius + 10);

            var count =
                HeroManager.Enemies.Where(x => x.Distance(Player) < 1100 && x.IsValidTarget(1100))
                    .Count(h => h.NetworkId != target.NetworkId && ultPoly.IsInside(h.ServerPosition));

            if (count >= MainMenu._MainMenu.Item("AutoKick").GetValue<Slider>().Value && _R.IsReady())
            {
                _R.Cast(target);
            }
        }
开发者ID:qq2128969,项目名称:LeagueSharp,代码行数:22,代码来源:Program.cs

示例12: Drawing_OnDraw

        protected override void Drawing_OnDraw(EventArgs args)
        {
            if (menu.Item("Draw_Disabled", true).GetValue<bool>())
                return;

            if (menu.Item("Draw_Q", true).GetValue<bool>())
                if (Q.Level > 0)
                    Render.Circle.DrawCircle(Player.Position, Q.Range, Q.IsReady() ? Color.Green : Color.Red);
            if (menu.Item("Draw_QE", true).GetValue<bool>())
                if (Q.Level > 0 && E.Level > 0)
                    Render.Circle.DrawCircle(Player.Position, _qe.Range, Q.IsReady() && E.IsReady() ? Color.Green : Color.Red);
            if (menu.Item("Draw_W", true).GetValue<bool>())
                if (W.Level > 0)
                    Render.Circle.DrawCircle(Player.Position, W.Range, W.IsReady() ? Color.Green : Color.Red);

            if (menu.Item("Draw_E", true).GetValue<bool>())
                if (E.Level > 0)
                    Render.Circle.DrawCircle(Player.Position, E.Range, E.IsReady() ? Color.Green : Color.Red);

            if (menu.Item("Draw_R", true).GetValue<bool>())
                if (R.Level > 0)
                    Render.Circle.DrawCircle(Player.Position, R.Range, R.IsReady() ? Color.Green : Color.Red);

            if (Get_Current_Orb() != null)
                Render.Circle.DrawCircle(Get_Current_Orb().Position, W.Width, Color.Green);

            //draw EQ
            if (menu.Item("Draw_QE_Line", true).GetValue<bool>())
            {
                var qeTarget = TargetSelector.GetTarget(_qe.Range, TargetSelector.DamageType.Magical);
                if (qeTarget == null || !Q.IsReady() || !E.IsReady())
                    return;

                var qTarget = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical);
                if (qTarget.IsValidTarget(E.Range))
                {
                    var pred = Q.GetPrediction(qTarget);

                    if (pred.Hitchance >= HitChanceManager.GetQEHitChance("Combo"))
                    {
                        var poly = new Geometry.Polygon.Rectangle(pred.CastPosition, Player.ServerPosition.Extend(pred.CastPosition, _qe.Range), _qe.Width);
                        poly.Draw(Color.LawnGreen);
                        var line = new Geometry.Polygon.Line(Player.Position, Player.ServerPosition.Extend(pred.CastPosition, _qe.Range));
                        line.Draw(Color.LawnGreen);
                        Render.Circle.DrawCircle(pred.CastPosition, Q.Width / 2, Color.Aquamarine);
                        Render.Circle.DrawCircle(Player.ServerPosition.Extend(pred.CastPosition, _qe.Range), Q.Width / 2, Color.SpringGreen);
                    }
                }
                else
                {
                    var startPos = Player.ServerPosition.To2D().Extend(qeTarget.ServerPosition.To2D(), Q.Range).To3D();
                    double rangeLeft = 100 + (-0.6 * Player.Distance(startPos) + 950);
                    var endPos = startPos + Vector3.Normalize(startPos - Player.ServerPosition) * (float)rangeLeft;

                    _qe.From = startPos;
                    _qe.Delay = E.Delay + Q.Range / E.Speed;

                    var qePred = _qe.GetPrediction(qeTarget);

                    var poly = new Geometry.Polygon.Rectangle(startPos, endPos, _qe.Width);

                    if (!poly.IsInside(qePred.UnitPosition))
                        return;

                    if (qePred.Hitchance >= HitChanceManager.GetQEHitChance("Combo"))
                    {
                        poly.Draw(Color.LawnGreen);
                        var line = new Geometry.Polygon.Line(Player.Position, endPos);
                        line.Draw(Color.LawnGreen);
                        Render.Circle.DrawCircle(startPos, Q.Width/2, Color.Aquamarine);
                        Render.Circle.DrawCircle(endPos, Q.Width/2, Color.SpringGreen);
                    }
                }
            }

            if (menu.Item("Draw_R_Killable", true).GetValue<bool>() && R.IsReady())
            {
                foreach (var wts in from unit in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(2000) && !x.IsDead && x.IsEnemy).OrderByDescending(GetComboDamage)
                                    let health = unit.Health + unit.HPRegenRate + 10
                                    where Get_Ult_Dmg(unit) > health
                                    select Drawing.WorldToScreen(unit.Position))
                {
                    Drawing.DrawText(wts[0] - 20, wts[1], Color.White, "KILL!!!");
                }
            }
        }
开发者ID:leenam0910,项目名称:LSharp,代码行数:86,代码来源:Syndra.cs

示例13: Game_OnUpdate

        private void Game_OnUpdate(EventArgs args)
        {
            if (UnderClocking.NeedtoUnderClocking())
                return;

            if (!ObjectManager.Player.IsDead)
                if (Orbwalking.CanMove(100))
                {
                    switch (MenuProvider.Orbwalker.ActiveMode)
                    {
                        case Orbwalking.OrbwalkingMode.Combo:
                            {
                                if (MenuProvider.Champion.Combo.UseQ)
                                    if (Q.isReadyPerfectly())
                                        if (!ObjectManager.Player.IsDashing())
                                            if (HasPassive == false)
                                            {
                                                var Target = TargetSelector.GetTarget(Q.Range, Q.DamageType);
                                                if (Target != null)
                                                    Q.CastOnUnit(Target);
                                                else
                                                {
                                                    var ExtendedTarget = TargetSelector.GetTarget(QExtended.Range, Q.DamageType);
                                                    if (ExtendedTarget != null)
                                                    {
                                                        var Minions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);
                                                        foreach (var Minion in Minions)
                                                        {
                                                            var BOX = new Geometry.Polygon.Rectangle(ObjectManager.Player.ServerPosition, ObjectManager.Player.ServerPosition.Extend(Minion.ServerPosition, QExtended.Range), QExtended.Width);
                                                            if (BOX.IsInside(QExtended.GetPrediction(ExtendedTarget).UnitPosition))
                                                            {
                                                                Q.CastOnUnit(Minion);
                                                                break;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                var killableTarget = HeroManager.Enemies.FirstOrDefault(x => x.isKillableAndValidTarget(Q.GetDamage(x), TargetSelector.DamageType.Physical, Q.Range));
                                                if (killableTarget != null)
                                                    Q.CastOnUnit(killableTarget);
                                            }

                                if (MenuProvider.Champion.Combo.UseW)
                                    if (W.isReadyPerfectly())
                                        if (!ObjectManager.Player.IsDashing())
                                            if (HasPassive == false)
                                            {
                                                if (HeroManager.Enemies.Any(x => Orbwalking.InAutoAttackRange(x)))
                                                    WNoCollision.CastOnBestTarget();
                                                else
                                                {
                                                    var Target = TargetSelector.GetTargetNoCollision(W);
                                                    if (Target != null)
                                                        W.Cast(Target);
                                                }
                                            }
                                            else
                                            {
                                                var killableTarget = HeroManager.Enemies.FirstOrDefault(x => x.isKillableAndValidTarget(W.GetDamage(x), TargetSelector.DamageType.Physical, W.Range) && W.GetPrediction(x).Hitchance >= HitChance.High);
                                                if (killableTarget != null)
                                                    W.Cast(killableTarget);
                                            }

                                break;
                            }
                        case Orbwalking.OrbwalkingMode.Mixed:
                            {
                                if (MenuProvider.Champion.Harass.UseQ)
                                    if (HasPassive == false)
                                        if (Q.isReadyPerfectly())
                                            if (!ObjectManager.Player.IsDashing())
                                                if (ObjectManager.Player.isManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                                                {
                                                    var Target = TargetSelector.GetTarget(Q.Range, Q.DamageType);
                                                    if (Target != null)
                                                        Q.CastOnUnit(Target);
                                                    else
                                                    {
                                                        var ExtendedTarget = TargetSelector.GetTarget(QExtended.Range, Q.DamageType);
                                                        if (ExtendedTarget != null)
                                                        {
                                                            var Minions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);
                                                            foreach (var Minion in Minions)
                                                            {
                                                                var BOX = new Geometry.Polygon.Rectangle(ObjectManager.Player.ServerPosition, ObjectManager.Player.ServerPosition.Extend(Minion.ServerPosition, QExtended.Range), QExtended.Width);
                                                                if (BOX.IsInside(QExtended.GetPrediction(ExtendedTarget).UnitPosition))
                                                                {
                                                                    Q.CastOnUnit(Minion);
                                                                    break;
                                                                }
                                                            }
                                                        }
                                                    }
                                                }

                                if (MenuProvider.Champion.Harass.UseW)
                                    if (W.isReadyPerfectly())
//.........这里部分代码省略.........
开发者ID:BlueSun99,项目名称:LeagueSharp-2,代码行数:101,代码来源:Lucian.cs

示例14: Cast_QE

        private void Cast_QE(string source, Obj_AI_Base target = null)
        {
            var qeTarget = TargetSelector.GetTarget(_qe.Range, TargetSelector.DamageType.Magical);
            if (qeTarget == null || !Q.IsReady() || !E.IsReady())
                return;

            var qTarget = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical);
            if (qTarget.IsValidTarget(E.Range))
            {
                var pred = Q.GetPrediction(qTarget);

                if (pred.Hitchance >= HitChanceManager.GetQEHitChance(source))
                {
                    Q.Cast(pred.CastPosition);
                    W.LastCastAttemptT = Utils.TickCount + 500;
                    _qe.LastCastAttemptT = Utils.TickCount;
                }
            }
            else
            {
                var startPos = Player.ServerPosition.To2D().Extend(qeTarget.ServerPosition.To2D(), Q.Range).To3D();
                double rangeLeft = 100 + (-0.6*Player.Distance(startPos) + 950);
                var endPos = startPos + Vector3.Normalize(startPos - Player.ServerPosition)*(float) rangeLeft;

                _qe.From = startPos;
                _qe.Delay = E.Delay + Q.Range / E.Speed;

                var qePred = _qe.GetPrediction(qeTarget);

                var poly = new Geometry.Polygon.Rectangle(startPos, endPos, _qe.Width);

                if (!poly.IsInside(qePred.UnitPosition))
                    return;

                poly.Draw(Color.LawnGreen);

                if (qePred.Hitchance >= HitChanceManager.GetQEHitChance(source))
                {
                    Q.Cast(startPos);
                    W.LastCastAttemptT = Utils.TickCount + 500;
                    _qe.LastCastAttemptT = Utils.TickCount;
                }
            }
        }
开发者ID:leenam0910,项目名称:LSharp,代码行数:44,代码来源:Syndra.cs

示例15: GetQHits

 private int GetQHits(Obj_AI_Hero target, HitChance hitChance)
 {
     if (target == null)
     {
         return 0;
     }
     var totalHits = 0;
     try
     {
         var pred = Q.GetPrediction(target);
         if (pred.Hitchance >= hitChance)
         {
             var enemies =
                 GameObjects.EnemyHeroes.Where(e => e.IsValidTarget((Q.Range + Q.Width) * 1.2f)).ToList();
             var rect = new Geometry.Polygon.Rectangle(
                 ObjectManager.Player.Position.To2D(),
                 ObjectManager.Player.Position.Extend(pred.CastPosition, Q.ChargedMaxRange * 0.85f).To2D(),
                 Q.Width);
             totalHits = 1 + (from enemy in enemies.Where(e => e.NetworkId != target.NetworkId)
                 let pred2 = Q.GetPrediction(enemy)
                 where pred2.Hitchance >= (hitChance - 1)
                 where
                     new Geometry.Polygon.Circle(pred2.UnitPosition, enemy.BoundingRadius * 0.9f).Points.Any(
                         p => rect.IsInside(p))
                 select enemy).Count();
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return totalHits;
 }
开发者ID:bigback,项目名称:LeagueSharp-Dev,代码行数:33,代码来源:Varus.cs


注:本文中的LeagueSharp.Common.Geometry.Polygon.Rectangle.IsInside方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。