|
Atrinik Server 2.5
|
Go to the source code of this file.
Data Structures | |
| struct | namebytype |
Typedefs | |
| typedef struct namebytype | arttypename |
Functions | |
| int | book_overflow (const char *buf1, const char *buf2, size_t booksize) |
| static void | init_msgfile () |
| static void | init_mon_info () |
| void | init_readable () |
| static void | new_text_name (object *book, int msgtype) |
| static void | add_author (object *op, int msgtype) |
| static void | change_book (object *book, int msgtype) |
| object * | get_random_mon () |
| static char * | mon_desc (object *mon, char *buf, size_t size) |
| static char * | mon_info_msg (char *buf, size_t booksize) |
| static char * | artifact_msg (int level, char *buf, size_t booksize) |
| static char * | spellpath_msg (int level, char *buf, size_t booksize) |
| static char * | msgfile_msg (size_t booksize) |
| void | tailor_readable_ob (object *book, int msg_type) |
| void | free_all_readable () |
Variables | |
| static object ** | monsters = NULL |
| static size_t | num_monsters = 0 |
| static char ** | msgs = NULL |
| static size_t | num_msgs = 0 |
| static uint32 | spellpathdef [NRSPELLPATHS] |
| static char * | path_book_name [] |
| static char * | path_author [] |
| static arttypename | art_name_array [] |
| static char * | art_book_name [] |
| static char * | art_author [] |
| static char * | mon_book_name [] |
| static char * | mon_author [] |
| static char * | book_name [] |
| static char * | book_author [] |
This file contains code relevant to allow randomly occurring messages in non-magical texts.
Definition in file readable.c.
| typedef struct namebytype arttypename |
special structure, used only by art_name_array[]
| static void add_author | ( | object * | op, |
| int | msgtype | ||
| ) | [static] |
A lot like new_text_name(), but instead chooses an author and sets op->title to that value.
| op | The book object. |
| msgtype | Message type. |
Definition at line 483 of file readable.c.
| static char* artifact_msg | ( | int | level, |
| char * | buf, | ||
| 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 |
| buf | Buffer to contain the description. |
| booksize | Length of the book. |
Definition at line 602 of file readable.c.
| int book_overflow | ( | const char * | buf1, |
| const char * | buf2, | ||
| size_t | booksize | ||
| ) |
Checks if book will overflow.
| buf1 | |
| buf2 | Buffers we plan on combining. |
| booksize | Maximum book size. |
Definition at line 312 of file readable.c.
| static void change_book | ( | object * | book, |
| int | msgtype | ||
| ) | [static] |
Give a new, fancier name to generated objects of type BOOK and SPELLBOOK.
Will attempt to create consistent author/title and message content for BOOKs. Also, will alter books that match archive entries to the archival levels and archetypes.
| book | The book object to alter. |
| msgtype | Message type to make. |
Definition at line 525 of file readable.c.
| void free_all_readable | ( | ) |
Cleanup routine for readable stuff.
Definition at line 882 of file readable.c.
| object* get_random_mon | ( | ) |
Returns a random monster from all the monsters in the game.
Definition at line 541 of file readable.c.
| static void init_mon_info | ( | ) | [static] |
Initialize array of monsters.
Definition at line 406 of file readable.c.
| static void init_msgfile | ( | ) | [static] |
Reads the messages file into the list pointed to by first_msg.
Definition at line 325 of file readable.c.
| void init_readable | ( | ) |
Initializes 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 429 of file readable.c.
| static char* mon_desc | ( | object * | mon, |
| char * | buf, | ||
| size_t | size | ||
| ) | [static] |
Returns a description of the monster.
| mon | Monster to describe. |
| buf | Buffer that will contain the description. |
| size | Size of 'buf'. |
Definition at line 558 of file readable.c.
| static char* mon_info_msg | ( | char * | buf, |
| size_t | booksize | ||
| ) | [static] |
Generate a message detailing the properties of randomly selected monsters.
| buf | Buffer that will contain the message. |
| booksize | Size (in characters) of the book we want. |
Definition at line 570 of file readable.c.
| static char* msgfile_msg | ( | size_t | booksize | ) | [static] |
Generate a message drawn randomly from a file in lib/.
| booksize | Maximum book size. |
Definition at line 792 of file readable.c.
| 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 | The book object. |
| msgtype | Message type. |
Definition at line 446 of file readable.c.
| static char* spellpath_msg | ( | int | level, |
| char * | buf, | ||
| 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. |
| buf | Buffer to write the description into. |
| booksize | Length of the book. |
Definition at line 728 of file readable.c.
| 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.
| book | The object we are creating into. |
| msg_type | If this is a positive value, we use it to determine the message type - otherwise a random value is used. |
Definition at line 830 of file readable.c.
char* art_author[] [static] |
{
"ancient things",
"artifacts",
"Havlor",
"items",
"lost artifacts",
"the ancients",
"useful things"
}
Used by artifact texts
Definition at line 182 of file readable.c.
char* art_book_name[] [static] |
{
"collection",
"file",
"files",
"guide",
"handbook",
"index",
"inventory",
"list",
"listing",
"record",
"record book"
}
Artifact book information
Definition at line 166 of file readable.c.
arttypename art_name_array[] [static] |
{
{"Helmet", HELMET},
{"Amulet", AMULET},
{"Shield", SHIELD},
{"Bracers", BRACERS},
{"Boots", BOOTS},
{"Cloak", CLOAK},
{"Gloves", GLOVES},
{"Girdle", GIRDLE},
{"Ring", RING},
{"Horn", HORN},
{"Missile Weapon", BOW},
{"Missile", ARROW},
{"Hand Weapon", WEAPON},
{"Artifact", SKILL},
{"Food", FOOD},
{"Body Armour", ARMOUR}
}
Artifact/item information
If it isn't listed here, then art_attr_msg will never generate a message for this type of artifact.
Definition at line 145 of file readable.c.
char* book_author[] [static] |
Used by 'generic' books
Definition at line 258 of file readable.c.
char* book_name[] [static] |
{
"calendar",
"datebook",
"diary",
"guidebook",
"handbook",
"ledger",
"notes",
"notebook",
"octavo",
"pamphlet",
"practicum",
"script",
"transcript",
"catalog",
"compendium",
"guide",
"manual",
"opus",
"tome",
"treatise",
"volume",
"work"
}
Generic book information.
Definition at line 231 of file readable.c.
char* mon_author[] [static] |
{
"beasts",
"creatures",
"dezidens",
"dwellers",
"evil nature",
"life",
"monsters",
"nature",
"new life",
"residents",
"the spawn",
"the living",
"things"
}
Used by monster bestiary texts
Definition at line 212 of file readable.c.
char* mon_book_name[] [static] |
{
"bestiary",
"catalog",
"compilation",
"collection",
"encyclopedia",
"guide",
"handbook",
"list",
"manual",
"notes",
"record",
"register",
"volume"
}
Monster book information
Definition at line 194 of file readable.c.
Array of all the monsters.
Definition at line 52 of file readable.c.
char** msgs = NULL [static] |
Array of the messages as read from the messages file.
Definition at line 59 of file readable.c.
size_t num_monsters = 0 [static] |
Number of the monsters.
Definition at line 55 of file readable.c.
size_t num_msgs = 0 [static] |
Number of msgs.
Definition at line 62 of file readable.c.
char* 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",
"cults",
"joy",
"lasting curse",
"madness",
"religions",
"the dead",
"the gods",
"the heirophant",
"the poor priest",
"the priestess",
"pain",
"white"
}
Used by spellpath texts
Definition at line 110 of file readable.c.
char* path_book_name[] [static] |
{
"codex",
"compendium",
"exposition",
"tables",
"treatise",
"devotional",
"devout notes",
"divine text",
"divine work",
"holy book",
"holy record",
"moral text",
"sacred guide",
"testament",
"transcript"
}
Path book information
Definition at line 90 of file readable.c.
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 65 of file readable.c.
1.7.4