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


C# AttackableUnit.IsValid方法代码示例

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


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

示例1: OnAfterAttack

 protected override void OnAfterAttack(AttackableUnit unit, AttackableUnit target)
 {
     if (!unit.IsMe) return;
     if (unit.IsMe )
     {
         if (target is Obj_AI_Hero && target.IsValid<Obj_AI_Hero>() && target.IsValidTarget())
         {
             if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.Combo)
             {
                 if (config.Item("UseItemCombo").GetValue<bool>() && !Player.IsWindingUp)
                 {
                     myUtility.UseItems(2, null);
                 }
                 if (config.Item("UseQCombo").GetValue<bool>() && !Player.IsWindingUp && Orbwalking.InAutoAttackRange(target) && Q.IsReady())
                 {
                     Q.Cast();
                 }
             }
         }
         if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.LaneClear)
         {
             if (target is Obj_AI_Turret && target.Team != Player.Team &&
                 config.Item("UseQMisc").GetValue<bool>() &&
                 !Player.IsWindingUp && Orbwalking.InAutoAttackRange(target) && Q.IsReady())
             {
                 Q.Cast();
             }
         }
     }
 }
开发者ID:Shpaamyi,项目名称:LeagueSharp,代码行数:30,代码来源:Shyvana.cs

示例2: AfterAttack

        private void AfterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (!unit.IsMe || !unit.IsValid<Obj_AI_Base>())
            {
                return;
            }

            if (Variables.Spells[SpellSlot.Q].IsEnabledAndReady(ModesMenuExtensions.Mode.Combo)
                || (Variables.Spells[SpellSlot.Q].IsEnabledAndReady(ModesMenuExtensions.Mode.Harrass)
                && ObjectManager.Player.ManaPercent >= Variables.AssemblyMenu.GetItemValue<Slider>("dzaio.champion.extra.mixed.mana").Value))
            {
                if (target.IsValid<Obj_AI_Hero>() && target.IsValidTarget())
                {
                    Variables.Spells[SpellSlot.Q].CastIfHitchanceEquals(target as Obj_AI_Hero, HitChance.High);
                }
            }

            if (Variables.Spells[SpellSlot.W].IsEnabledAndReady(ModesMenuExtensions.Mode.Combo)
                || (Variables.Spells[SpellSlot.W].IsEnabledAndReady(ModesMenuExtensions.Mode.Harrass)
                && ObjectManager.Player.ManaPercent >= Variables.AssemblyMenu.GetItemValue<Slider>("dzaio.champion.extra.mixed.mana").Value))
            {
                if (target.IsValid<Obj_AI_Hero>() && target.IsValidTarget())
                {
                    Variables.Spells[SpellSlot.W].CastIfHitchanceEquals(target as Obj_AI_Hero, HitChance.High);
                }
            }
        }
开发者ID:DZ191,项目名称:LeagueSharp,代码行数:27,代码来源:Ezreal.cs

示例3: AfterAttack

 internal static void AfterAttack(AttackableUnit unit, AttackableUnit target)
 {
     if (target.IsValidTarget() && unit.IsValid<Obj_AI_Hero>() && unit.IsMe)
     {
         LastTarget = target;
     }
 }
开发者ID:DZ191,项目名称:LeagueSharp,代码行数:7,代码来源:PlayerMonitor.cs

示例4: AttackableUnit_OnEnterVisiblityClient

 private static void AttackableUnit_OnEnterVisiblityClient(AttackableUnit sender, EventArgs args)
 {
     if (sender != null && sender.IsValid<Obj_AI_Hero>() && sender.IsEnemy && sender.DistanceToPlayer() < 1000)
     {
         UpdatePassiveList();
     }
 }
开发者ID:StopMotionCuber,项目名称:LeagueSharp-1,代码行数:7,代码来源:PassiveManager.cs

