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


C# Hero.IsHexed方法代码示例

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


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

示例1: IsInDanger

        private static bool IsInDanger(Hero ally)
        {
            if (ally != null && ally.IsAlive)
            {
                var projectiles = ObjectMgr.Projectiles.Where(x => Equals(x.Target, ally)).ToList();

                if (projectiles.Any())
                {
                    foreach (var projectile in projectiles)
                    {
                        if (projectile.Source != null && Equals(projectile.Target, ally))
                        {
                            return true;
                        }
                    }
                }

                var percHealth = ally.Health <= (ally.MaximumHealth*0.7);
                var enemies =
                    ObjectMgr.GetEntities<Hero>()
                        .Where(
                            entity =>
                                entity.Team != ally.Team && entity.IsAlive && entity.IsVisible && !entity.IsIllusion)
                        .ToList();
                if (enemies.Any() && percHealth)
                {
                    foreach (var enemy in enemies)
                    {
                        if (ally.Distance2D(enemy) < enemy.AttackRange + 50)
                        {
                            return true;
                        }
                        if (enemy.Spellbook.Spells.Any(abilities => ally.Distance2D(enemy) < abilities.CastRange + 50))
                        {
                            return true;
                        }
                    }
                }

                var buffs = new[]
                {
                    "modifier_item_urn_damage", "modifier_doom_bringer_doom", "modifier_axe_battle_hunger",
                    "modifier_queenofpain_shadow_strike", "modifier_phoenix_fire_spirit_burn",
                    "modifier_venomancer_poison_nova", "modifier_venomancer_venomous_gale",
                    "modifier_silencer_curse_of_the_silent", "modifier_silencer_last_word", "modifier_bane_fiends_grip",
                    "modifier_earth_spirit_magnetize", "modifier_jakiro_macropyre", "modifier_nerolyte_reapers_scythe",
                    "modifier_batrider_flaming_lasso", "modifier_sniper_assassinate", "modifier_pudge_dismember",
                    "modifier_enigma_black_hole_pull", "modifier_disruptor_static_storm", "modifier_sand_king_epicenter",
                    "modifier_bloodseeker_rupture", "modifier_dual_breath_burn", "modifier_jakiro_liquid_fire_burn",
                    "modifier_axe_battle_hunger", "modifier_viper_corrosive_skin", "modifier_viper_poison_attack",
                    "modifier_viper_viper_strike"
                };

                foreach (var buff in buffs)
                {
                    return ally.Modifiers.Any(x => x.Name == buff);
                }

                if ((ally.IsStunned() ||
                     (ally.IsSilenced() &&
                      ((ally.FindItem("item_manta_style") == null || ally.FindItem("item_manta_style").Cooldown > 0) ||
                       (ally.FindItem("item_black_king_bar") == null ||
                        ally.FindItem("item_black_king_bar").Cooldown > 0))) ||
                     ally.IsHexed() ||
                     ally.IsRooted()) && !ally.IsInvul()
                    )
                {
                    return true;
                }

                return false;
            }
            return false;
        }
开发者ID:evezus,项目名称:EnsageSharp,代码行数:74,代码来源:Program.cs

