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


C# Ability.UseAbility方法代码示例

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


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

示例1: Cast

 public static bool Cast(Ability ability, Unit target, string name)
 {
     if (name == "razor_static_link" && target.Distance2D(AbilityMain.Me) > (ability.GetCastRange(name) * 0.75))
     {
         return false;
     }
     if (ability.IsAbilityBehavior(AbilityBehavior.UnitTarget, name))
     {
         Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 0");
         ManageAutoAttack.AutoAttackDisabled = true;
         SoulRing.Cast(ability);
         ability.UseAbility(target);
         return true;
     }
     if ((ability.IsAbilityBehavior(AbilityBehavior.AreaOfEffect, name)
          || ability.IsAbilityBehavior(AbilityBehavior.Point, name))
         && (Prediction.StraightTime(target) > 1000 || target.MovementSpeed < 200))
     {
         Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 0");
         ManageAutoAttack.AutoAttackDisabled = true;
         return ability.CastSkillShot(target, name, SoulRing.Check(ability) ? MyAbilities.SoulRing : null);
     }
     if (ability.IsAbilityBehavior(AbilityBehavior.NoTarget, name))
     {
         Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 0");
         ManageAutoAttack.AutoAttackDisabled = true;
         SoulRing.Cast(ability);
         ability.UseAbility();
         return true;
     }
     return false;
 }
开发者ID:dendimonster,项目名称:EnsageSharp,代码行数:32,代码来源:Special.cs

示例2: useAbility

		private static bool useAbility(Ability ability, string codeWord, Hero target, bool isPos, Hero me)
		{
			if (ability == null)
			{
				return true;
			}
			if (ability.CanBeCasted() && !ability.IsInAbilityPhase && Utils.SleepCheck(codeWord))
			{
				if (target != null)
				{
					if (isPos)
					{
						ability.UseAbility(target.Position);
					}
					else
					{
						ability.UseAbility(target);
					}
				}
				else
				{
					ability.UseAbility();
				}
				Utils.Sleep(ability.GetCastDelay(me, target, true) * 1000, codeWord);
				if (ability.CanBeCasted())
				{
					return false;
				}
			}
			return true;
			}
开发者ID:oleg9522,项目名称:Ensage,代码行数:31,代码来源:Program.cs

示例3: UseMidas

        // --→ Function: Use Midas
        private static void UseMidas(Ability midas, Unit owner)
        {
            if (midas.CanBeCasted() && owner.CanUseItems() && owner.Equals(mHero))
            {
                if (!heroCreateSideMessage)
                {
                    heroCreateSideMessage = true;
                    GenerateSideMessage(GetOwnerName(owner));
                }
                var creeps = ObjectMgr.GetEntities<Creep>().Where(creep => creep.Team != owner.Team && creep.IsAlive && creep.IsVisible && creep.IsSpawned && !creep.IsAncient && creep.Health > 0 && creep.Distance2D(owner) < midas.CastRange + 25).ToList();
                if (!creeps.Any()) return;
                midas.UseAbility(creeps.First());
            }
            else if(heroCreateSideMessage) heroCreateSideMessage = false;

            if (midas.CanBeCasted() && owner.CanUseItems() && owner.ClassID.Equals(ClassID.CDOTA_Unit_SpiritBear))
            {
                if (!bearCreateSideMessage)
                {
                    bearCreateSideMessage = true;
                    GenerateSideMessage(GetOwnerName(owner));
                }
                var creeps = ObjectMgr.GetEntities<Creep>().Where(creep => creep.Team != owner.Team && creep.IsAlive && creep.IsVisible && creep.IsSpawned && !creep.IsAncient && creep.Health > 0 && creep.Distance2D(owner) < midas.CastRange + 25).ToList();
                if (!creeps.Any()) return;
                midas.UseAbility(creeps.First());
            }
            else if(bearCreateSideMessage) bearCreateSideMessage = false;
        }
开发者ID:vitac1998,项目名称:ensagesharp-1,代码行数:29,代码来源:AutoMidas.cs

