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


C# Spell.IsInRange方法代码示例

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


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

示例1: Minions

            public static Vector2 Minions(Spell spell, MobTypes mobTypes = MobTypes.All, int minMobCount = 1)
            {
                var rangedMinionsE = LeagueSharp.Common.MinionManager.GetMinions(
                    ObjectManager.Player.ServerPosition,
                    Spells.E.Range);

                var minionsE = Spells.E.GetCircularFarmLocation(rangedMinionsE, spell.Range);
                if (minionsE.MinionsHit < minMobCount || !spell.IsInRange(minionsE.Position))
                {
                    return new Vector2();
                }

                return minionsE.Position;
            }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:14,代码来源:Utils.cs

示例2: GetCircularFarmLocation

            public static Vector2 GetCircularFarmLocation(Spell spell, MobTypes mobTypes = MobTypes.All,
                int minMobCount = 1)
            {
                var cVector = new Vector2();
                var rangedMinionsE = LeagueSharp.Common.MinionManager.GetMinions(ObjectManager.Player.ServerPosition,
                    spell.Range);

                var minionsE = spell.GetCircularFarmLocation(rangedMinionsE, spell.Range);
                if (minionsE.MinionsHit > minMobCount && spell.IsInRange(minionsE.Position))
                {
                    cVector = minionsE.Position;
                }

                return cVector;
            }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:15,代码来源:Utils.cs

示例3: SpellPrediction

        public static bool SpellPrediction(Spell spell, Obj_AI_Hero target,bool collisionable)
        {
            //
            var dist = ObjectManager.Player.Distance(target.Position);
            var pos1 = LeagueSharp.Common.Prediction.GetPrediction(target, dist / spell.Speed).UnitPosition;
            var e = pos1.Distance(target.GetWaypoints()[1].To3D());

            pos1.Extend(target.GetWaypoints()[1].To3D(), -e);
            Render.Circle.DrawCircle(pos1, 10, System.Drawing.Color.BlueViolet, 2);
            //
            var point = PointsAroundTheTarget(target.Position, target.BoundingRadius + 50).FirstOrDefault(t => t.IsWall());
            if (point.X != 0 && point.Y != 0 && point.Z != 0)
            {
                if (MinionCollideLine(ObjectManager.Player.Position, ExtendWallpos(target, point), spell,collisionable)) return false;

                Render.Circle.DrawCircle(ExtendWallpos(target, point), 10, System.Drawing.Color.Brown, 2);
                spell.Cast(ExtendWallpos(target, point));
                return true;
            }
            else
            {
                var range = spell.Range;
                if (target.Position.Distance(ObjectManager.Player.Position) < target.GetWaypoints()[1].Distance(ObjectManager.Player.Position))
                {
                    range -= 100;
                }

                if (!spell.IsInRange(target, range)) return false;

                if (target.IsFacing(ObjectManager.Player) && target.Position.Distance(ObjectManager.Player.Position) > target.GetWaypoints()[1].Distance(ObjectManager.Player.Position))
                {
                  if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
                        spell.Cast(target.Position);
                        return true;

                }
               // float speed =
                if (target.IsImmovable) // check for cc guys
                {
                    if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
                    spell.Cast(target.Position);
                    return true;
                }

              //  if(target.IsChannelingImportantSpell())
                if (target.IsWindingUp && !target.IsMelee())
                {
                    if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
                    spell.Cast(target.Position);
                    return true;
                }

                if (target.Position.Distance(ObjectManager.Player.Position) <= 300)
                {
                    CastToDirection( target, spell,collisionable);
                }
                else
                {
                    var oldPos = target.GetWaypoints()[0].To3D();
                   var h = false;
                    Utility.DelayAction.Add(Game.Ping + 1000, () => h = Next(target, oldPos, spell,collisionable));
                    return h;
                }
            }
            return false;
        }
开发者ID:1550441149,项目名称:zeroRepository,代码行数:66,代码来源:Prediction.cs

