当前位置: 首页>>代码示例>>C#>>正文


C# WoWUnit.GetAllAuras方法代码示例

本文整理汇总了C#中WoWUnit.GetAllAuras方法的典型用法代码示例。如果您正苦于以下问题:C# WoWUnit.GetAllAuras方法的具体用法?C# WoWUnit.GetAllAuras怎么用?C# WoWUnit.GetAllAuras使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WoWUnit的用法示例。


在下文中一共展示了WoWUnit.GetAllAuras方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsCrowdControlled

 public static bool IsCrowdControlled(WoWUnit unit)
 {
     return unit.GetAllAuras().Any(a => a.IsHarmful &&
         (a.Spell.Mechanic == WoWSpellMechanic.Shackled ||
         a.Spell.Mechanic == WoWSpellMechanic.Polymorphed ||
         a.Spell.Mechanic == WoWSpellMechanic.Horrified ||
         a.Spell.Mechanic == WoWSpellMechanic.Rooted ||
         a.Spell.Mechanic == WoWSpellMechanic.Frozen ||
         a.Spell.Mechanic == WoWSpellMechanic.Stunned ||
         a.Spell.Mechanic == WoWSpellMechanic.Fleeing ||
         a.Spell.Mechanic == WoWSpellMechanic.Banished ||
         a.Spell.Mechanic == WoWSpellMechanic.Sapped));
 }
开发者ID:killingzor,项目名称:pqrotation-profiles,代码行数:13,代码来源:PVP.cs

示例2: GetAuraTimeLeft

        public static TimeSpan GetAuraTimeLeft(string auraName, WoWUnit onUnit, bool fromMyAura)
        {
            if (onUnit == null)
            {
                return TimeSpan.Zero;
            }

            WoWAura wantedAura =
                onUnit.GetAllAuras().Where(a => a.Name == auraName && (!fromMyAura || a.CreatorGuid == Me.Guid)).FirstOrDefault();

            if (wantedAura != null)
            {
                return wantedAura.TimeLeft;
            }
            return TimeSpan.Zero;
        }
开发者ID:rhoninsk,项目名称:novas-addons,代码行数:16,代码来源:Altarboy.AuraManager.cs

示例3: DebuffTime

 //Used for checking debuff timers
 private int DebuffTime(String spellName, WoWUnit unit)
 {
     using (new FrameLock())
     {
         if (unit.HasAura(spellName))
         {
             var auras = unit.GetAllAuras();
             foreach (var b in auras)
             {
                 if (b.Name == spellName)
                 {
                     return b.TimeLeft.Seconds;
                 }
             }
         }
     }
     return 0;
 }
开发者ID:rhoninsk,项目名称:novas-addons,代码行数:19,代码来源:Bowman+Marksman.cs

示例4: IsCrowdControlled

 /// <summary>
 /// Checks to see if specified target is under the effect of crowd control
 /// </summary>
 /// <param name="target">Target</param>
 /// <returns></returns>
 private static bool IsCrowdControlled(WoWUnit target)
 {
     // Just want to throw a shout-out to Singular for this function.
     return
         target.GetAllAuras().Any(
             unit =>
             unit.Spell.Mechanic == WoWSpellMechanic.Banished || unit.Spell.Mechanic == WoWSpellMechanic.Charmed
             || unit.Spell.Mechanic == WoWSpellMechanic.Horrified
             || unit.Spell.Mechanic == WoWSpellMechanic.Incapacitated
             || unit.Spell.Mechanic == WoWSpellMechanic.Polymorphed
             || unit.Spell.Mechanic == WoWSpellMechanic.Sapped
             || unit.Spell.Mechanic == WoWSpellMechanic.Shackled
             || unit.Spell.Mechanic == WoWSpellMechanic.Asleep
             || unit.Spell.Mechanic == WoWSpellMechanic.Frozen);
 }
开发者ID:LaoArchAngel,项目名称:RogueAssassin,代码行数:20,代码来源:Helpers.cs

示例5: UnitIsControlled

 /// <summary>returns true if the unit is crowd controlled.</summary>
 /// <param name="unit">unit to check</param>
 /// <param name="breakOnDamageOnly">true for break on damage</param>
 /// <returns>The unit is controlled.</returns>
 public static bool UnitIsControlled(WoWUnit unit, bool breakOnDamageOnly)
 {
     return unit != null && unit.GetAllAuras().Any(x => x.IsHarmful && (ControlDebuffs.Contains(x.Name) || (!breakOnDamageOnly && ControlUnbreakableDebuffs.Contains(x.Name))));
 }
开发者ID:Asphodan,项目名称:Alphabuddy,代码行数:8,代码来源:Unit.cs

示例6: CountMagicBuffPurge

 private static int CountMagicBuffPurge(WoWUnit target)
 {
     return target.GetAllAuras().Count<WoWAura>(a => ((a.IsActive && !a.IsHarmful) && (a.get_Spell().get_DispelType() == ((WoWDispelType)((int)WoWDispelType.Magic)))));
 }
开发者ID:bjss1976,项目名称:shamanspecialedition,代码行数:4,代码来源:THCommon.cs

