本文整理匯總了C#中WCell.RealmServer.Spells.SpellEffect.HasTarget方法的典型用法代碼示例。如果您正苦於以下問題:C# SpellEffect.HasTarget方法的具體用法?C# SpellEffect.HasTarget怎麽用?C# SpellEffect.HasTarget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WCell.RealmServer.Spells.SpellEffect
的用法示例。
在下文中一共展示了SpellEffect.HasTarget方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DecideDefaultTargetHandlerDefintion
/// <summary>
/// Called on every SpellEffect, after initialization
/// </summary>
internal static void DecideDefaultTargetHandlerDefintion(SpellEffect effect)
{
// ignore effects that already have custom settings
if (effect.AITargetHandlerDefintion != null || effect.AITargetEvaluator != null) return;
//var dflt = DefaultTargetDefinitions.GetTargetDefinition(effect.ImplicitTargetA);
if (effect.HarmType == HarmType.Beneficial && !effect.HasTarget(ImplicitSpellTargetType.Self))
{
// single target beneficial spells need special attention, since else AI would never correctly select a target
if (!effect.IsAreaEffect)
{
effect.Spell.MaxTargets = 1;
effect.SetAITargetDefinition(DefaultTargetAdders.AddAreaSource, // Adder
DefaultTargetFilters.IsFriendly); // Filters
}
else
{
effect.SetAITargetDefinition(DefaultTargetAdders.AddAreaSource, // Adder
DefaultTargetFilters.IsFriendly); // Filters
}
// choose evaluator
if (effect.IsHealEffect)
{
// select most wounded
effect.AITargetEvaluator = DefaultTargetEvaluators.MostWoundedEvaluator;
}
else
{
// buff random person
effect.AITargetEvaluator = DefaultTargetEvaluators.RandomEvaluator;
}
}
}