Crossfire Server, Trunk
recipe.c
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 1999-2014 Mark Wedel and the Crossfire Development Team
5  * Copyright (c) 1992 Frank Tore Johansen
6  *
7  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
8  * welcome to redistribute it under certain conditions. For details, please
9  * see COPYING and LICENSE.
10  *
11  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
12  */
13 
35 #include "global.h"
36 
37 #include <assert.h>
38 #include <ctype.h>
39 #include <stdlib.h>
40 #include <string.h>
41 
42 #include "object.h"
43 #include "assets.h"
44 
45 static void build_stringlist(const char *str, char ***result_list, size_t *result_size);
46 
49 
58 static recipelist *init_recipelist(void) {
59  recipelist *tl = (recipelist *)malloc(sizeof(recipelist));
60  if (tl == NULL)
62  tl->total_chance = 0;
63  tl->number = 0;
64  tl->items = NULL;
65  tl->next = NULL;
66  return tl;
67 }
68 
77 static recipe *get_empty_formula(void) {
78  // This used to be a malloc followed by setting everything to zero.
79  // So just use calloc to make it faster.
80  // SilverNexus -- 2018-10-22
81  recipe *t = (recipe *)calloc(1, sizeof(recipe));
82  if (t == NULL)
84  return t;
85 }
86 
97  recipelist *fl = formulalist;
98  int number = i;
99 
100  while (fl && number > 1) {
101  if (!(fl = fl->next))
102  break;
103  number--;
104  }
105  return fl;
106 }
107 
118 static int check_recipe(const recipe *rp) {
119  size_t i;
120  int result;
121 
122  result = 1;
123  for (i = 0; i < rp->arch_names; i++) {
124  if (try_find_archetype(rp->arch_name[i]) != NULL) {
125  if (strcmp(rp->title, "NONE")) {
126  const artifact *art = locate_recipe_artifact(rp, i);
127 
128  if (!art) {
129  LOG(llevError, "Formula %s of %s has no artifact.\n", rp->arch_name[i], rp->title);
130  result = 0;
131  }
132  }
133  } else {
134  LOG(llevError, "Can't find archetype %s for formula %s\n", rp->arch_name[i], rp->title);
135  result = 0;
136  }
137  }
138 
139  return result;
140 }
141 
147  const recipelist *rl = formulalist;
148  int abort = 0;
149  while (rl) {
150  const recipe *rp = rl->items;
151  while (rp) {
152  if (!check_recipe(rp)) {
153  abort = 1;
154  }
155  rp = rp->next;
156  }
157  rl = rl->next;
158  }
159  if (abort) {
161  }
162 }
163 
167 void init_formulae(BufferReader *reader, const char *filename) {
168  char *buf, *cp, *next;
169  recipe *formula = NULL;
170  recipelist *fl;
171  linked_char *tmp;
172  int value;
173 
174  if (!formulalist)
176 
177  while ((buf = bufferreader_next_line(reader)) != NULL) {
178  if (*buf == '#' || *buf == '\0')
179  continue;
180  cp = buf;
181  while (*cp == ' ') /* Skip blanks */
182  cp++;
183 
184  if (!strncmp(cp, "Remove ", 7)) {
185  if (strcmp(cp + 7, "*") == 0) {
188  } else {
189  LOG(llevError, "Recipes: only '*' is accepted for 'Remove' at %s:%d\n", filename, bufferreader_current_line(reader));
190  }
191  continue;
192  }
193  if (!strncmp(cp, "Object", 6)) {
194  formula = get_empty_formula();
195  formula->title = add_string(strchr(cp, ' ')+1);
196  } else if (formula == NULL) {
197  LOG(llevError, "recipe.c: First key in formulae file %s is not \"Object\".\n", filename);
199  } else if (!strncmp(cp, "keycode", 7)) {
200  formula->keycode = add_string(strchr(cp, ' ')+1);
201  } else if (sscanf(cp, "trans %d", &value)) {
202  formula->transmute = value;
203  } else if (sscanf(cp, "yield %d", &value)) {
204  formula->yield = value;
205  } else if (sscanf(cp, "chance %d", &value)) {
206  formula->chance = value;
207  } else if (sscanf(cp, "exp %d", &value)) {
208  formula->exp = value;
209  } else if (sscanf(cp, "diff %d", &value)) {
210  formula->diff = value;
211  } else if (!strncmp(cp, "ingred", 6)) {
212  int numb_ingred;
213  formula->ingred_count = 1;
214  cp = strchr(cp, ' ')+1;
215  do {
216  if ((next = strchr(cp, ',')) != NULL) {
217  *(next++) = '\0';
218  formula->ingred_count++;
219  }
220  tmp = (linked_char *)malloc(sizeof(linked_char));
221  /* trim the string */
222  while (*cp == ' ')
223  cp++;
224  while (*cp != '\0' && cp[strlen(cp) - 1] == ' ')
225  cp[strlen(cp) - 1] = '\0';
226  tmp->name = add_string(cp);
227  tmp->next = formula->ingred;
228  formula->ingred = tmp;
229  /* each ingredient's ASCII value is coadded. Later on this
230  * value will be used allow us to search the formula lists
231  * quickly for the right recipe.
232  */
233  formula->index += strtoint(cp);
234  } while ((cp = next) != NULL);
235  /* now find the correct (# of ingred ordered) formulalist */
236  numb_ingred = formula->ingred_count;
237  fl = formulalist;
238  while (numb_ingred != 1) {
239  if (!fl->next)
240  fl->next = init_recipelist();
241  fl = fl->next;
242  numb_ingred--;
243  }
244  formula->next = fl->items;
245  fl->items = formula;
246  } else if (!strncmp(cp, "arch", 4)) {
247  build_stringlist(strchr(cp, ' ')+1, &formula->arch_name, &formula->arch_names);
248  } else if (!strncmp(cp, "skill", 5)) {
249  formula->skill = add_string(strchr(cp, ' ')+1);
250  } else if (!strncmp(cp, "cauldron", 8)) {
251  formula->cauldron = add_string(strchr(cp, ' ')+1);
252  } else if (!strncmp(cp, "failure_arch ", 13)) {
253  formula->failure_arch = add_string(strchr(cp, ' ')+1);
254  } else if (!strncmp(cp, "failure_message ", 16)) {
255  formula->failure_message = add_string(strchr(cp, ' ')+1);
256  } else if (sscanf(cp, "min_level %d", &value)) {
257  formula->min_level = value;
258  } else if (!strncmp(cp, "tool ", 5)) {
259  build_stringlist(strchr(cp, ' ')+1, &formula->tool, &formula->tool_size);
260  } else if (sscanf(cp, "combination %d", &value)) {
261  formula->is_combination = value ? 1 : 0;
262  } else
263  LOG(llevError, "Unknown input in file %s: %s\n", filename, buf);
264  }
265  /* Set the total chance and count for each formula list.
266  * This needs to be done at the end to avoid dependancies on the field order in the file
267  */
268  for (fl = formulalist; fl; fl = fl->next) {
269  fl->total_chance = 0;
270  fl->number = 0;
271  for (formula = fl->items; formula; formula = formula->next) {
272  fl->total_chance += formula->chance;
273  fl->number++;
274  }
275  }
276  LOG(llevDebug, "done.\n");
277 }
278 
293 void check_formulae(void) {
294  recipelist *fl;
295  recipe *check, *formula;
296  int numb = 1, tool_match;
297  size_t tool_i,tool_j;
298 
299  LOG(llevDebug, "Checking formulae lists...\n");
300 
301  for (fl = formulalist; fl != NULL; fl = fl->next) {
302  for (formula = fl->items; formula != NULL; formula = formula->next) {
303  for (check = formula->next; check != NULL; check = check->next)
304  /* If one recipe has a tool and another a caudron, we should be able to handle it */
305  if (check->index == formula->index &&
306  ((check->cauldron && formula->cauldron && strcmp(check->cauldron, formula->cauldron) == 0) ||
307  (check->tool_size == formula->tool_size && check->tool_size > 0))) {
308  /* Check the tool list to make sure they have no matches */
309  if (check->tool && formula->tool)
310  {
311  tool_match = 0;
312  for (tool_i = 0; tool_i < formula->tool_size; ++tool_i)
313  /* If it turns out these lists are sorted, then we could optimize this better. */
314  for (tool_j = 0; tool_j < check->tool_size; ++tool_j)
315  if (strcmp(formula->tool[tool_i], check->tool[tool_j]) == 0) {
316  tool_match = 1;
317  break; /* TODO: break out of the double loop */
318  }
319  }
320  else
321  tool_match = 1; /* If we get here, we matched on the cauldron */
322  /* Check to see if we have a denoted match */
323  if (tool_match) {
324  /* if the recipes don't have the same facility, then no issue anyway. */
325  LOG(llevError, " ERROR: On %d ingred list:\n", numb);
326  LOG(llevError, "Formulae [%s] of %s and [%s] of %s have matching index id (%d)\n",
327  formula->arch_name[0], formula->title, check->arch_name[0], check->title, formula->index);
328  }
329  }
330  for (size_t idx = 0; idx < formula->arch_names; idx++) {
331  if (try_find_archetype(formula->arch_name[idx]) == NULL) {
332  LOG(llevError, "Formulae %s of %s (%d ingredients) references non existent archetype %s\n",
333  formula->arch_name[0], formula->title, numb, formula->arch_name[idx]);
334  }
335  }
336  }
337  numb++;
338  }
339 
340  LOG(llevDebug, "done checking.\n");
341 }
342 
350 void dump_alchemy(void) {
351  recipelist *fl = formulalist;
352  recipe *formula = NULL;
353  linked_char *next;
354  int num_ingred = 1;
355 
356  fprintf(logfile, "\n");
357  while (fl) {
358  fprintf(logfile, "\n Formulae with %d ingredient%s %d Formulae with total_chance=%d\n", num_ingred, num_ingred > 1 ? "s." : ".", fl->number, fl->total_chance);
359  for (formula = fl->items; formula != NULL; formula = formula->next) {
360  const artifact *art = NULL;
361  char buf[MAX_BUF];
362  size_t i;
363 
364  for (i = 0; i < formula->arch_names; i++) {
365  const char *string = formula->arch_name[i];
366 
367  if (try_find_archetype(string) != NULL) {
368  art = locate_recipe_artifact(formula, i);
369  if (!art && strcmp(formula->title, "NONE"))
370  LOG(llevError, "Formula %s has no artifact\n", formula->title);
371  else {
372  if (strcmp(formula->title, "NONE"))
373  snprintf(buf, sizeof(buf), "%s of %s", string, formula->title);
374  else
375  strlcpy(buf, string, sizeof(buf));
376  fprintf(logfile, "%-30s(%d) bookchance %3d ", buf, formula->index, formula->chance);
377  fprintf(logfile, "skill %s", formula->skill);
378  fprintf(logfile, "\n");
379  if (formula->ingred != NULL) {
380  int nval = 0, tval = 0;
381  fprintf(logfile, "\tIngred: ");
382  for (next = formula->ingred; next != NULL; next = next->next) {
383  if (nval != 0)
384  fprintf(logfile, ",");
385  fprintf(logfile, "%s(%d)", next->name, (nval = strtoint(next->name)));
386  tval += nval;
387  }
388  fprintf(logfile, "\n");
389  if (tval != formula->index)
390  fprintf(logfile, "WARNING:ingredient list and formula values not equal.\n");
391  }
392  if (formula->skill != NULL)
393  fprintf(logfile, "\tSkill Required: %s", formula->skill);
394  if (formula->cauldron != NULL)
395  fprintf(logfile, "\tCauldron: %s\n", formula->cauldron);
396  fprintf(logfile, "\tDifficulty: %d\t Exp: %d\n", formula->diff, formula->exp);
397  }
398  } else
399  LOG(llevError, "Can't find archetype:%s for formula %s\n", string, formula->title);
400  }
401  }
402  fprintf(logfile, "\n");
403  fl = fl->next;
404  num_ingred++;
405  }
406 }
407 
422 archetype *find_treasure_by_name(const treasure *t, const char *name, int depth) {
423  treasurelist *tl;
424  archetype *at;
425 
426  if (depth > 10)
427  return NULL;
428 
429  while (t != NULL) {
430  if (t->name != NULL) {
431  tl = find_treasurelist(t->name);
432  at = find_treasure_by_name(tl->items, name, depth+1);
433  if (at != NULL)
434  return at;
435  } else {
436  if (!strcasecmp(t->item->clone.name, name))
437  return t->item;
438  }
439  if (t->next_yes != NULL) {
440  at = find_treasure_by_name(t->next_yes, name, depth);
441  if (at != NULL)
442  return at;
443  }
444  if (t->next_no != NULL) {
445  at = find_treasure_by_name(t->next_no, name, depth);
446  if (at != NULL)
447  return at;
448  }
449  t = t->next;
450  }
451  return NULL;
452 }
453 
462 void dump_alchemy_costs(void) {
463  recipelist *fl = formulalist;
464  recipe *formula = NULL;
465  linked_char *next;
466  int num_ingred = 1;
467  int num_errors = 0;
468  long cost;
469  long tcost;
470 
471  fprintf(logfile, "\n");
472  while (fl) {
473  fprintf(logfile, "\n Formulae with %d ingredient%s %d Formulae with total_chance=%d\n", num_ingred, num_ingred > 1 ? "s." : ".", fl->number, fl->total_chance);
474  for (formula = fl->items; formula != NULL; formula = formula->next) {
475  const artifact *art = NULL;
476  const archetype *at = NULL;
477  char buf[MAX_BUF];
478  size_t i;
479 
480  for (i = 0; i < formula->arch_names; i++) {
481  const char *string = formula->arch_name[i];
482 
483  if ((at = try_find_archetype(string)) != NULL) {
484  art = locate_recipe_artifact(formula, i);
485  if (!art && strcmp(formula->title, "NONE"))
486  LOG(llevError, "Formula %s has no artifact\n", formula->title);
487  else {
488  if (!strcmp(formula->title, "NONE"))
489  strlcpy(buf, string, sizeof(buf));
490  else
491  snprintf(buf, sizeof(buf), "%s of %s", string, formula->title);
492  fprintf(logfile, "\n%-40s bookchance %3d skill %s\n", buf, formula->chance, formula->skill);
493  if (formula->ingred != NULL) {
494  tcost = 0;
495  for (next = formula->ingred; next != NULL; next = next->next) {
497  if (cost < 0)
498  num_errors++;
499  fprintf(logfile, "\t%-33s%5ld\n", next->name, cost);
500  if (cost < 0 || tcost < 0)
501  tcost = -1;
502  else
503  tcost += cost;
504  }
505  if (art != NULL && art->item != NULL)
506  cost = at->clone.value*art->item->value;
507  else
508  cost = at->clone.value;
509  fprintf(logfile, "\t\tBuying result costs: %5ld", cost);
510  if (formula->yield > 1) {
511  fprintf(logfile, " to %ld (max %d items)\n", cost*formula->yield, formula->yield);
512  cost = cost*(formula->yield+1L)/2L;
513  } else
514  fprintf(logfile, "\n");
515  fprintf(logfile, "\t\tIngredients cost: %5ld\n\t\tComment: ", tcost);
516  if (tcost < 0)
517  fprintf(logfile, "Could not find some ingredients. Check the formula!\n");
518  else if (tcost > cost)
519  fprintf(logfile, "Ingredients are much too expensive. Useless formula.\n");
520  else if (tcost*2L > cost)
521  fprintf(logfile, "Ingredients are too expensive.\n");
522  else if (tcost*10L < cost)
523  fprintf(logfile, "Ingredients are too cheap.\n");
524  else
525  fprintf(logfile, "OK.\n");
526  }
527  }
528  } else
529  LOG(llevError, "Can't find archetype:%s for formula %s\n", string, formula->title);
530  }
531  }
532  fprintf(logfile, "\n");
533  fl = fl->next;
534  num_ingred++;
535  }
536  if (num_errors > 0)
537  fprintf(logfile, "WARNING: %d objects required by the formulae do not exist in the game.\n", num_errors);
538 }
539 
548 static const char *ingred_name(const char *name) {
549  const char *cp = name;
550 
551  if (atoi(cp))
552  cp = strchr(cp, ' ')+1;
553  return cp;
554 }
555 
564 static int numb_ingred(const char *buf) {
565  int numb;
566 
567  if ((numb = atoi(buf)))
568  return numb;
569  else
570  return 1;
571 }
572 
583 int strtoint(const char *buf) {
584  const char *cp = ingred_name(buf);
585  int val = 0, len = strlen(cp), mult = numb_ingred(buf);
586 
587  while (len) {
588  val += tolower(*cp);
589  cp++; len--;
590  }
591  return val*mult;
592 }
593 
604 const artifact *locate_recipe_artifact(const recipe *rp, size_t idx) {
605  object *item = create_archetype(rp->arch_name[idx]);
606  const artifactlist *at = NULL;
607  const artifact *art = NULL;
608 
609  if (!item)
610  return (artifact *)NULL;
611 
612  if ((at = find_artifactlist(item->type)))
613  for (art = at->items; art; art = art->next)
614  if (!strcmp(art->item->name, rp->title) && legal_artifact_combination(item, art))
615  break;
616 
618 
619  return art;
620 }
621 
629  recipelist *fl = NULL;
630  int number = 0, roll = 0;
631 
632  /* first, determine # of recipelist we have */
633  for (fl = get_formulalist(1); fl; fl = fl->next)
634  number++;
635 
636  /* now, randomly choose one */
637  if (number > 0)
638  roll = RANDOM()%number;
639 
640  fl = get_formulalist(1);
641  while (roll && fl) {
642  if (fl->next)
643  fl = fl->next;
644  else
645  break;
646  roll--;
647  }
648  if (!fl) /* failed! */
649  LOG(llevError, "get_random_recipelist(): no recipelists found!\n");
650  else if (fl->total_chance == 0)
651  fl = get_random_recipelist();
652 
653  return fl;
654 }
655 
665  recipelist *fl = rpl;
666  recipe *rp = NULL;
667  int r = 0;
668 
669  /* looks like we have to choose a random one */
670  if (fl == NULL)
671  if ((fl = get_random_recipelist()) == NULL)
672  return rp;
673 
674  if (fl->total_chance > 0) {
675  r = RANDOM()%fl->total_chance;
676  for (rp = fl->items; rp; rp = rp->next) {
677  r -= rp->chance;
678  if (r < 0)
679  break;
680  }
681  }
682  return rp;
683 }
684 
688 void free_all_recipes(void) {
689  recipelist *fl, *flnext;
690  recipe *formula = NULL, *next;
691  linked_char *lchar, *charnext;
692 
693  LOG(llevDebug, "Freeing all the recipes\n");
694  for (fl = formulalist; fl != NULL; fl = flnext) {
695  flnext = fl->next;
696 
697  for (formula = fl->items; formula != NULL; formula = next) {
698  next = formula->next;
699 
700  free(formula->arch_name[0]);
701  free(formula->arch_name);
702  if (formula->title)
703  free_string(formula->title);
704  if (formula->skill)
705  free_string(formula->skill);
706  if (formula->cauldron)
707  free_string(formula->cauldron);
708  if (formula->failure_arch)
709  free_string(formula->failure_arch);
710  if (formula->failure_message)
711  free_string(formula->failure_message);
712  for (lchar = formula->ingred; lchar; lchar = charnext) {
713  charnext = lchar->next;
714  free_string(lchar->name);
715  free(lchar);
716  }
717  if (formula->tool)
718  free(formula->tool[0]);
719  free(formula->tool);
720  free(formula);
721  }
722  free(fl);
723  }
724  formulalist = NULL;
725 }
726 
738 static void build_stringlist(const char *str, char ***result_list, size_t *result_size) {
739  char *dup;
740  char *p;
741  size_t size;
742  size_t i;
743 
744  dup = strdup_local(str);
745  if (dup == NULL)
747 
748  size = 0;
749  for (p = strtok(dup, ","); p != NULL; p = strtok(NULL, ","))
750  size++;
751 
752  assert(size > 0);
753  *result_list = malloc(sizeof(**result_list) * size);
754  if (*result_list == NULL)
756  *result_size = size;
757 
758  for (i = 0; i < size; i++) {
759  (*result_list)[i] = dup;
760  dup = dup+strlen(dup)+1;
761  }
762 }
763 
771 recipe *find_recipe_for_tool(const char *tool, recipe *from) {
772  size_t t;
774  recipe *test = from ? from->next : list->items;
775 
776  while (list) {
777  while (test) {
778  for (t = 0; t < test->tool_size; t++) {
779  if (strcmp(test->tool[t], tool) == 0) {
780  return test;
781  }
782  }
783  test = test->next;
784  }
785 
786  list = list->next;
787  }
788 
789  return NULL;
790 }
791 
797 const Face *recipe_get_face(const recipe *rp) {
798  const artifact *art;
799  archetype *arch;
800  object *item;
801  const Face *face;
802 
803  if (rp->arch_names == 0)
804  return NULL;
805 
807  if (arch == NULL) {
808  return NULL;
809  }
810  if (strcmp(rp->title, "NONE") == 0) {
811  return arch->clone.face;
812  }
813 
814  art = locate_recipe_artifact(rp, 0);
815  if (art == NULL)
816  return arch->clone.face;
817 
818  face = arch->clone.face;
822  if (item->face != NULL && item->face != blank_face)
823  face = item->face;
825 
826  return face;
827 }
recipestruct::arch_names
size_t arch_names
Definition: recipe.h:12
give.next
def next
Definition: give.py:44
Face
Definition: face.h:14
global.h
FREE_OBJ_NO_DESTROY_CALLBACK
#define FREE_OBJ_NO_DESTROY_CALLBACK
Definition: object.h:531
tolower
#define tolower(C)
Definition: c_new.c:30
get_formulalist
recipelist * get_formulalist(int i)
Definition: recipe.c:96
object_free
void object_free(object *ob, int flags)
Definition: object.c:1578
get_empty_formula
static recipe * get_empty_formula(void)
Definition: recipe.c:77
add_string
sstring add_string(const char *str)
Definition: shstr.c:124
llevError
@ llevError
Definition: logger.h:11
give_artifact_abilities
void give_artifact_abilities(object *op, const object *artifact)
Definition: artifact.c:238
recipestruct::yield
int yield
Definition: recipe.h:21
strdup_local
#define strdup_local
Definition: compat.h:29
archininventory.arch
arch
DIALOGCHECK MINARGS 1 MAXARGS 1
Definition: archininventory.py:16
obj::value
int32_t value
Definition: object.h:355
find_recipe_for_tool
recipe * find_recipe_for_tool(const char *tool, recipe *from)
Definition: recipe.c:771
recipestruct::tool
char ** tool
Definition: recipe.h:32
ingred_name
static const char * ingred_name(const char *name)
Definition: recipe.c:548
guildoracle.list
list
Definition: guildoracle.py:87
init_recipelist
static recipelist * init_recipelist(void)
Definition: recipe.c:58
recipeliststruct::next
struct recipeliststruct * next
Definition: recipe.h:41
locate_recipe_artifact
const artifact * locate_recipe_artifact(const recipe *rp, size_t idx)
Definition: recipe.c:604
blank_face
const Face * blank_face
Definition: image.c:35
dump_alchemy_costs
void dump_alchemy_costs(void)
Definition: recipe.c:462
recipestruct::title
sstring title
Definition: recipe.h:11
bufferreader_next_line
char * bufferreader_next_line(BufferReader *br)
Definition: bufferreader.c:102
bufferreader_current_line
size_t bufferreader_current_line(BufferReader *br)
Definition: bufferreader.c:140
find_treasurelist
treasurelist * find_treasurelist(const char *name)
Definition: assets.cpp:263
artifactliststruct::items
struct artifactstruct * items
Definition: artifact.h:30
free_all_recipes
void free_all_recipes(void)
Definition: recipe.c:688
Ice.tmp
int tmp
Definition: Ice.py:207
SEE_LAST_ERROR
@ SEE_LAST_ERROR
Definition: define.h:52
get_random_recipelist
static recipelist * get_random_recipelist(void)
Definition: recipe.c:628
get_random_recipe
recipe * get_random_recipe(recipelist *rpl)
Definition: recipe.c:664
npc_dialog.filename
filename
Definition: npc_dialog.py:99
recipestruct::ingred_count
int ingred_count
Definition: recipe.h:23
recipeliststruct::number
int number
Definition: recipe.h:39
init_formulae
void init_formulae(BufferReader *reader, const char *filename)
Definition: recipe.c:167
recipestruct::chance
int chance
Definition: recipe.h:14
treasurestruct
Definition: treasure.h:63
linked_char
Definition: global.h:86
reputation_trigger_connect.check
def check()
Definition: reputation_trigger_connect.py:18
archt
Definition: object.h:469
free_string
void free_string(sstring str)
Definition: shstr.c:280
strtoint
int strtoint(const char *buf)
Definition: recipe.c:583
recipestruct
Definition: recipe.h:10
dump_alchemy
void dump_alchemy(void)
Definition: recipe.c:350
recipeliststruct::total_chance
int total_chance
Definition: recipe.h:38
check_recipes
void check_recipes()
Definition: recipe.c:146
obj::name
sstring name
Definition: object.h:314
linked_char::name
const char * name
Definition: global.h:87
find_artifactlist
artifactlist * find_artifactlist(int type)
Definition: artifact.c:575
rotate-tower.result
bool result
Definition: rotate-tower.py:13
artifactstruct::next
struct artifactstruct * next
Definition: artifact.h:18
recipestruct::cauldron
sstring cauldron
Definition: recipe.h:27
fatal
void fatal(enum fatal_error err)
Definition: utils.c:580
recipestruct::arch_name
char ** arch_name
Definition: recipe.h:13
make_face_from_files.str
str
Definition: make_face_from_files.py:24
recipestruct::tool_size
size_t tool_size
Definition: recipe.h:33
check_recipe
static int check_recipe(const recipe *rp)
Definition: recipe.c:118
recipestruct::exp
int exp
Definition: recipe.h:17
linked_char::next
struct linked_char * next
Definition: global.h:88
artifactliststruct
Definition: artifact.h:26
recipestruct::keycode
sstring keycode
Definition: recipe.h:25
object_give_identified_properties
void object_give_identified_properties(object *op)
Definition: item.c:1344
recipeliststruct
Definition: recipe.h:37
logfile
EXTERN FILE * logfile
Definition: global.h:134
recipe_get_face
const Face * recipe_get_face(const recipe *rp)
Definition: recipe.c:797
build_stringlist
static void build_stringlist(const char *str, char ***result_list, size_t *result_size)
Definition: recipe.c:738
numb_ingred
static int numb_ingred(const char *buf)
Definition: recipe.c:564
recipestruct::failure_message
sstring failure_message
Definition: recipe.h:29
recipestruct::ingred
linked_char * ingred
Definition: recipe.h:22
strlcpy
size_t strlcpy(char *dst, const char *src, size_t size)
Definition: porting.c:220
MAX_BUF
#define MAX_BUF
Definition: define.h:35
artifactstruct
Definition: artifact.h:14
create_archetype
object * create_archetype(const char *name)
Definition: arch.cpp:281
RANDOM
#define RANDOM()
Definition: define.h:644
recipestruct::skill
sstring skill
Definition: recipe.h:26
recipe_find_ingredient_cost
long recipe_find_ingredient_cost(const char *name)
Definition: assets.cpp:582
treasureliststruct::items
struct treasurestruct * items
Definition: treasure.h:89
Floor.t
t
Definition: Floor.py:62
archt::clone
object clone
Definition: object.h:473
item
Definition: item.py:1
LOG
void LOG(LogLevel logLevel, const char *format,...)
Definition: logger.c:51
recipestruct::min_level
int min_level
Definition: recipe.h:30
autojail.value
value
Definition: autojail.py:6
formulalist
static recipelist * formulalist
Definition: recipe.c:48
assets.h
buf
StringBuffer * buf
Definition: readable.c:1610
recipestruct::next
struct recipestruct * next
Definition: recipe.h:24
recipestruct::diff
int diff
Definition: recipe.h:16
arch_to_object
object * arch_to_object(archetype *at)
Definition: arch.cpp:232
recipestruct::transmute
int transmute
Definition: recipe.h:19
strcasecmp
int strcasecmp(const char *s1, const char *s2)
artifactstruct::item
object * item
Definition: artifact.h:15
recipestruct::is_combination
int is_combination
Definition: recipe.h:31
recipeliststruct::items
struct recipestruct * items
Definition: recipe.h:40
object_free_drop_inventory
void object_free_drop_inventory(object *ob)
Definition: object.c:1546
recipestruct::index
int index
Definition: recipe.h:18
try_find_archetype
archetype * try_find_archetype(const char *name)
Definition: assets.cpp:288
find_treasure_by_name
archetype * find_treasure_by_name(const treasure *t, const char *name, int depth)
Definition: recipe.c:422
FREE_OBJ_FREE_INVENTORY
#define FREE_OBJ_FREE_INVENTORY
Definition: object.h:530
recipestruct::failure_arch
sstring failure_arch
Definition: recipe.h:28
say.item
dictionary item
Definition: say.py:149
diamondslots.cost
int cost
Definition: diamondslots.py:21
check_formulae
void check_formulae(void)
Definition: recipe.c:293
legal_artifact_combination
int legal_artifact_combination(const object *op, const artifact *art)
Definition: artifact.c:260
OUT_OF_MEMORY
@ OUT_OF_MEMORY
Definition: define.h:48
BufferReader
Definition: bufferreader.c:21
ring_occidental_mages.r
r
Definition: ring_occidental_mages.py:6
object.h
llevDebug
@ llevDebug
Definition: logger.h:13
treasureliststruct
Definition: treasure.h:82
give.name
name
Definition: give.py:27