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


C# Obj_AI_Base.LSIsValidTarget方法代码示例

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


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

示例1: CastQTarget

 public static void CastQTarget(Obj_AI_Base target)
 {
     if (!target.LSIsValidTarget() || target.IsZombie || !Program._q.IsReady())
     if (!target.LSIsValidTarget(Program._q.Range) || target.IsZombie || !Program._q.IsReady())
          return;
     var pred = Program._q.GetPrediction(target);
     if (pred.Hitchance >= HitChance.Low)
     {
         Program._q.Cast(pred.CastPosition);
     }
     else
     {
         if (HasEBuff(target))
         {
             foreach (var tar in ObjectManager.Get<Obj_AI_Base>()
                 .Where(x => !x.IsAlly && HasEBuff(x) && !x.IsDead
                     && GetchainedTarget(x).Any(y => y.NetworkId == target.NetworkId)))
             {
                 var pred1 = Program._q.GetPrediction(tar);
                 if (pred1.Hitchance >= HitChance.Low)
                 {
                     Program._q.Cast(pred1.CastPosition);
                 }
             }
         }
     }
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:27,代码来源:Helper.cs

示例2: CastQ

        public static void CastQ(Obj_AI_Base t, float range = 980)
        {
            if (!Q.IsReady() || !t.LSIsValidTarget(range))
            {
                return;
            }

            if (t.HaveOlafSlowBuff() && t.LSIsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 65))
            {
                return;
            }

            var nDistance = ObjectManager.Player.LSDistance(t);
            var nExtend = 0;

            if (nDistance < 300)
            {
                nExtend = 40;
            }
            else if (nDistance >= 300 && nDistance < 500)
            {
                nExtend = 60;
            }
            else if (nDistance >= 500 && nDistance < 700)
            {
                nExtend = 80;
            }
            else if (nDistance >= 700 && nDistance < Q.Range)
            {
                nExtend = 100;
            }

            PredictionOutput qPredictionOutput = Q.GetPrediction(t);
            Vector3 castPosition = qPredictionOutput.CastPosition.LSExtend(ObjectManager.Player.Position, -nExtend);
            HitChance[] hitChances = new[]
            {
                HitChance.VeryHigh, HitChance.High, HitChance.Medium, HitChance.Low
            };

            if (qPredictionOutput.Hitchance >=
                (ObjectManager.Player.LSDistance(t.ServerPosition) >= 350
                    ? HitChance.VeryHigh
                    : hitChances[Modes.ModeSettings.QHitchance]) &&
                ObjectManager.Player.LSDistance(castPosition) < range)
            {
                Q.Cast(castPosition);
            }
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:48,代码来源:PlayerSpells.cs

示例3: CastQCombo

        public static void CastQCombo(Obj_AI_Base t)
        {
            //if (!Common.CommonHelper.ShouldCastSpell(CommonTargetSelector.GetTarget(Orbwalking.GetRealAutoAttackRange(null) + 65)))
            //{
            //    Game.PrintChat("Shen Active!");
            //    return;
            //}

            if (!Q.CanCast(t))
            {
                return;
            }

            if (getBoxItem(Modes.ModeCombo.MenuLocal, "Combo.Mode") == 1 && LastAutoAttackTick < LastSpellCastTick && t.LSIsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 65))
            {
                return;
            }

            if (Environment.TickCount - LastQCastTick < (getBoxItem(Modes.ModeSettings.MenuSettingQ, "Settings.Q.CastDelay") + 1) * 250)
            {
                return;
            }

            foreach (var enemy in Common.AutoBushHelper.EnemyInfo.Where(
                x =>
                    Q.CanCast(x.Player)
                    && Environment.TickCount - x.LastSeenForE >= (getBoxItem(Modes.ModeSettings.MenuSettingQ, "Settings.Q.VisibleDelay") + 1) * 250
                    && x.Player.NetworkId == t.NetworkId).Select(x => x.Player).Where(enemy => enemy != null))
            {
                Q.CastOnUnit(t);
                LastQCastTick = Environment.TickCount;
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:33,代码来源:PlayerSpells.cs

示例4: CastQ

        public static void CastQ(Obj_AI_Base t)
        {
            if (!t.LSIsValidTarget(Utils.Player.AutoAttackRange))
                return;

            Spells.Q.Cast();
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:7,代码来源:LaneClear.cs

示例5: CanHitSkillShot

        public static bool CanHitSkillShot(Obj_AI_Base target, GameObjectProcessSpellCastEventArgs args)
        {
            if (args.Target == null && target.LSIsValidTarget(float.MaxValue))
            {
                var pred = Prediction.Prediction.GetPrediction(target, 0.25f).CastPosition;
                if (pred == null)
                    return false;

                if (args.SData.LineWidth > 0)
                {
                    var powCalc = Math.Pow(args.SData.LineWidth + target.BoundingRadius, 2);
                    if (pred.LSTo2D().LSDistance(args.End.LSTo2D(), args.Start.LSTo2D(), true, true) <= powCalc ||
                        target.ServerPosition.LSTo2D().LSDistance(args.End.LSTo2D(), args.Start.LSTo2D(), true, true) <= powCalc)
                    {
                        return true;
                    }
                }
                else if (target.LSDistance(args.End) < 50 + target.BoundingRadius ||
                         pred.LSDistance(args.End) < 50 + target.BoundingRadius)
                {
                    return true;
                }
            }
            return false;
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:25,代码来源:OktwCommon.cs

示例6: Specials

        /// <summary>
        ///     Called on do-cast.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The args.</param>
        public static void Specials(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!Vars.TypesMenu["defensives"].Cast<CheckBox>().CurrentValue)
            {
                return;
            }

            if (sender != null &&
                args.Target != null)
            {
                /// <summary>
                ///     The Ohmwrecker logic.
                /// </summary>
                if (Items.CanUseItem(3056) &&
                    sender.LSIsValidTarget(750f))
                {
                    if (args.Target.IsAlly &&
                        sender is Obj_AI_Turret &&
                        args.Target is AIHeroClient)
                    {
                        Items.UseItem(3056, sender);
                    }
                }
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:30,代码来源:Specials.cs

示例7: CanHitCircle

 internal static bool CanHitCircle(this Spell spell, Obj_AI_Base unit)
 {
     if (!unit.LSIsValidTarget() || unit == null)
     {
         return false;
     }
     return spell.GetPredPosition(unit).DistanceToPlayer() < spell.Range;
 }
开发者ID:Xelamats,项目名称:PortAIO,代码行数:8,代码来源:Common.cs

示例8: OnCast

 private void OnCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (sender is AIHeroClient && sender.LSIsValidTarget())
     {
         if (args.SData.Name.ToLower().Equals("summonerflash") && args.End.LSDistance(ObjectManager.Player.ServerPosition) <= 365f)
         {
             Variables.spells[SpellSlot.E].CastOnUnit((AIHeroClient)sender);
         }
     }
 }
开发者ID:yMeliodasNTD,项目名称:PortAIO,代码行数:10,代码来源:FlashRepel.cs

示例9: GetComboDamage

        public static float GetComboDamage(Obj_AI_Base t)
        {
            var fComboDamage = 0d;

            if (Champion.PlayerSpells.Q.IsReady())
            {
                fComboDamage += ObjectManager.Player.LSGetSpellDamage(t, SpellSlot.Q);
            }

            //if (ObjectManager.Player.Health >= 20 && ObjectManager.Player.Health <= 50)
            //{
            //    fComboDamage += ObjectManager.Player.TotalAttackDamage*3;
            //}

            //if (ObjectManager.Player.Health > 50)
            //{
            //    fComboDamage += ObjectManager.Player.TotalAttackDamage * 7;
            //}

            if (Champion.PlayerSpells.E.IsReady())
            {
                fComboDamage += ObjectManager.Player.LSGetSpellDamage(t, SpellSlot.E);
            }

            if (Champion.PlayerSpells.R.IsReady())
            {
                fComboDamage += ObjectManager.Player.LSGetSpellDamage(t, SpellSlot.R) * 4;
            }

            if (t.LSIsValidTarget(Champion.PlayerSpells.Q.Range + Champion.PlayerSpells.E.Range) && Champion.PlayerSpells.Q.IsReady() && Champion.PlayerSpells.R.IsReady())
            {
                fComboDamage += ObjectManager.Player.TotalAttackDamage * 2;
            }

            fComboDamage += ObjectManager.Player.TotalAttackDamage * 2;

            if (CommonItems.Youmuu.IsReady())
            {
                fComboDamage += ObjectManager.Player.TotalAttackDamage * 3;
            }

            if (Common.CommonSummoner.IgniteSlot != SpellSlot.Unknown
                && ObjectManager.Player.Spellbook.CanUseSpell(Common.CommonSummoner.IgniteSlot) == SpellState.Ready)
            {
                fComboDamage += ObjectManager.Player.GetSummonerSpellDamage(t, Damage.SummonerSpell.Ignite);
            }

            if (LeagueSharp.Common.Items.CanUseItem(3128))
            {
                fComboDamage += ObjectManager.Player.GetItemDamage(t, Damage.DamageItems.Botrk);
            }

            return (float)fComboDamage;
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:54,代码来源:CommonMath.cs

示例10: CastR

        public static void CastR(Obj_AI_Base target)
        {
            if (R.IsReady())
            {
                if (Rstate == 1)
                {
                    if (target.LSIsValidTarget(R.Range))
                    {
                        R.Cast(target);
                    }
                }
                if (Rstate == 2)
                {
                    var t = LeagueSharp.Common.Prediction.GetPrediction(target, 400).CastPosition;
                    float x = target.MoveSpeed;
                    float y = x * 400 / 1000;
                    var pos = target.Position;
                    if (target.LSDistance(t) <= y)
                    {
                        pos = t;
                    }
                    if (target.LSDistance(t) > y)
                    {
                        pos = target.Position.LSExtend(t, y - 50);
                    }
                    if (Player.LSDistance(pos) <= 600)
                    {
                        R.Cast(pos);
                    }
                    if (Player.LSDistance(pos) > 600)
                    {
                        if (target.LSDistance(t) > y)
                        {
                            var pos2 = target.Position.LSExtend(t, y);
                            if (Player.LSDistance(pos2) <= 600)
                            {
                                R.Cast(pos2);
                            }
                            else
                            {
                                var prediction = R.GetPrediction(target);
                                if (prediction.HitChance >= EloBuddy.SDK.Enumerations.HitChance.High)
                                {
                                    var pos3 = prediction.CastPosition;
                                    var pos4 = Player.Position.LSExtend(pos3, 600);
                                    R.Cast(pos4);
                                }
                            }
                        }

                    }
                }
            }
        }
开发者ID:yMeliodasNTD,项目名称:PortAIO,代码行数:54,代码来源:Program.cs

示例11: CastE

 public static void CastE(Obj_AI_Base t)
 {
     if (E.IsReady() && t.LSIsValidTarget(Modes.ModeSettings.MaxERange))
     {
         HitChance[] hitChances = new[] { HitChance.VeryHigh, HitChance.High, HitChance.Medium, HitChance.Low };
         E.UpdateSourcePosition(ObjectManager.Player.ServerPosition, t.ServerPosition);
         if (E.GetPrediction(t).Hitchance >= hitChances[Modes.ModeSettings.EHitchance])
         {
             E.Cast(t, true);
         }
     }
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:12,代码来源:PlayerSpells.cs

示例12: CanQ

        internal static bool CanQ(Obj_AI_Base unit)
        {
            if (!unit.LSIsValidTarget() || unit.IsZombie ||
                TargetSelector.IsInvulnerable(unit, DamageType.Physical))
            {
                return false;
            }

            if (KL.Player.LSDistance(unit.ServerPosition) < 175 ||
                Utils.GameTimeTickCount - LastGrabTimeStamp < 350)
            {
                return false;
            }

            if (KL.Spellbook["R"].IsReady() &&
                KL.Player.Mana - KL.Spellbook["Q"].ManaCost < KL.Spellbook["R"].ManaCost)
            {
                return false;
            }

            if (KL.Spellbook["W"].IsReady() && KL.WDmg(unit) >= unit.Health &&
                unit.LSDistance(KL.Player.ServerPosition) <= 200)
            {
                return false;
            }

            if (KL.Spellbook["W"].IsReady() && KL.Player.HasBuff("DariusNoxonTactictsONH") &&
                unit.LSDistance(KL.Player.ServerPosition) <= 225)
            {
                return false;
            }

            if (KL.Player.LSDistance(unit.ServerPosition) > KL.Spellbook["Q"].Range)
            {
                return false;
            }

            if (KL.Spellbook["R"].IsReady() && KL.Spellbook["R"].IsInRange(unit) &&
                KL.RDmg(unit, PassiveCount(unit)) - KL.Hemorrhage(unit, 1) >= unit.Health)
            {
                return false;
            }

            if (KL.Player.GetAutoAttackDamage(unit) * 2 + KL.Hemorrhage(unit, PassiveCount(unit)) >= unit.Health &&
                KL.Player.LSDistance(unit.ServerPosition) <= 180)
            {
                return false;
            }

            return true;
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:51,代码来源:KurisuDarius.cs

示例13: Obj_AI_Base_OnBuffAdd

 static void Obj_AI_Base_OnBuffAdd(Obj_AI_Base sender, Obj_AI_BaseBuffGainEventArgs args)
 {
     foreach (var ally in Activator.Allies())
     {
         if (sender.LSIsValidTarget(1000) && !sender.IsZombie && sender.NetworkId == ally.Player.NetworkId)
         {
             if (args.Buff.Name == "rengarralertsound")
             {
                 ally.HitTypes.Add(HitType.Stealth);
                 LeagueSharp.Common.Utility.DelayAction.Add(100 + _random.Next(200, 450), () => ally.HitTypes.Remove(HitType.Stealth));
             }
         }
     }
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:14,代码来源:Stealth.cs

示例14: CastE2

        public static void CastE2(Obj_AI_Base t)
        {
            if (CommonHelper.SpellRStatus == CommonHelper.SpellRName.R2xE && E.IsReady() && t.LSIsValidTarget(Modes.ModeSettings.MaxERange))
            {
                HitChance[] hitChances = new[] { HitChance.VeryHigh, HitChance.High, HitChance.Medium, HitChance.Low};
                E.UpdateSourcePosition(ObjectManager.Player.ServerPosition, t.ServerPosition);
                if (E.GetPrediction(t).Hitchance >= hitChances[Modes.ModeSettings.EHitchance])
                {
                    E2.Cast(t, true);
                }

                //E2.UpdateSourcePosition(ObjectManager.Player.ServerPosition, t.ServerPosition);
                //if (E2.GetPrediction(t).Hitchance >= HitChance.High)
                //{
                //    E2.Cast(t);
                //}
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:18,代码来源:PlayerSpells.cs

示例15: Casting

 internal static LeagueSharp.SDK.Enumerations.CastStates Casting(
     this Spell spell,
     Obj_AI_Base unit,
     bool aoe = false,
     CollisionableObjects collisionable = CollisionableObjects.Minions | CollisionableObjects.YasuoWall)
 {
     if (!unit.LSIsValidTarget())
     {
         return CastStates.InvalidTarget;
     }
     if (!spell.IsReady())
     {
         return CastStates.NotReady;
     }
     if (spell.CastCondition != null && !spell.CastCondition())
     {
         return CastStates.FailedCondition;
     }
     var pred = spell.GetPrediction(unit, aoe, -1, collisionable);
     if (pred.CollisionObjects.Count > 0)
     {
         return CastStates.Collision;
     }
     if (spell.RangeCheckFrom.DistanceSquared(pred.CastPosition) > spell.RangeSqr)
     {
         return CastStates.OutOfRange;
     }
     if (pred.Hitchance < spell.MinHitChance
         && (!pred.Input.AoE || pred.Hitchance < HitChance.High || pred.AoeTargetsHitCount < 2))
     {
         return CastStates.LowHitChance;
     }
     if (!Program.Player.Spellbook.CastSpell(spell.Slot, pred.CastPosition))
     {
         return CastStates.NotCasted;
     }
     spell.LastCastAttemptT = Variables.TickCount;
     return CastStates.SuccessfullyCasted;
 }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:39,代码来源:Common.cs


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