コード例 #1
0
        public static void RemoveContext(Mobile m, EodonPotionContext context)
        {
            if (context == null)
            {
                return;
            }

            if (context.Potion != null)
            {
                context.Potion.RemoveBuff(m);
            }

            if (Contexts.ContainsKey(m))
            {
                if (Contexts[m] != null && Contexts[m].Contains(context))
                {
                    Contexts[m].Remove(context);
                }

                if (Contexts[m] == null || Contexts[m].Count == 0)
                {
                    Contexts.Remove(m);
                }

                if (Contexts.Count == 0)
                {
                    EndTimer();
                }

                m.Delta(MobileDelta.WeaponDamage);
            }
        }
コード例 #2
0
        public static void OnTick()
        {
            if (Contexts == null)
            {
                EndTimer();
            }
            else
            {
                Dictionary <Mobile, List <EodonPotionContext> > dictionary = new Dictionary <Mobile, List <EodonPotionContext> >(Contexts);

                foreach (KeyValuePair <Mobile, List <EodonPotionContext> > kvp in dictionary)
                {
                    List <EodonPotionContext> contexts = new List <EodonPotionContext>(kvp.Value);

                    for (var index = 0; index < contexts.Count; index++)
                    {
                        EodonPotionContext context = contexts[index];

                        context.OnTick(kvp.Key);
                    }

                    ColUtility.Free(contexts);
                }

                dictionary.Clear();
            }
        }
コード例 #3
0
        public void RemoveContext(Mobile m)
        {
            EodonPotionContext context = GetContext(m, this.PotionEffect);

            if (context != null)
            {
                RemoveContext(m, context);
            }
        }
コード例 #4
0
ファイル: EodonPotions.cs プロジェクト: tflynt91/TrueUO
        public override void OnTick(Mobile m)
        {
            EodonPotionContext context = GetContext(m, PotionEffect);

            if (context != null && context.StartTime + TimeSpan.FromMinutes(10) > DateTime.UtcNow)
            {
                m.Mana += 10;
                //TODO: Message?
            }
        }
コード例 #5
0
        public static int GetManaBuff(Mobile m)
        {
            EodonPotionContext c = GetContext(m, PotionEffect.Urali);

            if (c != null && c.StartTime + TimeSpan.FromMinutes(5) > DateTime.UtcNow)
            {
                return(10);
            }

            return(0);
        }
コード例 #6
0
        public static int HPRegenBonus(Mobile m)
        {
            EodonPotionContext c = GetContext(m, PotionEffect.Barrab);

            if (c != null && c.StartTime + TimeSpan.FromMinutes(10) > DateTime.UtcNow)
            {
                return(100);
            }

            return(0);
        }