示例5: AfterAttack

 public static void AfterAttack(AttackableUnit sender, AttackableUnit target)
 {
     if (sender.IsMe && target.IsValid<Obj_AI_Hero>())
     {
         var tg = target as Obj_AI_Hero;
         if (tg == null) return;
         var mode = Program.ComboMenu.Item("QMode").GetValue<StringList>().SelectedValue;
         var tumblePosition = Game.CursorPos;
         switch (mode)
         {
             case "PRADA":
                 tumblePosition = tg.GetTumblePos();
                 break;
             default:
                 tumblePosition = Game.CursorPos;
                 break;
         }
         Tumble.Cast(tumblePosition);
     }
     if (sender.IsMe && target.IsValid<Obj_AI_Minion>())
     {
         if (Program.Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.LaneClear)
         {
             var meleeMinion = ObjectManager.Get<Obj_AI_Minion>().FirstOrDefault(m => m.IsMelee);
             if (Program.LaneClearMenu.Item("QWaveClear").GetValue<bool>() && ObjectManager.Player.ManaPercent >= Program.LaneClearMenu.Item("QWaveClearMana").GetValue<Slider>().Value && meleeMinion.IsValidTarget())
             {
                 if (ObjectManager.Player.Level == 1)
                 {
                     Tumble.Cast(meleeMinion.GetTumblePos());
                 }
                 if (ObjectManager.Player.CountEnemiesInRange(1600) == 0)
                 {
                     Tumble.Cast(meleeMinion.GetTumblePos());
                 }
             }
             if (target.Name.Contains("SRU_"))
             {
                 Tumble.Cast(((Obj_AI_Base)target).GetTumblePos());
             }
         }
     }
 }
开发者ID:q51251,项目名称:LeagueSharp-1,代码行数:42,代码来源:AfterAttack.cs

示例6: OnAttack

 /// <summary>
 /// Called on-attack request.
 /// </summary>
 /// <param name="unit">The sender.</param>
 /// <param name="target">The target.</param>
 public static void OnAttack(AttackableUnit unit, AttackableUnit target)
 {
     if (unit.IsMe &&
         target.IsValid<Obj_AI_Hero>() &&
         !((Obj_AI_Hero)target).IsInvulnerable &&
         !Bools.IsSpellShielded((Obj_AI_Hero)target) &&
         Variables.Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.None &&
         Variables.Menu.Item($"{Variables.MainMenuName}.misc.resets").IsActive())
     {
         Logics.ExecuteBetaModes(unit, target);
     }
 }
开发者ID:ShineSharp,项目名称:ExoryREPO,代码行数:17,代码来源:Vayne.cs

示例7: AfterAttack

        public static void AfterAttack(AttackableUnit sender, AttackableUnit target)
        {
            if (!Q.IsReady())
            {
                _tumbleToKillSecondMinion = false;
                return;
            }
            if (!target.IsValid<Obj_AI_Hero>() || !ComboMenu.Item("QCombo").GetValue<bool>() || !sender.IsMe) return;
            if (!Flash.IsReady() && Environment.TickCount - FlashTime < 500) return;
            var tg = target as Obj_AI_Hero;
            if (tg == null) return;
            var mode = ComboMenu.Item("QMode").GetValue<StringList>().SelectedValue;
            switch (mode)
            {
                case "PRADA":
                    TumbleOrder = tg.GetTumblePos();
                    break;
                case "TUMBLEANDCONDEMN":
                    TumbleOrder = tg.ServerPosition.GetCondemnPosition();
                    break;
                default:
                    TumbleOrder = Game.CursorPos;
                    break;
            }
            if (Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.Combo)
            {
                Q.Cast(TumbleOrder);
                return;
            }

            if (_tumbleToKillSecondMinion && LaneClearMenu.Item("QLastHit").GetValue<bool>() && (Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.LaneClear || Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.LastHit) &&  Player.ManaPercent > LaneClearMenu.Item("QLastHitMana").GetValue<Slider>().Value)
            {
                TumbleOrder = Game.CursorPos;
                Q.Cast(TumbleOrder);
                _tumbleToKillSecondMinion = false;
            }

            if (Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.LaneClear &&
                LaneClearMenu.Item("QWaveClear").GetValue<bool>() && Player.ManaPercent >
                LaneClearMenu.Item("QWaveClearMana").GetValue<Slider>().Value &&
                !Orbwalker.ShouldWait())
            {
                TumbleOrder = Game.CursorPos;
                Q.Cast(TumbleOrder);
            }
        }
开发者ID:Hydro202,项目名称:Leaguesharp,代码行数:46,代码来源:Program.cs

