76 #define MAX_TITLE_CHECK 20 81 #define MSGTYPE_MONSTER 1 83 #define MSGTYPE_ARTIFACT 2 85 #define MSGTYPE_SPELLPATH 3 87 #define MSGTYPE_ALCHEMY 4 89 #define MSGTYPE_GODS 5 91 #define MSGTYPE_MSGFILE 6 98 #define arraysize(arrayname) (sizeof(arrayname)/sizeof(*(arrayname))) 133 static void add_book(
title *book,
int type,
const char *fname,
int lineno);
218 {
"Missile Weapon",
BOW },
219 {
"Missile",
ARROW },
220 {
"Hand Weapon",
WEAPON },
221 {
"Artifact",
SKILL },
362 "magical manufacture",
364 "philosophical items",
616 LOG(
llevInfo,
"Warning: invalid book index %d, using 0 instead\n", i);
620 for (tl = booklist, number = i; tl && number; tl = tl->
next, number--) {
642 int nstrtok(
const char *buf1,
const char *buf2) {
649 strlcpy(buf, buf1,
sizeof(buf));
650 for (tbuf = strtok(buf, buf2); tbuf; tbuf = strtok(NULL, buf2)) {
662 while ((*buf) ==
' ') {
685 int maxi, i =
nstrtok(buf1, buf2);
689 strlcpy(buf, buf1,
sizeof(buf));
690 snprintf(retbuf, size,
" ");
691 for (tbuf = strtok(buf, buf2); tbuf && i > 0; tbuf = strtok(NULL, buf2)) {
692 snprintf(retbuf+strlen(retbuf), size-strlen(retbuf),
"%s",
trim(tbuf));
694 if (i == 1 && maxi > 1)
695 snprintf(retbuf+strlen(retbuf), size-strlen(retbuf),
" and ");
696 else if (i > 0 && maxi > 1)
697 snprintf(retbuf+strlen(retbuf), size-strlen(retbuf),
", ");
700 int end = strlen(retbuf);
701 if (retbuf[end-1] ==
'\n')
703 snprintf(retbuf+end, size-end,
".");
740 #ifdef BOOK_MSG_DEBUG 744 static int did_init_barch = 0;
754 LOG(
llevDebug,
" Reading bookarch from %s...\n", fname);
756 fp = fopen(fname,
"r");
768 for (lineno = 1; fgets(buf,
MAX_BUF, fp) != NULL; lineno++) {
774 cp = strchr(buf,
'\n');
776 while (cp > buf && (cp[-1] ==
' ' || cp[-1] ==
'\t'))
781 if (strncmp(buf,
"title ", 6) == 0) {
784 while (*cp ==
' ' || *cp ==
'\t')
787 LOG(
llevInfo,
"Warning: missing book title at %s, line %d\n", fname, lineno);
793 #ifdef BOOK_MSG_DEBUG 797 }
else if (book == NULL) {
800 LOG(
llevInfo,
"Warning: expecting 'title' at %s, line %d\n", fname, lineno);
802 }
else if (strncmp(buf,
"authour ", 8) == 0) {
804 while (*cp ==
' ' || *cp ==
'\t')
807 LOG(
llevInfo,
"Warning: missing book authour at %s, line %d\n", fname, lineno);
811 }
else if (strncmp(buf,
"arch ", 5) == 0) {
813 while (*cp ==
' ' || *cp ==
'\t')
816 LOG(
llevInfo,
"Warning: missing book arch at %s, line %d\n", fname, lineno);
820 }
else if (sscanf(buf,
"level %d%n", &value, &len) == 1 && len == (
int)strlen(buf)) {
822 }
else if (sscanf(buf,
"type %d%n", &value, &len) == 1 && len == (
int)strlen(buf)) {
824 }
else if (sscanf(buf,
"size %d%n", &value, &len) == 1 && len == (
int)strlen(buf)) {
826 }
else if (sscanf(buf,
"index %d%n", &value, &len) == 1 && len == (
int)strlen(buf)) {
828 }
else if (strcmp(buf,
"end") == 0) {
829 add_book(book, type, fname, lineno);
833 LOG(
llevInfo,
"Warning: syntax error at %s, line %d\n", fname, lineno);
837 LOG(
llevInfo,
"Warning: missing 'end' at %s, line %d\n", fname, lineno);
838 add_book(book, type, fname, lineno);
847 #ifdef BOOK_MSG_DEBUG 848 LOG(
llevDebug,
"\n init_book_archive() got %d titles.\n", nroftitle);
860 static void add_book(
title *book,
int type,
const char *fname,
int lineno) {
864 LOG(
llevInfo,
"Warning: book with no type at %s, line %d; using type 0\n", fname, lineno);
887 static int did_init_mon_info = 0;
889 if (did_init_mon_info)
891 did_init_mon_info = 1;
905 static int did_this = 0;
942 return (
title *)NULL;
946 return (
title *)NULL;
948 length = strlen(book->
msg);
958 return (
title *)NULL;
1003 if (book->
weight > 2000) {
1027 if (msgtype < 0 || strlen(op->
msg) < 5)
1056 snprintf(title,
sizeof(title),
"of %s", name);
1100 LOG(
llevError,
"add_book_to_list can't get booklist!\n");
1119 #ifdef ARCHIVE_DEBUG 1143 LOG(
llevError,
"change_book_name() called w/ illegal obj type.\n");
1157 if (strlen(book->
msg) > 5 && (t =
find_title(book, msgtype))) {
1176 const char *old_title;
1177 const char *old_name;
1187 LOG(
llevError,
"change_book_name(): can't find title list\n");
1192 if (numb == maxnames) {
1193 #ifdef ARCHIVE_DEBUG 1194 LOG(
llevDebug,
"titles for list %d full (%d possible).\n", msgtype, maxnames);
1201 else if (!book->
title)
1219 #ifdef ARCHIVE_DEBUG 1220 LOG(
llevDebug,
"Failed to obtain unique title for %s %s (names:%d/%d)\n", book->
name, book->
title, numb, maxnames);
1237 }
else if (book->
title && strlen(book->
msg) > 5) {
1241 if (old_title != NULL)
1273 return (
object *)NULL;
1279 std::vector<object *> select;
1280 std::copy_if(
monsters.cbegin(),
monsters.cend(), std::back_inserter(select), [&] (
auto ob) {
return ob->level >=
level; });
1282 if (select.empty()) {
1283 LOG(
llevError,
"get_random_mon() couldn't return monster for level %d\n", level);
1286 return select[
RANDOM() % select.size()];
1348 const char *sep =
":";
1440 else if (chance >= 10)
1442 else if (chance >= 5)
1491 if (book_entries > 5)
1502 type = art_name_array[index].
type;
1505 }
while (al == NULL && i < 10);
1514 auto iart = al->
items.cbegin();
1516 if (iart == al->
items.cend())
1517 iart = al->
items.cbegin();
1522 stringbuffer_append_printf(message,
"Herein %s detailed %s...\n", book_entries > 1 ?
"are" :
"is", book_entries > 1 ?
"some artifacts" :
"an artifact");
1528 while (book_entries > 0) {
1530 if (iart == al->
items.cend())
1531 iart = al->
items.cbegin();
1654 const char *op_name;
1675 for (formula = fl->
items; formula != NULL; formula = formula->
next) {
1676 chance -= formula->
chance;
1677 if (chance <= 0 && formula->chance != 0 && !formula->
is_combination)
1695 LOG(
llevError,
"formula_msg() can't find arch %s for formula.\n", op_name);
1708 formula->
diff >= 10 && formula->
diff < 15 ?
"n" :
"",
1710 formula->
skill ? formula->
skill :
"an unknown skill");
1713 if (strcmp(formula->
title,
"NONE")) {
1739 if (formula->
ingred != NULL) {
1748 snprintf(name,
sizeof(name),
"an unknown place");
1752 for (next = formula->
ingred; next != NULL; next = next->
next) {
1757 LOG(
llevError,
"formula_msg() no ingredient list for object %s of %s\n", op_name, formula->
title);
1785 if (msg && strlen(msg->
message) <= booksize) {
1791 snprintf(km,
sizeof(km),
"message:%s", msg->
identifier);
1804 #ifdef BOOK_MSG_DEBUG 1838 LOG(
llevError,
"common/readable.c:god_info_msg() - passed in booksize (%lu) is larger than book buffer (%d)\n", (
unsigned long)booksize,
BOOK_BUF);
1842 if (level >= 2 &&
RANDOM()%2) {
1845 if (level >= 3 &&
RANDOM()%2) {
1848 if (level >= 4 &&
RANDOM()%2) {
1851 if (level >= 5 &&
RANDOM()%2) {
1854 if (level >= 6 &&
RANDOM()%2) {
1857 if (level >= 8 &&
RANDOM()%2) {
1860 if (level >= 12 &&
RANDOM()%2) {
1872 snprintf(buf,
sizeof(buf),
"god:%s:%d", god->
name, what);
1901 size_t book_buf_size;
1913 book_buf_size -= strlen(
"\n");
1931 msg_type = msg_type > 0 ? msg_type : (int)(
RANDOM()%6);
1961 if (message != NULL) {
1983 title *title1, *titlenext;
1987 for (tlist = booklist; tlist != NULL; tlist = tnext) {
1988 tnext = tlist->
next;
1989 for (title1 = tlist->
first_book; title1; title1 = titlenext) {
1990 titlenext = title1->
next;
2025 LOG(
llevDebug,
"Updating book archive: %s...\n", fname);
2034 fprintf(fp,
"title %s\n", book->
name);
2035 fprintf(fp,
"authour %s\n", book->
authour);
2036 fprintf(fp,
"arch %s\n", book->
archname);
2037 fprintf(fp,
"level %d\n", book->
level);
2038 fprintf(fp,
"type %d\n", index);
2040 fprintf(fp,
"size %lu\n", (
unsigned long)book->
size);
2041 fprintf(fp,
"index %d\n", book->
msg_index);
2042 fprintf(fp,
"end\n");
2049 LOG(
llevError,
"Could not set permissions on '%s'\n", fname);
2063 uint8_t subtype = readable->
subtype;
2066 return &readable_message_types[0];
2067 return &readable_message_types[subtype];
2076 return message->
title;
2094 return message->
face;
#define MSG_TYPE_PAPER_SCROLL_OLD_1
#define MSG_TYPE_SIGN_DIR_LEFT
int book_overflow(const char *buf1, const char *buf2, size_t booksize)
Checks if buf1 and buf2 can be combined.
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
#define GOD_BLESSED
Write various information (resistances?).
static title * find_title(const object *book, int msgtype)
Search the titlelist (based on msgtype) to see if book matches something already there.
static object * get_next_mon(const object *tmp)
This function returns the next monster after 'tmp' in the monster list.
Spell-related defines: spellpath, subtypes, ...
static const char *const path_book_name[]
Book names for path information.
static const int last_readable_subtype
Number of elements in readable_message_types.
struct archetype * arch
Pointer to archetype.
StringBuffer * describe_item(const object *op, const object *owner, int use_media_tags, StringBuffer *buf)
Describes an item, in all its details.
#define MSG_TYPE_PAPER_LETTER_NEW_1
int diff
Alchemical dfficulty level.
static const char *const mon_author[]
Used by monster beastuary texts.
static int unique_book(const object *book, int msgtype)
Check to see if the book title/msg is unique.
#define MSG_TYPE_CARD_ELEGANT_1
const char * name
the name of the book
const char * authour
the name of the book authour
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
void init_readable(void)
Initialize linked lists utilized by message functions in tailor_readable_ob()
#define MSGTYPE_ALCHEMY
Alchemy-related information.
#define MSG_TYPE_CARD_MONEY_1
#define MSG_TYPE_CARD_MONEY_3
void tailor_readable_ob(object *book, int msg_type)
The main routine.
const Face * get_message_face(const GeneralMessage *message)
Get a message's face.
archetype * find_archetype(const char *name)
sstring title
The message's title, only used for knowledge.
size_t stringbuffer_length(StringBuffer *sb)
Return the current length of the buffer.
int total_chance
Total chance of the recipes in this list.
void object_set_msg(object *op, const char *msg)
Set the message field of an object.
object * get_random_mon(int level)
Returns a random monster selected from linked list of all monsters in the current game...
void archetypes_for_each(arch_op op)
New face structure - this enforces the notion that data is face by face only - you can not change the...
#define MSG_TYPE_CARD_SIMPLE_2
#define MSG_TYPE_MONUMENT_STATUE_3
#define HUGE_BUF
Used for messages - some can be quite long.
#define MSG_TYPE_MONUMENT_WALL_2
sstring add_string(const char *str)
Share a string.
int32_t value
How much money it is worth (or contains)
int is_combination
Whather this is an alchemy recipe, or an item transformation description.
#define MSG_TYPE_PAPER_NOTE_2
#define MSG_TYPE_SIGN_DIR_RIGHT
#define MSG_TYPE_PAPER_ENVELOPE_1
const char * trim(const char *buf)
Return buf without its leading spaces.
#define MSG_TYPE_BOOK_SPELL_SORCERER
#define MSG_TYPE_PAPER_SCROLL_NEW_1
sstring title
Distinguishing name of product.
#define GOD_HOLYWORD
Write holy word information.
title * next
next item in the list
#define MSGTYPE_MONSTER
Monster-related information.
#define MSG_TYPE_MONUMENT_GRAVESTONE_1
#define MSG_TYPE_BOOK_QUARTO_2
static std::vector< object * > monsters
Information on monsters.
StringBuffer * stringbuffer_new(void)
Create a new string buffer.
linked_char * ingred
List of ingredients.
recipe * items
Pointer to first recipe in this list.
#define MSG_TYPE_MONUMENT_STONE_1
artifactlist * find_artifactlist(int type)
Finds the artifact list for a certain item type.
#define MSG_TYPE_MONUMENT_STONE_3
static void change_book(object *book, int msgtype)
Give a new, fancier name to generated objects of type BOOK and SPELLBOOK.
const char * archname
the archetype name of the book
#define MSG_TYPE_BOOK_SPELL_PRAYER
int index
Index value derived from formula ingredients.
static const arttypename art_name_array[]
Artiface/item information.
const char * recipe_get_difficulty_string(int difficulty)
A method to produce a difficulty adjective to describe alchemy projects.
sstring identifier
Message identifier, can be NULL.
#define MSG_TYPE_BOOK_SPELL_PYRO
Global type definitions and header inclusions.
sstring skill
Skill name used to make this recipe.
#define MSG_TYPE_BOOK_ELEGANT_1
static const char *const gods_author[]
Used by gods texts.
title * first_book
pointer to first book in this list
static void add_book_to_list(const object *book, int msgtype)
Adds a book to the list of existing books.
#define MSG_TYPE_PAPER_NOTE_3
sstring stringbuffer_finish_shared(StringBuffer *sb)
Deallocate the string buffer instance and return the string as a shared string.
#define MSG_TYPE_CARD_STRANGE_1
archetype * try_find_archetype(const char *name)
#define MSGTYPE_GODS
God-related information.
int32_t weight
Attributes of the object.
bool chance(int a, int b)
Return true with a probability of a/b.
archetype * head
The main part of a linked object.
static const char *const formula_author[]
This isn't used except for empty books.
static StringBuffer * mon_desc(const object *mon)
Returns a description of the monster.
titlelist * next
pointer to next book list
static const char *const mon_book_name[]
Monster book information.
uint16_t total_chance
Sum of chance for are artifacts on this list.
AssetsManager * getManager()
static StringBuffer * spellpath_msg(int level, size_t booksize, StringBuffer *buf)
Generate a message detailing the member incantations/prayers (and some of their properties) belonging...
#define GOD_RESISTANCES
Write resistances.
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
int16_t level
Level of creature or object.
const char *const spellpathnames[NRSPELLPATHS]
Perhaps not the best place for this, but needs to be in some file in the common area so that standalo...
static StringBuffer * artifact_msg(unsigned int level, size_t booksize)
Generate a message detailing the properties of 1-6 artifacts drawn sequentially from the artifact lis...
#define MSG_TYPE_CARD_ELEGANT_3
#define MSG_TYPE_PAPER_SCROLL_OLD_2
static titlelist * get_titlelist(int i)
Gets the ith titlelist.
std::vector< artifact * > items
Artifacts for this type.
static void make_formula_book(object *book, int level)
Generate a message detailing the properties of a randomly selected alchemical formula.
FILE * of_open(OutputFile *of, const char *fname)
Opens an output file.
#define MSG_TYPE_CARD_SIMPLE_3
int number
number of items in the list
const Face * face
Face the message displays at in the knowledge dialog, NULL if no face defined.
static const char *const art_author[]
Used by artifact texts.
GeneralMessage * random()
static const char *const book_author[]
Used by 'generic' books.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
sstring name
More definite name, like "generate_kobold".
size_t arch_names
Size of the arch_name[] array.
int describe_god(const object *god, int what, StringBuffer *buf, size_t maxlen)
Describe a god.
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
Append a formatted string to a string buffer instance.
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
void stringbuffer_append_string(StringBuffer *sb, const char *str)
Append a string to a string buffer instance.
#define MSG_TYPE_BOOK_ELEGANT_2
#define FLAG_UNAGGRESSIVE
Monster doesn't attack players.
#define QUERY_FLAG(xyz, p)
Information on one title.
#define MSG_TYPE_PAPER_SCROLL_MAGIC
#define BOOK_BUF
Maximum message buf size for books.
#define MSG_TYPE_MONUMENT_WALL_3
#define GOD_IMMUNITIES
Write immunities.
static const char *const gods_book_name[]
God book information.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
struct linked_char * next
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects, and puts it on the list of free objects.
#define FLAG_IDENTIFIED
Item is identifiable (e.g.
sstring msg
If this is a book/sign/magic mouth/etc.
#define MSG_TYPE_CARD_SIMPLE_1
List of recipes with a certain number of ingredients.
static const char *const formula_book_name[]
Alchemy (formula) information.
#define FLAG_CHANGING
Changes to other_arch when anim is done.
#define MSG_TYPE_CARD_STRANGE_3
static struct @0 sp_params
sstring object_get_value(const object *op, const char *const key)
Get an extra value by key.
sstring get_message_title(const GeneralMessage *message)
Get a message's title.
#define MSGTYPE_SPELLPATH
Spellpath-related information.
Struct to store the message_type and message_subtype for signs and books used by the player...
const object * get_rand_god(void)
Returns a random god.
This represents all archetypes for one particular object type.
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. ...
struct Settings settings
Global settings.
sstring lore
Obscure information about this object, to get put into books and the like.
object * object_new(void)
Grabs an object from the list of unused objects, makes sure it is initialised, and returns it...
const char * name
generic name to call artifacts of this type
recipelist * get_formulalist(int i)
Gets a formula list by ingredients count.
static int need_to_write_bookarchive
If set then we have information to save.
Messages * messages()
Get messages.
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...
Titles for one message type.
static const char *const art_book_name[]
Book titles for artifact information.
void fatal(enum fatal_error err)
fatal() is meant to be called whenever a fatal signal is intercepted.
static const char *const light_book_name[]
Generic book information.
#define MSG_TYPE_BOOK_SPELL_SUMMONER
#define MSG_TYPE_SIGN_BASIC
living stats
Str, Con, Dex, etc.
sstring quest_code
Optional quest code and state this message will start.
#define MAX_BUF
Used for all kinds of things.
#define NRSPELLPATHS
Number of spell paths.
int strtoint(const char *buf)
Convert buf into an integer equal to the coadded sum of the (lowercase) character.
#define MONSTER_EXCLUDE_FROM_READABLE_KEY
If set (any value), then monster is not listed in books.
size_t strlcpy(char *dst, const char *src, size_t size)
Portable implementation of strlcpy(3).
void object_copy(const object *src_ob, object *dest_ob)
Copy object first frees everything allocated by the second object, and then copies the contents of th...
#define MSG_TYPE_CARD_STRANGE_2
#define MSG_TYPE_MONUMENT_STATUE_2
static titlelist * booklist
Buffer of books read in from the bookarch file.
#define BOOKSIZE(xyz)
Get the book buffer size for an individual book object.
object * object_create_arch(archetype *at)
Create a full object using the given archetype.
#define MSG_TYPE_PAPER_LETTER_NEW_2
#define MSG_TYPE_MONUMENT_STONE_2
#define MSG_TYPE_MONUMENT_WALL_1
static const int max_titles[6]
Number of titles for different name lists.
#define MSG_TYPE_BOOK_CLASP_1
int msg_index
an index value derived from book message
#define MSG_TYPE_MONUMENT
#define MSG_TYPE_MONUMENT_STATUE_1
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...
sstring name_pl
The plural name of the object.
void free_all_readable(void)
Free all readable-related information.
int buf_overflow(const char *buf1, const char *buf2, size_t bufsize)
We don't want to exceed the buffer size of buf1 by adding on buf2!
static StringBuffer * mon_info_msg(int level, size_t booksize, object *book)
Generate a message detailing the properties of randomly monster(s), and add relevant knowledge marker...
void stringbuffer_append_stringbuffer(StringBuffer *sb, const StringBuffer *sb2)
Append the contents of a string buffer instance to another string buffer instance.
#define FREE_AND_COPY(sv, nv)
Release the shared string if not NULL, and make it a reference to nv.
#define MSG_TYPE_PAPER_SCROLL_NEW_2
Also see SKILL_TOOL (74) below.
#define GOD_ENEMY
Write down god's enemy.
static const readable_message_type readable_message_types[]
Each line of this array is a readable subtype.
#define MSG_TYPE_CARD_ELEGANT_2
const char * localdir
Read/write data files.
static StringBuffer * god_info_msg(int level, size_t booksize, object *book)
Generate a message detailing the properties of a random god.
static void do_monster(archetype *at)
int chance
Chance that recipe for this item will appear in an alchemical grimore.
#define MSG_TYPE_CARD_MONEY_2
sstring name
The name of the object, obviously...
sstring title
Of foo, etc.
#define MSG_TYPE_SIGN_MAGIC_MOUTH
Only for debugging purposes.
#define arraysize(arrayname)
Returns the element size of an array.
#define MSG_TYPE_PAPER_ENVELOPE_2
static StringBuffer * artifact_describe(const artifact *art, const artifactlist *al, int message, int art_name, int separator)
Describe an artifact.
#define GOD_PATHS
Path information.
int of_close(OutputFile *of)
Closes an output file.
#define GOD_SACRED
Write sacred creatures.
uint8_t type
PLAYER, BULLET, etc.
void add_abilities(object *op, const object *change)
Apply artifact properties to an object.
#define SAVE_MODE
If you have defined SAVE_PLAYER, you might want to change this, too.
static StringBuffer * msgfile_msg(object *book, size_t booksize)
Generate a message drawn randomly from lib/messages.
#define MSG_TYPE_PAPER_LETTER_OLD_2
void stringbuffer_delete(StringBuffer *sb)
Totally delete a string buffer.
static title * get_empty_book(void)
Creates a title.
Functions for creating text output files.
#define MSGTYPE_LIB
Message from the lib/messages file.
void write_book_archive(void)
Write out the updated book archive to bookarch file.
int object_set_value(object *op, const char *key, const char *value, int add_key)
Updates the key in op to value.
sstring get_message_body(const GeneralMessage *message)
Get a message's body.
#define MSGTYPE_MSGFILE
Message from the lib/messages file.
recipe * next
Next recipe with the same number of ingredients.
char ** arch_name
Possible archetypes of the final product made.
#define MSG_TYPE_PAPER_LETTER_OLD_1
#define MSG_TYPE_BOOK_SPELL_EVOKER
static void init_mon_info(void)
Creates the linked list of pointers to monster archetype objects if not called previously.
archetype * find_archetype_by_object_name(const char *name)
This function retrieves an archetype given the name that appears during the game (for example...
#define MSG_TYPE_SIGN_DIR_BOTH
#define MSGTYPE_ARTIFACT
Artifact-related information.
#define MSG_TYPE_MONUMENT_GRAVESTONE_2
void formula_knowledge_code(const recipe *r, char *buf, size_t len)
Store the textual knowledge marker code for recipe R in BUF.
#define FLAG_MONSTER
Will attack players.
C function wrappers to interact with assets.
#define MSG_TYPE_MONUMENT_GRAVESTONE_3
static const uint32_t spellpathdef[NRSPELLPATHS]
Spellpath information.
#define MAX_TITLE_CHECK
How many times to try to generate a unique name for a book.
One general message, from the lib/messages file.
Structure containing object statistics.
static void new_text_name(object *book, int msgtype)
Only for objects of type BOOK.
A buffer that will be expanded as content is added to it.
uint8_t subtype
Subtype of object.
static const char *const heavy_book_name[]
Name for big books.
static void init_book_archive(void)
If not called before, initialize the info list.
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
static const char *const path_author[]
Used by spellpath texts.
int ingred_count
Number of items in ingred.
#define MSG_TYPE_BOOK_QUARTO_1
size_t size
size of the book message
static void do_spellpath_msg(archetype *at)
Callback to write spells in messages.
const readable_message_type * get_readable_message_type(object *readable)
Get the readable type for an object (hopefully book).
sstring cauldron
Arch of the cauldron/workbench used to house the formulae.
This is one artifact, ie one special item.
#define MSG_TYPE_PAPER_NOTE_1
#define MSG_TYPE_BOOK_CLASP_2
Describes fundental parameters of 'books' - objects with type==BOOK.
static titlelist * get_empty_booklist(void)
Creates a titlelist.
special structure, used only by art_name_array[]
object clone
An object from which to do object_copy()
unsigned int level
level of difficulty of this message
static const char *const book_descrpt[]
Book descriptions.
object * item
Special values of the artifact.
uint16_t chance
Chance of the artifact to happen.
std::vector< sstring > allowed
List of archetypes the artifact can affect.
sstring message
The message's body.
uint32_t path_attuned
Paths the object is attuned to.
uint8_t type
Object type that this list represents.
static void add_book(title *book, int type, const char *fname, int lineno)
Appends a book to the booklist.