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


C# Obj_AI_Base.IsValid方法代码示例

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


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

示例1: _GetQDmg

 public static double _GetQDmg(Obj_AI_Base target)
 {
     var dmgItem = 0d;
     if (Program.Sheen.IsOwned() && (Program.Sheen.IsReady() || Player.HasBuff("Sheen")))
     {
         dmgItem = Variables._Player.BaseAttackDamage;
     }
     if (Program.Trinity.IsOwned() && (Program.Trinity.IsReady() || Player.HasBuff("Sheen")))
     {
         dmgItem = Variables._Player.BaseAttackDamage * 2;
     }
     var k = 1d;
     var reduction = 0d;
     var dmg = Variables._Player.TotalAttackDamage * (Variables._Player.Crit >= 0.85f ? (Item.HasItem(3031) ? 1.875 : 1.5) : 1)
               + dmgItem;
     if (Item.HasItem(3153))
     {
         var dmgBotrk = Math.Max(0.08 * target.Health, 10);
         if (target.IsValid<Obj_AI_Minion>())
         {
             dmgBotrk = Math.Min(dmgBotrk, 60);
         }
         dmg += dmgBotrk;
     }
     if (target.IsValid<AIHeroClient>())
     {
         var hero = (AIHeroClient)target;
         if (Item.HasItem(3047, hero))
         {
             k *= 0.9d;
         }
         if (hero.ChampionName == "Fizz")
         {
             reduction += hero.Level > 15
                              ? 14
                              : (hero.Level > 12
                                     ? 12
                                     : (hero.Level > 9 ? 10 : (hero.Level > 6 ? 8 : (hero.Level > 3 ? 6 : 4))));
         }
         var mastery = hero.Masteries.MinOrDefault(m => m.Page == MasteryPage.Defense && m.Id == 65);
         if (mastery != null && mastery.Points > 0)
         {
             reduction += 1 * mastery.Points;
         }
     }
     return Variables._Player.CalculateDamageOnUnit(target, DamageType.Physical, 20 * Program.Q.Level + (float)(dmg - reduction) * (float)k)
            + (Variables._Player.GetBuffCount("ItemStatikShankCharge") == 100
                   ? Variables._Player.CalculateDamageOnUnit(
                       target,
                       DamageType.Magical,
                       100 * (float)(Variables._Player.Crit >= 0.85f ? (Item.HasItem(3031) ? 2.25 : 1.8) : 1))
                   : 0);
 }
开发者ID:Kysamaa,项目名称:Developing,代码行数:53,代码来源:DamageManager.cs

示例2: OnDoCast

        /// <summary>
        /// Called when a cast has been executed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The args.</param>
        public static void OnDoCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            /// <summary>
            /// Load the Ohmwrecker logic.
            /// </summary>
            if (sender != null &&
                args.Target != null &&
                args.Target.IsAlly &&
                sender.IsValid<Obj_AI_Turret>() &&
                args.Target.IsValid<Obj_AI_Hero>() &&
                Variables.Menu.Item($"{Variables.MainMenuName}.defensives").GetValue<bool>())
            {
                Ohmwrecker.Execute(sender, args);
            }

            /// <summary>
            /// Load the Offensive items.
            /// </summary>
            if (sender.IsMe &&
                Orbwalking.IsAutoAttack(args.SData.Name) &&
                Variables.Menu.Item($"{Variables.MainMenuName}.resetters").GetValue<bool>() &&
                (Variables.Menu.Item($"{Variables.MainMenuName}.combo_button").GetValue<KeyBind>().Active ||
                    Variables.Menu.Item($"{Variables.MainMenuName}.laneclear_button").GetValue<KeyBind>().Active))
            {
                Resetters.Execute(sender, args);
            }
        }
开发者ID:ShineSharp,项目名称:ExoryREPO,代码行数:32,代码来源:NabbActivator.cs

