當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。