本文整理汇总了C#中WCell.RealmServer.Spells.SpellEffect.SpellEffectHandlerCreator方法的典型用法代码示例。如果您正苦于以下问题:C# SpellEffect.SpellEffectHandlerCreator方法的具体用法?C# SpellEffect.SpellEffectHandlerCreator怎么用?C# SpellEffect.SpellEffectHandlerCreator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCell.RealmServer.Spells.SpellEffect
的用法示例。
在下文中一共展示了SpellEffect.SpellEffectHandlerCreator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateHandler
private void CreateHandler(SpellEffect effect, int h, SpellEffectHandler[] handlers, ref SpellTargetCollection targets, ref SpellFailedReason failReason)
{
var handler = effect.SpellEffectHandlerCreator(this, effect);
handlers[h] = handler;
// make sure, we have the right Caster-Type
handler.CheckCasterType(ref failReason);
if (failReason != SpellFailedReason.Ok)
{
return;
}
// find targets and amount SpellTargetCollection if effects have same ImplicitTargetTypes
if (InitialTargets != null)
{
// do we have given targets?
if (targets == null)
{
targets = CreateSpellTargetCollection();
}
}
else if (handler.HasOwnTargets)
{
// see if targets are shared between effects
targets = null;
for (var j = 0; j < h; j++)
{
var handler2 = handlers[j];
if (handler.Effect.SharesTargetsWith(handler2.Effect, IsAICast))
{
// same targets -> share target collection
targets = handler2.m_targets;
break;
}
}
if (targets == null)
{
targets = CreateSpellTargetCollection();
}
}
if (targets != null)
{
handler.m_targets = targets;
targets.m_handlers.Add(handler);
}
}
示例2: CreateHandler
private void CreateHandler(SpellEffect effect, int h, SpellEffectHandler[] handlers, ref SpellTargetCollection targets, ref SpellFailedReason failReason)
{
var handler = effect.SpellEffectHandlerCreator(this, effect);
handlers[h] = handler;
// make sure, we have the right Caster-Type
handler.CheckCasterType(ref failReason);
if (failReason != SpellFailedReason.Ok)
{
return;
}
// find targets and amount SpellTargetCollection if effects have same ImplicitTargetTypes
if (m_initialTargets != null)
{
// do we have given targets?
//targets = SpellTargetCollection.SpellTargetCollectionPool.Obtain();
if (targets == null)
{
targets = new SpellTargetCollection();
}
}
else if (handler.HasOwnTargets)
{
targets = null;
// check if we have same target-types, else collect targets specifically for this Effect
for (var j = 0; j < h; j++)
{
var handler2 = handlers[j];
if (handler.Effect.TargetsEqual(handler2.Effect))
{
targets = handler2.m_targets;
break;
}
}
if (targets == null)
{
//targets = SpellTargetCollection.SpellTargetCollectionPool.Obtain();
targets = new SpellTargetCollection();
}
}
if (targets != null)
{
handler.m_targets = targets;
targets.m_handlers.Add(handler);
}
}