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


C# LeagueSharp.GetPrediction方法代码示例

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


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

示例1: IsPositionSafe

        // use underTurret and .Extend for this please
        public static bool IsPositionSafe(AIHeroClient target, LeagueSharp.Common.Spell spell)
        {
            var predPos = spell.GetPrediction(target).UnitPosition.LSTo2D();
            var myPos = ObjectManager.Player.Position.LSTo2D();
            var newPos = (target.Position.LSTo2D() - myPos);
            newPos.Normalize();

            var checkPos = predPos + newPos*(spell.Range - Vector2.Distance(predPos, myPos));
            Obj_Turret closestTower = null;

            foreach (var tower in ObjectManager.Get<Obj_Turret>()
                .Where(tower => tower.IsValid && !tower.IsDead && Math.Abs(tower.Health) > float.Epsilon)
                .Where(tower => Vector3.Distance(tower.Position, ObjectManager.Player.Position) < 1450))
            {
                closestTower = tower;
            }

            if (closestTower == null)
                return true;

            if (Vector2.Distance(closestTower.Position.LSTo2D(), checkPos) <= 910)
                return false;

            return true;
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:26,代码来源:Quinn.cs

示例2: CastR

        private static void CastR(LeagueSharp.Common.Spell R, AIHeroClient t)
        {
            Program.CastSpell(R, t);
            if (getCheckBoxItem(rMenu, "minionR"))
            {
                // collision + predictio R
                var poutput = R.GetPrediction(t);
                var col = poutput.CollisionObjects.Count(ColObj => ColObj.IsEnemy && ColObj.IsMinion && !ColObj.IsDead);

                //hitchance
                var prepos = LeagueSharp.Common.Prediction.GetPrediction(t, 0.4f);

                if (col == 0 && (int)prepos.Hitchance < 5)
                    return;

                float rSplash = 140;
                if (bonusR)
                    rSplash = 290f;

                var minions = Cache.GetMinions(Player.ServerPosition, R.Range - rSplash);
                foreach (var minion in minions.Where(minion => minion.LSDistance(poutput.CastPosition) < rSplash))
                {
                    R.Cast(minion);
                    return;
                }
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:27,代码来源:Corki.cs

示例3: CastQKill

 private static bool CastQKill(LeagueSharp.SDK.Spell spell, Obj_AI_Base target)
 {
     var pred1 = spell.GetPrediction(target, false, -1, CollisionableObjects.YasuoWall);
     if (pred1.Hitchance < Q.MinHitChance)
     {
         return false;
     }
     var pred2 = spell.GetPrediction(
         target,
         false,
         -1,
         CollisionableObjects.Heroes | CollisionableObjects.Minions);
     if (pred2.Hitchance == HitChance.Collision)
     {
         var subDmg = Q.GetDamage(target, DamageStage.SecondForm);
         switch (target.Type)
         {
             case GameObjectType.AIHeroClient:
                 return target.Health + target.AttackShield <= subDmg && Q.Cast(pred1.CastPosition);
             case GameObjectType.obj_AI_Minion:
                 return spell.CanLastHit(target, subDmg) && Q.Cast(pred1.CastPosition);
         }
     }
     else if (pred2.Hitchance >= Q.MinHitChance)
     {
         return Q.Cast(pred2.CastPosition);
     }
     return false;
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:29,代码来源:Zed.cs

示例4: CastQKill

 private static bool CastQKill(LeagueSharp.SDK.Spell spell, Obj_AI_Base target)
 {
     var pred = spell.GetPrediction(target, false, -1, LeagueSharp.SDK.CollisionableObjects.YasuoWall);
     if (pred.Hitchance < Q.MinHitChance)
     {
         return false;
     }
     var col = pred.GetCollision(LeagueSharp.SDK.CollisionableObjects.Heroes | LeagueSharp.SDK.CollisionableObjects.Minions);
     if (col.Count == 0)
     {
         Q.Cast(target);
         return true;
     }
     var subDmg = Q.GetDamage(target, DamageStage.SecondForm);
     if (target is AIHeroClient && target.Health + target.AttackShield <= subDmg)
     {
         Q.Cast(target);
         return true;
     }
     return target is Obj_AI_Minion && spell.CanLastHit(target, subDmg) && Q.Cast(pred.CastPosition);
 }
开发者ID:Xelamats,项目名称:PortAIO,代码行数:21,代码来源:Zed.cs


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