示例8: AfterAttack

 public static void AfterAttack(AttackableUnit sender, AttackableUnit target)
 {
     if (target.IsValid<Obj_AI_Hero>())
     {
         var tg = target as Obj_AI_Hero;
         if (tg.IsValidTarget())
         {
             if (Program.ComboMenu.Item("ChaseW").GetValue<bool>() && Program.Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.Combo
                 && ObjectManager.Player.IsFacing(tg) && !tg.IsFacing(ObjectManager.Player))
             {
                 Program.W.Cast();
             }
         }
     }
     if (target is Obj_AI_Turret)
     {
         if (Program.LaneClearMenu.Item("WTowers").GetValue<bool>())
         {
             Program.W.Cast();
         }
     }
 }
开发者ID:q51251,项目名称:LeagueSharp-1,代码行数:22,代码来源:AfterAttack.cs

示例9: AfterAttack

 public static void AfterAttack(AttackableUnit sender, AttackableUnit target)
 {
     if (sender.IsMe && target.IsValid<Obj_AI_Hero>())
     {
         var tg = target as Obj_AI_Hero;
         if (tg == null) return;
         var mode = Program.ComboMenu.Item("QMode").GetValue<StringList>().SelectedValue;
         var tumblePosition = Game.CursorPos;
         switch (mode)
         {
             case "PRADA":
                 tumblePosition = tg.GetTumblePos();
                 break;
             default:
                 tumblePosition = Game.CursorPos;
                 break;
         }
         if (Program.Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.Combo)
         {
             Tumble.Cast(tumblePosition);
             return;
         }
     }
 }
开发者ID:47110572,项目名称:LeagueSharp-3,代码行数:24,代码来源:AfterAttack.cs

示例10: OnAfterAttack

        public override void OnAfterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (!unit.IsMe)
            {
                return;
            }

            if (!target.IsValid<Obj_AI_Hero>() && !target.Name.ToLower().Contains("ward"))
            {
                return;
            }

            if (!E.IsReady())
            {
                return;
            }

            if (E.Cast())
            {
                Orbwalking.ResetAutoAttackTimer();
                Player.IssueOrder(GameObjectOrder.AttackUnit, target);
            }
        }
开发者ID:amanditateamuh,项目名称:LeagueSharp,代码行数:23,代码来源:Blitzcrank.cs

示例11: OnAfterAttack

        private static void OnAfterAttack(AttackableUnit target, EventArgs args)
        {
            if (!target.IsMe || !target.IsValid) return;

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                if (getCheckBoxItem(comboMenu, "com.isivir.combo.useW") && target.IsValid<AIHeroClient>())
                    {
                        if (ObjectManager.Player.LSGetAutoAttackDamage((AIHeroClient)target, true)
                            * getSliderItem(miscMenu, "com.isivir.miscc.noW") > target.Health) return;

                        Spells[SpellSlot.W].Cast();
                    }

                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
                {
                    if (getCheckBoxItem(harassMenu, "com.isivir.harass.useW") && target.IsValid<AIHeroClient>()
                        && ObjectManager.Player.ManaPercent
                        >= getSliderItem(harassMenu, "com.isivir.harass.mana"))
                    {
                        Spells[SpellSlot.W].Cast();
                    }

                    if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear))
                    {
                        if (getCheckBoxItem(laneMenu, "com.isivir.laneclear.useW") && target.IsValid<Obj_AI_Minion>()
                        && ObjectManager.Player.ManaPercent
                        >= getSliderItem(laneMenu, "com.isivir.laneclear.mana"))
                    {
                        Spells[SpellSlot.W].Cast();
                    }
            }
                }
            }
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:35,代码来源:Sivir.cs

示例12: Orbwalking_AfterAttack

        static void Orbwalking_AfterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (!unit.IsValid || !unit.IsMe)
            {
                return;
            }

            if (Config.Item("usecombo").GetValue<KeyBind>().Active && Player.ManaPercent >
                Config.Item("combomana").GetValue<Slider>().Value)
            {
                if (Config.Item("usecombow").GetValue<bool>() &&
                    target.IsValid<Obj_AI_Hero>())
                {
                    W.Cast();
                }
            }

            if (Config.Item("useharass").GetValue<KeyBind>().Active && Player.ManaPercent >
                Config.Item("harassmana").GetValue<Slider>().Value)
            {
                if (Config.Item("useharassw").GetValue<bool>() &&
                    target.IsValid<Obj_AI_Hero>() && IsWhiteListed((Obj_AI_Hero)target))
                {
                    W.Cast();
                }
            }

            if (Config.Item("useclear").GetValue<KeyBind>().Active && Player.ManaPercent >
                Config.Item("clearmana").GetValue<Slider>().Value)
            {
                if (Config.Item("useclearw").GetValue<bool>() &&
                    target.IsValid<Obj_AI_Minion>())
                {
                    W.Cast();
                }
            }
        }
