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


C# Hero.IsInvul方法代码示例

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


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

示例1: Execute

        /// <summary>
        ///     The execute.
        /// </summary>
        /// <param name="hero">
        ///     The hero.
        /// </param>
        /// <returns>
        ///     The <see cref="bool" />.
        /// </returns>
        public bool Execute(Hero hero)
        {
            if ((Variables.Instance.Techies.EnabledHeroes.ContainsKey(hero.ClassID)
                 && !Variables.Instance.Techies.EnabledHeroes[hero.ClassID]) || hero.IsInvul() || hero.IsMagicImmune()
                || hero.HasModifiers(
                    new[]
                        {
                            "modifier_juggernaut_blade_fury",
                            "modifier_ember_spirit_sleight_of_fist_caster_invulnerability"
                        },
                    false) || !hero.CanDie())
            {
                return false;
            }

            if (!Utils.SleepCheck(hero.ClassID + "Techies.AutoDetonate"))
            {
                return false;
            }

            var tempDamage = hero.GetStackDamage();
            if (!(tempDamage.Item1 >= hero.Health))
            {
                return false;
            }

            if (tempDamage.Item3 != null && tempDamage.Item3.AutoDetonate)
            {
                Detonate(tempDamage.Item2);
                Utils.Sleep(500, hero.ClassID + "Techies.AutoDetonate");
                return true;
            }

            if (tempDamage.Item3 == null || tempDamage.Item3.AutoDetonate
                || !Variables.Menu.DrawingsMenu.Item("Techies.ShowNotification").GetValue<bool>())
            {
                return false;
            }

            if (!Utils.SleepCheck("Techies.Notification." + hero.StoredName()))
            {
                return false;
            }

            Utils.Sleep(15000, "Techies.Notification." + hero.StoredName());
            if (this.notification == null)
            {
                this.notification = new Notification(
                    5000,
                    new Vector2(HUDInfo.ScreenSizeX(), (float)(HUDInfo.ScreenSizeY() / 2.3)),
                    new Vector2(HUDInfo.ScreenSizeX() / 8, HUDInfo.ScreenSizeX() / 30));
            }

            this.notification.RemoteMines = tempDamage.Item2;
            this.notification.PopUp(hero);
            return false;
        }
开发者ID:spyware293,项目名称:Ensage,代码行数:66,代码来源:AutoDetonateHeroes.cs

示例2: CastSpellsIfCanOrAttack

        private static void CastSpellsIfCanOrAttack(Ability ability, Unit source,  Hero target, bool cStun, byte targetType, Vector3 targetPos, float range = 0f)
        {

            if (range == 0f)
            {
                if ((cStun ? !target.IsStunned() : true) && CanCast(source, ability) && !target.IsInvul())
                { 
                    switch(targetType) {
                        case 0:
                            ability.UseAbility();
                            break;
                        case 1:
                            ability.UseAbility(target);
                            break;
                        case 2:
                            ability.UseAbility(targetPos);
                            break;
                    }
                    Utils.Sleep(ability.ChannelTime + Game.Ping, ability.Handle.ToString());
                }
                else if (Utils.SleepCheck(ability.Handle.ToString())) AttackIfCan(source, target);
            }
            else
            {
                if ((cStun ? !target.IsStunned() : true) && CanCast(source, ability) && !target.IsInvul() && source.Distance2D(target) <= range) { ability.UseAbility(); Utils.Sleep(ability.ChannelTime + Game.Ping, ability.Handle.ToString()); }
                else if (Utils.SleepCheck(ability.Handle.ToString())) AttackIfCan(source, target);
            }
        }
开发者ID:LimbViolencer,项目名称:EnsageSharp-6,代码行数:28,代码来源:EzUnitControl.cs

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

示例4: HitCount

		static int HitCount(Hero en)
		{
			var cleardmg = me.BonusDamage + me.DamageAverage;
			var hitDmg = en.DamageTaken(cleardmg, DamageType.Physical, me);
			//if (!me.CanAttack() || en.IsAttackImmune() || en.IsInvul() || ((int)Math.Ceiling((en.Health - procastdamage)/hitDmg))<=0)
            if (me.CanAttack() && !en.IsAttackImmune() && !en.IsInvul())
            {
                /*
                if ((ethereal != null && ethereal.CanBeCasted())
                    || (ghost != null && ghost.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(ghost.Name))
                    )
                    return ((int)Math.Ceiling((en.Health - procastdamage)/hitDmg));
                else
                    return ((int)Math.Ceiling((en.Health - procastdamage)/hitDmg)+1);*/
				if ((int)Math.Ceiling((en.Health - procastdamage+hitDmg) / hitDmg) <= 0)
					return 0;
				else
					return ((int)Math.Ceiling((en.Health - procastdamage+hitDmg) / hitDmg));

            }
            else 
                return 999;
		}
