Ejemplo n.º 1
0
        public void Perform(PossibleMatch Match, Actor Actor)
        {
            var direction = Match.Arguments["DIRECTION"] as Direction?;
            var location  = Actor.Location as Room;
            var link      = location.Links.FirstOrDefault(l => l.Direction == direction.Value);

            if (link == null)
            {
                Mud.SendEventMessage(Actor, EventMessageScope.Single, "You can't go that way.\r\n");
            }
            else
            {
                if (link.Door != null)
                {
                    if (!link.Door.Open)
                    {
                        Mud.SendEventMessage(Actor, EventMessageScope.Single, "The door is closed.");
                        return;
                    }
                }

                Mud.SendEventMessage(Actor, EventMessageScope.Single, "You went " + direction.Value.ToString().ToLower() + ".\r\n");
                Mud.SendEventMessage(Actor, EventMessageScope.External, Actor.Short + " went " + direction.Value.ToString().ToLower() + "\r\n");
                var destination = Mud.GetObject(link.Destination) as Room;
                if (destination == null)
                {
                    throw new InvalidOperationException("Link does not lead to room.");
                }
                Thing.Move(Actor, destination);
                Mud.EnqueuClientCommand(Actor.ConnectedClient, "look");
            }
        }
Ejemplo n.º 2
0
        public void Perform(PossibleMatch Match, Actor Actor)
        {
            var target      = Match.Arguments["TARGET"] as Thing;
            var destination = Match.Arguments["DESTINATION"].ToString();
            var room        = Mud.GetObject(destination);

            if (room != null)
            {
                Thing.Move(target, room);
            }
        }