Crossfire Server, Trunk
bwp.cpp
Go to the documentation of this file.
1 /*
2  * bwp - build wiki pages
3  *
4  * This program will sort out all monster archetypes and print wiki pages
5  * for them, named 'a' through 'z'. It uses some *_template subroutines taken
6  * from Ryo's mapper.c. It should compile if installed in server/trunk/utils.
7  * Please direct all suggestions or corrections to aaron@baugher.biz (or
8  * Mhoram on #crossfire).
9  *
10  * Compile command: g++ -g -O0 bwp.cpp -I../include ../common/libcross.a ../socket/libsocket.a ../types/libtypes.a ../random_maps/librandom_map.a ../server/libserver.a ../common/libcross.a ../socket/libsocket.a ../types/libtypes.a ../random_maps/librandom_map.a -o bwp -lz -lcrypt -lm -lstdc++ -fpermissive -ldl -lcurl -lpthread
11  * (someone should figure the correct order for the link of the libs...)
12  */
13 
14 /*
15  * CrossFire, A Multiplayer game for X-windows
16  *
17  * Copyright (C) 2002-2006 Mark Wedel & Crossfire Development Team
18  * Copyright (C) 1992 Frank Tore Johansen
19  * Copyright (C) 2006-2024 the Crossfire Development Team
20  *
21  * This program is free software; you can redistribute it and/or modify
22  * it under the terms of the GNU General Public License as published by
23  * the Free Software Foundation; either version 2 of the License, or
24  * (at your option) any later version.
25  *
26  * This program is distributed in the hope that it will be useful,
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29  * GNU General Public License for more details.
30  *
31  * You should have received a copy of the GNU General Public License
32  * along with this program; if not, write to the Free Software
33  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
34  *
35  * The authors can be reached via e-mail at crossfire-devel@real-time.com
36  */
37 
38 #define LO_NEWFILE 2
39 #define MAX_SIZE 64
40 #define NA "n/a"
41 
42 #include <time.h>
43 #include <stdio.h>
44 #include <stdlib.h>
45 #include <global.h>
46 #include <sys/stat.h>
47 
48 #include "sproto.h"
49 
50 char *monster_page_head; /* Head of wiki page of monsters */
51 char *monster_page_foot; /* Foot of wiki page of monsters */
52 char *monster_entry; /* A single monster entry */
53 char *monster_canuse_row; /* Can_use table row */
54 char *monster_protected_row; /* Protected table row */
55 char *monster_vulnerable_row; /* Vulnerable table row */
56 char *monster_special_row; /* Special table row */
57 char *monster_attack_row; /* Attack types table row */
58 char *monster_lore_row; /* Lore table row */
59 
60 typedef struct string_array {
61  int16_t count;
62  char **item;
63 } String_Array;
64 
74 const char *const flag_names[NUM_FLAGS+1] = {
75  "alive", "wiz", NULL, NULL, "was_wiz", "applied", "unpaid",
76  "can_use_shield", "no_pick", "client_anim_sync", "client_anim_random", /* 10 */
77  "is_animated", NULL /* slow_move */,
78  NULL /* flying */, "monster", "friendly", "generator",
79  "is_thrown", "auto_apply", "treasure", "player sold", /* 20 */
80  "see_invisible", "can_roll", "overlay_floor",
81  "is_turnable", NULL /* walk_off */, NULL /* fly_on */,
82  NULL /*fly_off*/, "is_used_up", "identified", "reflecting", /* 30 */
83  "changing", "splitting", "hitback", "startequip",
84  "blocksview", "undead", "scared", "unaggressive",
85  "reflect_missile", "reflect_spell", /* 40 */
86  "no_magic", "no_fix_player", "is_lightable", "tear_down",
87  "run_away", NULL /*pass_thru */, NULL /*can_pass_thru*/,
88  "pick_up", "unique", "no_drop", /* 50 */
89  NULL /* wizcast*/, "can_cast_spell", "can_use_scroll", "can_use_range",
90  "can_use_bow", "can_use_armour", "can_use_weapon",
91  "can_use_ring", "has_ready_range", "has_ready_bow", /* 60 */
92  "xrays", NULL, "is_floor", "lifesave", "no_strength", "sleep",
93  "stand_still", "random_movement", "only_attack", "confused", /* 70 */
94  "stealth", NULL, NULL, "cursed", "damned",
95  "see_anywhere", "known_magical", "known_cursed",
96  "can_use_skill", "been_applied", /* 80 */
97  "has_ready_scroll", NULL, NULL,
98  NULL, "make_invisible", "inv_locked", "is_wooded",
99  "is_hilly", "has_ready_skill", "has_ready_weapon", /* 90 */
100  "no_skill_ident", "is_blind", "can_see_in_dark", "is_cauldron",
101  "is_dust", "no_steal", "one_hit", NULL, "berserk", "neutral", /* 100 */
102  "no_attack", "no_damage", NULL, NULL, "activate_on_push",
103  "activate_on_release", "is_water", "use_content_on_gen", NULL, "is_buildable", /* 110 */
104  NULL, "blessed", "known_blessed"
105 };
106 
117 static char *cat_template(char *source, char *add) {
118  if (!source)
119  return add;
120  source = realloc(source, strlen(source)+strlen(add)+1);
121  strcat(source, add);
122  free(add);
123  return source;
124 }
125 
136 static int read_template(const char *name, char **buffer) {
137  FILE *file;
138  size_t size;
139  struct stat info;
140 
141  if (stat(name, &info)) {
142  printf("Couldn't stat template %s!\n", name);
143  return 1;
144  }
145 
146  (*buffer) = calloc(1, info.st_size+1);
147  if (!(*buffer)) {
148  printf("Template %s calloc failed!\n", name);
149  return 1;
150  }
151 
152  if (info.st_size == 0) {
153  (*buffer)[0] = '\0';
154  return 0;
155  }
156 
157  file = fopen(name, "rb");
158  if (!file) {
159  printf("Couldn't open template %s!\n", name);
160  free(*buffer);
161  return 1;
162  }
163  if (fread(*buffer, info.st_size, 1, file) != 1) {
164  printf("Couldn't read template %s!\n", name);
165  free(*buffer);
166  fclose(file);
167  return 1;
168  }
169  fclose(file);
170  return 0;
171 }
172 
190 static char *do_template(const char *tpl, const char **vars, const char **values) {
191  int count = 0;
192  const char *sharp = tpl;
193  int maxlen = 0;
194  int var = 0;
195  char *result;
196  char *current_result;
197  const char *end;
198 
199  while ((sharp = strchr(sharp, '#')) != NULL) {
200  sharp++;
201  count++;
202  }
203  if (!count)
204  return strdup(tpl);
205  if (count%2) {
206  printf("Malformed template, mismatched #!\n");
207  return strdup(tpl);
208  }
209 
210  while (vars[var] != NULL) {
211  if (strlen(values[var]) > maxlen)
212  maxlen = strlen(values[var]);
213  var++;
214  }
215  result = calloc(1, strlen(tpl)+maxlen*(count/2)+1);
216  if (!result)
217  return NULL;
218  current_result = result;
219 
220  sharp = tpl;
221  while ((sharp = strchr(sharp, '#')) != NULL) {
222  end = strchr(sharp+1, '#');
223  strncpy(current_result, tpl, sharp-tpl);
224  if (end == sharp+1) {
225  strcat(current_result, "#");
226  } else {
227  current_result = current_result+strlen(current_result);
228  var = 0;
229  while (vars[var] != 0 && strncmp(vars[var], sharp+1, end-sharp-1))
230  var++;
231  if (vars[var] == 0)
232  printf("Wrong tag: %s\n", sharp);
233  else
234  strcpy(current_result, values[var]);
235  }
236  current_result = current_result+strlen(current_result);
237  sharp = end+1;
238  tpl = sharp;
239  }
240  strcat(current_result, tpl);
241  return result;
242 }
243 
244 /**** Mhoram's code starts here *****/
245 
258 static void free_if_used(char *p) {
259  if (p && strlen(p) > 0) {
260  free(p);
261  }
262 }
263 
276 static int sortbyname(const void *a, const void *b) {
277  return (strcasecmp(*(const char **)a, *(const char **)b));
278 }
279 
293 static int sort_archetypes(const void *a, const void *b) {
294  archetype *aa;
295  archetype *bb;
296 
297  aa = *(archetype **)a;
298  bb = *(archetype **)b;
299 
300  return (strcasecmp(aa->clone.name, bb->clone.name));
301 }
302 
315 void push(String_Array *array, const char *string) {
316  int16_t i = array->count;
317 
318  array->item[i] = strdup_local(string);
319  array->count++;
320 }
321 
330 void free_data(String_Array *array) {
331  int item;
332 
333  for (item = 0; item < array->count; item++)
334  free(array->item[item]);
335  free(array->item);
336  array->item = NULL;
337 }
338 
349 const char *join_with_comma(String_Array *array) {
350  char *newtext;
351  int i;
352 
353  newtext = calloc(1, 1);
354  qsort(array->item, array->count, sizeof(char *), sortbyname);
355  for (i = 0; i < array->count; i++) {
356  if (i) {
357  newtext = realloc(newtext, strlen(newtext)+strlen(", ")+1);
358  newtext = strncat(newtext, ", ", 2);
359  }
360  newtext = realloc(newtext, strlen(newtext)+strlen(array->item[i])+1);
361  newtext = strncat(newtext, array->item[i], strlen(array->item[i]));
362  }
363  return newtext;
364 }
365 
366 int main(int argc, char *argv[]) {
367 
368  archetype *at;
369  int archnum = 0;
370  archetype *monster[4000];
371  int i;
372  char letter;
373  char last_letter;
374  char *wiki_page = NULL;
375  char *monster_entries = NULL;
376 
377  FILE *fp = NULL;
378  FILE *image_list;
379  char image_list_path[128];
380  char wikifile[128];
381  char *tpl;
382 
383  const char *wikidir = "/tmp"; /* Should change this to come from command line? */
384 
385  init_globals();
386  init_library();
387  init_readable();
388 
389  init_gods();
390 
391  /* Initialize templates */
392  if (read_template("templates/wiki/monster_page_head", &monster_page_head))
393  return;
394  if (read_template("templates/wiki/monster_page_foot", &monster_page_foot))
395  return;
396  if (read_template("templates/wiki/monster_entry", &monster_entry))
397  return;
398  if (read_template("templates/wiki/monster_canuse_row", &monster_canuse_row))
399  return;
400  if (read_template("templates/wiki/monster_protected_row", &monster_protected_row))
401  return;
402  if (read_template("templates/wiki/monster_vulnerable_row", &monster_vulnerable_row))
403  return;
404  if (read_template("templates/wiki/monster_special_row", &monster_special_row))
405  return;
406  if (read_template("templates/wiki/monster_attack_row", &monster_attack_row))
407  return;
408  if (read_template("templates/wiki/monster_lore_row", &monster_lore_row))
409  return;
410  sprintf(image_list_path, "%s/image_list", wikidir);
411  image_list = fopen(image_list_path, "w");
412  if (!image_list) {
413  LOG(llevError, "Unable to open image list file!\n");
414  exit(1);
415  }
416 
417  /* Pick out the monster archetypes and sort them into an array */
418  for (at = get_next_archetype(NULL); at != NULL; at = get_next_archetype(at)) {
419  if (QUERY_FLAG(&at->clone, FLAG_MONSTER)
420  && QUERY_FLAG(&at->clone, FLAG_ALIVE)) {
421  monster[archnum++] = at;
422  }
423  }
424  printf("Sorting...");
425  /* Calling qsort on monster, which is archetype** */
426  qsort(&monster[0], archnum, sizeof(archetype *), sort_archetypes);
427  printf("done. %i items found\n", archnum);
428 
429  last_letter = '\0';
430 
431  for (i = 0; i < archnum; i++) {
432  at = monster[i];
433  if (at) {
434  const char *key[16] = { NULL, };
435  const char *val[16] = { NULL, };
436  char buf[16][MAX_BUF];
437  int keycount = 0;
438  int res;
439 
440  letter = tolower(at->clone.name[0]);
441 
442  LOG(llevInfo, "Doing archetype %s\n", at->name);
443 
444  if (letter != last_letter) { /* New letter, new file */
445  if (fp) {
446  keycount = 0;
447  key[keycount] = NULL;
448  tpl = do_template(monster_page_foot, key, val);
449  res = fprintf(fp, "%s", tpl);
450  free(tpl);
451  tpl = NULL;
452  if (res < 0) {
453  LOG(llevError, "Unable to write to file!\n");
454  }
455  fclose(fp);
456  }
457 
458  snprintf(wikifile, sizeof(wikifile), "%s/%c", wikidir, letter);
459  fp = fopen(wikifile, "w");
460  if (!fp) {
461  fprintf(stderr, "Unable to write to wiki file!\n");
462  exit(1);
463  }
464 
465  char letterindex[256] = "";
466  char letterindexnext[7];
467  char li;
468  letterindexnext[0] = '\0';
469  for (li = 'a'; li <= 'z'; li++) {
470  char *p;
471 
472  if (li == letter) {
473  sprintf(letterindexnext, "%c ", toupper(li));
474  } else {
475  sprintf(letterindexnext, "[[%c]] ", toupper(li));
476  }
477  p = strchr(letterindex, '\0');
478  snprintf(p, letterindex+sizeof(letterindex)-p, "%s", letterindexnext);
479  }
480 
481  keycount = 0;
482  key[keycount] = "LETTER";
483  sprintf(buf[keycount], "%c", toupper(letter));
484  val[keycount++] = buf[keycount];
485  key[keycount] = "LETTERINDEX";
486  val[keycount++] = letterindex;
487  key[keycount] = NULL;
488  tpl = do_template(monster_page_head, key, val);
489  res = fprintf(fp, tpl);
490  free(tpl);
491  if (res < 0) {
492  LOG(llevError, "Unable to write to file!");
493  }
494  last_letter = letter;
495  }
496 
497  /* add a monster entry */
498  char *canuse_row;
499  char *protected_row;
500  char *vulnerable_row;
501  char *special_row;
502  char *attack_row;
503  char *lore_row;
504  const int CANUSE_LENGTH = 16;
505  String_Array canuse;
506  String_Array resist;
507  String_Array vulner;
508  String_Array attack;
509  String_Array special;
510  /* Some flags that seemed useful; may need to add to this list.
511  * *special_names[] is used because some of the names in
512  * define.h are a bit awkward. Last one is negative to mark end.
513  */
514  const int8_t special_flags[] = { 21, 93, 52, 38, 13, 32, 61, -1 };
515  const char *special_names[] = {
516  "see invisible",
517  "see in dark",
518  "spellcaster",
519  "unaggressive",
520  "flying",
521  "splitting",
522  "x-ray vision"
523  };
524  int j;
525 
526  canuse.item = calloc((CANUSE_LENGTH+1), sizeof(const char *));
527  resist.item = calloc((NROFATTACKS+1), sizeof(const char *));
528  vulner.item = calloc((NROFATTACKS+1), sizeof(const char *));
529  attack.item = calloc((NROFATTACKS+1), sizeof(const char *));
530  special.item = calloc((NROFATTACKS+1), sizeof(const char *));
531 
532  /* Do lore row */
533  if (at->clone.lore) {
534  key[keycount] = "LORE";
535  key[keycount+1] = NULL;
536  val[keycount] = at->clone.lore;
537  keycount++;
538  lore_row = do_template(monster_lore_row, key, val);
539  } else
540  lore_row = strdup("");
541 
542  /* Do canuse row */
543  canuse.count = 0;
544  keycount = 0;
545  for (j = 1; j <= NUM_FLAGS; j++) {
546  if (QUERY_FLAG(&at->clone, j)
547  && flag_names[j]
548  && !strncmp(flag_names[j], "can_use_", 8)) {
549  push(&canuse, flag_names[j]+8);
550  }
551  }
552  if (canuse.count) {
553  key[keycount] = "CANUSE";
554  key[keycount+1] = NULL;
555  val[keycount] = join_with_comma(&canuse);
556  canuse_row = do_template(monster_canuse_row, key, val);
557  free(val[keycount]);
558  } else
559  canuse_row = strdup("");
560 
561  /* Do protected/vulnerable rows */
562  resist.count = 0;
563  vulner.count = 0;
564  for (j = 0; j <= NROFATTACKS; j++) {
565  if (at->clone.resist[j] && attacktype_desc[j]) {
566  char rowtext[32];
567 
568  if (at->clone.resist[j] < 0) {
569  sprintf(rowtext, "%s %i", attacktype_desc[j], at->clone.resist[j]);
570  push(&vulner, rowtext);
571  } else {
572  sprintf(rowtext, "%s +%i", attacktype_desc[j], at->clone.resist[j]);
573  push(&resist, rowtext);
574  }
575  }
576  }
577  keycount = 0;
578  if (resist.count) {
579  key[keycount] = "PROTECTED";
580  key[keycount+1] = NULL;
581  val[keycount] = join_with_comma(&resist);
582  protected_row = do_template(monster_protected_row, key, val);
583  free(val[keycount]);
584  } else
585  protected_row = strdup("");
586 
587  keycount = 0;
588  if (vulner.count) {
589  key[keycount] = "VULNERABLE";
590  key[keycount+1] = NULL;
591  val[keycount] = join_with_comma(&vulner);
592  vulnerable_row = do_template(monster_vulnerable_row, key, val);
593  free(val[keycount]);
594  } else
595  vulnerable_row = strdup("");
596 
597  /* Do attacktype row */
598  attack.count = 0;
599  keycount = 0;
600  val[keycount] = NULL;
601  for (j = 0; j <= NROFATTACKS; j++) {
602  if (at->clone.attacktype&(1U<<j)) {
603  push(&attack, attacktype_desc[j]);
604  }
605  }
606  if (attack.count) {
607  key[keycount] = "ATTACKS";
608  key[keycount+1] = NULL;
609  val[keycount] = join_with_comma(&attack);
610  attack_row = do_template(monster_attack_row, key, val);
611  free(val[keycount]);
612  } else
613  attack_row = strdup("");
614 
615  /* Do special row */
616  special.count = 0;
617  keycount = 0;
618  val[keycount] = NULL;
619  for (j = 0; special_flags[j] >= 0; j++) {
620  if (QUERY_FLAG(&at->clone, special_flags[j])) {
621  push(&special, special_names[j]);
622  }
623  }
624  if (special.count) {
625  key[keycount] = "SPECIAL";
626  key[keycount+1] = NULL;
627  val[keycount] = join_with_comma(&special);
628  special_row = do_template(monster_special_row, key, val);
629  free(val[keycount]);
630  } else
631  special_row = strdup("");
632 
633  keycount = 0;
634  key[keycount] = "CANUSEROW";
635  val[keycount++] = canuse_row;
636  key[keycount] = "PROTECTEDROW";
637  val[keycount++] = protected_row;
638  key[keycount] = "VULNERABLEROW";
639  val[keycount++] = vulnerable_row;
640  key[keycount] = "SPECIALROW";
641  val[keycount++] = attack_row;
642  key[keycount] = "ATTACKROW";
643  val[keycount++] = special_row;
644  key[keycount] = "LOREROW";
645  val[keycount++] = lore_row;
646  key[keycount] = "XP";
647  sprintf(buf[keycount], "%li", at->clone.stats.exp);
648  val[keycount++] = buf[keycount];
649  key[keycount] = "HP";
650  sprintf(buf[keycount], "%i", at->clone.stats.hp);
651  val[keycount++] = buf[keycount];
652  key[keycount] = "AC";
653  sprintf(buf[keycount], "%i", at->clone.stats.ac);
654  val[keycount++] = buf[keycount];
655  key[keycount] = "NAME";
656  val[keycount++] = at->clone.name;
657  key[keycount] = "RACE";
658  if (at->clone.race) {
659  val[keycount++] = at->clone.race;
660  } else {
661  val[keycount++] = NA;
662  }
663  if (at->clone.face->name) {
664  key[keycount] = "FACE";
665  sprintf(buf[keycount], "{{http://aaron.baugher.biz/images/cf/%s.png}}", at->clone.face->name);
666  val[keycount++] = buf[keycount];
667  sprintf(buf[keycount], "%s.png\n", at->clone.face->name);
668  fprintf(image_list, buf[keycount]);
669  }
670 /* Plan to add generator face too, when I decide how */
671  key[keycount] = "GENFACE";
672  val[keycount++] = "";
673  key[keycount] = NULL;
674 
675  tpl = do_template(monster_entry, key, val);
676  fprintf(fp, tpl);
677  free(tpl);
678  tpl = NULL;
679 
680  free_data(&canuse);
681  free_data(&resist);
682  free_data(&vulner);
683  free_data(&attack);
684  free_data(&special);
685  free(canuse_row);
686  free(protected_row);
687  free(vulnerable_row);
688  free(attack_row);
689  free(special_row);
690  free(lore_row);
691  } else {
692  LOG(llevError, "Something is very wrong.\n");
693  }
694  }
695  fclose(image_list);
696 }
697 
698 void set_map_timeout(void) {
699  /* doesn't need to do anything */
700 }
701 
702 #include <global.h>
703 
704 #if 0
705 /* some plagarized code from apply.c--I needed just these two functions
706  without all the rest of the junk, so.... */
707 int apply_auto(object *op) {
708  object *tmp = NULL;
709  int i;
710 
711  switch (op->type) {
712  case SHOP_FLOOR:
713  if (!HAS_RANDOM_ITEMS(op))
714  return 0;
715  do {
716  i = 10; /* let's give it 10 tries */
717  while ((tmp = generate_treasure(op->randomitems, op->stats.exp ? op->stats.exp : 5)) == NULL && --i)
718  ;
719  if (tmp == NULL)
720  return 0;
723  tmp = NULL;
724  }
725  } while (!tmp);
726 
728  object_insert_in_map_at(tmp, op->map, NULL, 0, op->x, op->y);
730  tmp = identify(tmp);
731  break;
732 
733  case TREASURE:
734  if (HAS_RANDOM_ITEMS(op))
735  while ((op->stats.hp--) > 0)
736  create_treasure(op->randomitems, op, GT_ENVIRONMENT, op->stats.exp ? op->stats.exp : op->map == NULL ? 14 : op->map->difficulty, 0);
737  object_remove(op);
739  break;
740  }
741 
742  return tmp ? 1 : 0;
743 }
744 
745 /* apply_auto_fix goes through the entire map (only the first time
746  * when an original map is loaded) and performs special actions for
747  * certain objects (most initialization of chests and creation of
748  * treasures and stuff). Calls apply_auto if appropriate.
749  */
750 void apply_auto_fix(mapstruct *m) {
751  object *tmp, *above = NULL;
752  int x, y;
753 
754  for (x = 0; x < MAP_WIDTH(m); x++)
755  for (y = 0; y < MAP_HEIGHT(m); y++)
756  for (tmp = GET_MAP_OB(m, x, y); tmp != NULL; tmp = above) {
757  above = tmp->above;
758 
760  apply_auto(tmp);
761  else if (tmp->type == TREASURE) {
762  if (HAS_RANDOM_ITEMS(tmp))
763  while ((tmp->stats.hp--) > 0)
764  create_treasure(tmp->randomitems, tmp, 0, m->difficulty, 0);
765  }
766  if (tmp
767  && tmp->arch
768  && tmp->type != PLAYER
769  && tmp->type != TREASURE
770  && tmp->randomitems) {
771  if (tmp->type == CONTAINER) {
772  if (HAS_RANDOM_ITEMS(tmp))
773  while ((tmp->stats.hp--) > 0)
774  create_treasure(tmp->randomitems, tmp, 0, m->difficulty, 0);
775  } else if (HAS_RANDOM_ITEMS(tmp)) {
776  create_treasure(tmp->randomitems, tmp, 0, m->difficulty, 0);
777  if (QUERY_FLAG(tmp, FLAG_MONSTER)) {
779  }
780  }
781  }
782  }
783  for (x = 0; x < MAP_WIDTH(m); x++)
784  for (y = 0; y < MAP_HEIGHT(m); y++)
785  for (tmp = GET_MAP_OB(m, x, y); tmp != NULL; tmp = tmp->above)
786  if (tmp->above
787  && (tmp->type == TRIGGER_BUTTON || tmp->type == TRIGGER_PEDESTAL))
788  check_trigger(tmp, tmp->above);
789 }
790 #endif
791 #ifndef DOXYGEN_SHOULD_SKIP_THIS
792 
793 #if 0
794 
799 void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *txt) {
800  fprintf(logfile, "%s\n", txt);
801 }
802 
803 void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format, ...) {
804  va_list ap;
805  va_start(ap, format);
806  vfprintf(logfile, format, ap);
807  va_end(ap);
808 }
809 
810 void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1) {
811  fprintf(logfile, "ext_info_map: %s\n", str1);
812 }
813 
814 void move_firewall(object *ob) {
815 }
816 
817 void emergency_save(int x) {
818 }
819 
820 void clean_tmp_files(void) {
821 }
822 
823 void esrv_send_item(object *ob, object *obx) {
824 }
825 
826 void dragon_ability_gain(object *ob, int x, int y) {
827 }
828 
830 }
831 
832 object *find_skill_by_number(object *who, int skillno) {
833  return NULL;
834 }
835 
836 void esrv_del_item(player *pl, object *ob) {
837 }
838 
840 }
841 #endif
842 #endif /* dummy DOXYGEN_SHOULD_SKIP_THIS */
Face::name
sstring name
Definition: face.h:19
GET_MAP_OB
#define GET_MAP_OB(M, X, Y)
Definition: map.h:170
init_globals
void init_globals(void)
Definition: init.cpp:396
living::exp
int64_t exp
Definition: living.h:47
HAS_RANDOM_ITEMS
#define HAS_RANDOM_ITEMS(op)
Definition: define.h:184
PLAYER
@ PLAYER
Definition: object.h:112
global.h
emergency_save
void emergency_save(int flag)
Definition: main.cpp:347
llevError
@ llevError
Definition: logger.h:11
find_skill_by_number
object * find_skill_by_number(object *who, int skillno)
Definition: main.cpp:375
string_array::count
int16_t count
Definition: bwp.cpp:61
LOG
void LOG(LogLevel logLevel, const char *format,...)
Definition: logger.cpp:58
SET_FLAG
#define SET_FLAG(xyz, p)
Definition: define.h:224
player
Definition: player.h:105
strdup_local
#define strdup_local
Definition: compat.h:29
diamondslots.x
x
Definition: diamondslots.py:15
QUERY_FLAG
#define QUERY_FLAG(xyz, p)
Definition: define.h:226
get_next_archetype
archetype * get_next_archetype(archetype *current)
Definition: assets.cpp:262
TRIGGER_PEDESTAL
@ TRIGGER_PEDESTAL
Definition: object.h:139
join_with_comma
const char * join_with_comma(String_Array *array)
Definition: bwp.cpp:349
disinfect.a
a
Definition: disinfect.py:13
SHOP_FLOOR
@ SHOP_FLOOR
Definition: object.h:188
monster_protected_row
char * monster_protected_row
Definition: bwp.cpp:54
guildjoin.ob
ob
Definition: guildjoin.py:42
draw_ext_info_format
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
NUM_FLAGS
#define NUM_FLAGS
Definition: define.h:374
mad_mage_user.file
file
Definition: mad_mage_user.py:15
TREASURE
@ TREASURE
Definition: object.h:115
flags
static const flag_definition flags[]
Definition: gridarta-types-convert.cpp:101
esrv_update_spells
void esrv_update_spells(player *pl)
Definition: main.cpp:386
tolower
#define tolower(C)
Definition: c_new.cpp:30
sort_archetypes
static int sort_archetypes(const void *a, const void *b)
Definition: bwp.cpp:293
Ice.tmp
int tmp
Definition: Ice.py:207
NROFATTACKS
#define NROFATTACKS
Definition: attack.h:17
TRIGGER_BUTTON
@ TRIGGER_BUTTON
Definition: object.h:137
smoking_pipe.color
color
Definition: smoking_pipe.py:5
create_treasure
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
Definition: treasure.cpp:263
monster_lore_row
char * monster_lore_row
Definition: bwp.cpp:58
buf
StringBuffer * buf
Definition: readable.cpp:1565
object::resist
int16_t resist[NROFATTACKS]
Definition: object.h:351
dragon_ability_gain
void dragon_ability_gain(object *who, int atnr, int level)
Definition: main.cpp:365
FLAG_ALIVE
#define FLAG_ALIVE
Definition: define.h:230
esrv_send_item
void esrv_send_item(object *pl, object *op)
Definition: main.cpp:354
init_gods
void init_gods(void)
Definition: holy.cpp:59
m
static event_registration m
Definition: citylife.cpp:425
set_darkness_map
void set_darkness_map(mapstruct *m)
Definition: main.cpp:371
autojail.who
who
Definition: autojail.py:3
apply_auto_fix
void apply_auto_fix(mapstruct *m)
Definition: main.cpp:258
object_free_drop_inventory
void object_free_drop_inventory(object *ob)
Definition: object.cpp:1560
disinfect.map
map
Definition: disinfect.py:4
monster_page_foot
char * monster_page_foot
Definition: bwp.cpp:51
push
void push(String_Array *array, const char *string)
Definition: bwp.cpp:315
rotate-tower.result
bool result
Definition: rotate-tower.py:13
String_Array
struct string_array String_Array
main
int main(int argc, char *argv[])
Definition: bwp.cpp:366
cat_template
static char * cat_template(char *source, char *add)
Definition: bwp.cpp:117
archetype::clone
object clone
Definition: object.h:487
string_array
Definition: bwp.cpp:60
CONTAINER
@ CONTAINER
Definition: object.h:236
init_readable
void init_readable(void)
Definition: readable.cpp:904
ext_info_map
void void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
Definition: main.cpp:334
object::face
const Face * face
Definition: object.h:341
free_data
void free_data(String_Array *array)
Definition: bwp.cpp:330
Ice.b
b
Definition: Ice.py:48
FLAG_DAMNED
#define FLAG_DAMNED
Definition: define.h:317
move_firewall
void move_firewall(object *op)
Definition: main.cpp:343
disinfect.count
int count
Definition: disinfect.py:7
archetype
Definition: object.h:483
sproto.h
logfile
FILE * logfile
Definition: init.cpp:114
GT_ENVIRONMENT
@ GT_ENVIRONMENT
Definition: treasure.h:31
object::race
sstring race
Definition: object.h:326
monster_attack_row
char * monster_attack_row
Definition: bwp.cpp:57
object_insert_in_map_at
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Definition: object.cpp:2100
FLAG_MONSTER
#define FLAG_MONSTER
Definition: define.h:245
NA
#define NA
Definition: bwp.cpp:40
MAP_WIDTH
#define MAP_WIDTH(m)
Definition: map.h:73
sortbyname
static int sortbyname(const void *a, const void *b)
Definition: bwp.cpp:276
MAX_BUF
#define MAX_BUF
Definition: define.h:35
esrv_del_item
void esrv_del_item(player *pl, object *ob)
Definition: main.cpp:381
monster_check_apply_all
void monster_check_apply_all(object *monster)
Definition: monster.cpp:1999
read_template
static int read_template(const char *name, char **buffer)
Definition: bwp.cpp:136
check_trigger
int check_trigger(object *op, object *cause)
Definition: button.cpp:518
apply_auto
int apply_auto(object *op)
Definition: main.cpp:211
object::lore
sstring lore
Definition: object.h:332
llevInfo
@ llevInfo
Definition: logger.h:12
monster_canuse_row
char * monster_canuse_row
Definition: bwp.cpp:53
clean_tmp_files
void clean_tmp_files(void)
Definition: main.cpp:351
init_library
void init_library(void)
Definition: init.cpp:324
object::name
sstring name
Definition: object.h:319
attacktype_desc
const char *const attacktype_desc[NROFATTACKS]
Definition: init.cpp:40
item
Definition: item.py:1
mapstruct
Definition: map.h:313
give.op
op
Definition: give.py:33
FLAG_AUTO_APPLY
#define FLAG_AUTO_APPLY
Definition: define.h:250
diamondslots.y
y
Definition: diamondslots.py:16
CLEAR_FLAG
#define CLEAR_FLAG(xyz, p)
Definition: define.h:225
MAP_HEIGHT
#define MAP_HEIGHT(m)
Definition: map.h:75
living::ac
int8_t ac
Definition: living.h:38
set_map_timeout
void set_map_timeout(void)
Definition: bwp.cpp:698
free_if_used
static void free_if_used(char *p)
Definition: bwp.cpp:258
strcasecmp
int strcasecmp(const char *s1, const char *s2)
do_template
static char * do_template(const char *tpl, const char **vars, const char **values)
Definition: bwp.cpp:190
castle_read.key
key
Definition: castle_read.py:64
monster_special_row
char * monster_special_row
Definition: bwp.cpp:56
draw_ext_info
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
Definition: main.cpp:308
monster_page_head
char * monster_page_head
Definition: bwp.cpp:50
object_remove
void object_remove(object *op)
Definition: object.cpp:1833
FLAG_UNPAID
#define FLAG_UNPAID
Definition: define.h:236
generate_treasure
object * generate_treasure(treasurelist *t, int difficulty)
Definition: treasure.cpp:295
monster_entry
char * monster_entry
Definition: bwp.cpp:52
archetype::name
sstring name
Definition: object.h:484
say.item
dictionary item
Definition: say.py:149
flag_names
const char *const flag_names[NUM_FLAGS+1]
Definition: bwp.cpp:74
object::stats
living stats
Definition: object.h:378
object::attacktype
uint32_t attacktype
Definition: object.h:352
FLAG_CURSED
#define FLAG_CURSED
Definition: define.h:316
string_array::item
char ** item
Definition: bwp.cpp:62
altar_valkyrie.pl
pl
Definition: altar_valkyrie.py:28
monster_vulnerable_row
char * monster_vulnerable_row
Definition: bwp.cpp:55
living::hp
int16_t hp
Definition: living.h:40
altar_valkyrie.res
int res
Definition: altar_valkyrie.py:74
is_valid_types_gen.type
list type
Definition: is_valid_types_gen.py:25
give.name
name
Definition: give.py:27
identify
object * identify(object *op)
Definition: item.cpp:1421