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


C# Item.Cast方法代码示例

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


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

示例1: Combo

        private static void Combo()
        {
            var target = TargetSelector.GetTarget(1000, DamageType.Physical);
            if (target == null) return;
            var useQ = SkillMenu["QCombo"].Cast<CheckBox>().CurrentValue;
            var useW = SkillMenu["WCombo"].Cast<CheckBox>().CurrentValue;
            var useE = SkillMenu["ECombo"].Cast<CheckBox>().CurrentValue;
            var useR = SkillMenu["RCombo"].Cast<CheckBox>().CurrentValue;

            if (target.IsValidTarget(E.Range))
            {
                var hydra = new Item((int)ItemId.Ravenous_Hydra_Melee_Only);
                if (useQ && Q.IsReady() && target.IsValidTarget(E.Range) && !target.IsZombie)
                {
                    Q.Cast();
                }
                if (E.IsReady() && useE && target.IsValidTarget(E.Range) && !target.IsZombie)
                {
                    E.Cast(target);
                    hydra.Cast();
                }
                if (R.IsReady() && useR && target.IsValidTarget(E.Range) && !target.IsZombie)
                {
                    R.Cast();
                }
                if (W.IsReady() && useW && target.IsValidTarget(W.Range) && !target.IsZombie)
                {
                    W.Cast(target);
                }
                if (R.IsReady() && useR && target.IsValidTarget(E.Range) && !target.IsZombie)
                {
                    R.Cast();
                }
            }
            else if (!target.IsValidTarget(E.Range))
            {
                var hydra = new Item((int)ItemId.Ravenous_Hydra_Melee_Only);
                if (useR && R.IsReady() && !target.IsZombie)
                {
                    R.Cast();
                }
                if (Q.IsReady() && useQ && target.IsValidTarget(E.Range) && !target.IsZombie)
                {
                    Q.Cast();
                }
                if (E.IsReady() && useE && target.IsValidTarget(E.Range) && !target.IsZombie)
                {
                    E.Cast(target);
                    hydra.Cast();
                }
                if (W.IsReady() && useW && target.IsValidTarget(W.Range) && !target.IsZombie)
                {
                    W.Cast(target);
                }
                if (R.IsReady() && useR && target.IsValidTarget(R.Range) && !target.IsZombie)
                {
                    R.Cast();
                }
            }
        }
开发者ID:flashreverse,项目名称:EloBuddy,代码行数:60,代码来源:Program.cs

示例2: Game_OnTick

 private static void Game_OnTick(EventArgs args)
 {
     HPOT = new Item((int)ItemId.Health_Potion);
     if (_Player.HealthPercent <= 60 && HPOT.IsOwned())
     {
         HPOT.Cast();
     }
     if (Spells[SpellSlot.E].IsReady() && !_Player.IsDead)
     {
         Brain.KStiloso();
     }
     switch (Orbwalker.ActiveModesFlags)
     {
         case Orbwalker.ActiveModes.Combo:
             Brain.Combo();
             return;
         case Orbwalker.ActiveModes.Harass:
             Brain.Harass();
             return;
         case Orbwalker.ActiveModes.LaneClear:
            // Brain.LaneClear();
             return;
         case Orbwalker.ActiveModes.JungleClear:
            // Brain.LaneClear();
             return;
     }
 }
开发者ID:lolscripts,项目名称:zilean,代码行数:27,代码来源:Program.cs

示例3: Potions

 private static void Potions()
 {
     if (Utils.isChecked(MenuX.MiscMenu, "usePot") && !Utils._Player.IsInShopRange() && !Utils._Player.HasBuff("recall"))
     {
         var hpPot = new Item(2003);
         var manaPot = new Item(2004);
         var biscuit = new Item(2010);
         if ((hpPot.IsReady() || biscuit.IsReady()) &&
             (!Utils._Player.HasBuff("RegenerationPotion") || Utils._Player.HasBuff("ItemMiniRegenPotion")))
         {
             if (Utils._Player.CountEnemiesInRange(700) > 0 && Utils._Player.Health + 200 < Utils._Player.MaxHealth)
             {
                 if (Item.HasItem(hpPot.Id))
                 {
                     hpPot.Cast();
                 }
                 else
                 {
                     biscuit.Cast();
                 }
             }
             else if (Utils._Player.Health < Utils._Player.MaxHealth * 0.6)
             {
                 if (Item.HasItem(hpPot.Id))
                 {
                     hpPot.Cast();
                 }
                 else
                 {
                     biscuit.Cast();
                 }
             }
         }
         if (manaPot.IsReady() && !Utils._Player.HasBuff("FlaskOfCrystalWater"))
         {
             if (Utils._Player.Mana < Utils._Player.MaxMana * 0.6)
             {
                 manaPot.Cast();
             }
         }
     }
 }
