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


C# Hero.IsAttackImmune方法代码示例

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


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

示例1: AD


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


							
							//break rats shadow blades and invis (1 hex, 2 seal, 3 cyclone)
							|| e.IsMelee && me.Distance2D(e) <= 350 //test
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Legion_Commander && e.FindSpell("legion_commander_duel").Cooldown < 2 && me.Distance2D(e) < 480 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Tiny && me.Distance2D(e) <= 350
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Pudge && me.Distance2D(e) <= 350
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Nyx_Assassin && me.Distance2D(e) <= 350
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_BountyHunter && me.Distance2D(e) <= 350
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Nevermore && me.Distance2D(e) <= 350 
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Weaver && me.Distance2D(e) <= 350 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Riki && me.Distance2D(e) <= 350 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Clinkz && me.Distance2D(e) <= 350 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Broodmother && me.Distance2D(e) <= 350 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Slark && me.Distance2D(e) <= 350 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Ursa && me.Distance2D(e) <= 350 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Earthshaker && (e.Spellbook.SpellQ.Cooldown<=1 || e.Spellbook.SpellR.Cooldown<=1) 
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Alchemist && me.Distance2D(e) <= 350 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_TrollWarlord && me.Distance2D(e) <= 350 && !me.IsAttackImmune()

							//break rats blinkers (1 hex, 2 seal, 3 cyclone)
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Ursa && me.Distance2D(e) <= 350 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_PhantomAssassin && me.Distance2D(e) <= 350 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Riki && me.Distance2D(e) <= 350 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Spectre && me.Distance2D(e) <= 350 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_AntiMage && me.Distance2D(e) <= 350 && !me.IsAttackImmune()

							|| e.ClassID == ClassID.CDOTA_Unit_Hero_TemplarAssassin && me.Distance2D(e) <= e.GetAttackRange()+50 && !me.IsAttackImmune()
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Morphling && me.Distance2D(e) <= e.GetAttackRange()+50 && !me.IsAttackImmune()

							|| e.ClassID == ClassID.CDOTA_Unit_Hero_QueenOfPain && me.Distance2D(e) <= 800+aetherrange  + ensage_error
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Puck && me.Distance2D(e) <= 800+aetherrange  + ensage_error
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_StormSpirit && me.Distance2D(e) <= 800+aetherrange + ensage_error
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Phoenix && me.Distance2D(e) <= 800+aetherrange + ensage_error
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_Magnataur && me.Distance2D(e) <= 800+aetherrange + ensage_error
							|| e.ClassID == ClassID.CDOTA_Unit_Hero_FacelessVoid && me.Distance2D(e) <= 800+aetherrange + ensage_error
开发者ID:Air13,项目名称:ESharp,代码行数:66,代码来源:Tinker_Air13.cs

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

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

示例4: Game_OnUpdate


//.........这里部分代码省略.........
                                    {
                                        ghost.UseAbility();
                                        Utils.Sleep(250, "Ghost");
                                    }

                                    if (// Shiva Item
                                        shiva != null
                                        && shiva.CanBeCasted()
                                        && me.CanCast()
                                        && !target.IsMagicImmune()
                                        && Utils.SleepCheck("shiva")
                                        && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(shiva.Name)
                                        && me.Distance2D(target) <= 600
                                        )

                                    {
                                        shiva.UseAbility();
                                        Utils.Sleep(250, "shiva");
                                    } // Shiva Item end
                                    if ( // sheep
                                        sheep != null
                                        && sheep.CanBeCasted()
                                        && me.CanCast()
                                        && !target.IsLinkensProtected()
                                        && !target.IsMagicImmune()
                                        && me.Distance2D(target) <= 1400
                                        && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(sheep.Name)
                                        && Utils.SleepCheck("sheep")
                                        )
                                    {
                                        sheep.UseAbility(target);
                                        Utils.Sleep(250, "sheep");
                                    } // sheep Item end

                                    if (// Dagon
                                        me.CanCast()
                                        && dagon != null
                                        && (ethereal == null
                                        || (target.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_slow")
                                        || ethereal.Cooldown < 17))
                                        && !target.IsLinkensProtected()
                                        && dagon.CanBeCasted()
                                        && !target.IsMagicImmune()
                                        && Utils.SleepCheck("dagon")
                                       )
                                    {
                                        dagon.UseAbility(target);
                                        Utils.Sleep(200, "dagon");
                                    } // Dagon Item end

                                    if (
                                         // cheese
                                         cheese != null
                                         && cheese.CanBeCasted()
                                         && me.Health <= (me.MaximumHealth * 0.3)
                                         && me.Distance2D(target) <= 700
                                         && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(cheese.Name)
                                         && Utils.SleepCheck("cheese")
                                     )
                                    {
                                        cheese.UseAbility();
                                        Utils.Sleep(200, "cheese");
                                    } // cheese Item end
                                }
                            }
                        }
                        if (Menu.Item("orbwalk").GetValue<bool>())
                        {
                            if (me.Distance2D(target) <= me.AttackRange + 5 &&
                            (!me.IsAttackImmune()
                            || !target.IsAttackImmune()
                            )
                            && me.NetworkActivity != NetworkActivity.Attack
                            && me.CanAttack()
                            && !me.IsAttacking()
                            && Utils.SleepCheck("attack")
                            )
                            {
                                me.Attack(target);
                                Utils.Sleep(180, "attack");
                            }
                            else if (
                                (!me.CanAttack()
                                || me.Distance2D(target) >= 450)
                                && me.NetworkActivity != NetworkActivity.Attack
                                && me.Distance2D(target) <= 2500
                                && !me.IsAttacking()
                                && Utils.SleepCheck("Move")
                                )
                            {
                                me.Move(Prediction.InFront(target, 100));
                                Utils.Sleep(400, "Move");
                            }
                        }
                    }
                }
                Utils.Sleep(100, "activated");
            }
            A();
        }
开发者ID:VickTheRock,项目名称:ReworkAllScripts,代码行数:101,代码来源:Program.cs


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