--- deliantra/server/common/readable.C 2007/01/03 00:08:17 1.15 +++ deliantra/server/common/readable.C 2007/01/23 01:05:17 1.20 @@ -1,25 +1,26 @@ /* - CrossFire, A Multiplayer game for X-windows - - Copyright (C) 2002 Mark Wedel & Crossfire Development Team - Copyright (C) 1992 Frank Tore Johansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - The authors can be reached via e-mail at -*/ + * CrossFire, A Multiplayer game for X-windows + * + * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team + * Copyright (C) 2002 Mark Wedel & Crossfire Development Team + * Copyright (C) 1992 Frank Tore Johansen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * The authors can be reached via e-mail at + */ /* This file contains code relevant to the BOOKS hack -- designed @@ -112,7 +113,7 @@ static int nrofmon = 0, need_to_write_bookarchive = 0; -/* this is needed to keep track of status of initialization +/* this is needed to keep track of status of initialisation * of the message file */ static int nrofmsg = 0; @@ -189,7 +190,7 @@ {"Boots", BOOTS}, {"Cloak", CLOAK}, {"Gloves", GLOVES}, - {"Gridle", GIRDLE}, + {"Girdle", GIRDLE}, {"Ring", RING}, {"Horn", HORN}, {"Missile Weapon", BOW}, @@ -638,11 +639,11 @@ /***************************************************************************** * - * Start of initialization related functions. + * Start of initialisation related functions. * ****************************************************************************/ -/* init_msgfile() - if not called before, initialize the info list +/* init_msgfile() - if not called before, initialise the info list * reads the messages file into the list pointed to by first_msg */ @@ -710,7 +711,7 @@ } -/* init_book_archive() - if not called before, initialize the info list +/* init_book_archive() - if not called before, initialise the info list * This reads in the bookarch file into memory. bookarch is the file * created and updated across multiple runs of the program. */ @@ -837,10 +838,10 @@ } -/* init_readable() - initialize linked lists utilized by +/* init_readable() - initialise linked lists utilized by * message functions in tailor_readable_ob() * - * This is the function called by the main routine to initialize + * This is the function called by the main routine to initialise * all the readable information. */ @@ -922,35 +923,35 @@ { case 1: /*monster */ nbr = sizeof (mon_book_name) / sizeof (char *); - strcpy (name, mon_book_name[RANDOM () % nbr]); + strcpy (name, mon_book_name[rndm (nbr)]); break; case 2: /*artifact */ nbr = sizeof (art_book_name) / sizeof (char *); - strcpy (name, art_book_name[RANDOM () % nbr]); + strcpy (name, art_book_name[rndm (nbr)]); break; case 3: /*spellpath */ nbr = sizeof (path_book_name) / sizeof (char *); - strcpy (name, path_book_name[RANDOM () % nbr]); + strcpy (name, path_book_name[rndm (nbr)]); break; case 4: /*alchemy */ nbr = sizeof (formula_book_name) / sizeof (char *); - strcpy (name, formula_book_name[RANDOM () % nbr]); + strcpy (name, formula_book_name[rndm (nbr)]); break; case 5: /*gods */ nbr = sizeof (gods_book_name) / sizeof (char *); - strcpy (name, gods_book_name[RANDOM () % nbr]); + strcpy (name, gods_book_name[rndm (nbr)]); break; case 6: /*msg file */ default: if (book->weight > 2000) { /* based on weight */ nbr = sizeof (heavy_book_name) / sizeof (char *); - strcpy (name, heavy_book_name[RANDOM () % nbr]); + strcpy (name, heavy_book_name[rndm (nbr)]); } else if (book->weight < 2001) { nbr = sizeof (light_book_name) / sizeof (char *); - strcpy (name, light_book_name[RANDOM () % nbr]); + strcpy (name, light_book_name[rndm (nbr)]); } break; } @@ -976,27 +977,27 @@ { case 1: /* monster */ nbr = sizeof (mon_author) / sizeof (char *); - strcpy (name, mon_author[RANDOM () % nbr]); + strcpy (name, mon_author[rndm (nbr)]); break; case 2: /* artifacts */ nbr = sizeof (art_author) / sizeof (char *); - strcpy (name, art_author[RANDOM () % nbr]); + strcpy (name, art_author[rndm (nbr)]); break; case 3: /* spellpath */ nbr = sizeof (path_author) / sizeof (char *); - strcpy (name, path_author[RANDOM () % nbr]); + strcpy (name, path_author[rndm (nbr)]); break; case 4: /* alchemy */ nbr = sizeof (formula_author) / sizeof (char *); - strcpy (name, formula_author[RANDOM () % nbr]); + strcpy (name, formula_author[rndm (nbr)]); break; case 5: /* gods */ nbr = sizeof (gods_author) / sizeof (char *); - strcpy (name, gods_author[RANDOM () % nbr]); + strcpy (name, gods_author[rndm (nbr)]); break; case 6: /* msg file */ default: - strcpy (name, book_author[RANDOM () % nbr]); + strcpy (name, book_author[rndm (nbr)]); } sprintf (title, "of %s", name); @@ -1170,7 +1171,7 @@ /* Lets give the book a description to individualize it some */ char new_name[MAX_BUF]; - snprintf (new_name, MAX_BUF, "%s %s", book_descrpt[RANDOM () % nbr], old_name); + snprintf (new_name, MAX_BUF, "%s %s", book_descrpt[rndm (nbr)], old_name); book->name = new_name; }