开发者ID:TerencePerson,项目名称:KurisuSolutions,代码行数:37,代码来源:KurisuSivir.cs

示例13: Orbwalk

 public static void Orbwalk(AttackableUnit target)
 {
     if (target.IsValidTarget() && CanAttack && IsAllowedToAttack)
     {
         disableNextAttack = false;
         FireBeforeAttack(target);
         if (!disableNextAttack
             && (CurrentMode != Mode.Harass || !target.IsValid<Obj_AI_Minion>()
                 || config.Item("OW_Harass_LastHit").IsActive()))
         {
             lastAttack = Utils.GameTimeTickCount + Game.Ping + 100 - (int)(Player.AttackCastDelay * 1000);
             missileLaunched = false;
             if (Player.Distance(target, true) > Math.Pow(GetAutoAttackRange(target) - 65, 2) && !Player.IsMelee)
             {
                 lastAttack = Utils.GameTimeTickCount + Game.Ping + 400 - (int)(Player.AttackCastDelay * 1000);
             }
             if (!Player.IssueOrder(GameObjectOrder.AttackUnit, target))
             {
                 //ResetAutoAttack();
             }
             lastTarget = target;
             return;
         }
     }
     if (!CanMove || !IsAllowedToMove)
     {
         return;
     }
     if (config.Item("OW_Combo_MeleeMagnet").IsActive() && CurrentMode == Mode.Combo && Player.IsMelee
         && Player.AttackRange < 200 && InAutoAttackRange(target) && target.IsValid<Obj_AI_Hero>()
         && ((Obj_AI_Hero)target).Distance(Game.CursorPos) < 300)
     {
         MovePrediction.Delay = Player.BasicAttack.SpellCastTime;
         MovePrediction.Speed = Player.BasicAttack.MissileSpeed;
         MoveTo(MovePrediction.GetPrediction((Obj_AI_Hero)target).UnitPosition);
     }
     else
     {
         MoveTo(Game.CursorPos);
     }
 }
开发者ID:pandaChoi,项目名称:LeagueSharp-3,代码行数:41,代码来源:Orbwalker.cs

示例14: OrbwalkingOnAfterAttack

        private static void OrbwalkingOnAfterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (!unit.IsValid || !unit.IsMe)
            {
                return;
            }

            if (!target.IsValid<Obj_AI_Hero>())
            {
                return;
            }

            var targetAsHero = (Obj_AI_Hero) target;
            if (ProSeries.Player.GetSpellDamage(targetAsHero, SpellSlot.W) / W.Delay >
                ProSeries.Player.GetAutoAttackDamage(targetAsHero, true) * (1 / ProSeries.Player.AttackDelay))
            {
                W.Cast(targetAsHero);
            }
        }
开发者ID:fgpmaia,项目名称:LeagueSharp-1,代码行数:19,代码来源:Jinx.cs

示例15: Orbwalking_OnAfterAttack

        private static void Orbwalking_OnAfterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (!unit.IsValid || !unit.IsMe)
            {
                return;
            }

            if (ProSeries.CanCombo())
            {
                if (ProSeries.Config.Item("usecombow", true).GetValue<bool>() &&
                    target.IsValid<Obj_AI_Hero>())
                {
                    W.Cast();
                }
            }

            if (ProSeries.CanHarass())
            {
                if (ProSeries.Config.Item("useharassw", true).GetValue<bool>() &&
                    target.IsValid<Obj_AI_Hero>() && ProSeries.IsWhiteListed((Obj_AI_Hero) target))
                {
                    W.Cast();
                }
            }

            if (ProSeries.CanClear())
            {
                if (ProSeries.Config.Item("useclearw", true).GetValue<bool>() &&
                    target.IsValid<Obj_AI_Minion>())
                {
                    W.Cast();
                }
            }
        }
开发者ID:vuathan2,项目名称:LeagueSharp,代码行数:34,代码来源:Sivir.cs


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