Crossfire Server, Trunk
R22047
|
#include "global.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "libproto.h"
#include "living.h"
#include "spells.h"
#include "assets.h"
Go to the source code of this file.
Macros | |
#define | DESCRIBE_ABILITY(retbuf, variable, name) |
#define | DESCRIBE_PATH(retbuf, variable, name) |
Functions | |
static void | add_god_to_list (archetype *god_arch) |
int | describe_god (const object *god, int what, StringBuffer *buf, size_t maxlen) |
void | dump_gods (void) |
void | free_all_god (void) |
godlink * | get_rand_god (void) |
void | init_gods (void) |
static godlink * | init_godslist (void) |
const object * | pntr_to_god_obj (godlink *godlnk) |
God-related common functions.
Definition in file holy.c.
#define DESCRIBE_ABILITY | ( | retbuf, | |
variable, | |||
name | |||
) |
Definition at line 351 of file holy.c.
Referenced by dump_gods().
#define DESCRIBE_PATH | ( | retbuf, | |
variable, | |||
name | |||
) |
Definition at line 366 of file holy.c.
Referenced by dump_gods().
|
static |
Adds specified god to linked list if god, gives it an id.
god_arch | God to add. If NULL, will log an error. |
Definition at line 55 of file holy.c.
References add_string(), glnk::arch, first_god, glnk::id, init_godslist(), llevDebug, llevError, LOG(), glnk::name, and glnk::next.
Referenced by init_gods().
int describe_god | ( | const object * | god, |
int | what, | ||
StringBuffer * | buf, | ||
size_t | maxlen | ||
) |
Describe a god. The reason we return a combination is to know what exactly was written for knowledge management.
god | which god to describe. |
what | information to describe, combination of GOD_xxx flags. |
buf | where to describe, must not be NULL. |
maxlen | maximum wanted length of the description, if 0 no maximum length. |
Definition at line 138 of file holy.c.
References attacktype_desc, describe_resistance(), describe_spellpath_attenuation(), GOD_BLESSED, GOD_ENEMY, GOD_HOLYWORD, GOD_IMMUNITIES, GOD_PATHS, GOD_RESISTANCES, GOD_SACRED, HUGE_BUF, MAX_BUF, NROFATTACKS, nstrtok(), PATH_SUMMON, PATH_TURNING, snprintf, stringbuffer_append_printf(), stringbuffer_append_string(), stringbuffer_append_stringbuffer(), stringbuffer_finish(), stringbuffer_length(), stringbuffer_new(), and strtoktolin().
Referenced by god_info_msg(), and knowledge_god_detail().
void dump_gods | ( | void | ) |
Prints all gods to stderr.
Definition at line 387 of file holy.c.
References DESCRIBE_ABILITY, DESCRIBE_PATH, describe_resistance(), first_god, FLAG_BLIND, FLAG_MAKE_INVIS, FLAG_REFL_MISSILE, FLAG_REFL_SPELL, FLAG_SEE_IN_DARK, FLAG_STEALTH, FLAG_UNDEAD, FLAG_USE_ARMOUR, FLAG_USE_WEAPON, FLAG_XRAYS, HUGE_BUF, glnk::next, pntr_to_god_obj(), QUERY_FLAG, snprintf, and stringbuffer_finish().
Referenced by init_beforeplay().
void free_all_god | ( | void | ) |
Frees all god information.
Definition at line 338 of file holy.c.
References first_god, free_string(), llevDebug, LOG(), glnk::name, and glnk::next.
Referenced by cleanup().
godlink* get_rand_god | ( | void | ) |
Returns a random god.
Definition at line 102 of file holy.c.
References first_god, glnk::id, llevError, LOG(), glnk::next, and RANDOM.
Referenced by god_info_msg().
void init_gods | ( | void | ) |
This takes a look at all of the archetypes to find the objects which correspond to the GODS (type GOD)
Definition at line 86 of file holy.c.
References add_god_to_list(), archetypes_for_each(), llevDebug, and LOG().
Referenced by generate_map(), init_beforeplay(), main(), and setup().
|
static |
Initializes a god structure.
Definition at line 37 of file holy.c.
References glnk::arch, fatal(), glnk::id, glnk::name, glnk::next, and OUT_OF_MEMORY.
Referenced by add_god_to_list().
const object* pntr_to_god_obj | ( | godlink * | godlnk | ) |
Returns a pointer to the object We need to be VERY careful about using this, as we are returning a pointer to the CLONE object. -b.t.
godlnk | god to get object. |
Definition at line 124 of file holy.c.
References glnk::arch.
Referenced by dump_gods(), find_god(), and god_info_msg().