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


C# ezEvade.PositionInfo类代码示例

本文整理汇总了C#中ezEvade.PositionInfo的典型用法代码示例。如果您正苦于以下问题:C# PositionInfo类的具体用法?C# PositionInfo怎么用?C# PositionInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PositionInfo类属于ezEvade命名空间,在下文中一共展示了PositionInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SpellDetector_OnProcessDetectedSpells

        private void SpellDetector_OnProcessDetectedSpells()
        {
            ObjectCache.myHeroCache.UpdateInfo();

            if (ObjectCache.menuCache.cache["DodgeSkillShots"].Cast<KeyBind>().CurrentValue == false)
            {
                lastPosInfo = PositionInfo.SetAllUndodgeable();
                EvadeSpell.UseEvadeSpell();
                return;
            }

            if (ObjectCache.myHeroCache.serverPos2D.CheckDangerousPos(0)
                || ObjectCache.myHeroCache.serverPos2DExtra.CheckDangerousPos(0))
            {
                if (EvadeSpell.PreferEvadeSpell())
                {
                    lastPosInfo = PositionInfo.SetAllUndodgeable();
                }
                else
                {
                    var calculationTimer = EvadeUtils.TickCount;

                    var posInfo = EvadeHelper.GetBestPosition();

                    var caculationTime = EvadeUtils.TickCount - calculationTimer;

                    if (numCalculationTime > 0)
                    {
                        sumCalculationTime += caculationTime;
                        avgCalculationTime = sumCalculationTime/numCalculationTime;
                    }
                    numCalculationTime += 1;

                    //Console.WriteLine("CalculationTime: " + caculationTime);

                    /*if (EvadeHelper.GetHighestDetectedSpellID() > EvadeHelper.GetHighestSpellID(posInfo))
                    {
                        return;
                    }*/
                    if (posInfo != null)
                    {
                        lastPosInfo = posInfo.CompareLastMovePos();

                        var travelTime = ObjectCache.myHeroCache.serverPos2DPing.Distance(lastPosInfo.position)/
                                         myHero.MoveSpeed;

                        lastPosInfo.endTime = EvadeUtils.TickCount + travelTime*1000 - 100;
                    }

                    CheckHeroInDanger();
                    DodgeSkillShots(); //walking
                    CheckLastMoveTo();
                    EvadeSpell.UseEvadeSpell(); //using spells
                }
            }
            else
            {
                lastPosInfo = PositionInfo.SetAllDodgeable();
                CheckLastMoveTo();
            }

            //Console.WriteLine("SkillsDodged: " + lastPosInfo.dodgeableSpells.Count + " DangerLevel: " + lastPosInfo.undodgeableSpells.Count);
        }
开发者ID:GodLS,项目名称:EloBuddy-Addons,代码行数:63,代码来源:Evade.cs

