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


C# Spell.Cast方法代码示例

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


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

示例1: CastSkillshot

        public void CastSkillshot(Obj_AI_Hero t, Spell s, HitChance hc = HitChance.High)
        {
            if (!s.IsSkillshot)
                return;

            PredictionOutput p = s.GetPrediction(t);

            if (s.Collision)
            {
                for (int i = 0; i < p.CollisionObjects.Count; i++)
                    if (!p.CollisionObjects[i].IsDead && (p.CollisionObjects[i].IsEnemy || p.CollisionObjects[i].IsMinion))
                        return;
            }

            if ((t.HasBuffOfType(BuffType.Slow) && p.Hitchance >= HitChance.High) || p.Hitchance == HitChance.Immobile)
                s.Cast(p.CastPosition);
            else if (t.IsRecalling())
                s.Cast(t.ServerPosition);
            else
            {
                if (s.IsReady())
                {
                    s.SPredictionCast(t, hc);
                }
            }
        }
开发者ID:cak3d,项目名称:LeagueSharp,代码行数:26,代码来源:Nidalee.cs

示例2: CastBasicFarm

        public static void CastBasicFarm(Spell spell)
        {
            if (!spell.IsReady())
                return;
            var minion = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, spell.Range, MinionTypes.All, MinionTeam.NotAlly);

            if (minion.Count == 0)
                return;

            if (spell.Type == SkillshotType.SkillshotCircle)
            {
                spell.UpdateSourcePosition();

                var predPosition = spell.GetCircularFarmLocation(minion);

                if (predPosition.MinionsHit >= 2)
                {
                    spell.Cast(predPosition.Position);
                }
            }
            else if (spell.Type == SkillshotType.SkillshotLine || spell.Type == SkillshotType.SkillshotCone)
            {
                spell.UpdateSourcePosition();

                var predPosition = spell.GetLineFarmLocation(minion);

                if (predPosition.MinionsHit >= 2)
                    spell.Cast(predPosition.Position);
            }
        }
开发者ID:myo,项目名称:LSharp,代码行数:30,代码来源:SpellCastManager.cs

示例3: WallJumpo

        public static void WallJumpo(Spell spell, string menuname)
        {
            if (ObjectManager.Player.IsDead && ObjectManager.Player.IsZombie)
            {
                return;
            }
            CheckSpell(spell);
            if (Program.Champion.misc.Item(menuname).GetValue<KeyBind>().Active)
            {
                if (DrawColor == Color.Green)
                {
                    if (ObjectManager.Player.Distance(LastWallStartPosition) > 50)
                        ObjectManager.Player.IssueOrder(GameObjectOrder.MoveTo, LastWallStartPosition.To3D());
                    else
                        if (Prediction.GetPrediction(ObjectManager.Player, 500).UnitPosition.Distance(ObjectManager.Player.Position) <= 10 && SpellCount == 1)
                            spell.Cast(LastEndPosition);
                }
                else if (SpellCount == 1 && DrawColor == Color.ForestGreen)
                {
                    DrawColor = Color.White;

                    spell.Cast(LastWallJumpEndPosition);
                }
            }


            Vector2 dir = new Vector2(0, 0);

            float scale = 200;

            Position = ObjectManager.Player.Position.To2D() + scale * ObjectManager.Player.Direction.To2D().Perpendicular();

            if (LeagueSharp.Common.Utility.IsWall(Position))
            {
                dir = scale * ObjectManager.Player.Direction.To2D().Perpendicular();
                Continue(dir);
            }

            if (!LeagueSharp.Common.Utility.IsWall(Position) || LastColor == Color.Red)
            {
                scale = 200;

                Position2 = ObjectManager.Player.Position.To2D() + (scale * ObjectManager.Player.Direction.To2D().Perpendicular()).Perpendicular();
                Position3 = ObjectManager.Player.Position.To2D() + (scale * ObjectManager.Player.Direction.To2D().Perpendicular()).Perpendicular2();

                if (LeagueSharp.Common.Utility.IsWall(Position2))
                {
                    dir = (scale * ObjectManager.Player.Direction.To2D().Perpendicular()).Perpendicular();
                    WardJumpPosition = Position2;
                    Continue(dir, true);
                }
                else if (LeagueSharp.Common.Utility.IsWall(Position3))
                {
                    dir = (scale * ObjectManager.Player.Direction.To2D().Perpendicular()).Perpendicular2();
                    WardJumpPosition = Position3;
                    Continue(dir, true);
                }
            }
        }
开发者ID:Sthephanfelix,项目名称:LeagueSharp-4,代码行数:59,代码来源:WallJump.cs

