本文整理汇总了C#中WCell.RealmServer.Entities.Unit.AddHealingModsToAction方法的典型用法代码示例。如果您正苦于以下问题:C# Unit.AddHealingModsToAction方法的具体用法?C# Unit.AddHealingModsToAction怎么用?C# Unit.AddHealingModsToAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCell.RealmServer.Entities.Unit
的用法示例。
在下文中一共展示了Unit.AddHealingModsToAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Heal
/// <summary>
/// Heals this unit and sends the corresponding animation (healer might be null)
/// </summary>
/// <param name="effect">The effect of the spell that triggered the healing (or null)</param>
/// <param name="healer">The object that heals this Unit (or null)</param>
/// <param name="value">The amount to be healed</param>
public void Heal(Unit healer, int value, SpellEffect effect)
{
var critChance = 0f;
var crit = false;
int overheal = 0;
if (effect != null)
{
var oldVal = value;
if (healer != null)
{
if (effect.IsPeriodic)
{
// add periodic boni
if (healer is Character)
{
value = ((Character)healer).PlayerSpells.GetModifiedInt(SpellModifierType.PeriodicEffectValue, effect.Spell, value);
}
}
else
{
// add healing mods (spell power for healing)
value = healer.AddHealingModsToAction(value, effect, effect.Spell.Schools[0]);
}
}
if (this is Character)
{
value += (int) ((oldVal*((Character) this).HealingTakenModPct)/100);
}
critChance = GetSpellCritChance((DamageSchool) effect.Spell.SchoolMask)*100;
// do a critcheck
if (!effect.Spell.AttributesExB.HasFlag(SpellAttributesExB.CannotCrit) && critChance != 0)
{
var roll = Utility.Random(1f, 10001);
if (roll <= critChance)
{
value = (int) (value*(SpellHandler.SpellCritBaseFactor + GetIntMod(StatModifierInt.CriticalHealValuePct)));
crit = true;
}
}
}
if (value > 0)
{
value = (int)(value * Utility.Random(0.95f, 1.05f));
if (Health + value > MaxHealth)
{
overheal = (Health + value) - MaxHealth;
value = (MaxHealth - Health);
}
Health += value;
value += overheal;
CombatLogHandler.SendHealLog(healer, this, effect != null ? effect.Spell.Id : 0, value, crit, overheal);
}
if (healer != null)
{
var action = new HealAction
{
Attacker = (Unit)healer,
Victim = this,
Spell = effect != null ? effect.Spell : null,
IsCritical = crit,
Value = value
};
healer.Proc(ProcTriggerFlags.HealOther, this, action, true);
Proc(ProcTriggerFlags.Heal, healer, action, false);
OnHeal(healer, effect, value);
}
}