示例4: Cast

        public static bool Cast(Ability ability, Unit target, string name)
        {
            if (name == "item_tango" || name == "item_tango_single")
            {
                if (!target.Equals(AbilityMain.Me))
                {
                    return false;
                }

                var closestTree =
                    ObjectMgr.GetEntities<Tree>()
                        .Where(x => x.IsAlive && x.IsVisible && x.Distance2D(target) < 250)
                        .MinOrDefault(x => x.Distance2D(target));
                if (closestTree == null)
                {
                    return false;
                }

                //Console.WriteLine(closestTree);
                //ability.UseAbility(closestTree);
                //Player.UseAbility(target, ability, closestTree);
                return true;
            }

            if (ability.IsAbilityBehavior(AbilityBehavior.NoTarget, name))
            {
                Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 1");
                ManageAutoAttack.AutoAttackDisabled = true;
                SoulRing.Cast(ability);
                ability.UseAbility();
                return true;
            }

            if (name == "abaddon_death_coil" && target.Equals(AbilityMain.Me))
            {
                return false;
            }

            SoulRing.Cast(ability);
            Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 1");
            ManageAutoAttack.AutoAttackDisabled = true;
            ability.UseAbility(target);
            return true;
        }
开发者ID:Ray0fHope,项目名称:EnsageSharp,代码行数:44,代码来源:Heal.cs

示例5: CastHeal

 private static void CastHeal(Ability healSpell, Hero destination = null)
 {
     if (destination != null)
     {
         if (healSpell.CanBeCasted() && Utils.SleepCheck("Casting Heal"))
         {
             healSpell.UseAbility(destination);
             Utils.Sleep(100 + Game.Ping, "Casting Heal");
         }
     }
     else
     {
         if (Utils.SleepCheck("Casting Heal"))
         {
             healSpell.UseAbility();
             Utils.Sleep(healSpell.ChannelTime + Game.Ping, "Casting Heal");
         }
     }
 }
开发者ID:EmptyMer1s0n,项目名称:EnsageSharp,代码行数:19,代码来源:Program.cs

示例6: Cast

 public static bool Cast(Ability ability, Unit target, string name)
 {
     if (ability.IsAbilityBehavior(AbilityBehavior.NoTarget, name))
     {
         Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 0");
         ManageAutoAttack.AutoAttackDisabled = true;
         SoulRing.Cast(ability);
         ability.UseAbility();
         return true;
     }
     if ((name == "item_solar_crest" || name == "item_medallion_of_courage") && target.Equals(AbilityMain.Me))
     {
         return false;
     }
     SoulRing.Cast(ability);
     Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 0");
     ManageAutoAttack.AutoAttackDisabled = true;
     ability.UseAbility(target);
     return true;
 }
开发者ID:dendimonster,项目名称:EnsageSharp,代码行数:20,代码来源:Shield.cs

示例7: Cast

 public static bool Cast(Ability ability, Unit target, string name)
 {
     if (name == "item_tango" || name == "item_tango_single")
     {
         return false;
         //if (!target.Equals(AbilityMain.Me))
         //{
         //    return false;
         //}
         //var closestTree =
         //    ObjectMgr.GetEntities<Entity>()
         //        .Where(x => x.Name == "ent_dota_tree" && x.Distance2D(target) < 250)
         //        .MinOrDefault(x => x.Distance2D(target)) as Tree;
         //if (closestTree == null)
         //{
         //    return false;
         //}
         //Player.UseAbility(AbilityMain.Me,ability,closestTree);
         //ability.UseAbility(closestTree as Unit);
     }
     if (ability.IsAbilityBehavior(AbilityBehavior.NoTarget, name))
     {
         Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 1");
         ManageAutoAttack.AutoAttackDisabled = true;
         SoulRing.Cast(ability);
         ability.UseAbility();
         return true;
     }
     if (name == "abaddon_death_coil" && target.Equals(AbilityMain.Me))
     {
         return false;
     }
     SoulRing.Cast(ability);
     Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 1");
     ManageAutoAttack.AutoAttackDisabled = true;
     ability.UseAbility(target);
     return true;
 }
