Crossfire Server, Trunk
|
#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) |
const object * | find_god (const char *name) |
void | free_all_god (void) |
const char * | get_god_for_race (const char *race) |
const object * | get_rand_god (void) |
void | init_gods (void) |
Variables | |
static std::vector< object * > | gods |
God-related common functions.
Definition in file holy.cpp.
#define DESCRIBE_ABILITY | ( | retbuf, | |
variable, | |||
name | |||
) |
#define DESCRIBE_PATH | ( | retbuf, | |
variable, | |||
name | |||
) |
|
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 39 of file holy.cpp.
References archetype::clone, GOD, gods, llevDebug, llevError, LOG(), object::name, and object::type.
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 109 of file holy.cpp.
References attacktype_desc, buf, describe_resistance(), describe_spellpath_attenuation(), GOD_BLESSED, GOD_ENEMY, GOD_HOLYWORD, GOD_IMMUNITIES, GOD_PATHS, GOD_RESISTANCES, GOD_SACRED, HUGE_BUF, MAX_BUF, object::msg, give::name, object::name, NROFATTACKS, nstrtok(), object::path_attuned, object::path_denied, object::path_repelled, PATH_SUMMON, PATH_TURNING, object::race, object::resist, object::slaying, stringbuffer_append_printf(), stringbuffer_append_string(), stringbuffer_append_stringbuffer(), stringbuffer_finish(), stringbuffer_length(), stringbuffer_new(), strtoktolin(), guildbuy::temp, and object::title.
Referenced by god_info_msg(), and knowledge_god_detail().
void dump_gods | ( | void | ) |
Prints all gods to stderr.
Definition at line 367 of file holy.cpp.
References living::ac, object::attacktype, archetype::clone, living::Con, living::dam, DESCRIBE_ABILITY, DESCRIBE_PATH, describe_resistance(), living::Dex, 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, living::hp, HUGE_BUF, living::Int, object::last_eat, object::last_grace, object::last_heal, object::last_sp, object::level, living::luck, object::msg, object::name, archetype::name, object::other_arch, object::path_attuned, object::path_denied, object::path_repelled, living::Pow, QUERY_FLAG, object::race, object::slaying, object::speed, object::stats, living::Str, stringbuffer_finish(), object::title, living::wc, and living::Wis.
Referenced by init_beforeplay().
const object* find_god | ( | const char * | name | ) |
Returns a god's object from its name.
name | god's name. |
Definition at line 317 of file holy.cpp.
References is_valid_types_gen::found, and gods.
Referenced by become_follower(), cast_bless(), cast_consecrate(), cast_curse(), cast_detection(), cast_smite_spell(), command_setgod(), determine_god(), hit_player(), hit_with_one_attacktype(), mood_change(), perceive_self(), pets_summon_golem(), pets_summon_object(), pray_at_altar(), START_TEST(), and tailor_god_spell().
void free_all_god | ( | void | ) |
const char* get_god_for_race | ( | const char * | race | ) |
Returns a string that is the name of the god that should be natively worshipped by a creature of who has race *race if we can't find a god that is appropriate, we return NULL
race | race we're getting the god of. |
Definition at line 90 of file holy.cpp.
References gods.
Referenced by determine_god(), and START_TEST().
const object* get_rand_god | ( | void | ) |
Returns a random god.
Definition at line 73 of file holy.cpp.
Referenced by determine_god(), god_info_msg(), and START_TEST().
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 59 of file holy.cpp.
References add_god_to_list(), archetypes_for_each(), llevDebug, and LOG().
Referenced by generate_map(), init_beforeplay(), ResourcesManager::load(), main(), and setup().
|
static |
Definition at line 31 of file holy.cpp.
Referenced by add_god_to_list(), find_god(), free_all_god(), get_god_for_race(), and get_rand_god().