예제 #1
0
        public override void OnPositionChanging(Point3D newPos)
        {
            List <Mobile> mlist = new List <Mobile>(World.Mobiles.Values);

            for (int i = 0; i < mlist.Count; i++)
            {
                Mobile m = mlist[i];
                if (m != this)
                {
                    if (!Utility.InRange(m.Position, newPos, VisRange))
                    {
                        m.Remove();
                    }
                    else
                    {
                        Targeting.CheckLastTargetRange(m);
                    }
                }
            }

            mlist = null;


            List <Item>    ilist = new List <Item>(World.Items.Values);
            ScavengerAgent s     = ScavengerAgent.Instance;

            for (int i = 0; i < ilist.Count; i++)
            {
                Item item = ilist[i];
                if (item.Deleted || item.Container != null)
                {
                    continue;
                }

                int dist = Utility.Distance(item.GetWorldPosition(), newPos);
                if (item != DragDropManager.Holding && (dist > MultiVisRange || (!item.IsMulti && dist > VisRange)))
                {
                    item.Remove();
                }
                else if (!IsGhost && Visible && dist <= 2 && s.Enabled && item.Movable)
                {
                    s.Scavenge(item);
                }
            }

            ilist = null;

            base.OnPositionChanging(newPos);
        }
예제 #2
0
        public override void OnPositionChanging(Point3D oldPos)
        {
            AutoOpenDoors();

            List <Mobile> mlist = new List <Mobile>(World.Mobiles.Values);

            for (int i = 0; i < mlist.Count; i++)
            {
                Mobile m = mlist[i];
                if (m != this)
                {
                    if (!Utility.InRange(m.Position, Position, VisRange))
                    {
                        m.Remove();
                    }
                    else
                    {
                        Targeting.CheckLastTargetRange(m);
                    }
                }
            }

            mlist = null;


            List <Item> ilist = new List <Item>(World.Items.Values);

            for (int i = 0; i < ilist.Count; i++)
            {
                Item item = ilist[i];
                if (item.Deleted || item.Container != null)
                {
                    continue;
                }

                int dist = Utility.Distance(item.GetWorldPosition(), Position);
                if (item != DragDropManager.Holding && (dist > MultiVisRange || (!item.IsMulti && dist > VisRange)))
                {
                    item.Remove();
                }
            }

            ilist = null;

            base.OnPositionChanging(oldPos);
        }
예제 #3
0
        internal override void OnPositionChanging(Point3D newPos)
        {
            List <Mobile> mobiles = new List <Mobile>(World.Mobiles.Values);

            foreach (Mobile m in mobiles)
            {
                if (m != this)
                {
                    if (!Utility.InRange(m.Position, newPos, VisRange))
                    {
                        m.Remove();
                    }
                    else
                    {
                        Targeting.CheckLastTargetRange(m);
                    }
                }
            }

            List <Item> items = new List <Item>(World.Items.Values);

            foreach (Item item in items)
            {
                if (item.Deleted || item.Container != null)
                {
                    continue;
                }

                int dist = Utility.Distance(item.GetWorldPosition(), newPos);
                if (item != DragDropManager.Holding && (dist > MultiVisRange || (!item.IsMulti && dist > VisRange)))
                {
                    item.Remove();
                }
            }

            base.OnPositionChanging(newPos);
        }
예제 #4
0
파일: Player.cs 프로젝트: dissident76/Razor
        public override void OnPositionChanging(Point3D oldPos)
        {
            if (!IsGhost)
            {
                StealthSteps.OnMove();
            }

            AutoOpenDoors(false);

            List <Mobile> mlist = new List <Mobile>(World.Mobiles.Values);

            for (int i = 0; i < mlist.Count; i++)
            {
                Mobile m = mlist[i];
                if (m != this)
                {
                    if (!Utility.InRange(m.Position, Position, VisRange))
                    {
                        m.Remove();
                    }
                    else
                    {
                        Targeting.CheckLastTargetRange(m);
                    }
                }
            }

            mlist = null;


            List <Item>    ilist = new List <Item>(World.Items.Values);
            ScavengerAgent s     = ScavengerAgent.Instance;

            for (int i = 0; i < ilist.Count; i++)
            {
                Item item = ilist[i];
                if (item.Deleted || item.Container != null)
                {
                    continue;
                }

                int dist = Utility.Distance(item.GetWorldPosition(), Position);
                if (item != DragDropManager.Holding && (dist > MultiVisRange || (!item.IsMulti && dist > VisRange)))
                {
                    item.Remove();
                }
                else if (!IsGhost && Visible && dist <= 2 && s.Enabled && item.Movable)
                {
                    s.Scavenge(item);
                }
            }

            ilist = null;

            if (Engine.MainWindow != null && Engine.MainWindow.MapWindow != null)
            {
                Engine.MainWindow.SafeAction(f => f.MapWindow.PlayerMoved());
            }

            base.OnPositionChanging(oldPos);
        }