开发者ID:FireBuddy,项目名称:zilean,代码行数:42,代码来源:Brain.cs

示例4: CastZhonya

        public static Item zhonya; // Zhonya test

        #endregion Fields

        #region Methods

        /// <summary>
        /// Casts zhonya if Katarina is low on health.
        /// </summary>
        /// <param name="myHero">AIHeroClient reference -- ourselves</param>
        /// <returns>true if zhonya suceeded</returns>
        public static bool CastZhonya(AIHeroClient myHero, int zHealth)
        {
            zhonya = new Item((int)ItemId.Zhonyas_Hourglass);
            if(zhonya == null || !zhonya.IsReady() || !zhonya.IsOwned()) return false;

            if(myHero.HealthPercent <= zHealth) {
                zhonya.Cast();
                return true;
            }

            return false;
        }
开发者ID:infyhr,项目名称:EloBuddy,代码行数:23,代码来源:Helpers.cs

示例5: Combo

        public static void Combo()
        {
            BTRK1 = new Item((int)ItemId.Blade_of_the_Ruined_King);
            BTRK2 = new Item((int)ItemId.Bilgewater_Cutlass);
            YOMU = new Item((int)ItemId.Youmuus_Ghostblade);
            var target = TargetSelector2.GetTarget(Program.Spells[SpellSlot.W].Range, DamageType.Physical);
            if (target == null) return;
            if (MenuX.ComboMenu["useWCombo"].Cast<CheckBox>().CurrentValue)
            {
                if (target.IsValidTarget(Program.Spells[SpellSlot.W].Range) && Program.Spells[SpellSlot.W].IsReady())
                {
                    Program.Spells[SpellSlot.W].Cast(target);
                }
            }
            if (MenuX.ComboMenu["useRCombo"].Cast<CheckBox>().CurrentValue)
            {
                foreach (
                    var enemy in
                        ObjectManager.Get<AIHeroClient>()
                            .Where(enemy => enemy.Distance(_Player) <= Program.Spells[SpellSlot.R].Range))
                {
                    if (enemy.CountEnemiesInRange(850) >= MenuX.ComboMenu["minRCombo"].Cast<Slider>().CurrentValue)
                    {
                        Program.Spells[SpellSlot.R].Cast();
                    }
                }
            }
            if (target.HealthPercent <= 80 && (BTRK1.IsOwned() || BTRK2.IsOwned()) && (BTRK1.IsReady() || BTRK2.IsReady()))
            {
                BTRK1.Cast(target);
                BTRK2.Cast(target);
            }
            if (target.HealthPercent <= 75 && YOMU.IsOwned() && YOMU.IsReady())
            {
                YOMU.Cast();
            }

        }
开发者ID:FireBuddy,项目名称:zilean,代码行数:38,代码来源:Brain.cs

示例6: OnAttack

        public static void OnAttack(AttackableUnit target, EventArgs args)
        {
            var item = new Item(ItemId.Youmuus_Ghostblade, 0);
            if ((Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) || OrbwalkerPassive || OrbwalkLastClickActive))
            {
                if (item.IsReady())
                    item.Cast();
            }

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

示例7: CastTitan

 private static void CastTitan()
 {
     var id = ObjectManager.Player.InventoryItems.FirstOrDefault(a => a.Id == (ItemId) 3748);
     if (id != null)
     {
         var HydraItem = new Item(id.Id, 300);
         if (HydraItem.IsReady())
         {
             HydraItem.Cast();
             Orbwalker.ResetAutoAttack();
         }
     }
 }
开发者ID:KoalaHuman,项目名称:EloBuddy,代码行数:13,代码来源:Program.cs

示例8: OnAttack

        public static void OnAttack(OnAttackArgs args)
        {
            var item = new Item(ItemId.Youmuus_Ghostblade, 0);
            if ((PortAIO.OrbwalkerManager.isComboActive || OrbwalkerPassive || OrbwalkLastClickActive))
            {
                if (item.IsReady())
                    item.Cast();
            }

        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:10,代码来源:Program.cs

示例9: Itens

        private static void Itens()
        {
            var target = TargetSelector.GetTarget(500, DamageType.Physical);

            var botrk = new Item((int)ItemId.Blade_of_the_Ruined_King, 600f);
            var yommus = new Item((int)ItemId.Youmuus_Ghostblade);

            var useEr = ComboMenu["useER"].Cast<CheckBox>().CurrentValue;
            var erHealth = ComboMenu["ERHealth"].Cast<Slider>().CurrentValue;
            var useYommus = ComboMenu["UseYommus"].Cast<CheckBox>().CurrentValue;

            if (botrk.IsReady())
            {
                if (useEr && target.HealthPercent <= erHealth)
                {
                    botrk.Cast(target);
                }
            }

            if (yommus.IsReady() && useYommus)
            {
                yommus.Cast();

            }
        }
开发者ID:ReloadBot,项目名称:EloBuddy,代码行数:25,代码来源:Program.cs

示例10: AutoPotion

        private static void AutoPotion()
        {
            var usePotion = PotionMenu["hpPotion"].Cast<CheckBox>().CurrentValue;
            var hpporcent = PotionMenu["hp%"].Cast<Slider>().CurrentValue;

            var potionhp = new Item((int) ItemId.Health_Potion);

            if (potionhp.IsReady() &&
                usePotion && _Player.Health <= hpporcent)
            {
                potionhp.Cast();
            }
        }
开发者ID:ReloadBot,项目名称:EloBuddy,代码行数:13,代码来源:Program.cs

示例11: Orbwalker_OnPostAttack

        static void Orbwalker_OnPostAttack(AttackableUnit target, EventArgs args)
        {
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                var hydra = new Item((int)ItemId.Ravenous_Hydra_Melee_Only);
                var youmuus = new Item((int)ItemId.Youmuus_Ghostblade);

                if (hydra.IsOwned() && hydra.IsReady() || youmuus.IsOwned() && youmuus.IsReady())
                {
                    hydra.Cast();
                    youmuus.Cast();
                }
            }
        }
