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


C# Spell.GetPrediction方法代码示例

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


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

示例1: CastE

 public static void CastE(Spell.Skillshot E, Obj_AI_Base target)
 {
     var pred = E.GetPrediction(target);
     if (Config.EHitChance == 3)
     {
         if (pred.HitChance >= HitChance.High)
         {
             E.Cast(target);
         }
         return;
     }
     if (Config.EHitChance == 2)
     {
         if (pred.HitChance >= HitChance.AveragePoint)
         {
             E.Cast(target);
         }
         return;
     }
     if (Config.EHitChance == 1)
     {
         if (pred.HitChance >= HitChance.Medium)
         {
             E.Cast(target);
             return;
         }
     }
     if (Config.EHitChance == 0)
     {
         if (pred.HitChance >= HitChance.Low)
         {
             E.Cast(target);
         }
     }
 }
开发者ID:roaxtreil,项目名称:EBRepo,代码行数:35,代码来源:TDMF.cs

示例2: HitChanceCast

        public virtual bool HitChanceCast(Spell.Skillshot spell, Obj_AI_Base target, float chance = 85)
        {
            var pred = spell.GetPrediction(target);

            if (pred.HitChancePercent >= chance)
                if (spell.Cast(pred.CastPosition))
                    return true;

            return false;
        }
开发者ID:mrarticuno,项目名称:EBHQ,代码行数:10,代码来源:LogicBase.cs

示例3: GetTargetNoCollision

        public static AIHeroClient GetTargetNoCollision(Spell.Skillshot spell,
           bool ignoreShield = true,
           IEnumerable<AIHeroClient> ignoredChamps = null,
           Vector3? rangeCheckFrom = null)
        {
            var t = TargetSelector.GetTarget(spell.Range,
                DamageType.Physical);
            if (t != null)
            if (spell.AllowedCollisionCount < 100 && spell.GetPrediction(t).HitChance != HitChance.Collision)
            {
                return t;
            }

            return null;
        }
开发者ID:roaxtreil,项目名称:EBRepo,代码行数:15,代码来源:Utility.cs

示例4: CastSpell

 private static void CastSpell(Spell.Skillshot qwer, Obj_AI_Base target)
 {
     var predInput2 = new PredictionInput
     {
         Speed = qwer.Speed,
         Delay = qwer.CastDelay,
         Range = qwer.Range,
         From = Player.Instance.ServerPosition,
         Radius = qwer.Width,
         Unit = target,
         Type = SkillshotType.SkillshotLine
     };
     var poutput2 = P.GetPrediction(predInput2);
     var Standard = qwer.GetPrediction(target);
         if(Standard.HitChance >= EloBuddy.SDK.Enumerations.HitChance.Medium)
         {
         qwer.Cast(S.Q.GetPrediction(target).CastPosition);
         }
 }
开发者ID:FireBuddy,项目名称:Elobuddy-3,代码行数:19,代码来源:Combo.cs

示例5: CanCast

 public static bool CanCast(this Obj_AI_Base target, Spell.Skillshot spell, Menu m, int hitchancePercent = 75)
 {
     var asBase = spell as Spell.SpellBase;
     var pred = spell.GetPrediction(target);
     return target.CanCast(asBase, m) && pred.HitChancePercent >= 75;
 }
开发者ID:Casanje,项目名称:ItsMeMario,代码行数:6,代码来源:Extensions.cs