开发者ID:Air13,项目名称:ESharp,代码行数:23,代码来源:Tinker_Air13.cs

示例5: OnlyRktCountDmg

		static int OnlyRktCountDmg(Hero en)
		{
            if (!en.IsMagicImmune() && !en.IsInvul())
            {
				return ((int)(en.Health/onerocketdamage()+1)*onerocketdamage());
            }
			else 
                return 999;
		}
开发者ID:Air13,项目名称:ESharp,代码行数:9,代码来源:Tinker_Air13.cs

示例6: RktCount

		static int RktCount(Hero en)
		{
            if (!en.IsMagicImmune() && !en.IsInvul())
			{
				if (((int)((en.Health - procastdamage)/onerocketdamage()))<=0)
					return 0;
				else
					return ((int)((en.Health - procastdamage)/onerocketdamage()));
			}
			else 
                return 999;
		}
开发者ID:Air13,项目名称:ESharp,代码行数:12,代码来源:Tinker_Air13.cs

示例7: ProcastCounter

        static int ProcastCounter(Hero en)
		{
			var maxprocastdmgstatic = (en.DamageTaken(averagedamage()*100/75, DamageType.Magical, me, false, 0, 0, 0));
			var cleardmg = me.BonusDamage + me.DamageAverage;
			var hitDmg = en.DamageTaken(cleardmg, DamageType.Physical, me);
            if (!en.IsMagicImmune() && !en.IsInvul())
            {
				if (IsPhysDamageImune(en))
                    return (int)Math.Ceiling(en.Health / maxprocastdmgstatic);
				else
					return (int)Math.Ceiling(en.Health / maxprocastdmgstatic - hitDmg/en.Health );

            }
            else 
                return 999;
		
		
		
		}
开发者ID:Air13,项目名称:ESharp,代码行数:19,代码来源:Tinker_Air13.cs

