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; } }
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; } }
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); } }
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); } }