… | |
… | |
286 | } |
286 | } |
287 | |
287 | |
288 | /* Find a treasure with a matching name. The 'depth' parameter is |
288 | /* Find a treasure with a matching name. The 'depth' parameter is |
289 | * only there to prevent infinite loops in treasure lists (a list |
289 | * only there to prevent infinite loops in treasure lists (a list |
290 | * referencing another list pointing back to the first one). */ |
290 | * referencing another list pointing back to the first one). */ |
291 | archetype * |
291 | static archetype * |
292 | find_treasure_by_name (const treasure *t, const char *name, int depth) |
292 | find_treasure_by_name (const treasure *t, const char *name, int depth) |
293 | { |
293 | { |
294 | if (depth > 10) |
294 | if (depth > 10) |
295 | return 0; |
295 | return 0; |
296 | |
296 | |
… | |
… | |
329 | * monsters' body parts, there may be several monsters with the same |
329 | * monsters' body parts, there may be several monsters with the same |
330 | * name. This is not a problem if these monsters have the same level |
330 | * name. This is not a problem if these monsters have the same level |
331 | * (e.g. sage & c_sage) or if only one of the monsters generates the |
331 | * (e.g. sage & c_sage) or if only one of the monsters generates the |
332 | * body parts that we are looking for (e.g. big_dragon and |
332 | * body parts that we are looking for (e.g. big_dragon and |
333 | * big_dragon_worthless). */ |
333 | * big_dragon_worthless). */ |
334 | long |
334 | static long |
335 | find_ingred_cost (const char *name) |
335 | find_ingred_cost (const char *name) |
336 | { |
336 | { |
337 | archetype *at2; |
337 | archetype *at2; |
338 | artifactlist *al; |
338 | artifactlist *al; |
339 | artifact *art; |
339 | artifact *art; |
… | |
… | |
414 | |
414 | |
415 | /* failed to find any matching items -- formula should be checked */ |
415 | /* failed to find any matching items -- formula should be checked */ |
416 | return -1; |
416 | return -1; |
417 | } |
417 | } |
418 | |
418 | |
419 | const char * |
419 | static const char * |
420 | ingred_name (const char *name) |
420 | ingred_name (const char *name) |
421 | { |
421 | { |
422 | const char *cp = name; |
422 | const char *cp = name; |
423 | |
423 | |
424 | if (atoi (cp)) |
424 | if (atoi (cp)) |
425 | cp = strchr (cp, ' ') + 1; |
425 | cp = strchr (cp, ' ') + 1; |
426 | |
426 | |
427 | return cp; |
427 | return cp; |
428 | } |
428 | } |
429 | |
429 | |
430 | int |
430 | static int |
431 | numb_ingred (const char *buf) |
431 | numb_ingred (const char *buf) |
432 | { |
432 | { |
433 | int numb; |
433 | int numb; |
434 | |
434 | |
435 | if ((numb = atoi (buf))) |
435 | if ((numb = atoi (buf))) |
… | |
… | |
471 | return art; |
471 | return art; |
472 | |
472 | |
473 | return 0; |
473 | return 0; |
474 | } |
474 | } |
475 | |
475 | |
476 | recipelist * |
476 | static recipelist * |
477 | get_random_recipelist (void) |
477 | get_random_recipelist (void) |
478 | { |
478 | { |
479 | recipelist *fl = NULL; |
479 | recipelist *fl = NULL; |
480 | int number = 0, roll = 0; |
480 | int number = 0, roll = 0; |
481 | |
481 | |
… | |
… | |
527 | } |
527 | } |
528 | } |
528 | } |
529 | return rp; |
529 | return rp; |
530 | } |
530 | } |
531 | |
531 | |
532 | void |
532 | static void |
533 | free_all_recipes (void) |
533 | free_all_recipes (void) |
534 | { |
534 | { |
535 | recipelist *fl = formulalist, *flnext; |
535 | recipelist *fl = formulalist, *flnext; |
536 | recipe *formula = NULL, *next; |
536 | recipe *formula = NULL, *next; |
537 | linked_char *lchar, *charnext; |
537 | linked_char *lchar, *charnext; |