示例4: CastSafePosition

 private static void CastSafePosition(Spell spell, Obj_AI_Hero hero)
 {
     if (Geometry.CircleCircleIntersection(ObjectManager.Player.ServerPosition.To2D(), Prediction.GetPrediction(hero, 0f, hero.AttackRange).UnitPosition.To2D(), spell.Range, Orbwalking.GetRealAutoAttackRange(hero)).Count() > 0)
     {
         spell.Cast(
             Geometry.CircleCircleIntersection(ObjectManager.Player.ServerPosition.To2D(),
                 Prediction.GetPrediction(hero, 0f, hero.AttackRange).UnitPosition.To2D(), spell.Range,
                 Orbwalking.GetRealAutoAttackRange(hero)).MinOrDefault(i => i.Distance(Game.CursorPos)));
     }
     else
     {
         spell.Cast(ObjectManager.Player.ServerPosition.Extend(hero.ServerPosition, -E.Range));
     }
 }
开发者ID:654955321,项目名称:HY_Recommend,代码行数:14,代码来源:Program.cs

示例5: Obj_AI_Hero_OnProcessSpellCast

        static void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            Q = new Spell(SpellSlot.Q, 1150f);
            W = new Spell(SpellSlot.W, 5000f);
            E = new Spell(SpellSlot.E, 1000f);
            R = new Spell(SpellSlot.R, 1500f);


            foreach (var unit in ObjectManager.Get<Obj_AI_Hero>().Where(h => h.IsEnemy && h.IsHPBarRendered))
            {
                // Get buffs
                for (int i = 0; i < unit.Buffs.Count(); i++)
                {
                    // Check if the Soulbound is in a good range
                    var soulboundhero = HeroManager.Allies.FirstOrDefault(hero => hero.HasBuff("kalistacoopstrikeally", true) && args.Target.NetworkId == hero.NetworkId && hero.HealthPercent <= 15);
                    var enemy = HeroManager.Enemies.Where(x => soulboundhero.Distance(x.Position) > 800);
                    // Check if the Soulbound is a Blitzcrank
                    // Check if the enemy is hooked
                    // Check if target was far enough for ult
                    if (soulboundhero.ChampionName == "Blitzcrank" && unit.Buffs[i].Name == "rocketgrab2" && unit.Buffs[i].IsActive && enemy.Count() > 0 && Menu.Item("kaliscrank2", true).GetValue<Boolean>())
                    {
                        R.Cast();
                    }
                }
            }
        }
开发者ID:koolkaracter,项目名称:LeagueSharp,代码行数:26,代码来源:Program.cs

示例6: W

 public static void W(Spell spell)
 {
     foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(spell.Range) && x.Health < spell.GetDamage(x)))
     {
         spell.Cast(enemy);
     }
 }
开发者ID:HikigayaAss,项目名称:hikiMarksman,代码行数:7,代码来源:KillSteal.cs

示例7: CastBasicSkillShot

        public static void CastBasicSkillShot(Spell spell, float range, TargetSelector.DamageType type, HitChance hitChance, bool towerCheck = false)
        {
            var target = TargetSelector.GetTarget(range, type);

            if (target == null || !spell.IsReady())
                return;

            if (towerCheck && target.UnderTurret(true))
                return;

            spell.UpdateSourcePosition();

            if (spell.Type == SkillshotType.SkillshotCircle)
            {
                var pred = Prediction.GetPrediction(target, spell.Delay);

                if (pred.Hitchance >= hitChance)
                    spell.Cast(pred.CastPosition);
            }
            else
            {
                spell.CastIfHitchanceEquals(target, hitChance); 
            }
           
        }
开发者ID:leenam0910,项目名称:LSharp,代码行数:25,代码来源:SpellCastManager.cs

示例8: DoCast

        public static bool DoCast(Spell spell, Obj_AI_Hero target, HitChance minHitChance, bool colisionCheck=false)
        {
            //  Data.Static.Objects.ProjectLogger.WriteLog("DoCast Call");
            if ((PredictionMethod==0)||((PredictionMethod==1)&&colisionCheck)) //Sebby Colision is broken...lol
            {
                var output=spell.GetPrediction(target);

                if (colisionCheck)
                    if (CheckColision(output))
                        return false;

                if (minHitChance>output.Hitchance)
                    return false;

                spell.Cast(output.CastPosition);
                return true;
            }

            if (PredictionMethod==1)
            {
                var output=SebbyLib.Prediction.Prediction.GetPrediction(target, spell.Delay);

                if (minHitChance>(HitChance)output.Hitchance)
                    return false;

                spell.Cast(output.CastPosition);
                return true;
            }

            if (PredictionMethod==2)
            {
                var output=spell.GetSPrediction(target);

                if (colisionCheck)
                    if (CheckColision(output))
                        return false;

                if (minHitChance>output.HitChance)
                    return false;

                spell.Cast(output.CastPosition);
                return true;
            }

            return false;
        }