示例2: AD

		public static void AD(EventArgs args)
		{
			if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
                return;
            me = ObjectMgr.LocalHero;
            if (me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Tinker)
                return;
		
			aether = me.FindItem("item_aether_lens");
			//cyclone = me.FindItem("item_cyclone");
			//ghost = me.FindItem("item_ghost");
            //sheep = me.FindItem("item_sheepstick");
            //atos = me.FindItem("item_rod_of_atos");
            FindItems();



			
			if (aether == null)
				aetherrange = 0;
			else
				aetherrange = 200;

				
				
			if (bottle != null && !me.IsInvisible() && !me.IsChanneling() && !me.Spellbook.Spells.Any(x => x.IsInAbilityPhase) && !March.IsInAbilityPhase && me.Modifiers.Any(x => x.Name == "modifier_fountain_aura_buff") && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(bottle.Name) && Utils.SleepCheck("bottle1"))
			{
				if(!me.Modifiers.Any(x => x.Name == "modifier_bottle_regeneration") && (me.Health < me.MaximumHealth || me.Mana < me.MaximumMana))
					bottle.UseAbility();
				Alies = ObjectMgr.GetEntities<Hero>().Where(x => x.Team == me.Team && x != me && (x.Health < x.MaximumHealth || x.Mana < x.MaximumMana) && !x.Modifiers.Any(y => y.Name == "modifier_bottle_regeneration") && x.IsAlive && !x.IsIllusion && x.Distance2D(me) <= bottle.CastRange).ToList();
				foreach (Hero v in Alies)
					if (v != null)
						bottle.UseAbility(v);
				Utils.Sleep(255, "bottle1");
			}
				

			var enemies = ObjectMgr.GetEntities<Hero>().Where(x => x.IsVisible && x.IsAlive && x.Team == me.GetEnemyTeam() && !x.IsIllusion);
			
				
			foreach (var e in enemies)
			{
				if (e == null)
					return;
				//distance = me.Distance2D(e);
				angle = Math.Abs(e.FindAngleR() - Utils.DegreeToRadian(e.FindAngleForTurnTime(me.NetworkPosition)));

				if (Menu.Item("autoDisable").GetValue<bool>() && me.IsAlive && me.IsVisibleToEnemies)
				{		
					
					
					
					//break linken if tp
					if (!me.IsChanneling()
						&& me.Distance2D(e) <= 800 + aetherrange + ensage_error
						&& me.Distance2D(e) >= 300 + ensage_error
						&& e.Modifiers.Any(y => y.Name == "modifier_teleporting")
						&& e.IsLinkensProtected()
						&& Utils.SleepCheck("tplink")
						)
					{
						if ((cyclone != null && cyclone.CanBeCasted()) || (sheep != null && sheep.CanBeCasted()))
						{ 
							if (atos != null && atos.CanBeCasted())
								atos.UseAbility(e);
							else if (me.Spellbook.SpellQ != null && me.Spellbook.SpellQ.CanBeCasted())
								me.Spellbook.SpellQ.UseAbility(e);
							else if (ethereal != null && ethereal.CanBeCasted())
								ethereal.UseAbility(e);
							else if (dagon != null && dagon.CanBeCasted())
								dagon.UseAbility(e);
							else if ((sheep != null && sheep.CanBeCasted()) && (cyclone != null && cyclone.CanBeCasted()))
								sheep.UseAbility(e);
							//else if (cyclone != null && cyclone.CanBeCasted())
							//    cyclone.UseAbility(e);
						}

						Utils.Sleep(150, "tplink");
					}
					

					
					
						//break TP 
						if (!me.IsChanneling()
							&& me.Distance2D(e) <= 800 + aetherrange + ensage_error
							&& e.Modifiers.Any(y => y.Name == "modifier_teleporting")
							//&& e.IsChanneling()
							&& !e.IsHexed()
							&& !e.Modifiers.Any(y => y.Name == "modifier_eul_cyclone")
							&& !e.IsLinkensProtected()
							&& Utils.SleepCheck("tplink1")
							)
						{
							if (sheep != null && sheep.CanBeCasted())
								sheep.UseAbility(e);
							else if (cyclone != null && cyclone.CanBeCasted())
								cyclone.UseAbility(e);
								
							Utils.Sleep(150, "tplink1");
//.........这里部分代码省略.........
开发者ID:Air13,项目名称:ESharp,代码行数:101,代码来源:Tinker_Air13.cs

示例3: ComboInAction

        private static void ComboInAction(Hero me, Hero target)
        {
            #region Init
            /*
            var q = me.Spellbook.SpellQ;
            var w = me.Spellbook.SpellW;
            var e = me.Spellbook.SpellE;
            var active1 = me.Spellbook.Spell4;
            var active2 = me.Spellbook.Spell5;
            */
            var invoke = me.FindSpell("invoker_invoke");
            
            var eul = me.FindItem("item_cyclone");
            var dagger = me.FindItem("item_blink");
            var refresher = me.FindItem("item_refresher");
            var icewall = me.FindSpell("invoker_ice_wall");
            var deafblast = me.FindSpell("invoker_deafening_blast");
            var hex = me.FindItem("item_sheepstick");
            var urn = me.FindItem("item_urn_of_shadows");
            var orchid = me.FindItem("item_orchid");
            var meteor = me.FindSpell("invoker_chaos_meteor");
            var ss = me.FindSpell("invoker_sun_strike");
            //var emp = me.FindSpell("invoker_emp");
            /*
            
            var coldsnap = me.FindSpell("invoker_cold_snap");
            var ghostwalk = me.FindSpell("invoker_ghost_walk");
            
            var tornado = me.FindSpell("invoker_tornado");
            
            var forge = me.FindSpell("invoker_forge_spirit");
            
            var alacrity = me.FindSpell("invoker_alacrity");
            
            */
            if (!_initNewCombo)
            {
                _initNewCombo = true;
                _stage = 1;
                //PrintInfo("Starting new combo! " + $"[{_combo + 1}] target: {target.Name}");
            }
            if (!Utils.SleepCheck("StageCheck")) return;
            #endregion

            /*var modif = target.Modifiers.Where(x=>x.IsDebuff);
            PrintInfo("===========================");
            foreach (var s in modif)
            {
                PrintInfo(s.Name);
            }*/
            var myBoys = ObjectMgr.GetEntities<Unit>().Where(x => x.Team == me.Team && x.IsControllable && x.IsAlive && Utils.SleepCheck(x.Handle.ToString()));
            foreach (var myBoy in myBoys)
            {
                myBoy.Attack(target);
                Utils.Sleep(300, myBoy.Handle.ToString());
            }
            if (me.CanUseItems())
            {
                if (urn != null && urn.CanBeCasted(target))
                {
                    var urnMod = target.Modifiers.Any(x => x.Name == "modifier_item_urn_damage") &&
                                 Utils.SleepCheck(urn.Name);
                    if (!urnMod)
                    {
                        urn.UseAbility(target);
                        Utils.Sleep(300, urn.Name);
                    }
                }
                if (_stage > 2 && !target.IsHexed() && !target.IsStunned())
                {
                    if (hex != null && hex.CanBeCasted(target) &&
                        Menu.Item("items").GetValue<AbilityToggler>().IsEnabled(hex.Name) &&
                        Utils.SleepCheck("items"))
                    {
                        hex.UseAbility(target);
                        Utils.Sleep(300, "items");
                    }
                    if (orchid != null && orchid.CanBeCasted(target) &&
                        Menu.Item("items").GetValue<AbilityToggler>().IsEnabled(orchid.Name) &&
                        Utils.SleepCheck("items"))
                    {
                        orchid.UseAbility(target);
                        Utils.Sleep(300, "items");
                    }
                }
                if (dagger != null && Menu.Item("items").GetValue<AbilityToggler>().IsEnabled(dagger.Name) &&
                    dagger.CanBeCasted() && Utils.SleepCheck("blinker") && me.Distance2D(target) >= 700)
                {
                    var dist = 300;
                    var angle = me.FindAngleBetween(target.Position, true);
                    var point =
                        new Vector3(
                            (float) (target.Position.X -
                                     dist*
                                     Math.Cos(angle)),
                            (float) (target.Position.Y -
                                     dist*
                                     Math.Sin(angle)), 0);
                    if (me.Distance2D(target) <= 1150 + 700)
                        dagger.UseAbility(point);
//.........这里部分代码省略.........
开发者ID:dendimonster,项目名称:EnsageSharp-1,代码行数:101,代码来源:Program.cs

示例4: DoCombo

        private static void DoCombo(Hero target)
        {
            var theClosestMeepo = _meepoList.OrderBy(target.Distance2D).First();
            var dist = theClosestMeepo.Distance2D(target)+MyHero.HullRadius+target.HullRadius;
            var targetPos = target.Position;

            #region GetItems&Spells

            if (OrderStates[MyHero.Handle] != OrderState.Escape)
            {
                if (_blink != null && _blink.CanBeCasted() && dist <= 1150 && dist >= 250 && Utils.SleepCheck("Blink"))
                {
                    _blink.UseAbility(targetPos);
                    Utils.Sleep(250, "Blink");
                }
                var bkb = target.FindItem("item_black_king_bar");
                if (bkb != null && bkb.CanBeCasted() && _hex != null && _hex.CanBeCasted(target) &&
                    Utils.SleepCheck("hex"))
                {
                    _hex.UseAbility(target);
                    Utils.Sleep(250, "hex");
                }
                if (_orchid != null && _orchid.CanBeCasted(target) && !target.IsHexed() && Utils.SleepCheck("orchid") &&
                    Utils.SleepCheck("hex"))
                {
                    _orchid.UseAbility(target);
                    Utils.Sleep(250, "orchid");
                }
                if (_hex != null && _hex.CanBeCasted(target) && !target.IsSilenced() && Utils.SleepCheck("hex") &&
                    Utils.SleepCheck("orchid"))
                {
                    _hex.UseAbility(target);
                    Utils.Sleep(250, "hex");
                }
                if (_eb != null && _eb.CanBeCasted(target) && Utils.SleepCheck("eb"))
                {
                    _eb.UseAbility(target);
                    Utils.Sleep(250, "eb");
                }
            }

            #endregion

            foreach (
                var handle in
                    _meepoList.Where(x => x.IsAlive && OrderStates[x.Handle] != OrderState.Escape)
                        .Select(meepo => meepo.Handle))
            {
                OrderStates[handle] = OrderState.InCombo;
            }
            foreach (var meepo in _meepoList.Where(x => x.IsAlive && OrderStates[x.Handle] == OrderState.InCombo).OrderBy(y=>y.Distance2D(target)))
            {
                #region gettings spells and drawing effects

                var handle = meepo.Handle;
                DrawEffects(meepo, target);

                Ability q, w;
                if (!SpellQ.TryGetValue(handle, out q))
                    SpellQ[handle] = meepo.Spellbook.Spell1;
                if (!SpellW.TryGetValue(handle, out w))
                    SpellW[handle] = meepo.Spellbook.Spell2;
                #region Change Orders

                if (SafeTp(meepo, w))
                    continue;

                #endregion
                #endregion

                #region CastQ

                var mod = target.FindModifier("modifier_meepo_earthbind");
                var remTime = mod?.RemainingTime ?? 0;

                if ((_blink==null || !_blink.CanBeCasted()) && q != null && q.CanBeCasted() && dist <= q.CastRange &&
                    (mod == null || remTime <= .7) &&
                    Utils.SleepCheck("Period_q"))
                {
                    if (q.CastSkillShot(target))
                    //if (q.CastStun(target))
                    {
                        Utils.Sleep(q.GetHitDelay(target)*1000+100, "Period_q");
                    }
                }

                #endregion

                #region CastW

                if (w != null)
                {
                    var castRange = w.GetRealCastRange();
                    if ((!Equals(theClosestMeepo, meepo) || target.IsHexed() || target.IsStunned() ||
                         target.MovementSpeed <= 200 || (remTime > 1.3)) && w.CanBeCasted() &&
                        dist <= castRange &&
                        Utils.SleepCheck("Period_w" + handle))
                    {
                        w.UseAbility(theClosestMeepo);
                        Utils.Sleep(1500, "Period_w" + handle);
//.........这里部分代码省略.........
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:101,代码来源:Program.cs

示例5: TryToDispell

 private static void TryToDispell(Hero me, List<Item> toList, bool both, bool main, bool tempest)
 {
     var target = main ? _mainHero : tempest ? me : null;
     if (both)
     {
         var underShit = me.IsSilenced() || me.IsHexed() /*|| me.DebuffState*/;
         var isSilenced2 = _mainHero.IsSilenced();
         if (isSilenced2)
         {
             foreach (var item in toList.Where(item => me.Distance2D(_mainHero) <= 600))
             {
                 item.UseAbility(_mainHero);
                 Utils.Sleep(500, item.Name + me.Handle);
             }
         }
         if (underShit)
         {
             foreach (var item in toList)
             {
                 item.UseAbility(me);
                 Utils.Sleep(500, item.Name + me.Handle);
             }
         }
         foreach (var hero in Ensage.Common.Objects.Heroes.GetByTeam(me.Team).Where(x=>x.IsAlive && x.Distance2D(me)<=600 && (x.IsHexed() || x.IsSilenced())))
         {
             foreach (var item in toList)
             {
                 item.UseAbility(hero);
                 Utils.Sleep(500, item.Name + me.Handle);
             }
         }
     }
     else
     {
         var isSilenced = target.IsSilenced();
         if (!isSilenced) return;
         foreach (var item in toList.Where(x => me.Distance2D(target) <= 600))
         {
             item.UseAbility(target);
             Utils.Sleep(500, item.Name + me.Handle);
         }
     }
 }
开发者ID:DevGdos,项目名称:EnsageSharp,代码行数:43,代码来源:Program.cs

示例6: DoCombo

        private static void DoCombo(Hero me, Hero target)
        {
            var darkPact = me.Spellbook.SpellQ;
            var pounce = me.Spellbook.SpellW;
            var shadowDance = me.Spellbook.SpellR;
            var distance = me.Distance2D(target);

            var inSb = me.Modifiers.Any(x => x.Name == "modifier_item_silver_edge_windwalk" || x.Name == "modifier_item_invisibility_edge_windwalk");
            if (inSb)
            {
                if (!Utils.SleepCheck("attacking")) return;
                me.Attack(target);
                Utils.Sleep(200, "attacking");
                return;
            }
            if (Utils.SleepCheck("items"))
            {
                /*foreach (var item in me.Inventory.Items)
                {
                    Game.PrintMessage(item.Name+": "+item.AbilityBehavior,MessageType.ChatMessage);
                }*/
                var items =
                    me.Inventory.Items.Where(
                        x =>
                            Items.Contains(x.Name) && x.CanBeCasted() && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(x.Name) &&
                            (x.CastRange==0 || x.CastRange >= distance) && Utils.SleepCheck(x.Name)).ToList();
                foreach (var item in items)
                {
                    switch (item.ClassID)
                    {
                        case ClassID.CDOTA_Item_BlinkDagger:
                            var p = Prediction.InFront(target, 100);
                            var dist = me.Distance2D(p);
                            if (dist <= 1150 && dist >= 400 && pounce != null && pounce.CanBeCasted())
                            {
                                item.UseAbility(p);
                                Utils.Sleep(200, item.Name);
                            }
                            break;
                        default:
                            if (item.IsAbilityBehavior(AbilityBehavior.UnitTarget))
                            {
                                if (!target.IsStunned() && !target.IsHexed())
                                {
                                    item.UseAbility(target);
                                }
                                item.UseAbility(me);
                            }
                            else
                            {
                                item.UseAbility();
                            }
                            Utils.Sleep(200, item.Name);
                            break;
                    }
                }
            }

            if (Utils.SleepCheck("dp") && darkPact != null && darkPact.CanBeCasted() && darkPact.CanHit(target))
            {
                darkPact.UseAbility();
                Utils.Sleep(100, "dp");
            }
            var angle = (float) Math.Max(
                Math.Abs(me.RotationRad - Utils.DegreeToRadian(me.FindAngleBetween(target.Position))) - 0.20, 0);
            if (Utils.SleepCheck("pounce") && pounce != null && pounce.CanBeCasted() && distance <= 300 && angle == 0)
            {
                pounce.UseAbility();
                Utils.Sleep(100, "pounce");
            }

            if (me.Health <= me.MaximumHealth / 100 * Menu.Item("minHp").GetValue<Slider>().Value && Utils.SleepCheck("dance") && shadowDance != null && shadowDance.CanBeCasted())
            {
                shadowDance.UseAbility();
                Utils.Sleep(100, "dance");
            }

            if (!Utils.SleepCheck("attacking")) return;
            me.Attack(target);
            Utils.Sleep(200, "attacking");
        }
开发者ID:dendimonster,项目名称:EnsageSharp-1,代码行数:81,代码来源:Program.cs

示例7: DisabledAlly

 public static bool DisabledAlly(Hero target)
 {
     return target.IsStunned() || target.IsHexed() || target.IsRooted();
 }
开发者ID:Ray0fHope,项目名称:EnsageSharp,代码行数:4,代码来源:CastingChecks.cs

示例8: IsDisbled

 private static bool IsDisbled(Hero unit) {
     return (unit.IsHexed() || unit.IsStunned() ||
             (unit.IsSilenced() && unit.PrimaryAttribute == Attribute.Intelligence) ||
             unit.Modifiers.Any(
                 x =>
                     x.Name == "modifier_doom_bringer_doom" || x.Name == "modifier_axe_berserkers_call" ||
                     (x.Name == "modifier_legion_commander_duel" &&
                      unit.ClassID != ClassID.CDOTA_Unit_Hero_Legion_Commander)) &&
             Menu.Item("autoHealWhenDisabled").GetValue<HeroToggler>().IsEnabled(unit.Name)) &&
            unit.Modifiers.All(x => x.Name != "modifier_winter_wyvern_cold_embrace");
 }
开发者ID:RetiredQQ,项目名称:Ensage,代码行数:11,代码来源:Program.cs

示例9: ComboInAction


//.........这里部分代码省略.........
                                                (float) (target.Position.X -
                                                         200*
                                                         Math.Cos(me.FindAngleBetween(target.Position, true))),
                                                (float) (target.Position.Y -
                                                         200*
                                                         Math.Sin(me.FindAngleBetween(target.Position, true))), 0);
                                        me.Move(point);
                                        Utils.Sleep(300, "icewallmove");
                                    }

                                }
                                else
                                {
                                    _spellForCast.UseAbility();
                                    _stage++;
                                    Utils.Sleep(250, "StageCheck");
                                }
                            }
                            else
                            {
                                var tornadoMod = target.Modifiers.FirstOrDefault(x => x.Name == "modifier_invoker_tornado");
                                if (Equals(_spellForCast, deafblast))
                                {
                                    if (tornadoMod != null &&
                                        tornadoMod.RemainingTime <= me.Distance2D(target) / 1100 - .1 - Game.Ping / 1000)
                                    {
                                        UseSpell(_spellForCast, target);
                                        _stage++;
                                        Utils.Sleep(250, "StageCheck");
                                    }
                                    else if (tornadoMod == null)
                                    {
                                        UseSpell(_spellForCast, target);
                                        _stage++;
                                        Utils.Sleep(250, "StageCheck");
                                    }
                                }
                                else if (!Equals(_spellForCast, ss) && !Equals(_spellForCast, chaosmeteor))
                                {
                                    UseSpell(_spellForCast, target);
                                    _stage++;
                                    Utils.Sleep(250, "StageCheck");
                                }

                                var timing = (Equals(_spellForCast, ss))
                                    ? 1.7
                                    : (Equals(_spellForCast, chaosmeteor)) ? 1.3 : 0;
                                timing += Game.Ping / 1000 - 0.005;
                                //PrintInfo(timing.ToString(CultureInfo.InvariantCulture));
                                if (tornadoMod != null && tornadoMod.RemainingTime < timing)
                                {
                                    UseSpell(_spellForCast, target);
                                    _stage++;
                                    Utils.Sleep(250, "StageCheck");
                                }
                            }

                        }
                        else
                        {
                            SpellStruct s;
                            if (SpellInfo.TryGetValue(_spellForCast.Name, out s))
                            {
                                if (invoke.CanBeCasted())
                                {
                                    var spells = s.GetNeededAbilities();
                                    if (spells[0] != null) spells[0].UseAbility();
                                    if (spells[1] != null) spells[1].UseAbility();
                                    if (spells[2] != null) spells[2].UseAbility();
                                    invoke.UseAbility();
                                    Utils.Sleep(70, "StageCheck");
                                }
                            }
                            else
                                try
                                {
                                    PrintError("couldnt find data for spell: " + _spellForCast.Name);
                                }
                                catch (Exception)
                                {
                                    PrintError("couldnt find data for spell: ERROR");
                                }
                        }
                    }
                    break;*/

                    #endregion
            }
            if (_autoUseRefresher && refresher != null && refresher.AbilityState == AbilityState.Ready && _stage>=5)
            {
                refresher.UseAbility();
                _stage = 3;

            }
            if (_stage>2 && !target.IsHexed() && !target.IsStunned())
            {
                if (hex != null && hex.CanBeCasted(target))
                    hex.UseAbility(target);
            }
        }
开发者ID:popopxD,项目名称:JumpAttacker_EnsageSharp_fork,代码行数:101,代码来源:Program.cs

示例10: ItemUsage

 private static void ItemUsage(Hero me, IEnumerable<Item> inv, Hero target, float distance, bool useBkb, bool byIllusion = false)
 {
     if (me.IsChanneling()) return;
     var inventory = inv.Where(x => Utils.SleepCheck(x.Name + me.Handle) && x.CanBeCasted()/* && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(x.Name)*/).ToList();
     var items =
         inventory.Where(
             x =>
                 Items.Contains(x.Name) &&
                 ((x.CastRange == 0 && distance <= 1150 + Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value) ||
                  x.CastRange >= distance)).ToList();
     foreach (var item in items)
     {
         if (item.Name == "item_blink")
         {
             if (distance > 1150)
             {
                 var point = new Vector3(
                     (float)
                         (target.Position.X -
                          Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value*
                          Math.Cos(me.FindAngleBetween(target.Position, true))),
                     (float)
                         (target.Position.Y -
                          Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value*
                          Math.Sin(me.FindAngleBetween(target.Position, true))),
                     target.Position.Z);
                 var dist = me.Distance2D(point);
                 if (dist >= Menu.Item("Dagger.MinDistance").GetValue<Slider>().Value && dist <= 1150)
                 {
                     item.UseAbility(point);
                     Utils.Sleep(500, item.Name + me.Handle);
                 }
             }
             else if (distance>Menu.Item("Dagger.MinDistance").GetValue<Slider>().Value)
             {
                 item.UseAbility(target.Position);
                 Utils.Sleep(500, item.Name + me.Handle);
             }
             continue;
         }
         item.UseAbility();
         item.UseAbility(target);
         item.UseAbility(target.Position);
         item.UseAbility(me);
         Utils.Sleep(500, item.Name + me.Handle);
     }
     var underDiff = target.Modifiers.Any(x => x.Name == "modifier_item_diffusal_blade_slow");
     //Game.PrintMessage("Under SLow?: "+target.Modifiers.Any(x=>x.Name=="modifier_item_diffusal_blade_slow"),MessageType.ChatMessage);
     if (byIllusion && !underDiff && !target.IsStunned() && !target.IsHexed())
     {
         var items2 = inventory.Where(x => CloneOnlyComboItems.Contains(x.Name) && ((x.CastRange == 0 && distance <= 650) || x.CastRange >= distance)).ToList();
         foreach (var item in items2)
         {
             item.UseAbility(target);
             Utils.Sleep(500, item.Name + me.Handle);
         }
     }
     if (useBkb && distance<650)
     {
         var bkb = inventory.FirstOrDefault(x => x.Name == "item_black_king_bar");
         if (bkb != null && bkb.CanBeCasted() && Utils.SleepCheck(bkb.Name + me.Handle))
         {
             bkb.UseAbility();
             Utils.Sleep(500, bkb.Name + me.Handle);
         }
     }
     if (!items.Any()) return;
     {
         var r = me.Spellbook.SpellR;
         if (r == null || r.CanBeCasted()) return;
         var refresher = inventory.FirstOrDefault(x => x.Name == "item_refresher");
         refresher?.UseAbility();
         Utils.Sleep(500, refresher?.Name + me.Handle);
     }
 }
开发者ID:dendimonster,项目名称:EnsageSharp-1,代码行数:75,代码来源:Program.cs


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