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


C# Hero.IsSilenced方法代码示例

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


在下文中一共展示了Hero.IsSilenced方法的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: 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

示例3: AD


//.........这里部分代码省略.........
						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");
						}




					//break channel by Hex
					if (!me.IsChanneling()
						&& sheep != null && sheep.CanBeCasted()
						&& me.Distance2D(e) <= 800 + aetherrange + ensage_error
						&& !e.Modifiers.Any(y => y.Name == "modifier_eul_cyclone")
						&& !e.IsSilenced()
						&& !e.IsMagicImmune()
						&& !e.IsLinkensProtected()
						&& !e.Modifiers.Any(y => y.Name == "modifier_teleporting")
						&& Utils.SleepCheck(e.Handle.ToString())
						&& (e.IsChanneling()
							|| (e.FindItem("item_blink") != null && IsCasted(e.FindItem("item_blink")))
						//break escape spells (1 hex, 2 seal) no need cyclone
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_QueenOfPain && e.FindSpell("queenofpain_blink").IsInAbilityPhase
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_AntiMage && e.FindSpell("antimage_blink").IsInAbilityPhase
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_StormSpirit && e.FindSpell("storm_spirit_ball_lightning").IsInAbilityPhase
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Shredder && e.FindSpell("shredder_timber_chain").IsInAbilityPhase
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Weaver && e.FindSpell("weaver_time_lapse").IsInAbilityPhase
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_FacelessVoid && e.FindSpell("faceless_void_time_walk").IsInAbilityPhase
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Phoenix && e.FindSpell("phoenix_icarus_dive").IsInAbilityPhase
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Magnataur && e.FindSpell("magnataur_skewer").IsInAbilityPhase
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Morphling && e.FindSpell("morphling_waveform").IsInAbilityPhase
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_PhantomAssassin && e.FindSpell("phantom_assassin_phantom_strike").IsInAbilityPhase
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Riki && e.FindSpell("riki_blink_strike").IsInAbilityPhase
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Spectre && e.FindSpell("spectre_haunt").IsInAbilityPhase
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Furion && e.FindSpell("furion_sprout").IsInAbilityPhase
							
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_PhantomLancer && e.FindSpell("phantom_lancer_doppelwalk").IsInAbilityPhase



							//break special (1 hex, 2 cyclone)
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Riki && me.Modifiers.Any(y => y.Name == "modifier_riki_smoke_screen")
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_SpiritBreaker && e.Modifiers.Any(y => y.Name == "modifier_spirit_breaker_charge_of_darkness")
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Phoenix && e.Modifiers.Any(y => y.Name == "modifier_phoenix_icarus_dive")
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Magnataur && e.Modifiers.Any(y => y.Name == "modifier_magnataur_skewer_movement")

开发者ID:Air13,项目名称:ESharp,代码行数:65,代码来源:Tinker_Air13.cs

示例4: CastCombo

        private static void CastCombo(Hero globalTarget, Ability laser, Ability rockets, bool singleCombo = false)
        {
            var myInventory = Members.MyHero.Inventory.Items.ToList();
            var allItems = myInventory.Where(x =>
                Helper.IsItemEnable(x.StoredName()) && x.CanBeCasted()).ToList();
            var distance = Members.MyHero.Distance2D(globalTarget);
            var daggerCastRange = 1150 + (myInventory.Any(x => x.StoredName() == "item_aether_lens") ? 200 : 0);
            var inventory =
                allItems.Where(
                    x =>
                         ((x.StoredName() == "item_blink" && distance <= daggerCastRange + CloseRange) ||
                         (x.GetCastRange() > 0 && x.CanHit(globalTarget) /* && distance <= x.GetCastRange() + 150*/) ||
                         (x.GetCastRange() <= 0)) && Utils.SleepCheck($"{x.Handle}+item_usages"))
                    .ToList();

            if (laser != null && Helper.IsAbilityEnable(laser.StoredName()) && laser.CanBeCasted() &&
                laser.CanHit(globalTarget) && !_spellSleeper.Sleeping(laser))
            {
                laser.UseAbility(globalTarget);
                _spellSleeper.Sleep(1000, laser);
            }
            var slarkMod = globalTarget.HasModifiers(new[] { "modifier_slark_dark_pact", "modifier_slark_dark_pact_pulses" }, false);
            foreach (var item in inventory.OrderByDescending(Helper.PriorityHelper))
            {
                var name = item.StoredName();
                if (name == "item_ethereal_blade")
                    _ethereal.Sleep(1000);
                if (name.Contains("dagon"))
                    if (_ethereal.Sleeping && !globalTarget.HasModifier("modifier_item_ethereal_blade_ethereal"))
                        continue;
                if (item.IsAbilityBehavior(AbilityBehavior.NoTarget))
                {
                    item.UseAbility();
                }
                else if (item.IsAbilityBehavior(AbilityBehavior.UnitTarget))
                    if (item.TargetTeamType == TargetTeamType.Enemy || item.TargetTeamType == TargetTeamType.All ||
                        item.TargetTeamType == TargetTeamType.Custom)
                    {
                        if (item.IsDisable())
                        {
                            if (!slarkMod && !globalTarget.IsLinkensProtected())
                                item.UseAbility(globalTarget);
                                /*if (item.CastStun(globalTarget))
                                {
                                    Utils.Sleep(250, $"{item.Handle}+item_usages");
                                    continue;
                                }*/
                        }
                        else if (item.IsSilence())
                        {
                            if (!slarkMod)
                                if (!globalTarget.IsSilenced())
                                {
                                    item.UseAbility(globalTarget);
                                }
                        }
                        else if ((item.StoredName().Contains("dagon") || item.StoredName() == "item_ethereal_blade") &&
                                 globalTarget.HasModifiers(
                                     new[]
                                     {
                                         /*"modifier_templar_assassin_refraction_absorb",
                                         "modifier_templar_assassin_refraction_absorb_stacks",*/
                                         "modifier_oracle_fates_edict",
                                         "modifier_abaddon_borrowed_time"
                                     }, false))
                        {
                            continue;
                        }
                        else
                        {
                            item.UseAbility(globalTarget);
                        }

                        /*item.UseAbility(target);
                        Print($"[Using]: {item.Name} (3)", print: false);*/
                    }
                    else
                    {
                        item.UseAbility(Members.MyHero);
                    }
                else
                {
                    if (name == "item_blink")
                    {
                        if (singleCombo || _spellSleeper.Sleeping("blink_fix"))
                            continue;
                        if (distance > daggerCastRange+CloseRange)
                        {
                            var angle = Members.MyHero.FindAngleBetween(globalTarget.Position, true);
                            var point = new Vector3(
                                (float)
                                    (globalTarget.Position.X -
                                     daggerCastRange *
                                     Math.Cos(angle)),
                                (float)
                                    (globalTarget.Position.Y -
                                     daggerCastRange *
                                     Math.Sin(angle)),
                                globalTarget.Position.Z);
                            var dist = Members.MyHero.Distance2D(point);
//.........这里部分代码省略.........
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:101,代码来源:ComboAction.cs

示例5: 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

示例6: Universe

        public static void Universe(EventArgs args)
        {
            if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
                return;
            me = ObjectMgr.LocalHero;
            if (me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Brewmaster)
                return;
			FindItems();
			//manta (when silenced)
			if ((manta != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(manta.Name)) && manta.CanBeCasted() && me.IsSilenced() && Utils.SleepCheck("manta"))
             {
                manta.UseAbility();
                Utils.Sleep(400 + Game.Ping, "manta");
             }
			if (Game.IsKeyDown(Menu.Item("Using Ultimate").GetValue<KeyBind>().Key) && !Game.IsChatOpen && Utils.SleepCheck("toggle"))
            {
                activated = !activated;
                Utils.Sleep(250, "toggle");
            }
            if (Game.IsKeyDown(Menu.Item("Combo Key").GetValue<KeyBind>().Key) && !Game.IsChatOpen)
            {
                if (me.CanCast())
                {
                    mousepos = Game.MousePosition;
					var target = me.ClosestToMouseTarget(1200);
					var CheckDrunken = target.Modifiers.Any(y => y.Name == "modifier_brewmaster_drunken_haze");
                    if (me.Distance2D(mousepos) <= 1200)
                    {
                            //drunken haze (main combo)
							if ((drunkenhaze != null && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(drunkenhaze.Name)) && drunkenhaze.CanBeCasted() && ((target.Position.Distance2D(me.Position) < 850) && (target.Position.Distance2D(me.Position) > 300)) && primalsplit.CanBeCasted() && Utils.SleepCheck("thunderclap"))
                            {
                                drunkenhaze.UseAbility(target);
                                Utils.Sleep(150 + Game.Ping, "drunkenhaze");
                            }
							//drunken haze (if can't cast ult) --->Сюда добавить переменную отвечающую за ручное выключение ульты из комбо && если ульт выключен
							if ((drunkenhaze != null && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(drunkenhaze.Name)) && drunkenhaze.CanBeCasted() && target.Position.Distance2D(me.Position) < 850 && (!primalsplit.CanBeCasted() || (target.Health < (target.MaximumHealth*0.50)) || !activated || !(Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(primalsplit.Name))) && !CheckDrunken && (target.Health > (target.MaximumHealth*0.07)) && Utils.SleepCheck("drunkenhaze"))
                            {
                                drunkenhaze.UseAbility(target);
                                Utils.Sleep(150 + Game.Ping, "drunkenhaze");
                            }
							//black king bar
							if ((bkb != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(bkb.Name)) && bkb.CanBeCasted() && Utils.SleepCheck("bkb"))
                            {
                                bkb.UseAbility();
                                Utils.Sleep(150 + Game.Ping, "bkb");
                            }
							//blink
                            if ((blink != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(blink.Name)) && blink.CanBeCasted() && target.Position.Distance2D(me.Position) > 300 && Utils.SleepCheck("blink"))
                            {
                                blink.UseAbility(me.Distance2D(mousepos) < 1200 ? mousepos : new Vector3(me.NetworkPosition.X + 1150 * (float)Math.Cos(me.NetworkPosition.ToVector2().FindAngleBetween(mousepos.ToVector2(), true)), me.NetworkPosition.Y + 1150 * (float)Math.Sin(me.NetworkPosition.ToVector2().FindAngleBetween(mousepos.ToVector2(), true)), 100), false);
                                Utils.Sleep(150 + Game.Ping, "blink");
                            }
							//orchid
							if ((orchid != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(orchid.Name)) && orchid.CanBeCasted() && (target.Position.Distance2D(me.Position) < 300) && Utils.SleepCheck("orchid"))
                            {
                                orchid.UseAbility(target);
                                Utils.Sleep(150 + Game.Ping, "orchid");
                            }
							//dust
							if ((dust != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(dust.Name)) && dust.CanBeCasted() && Utils.SleepCheck("dust"))
                            {
                                dust.UseAbility();
                                Utils.Sleep(150 + Game.Ping, "dust");
                            }
							//necronomicon
							if ((necronomicon != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(necronomicon.Name)) && necronomicon.CanBeCasted() && (target.Health > (target.MaximumHealth*0.20)) && (target.Position.Distance2D(me.Position) < 400) && Utils.SleepCheck("necronomicon"))
                            {
                                necronomicon.UseAbility();
                                Utils.Sleep(150 + Game.Ping, "necronomicon");
                            }
							if ((necronomicon2 != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(necronomicon2.Name)) && necronomicon2.CanBeCasted() && (target.Health > (target.MaximumHealth*0.20)) && (target.Position.Distance2D(me.Position) < 400) && Utils.SleepCheck("necronomicon2"))
                            {
                                necronomicon2.UseAbility();
                                Utils.Sleep(150 + Game.Ping, "necronomicon2");
                            }
							if ((necronomicon3 != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(necronomicon3.Name)) && necronomicon3.CanBeCasted() && (target.Health > (target.MaximumHealth*0.20)) && (target.Position.Distance2D(me.Position) < 400) && Utils.SleepCheck("necronomicon3"))
                            {
                                necronomicon3.UseAbility();
                                Utils.Sleep(150 + Game.Ping, "necronomicon3");
                            }
							//thunder clap
                            if ((thunderclap != null && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(thunderclap.Name)) && thunderclap.CanBeCasted() && (target.Position.Distance2D(me.Position) < 300) && Utils.SleepCheck("thunderclap"))
                            {
                                thunderclap.UseAbility();
                                Utils.Sleep(150 + Game.Ping, "thunderclap");
                            }
							//urn of shadow
							if ((urn != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(urn.Name)) && urn.CanBeCasted() && Utils.SleepCheck("urn"))
                            {
                                urn.UseAbility(target);
                                Utils.Sleep(150 + Game.Ping, "urn");
                            }
							//medal
							if ((medal != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(medal.Name)) && medal.CanBeCasted() && (target.Position.Distance2D(me.Position) < 300) && Utils.SleepCheck("medal"))
                            {
                                medal.UseAbility(target);
                                Utils.Sleep(150 + Game.Ping, "medal");
                            }
							//shiva
							if ((shiva != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(shiva.Name)) && shiva.CanBeCasted() && (target.Position.Distance2D(me.Position) <= 800) && Utils.SleepCheck("shiva"))
//.........这里部分代码省略.........
开发者ID:Rgern100,项目名称:memes,代码行数:101,代码来源:BrewMaster.cs

示例7: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectMgr.LocalHero;
            var targets = ObjectMgr.GetEntities<Hero>().Where(enemy => enemy.Team == me.GetEnemyTeam() && !enemy.IsIllusion() && enemy.IsVisible && enemy.IsAlive && enemy.Health > 0).ToList();
            if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
                return;

            if (me.ClassID != ClassID.CDOTA_Unit_Hero_AntiMage)
                return;

            if (me == null)
                return;
            if (ulti == null)
                ulti = me.Spellbook.Spell4;

            if (Menu.Item("Killsteal").GetValue<bool>())
            {
                double modif = 0;
                switch (ulti.Level)
                {
                    case 1:
                        modif = .6;
                        break;

                    case 2:
                        modif = .85;
                        break;

                    case 3:
                        modif = 1.1;
                        break;
                    default:
                        break;
                }

                foreach (var target in targets)
                {
                    double damage = 0;
                    damage = Math.Floor((target.MaximumMana - target.Mana) * modif);
                    double damagefinal = target.DamageTaken((float)damage, DamageType.Magical, me, false);
                    double damageNeeded = target.Health - damagefinal + ulti.GetCastPoint(ulti.Level) * target.HealthRegeneration;
                    if (damageNeeded < 0 && ulti.CanBeCasted() && Utils.SleepCheck("ulti") && GetDistance2D(target.Position, me.Position) < 600)
                    {
                        ulti.UseAbility(target);
                        Utils.Sleep(150 + Game.Ping, "ulti");
                    }
                }
            }

            if (blink == null)
                blink = me.Spellbook.Spell2;

            if (armlet == null)
                armlet = me.FindItem("item_armlet");
            if (manta == null)
                manta = me.FindItem("item_manta");
            if (mjollnir == null)
                mjollnir = me.FindItem("item_mjollnir");
            if (dust == null)
                dust = me.FindItem("item_dust");
            if (bladeMail == null)
                bladeMail = me.FindItem("item_blade_mail");
            if (mom == null)
                mom = me.FindItem("item_mask_of_madness");
            if (medallion == null)
                medallion = me.FindItem("item_medallion_of_courage");
            if (solar == null)
                solar = me.FindItem("item_solar_crest");
            if (abyssal == null)
                abyssal = me.FindItem("item_abyssal_blade");

            if (manta != null && manta.CanBeCasted() && Menu.Item("Manta").GetValue<bool>() && me.IsSilenced())
            {
                manta.UseAbility();
                Utils.Sleep(150 + Game.Ping, "manta");
            }

            var illus = ObjectMgr.GetEntities<Hero>().Where(x => x.IsAlive && x.IsControllable && x.Team == me.Team && x.IsIllusion && x.Modifiers.Any(y => y.Name != "modifier_kill")).ToList();

            if (Menu.Item("Illusion").GetValue<bool>())
            {
                foreach (var enemy in targets)
                {
                    if (enemy.Health > 0)
                    {
                        foreach (var illusion in illus)
                        {
                            if (GetDistance2D(enemy.Position, illusion.Position) < 400 && Utils.SleepCheck(illusion.Handle.ToString()))
                            {
                                illusion.Attack(enemy);
                                Utils.Sleep(1000, illusion.Handle.ToString());
                            }
                        }
                    }
                }
            }
            if (combo && Menu.Item("enable").GetValue<bool>())
            {
                target = me.ClosestToMouseTarget(1000);

//.........这里部分代码省略.........
开发者ID:spyware293,项目名称:Ensage,代码行数:101,代码来源:Program.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: ItemUsage

        /**
        * ItemUsage takes in a Hero me, its inventory inv, a Hero target, the distance between me and target, a boolean usebkb and byillusion
        * and uses all items as necessary
        * 1) Uses blink dagger to a point given by Dagger.CloseRange menu option
        * 2) Uses all other items specified in the Items list (line 53)
        * 3) Uses diffusal blade (to purge or dispel) if enabled
        * 4) Uses bkb if enabled
        * 5) Uses ultimate if all items expect of refresher was casted
        **/
        private static bool ItemUsage(Hero me, IEnumerable<Item> inv, Hero target, double distance, bool useBkb, bool byIllusion = false)
        {
            if (me.IsChanneling() || !Utils.SleepCheck("DaggerTime") || me.IsStunned()) return false;
            // use all items given in Items list (line 53)
            var enumerable = inv as Item[] ?? inv.ToArray();
            var phase =
                enumerable.Find(
                    x =>
                        x.StoredName() == HideItemList[0] && byIllusion &&
                        SpellBaseList.Find(z => z.Name == x.Name) == null && Utils.SleepCheck(x.Name + me.Handle));
            if (phase != null)
            {
                phase.UseAbility();
                Utils.Sleep(250, $"{phase.StoredName() + me.Handle}");
            }
            var inventory =
                enumerable.Where(
                    x =>
                        (IsItemEnable(x.StoredName(), byIllusion) || CloneOnlyComboItems.Contains(x.StoredName()) ||
                         x.StoredName() == "item_dust" || x.StoredName() == "item_black_king_bar") && x.CanBeCasted() &&
                        (!byIllusion || SpellBaseList.Find(z => z.Name == x.Name) == null)
                            /* && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(x.Name)*/ && CheckForPike(me,target,distance,x) ).ToList();
            var items =
                inventory.Where(
                    x =>
                        Utils.SleepCheck(x.Name + me.Handle) && Items.Keys.Contains(x.Name) &&
                        ((x.CastRange == 0 &&
                          distance <=
                          (x.Name == "item_blink" ? 1150 + Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value : 1000)) ||
                         /*x.CastRange+50 >= distance*/x.CanHit(target))).OrderByDescending(y => GetComboOrder(y, byIllusion));
            var slarkMod = target.HasModifiers(new[] { "modifier_slark_dark_pact", "modifier_slark_dark_pact_pulses" }, false);
            foreach (var item in items)
            {
                var name = item.StoredName();
                if (name == "item_ethereal_blade")
                    _ethereal.Sleep(1000);
                if (name == "item_dagon" || name == "item_dagon_2" || name == "item_dagon_3" || name == "item_dagon_4" || name == "item_dagon_5")
                    if (_ethereal.Sleeping && !target.HasModifier("modifier_item_ethereal_blade_ethereal"))
                        continue;
                if (name == "item_hurricane_pike")
                {
                    item.UseAbility(me);
                    Utils.Sleep(250, $"{name + me.Handle}");
                    continue;
                }
                if (item.IsAbilityBehavior(AbilityBehavior.NoTarget))
                {
                    item.UseAbility();
                    Print($"[Using]: {item.Name} (10)", print: false);
                }
                else if (item.IsAbilityBehavior(AbilityBehavior.UnitTarget))
                    if (item.TargetTeamType == TargetTeamType.Enemy || item.TargetTeamType == TargetTeamType.All ||
                        item.TargetTeamType == TargetTeamType.Custom)
                    {
                        if (item.IsDisable())
                        {
                            if (!slarkMod && !target.IsLinkensProtected())
                                if (item.CastStun(target))
                                {
                                    Print($"[Using]: {item.Name} (9)", print: false);
                                    Utils.Sleep(350, $"{item.Name + me.Handle}");
                                    continue;
                                }
                        }
                        else if (item.IsSilence())
                        {
                            if (!slarkMod)
                                if (!target.IsSilenced())
                                {
                                    item.UseAbility(target);
                                    Print($"[Using]: {item.Name} (8)", print: false);
                                }
                        }
                        else if ((item.StoredName().Contains("dagon") || item.StoredName() == "item_ethereal_blade") &&
                                 target.HasModifiers(
                                     new[]
                                     {
                                         "modifier_templar_assassin_refraction_absorb",
                                         "modifier_templar_assassin_refraction_absorb_stacks",
                                         "modifier_oracle_fates_edict",
                                         "modifier_abaddon_borrowed_time"
                                     }, false))
                        {
                            Print("can damage this shit", print: false);
                            continue;
                        }
                        else
                        {
                            item.UseAbility(target);
                            Print($"[Using]: {item.Name} (1)", print: false);
                            Utils.Sleep(350, $"{item.Name + me.Handle}");
//.........这里部分代码省略.........
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:101,代码来源:Core.cs

示例10: Game_OnUpdate


//.........这里部分代码省略.........
                        && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(W.Name)
                        && Utils.SleepCheck("W"))
                    {
                        W.UseAbility();
                        Utils.Sleep(300, "W");
                    }
                    float angle = me.FindAngleBetween(target.Position, true);
                    Vector3 pos = new Vector3((float)(target.Position.X - 500 * Math.Cos(angle)), (float)(target.Position.Y - 500 * Math.Sin(angle)), 0);
                    if (
                        blink != null
                        && Q.CanBeCasted()
                        && me.CanCast()
                        && blink.CanBeCasted()
                        && me.Distance2D(target) >= 490
                        && me.Distance2D(pos) <= 1180
                        && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(blink.Name)
                        && Utils.SleepCheck("blink")
                        )
                    {
                        blink.UseAbility(pos);
                        Utils.Sleep(250, "blink");
                    }
                    if (
                           E != null
                           && E.CanBeCasted()
                           && me.CanCast()
                           && !target.IsLinkensProtected()
                           && me.Position.Distance2D(target) < 1400
                           && Utils.SleepCheck("E"))
                    {
                        E.UseAbility(target);
                        Utils.Sleep(200, "E");
                    }
                    if (!E.CanBeCasted() || E == null || me.IsSilenced())
                    {
                        if ( // orchid
                            orchid != null
                            && orchid.CanBeCasted()
                            && me.CanCast()
                            && !target.IsLinkensProtected()
                            && !target.IsMagicImmune()
                            && me.Distance2D(target) <= 1400
                            && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(orchid.Name)
                            && Utils.SleepCheck("orchid")
                            )
                        {
                            orchid.UseAbility(target);
                            Utils.Sleep(250, "orchid");
                        } // orchid Item end
                        if (!orchid.CanBeCasted() || orchid == null || me.IsSilenced() || !Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(orchid.Name))
                        {
                            if ( // vail
                                   vail != null
                                  && vail.CanBeCasted()
                                  && me.CanCast()
                                  && !target.IsMagicImmune()
                                  && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(vail.Name)
                                  && me.Distance2D(target) <= 1500
                                  && Utils.SleepCheck("vail")
                                  )
                            {
                                vail.UseAbility(target.Position);
                                Utils.Sleep(250, "vail");
                            } // orchid Item end
                            if (!vail.CanBeCasted() || vail == null || me.IsSilenced() || !Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(vail.Name))
                            {
开发者ID:VickTheRock,项目名称:ReworkAllScripts,代码行数:67,代码来源:Program.cs


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