version 1.76 | | version 1.77 |
---|
| | |
/* | | /* |
* static char *rcsid_c_misc_c = | | * static char *rcsid_c_misc_c = |
* "$Id: c_misc.c,v 1.76 2006/02/10 23:59:27 akirschbaum Exp $"; | | * "$Id: c_misc.c,v 1.77 2006/03/18 15:05:37 ryo_saeba Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
extern weathermap_t **weathermap; | | extern weathermap_t **weathermap; |
| | |
/* Handles misc. input request - things like hash table, malloc, maps, | | /** |
| | * Handles misc. input request - things like hash table, malloc, maps, |
* who, etc. | | * who, etc. |
*/ | | */ |
| | |
| | |
} | | } |
} | | } |
| | |
/* This command dumps the body information for object *op. | | /** |
| | * This command dumps the body information for object *op. |
* it doesn't care what the params are. | | * it doesn't care what the params are. |
* This is mostly meant as a debug command. | | * This is mostly meant as a debug command. |
*/ | | */ |
| | |
new_draw_info(NDI_UNIQUE, 0,op,errmsg); | | new_draw_info(NDI_UNIQUE, 0,op,errmsg); |
} | | } |
| | |
/* | | /** |
* Pretty much identical to current map_info, but on a bigger scale | | * Pretty much identical to current map_info, but on a bigger scale |
* This function returns the name of the players current region, and | | * This function returns the name of the players current region, and |
* a description of it. It is there merely for flavour text. | | * a description of it. It is there merely for flavour text. |
| | |
int login_order; | | int login_order; |
} chars_names; | | } chars_names; |
| | |
/*local functon for qsort comparison*/ | | /** local functon for qsort comparison*/ |
static int name_cmp (const chars_names *c1, const chars_names *c2) | | static int name_cmp (const chars_names *c1, const chars_names *c2) |
{ | | { |
return strcasecmp (c1->namebuf, c2->namebuf); | | return strcasecmp (c1->namebuf, c2->namebuf); |
| | |
return 1; | | return 1; |
} | | } |
| | |
/* Display a line of 'who' to op, about pl, using the formatting specified by format */ | | /** Display a line of 'who' to op, about pl, using the formatting specified by format */ |
void display_who_entry(object *op, player *pl, const char *format) { | | void display_who_entry(object *op, player *pl, const char *format) { |
char tmpbuf[MAX_BUF]; | | char tmpbuf[MAX_BUF]; |
char outbuf[MAX_BUF]; | | char outbuf[MAX_BUF]; |
| | |
new_draw_info(NDI_UNIQUE, 0, op, outbuf); | | new_draw_info(NDI_UNIQUE, 0, op, outbuf); |
} | | } |
| | |
/* Returns the value of the escape code used in the who format specifier | | /** |
| | * Returns the value of the escape code used in the who format specifier |
* the values are: | | * the values are: |
* N Name of character | | * N Name of character |
* t title of character | | * t title of character |
| | |
} | | } |
| | |
| | |
/* | | /** |
* Those dumps should be just one dump with good parser | | * Those dumps should be just one dump with good parser |
*/ | | */ |
| | |
| | |
| | |
int command_ssdumptable (object *op, char *params) | | int command_ssdumptable (object *op, char *params) |
{ | | { |
(void) ss_dump_table(1); | | ss_dump_table(1); |
return 0; | | return 0; |
} | | } |
| | |
| | |
return 1; | | return 1; |
} | | } |
| | |
/* Prints out some useful information for the character. Everything we print | | /** |
| | * Prints out some useful information for the character. Everything we print |
* out can be determined by the docs, so we aren't revealing anything extra - | | * out can be determined by the docs, so we aren't revealing anything extra - |
* rather, we are making it convenient to find the values. params have | | * rather, we are making it convenient to find the values. params have |
* no meaning here. | | * no meaning here. |
| | |
| | |
return 0; | | return 0; |
} | | } |
/* | | |
| | /** |
* Actual commands. | | * Actual commands. |
* Those should be in small separate files (c_object.c, c_wiz.c, cmove.c,...) | | * Those should be in small separate files (c_object.c, c_wiz.c, cmove.c,...) |
*/ | | */ |
| | |
| | |
static void help_topics(object *op, int what) | | static void help_topics(object *op, int what) |
{ | | { |
DIR *dirp; | | DIR *dirp; |
| | |
{ | | { |
char line[80]; | | char line[80]; |
int i, size, namelen, linelen=0; | | int i, size, namelen, linelen=0; |
CommArray_s *ap; | | command_array_struct *ap; |
extern CommArray_s Commands[], WizCommands[]; | | extern command_array_struct Commands[], WizCommands[]; |
extern const int CommandsSize, WizCommandsSize; | | extern const int CommandsSize, WizCommandsSize; |
| | |
switch (what) { | | switch (what) { |
| | |
return 1; | | return 1; |
} | | } |
| | |
/* | | /** |
* don't allow people to exit explore mode. It otherwise becomes | | * don't allow people to exit explore mode. It otherwise becomes |
* really easy to abuse this. | | * really easy to abuse this. |
*/ | | */ |
| | |
return 1; | | return 1; |
} | | } |
| | |
/* Perhaps these should be in player.c, but that file is | | /** |
| | * Perhaps these should be in player.c, but that file is |
* already a bit big. | | * already a bit big. |
*/ | | */ |
| | |
| | |
new_draw_info(NDI_UNIQUE, 0,op," "); | | new_draw_info(NDI_UNIQUE, 0,op," "); |
new_draw_info(NDI_UNIQUE, 0,op,"Welcome, Brave New Warrior!"); | | new_draw_info(NDI_UNIQUE, 0,op,"Welcome, Brave New Warrior!"); |
new_draw_info(NDI_UNIQUE, 0,op," "); | | new_draw_info(NDI_UNIQUE, 0,op," "); |
Roll_Again(op); | | roll_again(op); |
op->contr->state=ST_ROLL_STAT; | | op->contr->state=ST_ROLL_STAT; |
return; | | return; |
} | | } |