/// <summary> /// Find Immunity Effects by spellHandler Type /// </summary> /// <param name="target">Living to find effect on</param> /// <param name="spellHandler">Effect Type to find (Exact Type Match)</param> /// <returns>All Immunity State GameSpellEffect matching SpellHandler Type in target's effect list</returns> public static List <GameSpellEffect> FindImmunityEffectsOnTarget(this GameLiving target, Type spellHandler) { List <GameSpellEffect> effects = null; lock (target.EffectList) { effects = target.ImmunityEffectsOnTarget(spellHandler).ToList(); } return(effects); }
/// <summary> /// Find Immunity Effect by spellHandler Type /// </summary> /// <param name="target">Living to find effect on</param> /// <param name="spellHandler">Effect Type to find (Exact Type Match)</param> /// <returns>First occurence of Immunity State GameSpellEffect in target's effect list or null</returns> public static GameSpellEffect FindImmunityEffectOnTarget(this GameLiving target, Type spellHandler) { GameSpellEffect effect = null; lock (target.EffectList) { effect = target.ImmunityEffectsOnTarget(spellHandler).FirstOrDefault(); } return(effect); }