开发者ID:flashreverse,项目名称:EloBuddy,代码行数:14,代码来源:Program.cs

示例12: Tick

        // Combo Draw Damage
        private static void Tick(EventArgs args)
        {
            QHitChance = PredMenu["predq"].Cast<CheckBox>().CurrentValue ? HitChance.Medium : HitChance.High;
            EHitChance = PredMenu["prede"].Cast<CheckBox>().CurrentValue ? HitChance.Medium : HitChance.High;
            Killsteal();
            // AutoCast();

            {
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    Combo();
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) ||
                Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear))
            {
                LaneClear();
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
            {
                Harass();
            }

            //Auto Ignite
            {
                if (!ComboMenu["useignite"].Cast<CheckBox>().CurrentValue ||
                    !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    return;
                foreach (
                    var source in
                        ObjectManager.Get<AIHeroClient>()
                            .Where(
                                a =>
                                    a.IsEnemy && a.IsValidTarget(Ignite.Range) &&
                                    a.Health < 50 + 20*Me.Level - (a.HPRegenRate/5*3)))
                {
                    Ignite.Cast(source);
                    return;
                }
            }

            //Auto Zhonias

            var zhoniascheck = MiscMenu["zhonias"].Cast<CheckBox>().CurrentValue;
            var zpercent = MiscMenu["ZPercent"].Cast<Slider>().CurrentValue;
            var zhonias = new Item((int)ItemId.Zhonyas_Hourglass);

            if (zhoniascheck && zhonias.IsReady())
            {
                if (Me.HealthPercent <= zpercent)
                {
                    zhonias.Cast();
                }
            }
        }
开发者ID:ReloadBot,项目名称:EloBuddy,代码行数:56,代码来源:Program.cs

示例13: Itens

        private static void Itens()
        {
            var useEr = ItensMenu["useER"].Cast<CheckBox>().CurrentValue;
            var hpPorcent = ItensMenu["hpPorcent"].Cast<Slider>().CurrentValue;
            var mehpPorcent = ItensMenu["mehpPorcent"].Cast<Slider>().CurrentValue;
            var useYommus = ItensMenu["useYommus"].Cast<CheckBox>().CurrentValue;

            //itens 
            var botrk = new Item(ItemId.Blade_of_the_Ruined_King, 500);
            var yommus = new Item(ItemId.Youmuus_Ghostblade);

            if (botrk.IsReady() && useEr)
            {
                var targetEr = TargetSelector.GetTarget(botrk.Range, DamageType.Mixed);

                if (targetEr.IsValidTarget(500) && hpPorcent >= targetEr.HealthPercent)
                {
                    botrk.Cast();
                }
                if (Me.HealthPercent <= mehpPorcent)
                {
                    botrk.Cast();
                }

            }

            if (yommus.IsReady() && useYommus)
            {
                var targetY = TargetSelector.GetTarget(600, DamageType.Physical);

                if (targetY.IsValidTarget(600))
                {
                    yommus.Cast();
                }

            }

        }
开发者ID:TristeMyth,项目名称:Triste,代码行数:38,代码来源:Program.cs

示例14: Potions

        private static void Potions()
        {
            var usehp = PotionMenu["useHP"].Cast<CheckBox>().CurrentValue;
            var hpbar = PotionMenu["hpbar"].Cast<Slider>().CurrentValue;

            //potions instance
            var hppot = new Item(ItemId.Health_Potion);

            if (usehp && hppot.IsReady() && Me.HealthPercent <= hpbar)
            {
                hppot.Cast();

            }          


        }
开发者ID:TristeMyth,项目名称:Triste,代码行数:16,代码来源:Program.cs


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