示例7: GetPurgeEnemyAura

        private static WoWAura GetPurgeEnemyAura(WoWUnit target)
        {
            if (SingularSettings.Instance.PurgeBuffs == PurgeAuraFilter.All)
                return target.GetAllAuras().FirstOrDefault(a => a.TimeLeft.TotalSeconds > 1 && a.Spell.DispelType == WoWDispelType.Magic);

            SpellList sl = StyxWoW.Me.Class == WoWClass.Mage ? MageSteallist.Instance.SpellList : PurgeWhitelist.Instance.SpellList;
            return target.GetAllAuras().FirstOrDefault(a => a.TimeLeft.TotalSeconds > 1 && a.Spell.DispelType == WoWDispelType.Magic && sl.Contains(a.SpellId));
        }
开发者ID:superkhung,项目名称:SingularMod3,代码行数:8,代码来源:Dispelling.cs

示例8: IsSilenced

 public static bool IsSilenced(WoWUnit unit)
 {
     return unit.GetAllAuras().Any(a => a.IsHarmful &&
         (a.Spell.Mechanic == WoWSpellMechanic.Interrupted || 
         a.Spell.Mechanic == WoWSpellMechanic.Silenced));
 }
开发者ID:killingzor,项目名称:pqrotation-profiles,代码行数:6,代码来源:PVP.cs

示例9: GetAuraStack

        /// <summary>Check the aura stack count thats created by the specified unit</summary>
        /// <param name="unit">The unit to check auras for.</param>
        /// <param name="auraId">The Id of the aura</param>
        /// <param name="fromMyAura">True if you applied the aura</param>
        /// <returns>The get aura stack.</returns>
        public static uint GetAuraStack(WoWUnit unit, int auraId, bool fromMyAura)
        {
            if (unit != null)
            {
                var wantedAura = unit.GetAllAuras().FirstOrDefault(a => a.SpellId == auraId && a.StackCount > 0 && (!fromMyAura || a.CreatorGuid == Me.Guid));
                return wantedAura != null ? wantedAura.StackCount : 0;
            }

            CLULogger.DiagnosticLog(" [GetAuraStack] Unit is null ");
            return 0;
        }
开发者ID:Asphodan,项目名称:Alphabuddy,代码行数:16,代码来源:Buff.cs

示例10: CanHex

 private static bool CanHex(WoWUnit target)
 {
     return target.GetAllAuras().All<WoWAura>(aura => !HexImmuneAura.Contains(aura.SpellId));
 }
开发者ID:bjss1976,项目名称:shamanspecialedition,代码行数:4,代码来源:THCommon.cs

示例11: NeedTremor

 private static bool NeedTremor(WoWUnit target, int duration, bool writelog = true)
 {
     foreach (WoWAura aura in target.GetAllAuras())
     {
         if ((((aura.TimeLeft.TotalMilliseconds >= duration) && (aura.SpellId != 30283)) && (aura.SpellId != 132168)) && ((DebuffNeedTremor.Contains(aura.SpellId) || (aura.get_Spell().get_Mechanic() == ((WoWSpellMechanic)((int)WoWSpellMechanic.Asleep)))) || (((aura.get_Spell().get_Mechanic() == ((WoWSpellMechanic)((int)WoWSpellMechanic.Charmed))) || (aura.get_Spell().get_Mechanic() == ((WoWSpellMechanic)((int)WoWSpellMechanic.Fleeing)))) || (aura.get_Spell().get_Mechanic() == ((WoWSpellMechanic)((int)WoWSpellMechanic.Horrified))))))
         {
             if (writelog)
             {
                 Logging.Write("NeedTremor {0} {1} ID: {2}", new object[] { target.SafeName, aura.Name, aura.SpellId });
             }
             return true;
         }
     }
     return false;
 }
开发者ID:bjss1976,项目名称:shamanspecialedition,代码行数:15,代码来源:THCommon.cs

示例12: NeedPurgeASAPResto

 private static bool NeedPurgeASAPResto(WoWUnit target)
 {
     return target.GetAllAuras().Any<WoWAura>(aura => NeedPurgeASAPRestoHS.Contains(aura.Name));
 }
开发者ID:bjss1976,项目名称:shamanspecialedition,代码行数:4,代码来源:THCommon.cs

示例13: GetMyShieldonUnit

 private static bool GetMyShieldonUnit(WoWUnit target)
 {
     return target.GetAllAuras().Any<WoWAura>(delegate(WoWAura aura)
     {
         if (aura.CreatorGuid != target.Guid)
         {
             return false;
         }
         if ((aura.SpellId != 974) && (aura.SpellId != 324))
         {
             return (aura.SpellId == 52127);
         }
         return true;
     });
 }
开发者ID:bjss1976,项目名称:shamanspecialedition,代码行数:15,代码来源:THCommon.cs

示例14: Debuff63280Duration

 private static bool Debuff63280Duration(WoWUnit target, double duration, bool LogSpell = false)
 {
     return target.GetAllAuras().Any<WoWAura>(aura => Debuff63280DurationHS.Contains(aura.SpellId));
 }
开发者ID:bjss1976,项目名称:shamanspecialedition,代码行数:4,代码来源:THCommon.cs

示例15: IsMyAuraActive

 //Used for checking auras that has no time
 private bool IsMyAuraActive(WoWUnit Who, String What)
 {
     using (new FrameLock())
     {
         return Who.GetAllAuras().Where(p => p.CreatorGuid == Me.Guid && p.Name == What).FirstOrDefault() != null;
     }
 }
开发者ID:rhoninsk,项目名称:novas-addons,代码行数:8,代码来源:Bowman+Marksman.cs


注:本文中的WoWUnit.GetAllAuras方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。