本文整理汇总了C#中Hero.CanDie方法的典型用法代码示例。如果您正苦于以下问题:C# Hero.CanDie方法的具体用法?C# Hero.CanDie怎么用?C# Hero.CanDie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hero
的用法示例。
在下文中一共展示了Hero.CanDie方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: 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));
}