示例8: factdamage

		static int factdamage(Hero en)
        {
            if (en != null && en.IsAlive && en.IsValid)
            {
                int alletherealdmg = 0, alldagondmg = 0, dagondist = 0, alllaserdmg = 0, allrocketdmg = 0, allshivadmg = 0, allphysdmg = 0;
                int etherealdamage = (int)(((me.TotalIntelligence * 2) + 75));
				int factdamage1 = 0;

					
				spellamplymult = 1 + (me.TotalIntelligence/16/100);

				

				if (((ethereal != null && ethereal.CanBeCasted()) || (ethereal != null && IsCasted(ethereal))) && /*Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(ethereal.Name)&&*/ !en.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_ethereal"))
					etherealmult = 1.4;
				else
					etherealmult = 1;
				if (veil != null && veil.CanBeCasted() && /*Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(veil.Name) &&*/ !en.Modifiers.Any(y => y.Name == "modifier_item_veil_of_discord_debuff"))
					veilmult = 1.25;
				else
					veilmult = 1;
				if (me.FindItem("item_aether_lens")!=null)
					lensmult = 1.05;
				else
					lensmult = 1;					
					
                allmult = etherealmult * veilmult * lensmult * spellamplymult;

                if (dagon != null && dagon.CanBeCasted() /*&& Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled("item_dagon")*/)
				{
                    alldagondmg = (int)(en.DamageTaken(dagondamage[dagon.Level - 1], DamageType.Magical, me, false, 0, 0, 0)*allmult);
					dagondist = dagondistance[dagon.Level - 1];
                }
				else 
				{
					alldagondmg = 0;
					dagondist = 0;
				}
				if (((ethereal != null && ethereal.CanBeCasted()) || (ethereal != null && IsCasted(ethereal))) /* && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(ethereal.Name)*/)
                    alletherealdmg = (int)(en.DamageTaken(etherealdamage, DamageType.Magical, me, false, 0, 0, 0) *allmult);
				else
					alletherealdmg = 0;
					
				if (((shiva != null && shiva.CanBeCasted()) || (shiva != null && IsCasted(shiva))) /* && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(shiva.Name)*/)
                    allshivadmg = (int)(en.DamageTaken(200, DamageType.Magical, me, false, 0, 0, 0) *allmult);
				else
					allshivadmg = 0;					
					
					
				if (Laser!=null && Laser.Level>0 && Laser.CanBeCasted())
					alllaserdmg = (int)(en.DamageTaken((int)(laser_damage[Laser.Level - 1]), DamageType.Pure, me, false, 0, 0, 0)* lensmult * spellamplymult);
				else
					alllaserdmg = 0;
				
                if ((Rocket != null && Rocket.Level>0 && Rocket.CanBeCasted()) || (Rocket != null && Rocket.Level>0 && IsCasted(Rocket)))
					if (me.Distance2D(en) < 800 + aetherrange + ensage_error)
						allrocketdmg = (int)(en.DamageTaken((int)(rocket_damage[Rocket.Level - 1]), DamageType.Magical, me, false, 0, 0, 0)* allmult);
                    else if (me.Distance2D(en) >= 800 + aetherrange + ensage_error && me.Distance2D(en) < 1500 + aetherrange + ensage_error)
						allrocketdmg = (int)(en.DamageTaken((int)(rocket_damage[Rocket.Level - 1]), DamageType.Magical, me, false, 0, 0, 0)* veilmult * lensmult * spellamplymult);
                    else if (me.Distance2D(en) >= 1500 + aetherrange + ensage_error && me.Distance2D(en) < 2500)
						allrocketdmg = (int)(en.DamageTaken((int)(rocket_damage[Rocket.Level - 1]), DamageType.Magical, me, false, 0, 0, 0)* lensmult * spellamplymult);
				else
					allrocketdmg = 0;
					
				if (me.CanAttack() 
					&& !en.IsAttackImmune() 
					&& me.Distance2D(en)<me.GetAttackRange()+50 
					&& !en.IsInvul()
					&& !IsPhysDamageImune(en)

					//&& (ethereal == null || !ethereal.CanBeCasted())
					//&& (ghost == null || !ghost.CanBeCasted() || !Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(ghost.Name))
					)
					allphysdmg = (int)(en.DamageTaken(me.BonusDamage + me.DamageAverage, DamageType.Physical, me));
				else
					allphysdmg = 0;
					
				factdamage1 = ((me.Distance2D(en)<650+aetherrange + ensage_error)? alllaserdmg : 0 )+ ((me.Distance2D(en)<2500)? allrocketdmg : 0) + ((me.Distance2D(en)<800+aetherrange + ensage_error)? alletherealdmg: 0) + ((me.Distance2D(en)<dagondist+aetherrange + ensage_error)? alldagondmg: 0) + ((me.Distance2D(en)<900 + ensage_error)? allshivadmg : 0) + allphysdmg;  //factical damage in current range
                return factdamage1;
              
            }
            else
                return 0;
        }
开发者ID:Air13,项目名称:ESharp,代码行数:84,代码来源:Tinker_Air13.cs

示例9: IsPhysDamageImune

		static bool IsPhysDamageImune(Hero v)
        {
            if (me.Modifiers
                .Any(x =>
                x.Name == "modifier_tinker_laser_blind"
                || x.Name == "modifier_troll_warlord_whirling_axes_blind" 
				|| x.Name == "modifier_brewmaster_drunken_haze"
                || x.Name == "modifier_pugna_decrepify"
				|| x.Name == "modifier_item_ethereal_blade_ethereal")
                || v.Modifiers.Any(x => x.Name == "modifier_omniknight_guardian_angel"
									|| x.Name == "modifier_nyx_assassin_spiked_carapace"
									|| x.Name == "modifier_pugna_decrepify"
									|| x.Name == "modifier_windrunner_windrun"
									|| x.Name == "modifier_winter_wyverny_cold_embrace"
									|| x.Name == "modifier_ghost_state" 
									|| x.Name == "modifier_item_ethereal_blade_ethereal"
									)
                || (v.ClassID == ClassID.CDOTA_Unit_Hero_Tiny && v.Spellbook.SpellE.Level > 0)
				|| v.IsInvul()
				)
                return true;
            
            else
                return false;
        }
开发者ID:Air13,项目名称:ESharp,代码行数:25,代码来源:Tinker_Air13.cs

示例10: Killsteal

 public static bool Killsteal(Ability ability, Hero target, string name)
 {
     return AbilityDamage.CalculateDamage(ability, AbilityMain.Me, target) >= target.Health
            && target.CanDie(name)
            && (!target.IsInvul() || Utils.ChainStun(target, ability.GetHitDelay(target), null, true, name));
 }
开发者ID:Ray0fHope,项目名称:EnsageSharp,代码行数:6,代码来源:CastingChecks.cs

示例11: 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 items = me.Inventory.Items.ToList();
            var invoke = Abilities.FindAbility("invoker_invoke");

            var eul = items.FirstOrDefault(x=>x.StoredName()=="item_cyclone");
            var dagger = items.FirstOrDefault(x=>x.StoredName()=="item_blink");
            var refresher = items.FirstOrDefault(x=>x.StoredName()=="item_refresher");
            var hex = items.FirstOrDefault(x=>x.StoredName()=="item_sheepstick");
            var urn = items.FirstOrDefault(x=>x.StoredName()=="item_urn_of_shadows");
            var orchid = items.FirstOrDefault(x=>x.StoredName()=="item_orchid");
            var bloodthorn = items.FirstOrDefault(x=>x.StoredName()=="item_bloodthorn");

            var meteor = Abilities.FindAbility("invoker_chaos_meteor");
            var ss = Abilities.FindAbility("invoker_sun_strike");
            var icewall = Abilities.FindAbility("invoker_ice_wall");
            var deafblast = Abilities.FindAbility("invoker_deafening_blast");
            //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;
                if (ComboSwitcher)
                    _startComboPosition = _combo;
                //PrintInfo("Starting new combo! " + $"[{_combo + 1}] target: {target.StoredName()}");
            }
            if (!Utils.SleepCheck("StageCheck")) return;
            #endregion

            /*var modif = target.Modifiers.Where(x=>x.IsDebuff);
            PrintInfo("===========================");
            foreach (var s in modif)
            {
                PrintInfo(s.StoredName());
            }*/
            var myBoys = ObjectManager.GetEntities<Unit>().Where(x => x.Team == me.Team && x.IsControllable && x.IsAlive && Utils.SleepCheck(x.Handle.ToString()));
            if (!target.IsInvul())
                foreach (var myBoy in myBoys)
                {
                    if (myBoy is Hero)
                    {
                        //Orbwalking.Orbwalk(target, 0, 0, false, true);
                    }
                    else
                    {
                        Orbwalker orb;
                        if (!OrbDictinary.TryGetValue(myBoy, out orb))
                        {
                            OrbDictinary.Add(myBoy, new Orbwalker(myBoy));
                        }
                        orb = null;
                        if (orb != null)
                        {
                            orb.Attack(target, true);
                        }
                        else
                        {
                            myBoy.Attack(target);
                            Utils.Sleep(300, myBoy.Handle.ToString());
                        }

                    }

                }
            if (me.CanUseItems())
            {
                if (urn != null && urn.CanBeCasted(target))
                {
                    var urnMod = target.HasModifier("modifier_item_urn_damage") &&
                                 Utils.SleepCheck(urn.StoredName());
                    if (!urnMod)
                    {
                        urn.UseAbility(target);
                        Utils.Sleep(300, urn.StoredName());
                    }
                }
                if (_stage > 0 && !target.IsHexed())
                {
                    if (hex != null && hex.CanBeCasted(target) &&
                        Menu.Item("items").GetValue<AbilityToggler>().IsEnabled(hex.StoredName()) &&
//.........这里部分代码省略.........
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:101,代码来源:Program.cs

示例12: TryToAttack

 private static void TryToAttack(Hero target,Hero me)
 {
     if (!target.IsInvul())
         if (IsOrbwalking && target.Distance2D(me)>=OrbMinDist)
             Orbwalking.Orbwalk(target, 10, followTarget: ChaseEnemyOrbwalking);
         else
         {
             if (Utils.SleepCheck("attack_cd_autoattacking"))
             {
                 me.Attack(target);
                 Utils.Sleep(250, "attack_cd_autoattacking");
             }
         }
 }
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:14,代码来源:Program.cs

示例13: CastIceWall

 private static void CastIceWall(Hero me, Hero target, bool b, Ability icewall)
 {
     if (!b)
     {
         if (!me.CanMove() || !Utils.SleepCheck("icewallmove")) return;
         if (icewall.AbilityState == AbilityState.Ready)
         {
             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 if (!target.IsInvul())
         {
             TryToAttack(target,me);
         }
     }
     else
     {
         icewall.UseAbility();
         _stage++;
         Utils.Sleep(250, "StageCheck");
     }
 }
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:31,代码来源:Program.cs


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