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


C# AIHeroClient.GetDashInfo方法代码示例

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


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

示例1: HandleQ

        private static void HandleQ(AIHeroClient comboTarget)
        {
            var QPrediction = spells[SpellSlot.Q].GetPrediction(comboTarget);

            if (QPrediction.Hitchance >= HitChance.High)
            {
                if (spells[SpellSlot.Q].GetDamage(comboTarget) > comboTarget.Health + 15 &&
                    getCheckBoxItem(comboMenu, "dz191.bard.combo.qks"))
                {
                    spells[SpellSlot.Q].Cast(QPrediction.CastPosition);
                    return;
                }

                var QPushDistance = getSliderItem(miscMenu, "dz191.bard.misc.distance");
                var QAccuracy = getSliderItem(miscMenu, "dz191.bard.misc.accuracy");
                var PlayerPosition = ObjectManager.Player.ServerPosition;

                var BeamStartPositions = new List<Vector3>
                {
                    QPrediction.CastPosition,
                    QPrediction.UnitPosition,
                    comboTarget.ServerPosition,
                    comboTarget.Position
                };

                if (comboTarget.IsDashing())
                {
                    BeamStartPositions.Add(comboTarget.GetDashInfo().EndPos);
                }

                var PositionsList = new List<Vector3>();
                var CollisionPositions = new List<Vector3>();

                foreach (var position in BeamStartPositions)
                {
                    var collisionableObjects = spells[SpellSlot.Q].GetCollision(position.LSTo2D(),
                        new List<Vector2> { position.LSExtend(PlayerPosition, -QPushDistance).LSTo2D() });

                    if (collisionableObjects.Any())
                    {
                        if (collisionableObjects.Any(h => h is AIHeroClient) &&
                            collisionableObjects.All(h => h.LSIsValidTarget()))
                        {
                            spells[SpellSlot.Q].Cast(QPrediction.CastPosition);
                            break;
                        }

                        for (var i = 0; i < QPushDistance; i += (int)comboTarget.BoundingRadius)
                        {
                            CollisionPositions.Add(position.LSExtend(PlayerPosition, -i));
                        }
                    }

                    for (var i = 0; i < QPushDistance; i += (int)comboTarget.BoundingRadius)
                    {
                        PositionsList.Add(position.LSExtend(PlayerPosition, -i));
                    }
                }

                if (PositionsList.Any())
                {
                    //We don't want to divide by 0 Kappa
                    var WallNumber = PositionsList.Count(p => p.LSIsWall()) * 1.3f;
                    var CollisionPositionCount = CollisionPositions.Count;
                    var Percent = (WallNumber + CollisionPositionCount) / PositionsList.Count;
                    var AccuracyEx = QAccuracy / 100f;
                    if (Percent >= AccuracyEx)
                    {
                        spells[SpellSlot.Q].Cast(QPrediction.CastPosition);
                    }
                }
            }
            else if (QPrediction.Hitchance == HitChance.Collision)
            {
                var QCollision = QPrediction.CollisionObjects;
                if (QCollision.Count == 1)
                {
                    spells[SpellSlot.Q].Cast(QPrediction.CastPosition);
                }
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:81,代码来源:Program.cs


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