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


C# Spell.IsReady方法代码示例

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


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

示例1: LastHitSpell

 private static void LastHitSpell(Spell.Skillshot s)
 {
     if (s.IsReady())
     {
         var enemyminions =
             EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, MyHero.Position,
                 s.Range + s.Width, true).Where(o => o.IsValidTarget() && o.Health <= 2.0f * Damage(o, s.Slot));
         if (enemyminions.Any())
         {
             foreach (var minion in enemyminions)
             {
                 var CanCalculate = false;
                 if (!Orbwalker.CanAutoAttack)
                 {
                     if (Orbwalker.CanMove && Orbwalker.LastTarget != null &&
                         Orbwalker.LastTarget.NetworkId != minion.NetworkId)
                     {
                         CanCalculate = true;
                     }
                 }
                 else
                 {
                     if (MyHero.GetAutoAttackRange(minion) <= MyHero.Distance(minion))
                     {
                         CanCalculate = true;
                     }
                     else
                     {
                         var speed = MyHero.BasicAttack.MissileSpeed;
                         var time =
                             (int)
                                 (1000 * MyHero.Distance(minion) / speed + MyHero.AttackCastDelay * 1000);
                         var predHealth = Prediction.Health.GetPrediction(minion, time);
                         if (predHealth <= 0)
                         {
                             CanCalculate = true;
                         }
                         /**
                         if (!Orbwalker.CanBeLastHitted(minion))
                         {
                             CanCalculate = true;
                         }**/
                     }
                 }
                 if (CanCalculate)
                 {
                     var dmg = Damage(minion, s.Slot);
                     var source = s.SourcePosition ?? MyHero.Position;
                     var time = (int)(1000 * source.Distance(minion) / s.Speed + s.CastDelay);
                     var predHealth = Prediction.Health.GetPrediction(minion, time);
                     if (time > 0 && Math.Abs(predHealth - minion.Health) < float.Epsilon)
                     {
                         return;
                     }
                     if (dmg > predHealth && predHealth > 0)
                     {
                         CastQ(minion);
                     }
                 }
             }
         }
     }
 }
开发者ID:tramyeu,项目名称:EloBuddy,代码行数:63,代码来源:Program.cs

示例2: CanCast

 public static bool CanCast(this Obj_AI_Base target, Spell.SpellBase spell, Menu m)
 {
     if (spell == null) return false;
     if (m != ComboMenu)
     {
         if (Player.Instance.ManaPercent < m.GetSliderValue("manaSlider")) return false;
     }
     return target.IsValidTarget(spell.Range) && spell.IsReady() && m.GetCheckBoxValue(spell.Slot.ToString().ToLower() + "Use");
 }
开发者ID:Casanje,项目名称:ItsMeMario,代码行数:9,代码来源:Extensions.cs

示例3: LastHitSpell

 private static void LastHitSpell(Spell.Skillshot s)
 {
     if (s.IsReady())
     {
         var enemyminions = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, myHero.Position, s.Range + s.Width, true).Where(o => o.Health <= 2.0f * Damage(o, s.Slot));
         if (enemyminions.Count() > 0)
         {
             foreach (Obj_AI_Base minion in enemyminions)
             {
                 bool CanCalculate = false;
                 if (minion.IsValidTarget())
                 {
                     if (!Orbwalker.CanAutoAttack)
                     {
                         if (Orbwalker.CanMove && Orbwalker.LastTarget != null && Orbwalker.LastTarget.NetworkId != minion.NetworkId)
                         {
                             CanCalculate = true;
                         }
                     }
                     else
                     {
                         if (myHero.GetAutoAttackRange(minion) <= Extensions.Distance(myHero, minion))
                         {
                             CanCalculate = true;
                         }
                         else
                         {
                             var speed = myHero.BasicAttack.MissileSpeed;
                             var time = (int)(1000 * Extensions.Distance(myHero, minion) / speed + myHero.AttackCastDelay * 1000 + Game.Ping - 100);
                             var predHealth = Prediction.Health.GetPrediction(minion, time);
                             if (predHealth <= 0)
                             {
                                 CanCalculate = true;
                             }
                             /**
                             if (!Orbwalker.CanBeLastHitted(minion))
                             {
                                 CanCalculate = true;
                             }**/
                         }
                     }
                 }
                 if (CanCalculate)
                 {
                     var dmg = Damage(minion, s.Slot);
                     var time = (int)(1000 * Extensions.Distance(s.SourcePosition.Value, minion) / s.Speed + s.CastDelay - 70);
                     var predHealth = Prediction.Health.GetPrediction(minion, time);
                     if (time > 0 && predHealth == minion.Health) { return; }
                     if (dmg > predHealth && predHealth > 0)
                     {
                         CastQ(minion);
                     }
                 }
             }
         }
     }
 }
开发者ID:Real263,项目名称:EloBuddy,代码行数:57,代码来源:Program.cs

示例4: 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

示例5: 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