开发者ID:dendimonster,项目名称:EnsageSharp,代码行数:38,代码来源:Heal.cs

示例8: Game_OnUpdate

 public static void Game_OnUpdate(EventArgs args)
 {
     if (!Game.IsInGame) return;
     _me = ObjectMgr.LocalHero;
     if (_me == null || _me.ClassID != ClassID.CDOTA_Unit_Hero_Morphling)
     {
         return;
     }
     if (!_activated) return;
     if ((_target == null || !_target.IsVisible) && !_me.IsChanneling())
         _me.Move(Game.MousePosition);
     if (_target == null || _me.Distance2D(_target) > 500)
         _target = _me.ClosestToMouseTarget(1000);
     //Skills & Items
     waveform = _me.Spellbook.Spell1;
     adapt = _me.Spellbook.Spell2;
     eblade = _me.FindItem("item_ethereal_blade");
     bkb = _me.FindItem("item_black_king_bar");
     if (_target != null && _target.IsAlive && !_target.IsInvul())
     {
         if (!Utils.SleepCheck("Morph_Wait")) return;
         var targetDistance = _me.Distance2D(_target);
         var attackRange = 1000;
         if (targetDistance <= attackRange && waveform != null && waveform.CanBeCasted() && Utils.SleepCheck("waveform"))
         {
             waveform.UseAbility(_target.Position);
             Utils.Sleep(150 + Game.Ping, "waveform");
         }
         else if (bkb !=null && _bkbToggle && Utils.SleepCheck("BKB"))
         {
             bkb.UseAbility();
             Utils.Sleep(150 + Game.Ping, "BKB");
         }
         else if (eblade != null && eblade.CanBeCasted() && Utils.SleepCheck("eblade"))
         {
             eblade.UseAbility(_target);
             Utils.Sleep(150 + Game.Ping, "eblade");
         }
         else if (adapt != null && adapt.CanBeCasted() && Utils.SleepCheck("adapt"))
         {
             adapt.UseAbility(_target);
             Utils.Sleep(150 + Game.Ping, "adapt");
         }
     }
 }
开发者ID:potassiumsquare,项目名称:Morph,代码行数:45,代码来源:Program.cs

示例9: CastIceWall

 private static void CastIceWall(Hero me, Hero target, bool b, Ability icewall)
 {
     if (!b)
     {
         if (!me.CanMove() || !Utils.SleepCheck("icewallmove")) return;
         var angle = me.FindAngleBetween(target.Position, true);
         var point =
             new Vector3(
                 (float)(target.Position.X -
                          200 *
                          Math.Cos(angle)),
                 (float)(target.Position.Y -
                          200 *
                          Math.Sin(angle)), 0);
         me.Move(point);
         Utils.Sleep(300, "icewallmove");
     }
     else
     {
         icewall.UseAbility();
         _stage++;
         Utils.Sleep(250, "StageCheck");
     }
 }
开发者ID:LimbViolencer,项目名称:EnsageSharp-1,代码行数:24,代码来源:Program.cs

示例10: UseItem

 private static async Task UseItem(Ability ability, Unit target, CancellationToken cancellationToken)
 {
     if (ComboSleeper.Sleeping("invisAction"))
         return;
     ComboSleeper.Sleep(150, ability);
     if (ability.StoredName() == "item_armlet")
     {
         if (!Members.MyHero.HasModifier("modifier_item_armlet_unholy_strength"))
         {
             ability.ToggleAbility();
         }
         else
         {
             return;
         }
     }
     else if (ability.IsAbilityBehavior(AbilityBehavior.NoTarget))
     {
         ability.UseAbility();
     }
     else if (ability.IsAbilityBehavior(AbilityBehavior.UnitTarget))
     {
         if (ability.TargetTeamType == TargetTeamType.Enemy || ability.TargetTeamType == TargetTeamType.All ||
             ability.TargetTeamType == TargetTeamType.Custom)
         {
             ability.UseAbility(target);
         }
         else
         {
             ability.UseAbility(Members.MyHero);
         }
     }
     Printer.Print($"[{(int) Game.RawGameTime}] [Item] {ability.Name}: {50}");
     await Task.Delay(5, cancellationToken);
 }
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:35,代码来源:Core.cs

