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


C# Spell.IsReady方法代码示例

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


在下文中一共展示了Spell.IsReady方法的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: Cast_BasicSkillshot_AOE_Farm

        public void Cast_BasicSkillshot_AOE_Farm(Spell spell, int extrawidth = 0)
        {
            if(!spell.IsReady())
                return;
            var minions = MinionManager.GetMinions(MyHero.ServerPosition, spell.Type == SkillshotType.SkillshotLine ? spell.Range : spell.Range + ((spell.Width + extrawidth) / 2), MinionTypes.All, MinionTeam.NotAlly);
            if(minions.Count == 0)
                return;
            MinionManager.FarmLocation castPostion;

            switch(spell.Type)
            {
                case SkillshotType.SkillshotCircle:
                    castPostion = MinionManager.GetBestCircularFarmLocation(minions.Select(minion => minion.ServerPosition.To2D()).ToList(), spell.Width + extrawidth, spell.Range);
                    break;
                case SkillshotType.SkillshotLine:
                    castPostion = MinionManager.GetBestLineFarmLocation(
                        minions.Select(minion => minion.ServerPosition.To2D()).ToList(), spell.Width, spell.Range);
                    break;
                default:
                    return;
            }
            spell.UpdateSourcePosition();
            if(castPostion.MinionsHit >= 2 || minions.Any(x => x.Team == GameObjectTeam.Neutral))
                spell.Cast(castPostion.Position, UsePackets());
        }
开发者ID:InjectionDev,项目名称:LeagueSharp-xSLx,代码行数:25,代码来源:Champion.cs

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

示例5: CastMec

        private static void CastMec(Spell spell, int minHit)
        {
            if (!spell.IsReady() || ObjectManager.Player.HealthPercent <= 10)
                return;

            foreach (var target in HeroManager.Enemies.Where(x => x.IsValidTarget(spell.Range)))
            {
                var pred = spell.GetPrediction(target, true);

                var nearByEnemies = 1;

                if (spell.Type == SkillshotType.SkillshotLine && spell.Collision)
                {
                    var poly = new Geometry.Polygon.Circle(pred.UnitPosition, spell.Width);

                    nearByEnemies +=
                        HeroManager.Enemies.Where(x => x.NetworkId != target.NetworkId)
                            .Count(enemy => poly.IsInside(enemy.ServerPosition));

                }
                else
                {
                    nearByEnemies = pred.AoeTargetsHitCount;
                }

                if (nearByEnemies >= minHit)
                {
                    
                    spell.Cast(target);
                    return;
                }
            }
        }
开发者ID:leenam0910,项目名称:LSharp,代码行数:33,代码来源:AOESpellManager.cs

示例6: UseSpellOnTeleport

        public void UseSpellOnTeleport(Spell spell)
        {
            if (!IsMenuEnabled("EOnTP") || (Environment.TickCount - LastCheck) < 1500)
            {
                return;
            }

            LastCheck = Environment.TickCount;
            var player = ObjectManager.Player;
            if (!spell.IsReady())
            {
                return;
            }

            foreach (
                var targetPosition in
                    ObjectManager.Get<Obj_AI_Hero>()
                        .Where(
                            obj =>
                                obj.Distance(player) < spell.Range && obj.Team != player.Team &&
                                obj.HasBuff("teleport_target", true)))
            {
                spell.Cast(targetPosition.ServerPosition);
            }
        }
开发者ID:GodLS,项目名称:LSharpWIP,代码行数:25,代码来源:PennyJinx.cs

示例7: CheckFor

 private static bool CheckFor(Spell spell, Obj_AI_Base target, float spellrange, string menuitem)
 {
     if (spell.IsReady() && target.IsValidTarget(spellrange) && !target.HasBuffOfType(BuffType.Invulnerability) && !target.HasBuff("UndyingRage") && !target.IsDead && Config.Item(menuitem).GetValue<bool>() == true)
     {
         return true;
     }
     else return false;
 }
开发者ID:LSharpAura,项目名称:LeagueSharp,代码行数:8,代码来源:Annie.cs

