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


C# AIHeroClient.IsValidTarget方法代码示例

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


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

示例1: OnGapCloser

        public static void OnGapCloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs e)
        {
            var playerPosition = ObjectManager.Player.Position.To2D();
            var direction1 = (ObjectManager.Player.ServerPosition - sender.ServerPosition).To2D().Normalized();
            const int distance = 475;
            const int stepSize = 20;

            if (!Spells.E.IsReady() || !sender.IsValidTarget(Spells.E.Range) ||
                !Init.MiscMenu["gapcloser"].Cast<CheckBox>().CurrentValue ||
                e.Type == Gapcloser.GapcloserType.Targeted ||
                sender.IsAlly &&
                !(Player.HasBuff("rengarralertsound")
                && sender.IsEnemy
                && sender.IsValidTarget()))
                return;
            {
                for (var step = 0f; step < 360; step += stepSize)
                {
                    var currentAngel = step * (float)Math.PI / 90;
                    var currentCheckPoint = playerPosition +
                                            distance * direction1.Rotated(currentAngel);

                    if (!Helpers.IsSafePosition((Vector3)currentCheckPoint) ||
                        NavMesh.GetCollisionFlags(currentCheckPoint).HasFlag(CollisionFlags.Wall) ||
                        NavMesh.GetCollisionFlags(currentCheckPoint).HasFlag(CollisionFlags.Building))
                        continue;
                    {
                        Spells.E.Cast((Vector3)currentCheckPoint);
                    }
                }
            }
        }
开发者ID:tramyeu,项目名称:EloBuddy,代码行数:32,代码来源:Events.cs

示例2: CastItems

 public static void CastItems(AIHeroClient target)
 {
     foreach (var item in Player.Instance.InventoryItems)
     {
         switch (item.Id)
         {
             case ItemId.Hextech_Gunblade: //HexTech
                 if (Item.CanUseItem((int)ItemId.Hextech_Gunblade)) Item.UseItem((int)ItemId.Hextech_Gunblade, target);
                 break;
             case ItemId.Bilgewater_Cutlass: //BwC
                 if (Item.CanUseItem((int)ItemId.Bilgewater_Cutlass)) Item.UseItem((int)ItemId.Bilgewater_Cutlass, target);
                 break;
             case ItemId.Blade_of_the_Ruined_King:
                 if (Item.CanUseItem((int)ItemId.Blade_of_the_Ruined_King)) Item.UseItem((int)ItemId.Blade_of_the_Ruined_King, target);
                 break;
             case ItemId.Tiamat_Melee_Only:
                 if (Item.CanUseItem((int)ItemId.Tiamat_Melee_Only) && target.IsValidTarget(400)) Item.UseItem((int)ItemId.Tiamat_Melee_Only, target);
                 break;
             case ItemId.Ravenous_Hydra_Melee_Only:
                 if (Item.CanUseItem((int)ItemId.Ravenous_Hydra_Melee_Only) && target.IsValidTarget(400)) Item.UseItem((int)ItemId.Ravenous_Hydra_Melee_Only, target);
                 break;
             case ItemId.Titanic_Hydra:
                 if (Item.CanUseItem((int)ItemId.Titanic_Hydra) && target.IsValidTarget(Player.Instance.AttackRange)) Item.UseItem((int)ItemId.Titanic_Hydra, target);
                 break;
         }
     }
 }
开发者ID:xTeKillax,项目名称:EloBuddy,代码行数:27,代码来源:Utilities.cs

示例3: Combo

        public void Combo(AIHeroClient target)
        {
            if (E.IsReady() && Player.Instance.CountEnemiesInRange(800) == 1 &&
                target.HealthPercent < Player.Instance.HealthPercent - 10)
            {
                E.Cast(Player.Instance.Position.Extend(target.Position, E.Range).To3D());
            }

            if (Q.IsReady() && target.IsValidTarget(Q.Range))
            {
                Q.Cast(target);
            }

            if (W.IsReady() && target.IsValidTarget(W.Range) && Player.Instance.ManaPercent > 40)
            {
                W.Cast(target);
            }

            if (R.IsReady() && Player.Instance.CountEnemiesInRange(W.Range) <= 1)
            {
                var hero =
                    EntityManager.Heroes.Enemies.OrderByDescending(e => e.Health)
                        .FirstOrDefault(
                            e => e.Health < Player.Instance.GetSpellDamage(e, SpellSlot.R) && e.IsValidTarget(2500));
                if (hero == null) return;

                R.Cast(hero);
            }
        }
开发者ID:qkwlqk,项目名称:EloBuddy,代码行数:29,代码来源:Ezreal.cs

示例4: DmgCalc

 public static float DmgCalc(AIHeroClient target)
 {
     var damage = 0f;
     if (Program.Q.IsReady() && target.IsValidTarget(Program.Q.Range))
         damage += QCalc(target);
    if (Program.E.IsReady() && target.IsValidTarget(Program.E.Range))
         damage += ECalc(target) + _Player.GetAutoAttackDamage(target);
     damage += _Player.GetAutoAttackDamage(target, true) * 2;
     return damage;
 }
开发者ID:bruno105,项目名称:EloBuddy,代码行数:10,代码来源:DamageLib.cs

