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(); }
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; }
public static void RemoveContext(Mobile from, EffectsType type) { PropertyEffect effect = GetContext(from, type); if (effect != null) effect.RemoveEffects(); }
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; }
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); }
public abstract Effects GetEffects(EffectsType effectType);