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


C# GameObjectNewPathEventArgs类代码示例

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


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

示例1: ObjAiHeroOnOnNewPath

        private static void ObjAiHeroOnOnNewPath(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
        {
            if (sender.IsValid<AIHeroClient>())
            {
                if (!DetectedDashes.ContainsKey(sender.NetworkId))
                {
                    DetectedDashes.Add(sender.NetworkId, new DashItem());
                }

                if (args.IsDash)
                {
                    var path = new List<Vector2> { sender.ServerPosition.To2D2() };
                    path.AddRange(args.Path.ToList().To2D2());

                    DetectedDashes[sender.NetworkId].StartTick = Utils.TickCount;
                    DetectedDashes[sender.NetworkId].Speed = args.Speed;
                    DetectedDashes[sender.NetworkId].StartPos = sender.ServerPosition.To2D2();
                    DetectedDashes[sender.NetworkId].Unit = sender;
                    DetectedDashes[sender.NetworkId].Path = path;
                    DetectedDashes[sender.NetworkId].EndPos = DetectedDashes[sender.NetworkId].Path.Last();
                    DetectedDashes[sender.NetworkId].EndTick = DetectedDashes[sender.NetworkId].StartTick +
                                                           (int)
                                                               (1000 *
                                                                (DetectedDashes[sender.NetworkId].EndPos.Distance7(
                                                                    DetectedDashes[sender.NetworkId].StartPos) / DetectedDashes[sender.NetworkId].Speed));
                    DetectedDashes[sender.NetworkId].Duration = DetectedDashes[sender.NetworkId].EndTick - DetectedDashes[sender.NetworkId].StartTick;

                    CustomEvents.Unit.TriggerOnDash(DetectedDashes[sender.NetworkId].Unit, DetectedDashes[sender.NetworkId]);
                }
                else
                {
                    DetectedDashes[sender.NetworkId].EndTick = 0;
                }
            }
        }
开发者ID:wearegodz,项目名称:WeAreGodz,代码行数:35,代码来源:Dash.cs

示例2: OnNewPath

        public static void OnNewPath(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
        {
            if (!sender.IsMe)
            {
                return;
            }

            Modes.PermaActive.CatchAxe();
        }
开发者ID:TristeMyth,项目名称:Triste,代码行数:9,代码来源:_objaibase.cs

示例3: DrawFake

 private static void DrawFake(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
 {
     if (sender.IsMe && lastTime + deltaT < Game.Time && args.Path.LastOrDefault()!=lastEndpoint)
     {
         lastEndpoint = args.Path.LastOrDefault();
         if (!attacking)
             Hud.ShowClick(ClickType.Move, Game.CursorPos);
         else
             Hud.ShowClick(ClickType.Attack, Game.CursorPos);
         lastTime = Game.Time;
     }
 }
开发者ID:WTayllor,项目名称:Leaguesharp-4,代码行数:12,代码来源:Program.cs

示例4: OnNewPath

        private void OnNewPath(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
        {
            if (sender.Type != GameObjectType.obj_AI_Hero || !_mainMenu.Item("enabled").GetValue<bool>()) return;

            if (!_detectors.ContainsKey(sender.NetworkId))
            {
                var detectors = new List<IDetector> { new SacOrbwalkerDetector(), new LeaguesharpOrbwalkDetector() };
                detectors.ForEach(detector => detector.Initialize((Obj_AI_Hero)sender));
                _detectors.Add(sender.NetworkId, detectors);
            }
            else
                _detectors[sender.NetworkId].ForEach(detector => detector.FeedData(args.Path.Last()));
        }
开发者ID:s1m421,项目名称:PDLS,代码行数:13,代码来源:PatternDetector.cs

示例5: OnNewPath

        private void OnNewPath(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
        {
            if (sender.Type != GameObjectType.AIHeroClient || !_mainMenu["enabled"].Cast<CheckBox>().CurrentValue) return;

            if (!_detectors.ContainsKey(sender.NetworkId))
            {
                var detectors = new List<IDetector> { new SacOrbwalkerDetector(), new LeaguesharpOrbwalkDetector() };
                detectors.ForEach(detector => detector.Initialize((AIHeroClient)sender));
                _detectors.Add(sender.NetworkId, detectors);
            }
            else
                _detectors[sender.NetworkId].ForEach(detector => detector.FeedData(args.Path.Last()));
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:13,代码来源:TheCheater.cs

示例6: Obj_AI_Hero_OnNewPath

        /// <summary>
        /// OnNewPath event for average reaction time calculations
        /// </summary>
        private static void Obj_AI_Hero_OnNewPath(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
        {
            if (!sender.IsEnemy || !sender.IsChampion() || args.IsDash)
                return;

            EnemyData enemy = EnemyInfo[sender.NetworkId];

            lock (enemy.m_lock)
            {
                if (args.Path.Length < 2)
                {
                    if (!enemy.IsStopped)
                    {
                        enemy.StopTick = Environment.TickCount;
                        enemy.LastWaypointTick = Environment.TickCount;
                        enemy.IsStopped = true;
                        enemy.Count = 0;
                        enemy.AvgTick = 0;
                        enemy.AvgPathLenght = 0;
                    }
                }
                else
                {
                    List<Vector2> wp = args.Path.Select(p => p.To2D()).ToList();
                    if (!enemy.LastWaypoints.SequenceEqual(wp))
                    {
                        if (!enemy.IsStopped)
                        {
                            enemy.AvgTick = (enemy.Count * enemy.AvgTick + (Environment.TickCount - enemy.LastWaypointTick)) / ++enemy.Count;
                            enemy.AvgPathLenght = ((enemy.Count - 1) * enemy.AvgPathLenght + wp.PathLength()) / enemy.Count;
                        }
                        enemy.LastWaypointTick = Environment.TickCount;
                        enemy.IsStopped = false;
                        enemy.LastWaypoints = wp;

                        if (!enemy.IsWindupChecked)
                        {
                            if (Environment.TickCount - enemy.LastAATick < 300)
                                enemy.AvgOrbwalkTime = (enemy.AvgOrbwalkTime * enemy.OrbwalkCount + (enemy.LastWaypointTick - enemy.LastWindupTick)) / ++enemy.OrbwalkCount;
                            enemy.IsWindupChecked = true;
                        }
                    }
                }

                EnemyInfo[sender.NetworkId] = enemy;
            }
        }
开发者ID:Ryzeros,项目名称:L-,代码行数:50,代码来源:PathTracker.cs

示例7: ObjAiHeroOnOnNewPath

        private static void ObjAiHeroOnOnNewPath(Obj_AI_Base unit, GameObjectNewPathEventArgs args)
        {
            if (unit.Type == GameObjectType.obj_AI_Hero)
            {
                if (testMenu.Item("TestSpellEndTime").GetValue<bool>())
                {
                    Console.WriteLine("Dash windup: " + (EvadeUtils.TickCount - EvadeSpell.lastSpellEvadeCommand.timestamp));
                }

                if (args.IsDash && testMenu.Item("ShowDashInfo").GetValue<bool>())
                {
                    var dist = args.Path.First().Distance(args.Path.Last());
                    Console.WriteLine("Dash Speed: " + args.Speed + " Dash dist: " + dist);
                }

            }
        }
开发者ID:xQxCPMxQx,项目名称:LeagueSharp-5,代码行数:17,代码来源:EvadeTester.cs

示例8: Obj_AI_Hero_OnNewPath

        void Obj_AI_Hero_OnNewPath(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
        {
            if(!IsActive() || !sender.IsMe)
                return;

            for (int i = 0; i < args.Path.Length; i++)
            {
                var point = args.Path[i];
                Obj_AI_Turret baseTurret = ObjectManager.Get<Obj_AI_Turret>().Find(turret => IsBaseTurret(turret, 1425, true, point));
                if (baseTurret != null)
                {
                    float dist =
                        args.Path[i - 1].Distance(
                            baseTurret.ServerPosition) - 1425f - 20f;
                    Vector3 newPos = args.Path[i - 1].Extend(point, dist);
                    ObjectManager.Player.IssueOrder(GameObjectOrder.MoveTo, newPos);
                }
            }
        }
开发者ID:kampfi,项目名称:SAwarenessBeta,代码行数:19,代码来源:AntiNexusTurret.cs

示例9: DrawFake

        /// <summary>
        /// The on new path fake.
        /// Currently used for the second style of fake clicks
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="args">
        /// The args.
        /// </param>
        public static void DrawFake(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
        {
            if (sender.IsMe && lastTime + deltaT < Game.Time && args.Path.LastOrDefault() != lastEndpoint
                && args.Path.LastOrDefault().Distance(player.ServerPosition) >= 5f
                && fakeclick["Enable"].Cast<CheckBox>().CurrentValue
                && fakeclick["clicktype2"].Cast<CheckBox>().CurrentValue)
            {
                lastEndpoint = args.Path.LastOrDefault();
                if (!attacking)
                {
                    Hud.ShowClick(ClickType.Move, Game.CursorPos);
                }
                else
                {
                    Hud.ShowClick(ClickType.Attack, Game.CursorPos);
                }

                lastTime = Game.Time;
            }
        }
开发者ID:Xelamats,项目名称:PortAIO,代码行数:30,代码来源:Program.cs

示例10: Obj_AI_Base_OnNewPath

 /// <summary>
 /// OnNewPath event for the detect rengar leap
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void Obj_AI_Base_OnNewPath(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
 {
     if (sender.IsMe && args.IsDash && sender.CharData.BaseSkinName == "Rengar")
     {
         Events.FireOnAttack(this, m_lastTarget);
         m_lastAATick = Utils.TickCount - Game.Ping / 2;
         m_lastWindUpTime = (int)(sender.AttackCastDelay * 1000);
         m_lastAttackCooldown = (int)(sender.AttackDelay * 1000);
         m_lastAttackCompletesAt = m_lastAATick + m_lastWindUpTime;
         m_lastAttackPos = ObjectManager.Player.ServerPosition.LSTo2D();
         m_attackInProgress = true;
         m_rengarAttack = true;
         if (m_baseAttackSpeed == 0.5f)
             SetOrbwalkValues();
     }
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:21,代码来源:Orbwalker.cs

示例11: ObjAiHeroOnOnNewPath

        private static void ObjAiHeroOnOnNewPath(Obj_AI_Base unit, GameObjectNewPathEventArgs args)
        {
            if (unit.Type == GameObjectType.obj_AI_Hero)
            {
                if (testMenu.Item("TestSpellEndTime").GetValue<bool>())
                {
                    //ConsolePrinter.Print("Dash windup: " + (EvadeUtils.TickCount - EvadeSpell.lastSpellEvadeCommand.timestamp));
                }

                if (args.IsDash && testMenu.Item("ShowDashInfo").GetValue<bool>())
                {
                    var dist = args.Path.First().Distance(args.Path.Last());
                    ConsolePrinter.Print("Dash Speed: " + args.Speed + " Dash dist: " + dist);
                }

                if (unit.IsMe && testMenu.Item("EvadeTesterPing").GetValue<bool>()
                    && args.Path.Count() > 1)
                {
                    //ConsolePrinter.Print("Received Path ClickTime: " + (EvadeUtils.TickCount - lastRightMouseClickTime));
                }

                if (unit.IsMe)
                {
                    //Draw.RenderObjects.Add(new Draw.RenderCircle(args.Path.Last().To2D(), 500));
                    //Draw.RenderObjects.Add(new Draw.RenderCircle(args.Path.First().To2D(), 500));
                }

            }
        }
开发者ID:aikoy,项目名称:ezEvade,代码行数:29,代码来源:EvadeTester.cs

示例12: DrawFake

        /// <summary>
        ///     The on new path fake.
        ///     Currently used for the second style of fake clicks
        /// </summary>
        /// <param name="sender">
        ///     The sender.
        /// </param>
        /// <param name="args">
        ///     The args.
        /// </param>
        private static void DrawFake(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
        {
            if (sender.IsMe && lastTime + deltaT < Game.Time && args.Path.LastOrDefault() != lastEndpoint &&
                args.Path.LastOrDefault().Distance(player.ServerPosition) >= 5f && root.Item("Enable").IsActive() &&
                root.Item("Click Mode").GetValue<StringList>().SelectedIndex == 1)
            {
                lastEndpoint = args.Path.LastOrDefault();
                if (!attacking)
                {
                    ShowClick(Game.CursorPos, ClickType.Move);
                }
                else
                {
                    ShowClick(Game.CursorPos, ClickType.Attack);
                }

                lastTime = Game.Time;
            }
        }
开发者ID:Marandini,项目名称:LeagueSharp,代码行数:29,代码来源:FakeClicks.cs

示例13: Hero_OnNewPath

        private void Hero_OnNewPath(Obj_AI_Base hero, GameObjectNewPathEventArgs args)
        {
            if (ObjectCache.menuCache.cache["AutoSetPingOn"].GetValue<bool>() == false)
            {
                return;
            }

            if (!hero.IsMe)
            {
                return;
            }

            var path = args.Path;

            if (path.Length > 1 && !args.IsDash)
            {
                var movePos = path.Last().To2D();

                if (checkPing
                    && lastIssueOrderArgs.Process == true
                    && lastIssueOrderArgs.Order == GameObjectOrder.MoveTo
                    && lastIssueOrderArgs.TargetPosition.To2D().Distance(movePos) < 3
                    && myHero.Path.Count() == 1
                    && args.Path.Count() == 2
                    && myHero.IsMoving)
                {
                    //Draw.RenderObjects.Add(new Draw.RenderPosition(myHero.Path.Last().To2D(), 1000));

                    Draw.RenderObjects.Add(new Draw.RenderLine(args.Path.First().To2D(), args.Path.Last().To2D(), 1000));
                    Draw.RenderObjects.Add(new Draw.RenderLine(myHero.Position.To2D(), myHero.Path.Last().To2D(), 1000));

                    //Draw.RenderObjects.Add(new Draw.RenderCircle(lastMoveToServerPos, 1000, System.Drawing.Color.Red, 10));

                    var distanceTillEnd = myHero.Path.Last().To2D().Distance(myHero.Position.To2D());
                    float moveTimeTillEnd = 1000 * distanceTillEnd / myHero.MoveSpeed;

                    if (moveTimeTillEnd < 500)
                    {
                        return;
                    }

                    var dir1 = (myHero.Path.Last().To2D() - myHero.Position.To2D()).Normalized();
                    var ray1 = new Ray(myHero.Position.SetZ(0), new Vector3(dir1.X, dir1.Y, 0));

                    var dir2 = (args.Path.First().To2D() - args.Path.Last().To2D()).Normalized();
                    var pos2 = new Vector3(args.Path.First().X, args.Path.First().Y, 0);
                    var ray2 = new Ray(args.Path.First().SetZ(0), new Vector3(dir2.X, dir2.Y, 0));

                    Vector3 intersection3;
                    if (ray2.Intersects(ref ray1, out intersection3))
                    {
                        var intersection = intersection3.To2D();

                        var projection = intersection.ProjectOn(myHero.Path.Last().To2D(), myHero.Position.To2D());

                        if (projection.IsOnSegment && dir1.AngleBetween(dir2) > 20 && dir1.AngleBetween(dir2) < 160)
                        {
                            Draw.RenderObjects.Add(new Draw.RenderCircle(intersection, 1000, System.Drawing.Color.Red, 10));

                            var distance = //args.Path.First().To2D().Distance(intersection);
                                lastMoveToServerPos.Distance(intersection);
                            float moveTime = 1000 * distance / myHero.MoveSpeed;

                            //Console.WriteLine("waa: " + distance);

                            if (moveTime < 1000)
                            {
                                if (numExtraDelayTime > 0)
                                {
                                    sumExtraDelayTime += moveTime;
                                    avgExtraDelayTime = sumExtraDelayTime / numExtraDelayTime;

                                    pingList.Add(moveTime);
                                }
                                numExtraDelayTime += 1;

                                if (maxExtraDelayTime == 0)
                                {
                                    maxExtraDelayTime = ObjectCache.menuCache.cache["ExtraPingBuffer"].GetValue<Slider>().Value;
                                }

                                if (numExtraDelayTime % 100 == 0)
                                {
                                    pingList.Sort();

                                    var percentile = ObjectCache.menuCache.cache["AutoSetPercentile"].GetValue<Slider>().Value;
                                    int percentIndex = (int)Math.Floor(pingList.Count() * (percentile / 100f)) - 1;
                                    maxExtraDelayTime = Math.Max(pingList.ElementAt(percentIndex) - Game.Ping,0);
                                    ObjectCache.menuCache.cache["ExtraPingBuffer"].SetValue(new Slider((int)maxExtraDelayTime, 0, 200));

                                    pingList.Clear();

                                    Console.WriteLine("Max Extra Delay: " + maxExtraDelayTime);
                                }

                                Console.WriteLine("Extra Delay: " + Math.Max(moveTime - Game.Ping,0));
                            }
                        }
                    }
                }
//.........这里部分代码省略.........
开发者ID:joduskarne,项目名称:EloBuddyAddons,代码行数:101,代码来源:AutoSetPing.cs

示例14: Obj_AI_Hero_OnNewPath

        private static void Obj_AI_Hero_OnNewPath(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
        {
            if (!(sender is Obj_AI_Hero))
            {
                return;
            }

            if (!StoredPaths.ContainsKey(sender.NetworkId))
            {
                StoredPaths.Add(sender.NetworkId, new List<StoredPath>());
            }

            var newPath = new StoredPath { Tick = Utils.TickCount, Path = args.Path.ToList().To2D() };
            StoredPaths[sender.NetworkId].Add(newPath);

            if (StoredPaths[sender.NetworkId].Count > 50)
            {
                StoredPaths[sender.NetworkId].RemoveRange(0, 40);
            }
        }
开发者ID:werdbrian,项目名称:LeagueSharp-20,代码行数:20,代码来源:Prediction.cs

示例15: OnNewPath

 /// <summary>
 ///     On new path event.
 /// </summary>
 /// <param name="sender">
 ///     The sender.
 /// </param>
 /// <param name="args">
 ///     The args.
 /// </param>
 private static void OnNewPath(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
 {
     //EventDash(sender, args);
 }
开发者ID:CONANLXF,项目名称:Berb.Common,代码行数:13,代码来源:Events.cs


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