Beispiel #1
0
        /// <summary>
        /// Find effect by spell type / spell name
        /// </summary>
        /// <param name="target">Living to find effect on</param>
        /// <param name="spellType">Spell type to find</param>
        /// <param name="spellName">Spell name to find</param>
        /// <returns>First occurence GameSpellEffect matching Type and Name in target's effect list or null</returns>
        public static GameSpellEffect FindEffectOnTarget(this GameLiving target, string spellType, string spellName)
        {
            GameSpellEffect effect = null;

            lock (target.EffectList)
            {
                effect = target.EffectsOnTarget(spellType, spellName).FirstOrDefault();
            }
            return(effect);
        }
Beispiel #2
0
        /// <summary>
        /// Find effects by spell handler Object Type (Hierarchical)
        /// </summary>
        /// <param name="target">Living to find effect on</param>
        /// <param name="spellHandler">Spell Handler to find (Hierarchical Type Match)</param>
        /// <returns>All GameSpellEffect mathing Type Hierarchy in target's effect list</returns>
        public static List <GameSpellEffect> FindEffectsOnTarget(this GameLiving target, Type spellHandler)
        {
            List <GameSpellEffect> effects = null;

            lock (target.EffectList)
            {
                effects = target.EffectsOnTarget(spellHandler).ToList();
            }
            return(effects);
        }
Beispiel #3
0
        /// <summary>
        /// Find effect by spell handler Object Type (Hierarchical)
        /// </summary>
        /// <param name="target">Living to find effect on</param>
        /// <param name="spellHandler">Spell Handler to find (Hierarchical Type Match)</param>
        /// <returns>First occurence of GameSpellEffect in target's effect list or null</returns>
        public static GameSpellEffect FindEffectOnTarget(this GameLiving target, Type spellHandler)
        {
            GameSpellEffect effect = null;

            lock (target.EffectList)
            {
                effect = target.EffectsOnTarget(spellHandler).FirstOrDefault();
            }
            return(effect);
        }
Beispiel #4
0
        /// <summary>
        /// Find effects by spell type / spell name
        /// </summary>
        /// <param name="target">Living to find effect on</param>
        /// <param name="spellType">Spell type to find</param>
        /// <param name="spellName">Spell name to find</param>
        /// <returns>All GameSpellEffect matching Type and Name in target's effect list or null</returns>
        public static List <GameSpellEffect> FindEffectsOnTarget(this GameLiving target, string spellType, string spellName)
        {
            List <GameSpellEffect> effects = null;

            lock (target.EffectList)
            {
                effects = target.EffectsOnTarget(spellType, spellName).ToList();
            }
            return(effects);
        }
Beispiel #5
0
        /// <summary>
        /// Find Game Spell Effects by spell object
        /// </summary>
        /// <param name="target">Living to find effect on</param>
        /// <param name="spell">Spell Object to Find (Spell.ID Match)</param>
        /// <returns>All GameSpellEffect build from spell in target's effect list or null</returns>
        public static List <GameSpellEffect> FindEffectsOnTarget(this GameLiving target, Spell spell)
        {
            List <GameSpellEffect> effects;

            lock (target.EffectList)
            {
                effects = target.EffectsOnTarget(spell).ToList();
            }

            return(effects);
        }
Beispiel #6
0
        /// <summary>
        /// Find Game Spell Effect by spell object
        /// </summary>
        /// <param name="target">Living to find effect on</param>
        /// <param name="spell">Spell Object to Find (Spell.ID Match)</param>
        /// <returns>First occurence GameSpellEffect build from spell in target's effect list or null</returns>
        public static GameSpellEffect FindEffectOnTarget(this GameLiving target, Spell spell)
        {
            GameSpellEffect effect;

            lock (target.EffectList)
            {
                effect = target.EffectsOnTarget(spell).FirstOrDefault();
            }

            return(effect);
        }