示例3: ObjAiHeroOnOnNewPath

        private static void ObjAiHeroOnOnNewPath(Obj_AI_Base sender, GameObjectNewPathEventArgs args)
        {
            if (sender.IsValid<AIHeroClient>())
            {
                if (!DetectedDashes.ContainsKey(sender.NetworkId))
                {
                    DetectedDashes.Add(sender.NetworkId, new DashItem());
                }

                if (args.IsDash)
                {
                    var path = new List<Vector2> { sender.ServerPosition.To2D2() };
                    path.AddRange(args.Path.ToList().To2D2());

                    DetectedDashes[sender.NetworkId].StartTick = Utils.TickCount;
                    DetectedDashes[sender.NetworkId].Speed = args.Speed;
                    DetectedDashes[sender.NetworkId].StartPos = sender.ServerPosition.To2D2();
                    DetectedDashes[sender.NetworkId].Unit = sender;
                    DetectedDashes[sender.NetworkId].Path = path;
                    DetectedDashes[sender.NetworkId].EndPos = DetectedDashes[sender.NetworkId].Path.Last();
                    DetectedDashes[sender.NetworkId].EndTick = DetectedDashes[sender.NetworkId].StartTick +
                                                           (int)
                                                               (1000 *
                                                                (DetectedDashes[sender.NetworkId].EndPos.Distance7(
                                                                    DetectedDashes[sender.NetworkId].StartPos) / DetectedDashes[sender.NetworkId].Speed));
                    DetectedDashes[sender.NetworkId].Duration = DetectedDashes[sender.NetworkId].EndTick - DetectedDashes[sender.NetworkId].StartTick;

                    CustomEvents.Unit.TriggerOnDash(DetectedDashes[sender.NetworkId].Unit, DetectedDashes[sender.NetworkId]);
                }
                else
                {
                    DetectedDashes[sender.NetworkId].EndTick = 0;
                }
            }
        }
开发者ID:wearegodz,项目名称:WeAreGodz,代码行数:35,代码来源:Dash.cs

示例4: OnProcessSpellCast

        /// <summary>
        /// Called while processing Spellcast operations.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The args.</param>
        public static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (args.Target != null &&
                args.Target.IsMe &&
                args.Target.IsValid &&

                ((sender.IsEnemy &&
                    sender.IsValid<Obj_AI_Hero>()) ||

                (sender.IsValid<Obj_AI_Minion>() &&
                    sender.CharData.BaseSkinName.Equals("SRU_Dragon"))) &&

                !ObjectManager.Player.IsInvulnerable &&
                !Bools.IsSpellShielded(ObjectManager.Player))
            {
                Logics.ExecuteShield(sender, args);
            }
        }
开发者ID:ShineSharp,项目名称:ExoryREPO,代码行数:23,代码来源:Sivir.cs

示例5: OnProcessSpellCast

 protected override void OnProcessSpellCast(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs spell)
 {
     if (unit.IsMe)
     {
         if (spell.SData.Name.ToLower().Contains("udyr") && spell.SData.Name.ToLower().Contains("stance"))
         {
             LastAny = myUtility.TickCount;
         }
         if (spell.SData.Name.ToLower() == "udyrtigerstance")
         {
             LastQ = myUtility.TickCount;
         }
         if (spell.SData.Name.ToLower() == "udyrturtlestance")
         {
             LastW = myUtility.TickCount;
         }
         if (spell.SData.Name.ToLower() == "udyrbearstance")
         {
             LastE = myUtility.TickCount;
         }
         if (spell.SData.Name.ToLower() == "udyrphoenixstance")
         {
             LastR = myUtility.TickCount;
         }
     }
     if (!unit.IsMe && unit.IsEnemy && unit.IsValid<Obj_AI_Hero>())
     {
         if (spell.Target == null || !spell.Target.IsValid || !spell.Target.IsMe)
         {
             return;
         }
         if (!spell.SData.IsAutoAttack() && spell.Target.IsMe && E.IsReady())
         {
             if (unit.IsChampion(unit.BaseSkinName))
             {
                 if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.Combo)
                 {
                     if (config.Item("UseWCombo").GetValue<bool>() && !Active(null))
                     {
                         Utility.DelayAction.Add(myUtility.RandomDelay(0, 200), () => W.Cast());
                     }
                 }
                 if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.Harass)
                 {
                     if (config.Item("UseWHarass").GetValue<bool>())
                     {
                         Utility.DelayAction.Add(myUtility.RandomDelay(0, 200), () => W.Cast());
                     }
                 }
                 if (config.Item("UseWMisc").GetValue<bool>() && !Active(null))
                 {
                     Utility.DelayAction.Add(myUtility.RandomDelay(0, 200), () => W.Cast());
                 }
             }
         }
     }
 }
开发者ID:Shpaamyi,项目名称:LeagueSharp,代码行数:57,代码来源:Udyr.cs

示例6: OnProcessSpellCast

 /// <summary>
 /// Called when a cast gets executed.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The args.</param>
 public static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (sender != null &&
         sender.IsEnemy &&
         sender.IsValid<Obj_AI_Hero>())
     {
         Logics.ExecuteSpellCast(sender, args);
     }
 }
