Пример #1
0
        public override void Use(Player p, string message, CommandData data)
        {
            if (message.Length == 0)
            {
                p.Message("Your current transform is: " + p.Transform.Name); return;
            }
            string[]         args      = message.SplitSpaces(2);
            TransformFactory transform = TransformFactory.Find(args[0]);

            if (IsListCommand(args[0]))
            {
                List(p);
            }
            else if (transform == null)
            {
                p.Message("No transform found with name \"{0}\".", args[0]);
                List(p);
            }
            else
            {
                p.Message("Set your transform to: " + transform.Name);
                Transform instance = transform.Construct(p, args.Length == 1 ? "" : args[1]);
                if (instance == null)
                {
                    return;
                }
                p.Transform = instance;
            }
        }
Пример #2
0
        public override void Use(Player p, string message)
        {
            if (message.Length == 0)
            {
                Player.Message(p, "Your current transform is: " + p.Transform.Name); return;
            }
            string[]         args      = message.SplitSpaces(2);
            TransformFactory transform = TransformFactory.Find(args[0]);

            if (args[0].CaselessEq("list"))
            {
                Player.Message(p, "%HAvailable transforms: %S" + TransformFactory.Available);
            }
            else if (transform == null)
            {
                Player.Message(p, "No transform found with name \"{0}\".", args[0]);
                Player.Message(p, "Available transforms: " + TransformFactory.Available);
            }
            else
            {
                Player.Message(p, "Set your transform to: " + transform.Name);
                Transform instance = transform.Construct(p, args.Length == 1 ? "" : args[1]);
                if (instance == null)
                {
                    return;
                }
                p.Transform = instance;
            }
        }
Пример #3
0
        public override void Help(Player p, string message)
        {
            TransformFactory transform = TransformFactory.Find(message);

            if (transform == null)
            {
                p.Message("No transform found with name \"{0}\".", message);
                List(p);
            }
            else
            {
                p.MessageLines(transform.Help);
            }
        }
Пример #4
0
        public override void Help(Player p, string message)
        {
            TransformFactory transform = TransformFactory.Find(message);

            if (transform == null)
            {
                Player.Message(p, "No transform found with name \"{0}\".", message);
                Player.Message(p, "%HAvailable transforms: %S" + TransformFactory.Available);
            }
            else
            {
                Player.MessageLines(p, transform.Help);
            }
        }