示例6: Optimized

                internal static void Optimized(Spell.Skillshot spell, DamageType damageType,
                    int range = 0, int minHit = 1, HitChance hitChance = HitChance.Medium,
                    AIHeroClient targetHero = null)
                {
                    if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
                        (spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
                        (spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
                        (spell.Slot != SpellSlot.R || !TickManager.NoLag(4)))
                        return;

                    if (!spell.IsReady() || IsAutoAttacking) return;

                    AIHeroClient target;
                    if (targetHero == null)
                        target = range != 0
                            ? TargetManager.Target(range, damageType)
                            : TargetManager.Target(spell, damageType);
                    else target = targetHero;

                    if (target == null) return;

                    if (!target.IsValidTarget(spell.Range + spell.Radius) ||
                        spell.GetPrediction(target).HitChance < hitChance)
                        return;

                    var champs = EntityManager.Heroes.Enemies.Where(e => e.Distance(target) < spell.Radius).Select(champ => Prediction.Position.PredictUnitPosition(champ, ((int)Player.Distance(champ) / spell.Speed) + spell.CastDelay)).ToList();

                    var posAndHits = GetOptimizedCircleLocation(champs, spell.Width, spell.Range);

                    if (posAndHits.ChampsHit >= minHit)
                        spell.Cast(posAndHits.Position.To3DWorld());
                }
开发者ID:globalik,项目名称:EloBuddy,代码行数:32,代码来源:CastManager.cs

示例7: SingleTargetHero

                internal static void SingleTargetHero(Spell.Skillshot spell, DamageType damageType,
                    int range = 0, HitChance hitChance = HitChance.Medium, AIHeroClient targetHero = null)
                {
                    if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
                        (spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
                        (spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
                        (spell.Slot != SpellSlot.R || !TickManager.NoLag(4))) return;

                    if (!spell.IsReady() || IsAutoAttacking) return;

                    AIHeroClient target;
                    if (targetHero == null)
                        target = range != 0
                            ? TargetManager.Target(range, damageType)
                            : TargetManager.Target(spell, damageType);
                    else target = targetHero;

                    if (target == null) return;

                    if (!VolatileMenu["vpred"].Cast<CheckBox>().CurrentValue)
                    {
                        if (!target.IsValidTarget(spell.Range) || spell.GetPrediction(target).HitChance < hitChance)
                            return;

                        spell.Cast(spell.GetPrediction(target).CastPosition);
                    }
                    /*else
                    {
                        var CoreType2 = SkillshotType.SkillshotLine;
                        bool aoe2 = false;
                        if ((int) spell.Type == (int) SkillshotType.SkillshotCircle)
                        {
                            CoreType2 = SkillshotType.SkillshotCircle;
                            aoe2 = true;
                        }
                        if (spell.Width > 80 && spell.AllowedCollisionCount < 100)
                            aoe2 = true;
                        var predInput2 = new PredictionInput
                        {
                            Aoe = aoe2,
                            Collision = spell.AllowedCollisionCount < 100,
                            Speed = spell.Speed,
                            Delay = spell.CastDelay,
                            Range = spell.Range,
                            From = Player.ServerPosition,
                            Radius = spell.Radius,
                            Unit = target,
                            Type = CoreType2
                        };
                        var poutput2 = Test.TopSecret.Prediction.GetPrediction(predInput2);
                        //var poutput2 = spell.GetPrediction(target);
                        Chat.Print(spell.Slot+" "+predInput2.Collision+poutput2.Hitchance);
                        if (spell.Speed != float.MaxValue && CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
                            return;

                        if (VolatileMenu["vpred2"].Cast<Slider>().CurrentValue == 0)
                        {
                            if (poutput2.Hitchance >= Test.TopSecret.HitChance.VeryHigh)
                                spell.Cast(poutput2.CastPosition);
                            else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 &&
                                     poutput2.Hitchance >= Test.TopSecret.HitChance.High)
                            {
                                spell.Cast(poutput2.CastPosition);
                            }

                        }
                        else if (VolatileMenu["vpred2"].Cast<Slider>().CurrentValue == 1)
                        {
                            if (poutput2.Hitchance >= Test.TopSecret.HitChance.High)
                                spell.Cast(poutput2.CastPosition);

                        }
                        else if (VolatileMenu["vpred2"].Cast<Slider>().CurrentValue == 2)
                        {
                            if (poutput2.Hitchance >= Test.TopSecret.HitChance.Medium)
                                spell.Cast(poutput2.CastPosition);
                        }
                    }*/
                }
开发者ID:globalik,项目名称:EloBuddy,代码行数:79,代码来源:CastManager.cs

示例8: CastwithPred

 private static void CastwithPred(Spell.Skillshot x, AIHeroClient t)
 {
     var pred = x.GetPrediction(t);
     if (pred.HitChance >= HitChance.High)
         x.Cast(pred.CastPosition);
 }
开发者ID:lolscripts,项目名称:zilean,代码行数:6,代码来源:Casts.cs

示例9: SingleTargetHero

                internal static void SingleTargetHero(Spell.Skillshot spell, DamageType damageType,
                    int range = 0, HitChance hitChance = HitChance.Medium, AIHeroClient targetHero = null)
                {
                    if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
                        (spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
                        (spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
                        (spell.Slot != SpellSlot.R || !TickManager.NoLag(4))) return;

                    if (!spell.IsReady() || _isAutoAttacking) return;

                    AIHeroClient target;
                    if (targetHero == null)
                        target = range != 0
                            ? TargetManager.Target(range, damageType)
                            : TargetManager.Target(spell, damageType);
                    else target = targetHero;

                    if (target == null) return;

                    if (!target.IsValidTarget(spell.Range) || spell.GetPrediction(target).HitChance < hitChance)
                        return;

                    spell.Cast(spell.GetPrediction(target).CastPosition);

                    lock (_lastSpells)
                    {
                        _lastSpells.RemoveAll(p => Environment.TickCount - p.tick > 2000);

                        if (_lastSpells.Exists(p => p.name == spell.Name) || spell.Slot != SpellSlot.Q)
                            return;

                        _lastSpells.Add(new LastSpells(spell.Name, Environment.TickCount,
                            Player.GetSpellDamage(target, spell.Slot), target.Name));

                        CastCount++;
                    }
                }
开发者ID:addctionbr,项目名称:EloBuddy,代码行数:37,代码来源:CastManager.cs

示例10: WujuStyle

                internal static void WujuStyle(Spell.Skillshot spell, DamageType damageType,
                    int range = 0, int minHit = 1, HitChance hitChance = HitChance.Medium, AIHeroClient targetHero = null)
                {
                    //Credits to WujuSan for the original algorithm, now optimized by turkey for better hitchance
                    if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
                        (spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
                        (spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
                        (spell.Slot != SpellSlot.R || !TickManager.NoLag(4)))
                        return;

                    if (!spell.IsReady() || _isAutoAttacking) return;

                    AIHeroClient target;
                    if (targetHero == null)
                        target = range != 0
                            ? TargetManager.Target(range, damageType)
                            : TargetManager.Target(spell, damageType);
                    else target = targetHero;

                    if (target == null) return;

                    if (!target.IsValidTarget(spell.Range + spell.Radius) ||
                        spell.GetPrediction(target).HitChance < hitChance)
                        return;
                    var posAndHits = CircleSpellPos(spell.GetPrediction(target).CastPosition.To2D(), spell);

                    if (posAndHits.First().Value >= minHit)
                        spell.Cast(posAndHits.First().Key.To3D());
                }
开发者ID:addctionbr,项目名称:EloBuddy,代码行数:29,代码来源:CastManager.cs

示例11: GetEnemiesPosition

 private static IEnumerable<Vector2> GetEnemiesPosition(Spell.Skillshot spell)
 {
     return
         EntityManager.Heroes.Enemies.Where(
             hero => !hero.IsDead && Player.Distance(hero) <= spell.Range + spell.Radius)
             .Select(hero => spell.GetPrediction(hero).CastPosition.To2D())
             .ToList();
 }
开发者ID:addctionbr,项目名称:EloBuddy,代码行数:8,代码来源:CastManager.cs

示例12: SingleTargetHero

                internal static void SingleTargetHero(Spell.Skillshot spell, DamageType damageType,
                    int range = 0, HitChance? hitChance = HitChance.Medium, AIHeroClient targetHero = null)
                {
                    if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
                        (spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
                        (spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
                        (spell.Slot != SpellSlot.R || !TickManager.NoLag(4))) return;

                    if (!spell.IsReady() || IsAutoAttacking) return;

                    AIHeroClient target;
                    if (targetHero == null)
                        target = range != 0
                            ? TargetManager.Target(range, damageType)
                            : TargetManager.Target(spell, damageType);
                    else target = targetHero;

                    if (target == null) return;

                    if (!target.IsValidTarget(spell.Range) || spell.GetPrediction(target).HitChance < hitChance)
                        return;
                    spell.Cast(spell.GetPrediction(target).CastPosition);
                }
开发者ID:BEEBEEISADOG,项目名称:EloBuddy-4,代码行数:23,代码来源:CastManager.cs


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