示例11: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectManager.LocalHero;
            if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_BountyHunter) return;
            if (!Menu.Item("enabled").IsActive())
                return;

            Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue<KeyBind>().Key);

            RActive = Menu.Item("KeyR").GetValue<KeyBind>().Active;
            Q = me.Spellbook.SpellQ;
            R = me.Spellbook.SpellR;

            var enemies = ObjectManager.GetEntities<Hero>()
                    .Where(x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && !x.IsMagicImmune())
                    .ToList();
            if (Active)
            {
                e = me.ClosestToMouseTarget(1800);
                if (e == null)
                    return;
                mom = me.FindItem("item_mask_of_madness");
                urn = me.FindItem("item_urn_of_shadows");
                dagon = me.Inventory.Items.FirstOrDefault(x => x.Name.Contains("item_dagon"));
                ethereal = me.FindItem("item_ethereal_blade");
                halberd = me.FindItem("item_heavens_halberd");
                mjollnir = me.FindItem("item_mjollnir");
                orchid = me.FindItem("item_orchid") ?? me.FindItem("item_bloodthorn");
                abyssal = me.FindItem("item_abyssal_blade");
                mail = me.FindItem("item_blade_mail");
                bkb = me.FindItem("item_black_king_bar");
                satanic = me.FindItem("item_satanic");
                medall = me.FindItem("item_medallion_of_courage") ?? me.FindItem("item_solar_crest");
                Shiva = me.FindItem("item_shivas_guard");

                if (Menu.Item("orbwalk").GetValue<bool>() && me.Distance2D(e) <= 1900)
                {
                    Orbwalking.Orbwalk(e, 0, 1600, true, true);
                }
                if (Active && me.Distance2D(e) <= 1400 && e != null && e.IsAlive && !me.IsInvisible())
                {
                    if (
                        Q != null && Q.CanBeCasted() && me.Distance2D(e) <= 1500
                        && Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(Q.Name)
                        && Utils.SleepCheck("Q")
                        )
                    {
                        Q.UseAbility(e);
                        Utils.Sleep(200, "Q");
                    }
                    if (
                        R != null && R.CanBeCasted() && me.Distance2D(e) <= 1500
                        && Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(R.Name)
                        && !me.HasModifier("modifier_bounty_hunter_wind_walk")
                        && !me.IsChanneling()
                        && Utils.SleepCheck("R")
                        )
                    {
                        R.UseAbility(e);
                        Utils.Sleep(200, "R");
                    }

                    if ( // MOM
                        mom != null
                        && mom.CanBeCasted()
                        && me.CanCast()
                        && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(mom.Name)
                        && Utils.SleepCheck("mom")
                        && me.Distance2D(e) <= 700
                        )
                    {
                        mom.UseAbility();
                        Utils.Sleep(250, "mom");
                    }
                    if ( // Mjollnir
                        mjollnir != null
                        && mjollnir.CanBeCasted()
                        && me.CanCast()
                        && !e.IsMagicImmune()
                        && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(mjollnir.Name)
                        && Utils.SleepCheck("mjollnir")
                        && me.Distance2D(e) <= 900
                        )
                    {
                        mjollnir.UseAbility(me);
                        Utils.Sleep(250, "mjollnir");
                    } // Mjollnir Item end
                    if ( // Medall
                        medall != null
                        && medall.CanBeCasted()
                        && Utils.SleepCheck("Medall")
                        && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(medall.Name)
                        && me.Distance2D(e) <= 700
                        )
                    {
                        medall.UseAbility(e);
                        Utils.Sleep(250, "Medall");
                    } // Medall Item end
                    if ( // Hellbard
                        halberd != null
//.........这里部分代码省略.........
开发者ID:VickTheRock,项目名称:ReworkAllScripts,代码行数:101,代码来源:Program.cs

示例12: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            var me = ObjectMgr.LocalHero;

            if (!Game.IsInGame || me.ClassID != ClassID.CDOTA_Unit_Hero_Pugna || me == null)
            {
                return;
            }

            var target = me.ClosestToMouseTarget(2000);
            if (target == null)
            {
                return;
            }

            //spell
            Q = me.Spellbook.SpellQ;

            W = me.Spellbook.SpellW;

            E = me.Spellbook.SpellE;

            R = me.Spellbook.SpellR;

            // Item
            ethereal = me.FindItem("item_ethereal_blade");

            sheep = target.ClassID == ClassID.CDOTA_Unit_Hero_Tidehunter ? null : me.FindItem("item_sheepstick");

            vail = me.FindItem("item_veil_of_discord");

            cheese = me.FindItem("item_cheese");

            ghost = me.FindItem("item_ghost");

            orchid = me.FindItem("item_orchid");

            atos = me.FindItem("item_rod_of_atos");

            soulring = me.FindItem("item_soul_ring");

            arcane = me.FindItem("item_arcane_boots");

            blink = me.FindItem("item_blink");

            shiva = me.FindItem("item_shivas_guard");

            dagon = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));

            var ModifRod = target.Modifiers.Any(y => y.Name == "modifier_rod_of_atos_debuff");
            var ModifEther = target.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_slow");
            var ModifVail = target.Modifiers.Any(y => y.Name == "modifier_item_veil_of_discord_debuff");
            var stoneModif = target.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");

            if (activated && me.IsAlive && target.IsAlive && Utils.SleepCheck("activated"))
            {
                var noBlade = target.Modifiers.Any(y => y.Name == "modifier_item_blade_mail_reflect");
                if (R.IsInAbilityPhase || me.Modifiers.Any(y => y.Name == "modifier_pugna_life_drain") )
                    return;
                if (target.IsVisible && me.Distance2D(target) <= 2300 && !noBlade)
                {
                    if ((!me.IsChanneling() && !me.AghanimState()) || me.AghanimState())
                    {
                        if (
                                         blink != null
                                         && W.CanBeCasted()
                                         && me.CanCast()
                                         && blinkToggle
                                         && blink.CanBeCasted()
                                         && me.Distance2D(target) > 600
                                         && me.Distance2D(target) < 1150
                                         && !stoneModif
                                         && Utils.SleepCheck("blink")
                               )
                        {
                            blink.UseAbility(target.Position);
                            Utils.Sleep(250, "blink");
                        }
                        if (
                                             W != null
                                             && W.CanBeCasted()
                                             && (target.IsLinkensProtected()
                                             || !target.IsLinkensProtected())
                                             && me.CanCast()
                                             && me.Distance2D(target) < 1400
                                             && !stoneModif
                                             && Utils.SleepCheck("W")
                               )
                        {
                            W.UseAbility(target);
                            Utils.Sleep(200, "W");
                        }
                        if ( // atos Blade
                                      atos != null
                                     && atos.CanBeCasted()
                                     && me.CanCast()
                                     && !target.IsLinkensProtected()
                                     && !target.IsMagicImmune()
                                     && Utils.SleepCheck("atos")
                                     && me.Distance2D(target) <= 2000
//.........这里部分代码省略.........
开发者ID:xzyxzy,项目名称:ReworkAllScripts,代码行数:101,代码来源:Program.cs

示例13: Combo

        //private int stage;
        public void Combo()
        {
            target = me.ClosestToMouseTarget(2000);

            if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame || Game.IsChatOpen)
                return;

            if (me == null || target == null)
                return;
            // skills
                Q = me.Spellbook.SpellQ;
                W = me.Spellbook.SpellW;
                E = me.Spellbook.SpellE;
                D = me.Spellbook.SpellD;
                R = me.Spellbook.SpellR;
            // itens
            blink = me.FindItem("item_blink");
            dagon = me.Inventory.Items.FirstOrDefault(x => x.Name.Contains("item_dagon"));
            ethereal = me.FindItem("item_ethereal_blade");
            euls = me.FindItem("item_cyclone");
            Shiva = me.FindItem("item_shivas_guard");
            orchid = me.FindItem("item_orchid");
            vail = me.FindItem("item_veil_of_discord");
            forcestaff = me.FindItem("item_force_staff");
            sheep = me.FindItem("item_sheepstick");

            //Starting Combo

            var _Is_in_Advantage = (target.HasModifier("modifier_item_blade_mail_reflect") ||
                                    target.HasModifier("modifier_item_lotus_orb_active") ||
                                    target.HasModifier("modifier_nyx_assassin_spiked_carapace") ||
                                    target.HasModifier("modifier_templar_assassin_refraction_damage") ||
                                    target.HasModifier("modifier_ursa_enrage") ||
                                    target.HasModifier("modifier_abaddon_borrowed_time") ||
                                    (target.HasModifier("modifier_dazzle_shallow_grave")));
            if (Game.IsKeyDown(menu.Item("Full").GetValue<KeyBind>().Key) && Utils.SleepCheck("combo"))
            {
                if (me.CanCast() && !me.IsChanneling() && me.Distance2D(target) <= 1200 &&
                 target.IsVisible && target.IsAlive && !target.IsMagicImmune() &&
                 !_Is_in_Advantage)
                {
                    if (me.CanCast())
                    {
                        var v =
                      ObjectManager.GetEntities<Hero>()
                          .Where(x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && !x.IsMagicImmune())
                          .ToList();
                        var X = me.Position.X;
                        var Y = me.Position.Y;
                        var pos = new Vector3(X, Y, me.Position.Z);
                        if (me.Position.X < 0)
                        {
                            X = me.Position.X + 100;
                        }
                        else
                        {
                            X = me.Position.X - 100;
                        }
                        if (me.Position.Y < 0)
                        {
                            Y = me.Position.Y + 100;
                        }
                        else
                        {
                            Y = me.Position.Y - 100;
                        }
                        uint elsecount = 0;
                        if (blink != null
                            && blink.CanBeCasted()
                            && me.Distance2D(target.Position) > 300
                            && menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(blink.Name))
                        {
                            blink.UseAbility(target.Position);
                        }
                        elsecount++;
                        if ( // vail
                            vail != null
                            && vail.CanBeCasted()
                            && me.CanCast()
                            && menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(vail.Name)
                            && !target.IsMagicImmune()
                            && Utils.SleepCheck("vail")
                            && me.Distance2D(target) <= 1500
                            )
                        {
                            vail.UseAbility(target.Position);
                        }
                        else elsecount++;
                        if (orchid != null && orchid.CanBeCasted() &&
                                menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(orchid.Name))
                        {
                            orchid.UseAbility(target);
                        }
                        else elsecount++;
                        if (sheep != null && sheep.CanBeCasted() &&
                                      menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(sheep.Name))
                        {
                            sheep.UseAbility(target);
                        }
//.........这里部分代码省略.........
开发者ID:Rulfy,项目名称:ReworkAllScripts,代码行数:101,代码来源:PuckController.cs

示例14: Combo

        public void Combo()
        {
            if (!Menu.Item("enabled").GetValue<bool>()) return;

            Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue<KeyBind>().Key);

            Q = me.Spellbook.SpellQ;
            R = me.Spellbook.SpellR;
            W = me.Spellbook.SpellW;

            mom = me.FindItem("item_mask_of_madness");
            urn = me.FindItem("item_urn_of_shadows");
            dagon = me.Inventory.Items.FirstOrDefault(x => x.Name.Contains("item_dagon"));
            ethereal = me.FindItem("item_ethereal_blade");
            halberd = me.FindItem("item_heavens_halberd");
            mjollnir = me.FindItem("item_mjollnir");
            blink = me.FindItem("item_blink");
            orchid = me.FindItem("item_orchid") ?? me.FindItem("item_bloodthorn");
            abyssal = me.FindItem("item_abyssal_blade");
            mail = me.FindItem("item_blade_mail");
            bkb = me.FindItem("item_black_king_bar");
            satanic = me.FindItem("item_satanic");
            medall = me.FindItem("item_medallion_of_courage") ?? me.FindItem("item_solar_crest");
            Shiva = me.FindItem("item_shivas_guard");
            var v =
                ObjectManager.GetEntities<Hero>()
                    .Where(x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && !x.IsMagicImmune())
                    .ToList();
            e = Toolset.ClosestToMouse(me);
            if (e == null) return;

            if (Active && me.IsInvisible())
            {
                if (me.Distance2D(e) <= 150 && Utils.SleepCheck("Attack") && me.NetworkActivity != NetworkActivity.Attack)
                {
                    me.Attack(e);
                    Utils.Sleep(150, "Attack");
                }
                else if (me.Distance2D(e) <= 2400 && me.Distance2D(e) >= 130 && me.NetworkActivity != NetworkActivity.Attack && Utils.SleepCheck("Move"))
                {
                    me.Move(e.Position);
                    Utils.Sleep(150, "Move");
                }
            }
            else if (Active && me.Distance2D(e) <= 1400 && e.IsAlive && !me.IsInvisible())
            {
                if (me.Distance2D(e) >= 400)
                {
                    if (
                        W != null && W.CanBeCasted() && me.Distance2D(e) <= 1100
                        && me.CanAttack()
                        && Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(W.Name)
                        && Utils.SleepCheck("W")
                        )
                    {
                        W.UseAbility();
                        Utils.Sleep(100, "W");
                    }
                }
                if (W != null && W.IsInAbilityPhase || me.HasModifier("modifier_weaver_shukuchi")) return;

                if (Menu.Item("orbwalk").GetValue<bool>())
                {
                    Orbwalking.Orbwalk(e, 0, 1600, true, true);
                }
                if (
                    blink != null
                    && me.CanCast()
                    && blink.CanBeCasted()
                    && me.Distance2D(e) < 1190
                    && me.Distance2D(e) > me.AttackRange - 50
                    && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(blink.Name)
                    && Utils.SleepCheck("blink")
                    )
                {
                    blink.UseAbility(e.Position);
                    Utils.Sleep(250, "blink");
                }
                if (
                    Q != null && Q.CanBeCasted() && me.Distance2D(e) <= me.AttackRange + 300
                    && me.CanAttack()
                    && Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(Q.Name)
                    && Utils.SleepCheck("Q")
                    )
                {
                    Q.UseAbility(e.Position);
                    Utils.Sleep(100, "Q");
                }
                if ( // MOM
                mom != null
                && mom.CanBeCasted()
                && me.CanCast()
                && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(mom.Name)
                && Utils.SleepCheck("mom")
                && me.Distance2D(e) <= 700
                )
                {
                    mom.UseAbility();
                    Utils.Sleep(250, "mom");
                }
//.........这里部分代码省略.........
开发者ID:VickTheRock,项目名称:ReworkAllScripts,代码行数:101,代码来源:WeaverController.cs

示例15: CastSpell

 private static void CastSpell(Ability spell, Unit target, Unit me, bool lsblock)
 {
     if (spell.CanBeCasted() && me.CanCast() && (target.Modifiers.FirstOrDefault(modifier => modifier.Name == "modifier_item_sphere") == null || target.FindItem("item_sphere").Cooldown > 0) || lsblock == false)
         spell.UseAbility(target);
 }
开发者ID:YukinoAguria,项目名称:ensagesharp,代码行数:5,代码来源:Program.cs


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