本文整理匯總了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;
}