本文整理匯總了C#中WCell.RealmServer.Entities.Unit.GetMechanicDurationMod方法的典型用法代碼示例。如果您正苦於以下問題:C# Unit.GetMechanicDurationMod方法的具體用法?C# Unit.GetMechanicDurationMod怎麽用?C# Unit.GetMechanicDurationMod使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WCell.RealmServer.Entities.Unit
的用法示例。
在下文中一共展示了Unit.GetMechanicDurationMod方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetDuration
/// <summary>
/// Returns the max duration for this Spell in milliseconds,
/// including all modifiers.
/// </summary>
public int GetDuration(CasterInfo caster, Unit target)
{
var millis = Durations.Min;
//if (Durations.LevelDelta > 0)
//{
// millis += (int)caster.Level * Durations.LevelDelta;
// if (Durations.Max > 0 && millis > Durations.Max)
// {
// millis = Durations.Max;
// }
//}
if (Durations.Max > Durations.Min && IsFinishingMove && caster.CasterUnit != null)
{
// For some finishing moves, Duration depends on Combopoints
millis += caster.CasterUnit.ComboPoints * ((Durations.Max - Durations.Min) / 5);
}
if (target != null && Mechanic != SpellMechanic.None)
{
var mod = target.GetMechanicDurationMod(Mechanic);
if (mod != 0)
{
millis = UnitUpdates.GetMultiMod(mod / 100f, millis);
}
}
var chr = caster.Caster as Character;
if (chr != null)
{
millis = chr.PlayerSpells.GetModifiedInt(SpellModifierType.Duration, this, millis);
}
return millis;
}