本文整理汇总了C#中WCell.RealmServer.Entities.Unit.GetResiliencePct方法的典型用法代码示例。如果您正苦于以下问题:C# Unit.GetResiliencePct方法的具体用法?C# Unit.GetResiliencePct怎么用?C# Unit.GetResiliencePct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCell.RealmServer.Entities.Unit
的用法示例。
在下文中一共展示了Unit.GetResiliencePct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalcCritDamage
/// <summary>
/// Modified by victim's resilience
/// </summary>
/// <param name="dmg"></param>
/// <param name="victim"></param>
/// <param name="effect"></param>
/// <returns></returns>
public virtual float CalcCritDamage(float dmg, Unit victim, SpellEffect effect)
{
if (effect != null)
{
return (int)(dmg * 1.5f);
}
var multiplier = 200;
multiplier -= (int)victim.GetResiliencePct();
multiplier += victim.GetIntMod(StatModifierInt.CritDamageBonusPct);
return (dmg * multiplier + 50) / 100;
}
示例2: CalcSpellCritChance
public float CalcSpellCritChance(Unit defender, DamageSchool dmgSchool, float resistPct, Spell spell)
{
var chance = GetSpellCritChance(dmgSchool);
if (this is Character)
{
var chr = (Character)this;
chance += chr.PlayerSpells.GetModifierFlat(SpellModifierType.CritChance, spell);
}
chance -= defender.GetResiliencePct();
return chance;
}
示例3: CalcCritChance
public float CalcCritChance(Unit defender, DamageSchool dmgSchool, Spell spell, IWeapon weapon)
{
float chance;
if (this is Character)
{
var chr = (Character)this;
if (weapon != null)
{
if (weapon.IsRanged)
{
chance = chr.CritChanceRangedPct;
}
else
{
chance = chr.CritChanceMeleePct;
}
}
else
{
chance = GetCritChance(dmgSchool);
}
}
else
{
chance = GetCritChance(dmgSchool);
}
//chance -= defender.GetResiliencePct(this);
chance -= defender.GetResiliencePct();
return chance;
}
示例4: CalcCritDamage
public virtual float CalcCritDamage(float dmg, Unit victim, SpellEffect effect)
{
dmg = (dmg * (1.5f - (victim.GetResiliencePct() * 2)));
return dmg;
}