示例2: Game_OnCastSpell

        private void Game_OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args)
        {
            if (!spellbook.Owner.IsMe)
                return;

            var sData = spellbook.GetSpell(args.Slot);
            string name;

            if (SpellDetector.channeledSpells.TryGetValue(sData.Name, out name))
            {
                //Evade.isChanneling = true;
                //Evade.channelPosition = ObjectCache.myHeroCache.serverPos2D;
                lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100;
            }

            if (EvadeSpell.lastSpellEvadeCommand != null &&
                EvadeSpell.lastSpellEvadeCommand.timestamp + ObjectCache.gamePing + 150 > EvadeUtils.TickCount)
            {
                args.Process = false;
            }

            lastSpellCast = args.Slot;
            lastSpellCastTime = EvadeUtils.TickCount;

            //moved from processPacket

            /*if (args.Slot == SpellSlot.Recall)
            {
                lastStopPosition = myHero.ServerPosition.To2D();
            }*/

            if (Situation.ShouldDodge())
            {
                if (isDodging && SpellDetector.spells.Count() > 0)
                {
                    foreach (KeyValuePair<String, SpellData> entry in SpellDetector.windupSpells)
                    {
                        SpellData spellData = entry.Value;

                        if (spellData.spellKey == args.Slot) //check if it's a spell that we should block
                        {
                            args.Process = false;
                            return;
                        }
                    }
                }
            }

            foreach (var evadeSpell in EvadeSpell.evadeSpells)
            {
                if (evadeSpell.isItem == false && evadeSpell.spellKey == args.Slot)
                {
                    if (evadeSpell.evadeType == EvadeType.Blink
                        || evadeSpell.evadeType == EvadeType.Dash)
                    {
                        //Block spell cast if flashing/blinking into spells
                        if (args.EndPosition.To2D().CheckDangerousPos(6, true)) //for blink + dash
                        {
                            args.Process = false;
                            return;
                        }

                        if (evadeSpell.evadeType == EvadeType.Dash)
                        {
                            var extraDelayBuffer =
                                ObjectCache.menuCache.cache["ExtraPingBuffer"].Cast<Slider>().CurrentValue;
                            var extraDist = ObjectCache.menuCache.cache["ExtraCPADistance"].Cast<Slider>().CurrentValue;

                            var dashPos = Game.CursorPos.To2D(); //real pos?

                            if (evadeSpell.fixedRange)
                            {
                                var dir = (dashPos - myHero.ServerPosition.To2D()).Normalized();
                                dashPos = myHero.ServerPosition.To2D() + dir*evadeSpell.range;
                            }

                            //Draw.RenderObjects.Add(new Draw.RenderPosition(dashPos, 1000));

                            var posInfo = EvadeHelper.CanHeroWalkToPos(dashPos, evadeSpell.speed,
                                extraDelayBuffer + ObjectCache.gamePing, extraDist);

                            if (posInfo.posDangerLevel > 0)
                            {
                                args.Process = false;
                                return;
                            }
                        }

                        lastPosInfo = PositionInfo.SetAllUndodgeable(); //really?

                        if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500)
                        {
                            EvadeCommand.MoveTo(Game.CursorPos.To2D()); //block moveto
                            lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100;
                        }
                    }
                    return;
                }
            }
        }
开发者ID:GodLS,项目名称:EloBuddy-Addons,代码行数:100,代码来源:Evade.cs

