Crossfire Server, Branch 1.12
R12190
|
This file contains code relevant to the BOOKS hack -- designed to allow randomly occuring messages in non-magical texts. More...
Go to the source code of this file.
Data Structures | |
struct | namebytype |
special structure, used only by art_name_array[] More... | |
struct | titleliststruct |
struct | titlestruct |
'title' and 'titlelist' are used by the readable code More... | |
Defines | |
#define | arraysize(arrayname) (sizeof(arrayname)/sizeof(*(arrayname))) |
Returns the element size of an array. | |
#define | MAX_TITLE_CHECK 20 |
How many times to try to generate a unique name for a book. | |
#define | MSGTYPE_ALCHEMY 4 |
#define | MSGTYPE_ARTIFACT 2 |
#define | MSGTYPE_GODS 5 |
#define | MSGTYPE_LIB 0 |
#define | MSGTYPE_MONSTER 1 |
#define | MSGTYPE_MSGFILE 6 |
#define | MSGTYPE_SPELLPATH 3 |
Typedefs | |
typedef struct namebytype | arttypename |
special structure, used only by art_name_array[] | |
typedef struct titlestruct | title |
'title' and 'titlelist' are used by the readable code | |
typedef struct titleliststruct | titlelist |
Functions | |
static void | add_author (object *op, int msgtype) |
A lot like new_text_name() above, but instead chooses an author and sets op->title to that value. | |
static void | add_book (title *book, int type, const char *fname, int lineno) |
Appends a book to the booklist. | |
static void | add_book_to_list (const object *book, int msgtype) |
Adds a book to the list of existing books. | |
static char * | artifact_msg (int level, char *retbuf, size_t booksize) |
Generate a message detailing the properties of 1-6 artifacts drawn sequentially from the artifact list. | |
int | book_overflow (const char *buf1, const char *buf2, size_t booksize) |
Checks if buf1 and buf2 can be combined. | |
static void | change_book (object *book, int msgtype) |
Give a new, fancier name to generated objects of type BOOK and SPELLBOOK. | |
static title * | find_title (const object *book, int msgtype) |
Search the titlelist (based on msgtype) to see if book matches something already there. | |
void | free_all_readable (void) |
static title * | get_empty_book (void) |
Creates a title. | |
static titlelist * | get_empty_booklist (void) |
Creates a titlelist. | |
static object * | get_next_mon (const object *tmp) |
This function returns the next monster after 'tmp' in the monster list. | |
object * | get_random_mon (int level) |
Returns a random monster selected from linked list of all monsters in the current game. | |
const readable_message_type * | get_readable_message_type (object *readable) |
Get the readable type for an object (hopefully book). | |
static titlelist * | get_titlelist (int i) |
Gets the ith titlelist. | |
static char * | god_info_msg (int level, char *retbuf, size_t booksize) |
Generate a message detailing the properties of a random god. | |
static void | init_book_archive (void) |
If not called before, initialize the info list. | |
static void | init_mon_info (void) |
Creates the linked list of pointers to monster archetype objects if not called previously. | |
static void | init_msgfile (void) |
If not called before, initialize the info list. | |
void | init_readable (void) |
Initialize linked lists utilized by message functions in tailor_readable_ob() | |
static void | make_formula_book (object *book, int level) |
Generate a message detailing the properties of a randomly selected alchemical formula. | |
static char * | mon_desc (const object *mon, char *buf, size_t size) |
Returns a description of the monster. | |
static char * | mon_info_msg (int level, char *buf, size_t booksize) |
Generate a message detailing the properties of randomly monster(s). | |
static char * | msgfile_msg (int level, size_t booksize) |
Generate a message drawn randomly from a file in lib/. | |
static void | new_text_name (object *book, int msgtype) |
Only for objects of type BOOK. | |
static int | nstrtok (const char *buf1, const char *buf2) |
Simple routine to return the number of list items in buf1 as separated by the value of buf2. | |
static char * | spellpath_msg (int level, char *retbuf, size_t booksize) |
Generate a message detailing the member incantations/prayers (and some of their properties) belonging to a random spellpath. | |
static char * | strtoktolin (const char *buf1, const char *buf2, char *retbuf, size_t size) |
Takes a string in buf1 and separates it into a list of strings delimited by buf2. | |
void | tailor_readable_ob (object *book, int msg_type) |
The main routine. | |
static int | unique_book (const object *book, int msgtype) |
Check to see if the book title/msg is unique. | |
void | write_book_archive (void) |
Write out the updated book archive to bookarch file. | |
Variables | |
static const char *const | art_author [] |
Used by artifact texts. | |
static const char *const | art_book_name [] |
Book titles for artifact information. | |
static const arttypename | art_name_array [] |
Artiface/item information. | |
static const char *const | book_author [] |
Used by 'generic' books. | |
static const char *const | book_descrpt [] |
Book descriptions. | |
static titlelist * | booklist = NULL |
booklist is the buffer of books read in from the bookarch file. | |
static objectlink * | first_mon_info = NULL |
Information on monsters. | |
static linked_char * | first_msg = NULL |
first_msg is the started of the linked list of messages as read from the messages file | |
static const char *const | formula_author [] |
This isn't used except for empty books. | |
static const char *const | formula_book_name [] |
Alchemy (formula) information. | |
static const char *const | gods_author [] |
Used by gods texts. | |
static const char *const | gods_book_name [] |
God book information. | |
static const char *const | heavy_book_name [] |
Name for big books. | |
static const int | last_readable_subtype = arraysize(readable_message_types) |
Number of elements in readable_message_types. | |
static const char *const | light_book_name [] |
Generic book information. | |
static const int | max_titles [6] |
Number of titles for different name lists. | |
static const char *const | mon_author [] |
Used by monster beastuary texts. | |
static const char *const | mon_book_name [] |
Monster book information. | |
static int | need_to_write_bookarchive = 0 |
static int | nrofmon = 0 |
these are needed for creation of a linked list of pointers to all (hostile) monster objects | |
static int | nrofmsg = 0 |
this is needed to keep track of status of initialization of the message file | |
static const char *const | path_author [] |
Used by spellpath texts. | |
static const char *const | path_book_name [] |
Book names for path information. | |
static const readable_message_type | readable_message_types [] |
Each line of this array is a readable subtype Be careful to keep the order. | |
static const uint32 | spellpathdef [NRSPELLPATHS] |
Spellpath information. |
This file contains code relevant to the BOOKS hack -- designed to allow randomly occuring messages in non-magical texts.
Definition in file readable.c.
#define arraysize | ( | arrayname | ) | (sizeof(arrayname)/sizeof(*(arrayname))) |
Returns the element size of an array.
arrayname | the array's name |
Definition at line 97 of file readable.c.
Referenced by add_author(), artifact_msg(), change_book(), get_titlelist(), init_book_archive(), make_formula_book(), and new_text_name().
#define MAX_TITLE_CHECK 20 |
How many times to try to generate a unique name for a book.
Definition at line 82 of file readable.c.
Referenced by change_book().
#define MSGTYPE_ALCHEMY 4 |
Definition at line 88 of file readable.c.
Referenced by add_author(), make_formula_book(), new_text_name(), and tailor_readable_ob().
#define MSGTYPE_ARTIFACT 2 |
Definition at line 86 of file readable.c.
Referenced by add_author(), new_text_name(), and tailor_readable_ob().
#define MSGTYPE_GODS 5 |
Definition at line 89 of file readable.c.
Referenced by add_author(), new_text_name(), and tailor_readable_ob().
#define MSGTYPE_LIB 0 |
Definition at line 84 of file readable.c.
Referenced by tailor_readable_ob().
#define MSGTYPE_MONSTER 1 |
Definition at line 85 of file readable.c.
Referenced by add_author(), new_text_name(), and tailor_readable_ob().
#define MSGTYPE_MSGFILE 6 |
Definition at line 90 of file readable.c.
Referenced by add_author(), and new_text_name().
#define MSGTYPE_SPELLPATH 3 |
Definition at line 87 of file readable.c.
Referenced by add_author(), new_text_name(), and tailor_readable_ob().
typedef struct namebytype arttypename |
special structure, used only by art_name_array[]
typedef struct titlestruct title |
'title' and 'titlelist' are used by the readable code
typedef struct titleliststruct titlelist |
static void add_author | ( | object * | op, |
int | msgtype | ||
) | [static] |
A lot like new_text_name() above, but instead chooses an author and sets op->title to that value.
op | book to alter. |
msgtype | information we want. |
Definition at line 1072 of file readable.c.
References add_string(), arraysize, art_author, book_author, formula_author, gods_author, MAX_BUF, mon_author, MSGTYPE_ALCHEMY, MSGTYPE_ARTIFACT, MSGTYPE_GODS, MSGTYPE_MONSTER, MSGTYPE_MSGFILE, MSGTYPE_SPELLPATH, path_author, and snprintf().
Referenced by change_book(), and make_formula_book().
Appends a book to the booklist.
book | the book to add |
type | the book type |
fname | the file name; for error messages |
lineno | the line number; for error messages |
Definition at line 902 of file readable.c.
References titleliststruct::first_book, get_titlelist(), llevInfo, LOG(), titlestruct::next, and titleliststruct::number.
Referenced by init_book_archive().
static void add_book_to_list | ( | const object * | book, |
int | msgtype | ||
) | [static] |
Adds a book to the list of existing books.
book | book to add. |
msgtype | what information the book contains. |
Definition at line 1144 of file readable.c.
References add_string(), titlestruct::archname, titlestruct::authour, titleliststruct::first_book, get_empty_book(), get_titlelist(), titlestruct::level, llevDebug, llevError, LOG(), titlestruct::msg_index, titlestruct::name, need_to_write_bookarchive, titlestruct::next, titleliststruct::number, titlestruct::size, and strtoint().
Referenced by change_book().
static char* artifact_msg | ( | int | level, |
char * | retbuf, | ||
size_t | booksize | ||
) | [static] |
Generate a message detailing the properties of 1-6 artifacts drawn sequentially from the artifact list.
level | level of the book. |
retbuf | buffer to contain the description. Must be at least booksize chars. |
booksize | length of the book. |
Definition at line 1477 of file readable.c.
References add_abilities(), artifactstruct::allowed, arraysize, BOOK_BUF, book_overflow(), artifactstruct::chance, describe_item(), find_artifactlist(), FLAG_IDENTIFIED, free_object(), get_object(), artifactstruct::item, artifactliststruct::items, llevDebug, LOG(), logfile, MAX_BUF, linked_char::name, artifactstruct::next, linked_char::next, SET_FLAG, snprintf(), artifactliststruct::total_chance, and namebytype::type.
Referenced by tailor_readable_ob().
int book_overflow | ( | const char * | buf1, |
const char * | buf2, | ||
size_t | booksize | ||
) |
Checks if buf1 and buf2 can be combined.
buf1 | |
buf2 | buffer we plan on combining. |
booksize | maximum book size. |
Definition at line 696 of file readable.c.
References BOOK_BUF, and buf_overflow().
Referenced by artifact_msg(), god_info_msg(), mon_info_msg(), msgfile_msg(), spellpath_msg(), and write_note().
static void change_book | ( | object * | book, |
int | msgtype | ||
) | [static] |
Give a new, fancier name to generated objects of type BOOK and SPELLBOOK.
Aug 96 I changed this so we will attempt to create consistent authour/title and message content for BOOKs. Also, we will alter books that match archive entries to the archival levels and architypes. -b.t.
book | book to alter. Should be of type BOOK. |
msgtype | what information the book contains. |
Definition at line 1186 of file readable.c.
References add_author(), add_book_to_list(), add_string(), titlestruct::archname, arraysize, titlestruct::authour, BOOK, book_descrpt, copy_object(), create_archetype(), find_title(), free_object(), free_string(), get_titlelist(), titlestruct::level, llevDebug, llevError, LOG(), MAX_BUF, MAX_TITLE_CHECK, max_titles, titlestruct::name, new_text_name(), titleliststruct::number, snprintf(), and unique_book().
Referenced by tailor_readable_ob().
static title* find_title | ( | const object * | book, |
int | msgtype | ||
) | [static] |
Search the titlelist (based on msgtype) to see if book matches something already there.
IF so, return that title.
book | book we're searching. |
msgtype | message type. |
Definition at line 984 of file readable.c.
References titlestruct::authour, titleliststruct::first_book, get_titlelist(), llevDebug, LOG(), titlestruct::msg_index, titlestruct::name, titlestruct::next, titlestruct::size, and strtoint().
Referenced by change_book().
void free_all_readable | ( | void | ) |
Definition at line 2084 of file readable.c.
References titlestruct::archname, titlestruct::authour, titleliststruct::first_book, first_mon_info, free_string(), llevDebug, LOG(), titlestruct::name, linked_char::name, titlestruct::next, titleliststruct::next, and linked_char::next.
Referenced by cleanup().
static title* get_empty_book | ( | void | ) | [static] |
Creates a title.
Definition at line 580 of file readable.c.
References titlestruct::archname, titlestruct::authour, fatal(), titlestruct::level, titlestruct::msg_index, titlestruct::name, titlestruct::next, OUT_OF_MEMORY, and titlestruct::size.
Referenced by add_book_to_list(), and init_book_archive().
static titlelist* get_empty_booklist | ( | void | ) | [static] |
Creates a titlelist.
Definition at line 560 of file readable.c.
References fatal(), titleliststruct::first_book, titleliststruct::next, titleliststruct::number, and OUT_OF_MEMORY.
Referenced by get_titlelist(), and init_book_archive().
static object* get_next_mon | ( | const object * | tmp | ) | [static] |
This function returns the next monster after 'tmp' in the monster list.
tmp | monster. |
Definition at line 1400 of file readable.c.
References first_mon_info, and mon.
Referenced by mon_info_msg().
object* get_random_mon | ( | int | level | ) |
Returns a random monster selected from linked list of all monsters in the current game.
Changed 971225 to be greater than equal to level passed. Also made choosing by level more random.
level | if non-zero, then only monsters greater than that level will be returned. |
Definition at line 1316 of file readable.c.
References first_mon_info, llevError, LOG(), mon, and nrofmon.
Referenced by alchemy_failure_effect(), and mon_info_msg().
const readable_message_type* get_readable_message_type | ( | object * | readable | ) |
Get the readable type for an object (hopefully book).
readable | object for which we want the readable type. |
Definition at line 2181 of file readable.c.
References last_readable_subtype.
Referenced by apply_sign(), and book_type_apply().
static titlelist* get_titlelist | ( | int | i | ) | [static] |
Gets the ith titlelist.
Will create items if they don't exist.
i | index to get. |
Definition at line 605 of file readable.c.
References arraysize, booklist, get_empty_booklist(), llevInfo, LOG(), max_titles, and titleliststruct::next.
Referenced by add_book(), add_book_to_list(), change_book(), find_title(), unique_book(), and write_book_archive().
static char* god_info_msg | ( | int | level, |
char * | retbuf, | ||
size_t | booksize | ||
) | [static] |
Generate a message detailing the properties of a random god.
Used by the book hack. b.t.
level | number of elements to give. |
retbuf | buffer that will contain the description. Must be at least length chars. |
booksize | desired length of the book. |
Definition at line 1813 of file readable.c.
References attacktype_desc, BOOK_BUF, book_overflow(), DESCRIBE_PATH_SAFE, describe_resistance(), get_rand_god(), llevDebug, llevError, LOG(), logfile, MAX_BUF, NROFATTACKS, nstrtok(), PATH_SUMMON, PATH_TURNING, pntr_to_god_obj(), safe_strcat(), snprintf(), and strtoktolin().
Referenced by tailor_readable_ob().
static void init_book_archive | ( | void | ) | [static] |
If not called before, initialize the info list.
This reads in the bookarch file into memory. bookarch is the file created and updated across multiple runs of the program.
Definition at line 784 of file readable.c.
References add_book(), add_string(), titlestruct::archname, arraysize, titlestruct::authour, close_and_delete(), get_empty_book(), get_empty_booklist(), titlestruct::level, llevDebug, llevInfo, Settings::localdir, LOG(), MAX_BUF, max_titles, titlestruct::msg_index, titlestruct::name, titleliststruct::next, titleliststruct::number, open_and_uncompress(), settings, titlestruct::size, and snprintf().
Referenced by init_readable().
static void init_mon_info | ( | void | ) | [static] |
Creates the linked list of pointers to monster archetype objects if not called previously.
Definition at line 920 of file readable.c.
References first_archetype, first_mon_info, FLAG_CHANGING, FLAG_MONSTER, FLAG_UNAGGRESSIVE, llevDebug, llevError, LOG(), mon, nrofmon, and QUERY_FLAG.
Referenced by init_readable().
static void init_msgfile | ( | void | ) | [static] |
If not called before, initialize the info list.
Reads the messages file into the list pointed to by first_msg
Definition at line 714 of file readable.c.
References add_string(), BOOK_BUF, buf_overflow(), close_and_delete(), Settings::datadir, first_msg, HUGE_BUF, llevDebug, llevInfo, LOG(), MAX_BUF, linked_char::name, linked_char::next, nrofmsg, open_and_uncompress(), settings, and snprintf().
Referenced by init_readable().
void init_readable | ( | void | ) |
Initialize linked lists utilized by message functions in tailor_readable_ob()
This is the function called by the main routine to initialize all the readable information.
Definition at line 952 of file readable.c.
References init_book_archive(), init_mon_info(), init_msgfile(), llevDebug, and LOG().
Referenced by init_beforeplay(), and main().
static void make_formula_book | ( | object * | book, |
int | level | ||
) | [static] |
Generate a message detailing the properties of a randomly selected alchemical formula.
book | book we write to. |
level | level for formulaes and such. |
Definition at line 1656 of file readable.c.
References add_author(), add_string(), recipestruct::arch_name, recipestruct::arch_names, arraysize, BOOK_BUF, recipestruct::cauldron, recipestruct::chance, find_archetype(), formula_book_name, free_string(), get_formulalist(), recipestruct::ingred, recipeliststruct::items, llevError, LOG(), MAX_BUF, MSGTYPE_ALCHEMY, linked_char::name, new_text_name(), recipestruct::next, linked_char::next, query_name(), recipestruct::skill, snprintf(), recipestruct::title, and recipeliststruct::total_chance.
Referenced by tailor_readable_ob().
static char* mon_desc | ( | const object * | mon, |
char * | buf, | ||
size_t | size | ||
) | [static] |
Returns a description of the monster.
This really needs to be redone, as describe_item really gives a pretty internal description.
mon | monster to describe. |
buf | buffer that will contain the description. |
size | buf's length. |
Definition at line 1383 of file readable.c.
References describe_item(), and snprintf().
Referenced by mon_info_msg().
static char* mon_info_msg | ( | int | level, |
char * | buf, | ||
size_t | booksize | ||
) | [static] |
Generate a message detailing the properties of randomly monster(s).
level | book level. |
buf | buffer that will contain the message. Must be at least of length booksize |
booksize | size (in characters) of the book we want. |
Definition at line 1429 of file readable.c.
References book_overflow(), get_next_mon(), get_random_mon(), HUGE_BUF, llevDebug, LOG(), logfile, MAX_BUF, mon_desc(), and snprintf().
Referenced by tailor_readable_ob().
static char* msgfile_msg | ( | int | level, |
size_t | booksize | ||
) | [static] |
Generate a message drawn randomly from a file in lib/.
Level currently has no effect on the message which is returned.
level | (ignored) |
booksize | length of the book we want. |
Definition at line 1774 of file readable.c.
References BOOK_BUF, book_overflow(), first_msg, llevDebug, LOG(), linked_char::name, linked_char::next, nrofmsg, and snprintf().
Referenced by tailor_readable_ob().
static void new_text_name | ( | object * | book, |
int | msgtype | ||
) | [static] |
Only for objects of type BOOK.
SPELLBOOK stuff is handled directly in change_book_name(). Names are based on text msgtype
This sets book book->name based on msgtype given. What name is given is based on various criteria
book | book we want to alter. |
msgtype | what information we want in the book. |
Definition at line 1023 of file readable.c.
References add_string(), arraysize, art_book_name, BOOK, formula_book_name, free_string(), gods_book_name, heavy_book_name, light_book_name, mon_book_name, MSGTYPE_ALCHEMY, MSGTYPE_ARTIFACT, MSGTYPE_GODS, MSGTYPE_MONSTER, MSGTYPE_MSGFILE, MSGTYPE_SPELLPATH, and path_book_name.
Referenced by change_book(), and make_formula_book().
static int nstrtok | ( | const char * | buf1, |
const char * | buf2 | ||
) | [static] |
Simple routine to return the number of list items in buf1 as separated by the value of buf2.
buf1 | items we want to split. |
buf2 | what to split by. |
Definition at line 636 of file readable.c.
References MAX_BUF, and snprintf().
Referenced by god_info_msg(), and strtoktolin().
static char* spellpath_msg | ( | int | level, |
char * | retbuf, | ||
size_t | booksize | ||
) | [static] |
Generate a message detailing the member incantations/prayers (and some of their properties) belonging to a random spellpath.
level | level of the book. |
retbuf | buffer to write the description into. |
booksize | length of the book. |
Definition at line 1607 of file readable.c.
References book_overflow(), first_archetype, NRSPELLPATHS, snprintf(), SPELL, spellpathdef, and spellpathnames.
Referenced by tailor_readable_ob().
static char* strtoktolin | ( | const char * | buf1, |
const char * | buf2, | ||
char * | retbuf, | ||
size_t | size | ||
) | [static] |
Takes a string in buf1 and separates it into a list of strings delimited by buf2.
Then returns a comma separated string w/ decent punctuation.
buf1 | buffer to split. |
buf2 | what to split buf1 by. |
retbuf | where to write the resulting string. |
size | length of retbuf. |
Definition at line 666 of file readable.c.
References MAX_BUF, nstrtok(), and snprintf().
Referenced by god_info_msg().
void tailor_readable_ob | ( | object * | book, |
int | msg_type | ||
) |
The main routine.
This chooses a random message to put in given readable object (type==BOOK) which will be referred hereafter as a 'book'. We use the book level to de- termine the value of the information we will insert. Higher values mean the book will (generally) have better/more info. See individual cases as to how this will be utilized. "Book" name/content length are based on the weight of the document. If the value of msg_type is negative, we will randomly choose the kind of message to generate. -b.t. thomas@astro.psu.edu
book | the object we are creating into. Must be a book, can have a level. |
msg_type | if it is a positive value, we use that to determine the message type - otherwise a random value is used. |
Definition at line 2010 of file readable.c.
References add_string(), artifact_msg(), BOOK, BOOK_BUF, BOOKSIZE, change_book(), free_string(), god_info_msg(), make_formula_book(), mon_info_msg(), msgfile_msg(), MSGTYPE_ALCHEMY, MSGTYPE_ARTIFACT, MSGTYPE_GODS, MSGTYPE_LIB, MSGTYPE_MONSTER, MSGTYPE_SPELLPATH, and spellpath_msg().
Referenced by fix_generated_item().
static int unique_book | ( | const object * | book, |
int | msgtype | ||
) | [static] |
Check to see if the book title/msg is unique.
We go through the entire list of possibilities each time. If we find a match, then unique_book returns true (because inst unique).
book | book we're searching. |
msgtype | type of information contained. |
Definition at line 1120 of file readable.c.
References titlestruct::authour, get_titlelist(), titlestruct::name, and titlestruct::next.
Referenced by change_book().
void write_book_archive | ( | void | ) |
Write out the updated book archive to bookarch file.
Definition at line 2127 of file readable.c.
References titlestruct::archname, titlestruct::authour, titleliststruct::first_book, get_titlelist(), titlestruct::level, llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, titlestruct::msg_index, titlestruct::name, need_to_write_bookarchive, titlestruct::next, titleliststruct::next, SAVE_MODE, settings, titlestruct::size, and snprintf().
Referenced by cleanup(), and do_specials().
const char* const art_author[] [static] |
{ "ancient things", "artifacts", "Havlor", "items", "lost artifacts", "the ancients", "useful things" }
Used by artifact texts.
Definition at line 249 of file readable.c.
Referenced by add_author().
const char* const art_book_name[] [static] |
{ "collection", "file", "files", "guide", "handbook", "index", "inventory", "list", "listing", "record", "record book" }
Book titles for artifact information.
Definition at line 234 of file readable.c.
Referenced by new_text_name().
const arttypename art_name_array[] [static] |
{ { "Helmet", HELMET }, { "Amulet", AMULET }, { "Shield", SHIELD }, { "Bracers", BRACERS }, { "Boots", BOOTS }, { "Cloak", CLOAK }, { "Gloves", GLOVES }, { "Gridle", GIRDLE }, { "Ring", RING }, { "Horn", HORN }, { "Missile Weapon", BOW }, { "Missile", ARROW }, { "Hand Weapon", WEAPON }, { "Artifact", SKILL }, { "Food", FOOD }, { "Body Armour", ARMOUR } }
Artiface/item information.
if it isnt listed here, then art_attr_msg() will never generate a message for this type of artifact. -b.t.
Definition at line 214 of file readable.c.
const char* const book_author[] [static] |
const char* const book_descrpt[] [static] |
{ "ancient", "cryptic", "cryptical", "dusty", "hiearchical", "grizzled", "gold-guilt", "great", "lost", "magnificent", "musty", "mythical", "mystical", "rustic", "stained", "silvered", "transcendental", "weathered" }
Book descriptions.
Definition at line 440 of file readable.c.
Referenced by change_book().
booklist is the buffer of books read in from the bookarch file.
It's element size does not exceed arraysize(max_titles).
Definition at line 132 of file readable.c.
Referenced by get_titlelist().
objectlink* first_mon_info = NULL [static] |
Information on monsters.
Definition at line 135 of file readable.c.
Referenced by free_all_readable(), get_next_mon(), get_random_mon(), and init_mon_info().
linked_char* first_msg = NULL [static] |
first_msg is the started of the linked list of messages as read from the messages file
Definition at line 153 of file readable.c.
Referenced by init_msgfile(), and msgfile_msg().
const char* const formula_author[] [static] |
{ "Albertus Magnus", "alchemy", "balms", "creation", "dusts", "magical manufacture", "making", "philosophical items", "potions", "powders", "the cauldron", "the lamp black", "transmutation", "waters" }
This isn't used except for empty books.
Definition at line 342 of file readable.c.
Referenced by add_author().
const char* const formula_book_name[] [static] |
{ "cookbook", "formulary", "lab book", "lab notes", "recipe book", "experiment record", "work plan", "design notes" }
Alchemy (formula) information.
Definition at line 330 of file readable.c.
Referenced by make_formula_book(), and new_text_name().
const char* const gods_author[] [static] |
{ "cults", "joy", "lasting curse", "madness", "religions", "the dead", "the gods", "the heirophant", "the poor priest", "the priestess", "pain", "white" }
Used by gods texts.
Definition at line 312 of file readable.c.
Referenced by add_author().
const char* const gods_book_name[] [static] |
{ "devotional", "devout notes", "divine text", "divine work", "holy book", "holy record", "moral text", "sacred guide", "testament", "transcript" }
God book information.
Definition at line 298 of file readable.c.
Referenced by new_text_name().
const char* const heavy_book_name[] [static] |
{ "catalog", "compendium", "guide", "manual", "opus", "tome", "treatise", "volume", "work" }
Name for big books.
Definition at line 381 of file readable.c.
Referenced by new_text_name().
const int last_readable_subtype = arraysize(readable_message_types) [static] |
Number of elements in readable_message_types.
Definition at line 533 of file readable.c.
Referenced by get_readable_message_type().
const char* const light_book_name[] [static] |
{ "calendar", "datebook", "diary", "guidebook", "handbook", "ledger", "notes", "notebook", "octavo", "pamphlet", "practicum", "script", "transcript" }
Generic book information.
Used by msg file and 'generic' books
Definition at line 364 of file readable.c.
Referenced by new_text_name().
const int max_titles[6] [static] |
{ (arraysize(light_book_name)+arraysize(heavy_book_name))*arraysize(book_author), arraysize(mon_book_name)*arraysize(mon_author), arraysize(art_book_name)*arraysize(art_author), arraysize(path_book_name)*arraysize(path_author), arraysize(formula_book_name)*arraysize(formula_author), arraysize(gods_book_name)*arraysize(gods_author), }
Number of titles for different name lists.
Definition at line 536 of file readable.c.
Referenced by change_book(), get_titlelist(), and init_book_archive().
const char* const mon_author[] [static] |
{ "beasts", "creatures", "dezidens", "dwellers", "evil nature", "life", "monsters", "nature", "new life", "residents", "the spawn", "the living", "things" }
Used by monster beastuary texts.
Definition at line 279 of file readable.c.
Referenced by add_author().
const char* const mon_book_name[] [static] |
{ "beastuary", "catalog", "compilation", "collection", "encyclopedia", "guide", "handbook", "list", "manual", "notes", "record", "register", "volume" }
Monster book information.
Definition at line 262 of file readable.c.
Referenced by new_text_name().
int need_to_write_bookarchive = 0 [static] |
Definition at line 141 of file readable.c.
Referenced by add_book_to_list(), and write_book_archive().
int nrofmon = 0 [static] |
these are needed for creation of a linked list of pointers to all (hostile) monster objects
Definition at line 141 of file readable.c.
Referenced by get_random_mon(), and init_mon_info().
int nrofmsg = 0 [static] |
this is needed to keep track of status of initialization of the message file
Definition at line 147 of file readable.c.
Referenced by init_msgfile(), and msgfile_msg().
const char* const path_author[] [static] |
{ "aether", "astral byways", "connections", "the Grey Council", "deep pathways", "knowledge", "magic", "mystic ways", "pathways", "power", "spells", "transforms", "the mystic veil", "unknown spells" }
Used by spellpath texts.
Definition at line 191 of file readable.c.
Referenced by add_author().
const char* const path_book_name[] [static] |
{ "codex", "compendium", "exposition", "tables", "treatise" }
Book names for path information.
Definition at line 182 of file readable.c.
Referenced by new_text_name().
const readable_message_type readable_message_types[] [static] |
Each line of this array is a readable subtype Be careful to keep the order.
If you add readable subtype, add them at the bottom of the list. Never delete a subtype because index is used as subtype parameter in arch files!
Definition at line 467 of file readable.c.
const uint32 spellpathdef[NRSPELLPATHS] [static] |
{ PATH_PROT, PATH_FIRE, PATH_FROST, PATH_ELEC, PATH_MISSILE, PATH_SELF, PATH_SUMMON, PATH_ABJURE, PATH_RESTORE, PATH_DETONATE, PATH_MIND, PATH_CREATE, PATH_TELE, PATH_INFO, PATH_TRANSMUTE, PATH_TRANSFER, PATH_TURNING, PATH_WOUNDING, PATH_DEATH, PATH_LIGHT }
Spellpath information.
Definition at line 158 of file readable.c.
Referenced by spellpath_msg().