Пример #1
0
        public PropertyEffect(Mobile from, Item owner, EffectsType effect, TimeSpan duration, TimeSpan tickduration)
        {
            m_Mobile = from;
            m_Owner = owner;
            m_Effect = effect;
            m_Duration = duration;
            m_TickDuration = tickduration;

            m_Effects.Add(this);

            if (m_TickDuration > TimeSpan.MinValue)
                StartTimer();
        }
Пример #2
0
        public static PropertyEffect GetContext(Mobile from, EffectsType type)
        {
            foreach (PropertyEffect e in m_Effects)
            {
                if (e.Mobile == from && e.Effect == type)
                    return e;
            }

            return null;
        }
Пример #3
0
        public static void RemoveContext(Mobile from, EffectsType type)
        {
            PropertyEffect effect = GetContext(from, type);

            if (effect != null)
                effect.RemoveEffects();
        }
Пример #4
0
 public static bool IsUnderEffects(Mobile from, EffectsType effect)
 {
     foreach (PropertyEffect e in m_Effects)
     {
         if (e.Mobile == from && e.Effect == effect)
             return true;
     }
     return false;
 }
Пример #5
0
 public static T GetContext <T>(Mobile from, Mobile victim, EffectsType type) where T : PropertyEffect
 {
     return(m_Effects.FirstOrDefault(e => e.Mobile == from && e.Victim == victim && e.Effect == type) as T);
 }
Пример #6
0
 public abstract Effects GetEffects(EffectsType effectType);