示例4: SpellPrediction

        public static bool SpellPrediction(Spell spell, Obj_AI_Hero target,bool collisionable)
        {
            //
            var dist = ObjectManager.Player.Distance(target.Position);
            var pos1 = LeagueSharp.Common.Prediction.GetPrediction(target, dist / spell.Speed).UnitPosition-40;
            var dister = target.Position.Extend(target.GetWaypoints()[1].To3D(), target.GetWaypoints()[1].To3D().Distance(target.Position) + 50);
              //  var pos1 = LeagueSharp.Common.Prediction.GetPrediction(target, dist / spell.Speed).UnitPosition - 40;
            var wts = Drawing.WorldToScreen(target.Position);
            var wtsx = target.GetWaypoints()[1];
            Drawing.DrawLine(wts[0], wts[1], wtsx[0], wtsx[1], 2f, System.Drawing.Color.Red);
            var e = pos1.Distance(target.GetWaypoints()[1].To3D());

            pos1.Extend(target.GetWaypoints()[1].To3D(), -e);
            Render.Circle.DrawCircle(dister, 10, System.Drawing.Color.GreenYellow, 2);
            Render.Circle.DrawCircle(pos1, 10, System.Drawing.Color.BlueViolet, 2);
            //
            var point = PointsAroundTheTarget(target.Position, target.BoundingRadius + 50).FirstOrDefault(t => t.IsWall());
            if (point.X != 0 && point.Y != 0 && point.Z != 0)
            {
                if (MinionCollideLine(ObjectManager.Player.Position, ExtendWallpos(target, point), spell,collisionable)) return false;

                Render.Circle.DrawCircle(ExtendWallpos(target, point), 10, System.Drawing.Color.Brown, 2);
                spell.Cast(ExtendWallpos(target, point));
                return true;
            }
            else
            {
                var range = spell.Range;
                if (target.Position.Distance(ObjectManager.Player.Position) < target.GetWaypoints()[1].Distance(ObjectManager.Player.Position))
                {
                    range -= 100;
                }

                if (!spell.IsInRange(target, range)) return false;

                /*if (target.IsFacing(ObjectManager.Player) && target.Position.Distance(ObjectManager.Player.Position) > target.GetWaypoints()[1].Distance(ObjectManager.Player.Position))
                {
                  if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;

                    {
                        Game.PrintChat("Casteando por inface");
                       spell.Cast(target.Position);

                        return true;
                    }

                }*/
                // code of dashes
                if (target.IsDashing())
                {
                    float timeforArrive=(target.Position.Distance(target.GetDashInfo().EndPos.To3D()))/target.GetDashInfo().Speed;
                    float grabtime =( ObjectManager.Player.Position.Distance(target.GetDashInfo().EndPos.To3D())
                                     / spell.Speed)+spell.Delay;
                    if (timeforArrive<grabtime)
                    {
                        spell.Cast(target.GetDashInfo().EndPos);
                        return true;
                    }
                }
               /* if (target.IsImmovable) // check for cc guys
                {
                    if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
                    spell.Cast(target.Position);
                    return true;
                }*/

              //  if(target.IsChannelingImportantSpell())
                if (target.IsWindingUp && !target.IsMelee())
                {
                    if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
                    spell.Cast(target.Position);
                    return true;
                }

                if (target.Position.Distance(ObjectManager.Player.Position) <= 300)
                {
                    CastToDirection( target, spell,collisionable);
                }
                else
                {
                    var oldPos = target.GetWaypoints()[0].To3D();
                   var h = false;
                    Utility.DelayAction.Add(Game.Ping + 1000, () => h = Next(target, oldPos, spell,collisionable));
                    return h;
                }
            }
            return false;
        }
开发者ID:kga321,项目名称:zeroRepository,代码行数:88,代码来源:Prediction.cs

示例5: SmiteCollision

 public static bool SmiteCollision(Obj_AI_Hero Target, Spell Skill)
 {
     if (!SmiteReady()) return false;
     var ListCol = Skill.GetPrediction(Target).CollisionObjects.Where(i => IsValid(i, Skill.Range) && Skill.WillHit(i.Position, Target.Position, (int)i.BoundingRadius));
     if (Skill.IsInRange(Target.Position) && ListCol.Count() == 1)
     {
         if (ListCol.First() is Obj_AI_Minion && CastSmite(ListCol.First()))
         {
             Skill.Cast(Target.Position);
             return true;
         }
     }
     return false;
 }
开发者ID:fgpmaia,项目名称:Lsharp,代码行数:14,代码来源:LeeSin.cs

示例6: getMinionsOnRange

 public Obj_AI_Base getMinionsOnRange(Spell spell)
 {
     return  ObjectManager.Get<Obj_AI_Base>().Where(x => spell.IsInRange(x)).MinOrDefault(x => x.Distance(Game.CursorPos));
 }
开发者ID:nethd1988,项目名称:zeroRepository,代码行数:4,代码来源:Modes.cs


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