示例5: AntiGapCloser

 private static void AntiGapCloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs e)
 {
     if (CaitlynTheTrollMeNu.GapcloserE() && sender.IsEnemy && sender.IsValidTarget(E.Range) && e.End.Distance(Player) <= 250)
     {
         E.Cast(e.End);
     }
     if (CaitlynTheTrollMeNu.GapcloserW() && sender.IsEnemy && sender.IsValidTarget(W.Range) && e.End.Distance(Player) <= 250)
     {
         W.Cast(e.End);
     }
 }
开发者ID:FireBuddy,项目名称:Elobuddy-1,代码行数:11,代码来源:Program.cs

示例6: UseBotrk

 public static bool UseBotrk(AIHeroClient target)
 {
     if (Settings.UseBotrk && Botrk.IsReady() && target.IsValidTarget(Botrk.Range) && Player.Health + Player.GetItemDamage(target, (ItemId) Botrk.Id) < Player.MaxHealth)
     {
         return Botrk.Cast(target);
     }
     if (Settings.UseCutlass && Cutlass.IsReady() && target.IsValidTarget(Cutlass.Range))
     {
         return Cutlass.Cast(target);
     }
     return false;
 }
开发者ID:tingtop747,项目名称:EloBuddy-Addons-1,代码行数:12,代码来源:ItemManager.cs

示例7: Harass

        public void Harass(AIHeroClient target)
        {
            if (Q.IsReady() && target.IsValidTarget(Q.Range) && 20 <= Player.Instance.ManaPercent)
            {
                Q.Cast(target);
            }

            if (W.IsReady() && target.IsValidTarget(W.Range) && 30 <= Player.Instance.ManaPercent)
            {
                W.Cast(target);
            }
        }
开发者ID:qkwlqk,项目名称:EloBuddy,代码行数:12,代码来源:Ezreal.cs

示例8: AntiGapCloser

        private static void AntiGapCloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs e)
        {
            if (!sender.IsEnemy) return;

            if (sender.IsValidTarget(Q.Range) && FiddleTheTrollMeNu.GapcloserQ() && Player.Distance(e.End) < 150)
            {
                Q.Cast(sender);
            }
            if (sender.IsValidTarget(E.Range) && FiddleTheTrollMeNu.GapcloserE() && Player.Distance(e.End) < 150)
            {
                E.Cast(sender);
            }
        }
开发者ID:FireBuddy,项目名称:Elobuddy-1,代码行数:13,代码来源:Program.cs

示例9: GetComboDmg

 public static float GetComboDmg(AIHeroClient target)
 {
     var damage = 0f;
     if (Spells.Q.IsReady() && target.IsValidTarget(Spells.Q.Range))
         damage += QDamage(target);
     if (Spells.W.IsReady())
         damage += WDamage(target);
     if (Spells.E.IsReady() && target.IsValidTarget(Spells.E.Range))
         damage += EDamage(target);
     if (Spells.R.IsReady() && target.IsValidTarget(Spells.R.Range))
         damage += RDamage(target);
     damage += Utils._Player.GetAutoAttackDamage(target, true)*2;
     return damage;
 }
开发者ID:werdbrian,项目名称:EloBuddy,代码行数:14,代码来源:DamageLib.cs

示例10: Gapcloser_OnGapcloser

        private static void Gapcloser_OnGapcloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs e)
        {
            if (sender.IsValidTarget() && sender.IsEnemy)
            {

            }
        }
开发者ID:mezer123,项目名称:EloBuddy,代码行数:7,代码来源:Champion.cs

示例11: DmgCalc

 public static float DmgCalc(AIHeroClient target)
 {
     var damage = 0f;
     if (Program.E.IsReady() && target.IsValidTarget(2000))
         if (!target.HasBuff("TristanaECharge"))
         {
             damage += ECalc(target);
         }
     if (target.HasBuff("TristanaECharge") && target.IsValidTarget(2000))
     {
        damage += ECalc(target) + ECalc(target) * (target.GetBuffCount("TristanaECharge") * 30f);
     }
     if (Program.R.IsReady() && target.IsValidTarget(Program.R.Range))
         damage += RCalc(target);
     return damage;
 }
开发者ID:,项目名称:,代码行数:16,代码来源:

示例12: OnGapCloser

 private static void OnGapCloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs args)
 {
     if (sender.IsEnemy && sender.IsValidTarget(SpellManager.W.Range) && SpellManager.W.IsReady())
     {
         SpellManager.W.Cast(sender);
     }
 }
开发者ID:TristeMyth,项目名称:Triste,代码行数:7,代码来源:ModeManager.cs

示例13: CastR

 public static void CastR(AIHeroClient target)
 {
     if (Spells.R1.IsReady() && Variables.UseRCombo && Riven.R1Activated == false && target.IsValidTarget(500))
     {
         Spells.R1.Cast();
     }
 }
开发者ID:Enelx,项目名称:EloBuddy,代码行数:7,代码来源:Logic.cs

示例14: CastQ

 public static void CastQ(AIHeroClient target)
 {
     if (Spells.Q.IsReady() && target.IsValidTarget(Spells.Q.Range))
     {
         Spells.Q.Cast(target.ServerPosition);
     }
 }
开发者ID:Enelx,项目名称:EloBuddy,代码行数:7,代码来源:Logic.cs

示例15: CastE

 public static void CastE(AIHeroClient target)
 {
     if (Spells.E.IsReady() && target.IsValidTarget(Spells.E.Range + Player.Instance.BoundingRadius))
     {
         Spells.E.Cast(target.ServerPosition);
     }
 }
开发者ID:Enelx,项目名称:EloBuddy,代码行数:7,代码来源:Logic.cs


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