59 LOG(
llevError,
"ERROR: Tried to add null god to list!\n");
62 if (!(god_arch->clone.type == GOD)) {
112 LOG(
llevError,
"get_rand_god(): can't find a random god!\n");
125 if (godlnk && godlnk->
arch)
126 return &godlnk->
arch->clone;
139 int hassomething = 0, real = 0;
151 if (
nstrtok(god->msg,
",") > 0) {
164 stringbuffer_append_printf(add,
"It is rarely known fact that the priests of %s are mystically transformed. Effects of this include:\n", name);
166 if (god->path_attuned) {
170 if (god->path_repelled) {
174 if (god->path_denied) {
196 int has_effect = 0, tmpvar;
200 stringbuffer_append_printf(add,
"\nThe priests of %s are known to make cast a mighty prayer of possession which gives the recipient ", name);
203 if (god->resist[tmpvar] == 100) {
229 stringbuffer_append_printf(add,
"\nThe priests of %s are known to be able to bestow a blessing which makes the recipient %s\n ---\n", name, cp);
245 if (god->race && !(god->path_denied&
PATH_SUMMON)) {
246 int i =
nstrtok(god->race,
",");
273 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);
289 if ((god->slaying) && !(god->path_denied&
PATH_TURNING)) {
293 if (
nstrtok(god->slaying,
",") > 1)
327 if (hassomething == 0) {
342 for (god =
first_god; god; god = godnext) {
351 #define DESCRIBE_ABILITY(retbuf, variable, name) \ 354 strcat(retbuf, "(" name ": "); \ 355 for (i = 0; i < NROFATTACKS; i++) \ 356 if (variable&(1<<i)) { \ 358 strcat(retbuf, ", "); \ 361 strcat(retbuf, attacks[i]); \ 363 strcat(retbuf, ")"); \ 366 #define DESCRIBE_PATH(retbuf, variable, name) \ 369 strcat(retbuf, "(" name ": "); \ 370 for (i = 0; i < NRSPELLPATHS; i++) \ 371 if (variable&(1<<i)) { \ 373 strcat(retbuf, ", "); \ 376 strcat(retbuf, spellpathnames[i]); \ 378 strcat(retbuf, ")"); \ 390 fprintf(stderr,
"\n");
394 int tmpvar, gifts = 0;
396 fprintf(stderr,
"GOD: %s\n", god->name);
397 fprintf(stderr,
" avatar stats:\n");
398 fprintf(stderr,
" S:%d C:%d D:%d I:%d W:%d P:%d\n", god->stats.Str, god->stats.Con, god->stats.Dex, god->stats.Int, god->stats.Wis, god->stats.Pow);
399 fprintf(stderr,
" lvl:%d speed:%4.2f\n", god->level, god->speed);
400 fprintf(stderr,
" wc:%d ac:%d hp:%d dam:%d\n", god->stats.wc, god->stats.ac, god->stats.hp, god->stats.dam);
401 fprintf(stderr,
" enemy: %s\n", god->title ? god->title :
"NONE");
402 if (god->other_arch) {
403 object *serv = &god->other_arch->clone;
404 fprintf(stderr,
" servant stats: (%s)\n", god->other_arch->name);
405 fprintf(stderr,
" S:%d C:%d D:%d I:%d W:%d P:%d\n", serv->stats.Str, serv->stats.Con, serv->stats.Dex, serv->stats.Int, serv->stats.Wis, serv->stats.Pow);
406 fprintf(stderr,
" lvl:%d speed:%4.2f\n", serv->level, serv->speed);
407 fprintf(stderr,
" wc:%d ac:%d hp:%d dam:%d\n", serv->stats.wc, serv->stats.ac, serv->stats.hp, serv->stats.dam);
409 fprintf(stderr,
" servant: NONE\n");
410 fprintf(stderr,
" aligned_race(s): %s\n", god->race);
411 fprintf(stderr,
" enemy_race(s): %s\n", (god->slaying ? god->slaying :
"none"));
413 fprintf(stderr,
"%s",
final);
415 snprintf(tmpbuf,
sizeof(tmpbuf),
" attacktype:");
416 if ((tmpvar = god->attacktype)) {
417 strcat(tmpbuf,
"\n ");
420 strcat(tmpbuf,
"\n aura:");
422 strcat(tmpbuf,
"\n paths:");
423 if ((tmpvar = god->path_attuned)) {
424 strcat(tmpbuf,
"\n ");
427 if ((tmpvar = god->path_repelled)) {
428 strcat(tmpbuf,
"\n ");
431 if ((tmpvar = god->path_denied)) {
432 strcat(tmpbuf,
"\n ");
435 fprintf(stderr,
"%s\n", tmpbuf);
436 fprintf(stderr,
" Desc: %s", god->msg ? god->msg :
"---\n");
437 fprintf(stderr,
" Priest gifts/limitations: ");
448 if (god->last_heal) { gifts = 1; fprintf(stderr,
"\n hp regenerate at %d", god->last_heal); }
449 if (god->last_sp) { gifts = 1; fprintf(stderr,
"\n sp regenerate at %d", god->last_sp); }
450 if (god->last_eat) { gifts = 1; fprintf(stderr,
"\n digestion is %s (%d)", god->last_eat < 0 ?
"slowed" :
"faster", god->last_eat); }
451 if (god->last_grace) { gifts = 1; fprintf(stderr,
"\n grace regenerates at %d", god->last_grace); }
452 if (god->stats.luck) { gifts = 1; fprintf(stderr,
"\n luck is %d", god->stats.luck); }
453 if (!gifts) fprintf(stderr,
"NONE");
454 fprintf(stderr,
"\n\n");
void stringbuffer_append_stringbuffer(StringBuffer *sb, const StringBuffer *sb2)
void fatal(enum fatal_error err)
void archetypes_for_each(arch_op op)
StringBuffer * stringbuffer_new(void)
void free_string(sstring str)
int nstrtok(const char *buf1, const char *buf2)
#define DESCRIBE_ABILITY(retbuf, variable, name)
void stringbuffer_append_string(StringBuffer *sb, const char *str)
godlink * get_rand_god(void)
size_t stringbuffer_length(StringBuffer *sb)
const object * pntr_to_god_obj(godlink *godlnk)
EXTERN godlink * first_god
int describe_god(const object *god, int what, StringBuffer *buf, size_t maxlen)
#define QUERY_FLAG(xyz, p)
static void add_god_to_list(archetype *god_arch)
EXTERN const char *const attacktype_desc[NROFATTACKS]
static godlink * init_godslist(void)
#define DESCRIBE_PATH(retbuf, variable, name)
char * strtoktolin(const char *buf1, const char *buf2, char *retbuf, size_t size)
sstring add_string(const char *str)
StringBuffer * describe_resistance(const object *op, int newline, int use_media_tags, StringBuffer *buf)
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
StringBuffer * describe_spellpath_attenuation(const char *attenuation, int value, StringBuffer *buf)
void LOG(LogLevel logLevel, const char *format,...)
#define FLAG_REFL_MISSILE
char * stringbuffer_finish(StringBuffer *sb)