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


C# EloBuddy.IsDashing方法代码示例

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


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

示例1: IsCondemnable

        private bool IsCondemnable(EloBuddy.AIHeroClient hero)
        {
            if (!hero.LSIsValidTarget(550f) || hero.HasBuffOfType(EloBuddy.BuffType.SpellShield) ||
                hero.HasBuffOfType(EloBuddy.BuffType.SpellImmunity) || hero.IsDashing()) return false;

            //values for pred calc pP = player position; p = enemy position; pD = push distance
            var pP = EloBuddy.ObjectManager.Player.ServerPosition;
            var p = hero.ServerPosition;
            var pD = EPushDistanceSlider;
            var mode = EModeStringList;

            if (mode == 1 && (IsCollisionable(p.LSExtend(pP, -pD)) || IsCollisionable(p.LSExtend(pP, -pD / 2f)) ||
                                         IsCollisionable(p.LSExtend(pP, -pD / 3f))))
            {
                if (!hero.CanMove)
                    return true;

                var enemiesCount = EloBuddy.ObjectManager.Player.CountEnemyHeroesInRange(1200);
                if (enemiesCount > 1 && enemiesCount <= 3)
                {
                    var prediction = E.GetPrediction(hero);
                    for (var i = 15; i < pD; i += 75)
                    {
                        if (i > pD)
                        {
                            var lastPosFlags = EloBuddy.NavMesh.GetCollisionFlags(
                            prediction.UnitPosition.ToVector2()
                                .Extend(
                                    pP.ToVector2(),
                                    -pD)
                                .ToVector3());
                            if (lastPosFlags.HasFlag(EloBuddy.CollisionFlags.Wall) || lastPosFlags.HasFlag(EloBuddy.CollisionFlags.Building))
                            {
                                return true;
                            }
                            return false;
                        }
                        var posFlags = EloBuddy.NavMesh.GetCollisionFlags(
                            prediction.UnitPosition.ToVector2()
                                .Extend(
                                    pP.ToVector2(),
                                    -i)
                                .ToVector3());
                        if (posFlags.HasFlag(EloBuddy.CollisionFlags.Wall) || posFlags.HasFlag(EloBuddy.CollisionFlags.Building))
                        {
                            return true;
                        }
                    }
                    return false;
                }
                else
                {
                    var hitchance = EHitchanceSlider;
                    var angle = 0.20 * hitchance;
                    const float travelDistance = 0.5f;
                    var alpha = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)),
                        (float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle)));
                    var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)),
                        (float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle)));

                    for (var i = 15; i < pD; i += 100)
                    {
                        if (i > pD) return false;
                        if (IsCollisionable(pP.ToVector2().Extend(alpha,
                            i)
                            .ToVector3()) && IsCollisionable(pP.ToVector2().Extend(beta, i).ToVector3())) return true;
                    }
                    return false;
                }
            }

            if (mode == 2 &&
                (IsCollisionable(p.LSExtend(pP, -pD)) || IsCollisionable(p.LSExtend(pP, -pD / 2f)) ||
                 IsCollisionable(p.LSExtend(pP, -pD / 3f))))
            {
                if (!hero.CanMove ||
                    (hero.Spellbook.IsAutoAttacking))
                    return true;

                var hitchance = EHitchanceSlider;
                var angle = 0.20 * hitchance;
                const float travelDistance = 0.5f;
                var alpha = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)),
                    (float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle)));
                var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)),
                    (float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle)));

                for (var i = 15; i < pD; i += 100)
                {
                    if (i > pD)
                    {
                        return IsCollisionable(alpha.Extend(pP.ToVector2(),
                            -pD)
                            .ToVector3()) && IsCollisionable(beta.Extend(pP.ToVector2(), -pD).ToVector3());
                    }
                    if (IsCollisionable(alpha.Extend(pP.ToVector2(),
                        -i)
                        .ToVector3()) && IsCollisionable(beta.Extend(pP.ToVector2(), -i).ToVector3())) return true;
                }
                return false;
//.........这里部分代码省略.........
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:101,代码来源:Vayne.cs


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