示例6: LastHitSpell

 private static void LastHitSpell(Spell.Skillshot s)
 {
     if (s.IsReady())
     {
         foreach (var minion in from minion in Orbwalker.UnLasthittableMinions let predHealth = Prediction.Health.GetPrediction(minion, (int)(1000f * (s.SourcePosition ?? myHero.Position).Distance(minion) / s.Speed) + s.CastDelay) where predHealth >= 0 where Damage(minion, s.Slot) >= predHealth select minion)
         {
             CastQ(minion);
         }
         /*
         var enemyminions =
             EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, myHero.Position,
                 s.Range + s.Width, true).Where(o => o.Health <= 2.0f * Damage(o, s.Slot));
         if (enemyminions.Any())
         {
             foreach (var minion in enemyminions)
             {
                 var canCalculate = false;
                 if (minion.IsValidTarget())
                 {
                     if (!Orbwalker.CanAutoAttack)
                     {
                         if (Orbwalker.CanMove && Orbwalker.LastTarget != null &&
                             Orbwalker.LastTarget.NetworkId != minion.NetworkId)
                         {
                             canCalculate = true;
                         }
                     }
                     else
                     {
                         if (!myHero.IsInAutoAttackRange(minion))
                         {
                             canCalculate = true;
                         }
                         else
                         {
                             var speed = myHero.BasicAttack.MissileSpeed;
                             var time =
                                 (int)
                                     (1000 * myHero.Distance(minion) / speed + myHero.AttackCastDelay * 1000);
                             var predHealth = Prediction.Health.GetPrediction(minion, time);
                             if (predHealth <= -20)
                             {
                                 canCalculate = true;
                             }
                         }
                     }
                 }
                 if (canCalculate)
                 {
                     var dmg = Damage(minion, s.Slot);
                     var time = (int)(1000 * s.SourcePosition.Value.Distance(minion) / s.Speed + s.CastDelay);
                     var predHealth = Prediction.Health.GetPrediction(minion, time);
                     if (time > 0 && Math.Abs(predHealth - minion.Health) < float.Epsilon)
                     {
                         return;
                     }
                     if (dmg > predHealth && predHealth > 0)
                     {
                     }
                 }
             }
         }*/
     }
 }
开发者ID:mezer123,项目名称:EloBuddy,代码行数:64,代码来源:Program.cs

示例7: Farm

                internal static void Farm(Spell.Skillshot spell, int minHit = 1)
                {
                    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;

                    var minions =
                        MinionManager.GetMinions(Player.ServerPosition, spell.Range + spell.Radius)
                            .Select(
                                minion =>
                                    Prediction.Position.PredictUnitPosition(minion,
                                        (int) (spell.CastDelay + (Player.Distance(minion)/spell.Speed))))
                            .ToList();
                    
                    if (MinionManager.GetBestCircularFarmLocation(minions, spell.Width, spell.Range).MinionsHit <
                        minHit) return;
                        spell.Cast(
                            MinionManager.GetBestCircularFarmLocation(minions, spell.Width, spell.Range).Position.To3D());
                }
开发者ID:globalik,项目名称:EloBuddy,代码行数:21,代码来源:CastManager.cs

示例8: 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

示例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: Farm

 internal static void Farm(Spell.Skillshot spell, int minHit = 1)
 {
     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;
     var minionWaves = GetMinionWaves();
     foreach (
         var wave in
             minionWaves.Where(
                 vector =>
                     Player.Distance(GetMinionWaveVector(vector)) >
                     (spell.Range + spell.Radius)).ToList()
         )
     {
         minionWaves.Remove(wave);
     }
     var biggestWaveInRange = new List<Obj_AI_Minion>();
     foreach (var wave in minionWaves)
     {
         if (wave.Count > biggestWaveInRange.Count)
         {
             biggestWaveInRange = wave;
         }
     }
     if (biggestWaveInRange.Count>=minHit)
     spell.Cast(GetMinionWaveVector(biggestWaveInRange).To3D());
 }
开发者ID:addctionbr,项目名称:EloBuddy,代码行数:29,代码来源:CastManager.cs

示例11: CanCastSpell

 public static bool CanCastSpell(this Vector3 target, Spell.SpellBase spell)
 {
     if (spell == null || target == null) return false;
     return target.IsInRange(Player.Instance, spell.Range) && spell.IsReady();
 }
开发者ID:Casanje,项目名称:ItsMeMario,代码行数:5,代码来源:Spells.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

示例13: NewPredTest

                internal static void NewPredTest(Spell.Skillshot spell, DamageType damageType,
                    int range = 0, Utils.HitChance hitChance = Utils.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))
                        return;

                    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 = VPrediction.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 (hitChance == Utils.HitChance.VeryHigh)
                    {
                        if (poutput2.Hitchance >= Utils.HitChance.VeryHigh)
                            spell.Cast(poutput2.CastPosition);
                        else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 &&
                                 poutput2.Hitchance >= Utils.HitChance.High)
                        {
                            spell.Cast(poutput2.CastPosition);
                        }

                    }
                    else if (hitChance == Utils.HitChance.High)
                    {
                        if (poutput2.Hitchance >= Utils.HitChance.High)
                            spell.Cast(poutput2.CastPosition);

                    }
                    else if (hitChance == Utils.HitChance.Medium)
                    {
                        if (poutput2.Hitchance >= Utils.HitChance.Medium)
                            spell.Cast(poutput2.CastPosition);
                    }
                }
开发者ID:BEEBEEISADOG,项目名称:EloBuddy-4,代码行数:73,代码来源:CastManager.cs


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