本文整理汇总了C#中SpellFailedReason类的典型用法代码示例。如果您正苦于以下问题:C# SpellFailedReason类的具体用法?C# SpellFailedReason怎么用?C# SpellFailedReason使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpellFailedReason类属于命名空间,在下文中一共展示了SpellFailedReason类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
if (target.MaxPower == 0 || target.PowerType != (PowerType)m_spellEffect.MiscValue)
{
failReason = SpellFailedReason.BadTargets;
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:7,代码来源:PeriodicManaLeech.cs
示例2: Initialize
public override void Initialize(ref SpellFailedReason failReason)
{
if (m_targets != null && m_targets.Count > 0)
{
firstTarget = (Unit)m_targets[0];
}
}
开发者ID:remixod,项目名称:netServer,代码行数:7,代码来源:SummonObject.cs
示例3: IsFriendly
public static void IsFriendly(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
{
if (effectHandler.Cast.CasterObject.MayAttack(target))
{
failedReason = SpellFailedReason.TargetEnemy;
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:7,代码来源:DefaultTargetFilters.cs
示例4: CheckInitialize
protected internal override void CheckInitialize(CasterInfo casterInfo, Unit target, ref SpellFailedReason failReason)
{
if (target.MaxPower == 0 || target.PowerType != (PowerType)m_spellEffect.MiscValue)
{
failReason = SpellFailedReason.BadTargets;
}
}
开发者ID:pallmall,项目名称:WCell,代码行数:7,代码来源:PeriodicManaLeech.cs
示例5: CheckInitialize
protected internal override void CheckInitialize(CasterInfo casterInfo, Unit target, ref SpellFailedReason failReason)
{
if (!(target is Character))
{
failReason = SpellFailedReason.TargetNotPlayer;
}
}
开发者ID:ray2006,项目名称:WCell,代码行数:7,代码来源:TrackResources.cs
示例6: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterRef, Unit target, ref SpellFailedReason failReason)
{
if (!(target is NPC))
{
failReason = SpellFailedReason.BadTargets;
}
if (casterRef != null && casterRef.Object is Unit)
{
var caster = (Unit)casterRef.Object;
//if (target.Target == caster)
//{
// failReason = SpellFailedReason.NoValidTargets;
//}
//else
{
var spell = m_aura.Spell;
var hasSingleFriendTarget = spell.HasBeneficialEffects && !spell.IsAreaSpell && spell.HasTargets;
if (hasSingleFriendTarget && caster.Target != null && caster.IsFriendlyWith(caster.Target))
{
// taunting a friend, means we want to taunt his attackers
// needed for Righteous defense, amongst others
if (target.Target != caster.Target)
{
failReason = SpellFailedReason.NoValidTargets;
}
}
}
}
}
开发者ID:ebakkedahl,项目名称:WCell,代码行数:30,代码来源:ModTaunt.cs
示例7: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
if (!(target is Character))
{
failReason = SpellFailedReason.TargetNotPlayer;
}
}
开发者ID:ebakkedahl,项目名称:WCell,代码行数:7,代码来源:TrackCreatures.cs
示例8: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
Caster = casterReference.Object as Unit;
if (Caster == null || Caster is Vehicle)
{
log.Warn("Invalid SpellCaster \"{0}\" for Spell: {1}", Caster, SpellEffect.Spell);
failReason = SpellFailedReason.Error;
return;
}
Vehicle = target as Vehicle;
if (Vehicle == null)
{
failReason = SpellFailedReason.BadTargets;
}
else
{
Seat = Vehicle.GetSeatFor(Caster);
if (Seat == null)
{
// must never happen since Vehicle is unclickable when full
failReason = SpellFailedReason.BadTargets;
}
}
}
开发者ID:remixod,项目名称:netServer,代码行数:25,代码来源:VehicleAuraHandler.cs
示例9: IsHostileOrHealable
/// <summary>
/// Duel target type
/// </summary>
/// <param name="targets"></param>
/// <param name="target"></param>
/// <param name="failedReason"></param>
public static void IsHostileOrHealable(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
{
var caster = effectHandler.Cast.CasterObject;
var spell = effectHandler.Cast.Spell;
var isHarmful = spell.HasHarmfulEffects;
var isHarmfulAndBeneficial = spell.HasHarmfulEffects == spell.HasBeneficialEffects;
if (!isHarmfulAndBeneficial)
{
if (isHarmful != caster.MayAttack(target))
{
if (isHarmful)
{
failedReason = SpellFailedReason.TargetFriendly;
}
else
{
failedReason = SpellFailedReason.TargetEnemy;
}
}
else if (isHarmful && !target.CanBeHarmed)
{
failedReason = SpellFailedReason.NotHere;
}
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:32,代码来源:DefaultTargetFilters.cs
示例10: Initialize
public override void Initialize(ref SpellFailedReason failReason)
{
if (m_cast.TargetItem == null)
{
failReason = SpellFailedReason.ItemGone;
return;
}
if (m_cast.TargetItem.Template.Level < Effect.Spell.BaseLevel)
{
failReason = SpellFailedReason.TargetLowlevel;
return;
}
enchantEntry = EnchantMgr.GetEnchantmentEntry((uint)Effect.MiscValue);
if (enchantEntry == null)
{
log.Error("Spell {0} refers to invalid EnchantmentEntry {1}", Effect.Spell, Effect.MiscValue);
failReason = SpellFailedReason.Error;
}
else if (!enchantEntry.CheckRequirements(m_cast.CasterUnit))
{
failReason = SpellFailedReason.MinSkill;
}
}
开发者ID:Jeroz,项目名称:WCell,代码行数:25,代码来源:EnchantItem.cs
示例11: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterRef, Unit target, ref SpellFailedReason failReason)
{
var caster = creatingCast.CasterReference.Object as Unit;
if (caster == null)
{
failReason = SpellFailedReason.BadTargets;
}
else
{
if (caster.Charm != null)
{
failReason = SpellFailedReason.AlreadyHaveCharm;
}
else if (target.HasMaster)
{
failReason = SpellFailedReason.CantDoThatRightNow;
}
else if (caster.HasMaster)
{
failReason = SpellFailedReason.Possessed;
}
else if (caster is Character)
{
if (((Character)caster).ActivePet != null)
{
failReason = SpellFailedReason.AlreadyHaveSummon;
}
}
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:30,代码来源:ModPossessAuraHandler.cs
示例12: Initialize
public override void Initialize(ref SpellFailedReason failReason)
{
if (m_cast.InitialTargets == null || m_cast.InitialTargets.Length == 0 || !(m_cast.InitialTargets[0] is Unit))
{
failReason = SpellFailedReason.NoValidTargets;
}
}
开发者ID:NVN,项目名称:WCell,代码行数:7,代码来源:TriggerRitualOfSummoningEffectHandler.cs
示例13: Initialize
public override void Initialize(ref SpellFailedReason failReason)
{
if (m_cast.CasterChar.ActivePet == null)
{
failReason = SpellFailedReason.NoPet;
}
}
开发者ID:ray2006,项目名称:WCell,代码行数:7,代码来源:SummonDeadPet.cs
示例14: Collect
internal void Collect(SpellTargetCollection targets, ref SpellFailedReason failReason)
{
if (Adder != null)
{
Adder(targets, Filter, ref failReason);
}
}
开发者ID:Jeroz,项目名称:WCell,代码行数:7,代码来源:TargetDefinition.cs
示例15: Initialize
public override void Initialize(ref SpellFailedReason failReason)
{
if (m_cast.UsedItem.Amount < Effect.MinValue)
{
failReason = SpellFailedReason.NeedMoreItems;
}
}
开发者ID:ray2006,项目名称:WCell,代码行数:7,代码来源:ItemConvertEffectHandler.cs
示例16: Initialize
public override void Initialize(ref SpellFailedReason failReason)
{
if(Effect.BasePoints < 0)
{
Effect.BasePoints = 0;
}
base.Initialize(ref failReason);
}
开发者ID:primax,项目名称:WCell,代码行数:8,代码来源:CreateManaGemEffectHandler.cs
示例17: Initialize
public override void Initialize(ref SpellFailedReason failReason)
{
if (Effect.TriggerSpell == null)
{
failReason = SpellFailedReason.Error;
log.Warn("Tried to cast Spell \"{0}\" which has invalid TriggerSpellId {1}", Effect.Spell, Effect.TriggerSpellId);
}
}
开发者ID:pallmall,项目名称:WCell,代码行数:8,代码来源:TriggerSpell.cs
示例18: IsSameClass
public static void IsSameClass(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
{
var caster = effectHandler.Cast.CasterUnit;
if (caster == null || !(target is Unit) || caster.Class != ((Unit)target).Class)
{
failedReason = SpellFailedReason.BadTargets;
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:8,代码来源:DefaultTargetFilters.cs
示例19: NotifyCancelled
internal void NotifyCancelled(SpellCast cast, SpellFailedReason reason)
{
var evt = Cancelling;
if (evt != null)
{
evt(cast, reason);
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:8,代码来源:Spell.Events.cs
示例20: CheckInitialize
protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
if (m_spellEffect.TriggerSpell == null)
{
failReason = SpellFailedReason.Error;
log.Warn("Tried to cast Spell \"{0}\" which has invalid TriggerSpellId {1}", m_spellEffect.Spell, m_spellEffect.TriggerSpellId);
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:8,代码来源:TriggerDelayedEffectHandler.cs
注:本文中的SpellFailedReason类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论