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


C# Spell.Cast方法代码示例

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


在下文中一共展示了Spell.Cast方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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 (poutput2.Hitchance >= HitChance.High)
         qwer.Cast(poutput2.CastPosition);
     else
         if (Standard.HitChance >= EloBuddy.SDK.Enumerations.HitChance.Medium)
         qwer.Cast(P.GetPrediction(target, 150).CastPosition);
 }
开发者ID:FireBuddy,项目名称:Elobuddy-3,代码行数:20,代码来源:Harrass.cs

示例4: KS

 public static void KS(Spell.SpellBase spell, float damage)
 {
     foreach (var hero in
         HeroManager.Enemies
             .Where(x => x.Position.Distance(ObjectManager.Player) < spell.Range))
     {
         if (!hero.IsDead && !hero.IsZombie && damage > hero.Health)
         {
             spell.Cast(hero);
         }
     }
 }
开发者ID:ss841122,项目名称:EloBuddy,代码行数:12,代码来源:Logics.cs

示例5: CastSpell

 public 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);
     if (poutput2.Hitchance >= HitChance.Low)
         qwer.Cast(poutput2.CastPosition);
 }
开发者ID:FireBuddy,项目名称:Elobuddy-3,代码行数:16,代码来源:JungleClear.cs

示例6: CastSpell

        public static void CastSpell(Spell.Skillshot QWER, Obj_AI_Base target)
        {
            if (QWER.Slot == SpellSlot.W)
            {
                var pred = W.GetPrediction(target);
                if (pred.HitChancePercent >= MenuConfig.Wpred)
                {
                    QWER.Cast(pred.CastPosition);
                }
            }
            if (QWER.Slot == SpellSlot.E)
            {
                var pred = E.GetPrediction(target);
                QWER.Cast(pred.CastPosition);

            }

            if (QWER.Slot == SpellSlot.R)
            {
                var pred = R.GetPrediction(target);
                if (pred.HitChancePercent >= MenuConfig.Rpred)
                {
                    QWER.Cast(pred.CastPosition);
                }
            }
        }
开发者ID:roaxtreil,项目名称:EBRepo,代码行数:26,代码来源:Program.cs

示例7: CastSpell

        private static void CastSpell(Spell.Skillshot QWER, Obj_AI_Base target, HitChance hitchance, int MaxRange)
        {
            var coreType2 = SkillshotType.SkillshotLine;
            var aoe2 = false;
            if ((int)QWER.Type == (int)SkillshotType.SkillshotCircle)
            {
                coreType2 = SkillshotType.SkillshotCircle;
                aoe2 = true;
            }
            if (QWER.Width > 80 && QWER.AllowedCollisionCount < 100)
                aoe2 = true;
            var predInput2 = new PredictionInput
            {
                Aoe = aoe2,
                Collision = QWER.AllowedCollisionCount < 100,
                Speed = QWER.Speed,
                Delay = QWER.CastDelay,
                Range = MaxRange,
                From = Player.ServerPosition,
                Radius = QWER.Radius,
                Unit = target,
                Type = coreType2
            };
            var poutput2 = Prediction.GetPrediction(predInput2);
            Chat.Print(QWER.Slot + " " + predInput2.Collision + poutput2.Hitchance);
            if (QWER.Speed < float.MaxValue && Utils.CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
                return;

            if (hitchance == HitChance.VeryHigh)
            {
                if (poutput2.Hitchance >= HitChance.VeryHigh)
                    QWER.Cast(poutput2.CastPosition);
                else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 &&
                         poutput2.Hitchance >= HitChance.High)
                {
                    QWER.Cast(poutput2.CastPosition);
                }
            }
            else if (hitchance == HitChance.High)
            {
                if (poutput2.Hitchance >= HitChance.High)
                    QWER.Cast(poutput2.CastPosition);
            }
            else if (hitchance == HitChance.Medium)
            {
                if (poutput2.Hitchance >= HitChance.Medium)
                    QWER.Cast(poutput2.CastPosition);
            }
            else if (hitchance == HitChance.Low)
            {
                if (poutput2.Hitchance >= HitChance.Low)
                    QWER.Cast(poutput2.CastPosition);
            }
        }
开发者ID:Musee30,项目名称:Elobuddyy,代码行数:54,代码来源:Program.cs

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

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

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

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

示例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);

                    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

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

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

示例15: CastSpell

        public static void CastSpell(Spell QWER, Obj_AI_Base target)
        {
            if (Config.Item("PredictionMODE", true).GetValue<StringList>().SelectedIndex == 1)
            {
                Core.SkillshotType CoreType2 = Core.SkillshotType.SkillshotLine;
                bool aoe2 = false;

                if (QWER.Type == SkillshotType.SkillshotCircle)
                {
                    CoreType2 = Core.SkillshotType.SkillshotCircle;
                    aoe2 = true;
                }

                if (QWER.Width > 80 && !QWER.Collision)
                    aoe2 = true;

                var predInput2 = new Core.PredictionInput
                {
                    Aoe = aoe2,
                    Collision = QWER.Collision,
                    Speed = QWER.Speed,
                    Delay = QWER.Delay,
                    Range = QWER.Range,
                    From = Player.ServerPosition,
                    Radius = QWER.Width,
                    Unit = target,
                    Type = CoreType2
                };
                var poutput2 = Core.Prediction.GetPrediction(predInput2);

                //var poutput2 = QWER.GetPrediction(target);

                if (QWER.Speed != float.MaxValue && OktwCommon.CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
                    return;

                if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 0)
                {
                    if (poutput2.Hitchance >= Core.HitChance.VeryHigh)
                        QWER.Cast(poutput2.CastPosition);
                    else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 && poutput2.Hitchance >= Core.HitChance.High)
                    {
                        QWER.Cast(poutput2.CastPosition);
                    }

                }
                else if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 1)
                {
                    if (poutput2.Hitchance >= Core.HitChance.High)
                        QWER.Cast(poutput2.CastPosition);

                }
                else if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 2)
                {
                    if (poutput2.Hitchance >= Core.HitChance.Medium)
                        QWER.Cast(poutput2.CastPosition);
                }
                if (Game.Time - DrawSpellTime > 0.5)
                {
                    DrawSpell = QWER;
                    DrawSpellTime = Game.Time;

                }
                DrawSpellPos = poutput2;
            }
            else if (Config.Item("PredictionMODE", true).GetValue<StringList>().SelectedIndex == 0)
            {
                if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 0)
                {
                    QWER.CastIfHitchanceEquals(target, HitChance.VeryHigh);
                    return;
                }
                else if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 1)
                {
                    QWER.CastIfHitchanceEquals(target, HitChance.High);
                    return;
                }
                else if (Config.Item("HitChance ", true).GetValue<StringList>().SelectedIndex == 2)
                {
                    QWER.CastIfHitchanceEquals(target, HitChance.Medium);
                    return;
                }
            }
            else if (Config.Item("PredictionMODE", true).GetValue<StringList>().SelectedIndex == 2 )
            {
                
                if (target is Obj_AI_Hero && target.IsValid)
                {
                    var t = target as Obj_AI_Hero;
                    if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 0)
                    {
                        QWER.SPredictionCast(t, HitChance.VeryHigh);
                        return;
                    }
                    else if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 1)
                    {
                        QWER.SPredictionCast(t, HitChance.High);
                        return;
                    }
                    else if (Config.Item("HitChance ", true).GetValue<StringList>().SelectedIndex == 2)
                    {
//.........这里部分代码省略.........
开发者ID:MrWenzoxfs,项目名称:elobuddy,代码行数:101,代码来源:Program.cs


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