开发者ID:ShineSharp,项目名称:ExoryREPO,代码行数:14,代码来源:Jinx.cs

示例7: Obj_AI_Hero_OnProcessSpellCast

 /// <summary>
 /// Called while processing Spellcast operations.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The args.</param>
 public static void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (Variables.E.IsReady() &&
         sender.IsValid<Obj_AI_Hero>() &&
         sender != null &&
         sender.IsEnemy)
     {
         Logics.ExecuteShield(sender, args);
     }
 }
开发者ID:ExoryREPO2,项目名称:LuckFegacy,代码行数:15,代码来源:ExorSivir.cs

示例8: Obj_AI_Base_OnDoCast

 /// <summary>
 /// Called when a cast has been executed.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The args.</param>
 public static void Obj_AI_Base_OnDoCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (ItemData.Ohmwrecker.GetItem().IsReady())
     {
         if (sender.IsValid<Obj_AI_Turret>() &&
             args.Target.IsValid<Obj_AI_Hero>() &&
             args.Target.IsAlly &&
             Variables.Menu.Item($"{Variables.MainMenuName}.defensives").GetValue<bool>())
         {
             ItemData.Ohmwrecker.GetItem().Cast((Obj_AI_Turret)args.Target);
         }
     }
 }
开发者ID:ExoryREPO2,项目名称:LuckFegacy,代码行数:18,代码来源:NabbActivator.cs

示例9: Obj_AI_Base_OnIssueOrder

        private static void Obj_AI_Base_OnIssueOrder(Obj_AI_Base sender, GameObjectIssueOrderEventArgs args)
        {
            var senderValid = sender.IsValid() && sender.IsMe;

            if (!senderValid || !args.Order.Equals(GameObjectOrder.MoveTo) ||
                !Menu.GetValue<MenuBool>("MovementEnabled").Value)
            {
                return;
            }

            if (Variables.TickCount - LastMove < Menu.GetValue<MenuSlider>("MovementDelay").Value)
            {
                args.Process = false;
                return;
            }

            LastMove = Variables.TickCount;
        }
开发者ID:tr33s,项目名称:LeagueSharp2,代码行数:18,代码来源:Program.cs

示例10: ProcessSpell_OrianaRedactCommand

        private static void ProcessSpell_OrianaRedactCommand(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            if (!hero.IsValid<Obj_AI_Hero>())
                return;

            var champ = (Obj_AI_Hero)hero;

            if (champ.ChampionName == "Orianna" && champ.IsEnemy)
            {
                if (args.SData.Name == "OrianaRedactCommand")
                {
                    foreach (KeyValuePair<int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                    {
                        var info = entry.Value;

                        if (entry.Value.Name == "TheDoomBall")
                        {
                            info.usePosition = false;
                            info.obj = args.Target;
                        }
                    }
                }
            }
        }
开发者ID:aikoy,项目名称:ezEvade,代码行数:24,代码来源:Orianna.cs

示例11: Cast

 public static CastStates Cast(Spell spell, Obj_AI_Base unit, bool areaOfEffect = false)
 {
     if (!unit.IsValid())
     {
         return CastStates.InvalidTarget;
     }
     if (!spell.IsReady())
     {
         return CastStates.NotReady;
     }
     var pred = GetPrediction(spell, unit, areaOfEffect);
     if (pred.CollisionObjects.Count > 0)
     {
         return CastStates.Collision;
     }
     if (pred.Hitchance < spell.MinHitChance)
     {
         return CastStates.LowHitChance;
     }
     spell.LastCastAttemptT = Variables.TickCount;
     return !ObjectManager.Player.Spellbook.CastSpell(spell.Slot, pred.CastPosition)
                ? CastStates.NotCasted
                : CastStates.SuccessfullyCasted;
 }
开发者ID:seniseviy,项目名称:LeagueSharp-6,代码行数:24,代码来源:Common.cs

示例12: Interrupter2_OnInterruptableTarget

        private static void Interrupter2_OnInterruptableTarget(Obj_AI_Base sender,
            Interrupter.InterruptableSpellEventArgs e)
        {
            try
            {
                if (Player.IsDead)
                    return;
                if (!sender.IsEnemy || !sender.IsValid<AIHeroClient>())
                    return;

                if (getCheckBoxItem(MiscMenu, "Blitzcrank_InterQ") && _Q.IsReady())
                {
                    if (sender.LSDistance(Player.ServerPosition, true) <= _Q.RangeSqr)
                        _Q.Cast(sender);
                }
                if (getCheckBoxItem(MiscMenu, "Blitzcrank_InterR") && _R.IsReady())
                {
                    if (sender.LSDistance(Player.ServerPosition, true) <= _R.RangeSqr)
                        _R.Cast();
                }
                if (getCheckBoxItem(MiscMenu, "Blitzcrank_InterE") && _E.IsReady())
                {
                    if (sender.LSDistance(Player.ServerPosition, true) <= _E.RangeSqr)
                        _E.CastOnUnit(Player);
                }
            }
            catch (Exception)
            {
                if (FreshCommon.NowTime() > ErrorTime)
                {
                    Chat.Print(ChampName + " in FreshBooster isn't Load. Error Code 09");
                    ErrorTime = FreshCommon.TickCount(10000);
                }
            }
        }
开发者ID:,项目名称:,代码行数:35,代码来源:

示例13: Obj_AI_Base_OnProcessSpellCast

        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!E.IsReady() || args.Target == null || !sender.IsEnemy || !args.Target.IsMe || !sender.IsValid<Obj_AI_Hero>() || args.SData.Name == "TormentedSoil")
                return;

            if (Config.Item("spell" + args.SData.Name) != null && !Config.Item("spell" + args.SData.Name).GetValue<bool>())
                return;

            var dmg = sender.GetSpellDamage(ObjectManager.Player, args.SData.Name);
            double HpLeft = ObjectManager.Player.Health - dmg;
            double HpPercentage = (dmg * 100) / Player.Health;

            if ( HpPercentage >= Config.Item("Edmg", true).GetValue<Slider>().Value && sender.IsEnemy && args.Target.IsMe && !args.SData.IsAutoAttack() && Config.Item("autoE", true).GetValue<bool>() )
            {
                E.Cast();
            }
        }
