Go to the documentation of this file.
31 static std::vector<object *>
gods;
42 LOG(
llevError,
"ERROR: Tried to add null god to list!\n");
95 auto god = std::find_if(
gods.begin(),
gods.end(), [&] (
const object *god) {
96 return god->race && !strcasecmp(god->race, race);
98 return god ==
gods.end() ? nullptr : (*god)->name;
110 int hassomething = 0, real = 0;
167 int has_effect = 0, tmpvar;
174 if (god->
resist[tmpvar] == 100) {
200 stringbuffer_append_printf(add,
"\nThe priests of %s are known to be able to bestow a blessing which grants the recipient:\n%s\n ---\n",
name, cp);
244 stringbuffer_append_printf(add,
"%s has a potent aura which is extended to faithful priests. The effects of this aura include:\n%s\n ---\n",
name, cp);
298 if (hassomething == 0) {
318 auto found = std::find_if(
gods.begin(),
gods.end(), [&] (
const object *god) {
319 return !strcmp(name, god->name);
331 #define DESCRIBE_ABILITY(retbuf, variable, name) \
334 strcat(retbuf, "(" name ": "); \
335 for (i = 0; i < NROFATTACKS; i++) \
336 if (variable&(1<<i)) { \
338 strcat(retbuf, ", "); \
341 strcat(retbuf, attacks[i]); \
343 strcat(retbuf, ")"); \
346 #define DESCRIBE_PATH(retbuf, variable, name) \
349 strcat(retbuf, "(" name ": "); \
350 for (i = 0; i < NRSPELLPATHS; i++) \
351 if (variable&(1<<i)) { \
353 strcat(retbuf, ", "); \
356 strcat(retbuf, spellpathnames[i]); \
358 strcat(retbuf, ")"); \
371 fprintf(stderr,
"\n");
372 for (glist = first_god; glist; glist = glist->next) {
373 const object *god = &glist->arch->clone;
375 int tmpvar, gifts = 0;
377 fprintf(stderr,
"GOD: %s\n", god->
name);
378 fprintf(stderr,
" avatar stats:\n");
380 fprintf(stderr,
" lvl:%d speed:%4.2f\n", god->
level, god->
speed);
382 fprintf(stderr,
" enemy: %s\n", god->
title ? god->
title :
"NONE");
387 fprintf(stderr,
" lvl:%d speed:%4.2f\n", serv->
level, serv->
speed);
390 fprintf(stderr,
" servant: NONE\n");
391 fprintf(stderr,
" aligned_race(s): %s\n", god->
race);
392 fprintf(stderr,
" enemy_race(s): %s\n", (god->
slaying ? god->
slaying :
"none"));
394 fprintf(stderr,
"%s",
final);
396 snprintf(tmpbuf,
sizeof(tmpbuf),
" attacktype:");
398 strcat(tmpbuf,
"\n ");
401 strcat(tmpbuf,
"\n aura:");
403 strcat(tmpbuf,
"\n paths:");
405 strcat(tmpbuf,
"\n ");
409 strcat(tmpbuf,
"\n ");
413 strcat(tmpbuf,
"\n ");
416 fprintf(stderr,
"%s\n", tmpbuf);
417 fprintf(stderr,
" Desc: %s", god->
msg ? god->
msg :
"---\n");
418 fprintf(stderr,
" Priest gifts/limitations: ");
429 if (god->
last_heal) { gifts = 1; fprintf(stderr,
"\n hp regenerate at %d", god->
last_heal); }
430 if (god->
last_sp) { gifts = 1; fprintf(stderr,
"\n sp regenerate at %d", god->
last_sp); }
431 if (god->
last_eat) { gifts = 1; fprintf(stderr,
"\n digestion is %s (%d)", god->
last_eat < 0 ?
"slowed" :
"faster", god->
last_eat); }
432 if (god->
last_grace) { gifts = 1; fprintf(stderr,
"\n grace regenerates at %d", god->
last_grace); }
433 if (god->
stats.
luck) { gifts = 1; fprintf(stderr,
"\n luck is %d", god->
stats.
luck); }
434 if (!gifts) fprintf(stderr,
"NONE");
435 fprintf(stderr,
"\n\n");
size_t stringbuffer_length(StringBuffer *sb)
void LOG(LogLevel logLevel, const char *format,...)
#define QUERY_FLAG(xyz, p)
#define FLAG_REFL_MISSILE
void archetypes_for_each(arch_op op)
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
StringBuffer * stringbuffer_new(void)
char * strtoktolin(const char *buf1, const char *buf2, char *retbuf, size_t size)
int16_t resist[NROFATTACKS]
const object * find_god(const char *name)
char * stringbuffer_finish(StringBuffer *sb)
const object * get_rand_god(void)
StringBuffer * describe_resistance(const object *op, int newline, int use_media_tags, StringBuffer *buf)
#define DESCRIBE_ABILITY(retbuf, variable, name)
StringBuffer * describe_spellpath_attenuation(const char *attenuation, int value, StringBuffer *buf)
const char * get_god_for_race(const char *race)
void stringbuffer_append_string(StringBuffer *sb, const char *str)
struct archetype * other_arch
static void add_god_to_list(archetype *god_arch)
const char *const attacktype_desc[NROFATTACKS]
#define DESCRIBE_PATH(retbuf, variable, name)
void stringbuffer_append_stringbuffer(StringBuffer *sb, const StringBuffer *sb2)
static std::vector< object * > gods
int describe_god(const object *god, int what, StringBuffer *buf, size_t maxlen)
int nstrtok(const char *buf1, const char *buf2)