version 1.3 | | version 1.4 |
---|
| | |
| | /* |
| | * static char *rcsid_readable_c = |
| | * "$Id: readable.c,v 1.4 2001/03/30 06:14:25 mwedel Exp $"; |
| | */ |
| | |
| | /* |
| | CrossFire, A Multiplayer game for X-windows |
| | |
| | Copyright (C) 2001 Mark Wedel |
| | 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 author can be reached via e-mail to mwedel@scruz.net |
| | */ |
| | |
| | |
/* This file contains code relevant to the BOOKS hack -- designed | | /* This file contains code relevant to the BOOKS hack -- designed |
* to allow randomly occuring messages in non-magical texts. | | * to allow randomly occuring messages in non-magical texts. |
| | |
| | |
static char *mage_book_name[] = | | static char *mage_book_name[] = |
{ | | { |
"grimoire", | | "grimoire", /* Level 1 */ |
"grimoire", | | "grimoire", /* Level 2-3 */ |
"grimoire", | | "manual", /* Level 4-5 */ |
"manual", | | "tome", /* Level 6-7 */ |
"tome", | | "treatise" /* Level 8+ */ |
"treatise" | | |
}; | | }; |
| | |
static char *priest_book_name[] = | | static char *priest_book_name[] = |
{ | | { |
"hymnal", | | "hymnal", /* Level 1 */ |
"prayerbook", | | "prayerbook", /* Level 2-3 */ |
"prayerbook", | | "prayerbook", /* Level 4-5 */ |
"prayerbook", | | "sacred text", /* Level 6-7 */ |
"sacred text", | | "testament" /* Level 8+ */ |
"testiment" | | |
}; | | }; |
| | |
static int max_titles[6] = | | static int max_titles[6] = |
| | |
case SPELLBOOK: /* depends on mage/clerical */ | | case SPELLBOOK: /* depends on mage/clerical */ |
if (!strcmp (book->arch->name, "cleric_book")) | | if (!strcmp (book->arch->name, "cleric_book")) |
{ | | { |
| | int level; |
| | level=spells[book->stats.sp].level/2; |
nbr = sizeof (priest_book_name) / sizeof (char *); | | nbr = sizeof (priest_book_name) / sizeof (char *); |
strcpy (name, priest_book_name[RANDOM () % nbr]); | | if (level>(nbr-1)) level=nbr-1; |
| | strcpy (name, priest_book_name[level]); |
} | | } |
else | | else |
{ | | { |
| | int level; |
| | |
| | level=spells[book->stats.sp].level/2; |
nbr = sizeof (mage_book_name) / sizeof (char *); | | nbr = sizeof (mage_book_name) / sizeof (char *); |
strcpy (name, mage_book_name[RANDOM () % nbr]); | | if (level>(nbr-1)) level=nbr-1; |
| | strcpy (name, mage_book_name[level]); |
} | | } |
if (book->name) | | if (book->name) |
free_string (book->name); | | free_string (book->name); |