示例#1
0
        protected void RemovePartyMember(Mobile m)
        {
            PartyList.Remove(m);
            RemovePartyEffects(m);

            if (m is PlayerMobile)
            {
                foreach (var pet in ((PlayerMobile)m).AllFollowers.Where(p => PartyList.Contains(p)))
                {
                    RemovePartyMember(pet);
                }
            }
        }
示例#2
0
        protected void AddPartyMember(Mobile m)
        {
            PartyList.Add(m);
            AddPartyEffects(m);

            if (m is PlayerMobile)
            {
                foreach (var pet in ((PlayerMobile)m).AllFollowers.Where(p => !PartyList.Contains(p) && ValidPartyMember(p)))
                {
                    AddPartyMember(pet);
                }
            }
        }
示例#3
0
 private void UpdatePets(Mobile m)
 {
     if (m is PlayerMobile pm)
     {
         foreach (Mobile pet in pm.AllFollowers)
         {
             if (!PartyList.Contains(pet) && ValidPartyMember(pet))
             {
                 AddPartyMember(pet);
             }
         }
     }
 }
示例#4
0
        public List <Mobile> GetParty()
        {
            if (!PartyEffects)
            {
                return(null);
            }

            Party         p    = Party.Get(Caster);
            List <Mobile> list = new List <Mobile>();

            if (p != null)
            {
                IPooledEnumerable eable = Caster.Map.GetMobilesInRange(Caster.Location, PartyRange);

                foreach (Mobile mob in eable)
                {
                    Mobile check = mob;

                    if (mob is BaseCreature && (((BaseCreature)mob).Summoned || ((BaseCreature)mob).Controlled))
                    {
                        check = ((BaseCreature)mob).GetMaster();
                    }

                    if (check != null && p.Contains(check))
                    {
                        list.Add(mob);

                        if (PartyList == null)
                        {
                            PartyList = new List <Mobile>();
                        }

                        if (!PartyList.Contains(mob))
                        {
                            PartyList.Add(mob);
                        }
                    }
                }

                eable.Free();
            }

            if (!list.Contains(Caster))
            {
                list.Add(Caster);
            }

            return(list);
        }
示例#5
0
        private void UpdatePets(Mobile m)
        {
            if (m is PlayerMobile pm)
            {
                for (var index = 0; index < pm.AllFollowers.Count; index++)
                {
                    Mobile pet = pm.AllFollowers[index];

                    if (!PartyList.Contains(pet) && ValidPartyMember(pet))
                    {
                        AddPartyMember(pet);
                    }
                }
            }
        }
示例#6
0
        protected void RemovePartyMember(Mobile m)
        {
            PartyList.Remove(m);
            RemovePartyEffects(m);

            if (m is PlayerMobile pm)
            {
                foreach (Mobile pet in pm.AllFollowers)
                {
                    if (PartyList.Contains(pet))
                    {
                        RemovePartyMember(pet);
                    }
                }
            }
        }
示例#7
0
        protected void AddPartyMember(Mobile m)
        {
            PartyList.Add(m);
            AddPartyEffects(m);

            if (m is PlayerMobile pm)
            {
                foreach (Mobile pet in pm.AllFollowers)
                {
                    if (!PartyList.Contains(pet) && ValidPartyMember(pet))
                    {
                        AddPartyMember(pet);
                    }
                }
            }
        }
示例#8
0
        protected void RemovePartyMember(Mobile m)
        {
            PartyList.Remove(m);
            RemovePartyEffects(m);

            if (m is PlayerMobile pm)
            {
                for (var index = 0; index < pm.AllFollowers.Count; index++)
                {
                    Mobile pet = pm.AllFollowers[index];

                    if (PartyList.Contains(pet))
                    {
                        RemovePartyMember(pet);
                    }
                }
            }
        }
示例#9
0
        protected void AddPartyMember(Mobile m)
        {
            PartyList.Add(m);
            AddPartyEffects(m);

            if (m is PlayerMobile pm)
            {
                for (var index = 0; index < pm.AllFollowers.Count; index++)
                {
                    Mobile pet = pm.AllFollowers[index];

                    if (!PartyList.Contains(pet) && ValidPartyMember(pet))
                    {
                        AddPartyMember(pet);
                    }
                }
            }
        }
示例#10
0
        public void UpdateParty(bool playersOnly)
        {
            Party p = Party.Get(Caster);

            if (PartyList == null)
            {
                PartyList = new List <Mobile>();
            }

            if (p != null)
            {
                for (var index = 0; index < p.Members.Count; index++)
                {
                    var x = p.Members[index];

                    Mobile m = x.Mobile;

                    if (!PartyList.Contains(m) && (!playersOnly || m is PlayerMobile) && ValidPartyMember(m))
                    {
                        AddPartyMember(m);
                    }
                    else if (PartyList.Contains(m) && !ValidPartyMember(m))
                    {
                        RemovePartyMember(m);
                    }
                    else
                    {
                        UpdatePets(m);
                    }
                }
            }
            else if (!PartyList.Contains(Caster))
            {
                AddPartyMember(Caster);
            }
        }