示例8: wardJump

        public static void wardJump(Vector2 pos)
        {
            Q = new Spell(SpellSlot.Q, 700);

            if (!Q.IsReady())
                return;

            var wardIs = false;

            if (!InDistance(pos, Player.ServerPosition.LSTo2D(), Q.Range))
            {
                pos = Player.ServerPosition.LSTo2D() + Vector2.Normalize(pos - Player.ServerPosition.LSTo2D())*600;
            }

            if (!Q.IsReady())
                return;

            foreach (var ally in ObjectManager.Get<Obj_AI_Base>().Where(ally => ally.IsAlly && !(ally is Obj_AI_Turret) && InDistance(pos, ally.ServerPosition.LSTo2D(), 200)))
            {
                wardIs = true;
                moveTo(pos);
                if (InDistance(Player.ServerPosition.LSTo2D(), ally.ServerPosition.LSTo2D(), Q.Range + ally.BoundingRadius))
                {
                    if (last < Environment.TickCount)
                    {
                        Q.Cast(ally);
                        last = Environment.TickCount + 2000;
                    }
                    else return;
                }
                return;
            }
            Polygon pol;
            if ((pol = Program.map.getInWhichPolygon(pos)) != null)
            {
                if (InDistance(pol.getProjOnPolygon(pos), Player.ServerPosition.LSTo2D(), Q.Range) && !wardIs &&
                    InDistance(pol.getProjOnPolygon(pos), pos, 250))
                {
                    putWard(pos);
                }
            }
            else if (!wardIs)
            {
                putWard(pos);
            }
        }
开发者ID:yMeliodasNTD,项目名称:PortAIO,代码行数:46,代码来源:Jumper.cs

示例9: wardJump

        public static void wardJump(Vector2 pos)
        {
            W = new Spell(SpellSlot.Q, 700);
            Vector2 posStart = pos;
            if (!W.IsReady())
                return;
            bool wardIs = false;
            if (!inDistance(pos, Player.ServerPosition.To2D(), W.Range+15))
            {
                pos = Player.ServerPosition.To2D() + Vector2.Normalize(pos - Player.ServerPosition.To2D())*600;
            }

            if(!W.IsReady() && W.ChargedSpellName == "")
                return;
            foreach (Obj_AI_Base ally in ObjectManager.Get<Obj_AI_Base>().Where(ally => ally.IsAlly
                && !(ally is Obj_AI_Turret) && inDistance(pos, ally.ServerPosition.To2D(), 200)))
            {
                    wardIs = true;
                moveTo(pos);
                if (inDistance(Player.ServerPosition.To2D(), ally.ServerPosition.To2D(), W.Range + ally.BoundingRadius))
                {
                    if (last < Environment.TickCount)
                    {
                        W.Cast(ally);
                        last = Environment.TickCount + 2000;
                    }
                    else return;
                }
                return;
            }
            Polygon pol;
            if ((pol = Program.map.getInWhichPolygon(pos)) != null)
            {
                if (inDistance(pol.getProjOnPolygon(pos), Player.ServerPosition.To2D(), W.Range + 15) && !wardIs && inDistance(pol.getProjOnPolygon(pos), pos, 200))
                {
                    putWard(pos);
                }
                
            }
            else if(!wardIs)
            {
                    putWard(pos);
            }

        }
开发者ID:CupidL0ve,项目名称:LeagueSharp,代码行数:45,代码来源:Jumper.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: 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

示例12: Karma

 static void Karma()
 {
     Game.PrintChat("Karma supported");
     var shield = new Spell(SpellSlot.E, 400);
     Game.OnUpdate += eventArgs =>
     {
         if (shield.IsReady() && ObjectManager.Player.CountEnemiesInRange(1500) > 0)
         {
             shield.CastOnUnit(ObjectManager.Player);
         }
     };
 }
开发者ID:amanditateamuh,项目名称:LeagueSharp,代码行数:12,代码来源:Program.cs

示例13: castLineSkillShot

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

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

示例15: TargetSkill

        public static void TargetSkill(Obj_AI_Base target, Spell spell, bool packet = false, bool towerCheck = false)
        {
            if (!spell.IsReady())
            {
                return;
            }

            if (target == null || towerCheck && target.UnderTurret(true))
            {
                return;
            }

            spell.Cast(target, packet);
        }
开发者ID:lukasi273,项目名称:SFX-5.12-update,代码行数:14,代码来源:Casting.cs


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