本文整理汇总了C#中DamageType.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# DamageType.Equals方法的具体用法?C# DamageType.Equals怎么用?C# DamageType.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DamageType
的用法示例。
在下文中一共展示了DamageType.Equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsInvulnerable
public static bool IsInvulnerable(Obj_AI_Base target, DamageType damageType, bool ignoreShields = true)
{
// Tryndamere's Undying Rage (R)
if (target.HasBuff("Undying Rage") && target.Health <= target.MaxHealth * 0.10f)
{
return true;
}
// Kayle's Intervention (R)
if (target.HasBuff("JudicatorIntervention"))
{
return true;
}
if (ignoreShields)
{
return false;
}
// Morgana's Black Shield (E)
if (damageType.Equals(DamageType.Magical) && target.HasBuff("BlackShield"))
{
return true;
}
// Banshee's Veil (PASSIVE)
if (damageType.Equals(DamageType.Magical) && target.HasBuff("BansheesVeil"))
{
// TODO: Get exact Banshee's Veil buff name.
return true;
}
// Sivir's Spell Shield (E)
if (damageType.Equals(DamageType.Magical) && target.HasBuff("SivirShield"))
{
// TODO: Get exact Sivir's Spell Shield buff name
return true;
}
// Nocturne's Shroud of Darkness (W)
if (damageType.Equals(DamageType.Magical) && target.HasBuff("ShroudofDarkness"))
{
// TODO: Get exact Nocturne's Shourd of Darkness buff name
return true;
}
return false;
}
示例2: IsInvulnerable
public static bool IsInvulnerable(Obj_AI_Base target, DamageType damageType, bool ignoreShields = true)
{
//Kindred's Lamb's Respite(R)
if (target.HasBuff("kindrednodeathbuff"))
{
return true;
}
// Tryndamere's Undying Rage (R)
if (target.HasBuff("Undying Rage") && target.Health <= target.MaxHealth * 0.10f)
{
return true;
}
// Kayle's Intervention (R)
if (target.HasBuff("JudicatorIntervention"))
{
return true;
}
// Poppy's Diplomatic Immunity (R)
if (target.HasBuff("DiplomaticImmunity") && !ObjectManager.Player.HasBuff("poppyulttargetmark"))
{
//TODO: Get the actual target mark buff name
return true;
}
if (ignoreShields)
{
return false;
}
// Morgana's Black Shield (E)
if (damageType.Equals(DamageType.Magical) && target.HasBuff("BlackShield"))
{
return true;
}
// Banshee's Veil (PASSIVE)
if (damageType.Equals(DamageType.Magical) && target.HasBuff("BansheesVeil"))
{
// TODO: Get exact Banshee's Veil buff name.
return true;
}
// Sivir's Spell Shield (E)
if (damageType.Equals(DamageType.Magical) && target.HasBuff("SivirShield"))
{
// TODO: Get exact Sivir's Spell Shield buff name
return true;
}
// Nocturne's Shroud of Darkness (W)
if (damageType.Equals(DamageType.Magical) && target.HasBuff("ShroudofDarkness"))
{
// TODO: Get exact Nocturne's Shourd of Darkness buff name
return true;
}
return false;
}
示例3: IsInvulnerable
public static bool IsInvulnerable(Obj_AI_Base target, DamageType damageType, bool ignoreShields = true)
{
// Tryndamere's Undying Rage (R)
if (target.HasBuff("Undying Rage") && target.Health <= target.MaxHealth * 0.10f)
{
return true;
}
// Kayle's Intervention (R)
if (target.HasBuff("JudicatorIntervention"))
{
return true;
}
if (ignoreShields)
{
return false;
}
// Morgana's Black Shield (E)
if (damageType.Equals(DamageType.Magical) && target.HasBuff("BlackShield"))
{
return true;
}
if (damageType.Equals(DamageType.Magical) && target.HasSpellShield())
{
return true;
}
return false;
}
示例4: IsInvulnerable
public static bool IsInvulnerable(Obj_AI_Base target, DamageType damageType, bool ignoreShields = true)
{
var targetBuffs = new HashSet<string>(target.Buffs.Select(buff => buff.Name), StringComparer.OrdinalIgnoreCase);
// Kindred's Lamb's Respite(R)
if (targetBuffs.Contains("KindredRNoDeathBuff") && target.HealthPercent <= 10)
{
return true;
}
// Vladimir W
if (targetBuffs.Contains("VladimirSanguinePool"))
{
return true;
}
// Tryndamere's Undying Rage (R)
if (targetBuffs.Contains("UndyingRage") && target.Health <= target.MaxHealth * 0.10f)
{
return true;
}
// Kayle's Intervention (R)
if (targetBuffs.Contains("JudicatorIntervention"))
{
return true;
}
if (ignoreShields)
{
return false;
}
// Morgana's Black Shield (E)
if (targetBuffs.Contains("BlackShield") && damageType.Equals(DamageType.Magical))
{
return true;
}
// Banshee's Veil (PASSIVE)
if (targetBuffs.Contains("bansheesveil") && damageType.Equals(DamageType.Magical))
{
return true;
}
// Sivir's Spell Shield (E)
if (targetBuffs.Contains("SivirE") && damageType.Equals(DamageType.Magical))
{
return true;
}
// Nocturne's Shroud of Darkness (W)
if (targetBuffs.Contains("NocturneShroudofDarkness") && damageType.Equals(DamageType.Magical))
{
return true;
}
return false;
}
示例5: IsInvulnerable
/// <summary>
/// Checks whether the target is invulnerable.
/// </summary>
/// <param name="target">
/// The target
/// </param>
/// <param name="damageType">
/// The damage type
/// </param>
/// <param name="ignoreShields">
/// The ignore shields
/// </param>
/// <returns>
/// The <see cref="bool" />
/// </returns>
public static bool IsInvulnerable(this Obj_AI_Base target, DamageType damageType, bool ignoreShields = true)
{
// Tryndamere's Undying Rage (R)
if (!damageType.Equals(DamageType.True) && target.HasBuff("Undying Rage") && target.Health <= 2f)
{
return true;
}
// Kayle's Intervention (R)
if (target.HasBuff("JudicatorIntervention"))
{
return true;
}
return false;
}