示例3: RecalculatePath

        private void RecalculatePath()
        {
            if (ObjectCache.menuCache.cache["RecalculatePosition"].Cast<CheckBox>().CurrentValue && isDodging) //recheck path
            {
                if (lastPosInfo != null && !lastPosInfo.recalculatedPath)
                {
                    var path = myHero.Path;
                    if (path.Length > 0)
                    {
                        var movePos = path.Last().To2D();

                        if (movePos.Distance(lastPosInfo.position) < 5) //more strict checking
                        {
                            var posInfo = EvadeHelper.CanHeroWalkToPos(movePos, ObjectCache.myHeroCache.moveSpeed, 0, 0,
                                false);
                            if (posInfo.posDangerCount > lastPosInfo.posDangerCount)
                            {
                                lastPosInfo.recalculatedPath = true;

                                if (EvadeSpell.PreferEvadeSpell())
                                {
                                    lastPosInfo = PositionInfo.SetAllUndodgeable();
                                }
                                else
                                {
                                    var newPosInfo = EvadeHelper.GetBestPosition();
                                    if (newPosInfo.posDangerCount < posInfo.posDangerCount)
                                    {
                                        lastPosInfo = newPosInfo;
                                        CheckHeroInDanger();
                                        DodgeSkillShots();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
开发者ID:GodLS,项目名称:EloBuddy-Addons,代码行数:39,代码来源:Evade.cs

示例4: GetBestPositionTargetedDash

        public static PositionInfo GetBestPositionTargetedDash(EvadeSpellData spell)
        {
            /*if (spell.spellDelay > 0)
            {
                if (CheckWindupTime(spell.spellDelay))
                {
                    return null;
                }
            }*/

            var extraDelayBuffer = ObjectCache.menuCache.cache["ExtraPingBuffer"].Cast<Slider>().CurrentValue;
            //var extraEvadeDistance = 100;// Evade.menu.SubMenu("MiscSettings").SubMenu("ExtraBuffers").Item("ExtraEvadeDistance").GetValue<Slider>().Value;
            var extraDist = ObjectCache.menuCache.cache["ExtraCPADistance"].Cast<Slider>().CurrentValue;

            Vector2 heroPoint = ObjectCache.myHeroCache.serverPos2DPing;
            Vector2 lastMovePos = Game.CursorPos.To2D();

            List<PositionInfo> posTable = new List<PositionInfo>();
            List<int> spellList = SpellDetector.GetSpellList();

            int minDistance = 50; //Math.Min(spell.range, minDistance)
            int maxDistance = int.MaxValue;

            if (spell.fixedRange)
            {
                minDistance = maxDistance = (int)spell.range;
            }

            List<Obj_AI_Base> collisionCandidates = new List<Obj_AI_Base>();

            if (spell.spellTargets.Contains(SpellTargets.Targetables))
            {
                foreach (var obj in ObjectManager.Get<Obj_AI_Base>()
                    .Where(h => !h.IsMe && h.IsValidTarget(spell.range, false)))
                {
                    if (obj.GetType() == typeof(Obj_AI_Turret) && ((Obj_AI_Turret)obj).IsValid())
                    {
                        collisionCandidates.Add(obj);
                    }
                }
            }
            else
            {
                List<AIHeroClient> heroList = new List<AIHeroClient>();

                if (spell.spellTargets.Contains(SpellTargets.EnemyChampions)
                    && spell.spellTargets.Contains(SpellTargets.AllyChampions))
                {
                    heroList = EntityManager.Heroes.AllHeroes;
                }
                else if (spell.spellTargets.Contains(SpellTargets.EnemyChampions))
                {
                    heroList = EntityManager.Heroes.Enemies;
                }
                else if (spell.spellTargets.Contains(SpellTargets.AllyChampions))
                {
                    heroList = EntityManager.Heroes.Allies;
                }

                foreach (var hero in heroList.Where(h => !h.IsMe && h.IsValidTarget(spell.range)))
                {
                    collisionCandidates.Add(hero);
                }

                List<Obj_AI_Minion> minionList = new List<Obj_AI_Minion>();

                if (spell.spellTargets.Contains(SpellTargets.EnemyMinions)
                    && spell.spellTargets.Contains(SpellTargets.AllyMinions))
                {
                    minionList = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Both, Player.Instance.ServerPosition, spell.range).ToList();
                }
                else if (spell.spellTargets.Contains(SpellTargets.EnemyMinions))
                {
                    minionList = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.Instance.ServerPosition, spell.range).ToList();
                }
                else if (spell.spellTargets.Contains(SpellTargets.AllyMinions))
                {
                    minionList = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Ally, Player.Instance.ServerPosition, spell.range).ToList();
                }

                foreach (var minion in minionList.Where(h => h.IsValidTarget(spell.range)))
                {
                    collisionCandidates.Add(minion);
                }
            }

            foreach (var candidate in collisionCandidates)
            {
                var pos = candidate.ServerPosition.To2D();

                PositionInfo posInfo;

                if (spell.spellName == "YasuoDashWrapper")
                {
                    bool hasDashBuff = false;

                    foreach (var buff in candidate.Buffs)
                    {
                        if (buff.Name == "YasuoDashWrapper")
                        {
//.........这里部分代码省略.........
开发者ID:CONANLXF,项目名称:AIO,代码行数:101,代码来源:EvadeHelper.cs

示例5: SetAllUndodgeable

 public static void SetAllUndodgeable()
 {
     lastPosInfo = PositionInfo.SetAllUndodgeable();
 }
开发者ID:GodLS,项目名称:EloBuddy-Addons,代码行数:4,代码来源:Evade.cs

示例6: PositionInfoStillValid

 public static bool PositionInfoStillValid(PositionInfo posInfo, float moveSpeed = 0)
 {
     return true; //too buggy
 }
开发者ID:CONANLXF,项目名称:AIO,代码行数:4,代码来源:EvadeHelper.cs

示例7: GetBestPositionBlink

        public static PositionInfo GetBestPositionBlink()
        {
            int posChecked = 0;
            int maxPosToCheck = 100;
            int posRadius = 50;
            int radiusIndex = 0;

            var extraEvadeDistance = 100;//Evade.menu.SubMenu("MiscSettings").SubMenu("ExtraBuffers").Item("ExtraAvoidDistance").GetValue<Slider>().Value;

            Vector2 heroPoint = ObjectCache.myHeroCache.serverPos2DPing;
            Vector2 lastMovePos = Game.CursorPos.To2D();

            int minComfortZone = ObjectCache.menuCache.cache["MinComfortZone"].Cast<Slider>().CurrentValue;

            List<PositionInfo> posTable = new List<PositionInfo>();

            while (posChecked < maxPosToCheck)
            {
                radiusIndex++;

                int curRadius = radiusIndex * (2 * posRadius);
                int curCircleChecks = (int)Math.Ceiling((2 * Math.PI * (double)curRadius) / (2 * (double)posRadius));

                for (int i = 1; i < curCircleChecks; i++)
                {
                    posChecked++;
                    var cRadians = (2 * Math.PI / (curCircleChecks - 1)) * i; //check decimals
                    var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians)));

                    bool isDangerousPos = pos.CheckDangerousPos(6);
                    var dist = pos.GetPositionValue();

                    var posInfo = new PositionInfo(pos, isDangerousPos, dist);
                    posInfo.hasExtraDistance = extraEvadeDistance > 0 ? pos.CheckDangerousPos(extraEvadeDistance) : false;

                    posInfo.posDistToChamps = pos.GetDistanceToChampions();

                    if (minComfortZone < posInfo.posDistToChamps)
                    {
                        posTable.Add(posInfo);
                    }
                }
            }

            var sortedPosTable =
                posTable.OrderBy(p => p.isDangerousPos)
                        .ThenBy(p => p.hasExtraDistance)
                        .ThenBy(p => p.distanceToMouse);

            foreach (var posInfo in sortedPosTable)
            {
                if (CheckPointCollision(myHero, posInfo.position) == false)
                    return posInfo;
            }

            return null;
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:57,代码来源:EvadeHelper.cs

示例8: isSamePosInfo

 public static bool isSamePosInfo(this PositionInfo posInfo1, PositionInfo posInfo2)
 {
     return new HashSet<int>(posInfo1.spellList).SetEquals(posInfo2.spellList);
 }
开发者ID:CONANLXF,项目名称:AIO,代码行数:4,代码来源:PositionInfo.cs

示例9: CompareEvadeOption

        public static bool CompareEvadeOption(PositionInfo posInfo, bool checkSpell = false)
        {
            if (checkSpell)
            {
                if (posInfo.posDangerLevel == 0)
                {
                    return true;
                }
            }

            return posInfo.isBetterMovePos();
        }
开发者ID:GodLS,项目名称:EloBuddy-Addons,代码行数:12,代码来源:EvadeSpell.cs

示例10: PositionInfoStillValid

        public static bool PositionInfoStillValid(PositionInfo posInfo, float moveSpeed = 0)
        {
            return true; //too buggy

            /*if (moveSpeed == 0)
                moveSpeed = ObjectCache.myHeroCache.moveSpeed;

            var canDodge = true;
            foreach (KeyValuePair<int, Spell> entry in SpellDetector.spells) //final check
            {
                Spell spell = entry.Value;

                if (posInfo.undodgeableSpells.Contains(entry.Key))
                {
                    continue;
                }

                float timeElapsed = Evade.GetTickCount - posInfo.timestamp;
                if (spell.info.spellType == SpellType.Line)
                {
                    if (spell.info.projectileSpeed != float.MaxValue && posInfo.closestDistance < spell.info.projectileSpeed * timeElapsed / 1000)
                    {
                        canDodge = false;
                        break;
                    }
                }
                else if (spell.info.spellType == SpellType.Circular)
                {
                    if (posInfo.closestDistance < moveSpeed * timeElapsed / 1000)
                    {
                        canDodge = false;
                        break;
                    }
                }
            }

            return canDodge;*/
        }
开发者ID:bongy97,项目名称:LeagueSharp-1,代码行数:38,代码来源:EvadeHelper.cs

示例11: GetBestPositionMovementBlock

        public static PositionInfo GetBestPositionMovementBlock(Vector2 movePos)
        {
            int posChecked = 0;
            int maxPosToCheck = 50;
            int posRadius = 50;
            int radiusIndex = 0;

            var extraEvadeDistance = ObjectCache.menuCache.cache["ExtraAvoidDistance"].GetValue<Slider>().Value;

            Vector2 heroPoint = ObjectCache.myHeroCache.serverPos2D;
            Vector2 lastMovePos = movePos;//Game.CursorPos.To2D(); //movePos

            List<PositionInfo> posTable = new List<PositionInfo>();

            while (posChecked < maxPosToCheck)
            {
                radiusIndex++;

                int curRadius = radiusIndex * (2 * posRadius);
                int curCircleChecks = (int)Math.Ceiling((2 * Math.PI * (double)curRadius) / (2 * (double)posRadius));

                for (int i = 1; i < curCircleChecks; i++)
                {
                    posChecked++;
                    var cRadians = (2 * Math.PI / (curCircleChecks - 1)) * i; //check decimals
                    var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians)));

                    bool isDangerousPos = pos.CheckDangerousPos(6) || CheckMovePath(pos);
                    var dist = pos.Distance(lastMovePos);

                    //if (pos.Distance(myHero.Position.To2D()) < 100)
                    //    dist = 0;

                    var posInfo = new PositionInfo(pos, isDangerousPos, dist);
                    //posInfo.intersectionTime = GetMovementBlockPositionValue(pos, movePos);
                    posInfo.hasExtraDistance = extraEvadeDistance > 0 ? pos.HasExtraAvoidDistance(extraEvadeDistance) : false;
                    posTable.Add(posInfo);
                }
            }

            var sortedPosTable =
                posTable.OrderBy(p => p.isDangerousPos)
                        .ThenBy(p => p.hasExtraDistance)
                        .ThenBy(p => p.distanceToMouse);
            //.ThenBy(p => p.intersectionTime);

            foreach (var posInfo in sortedPosTable)
            {
                if (CheckPathCollision(myHero, posInfo.position) == false)
                    return posInfo;
            }
            return null;
        }
开发者ID:bongy97,项目名称:LeagueSharp-1,代码行数:53,代码来源:EvadeHelper.cs

示例12: Game_OnCastSpell

        private void Game_OnCastSpell(Spellbook spellbook, SpellbookCastSpellEventArgs args)
        {
            if (!spellbook.Owner.IsMe)
                return;

            var sData = spellbook.GetSpell(args.Slot);
            string name;

            if (SpellDetector.channeledSpells.TryGetValue(sData.Name, out name))
            {
                //Evade.isChanneling = true;
                //Evade.channelPosition = ObjectCache.myHeroCache.serverPos2D;
                lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100;
            }

            if (EvadeSpell.lastSpellEvadeCommand != null && EvadeSpell.lastSpellEvadeCommand.timestamp + ObjectCache.gamePing + 150 > EvadeUtils.TickCount)
            {
                args.Process = false;
            }

            lastSpellCast = args.Slot;
            lastSpellCastTime = EvadeUtils.TickCount;

            //moved from processPacket

            if (Situation.ShouldDodge())
            {
                if (isDodging && SpellDetector.spells.Count() > 0)
                {
                    foreach (KeyValuePair<String, SpellData> entry in SpellDetector.windupSpells)
                    {
                        SpellData spellData = entry.Value;

                        if (spellData.spellKey == args.Slot) //check if it's a spell that we should block
                        {
                            args.Process = false;
                            return;
                        }
                    }
                }
            }

            foreach (var evadeSpell in EvadeSpell.evadeSpells)
            {
                if (evadeSpell.isItem == false && evadeSpell.spellKey == args.Slot)
                {
                    lastPosInfo = PositionInfo.SetAllUndodgeable();

                    if (evadeSpell.evadeType == EvadeType.Blink
                        || evadeSpell.evadeType == EvadeType.Dash)
                    {
                        if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500)
                        {
                            EvadeCommand.MoveTo(Game.CursorPos.To2D());
                            lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100;
                        }
                    }
                    return;
                }
            }
        }
开发者ID:bongy97,项目名称:LeagueSharp-1,代码行数:61,代码来源:Evade.cs

示例13: DodgeSkillShots

        private void DodgeSkillShots()
        {
            if (!Situation.ShouldDodge())
            {
                isDodging = false;
                return;
            }

            /*
            if (isDodging && playerInDanger == false) //serverpos test
            {
                myHero.IssueOrder(GameObjectOrder.HoldPosition, myHero, false);
            }*/

            if (isDodging)
            {
                if (lastPosInfo != null)
                {
                    /*foreach (KeyValuePair<int, Spell> entry in SpellDetector.spells)
                    {
                        Spell spell = entry.Value;

                        Console.WriteLine("" + (int)(TickCount-spell.startTime));
                    }*/

                    Vector2 lastBestPosition = lastPosInfo.position;

                    if (ObjectCache.menuCache.cache["RecalculatePosition"].GetValue<bool>())//recheck path
                    {
                        var dodgeInterval = ObjectCache.menuCache.cache["DodgeInterval"].GetValue<Slider>().Value;
                        if (lastPosInfo != null && !lastPosInfo.recalculatedPath &&
                            dodgeInterval <= EvadeUtils.TickCount - lastPosInfo.timestamp)
                        {
                            var path = myHero.Path;
                            if (path.Length > 0)
                            {
                                var movePos = path[path.Length - 1].To2D();

                                if (movePos.Distance(lastPosInfo.position) < 5) //more strict checking
                                {
                                    var posInfo = EvadeHelper.CanHeroWalkToPos(movePos, ObjectCache.myHeroCache.moveSpeed, 0, 0, false);
                                    if (posInfo.isSamePosInfo(lastPosInfo) &&
                                        posInfo.posDangerCount > lastPosInfo.posDangerCount)
                                    {
                                        var newPosInfo = EvadeHelper.GetBestPosition();
                                        if (newPosInfo.posDangerCount < posInfo.posDangerCount)
                                        {
                                            lastPosInfo = newPosInfo;
                                            CheckHeroInDanger();
                                        }
                                        else if (EvadeSpell.PreferEvadeSpell())
                                        {
                                            lastPosInfo = PositionInfo.SetAllUndodgeable();
                                        }
                                        else
                                        {
                                            lastPosInfo.recalculatedPath = true;
                                        }
                                    }
                                }
                            }
                        }
                    }

                    if (ObjectCache.menuCache.cache["ClickOnlyOnce"].GetValue<bool>() == false
                        || lastPosInfo.timestamp > lastEvadeOrderTime)
                    {
                        if (Game.Time * 1000 - lastIssueOrderTime < 1)
                        {
                            DelayAction.Add(0, () => EvadeCommand.MoveTo(lastBestPosition));
                            lastEvadeOrderTime = EvadeUtils.TickCount;
                        }
                        else
                        {
                            EvadeCommand.MoveTo(lastBestPosition);
                            lastEvadeOrderTime = EvadeUtils.TickCount;
                        }
                    }

                }
            }
            else //if not dodging
            {
                //Check if hero will walk into a skillshot
                var path = myHero.Path;
                if (path.Length > 0)
                {
                    var movePos = path[path.Length - 1].To2D();

                    if (EvadeHelper.CheckMovePath(movePos))
                    {
                        var posInfo = EvadeHelper.GetBestPositionMovementBlock(movePos);
                        if (posInfo != null)
                        {
                            if (Game.Time * 1000 - lastIssueOrderTime < 1) //check?
                            {
                                DelayAction.Add(0, () => EvadeCommand.MoveTo(posInfo.position));
                            }
                            else
                            {
//.........这里部分代码省略.........
开发者ID:bongy97,项目名称:LeagueSharp-1,代码行数:101,代码来源:Evade.cs

示例14: Game_OnCastSpell


//.........这里部分代码省略.........
                EvadeSpell.lastSpellEvadeCommand.timestamp + ObjectCache.gamePing + 150 > EvadeUtils.TickCount)
            {
                args.Process = false;
            }

            lastSpellCast = args.Slot;
            lastSpellCastTime = EvadeUtils.TickCount;

            if (Situation.ShouldDodge())
            {
                if (isDodging && SpellDetector.spells.Any())
                {
                    foreach (KeyValuePair<String, SpellData> entry in SpellDetector.windupSpells)
                    {
                        SpellData spellData = entry.Value;

                        if (spellData.spellKey == args.Slot) //check if it's a spell that we should block
                        {
                            args.Process = false;
                            return;
                        }
                    }
                }
            }

            foreach (var evadeSpell in EvadeSpell.evadeSpells)
            {
                if (evadeSpell.isItem == false &&
                    evadeSpell.spellKey == args.Slot && evadeSpell.untargetable == false)
                {
                    if (evadeSpell.evadeType == EvadeType.Blink)
                    {
                        var dir = (args.StartPosition.LSTo2D() - myHero.ServerPosition.LSTo2D()).LSNormalized();

                        var end = myHero.ServerPosition.LSTo2D() + dir * myHero.ServerPosition.LSTo2D().LSDistance(Game.CursorPos.LSTo2D());
                        if (evadeSpell.fixedRange || end.LSDistance(myHero.ServerPosition.LSTo2D()) > evadeSpell.range)
                        {
                            end = myHero.ServerPosition.LSTo2D() + dir * evadeSpell.range;
                        }

                        var posInfo = EvadeHelper.CanHeroWalkToPos(end, evadeSpell.speed, ObjectCache.gamePing, 0);
                        if (posInfo.posDangerCount > 0)
                        {
                            args.Process = false;
                        }
                        else
                        {
                            lastPosInfo.position = end;
                            lastDodgingEndTime = EvadeUtils.TickCount;

                            if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500)
                            {
                                EvadeCommand.MoveTo(Game.CursorPos.LSTo2D()); //block moveto
                                lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100;
                            }

                            return;
                        }
                    }

                    if (evadeSpell.evadeType == EvadeType.Dash)
                    {
                        var dashPos = args.StartPosition.LSTo2D();

                        if (args.Target != null)
                        {
                            dashPos = args.Target.Position.LSTo2D();
                        }

                        if (evadeSpell.fixedRange || dashPos.LSDistance(myHero.ServerPosition.LSTo2D()) > evadeSpell.range)
                        {
                            var dir = (dashPos - myHero.ServerPosition.LSTo2D()).LSNormalized();
                            dashPos = myHero.ServerPosition.LSTo2D() + dir * evadeSpell.range;
                        }

                        var posInfo = EvadeHelper.CanHeroWalkToPos(dashPos, evadeSpell.speed, ObjectCache.gamePing, 0);
                        if (posInfo.posDangerLevel > 0)
                        {
                            args.Process = false;
                        }
                        else
                        {
                            lastPosInfo.position = dashPos;
                            lastDodgingEndTime = EvadeUtils.TickCount;

                            if (isDodging || EvadeUtils.TickCount < lastDodgingEndTime + 500)
                            {
                                EvadeCommand.MoveTo(Game.CursorPos.LSTo2D()); //block moveto
                                lastStopEvadeTime = EvadeUtils.TickCount + ObjectCache.gamePing + 100;
                            }

                            return;
                        }
                    }

                    lastPosInfo = PositionInfo.SetAllUndodgeable();
                    return;
                }
            }
        }
开发者ID:CainWolf,项目名称:PortAIO,代码行数:101,代码来源:Evade.cs

示例15: SpellDetector_OnProcessDetectedSpells

        private void SpellDetector_OnProcessDetectedSpells()
        {
            ObjectCache.myHeroCache.UpdateInfo();

            if (ObjectCache.menuCache.cache["DodgeSkillShots"].GetValue<KeyBind>().Active == false)
            {
                lastPosInfo = PositionInfo.SetAllUndodgeable();
                EvadeSpell.UseEvadeSpell();
                return;
            }

            if (ObjectCache.myHeroCache.serverPos2D.CheckDangerousPos(0)
                || ObjectCache.myHeroCache.serverPos2DExtra.CheckDangerousPos(0))
            {
                if (EvadeSpell.PreferEvadeSpell())
                {
                    lastPosInfo = PositionInfo.SetAllUndodgeable();
                }
                else
                {

                    var posInfo = EvadeHelper.GetBestPosition();

                    var calculationTimer = EvadeUtils.TickCount;
                    var caculationTime = EvadeUtils.TickCount - calculationTimer;
                    if (posInfo != null)
                    {
                        lastPosInfo = posInfo.CompareLastMovePos();

                        var travelTime = ObjectCache.myHeroCache.serverPos2DPing.Distance(lastPosInfo.position) / myHero.MoveSpeed;

                        lastPosInfo.endTime = EvadeUtils.TickCount + travelTime * 1000 - 100;
                    }
                    CheckHeroInDanger();
                    DodgeSkillShots(); //walking
                    CheckLastMoveTo();
                    EvadeSpell.UseEvadeSpell(); //using spells
                }
            }
            else
            {
                lastPosInfo = PositionInfo.SetAllDodgeable();
                CheckLastMoveTo();
            }
        }
开发者ID:salesprendes,项目名称:LeagueSharp,代码行数:45,代码来源:Evade.cs


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