 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
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)))
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) {
650 for (tbuf = strtok(
buf, buf2); tbuf; tbuf = strtok(NULL, buf2)) {
662 while ((*
buf) ==
' ') {
684 char *
strtoktolin(
const char *buf1,
const char *buf2,
char *retbuf,
size_t size) {
685 int maxi, i =
nstrtok(buf1, buf2);
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) {
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);
847 #ifdef BOOK_MSG_DEBUG
848 LOG(
llevDebug,
"\n init_book_archive() got %d titles.\n", nroftitle);
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);
951 if (
t->size == length &&
t->msg_index == index) {
953 LOG(
llevDebug,
"Found title match (list %d): %s %s (%d)\n", msgtype,
t->name,
t->authour,
t->msg_index);
958 return (
title *)NULL;
1003 if (book->
weight > 2000) {
1027 if (msgtype < 0 || strlen(op->
msg) < 5)
1100 LOG(
llevError,
"add_book_to_list can't get booklist!\n");
1107 t->size = strlen(book->
msg);
1119 #ifdef ARCHIVE_DEBUG
1143 LOG(
llevError,
"change_book_name() called w/ illegal obj type.\n");
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 =
":";
1491 if (book_entries > 5)
1505 }
while (al == NULL && i < 10);
1514 auto iart = al->
items.cbegin();
1516 if (iart == al->
items.cend())
1517 iart = al->
items.cbegin();
1528 while (book_entries > 0) {
1530 if (iart == al->
items.cend())
1531 iart = al->
items.cbegin();
1646 const char *op_name;
1667 for (formula = fl->
items; formula != NULL; formula = formula->
next) {
1687 LOG(
llevError,
"formula_msg() can't find arch %s for formula.\n", op_name);
1700 formula->
diff >= 10 && formula->
diff < 15 ?
"n" :
"",
1702 formula->
skill ? formula->
skill :
"an unknown skill");
1705 if (strcmp(formula->
title,
"NONE")) {
1731 if (formula->
ingred != NULL) {
1740 snprintf(
name,
sizeof(
name),
"an unknown place");
1744 for (next = formula->
ingred; next != NULL; next = next->
next) {
1749 LOG(
llevError,
"formula_msg() no ingredient list for object %s of %s\n", op_name, formula->
title);
1759 snprintf(km,
sizeof(km),
"alchemy:%d:%d:%s", count, formula->
index, formula->
title);
1784 snprintf(km,
sizeof(km),
"message:%s", msg->
identifier);
1797 #ifdef BOOK_MSG_DEBUG
1831 LOG(
llevError,
"common/readable.c:god_info_msg() - passed in booksize (%lu) is larger than book buffer (%d)\n", (
unsigned long)
booksize,
BOOK_BUF);
1865 snprintf(
buf,
sizeof(
buf),
"god:%s:%d", god->
name, what);
1894 size_t book_buf_size;
1906 book_buf_size -= strlen(
"\n");
1924 msg_type = msg_type > 0 ? msg_type : (int)(
RANDOM()%6);
1976 title *title1, *titlenext;
1980 for (tlist =
booklist; tlist != NULL; tlist = tnext) {
1981 tnext = tlist->
next;
1982 for (title1 = tlist->
first_book; title1; title1 = titlenext) {
1983 titlenext = title1->
next;
2018 LOG(
llevDebug,
"Updating book archive: %s...\n", fname);
2027 fprintf(fp,
"title %s\n", book->
name);
2028 fprintf(fp,
"authour %s\n", book->
authour);
2029 fprintf(fp,
"arch %s\n", book->
archname);
2030 fprintf(fp,
"level %d\n", book->
level);
2031 fprintf(fp,
"type %d\n", index);
2033 fprintf(fp,
"size %lu\n", (
unsigned long)book->
size);
2034 fprintf(fp,
"index %d\n", book->
msg_index);
2035 fprintf(fp,
"end\n");
2042 LOG(
llevError,
"Could not set permissions on '%s'\n", fname);
2056 uint8_t subtype = readable->
subtype;
void write_book_archive(void)
Write out the updated book archive to bookarch file.
#define MSG_TYPE_MONUMENT_WALL_2
sstring name_pl
The plural name of the object.
New face structure - this enforces the notion that data is face by face only - you can not change the...
static const char *const formula_book_name[]
Alchemy (formula) information.
#define MSG_TYPE_BOOK_SPELL_PRAYER
#define GOD_IMMUNITIES
Write immunities.
static void change_book(object *book, int msgtype)
Give a new, fancier name to generated objects of type BOOK and SPELLBOOK.
struct Settings settings
Server settings.
static const char *const path_book_name[]
Book names for path information.
size_t stringbuffer_length(StringBuffer *sb)
Return the current length of the buffer.
One general message, from the lib/messages file.
recipelist * get_formulalist(int i)
Gets a formula list by ingredients count.
#define SAVE_MODE
If you have defined SAVE_PLAYER, you might want to change this, too.
const char * authour
the name of the book authour
static titlelist * get_empty_booklist(void)
Creates a titlelist.
static void do_spellpath_msg(archetype *at)
Callback to write spells in messages.
static const char *const mon_author[]
Used by monster beastuary texts.
@ llevError
Error, serious thing.
static void init_mon_info(void)
Creates the linked list of pointers to monster archetype objects if not called previously.
#define GOD_PATHS
Path information.
uint32_t path_attuned
Paths the object is attuned to.
static title * get_empty_book(void)
Creates a title.
#define MSG_TYPE_PAPER_LETTER_OLD_2
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define arraysize(arrayname)
Returns the element size of an array.
#define MSG_TYPE_BOOK_SPELL_SUMMONER
static const char *const book_author[]
Used by 'generic' books.
int of_close(OutputFile *of)
Closes an output file.
#define MONSTER_EXCLUDE_FROM_READABLE_KEY
If set (any value), then monster is not listed in books.
void free_all_readable(void)
Free all readable-related information.
Messages * messages()
Get messages.
static std::vector< object * > monsters
Information on monsters.
FILE * of_open(OutputFile *of, const char *fname)
Opens an output file.
const char * name
generic name to call artifacts of this type
#define QUERY_FLAG(xyz, p)
size_t arch_names
Size of the arch_name[] array.
void archetypes_for_each(arch_op op)
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 const char *const mon_book_name[]
Monster book information.
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
Append a formatted string to a string buffer instance.
static const char *const path_author[]
Used by spellpath texts.
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_PAPER_LETTER_NEW_2
struct archetype * arch
Pointer to archetype.
StringBuffer * stringbuffer_new(void)
Create a new string buffer.
#define MSG_TYPE_BOOK_QUARTO_1
#define MSG_TYPE_SIGN_BASIC
std::vector< artifact * > items
Artifacts for this type.
static const char *const gods_book_name[]
God book information.
#define MSG_TYPE_PAPER_SCROLL_NEW_2
#define MSG_TYPE_PAPER_SCROLL_OLD_2
#define MSG_TYPE_PAPER_NOTE_2
#define MSG_TYPE_CARD_MONEY_2
#define MSG_TYPE_MONUMENT_STATUE_3
object * item
Special values of the artifact.
static StringBuffer * god_info_msg(int level, size_t booksize, object *book)
Generate a message detailing the properties of a random god.
void add_abilities(object *op, const object *change)
Apply artifact properties to an object.
recipe * items
Pointer to first recipe in this list.
archetype * head
The main part of a linked object.
#define MSG_TYPE_PAPER_LETTER_OLD_1
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.
#define MSG_TYPE_SIGN_DIR_RIGHT
static const char *const gods_author[]
Used by gods texts.
const char * name
the name of the book
#define MSG_TYPE_CARD_SIMPLE_2
@ SKILL
Also see SKILL_TOOL (74) below.
sstring identifier
Message identifier, can be NULL.
Titles for one message type.
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...
char ** arch_name
Possible archetypes of the final product made.
std::vector< sstring > allowed
List of archetypes the artifact can affect.
#define MSG_TYPE_BOOK_CLASP_2
#define MSGTYPE_MONSTER
Monster-related information.
#define MSG_TYPE_BOOK_ELEGANT_1
sstring title
Of foo, etc.
const char * object_get_value(const object *op, const char *const key)
Get an extra value by key.
#define GOD_BLESSED
Write various information (resistances?).
int16_t level
Level of creature or object.
size_t size
size of the book message
AssetsManager * getManager()
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
int total_chance
Total chance of the recipes in this list.
#define HUGE_BUF
Used for messages - some can be quite long.
static const readable_message_type readable_message_types[]
Each line of this array is a readable subtype.
#define GOD_HOLYWORD
Write holy word information.
title * first_book
pointer to first book in this list
Plugin animator file specs[Config] name
int is_combination
Whather this is an alchemy recipe, or an item transformation description.
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.
#define MSG_TYPE_PAPER_SCROLL_OLD_1
static int need_to_write_bookarchive
If set then we have information to save.
#define MSG_TYPE_CARD_STRANGE_1
GeneralMessage * random()
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
#define MSGTYPE_MSGFILE
Message from the lib/messages file.
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
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.
const object * get_rand_god(void)
Returns a random god.
uint8_t subtype
Subtype of object.
List of recipes with a certain number of ingredients.
#define MSG_TYPE_MONUMENT_GRAVESTONE_1
#define MSG_TYPE_MONUMENT
#define MSG_TYPE_CARD_STRANGE_2
void query_name(const object *op, char *buf, size_t size)
Describes an item.
#define MSG_TYPE_SIGN_DIR_BOTH
#define MSG_TYPE_MONUMENT_GRAVESTONE_2
static titlelist * get_titlelist(int i)
Gets the ith titlelist.
sstring stringbuffer_finish_shared(StringBuffer *sb)
Deallocate the string buffer instance and return the string as a shared string.
#define MSG_TYPE_SIGN_DIR_LEFT
object clone
An object from which to do object_copy()
sstring add_string(const char *str)
This will add 'str' to the hash table.
#define MSG_TYPE_BOOK_CLASP_1
static const char *const book_descrpt[]
Book descriptions.
void init_readable(void)
Initialize linked lists utilized by message functions in tailor_readable_ob()
titlelist * next
pointer to next book list
static void init_book_archive(void)
If not called before, initialize the info list.
void tailor_readable_ob(object *book, int msg_type)
The main routine.
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...
int32_t value
How much money it is worth (or contains)
#define FREE_AND_COPY(sv, nv)
Release the shared string if not NULL, and make it a reference to nv.
#define MSG_TYPE_MONUMENT_STATUE_2
static void add_book_to_list(const object *book, int msgtype)
Adds a book to the list of existing books.
uint8_t type
PLAYER, BULLET, etc.
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your message
#define MSG_TYPE_CARD_ELEGANT_1
int index
Index value derived from formula ingredients.
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn t
object * object_create_arch(archetype *at)
Create a full object using the given archetype.
#define MAX_TITLE_CHECK
How many times to try to generate a unique name for a book.
struct linked_char * next
Information on one title.
This represents all archetypes for one particular object type.
special structure, used only by art_name_array[]
#define FLAG_UNAGGRESSIVE
Monster doesn't attack players.
#define MSG_TYPE_CARD_ELEGANT_3
static StringBuffer * artifact_describe(const artifact *art, const artifactlist *al, int message, int art_name, int separator)
Describe an artifact.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
#define MSG_TYPE_CARD_MONEY_3
#define MSG_TYPE_BOOK_SPELL_EVOKER
#define MSG_TYPE_MONUMENT_GRAVESTONE_3
sstring get_message_body(const GeneralMessage *message)
Get a message's body.
void stringbuffer_append_string(StringBuffer *sb, const char *str)
Append a string to a string buffer instance.
#define MSG_TYPE_MONUMENT_STONE_3
#define MSG_TYPE_MONUMENT_WALL_3
int number
number of items in the list
const char * trim(const char *buf)
Return buf without its leading spaces.
#define MSG_TYPE_PAPER_ENVELOPE_2
#define MSG_TYPE_CARD_ELEGANT_2
#define MSG_TYPE_PAPER_NOTE_1
#define MSG_TYPE_BOOK_SPELL_SORCERER
#define MSG_TYPE_BOOK_SPELL_PYRO
const char * archname
the archetype name of the book
#define MSGTYPE_GODS
God-related information.
#define MSG_TYPE_SIGN_MAGIC_MOUTH
#define FLAG_MONSTER
Will attack players.
void fatal(enum fatal_error err)
fatal() is meant to be called whenever a fatal signal is intercepted.
static StringBuffer * mon_desc(const object *mon)
Returns a description of the monster.
#define MAX_BUF
Used for all kinds of things.
size_t strlcpy(char *dst, const char *src, size_t size)
Portable implementation of strlcpy(3).
object * object_new(void)
Grabs an object from the list of unused objects, makes sure it is initialised, and returns it.
StringBuffer * describe_item(const object *op, const object *owner, int use_media_tags, StringBuffer *buf)
Describes an item, in all its details.
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
pluglist shows those as well as a short text describing each the list will simply appear empty The keyword for the Python plugin is Python plugout< keyword > Unloads a given identified by its _keyword_ So if you want to unload the Python you need to do plugout Python plugin< libname > Loads a given whose _filename_ is libname So in the case of you d have to do a plugin cfpython so Note that all filenames are relative to the default plugin path(SHARE/plugins). Console messages. ----------------- When Crossfire starts
int32_t weight
Attributes of the object.
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
A buffer that will be expanded as content is added to it.
static const char *const art_book_name[]
Book titles for artifact information.
sstring message
The message's body.
#define GOD_RESISTANCES
Write resistances.
#define MSG_TYPE_CARD_MONEY_1
sstring lore
Obscure information about this object, to get put into books and the like.
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_PAPER_ENVELOPE_1
sstring name
The name of the object, obviously...
sstring get_message_title(const GeneralMessage *message)
Get a message's title.
#define MSGTYPE_LIB
Message from the lib/messages file.
#define MSG_TYPE_CARD_SIMPLE_3
static const uint32_t spellpathdef[NRSPELLPATHS]
Spellpath information.
void stringbuffer_delete(StringBuffer *sb)
Totally delete a string buffer.
static StringBuffer * msgfile_msg(object *book, size_t booksize)
Generate a message drawn randomly from lib/messages.
int chance
Chance that recipe for this item will appear in an alchemical grimore.
uint16_t chance
Chance of the artifact to happen.
#define MSGTYPE_ALCHEMY
Alchemy-related information.
const typedef char * sstring
#define MSG_TYPE_PAPER_LETTER_NEW_1
archetype * find_archetype(const char *name)
#define MSG_TYPE_BOOK_ELEGANT_2
int strtoint(const char *buf)
Convert buf into an integer equal to the coadded sum of the (lowercase) character.
#define GOD_ENEMY
Write down god's enemy.
void object_set_msg(object *op, const char *msg)
Set the message field of an object.
int diff
Alchemical dfficulty level.
sstring msg
If this is a book/sign/magic mouth/etc.
#define BOOK_BUF
Maximum message buf size for books.
title * next
next item in the list
uint16_t total_chance
Sum of chance for are artifacts on this list.
#define MSGTYPE_ARTIFACT
Artifact-related information.
static void do_monster(archetype *at)
static const arttypename art_name_array[]
Artiface/item information.
#define MSG_TYPE_MONUMENT_STONE_2
void stringbuffer_append_stringbuffer(StringBuffer *sb, const StringBuffer *sb2)
Append the contents of a string buffer instance to another string buffer instance.
static void new_text_name(object *book, int msgtype)
Only for objects of type BOOK.
static const char *const heavy_book_name[]
Name for big books.
#define MSGTYPE_SPELLPATH
Spellpath-related information.
Struct to store the message_type and message_subtype for signs and books used by the player.
static const char *const formula_author[]
This isn't used except for empty books.
static titlelist * booklist
Buffer of books read in from the bookarch file.
#define MSG_TYPE_MONUMENT_STATUE_1
unsigned int level
level of difficulty of this message
#define MSG_TYPE_MONUMENT_WALL_1
const readable_message_type * get_readable_message_type(object *readable)
Get the readable type for an object (hopefully book).
static const char *const art_author[]
Used by artifact texts.
static const int last_readable_subtype
Number of elements in readable_message_types.
object * get_random_mon(int level)
Returns a random monster selected from linked list of all monsters in the current game.
int book_overflow(const char *buf1, const char *buf2, size_t booksize)
Checks if buf1 and buf2 can be combined.
#define MSG_TYPE_PAPER_NOTE_3
#define MSG_TYPE_BOOK_QUARTO_2
archetype * try_find_archetype(const char *name)
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...
static int unique_book(const object *book, int msgtype)
Check to see if the book title/msg is unique.
linked_char * ingred
List of ingredients.
#define MSG_TYPE_CARD_SIMPLE_1
static const char *const light_book_name[]
Generic book information.
#define MSG_TYPE_MONUMENT_STONE_1
sstring name
More definite name, like "generate_kobold".
recipe * next
Next recipe with the same number of ingredients.
bool chance(int a, int b)
Return true with a probability of a/b.
sstring skill
Skill name used to make this recipe.
living stats
Str, Con, Dex, etc.
This is one artifact, ie one special item.
int object_set_value(object *op, const char *key, const char *value, int add_key)
Updates the key in op to value.
char title[BIG_NAME]
Default title, like fighter, wizard, etc.
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!
int describe_god(const object *god, int what, StringBuffer *buf, size_t maxlen)
Describe a god.
if you malloc the data for the make sure to free it when done There is also the newclient h file which is shared between the client and server This file contains the definition of the as well as many defined values for constants of varying you will need to grab these constant values for yourself Many of the constants in this file are used in the protocol to denote types Image Caching ~ Image caching has been implemented on the with necessary server support to handle it This section will briefly describe how image caching works on the protocol as well as how the current client does it the client checks for an option denoting the image caching is desired If we initialize all the images to a default value this means we don t need to put special checks into the drawing code to see if we have an image we just draw the default we know what filename to store it as we request the server to do image caching This is done by or ing the cache directive to the image mode we want C when the server finds an image number that it has not send to the it sends us a name command information us the number to name and there is no space between that the and the name Such formating is difficult but the above example illustrates the data is sent The client then checks for the existence of the image locally It is up to the client to organize images and then splits them into sub directories based on the first letters in the above the file would be crossfire images CS CSword If the client does not have the image or otherwise needs a copy from the it then requests it
static void add_book(title *book, int type, const char *fname, int lineno)
Appends a book to the booklist.
#define MSG_TYPE_PAPER_SCROLL_MAGIC
static void make_formula_book(object *book, int level)
Generate a message detailing the properties of a randomly selected alchemical formula.
#define FLAG_CHANGING
Changes to other_arch when anim is done.
int msg_index
an index value derived from book message
#define MSG_TYPE_PAPER_SCROLL_NEW_1
static struct @0 sp_params
#define BOOKSIZE(xyz)
Get the book buffer size for an individual book object.
static const int max_titles[6]
Number of titles for different name lists.
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.
artifactlist * find_artifactlist(int type)
Finds the artifact list for a certain item type.
uint8_t type
Object type that this list represents.
#define MSG_TYPE_CARD_STRANGE_3
const Face * get_message_face(const GeneralMessage *message)
Get a message's face.
const char * recipe_get_difficulty_string(int difficulty)
A method to produce a difficulty adjective to describe alchemy projects.
@ llevDebug
Only for debugging purposes.
sstring quest_code
Optional quest code and state this message will start.
#define NRSPELLPATHS
Number of spell paths.
#define GOD_SACRED
Write sacred creatures.
#define FLAG_IDENTIFIED
Player knows full info about item.
sstring cauldron
Arch of the cauldron/workbench used to house the formulae.
sstring title
Distinguishing name of product.
const char * localdir
Read/write data files.