开发者ID:47110572,项目名称:LeagueRepo,代码行数:17,代码来源:Sivir.cs

示例14: OnProcessSpellCast

        private void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsMe && args.SData.Name == "ReapTheWhirlwind")
            {
                this.Orbwalker.SetAttack(false);
                this.Orbwalker.SetMovement(false);
                this.IsUltChanneling = true;
            }

            if (!this.E.IsReady() || !this.E.IsInRange(sender))
            {
                return;
            }

            // Boost Damage
            // Caster ally / target enemy hero
            if (sender.IsValid<Obj_AI_Hero>() && sender.IsAlly && !sender.IsMe)
            {
                var spell = args.SData.Name;
                var caster = (Obj_AI_Hero)sender;

                if (DamageBoostDatabase.Spells.Any(s => s.Spell == spell) && caster.CountEnemiesInRange(2000) > 0)
                {
                    switch (this.ConfigValue<Slider>("Misc.E.Spell." + args.SData.Name).Value) // prio 0 = disabled
                    {
                        case 1:
                            if (this.Player.ManaPercent > this.ConfigValue<Slider>("Mana.E.Priority.1").Value)
                            {
                                this.E.CastOnUnit(caster);
                                Console.WriteLine("DMG Boost " + spell);
                            }
                            break;
                        case 2:
                            if (this.Player.ManaPercent > this.ConfigValue<Slider>("Mana.E.Priority.2").Value)
                            {
                                this.E.CastOnUnit(caster);
                                Console.WriteLine("DMG Boost " + spell);
                            }
                            break;
                        case 3:
                            if (this.Player.ManaPercent > this.ConfigValue<Slider>("Mana.E.Priority.3").Value)
                            {
                                this.E.CastOnUnit(caster);
                                Console.WriteLine("DMG Boost " + spell);
                            }
                            break;
                    }
                }
            }
        }
开发者ID:654955321,项目名称:HY_Recommend,代码行数:50,代码来源:Janna.cs

示例15: Obj_AI_Base_OnProcessSpellCast

        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (args.Target == null && !Q.IsReady())
                return;

            if (sender.IsValid<Obj_AI_Hero>() && sender.IsEnemy && args.Target.IsMe && args.SData.IsAutoAttack())
            {
                var target2 = ObjectManager.Get<Obj_AI_Hero>().Find(x => x.NetworkId == sender.NetworkId);
                if (ActiveR && target2.IsValidTarget(500))
                {
                    Q.Cast();
                    return;
                }

                Q.Cast(target2);
                //Game.PrintChat("" + HpPercentage);
            }
        }
开发者ID:0s0speedy,项目名称:LeagueRepo,代码行数:18,代码来源:Quinn.cs


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