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


C# Vector2.UnderTurret方法代码示例

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


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

示例1: GetPRADAPos

        public static Vector3 GetPRADAPos(this AIHeroClient target)
        {
            if (target == null) return Vector3.Zero;
            var aRC = new Geometry.Circle(Heroes.Player.ServerPosition.To2D(), 300).ToPolygon().ToClipperPath();
            var tP = target.ServerPosition;
            var pList = new List<Vector3>();
            foreach (var p in aRC)
            {
                var v3 = new Vector2(p.X, p.Y).To3D();


                if (!v3.UnderTurret(true) && v3.Distance(tP) > 325 && v3.Distance(tP) < Heroes.Player.AttackRange &&
                    (v3.CountEnemiesInRange(425) <= v3.CountAlliesInRange(325))) pList.Add(v3);
            }
            return pList.Count > 1 ? pList.OrderByDescending(el => el.Distance(tP)).FirstOrDefault() : Vector3.Zero;
        }
开发者ID:AristoLOL,项目名称:EloBuddy-1,代码行数:16,代码来源:Wizard.cs

示例2: GetTumblePos

        public static Vector3 GetTumblePos(this Obj_AI_Hero target)
        {
            //if the target is not a melee and he's alone he's not really a danger to us, proceed to 1v1 him :^ )
            if (!target.IsMelee && Heroes.Player.CountEnemiesInRange(800) == 1) return Game.CursorPos;

            var flash = Program.Flash;
            var flashedAtTick = Program.FlashTime;
            if (!flash.IsReady())
            {
                if (Environment.TickCount - flashedAtTick < 500) return Vector3.Zero;
            }

            var aRC = new Geometry.Circle(Heroes.Player.ServerPosition.To2D(), 300).ToPolygon().ToClipperPath();
            var cP = Game.CursorPos;
            var tP = target.ServerPosition;
            var pList = new List<Vector3>();
            var additionalDistance = (0.106 + Game.Ping/2000f) * target.MoveSpeed;

            if ((!cP.IsWall() && !cP.UnderTurret(true) && cP.Distance(tP) > 325 && cP.Distance(tP) < 550 &&
                 (cP.CountEnemiesInRange(425) <= cP.CountAlliesInRange(325)))) return cP;

            foreach (var p in aRC)
            {
                var v3 = new Vector2(p.X, p.Y).To3D();

                if (target.IsFacing(Heroes.Player))
                {
                    if (!v3.IsWall() && !v3.UnderTurret(true) && v3.Distance(tP) > 325 && v3.Distance(tP) < 550 &&
                        (v3.CountEnemiesInRange(425) <= v3.CountAlliesInRange(325))) pList.Add(v3);
                }
                else
                {
                    if (!v3.IsWall() && !v3.UnderTurret(true) && v3.Distance(tP) > 325 &&
                        v3.Distance(tP) < (550 - additionalDistance) &&
                        (v3.CountEnemiesInRange(425) <= v3.CountAlliesInRange(325))) pList.Add(v3);
                }
            }
            if (Heroes.Player.UnderTurret() || Heroes.Player.CountEnemiesInRange(800) == 1)
            {
                return pList.Count > 1 ? pList.OrderBy(el => el.Distance(cP)).FirstOrDefault() : Vector3.Zero;
            }
            return pList.Count > 1 ? pList.OrderByDescending(el => el.Distance(tP)).FirstOrDefault() : Vector3.Zero;
        }
开发者ID:Hydro202,项目名称:Leaguesharp,代码行数:43,代码来源:Extensions.cs


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