co_mmands.c

dw_fluffos_v1/lib/cmds/player/co_mmands.c · 1020 B

From the archive dw_fluffos_v1.tar.gz

Download the archive   « Back to the archive contents

/*  -*- LPC -*-  */
/*
 * $Locker:  $
 * $Id: co_mmands.c,v 1.2 2003/03/25 23:12:44 drakkos Exp $
 * $Log: co_mmands.c,v $
 * Revision 1.2  2003/03/25 23:12:44  drakkos
 * Added a line for PT commands
 *
 * Revision 1.1  1998/01/06 05:29:43  ceres
 * Initial revision
 * 
*/
inherit "/cmds/base";

int cmd( ) {
  string *cmds;
  write( "Your current commands are:\n"+ sprintf( "%-#*s\n",
         (int)this_player()->query_cols(), implode( sort_array(
         (string *)this_player()->query_known_commands(), 1 ),
         "\n" ) ) );
         
  if (this_player()->query_playtester()) {
    cmds = get_dir ("/cmds/playtester/");
    
    cmds = filter (cmds, (: strsrch ($1, ".c") == (sizeof ($1) - 2) :));
    write( "\n\nYour playtester commands are:\n"+ replace (sprintf( "%-#*s\n",
         (int)this_player()->query_cols(), implode( sort_array(
         (string *)cmds, 1 ),
         "\n" ) ), ({".c", ""})) );
        
  }
   return 1;
} /* cmd() */

mixed* query_patterns() {
   return ({ "", (: cmd() :) });
}

Site Stats

Snippets: 1791
Codebases: 571