开发者ID:KallenStadtfeldGeass,项目名称:KallenSharp,代码行数:46,代码来源:Prediction.cs

示例9: CastSpell

 public static void CastSpell(Spell spell, Obj_AI_Base target, bool packetCast)
 {
     if (target.IsValidTarget(spell.Range))
     {
         spell.Cast(target, packetCast);
         LastCastTime = Environment.TickCount;
         Orbwalking.ResetAutoAttackTimer();
     }
 }
开发者ID:matt184,项目名称:LeagueSharp,代码行数:9,代码来源:SpellManager.cs

示例10: CastBasicSkillShot

 public static void CastBasicSkillShot(Spell spell, float range, LeagueSharp.Common.TargetSelector.DamageType type, HitChance hitChance)
 {
     var target = LeagueSharp.Common.TargetSelector.GetTarget(range, type);
     if (target == null || !spell.IsReady())
     return;
     spell.UpdateSourcePosition();
     if (spell.GetPrediction(target).Hitchance >= hitChance)
     spell.Cast(target, packets());
 }
开发者ID:LittleYuiChan,项目名称:LeagueSharp-2,代码行数:9,代码来源:Program.cs

示例11: CastSpellSSAuto

 private static void CastSpellSSAuto(Spell spell, Vector3 predpos, Obj_AI_Hero target)
 {
     Orbwalking.ResetAutoAttackTimer();
     spell.Cast(predpos);
     if (Player.Distance(target) <= Player.AttackRange)
     {
         Program.Player.IssueOrder(GameObjectOrder.AttackUnit, target);
     }
 }
开发者ID:ninja1234567,项目名称:LeagueSharp,代码行数:9,代码来源:SpellLogic.cs

示例12: castSpell

 public static void castSpell(Spell p, String menu, Obj_AI_Base target)
 {
     var Passive = Program.menu.Item(menu).GetValue<bool>();
     if (!Program.Passive())
     {
         Program.passive = false;
     }
     if (Passive == false && Program.passive)
     {
         p.Cast(target);
     }
     else
     {
         if (!Program.Passive())
         {
             p.Cast(target);
         }
     }
 }
开发者ID:hprobotic,项目名称:zeroRepository,代码行数:19,代码来源:Data.cs

示例13: CastSpell

        private static void CastSpell(Spell spell, BuffType x, Obj_AI_Hero target, float lastpostime)
        {
            if (x == BuffType.Stun || x == BuffType.Snare || x == BuffType.Knockup || x == BuffType.Fear)
            {
                if (Game.Time <= lastpostime)
                {
                    spell.Cast(target.ServerPosition);
                }
            }
            else
            {

                var pred = spell.GetPrediction(target);
                if (pred != null && Game.Time <= lastpostime)
                {
                    spell.Cast(pred.CastPosition);
                }
            }
        }
开发者ID:ninja1234567,项目名称:LeagueSharp,代码行数:19,代码来源:Program.cs

示例14: Cast_BasicSkillshot_Enemy

 public Obj_AI_Hero Cast_BasicSkillshot_Enemy(Spell spell, TargetSelector.PriorityMode prio = TargetSelector.PriorityMode.AutoPriority, float extrarange = 0)
 {
     if(!spell.IsReady())
         return null;
     var target = TargetSelector.GetTarget(spell.Range, prio);
     if(target == null)
         return null;
     if (!target.IsValidTarget(spell.Range + extrarange) || spell.GetPrediction(target).Hitchance < HitChance.High)
         return null;
     spell.Cast(target, UsePackets());
     return target;
 }
开发者ID:lanyi777,项目名称:CN,代码行数:12,代码来源:Champion.cs

示例15: castCircleSkillShot

 /// <summary>
 ///     Casts a basic circle skillshot towards target if hitchance is high
 /// </summary>
 /// <param name="spell"></param>
 /// <param name="damageType"></param>
 /// <param name="extrarange"></param>
 /// <returns></returns>
 public Obj_AI_Base castCircleSkillShot(Spell spell,
     SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical, float extrarange = 0)
 {
     if (!spell.IsReady())
         return null;
     Obj_AI_Hero target = SimpleTs.GetTarget(spell.Range + extrarange, damageType);
     if (target == null)
         return null;
     if (target.IsValidTarget(spell.Range + extrarange) &&
         spell.GetPrediction(target).Hitchance >= HitChance.High)
         spell.Cast(target, true);
     return target;
 }
开发者ID:eejjii123,项目名称:LeagueSharp-1,代码行数:20,代码来源:Class1.cs


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