1 | /* |
1 | /* |
2 | * CrossFire, A Multiplayer game for X-windows |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (C) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * it under the terms of the GNU General Public License as published by |
9 | * the terms of the Affero GNU General Public License as published by the |
10 | * the Free Software Foundation; either version 2 of the License, or |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * (at your option) any later version. |
11 | * option) any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
16 | * GNU General Public License for more details. |
17 | * |
17 | * |
18 | * You should have received a copy of the GNU General Public License |
18 | * You should have received a copy of the Affero GNU General Public License |
19 | * along with this program; if not, write to the Free Software |
19 | * and the GNU General Public License along with this program. If not, see |
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | * <http://www.gnu.org/licenses/>. |
21 | * |
21 | * |
22 | * The authors can be reached via e-mail at <crossfire@schmorp.de> |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
23 | */ |
23 | */ |
24 | |
24 | |
25 | /* March 96 - Laid down original code. -b.t. thomas@astro.psu.edu */ |
25 | /* March 96 - Laid down original code. -b.t. thomas@astro.psu.edu */ |
26 | |
26 | |
27 | #include <global.h> |
27 | #include <global.h> |
… | |
… | |
56 | "rattles", |
56 | "rattles", |
57 | "makes chugging sounds", |
57 | "makes chugging sounds", |
58 | "smokes heavily for a while" |
58 | "smokes heavily for a while" |
59 | }; |
59 | }; |
60 | |
60 | |
61 | |
|
|
62 | static int is_defined_recipe (const recipe *rp, const object *cauldron, object *caster); |
61 | static int is_defined_recipe (const recipe *rp, const object *cauldron, object *caster); |
63 | static recipe *find_recipe (recipelist * fl, int formula, object *ingredients); |
62 | static recipe *find_recipe (recipelist * fl, int formula, object *ingredients); |
64 | |
|
|
65 | |
63 | |
66 | /** Returns a random selection from cauldron_effect[] */ |
64 | /** Returns a random selection from cauldron_effect[] */ |
67 | static const char * |
65 | static const char * |
68 | cauldron_sound (void) |
66 | cauldron_sound (void) |
69 | { |
67 | { |
70 | int size = sizeof (cauldron_effect) / sizeof (char *); |
68 | int size = sizeof (cauldron_effect) / sizeof (char *); |
71 | |
69 | |
72 | return cauldron_effect[rndm (0, size - 1)]; |
70 | return cauldron_effect[rndm (0, size - 1)]; |
73 | } |
71 | } |
74 | |
72 | |
75 | /**
|
73 | /** |
76 | * Main part of the ALCHEMY code. From this we call fctns |
74 | * Main part of the ALCHEMY code. From this we call fctns |
77 | * that take a look at the contents of the 'cauldron' and, using these ingredients, |
75 | * that take a look at the contents of the 'cauldron' and, using these ingredients, |
78 | * we construct an integer formula value which is referenced (randomly) against a |
76 | * we construct an integer formula value which is referenced (randomly) against a |
79 | * formula list (the formula list chosen is based on the # contents of the cauldron). |
77 | * formula list (the formula list chosen is based on the # contents of the cauldron). |
80 | * |
78 | * |
… | |
… | |
95 | * around. :) |
93 | * around. :) |
96 | * -b.t. |
94 | * -b.t. |
97 | */ |
95 | */ |
98 | |
96 | |
99 | void |
97 | void |
100 | attempt_do_alchemy (object *caster, object *cauldron) |
98 | attempt_do_alchemy (object *caster, object *cauldron, object *skill) |
101 | { |
99 | { |
102 | recipelist *fl; |
100 | recipelist *fl; |
103 | recipe *rp = NULL; |
101 | recipe *rp = NULL; |
104 | float success_chance; |
102 | float success_chance; |
105 | int numb, ability = 1; |
103 | int numb, ability = 1; |
… | |
… | |
128 | rp = find_recipe (fl, formula, cauldron->inv); |
126 | rp = find_recipe (fl, formula, cauldron->inv); |
129 | if (rp != NULL) |
127 | if (rp != NULL) |
130 | { |
128 | { |
131 | #ifdef ALCHEMY_DEBUG |
129 | #ifdef ALCHEMY_DEBUG |
132 | if (strcmp (rp->title, "NONE")) |
130 | if (strcmp (rp->title, "NONE")) |
133 | LOG (llevDebug, "WIZ got formula: %s of %s\n", rp->arch_name[0], rp->title); |
131 | LOG (llevDebug, "WIZ got formula: %s of %s\n", rp->arch_name[0], &rp->title); |
134 | else |
132 | else |
135 | LOG (llevDebug, "WIZ got formula: %s (nbatches:%d)\n", rp->arch_name[0], formula / rp->index); |
133 | LOG (llevDebug, "WIZ got formula: %s (nbatches:%d)\n", rp->arch_name[0], formula / rp->index); |
136 | #endif |
134 | #endif |
137 | attempt_recipe (caster, cauldron, ability, rp, formula / rp->index); |
135 | attempt_recipe (caster, cauldron, ability, rp, formula / rp->index); |
138 | } |
136 | } |
… | |
… | |
141 | return; |
139 | return; |
142 | } /* End of WIZ alchemy */ |
140 | } /* End of WIZ alchemy */ |
143 | |
141 | |
144 | /* find the recipe */ |
142 | /* find the recipe */ |
145 | rp = find_recipe (fl, formula, cauldron->inv); |
143 | rp = find_recipe (fl, formula, cauldron->inv); |
146 | if (rp) |
144 | if (rp |
|
|
145 | && rp->skill == skill->skill |
|
|
146 | && (!rp->cauldron |
|
|
147 | || rp->cauldron == cauldron->arch->archname)) |
147 | { |
148 | { |
148 | uint64 value_ingredients; |
149 | uint64 value_ingredients; |
149 | uint64 value_item; |
150 | uint64 value_item; |
150 | object *tmp; |
151 | object *tmp; |
151 | int attempt_shadow_alchemy; |
152 | int attempt_shadow_alchemy; |
152 | |
153 | |
153 | ave_chance = fl->total_chance / (float) fl->number; |
154 | ave_chance = fl->total_chance / (float) fl->number; |
154 | /* the caster gets an increase in ability based on thier skill lvl */ |
155 | |
155 | if (rp->skill) |
|
|
156 | { |
|
|
157 | skop = find_skill_by_name (caster, rp->skill); |
|
|
158 | if (!skop) |
|
|
159 | new_draw_info (NDI_UNIQUE, 0, caster, "You do not have the proper skill for this recipe"); |
|
|
160 | else |
|
|
161 | ability += (int) (skop->level * ((4.0 + cauldron->magic) / 4.0)); |
156 | ability += (int) (skill->level * ((4.0 + cauldron->magic) / 4.0)); |
162 | } |
|
|
163 | else |
|
|
164 | { |
|
|
165 | LOG (llevDebug, "Recipe %s has NULL skill!\n", &rp->title); |
|
|
166 | return; |
|
|
167 | } |
|
|
168 | |
|
|
169 | if (!rp->cauldron) |
|
|
170 | { |
|
|
171 | LOG (llevDebug, "Recipe %s has NULL cauldron!\n", &rp->title); |
|
|
172 | return; |
|
|
173 | } |
|
|
174 | |
157 | |
175 | /* determine value of ingredients */ |
158 | /* determine value of ingredients */ |
176 | value_ingredients = 0; |
159 | value_ingredients = 0; |
177 | for (tmp = cauldron->inv; tmp != NULL; tmp = tmp->below) |
160 | for (tmp = cauldron->inv; tmp != NULL; tmp = tmp->below) |
178 | value_ingredients += query_cost (tmp, NULL, F_TRUE); |
161 | value_ingredients += query_cost (tmp, NULL, F_TRUE); |
… | |
… | |
216 | |
199 | |
217 | /* if we get here, we failed!! */ |
200 | /* if we get here, we failed!! */ |
218 | alchemy_failure_effect (caster, cauldron, rp, calc_alch_danger (caster, cauldron, rp)); |
201 | alchemy_failure_effect (caster, cauldron, rp, calc_alch_danger (caster, cauldron, rp)); |
219 | } |
202 | } |
220 | |
203 | |
221 | /**
|
204 | /** |
222 | * Recipe value of the entire contents of a container. |
205 | * Recipe value of the entire contents of a container. |
223 | * This appears to just generate a hash value, which I guess for now works |
206 | * This appears to just generate a hash value, which I guess for now works |
224 | * ok, but the possibility of duplicate hashes is certainly possible - msw |
207 | * ok, but the possibility of duplicate hashes is certainly possible - msw |
225 | */ |
208 | */ |
226 | |
|
|
227 | int |
209 | int |
228 | content_recipe_value (object *op) |
210 | content_recipe_value (object *op) |
229 | { |
211 | { |
230 | char name[MAX_BUF]; |
212 | char name[MAX_BUF]; |
231 | object *tmp = op->inv; |
213 | object *tmp = op->inv; |
… | |
… | |
248 | LOG (llevDebug, " Formula value=%d\n", formula); |
230 | LOG (llevDebug, " Formula value=%d\n", formula); |
249 | #endif |
231 | #endif |
250 | return formula; |
232 | return formula; |
251 | } |
233 | } |
252 | |
234 | |
253 | /**
|
235 | /** |
254 | * Returns total number of items in op
|
236 | * Returns total number of items in op |
255 | */ |
237 | */ |
256 | |
238 | |
257 | int |
239 | int |
258 | numb_ob_inside (object *op) |
240 | numb_ob_inside (object *op) |
259 | { |
241 | { |
… | |
… | |
268 | number++; |
250 | number++; |
269 | o_number++; |
251 | o_number++; |
270 | tmp = tmp->below; |
252 | tmp = tmp->below; |
271 | } |
253 | } |
272 | #ifdef ALCHEMY_DEBUG |
254 | #ifdef ALCHEMY_DEBUG |
273 | LOG (llevDebug, "numb_ob_inside(%s): found %d ingredients\n", op->name, o_number); |
255 | LOG (llevDebug, "numb_ob_inside(%s): found %d ingredients\n", &op->name, o_number); |
274 | #endif |
256 | #endif |
275 | return o_number; |
257 | return o_number; |
276 | } |
258 | } |
277 | |
259 | |
278 | /** |
260 | /** |
… | |
… | |
280 | * insert_ob_in_ob. If the caster has some alchemy skill, then they might |
262 | * insert_ob_in_ob. If the caster has some alchemy skill, then they might |
281 | * gain some exp from (successfull) fabrication of the product. |
263 | * gain some exp from (successfull) fabrication of the product. |
282 | * If nbatches==-1, don't give exp for this creation (random generation/ |
264 | * If nbatches==-1, don't give exp for this creation (random generation/ |
283 | * failed recipe) |
265 | * failed recipe) |
284 | */ |
266 | */ |
285 | |
|
|
286 | object * |
267 | object * |
287 | attempt_recipe (object *caster, object *cauldron, int ability, recipe *rp, int nbatches) |
268 | attempt_recipe (object *caster, object *cauldron, int ability, recipe *rp, int nbatches) |
288 | { |
269 | { |
289 | |
270 | |
290 | object *item = NULL, *skop; |
271 | object *item = NULL, *skop; |
291 | |
272 | |
292 | /* this should be passed to this fctn, not effiecent cpu use this way */ |
273 | /* this should be passed to this fctn, not effiecent cpu use this way */ |
293 | int batches = abs (nbatches); |
274 | int batches = abs (nbatches); |
294 | |
275 | |
295 | |
|
|
296 | /* is the cauldron the right type? */ |
276 | /* is the cauldron the right type? */ |
297 | if (rp->cauldron != cauldron->arch->name) |
277 | if (rp->cauldron && rp->cauldron != cauldron->arch->archname) |
298 | { |
|
|
299 | new_draw_info (NDI_UNIQUE, 0, caster, "You are not using the proper" " facilities for this formula."); |
|
|
300 | return 0; |
278 | return 0; |
301 | } |
|
|
302 | |
279 | |
303 | skop = find_skill_by_name (caster, rp->skill); |
280 | skop = find_skill_by_name (caster, rp->skill); |
304 | /* does the caster have the skill? */ |
281 | /* does the caster have the skill? */ |
305 | if (!skop) |
282 | if (!skop) |
306 | return 0; |
283 | return 0; |
… | |
… | |
316 | break; |
293 | break; |
317 | } |
294 | } |
318 | |
295 | |
319 | if (!tmp) |
296 | if (!tmp) |
320 | { /* failure--no code found */ |
297 | { /* failure--no code found */ |
321 | new_draw_info (NDI_UNIQUE, 0, caster, "You know the ingredients," " but not the technique. Go learn how to do this recipe."); |
298 | new_draw_info (NDI_UNIQUE, 0, caster, "You know the ingredients, but not the technique. Go learn how to do this recipe."); |
322 | return 0; |
299 | return 0; |
323 | } |
300 | } |
324 | } |
301 | } |
325 | |
302 | |
326 | #ifdef EXTREME_ALCHEMY_DEBUG |
303 | #ifdef EXTREME_ALCHEMY_DEBUG |
327 | LOG (llevDebug, "attempt_recipe(): got %d nbatches\n", nbatches); |
304 | LOG (llevDebug, "attempt_recipe(): got %d nbatches\n", nbatches); |
328 | LOG (llevDebug, "attempt_recipe(): using recipe %s\n", rp->title ? rp->title : "unknown"); |
305 | LOG (llevDebug, "attempt_recipe(): using recipe %s\n", *rp->title ? &rp->title : "unknown"); |
329 | #endif |
306 | #endif |
330 | |
307 | |
331 | if ((item = make_item_from_recipe (cauldron, rp)) != NULL) |
308 | if ((item = make_item_from_recipe (cauldron, rp)) != NULL) |
332 | { |
309 | { |
333 | remove_contents (cauldron->inv, item); |
310 | remove_contents (cauldron->inv, item); |
334 | /* Recalc carrying of the cauldron, in case recipe did not conserve mass */ |
311 | /* Recalc carrying of the cauldron, in case recipe did not conserve mass */ |
335 | sum_weight (cauldron); |
312 | cauldron->update_weight (); |
336 | /* adj lvl, nrof on caster level */ |
313 | /* adj lvl, nrof on caster level */ |
337 | adjust_product (item, ability, rp->yield ? (rp->yield * batches) : batches); |
314 | adjust_product (item, ability, rp->yield ? (rp->yield * batches) : batches); |
338 | if (!item->env && (item = insert_ob_in_ob (item, cauldron)) == NULL) |
315 | if (!item->env && (item = insert_ob_in_ob (item, cauldron)) == NULL) |
339 | { |
316 | { |
340 | new_draw_info (NDI_UNIQUE, 0, caster, "Nothing happened."); |
317 | new_draw_info (NDI_UNIQUE, 0, caster, "Nothing happened."); |
… | |
… | |
347 | } |
324 | } |
348 | |
325 | |
349 | return item; |
326 | return item; |
350 | } |
327 | } |
351 | |
328 | |
352 | |
|
|
353 | |
|
|
354 | /** |
329 | /** |
355 | * We adjust the nrof, exp and level of the final product, based |
330 | * We adjust the nrof, exp and level of the final product, based |
356 | * on the item's default parameters, and the relevant caster skill level.
|
331 | * on the item's default parameters, and the relevant caster skill level. |
357 | */ |
332 | */ |
358 | void |
333 | void |
359 | adjust_product (object *item, int lvl, int yield) |
334 | adjust_product (object *item, int lvl, int yield) |
360 | { |
335 | { |
361 | int nrof = 1; |
336 | int nrof = 1; |
… | |
… | |
374 | nrof = yield; |
349 | nrof = yield; |
375 | |
350 | |
376 | item->nrof = nrof; |
351 | item->nrof = nrof; |
377 | } |
352 | } |
378 | } |
353 | } |
379 | |
|
|
380 | |
354 | |
381 | /** |
355 | /** |
382 | * Using a list of items and a recipe to make an artifact. |
356 | * Using a list of items and a recipe to make an artifact. |
383 | * |
357 | * |
384 | * @param cauldron the cauldron (including the ingredients) used to make the item |
358 | * @param cauldron the cauldron (including the ingredients) used to make the item |
385 | * |
359 | * |
386 | * @param rp the recipe to make the artifact from |
360 | * @param rp the recipe to make the artifact from |
387 | * |
361 | * |
388 | * @return the newly created object, NULL if something failed |
362 | * @return the newly created object, NULL if something failed |
389 | */ |
363 | */ |
390 | |
|
|
391 | object * |
364 | object * |
392 | make_item_from_recipe (object *cauldron, recipe *rp) |
365 | make_item_from_recipe (object *cauldron, recipe *rp) |
393 | { |
366 | { |
394 | artifact *art = NULL; |
367 | artifact *art = NULL; |
395 | object *item = NULL; |
368 | object *item = NULL; |
… | |
… | |
404 | LOG (llevDebug, "make_alchemy_item(): failed to create alchemical object.\n"); |
377 | LOG (llevDebug, "make_alchemy_item(): failed to create alchemical object.\n"); |
405 | return (object *) NULL; |
378 | return (object *) NULL; |
406 | } |
379 | } |
407 | |
380 | |
408 | /* Find the appropriate artifact template... */ |
381 | /* Find the appropriate artifact template... */ |
409 | if (strcmp (rp->title, "NONE")) |
382 | if (rp->title != shstr_NONE) |
410 | { |
383 | { |
411 | if ((art = locate_recipe_artifact (rp, rp_arch_index)) == NULL) |
384 | if ((art = locate_recipe_artifact (rp, rp_arch_index)) == NULL) |
412 | { |
385 | { |
413 | LOG (llevError, "make_alchemy_item(): failed to locate recipe artifact.\n"); |
386 | LOG (llevError, "make_alchemy_item(): failed to locate recipe artifact.\n"); |
414 | LOG (llevDebug, " --requested recipe: %s of %s.\n", rp->arch_name[0], &rp->title); |
387 | LOG (llevDebug, " --requested recipe: %s of %s.\n", rp->arch_name[0], &rp->title); |
415 | return (object *) NULL; |
388 | return (object *) NULL; |
416 | } |
389 | } |
|
|
390 | |
417 | transmute_materialname (item, art->item); |
391 | transmute_materialname (item, art->item); |
418 | give_artifact_abilities (item, art->item); |
392 | give_artifact_abilities (item, art->item); |
419 | } |
393 | } |
420 | |
394 | |
421 | if (QUERY_FLAG (cauldron, FLAG_CURSED)) |
395 | if (QUERY_FLAG (cauldron, FLAG_CURSED)) |
… | |
… | |
424 | SET_FLAG (item, FLAG_DAMNED); |
398 | SET_FLAG (item, FLAG_DAMNED); |
425 | |
399 | |
426 | return item; |
400 | return item; |
427 | } |
401 | } |
428 | |
402 | |
429 | |
|
|
430 | /**
|
403 | /** |
431 | * Looks through the ingredient list. If we find a |
404 | * Looks through the ingredient list. If we find a |
432 | * suitable object in it - we will use that to make the requested artifact. |
405 | * suitable object in it - we will use that to make the requested artifact. |
433 | * Otherwise the code returns a 'generic' item if create_item is set. -b.t. |
406 | * Otherwise the code returns a 'generic' item if create_item is set. -b.t. |
434 | * |
407 | * |
435 | * @param rp_arch_index pointer to return value; set to arch index for recipe; |
408 | * @param rp_arch_index pointer to return value; set to arch index for recipe; |
436 | * set to zero if not using a transmution formula |
409 | * set to zero if not using a transmution formula |
437 | */ |
410 | */ |
438 | |
|
|
439 | object * |
411 | object * |
440 | find_transmution_ob (object *first_ingred, recipe *rp, size_t * rp_arch_index, int create_item) |
412 | find_transmution_ob (object *first_ingred, recipe *rp, size_t *rp_arch_index, int create_item) |
441 | { |
413 | { |
442 | object *item = NULL; |
414 | object *prod_item = 0; |
443 | |
415 | bool found = false; |
444 | *rp_arch_index = 0; |
416 | *rp_arch_index = 0; |
445 | |
417 | |
446 | if (rp->transmute) /* look for matching ingredient/prod archs */ |
418 | if (rp->transmute) /* look for matching ingredient/prod archs */ |
447 | for (item = first_ingred; item; item = item->below) |
419 | for (object *item = first_ingred; item; item = item->below) |
448 | { |
420 | { |
449 | size_t i; |
|
|
450 | |
|
|
451 | for (i = 0; i < rp->arch_names; i++) |
421 | for (int i = 0; i < rp->arch_names; i++) |
452 | { |
422 | //TODO: should be a shstr comparison |
453 | if (item->arch->name == rp->arch_name[i]) |
423 | if (!strcmp(&item->arch->archname,rp->arch_name[i])) |
454 | { |
424 | { |
455 | *rp_arch_index = i; |
425 | *rp_arch_index = i; |
|
|
426 | prod_item = item; |
456 | break; |
427 | break; |
457 | } |
428 | } |
458 | } |
|
|
459 | |
429 | |
460 | if (i < rp->arch_names) |
430 | if (prod_item) |
461 | break; |
431 | break; |
462 | } |
432 | } |
463 | |
433 | |
464 | /* failed, create a fresh object. Note no nrof>1 because that would |
434 | /* failed, create a fresh object. Note no nrof>1 because that would |
465 | * allow players to create massive amounts of artifacts easily */ |
435 | * allow players to create massive amounts of artifacts easily */ |
466 | if (create_item && (!item || item->nrof > 1)) |
436 | if (create_item && (!prod_item || prod_item->nrof > 1)) |
|
|
437 | { |
|
|
438 | #ifdef ALCHEMY_DEBUG |
|
|
439 | LOG (llevDebug, "creating a new item.\n"); |
|
|
440 | if (prod_item != NULL) |
467 | { |
441 | { |
|
|
442 | LOG (llevDebug, " had item: arch %s(nrof:%d)\n", |
|
|
443 | &prod_item->arch->archname, prod_item->nrof); |
|
|
444 | } |
|
|
445 | #endif |
|
|
446 | if (!prod_item) |
468 | *rp_arch_index = RANDOM () % rp->arch_names; |
447 | *rp_arch_index = rndm (rp->arch_names); |
469 | item = get_archetype (rp->arch_name[*rp_arch_index]); |
448 | prod_item = get_archetype (rp->arch_name[*rp_arch_index]); |
470 | } |
449 | } |
471 | |
450 | |
472 | #ifdef ALCHEMY_DEBUG |
451 | #ifdef ALCHEMY_DEBUG |
473 | LOG (llevDebug, "recipe calls for%stransmution.\n", rp->transmute ? " " : " no "); |
452 | LOG (llevDebug, "recipe calls for%stransmution.\n", rp->transmute ? " " : " no "); |
474 | if (item != NULL) |
453 | if (prod_item != NULL) |
475 | { |
454 | { |
476 | LOG (llevDebug, " find_transmutable_ob(): returns arch %s(sp:%d)\n", item->arch->name, item->stats.sp); |
455 | LOG (llevDebug, " find_transmutable_ob(): returns arch %s(sp:%d)\n", |
|
|
456 | &prod_item->arch->archname, prod_item->stats.sp); |
477 | } |
457 | } |
478 | #endif |
458 | #endif |
479 | |
459 | |
480 | return item; |
460 | return prod_item; |
481 | } |
461 | } |
482 | |
462 | |
483 | |
|
|
484 | /**
|
463 | /** |
485 | * Ouch. We didnt get the formula we wanted. |
464 | * Ouch. We didnt get the formula we wanted. |
486 | * This fctn simulates the backfire effects--worse effects as the level |
465 | * This fctn simulates the backfire effects--worse effects as the level |
487 | * increases. If SPELL_FAILURE_EFFECTS is defined some really evil things |
466 | * increases. If SPELL_FAILURE_EFFECTS is defined some really evil things |
488 | * can happen to the would be alchemist. This table probably needs some |
467 | * can happen to the would be alchemist. This table probably needs some |
489 | * adjustment for playbalance. -b.t. |
468 | * adjustment for playbalance. -b.t. |
490 | */ |
469 | */ |
491 | |
|
|
492 | void |
470 | void |
493 | alchemy_failure_effect (object *op, object *cauldron, recipe *rp, int danger) |
471 | alchemy_failure_effect (object *op, object *cauldron, recipe *rp, int danger) |
494 | { |
472 | { |
495 | int level = 0; |
473 | int level = 0; |
496 | |
474 | |
… | |
… | |
511 | |
489 | |
512 | if (rndm (0, 2)) |
490 | if (rndm (0, 2)) |
513 | { /* slag created */ |
491 | { /* slag created */ |
514 | object *tmp = cauldron->inv; |
492 | object *tmp = cauldron->inv; |
515 | int weight = 0; |
493 | int weight = 0; |
516 | uint16 material = M_STONE; |
|
|
517 | |
494 | |
518 | while (tmp) |
|
|
519 | { /* slag has coadded ingredient properties */ |
|
|
520 | weight += tmp->weight; |
|
|
521 | if (!(material & tmp->material)) |
|
|
522 | material |= tmp->material; |
|
|
523 | tmp = tmp->below; |
|
|
524 | } |
|
|
525 | tmp = get_archetype ("rock"); |
495 | tmp = get_archetype ("rock"); |
526 | tmp->weight = weight; |
496 | tmp->weight = weight; |
527 | tmp->value = 0; |
497 | tmp->value = 0; |
528 | tmp->material = material; |
|
|
529 | tmp->materialname = "stone"; |
498 | tmp->materialname = "stone"; |
530 | tmp->name = "slag"; |
499 | tmp->name = "slag"; |
531 | tmp->name_pl = "slags"; |
500 | tmp->name_pl = "slags"; |
532 | item = insert_ob_in_ob (tmp, cauldron); |
501 | item = insert_ob_in_ob (tmp, cauldron); |
533 | CLEAR_FLAG (tmp, FLAG_CAN_ROLL); |
502 | CLEAR_FLAG (tmp, FLAG_CAN_ROLL); |
534 | CLEAR_FLAG (tmp, FLAG_NO_PICK); |
503 | CLEAR_FLAG (tmp, FLAG_NO_PICK); |
535 | tmp->move_block = 0; |
504 | tmp->move_block = 0; |
536 | } |
505 | } |
|
|
506 | |
537 | remove_contents (cauldron->inv, item); |
507 | remove_contents (cauldron->inv, item); |
538 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s %s.", &cauldron->name, cauldron_sound ()); |
508 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s %s.", &cauldron->name, cauldron_sound ()); |
539 | return; |
509 | return; |
540 | } |
510 | } |
541 | else if (level < 40) |
511 | else if (level < 40) |
… | |
… | |
567 | } |
537 | } |
568 | while (rndm (0, 2)); |
538 | while (rndm (0, 2)); |
569 | } |
539 | } |
570 | return; |
540 | return; |
571 | } |
541 | } |
|
|
542 | |
572 | if (level == 40) |
543 | if (level == 40) |
573 | { /* MAKE RANDOM RECIPE */ |
544 | { /* MAKE RANDOM RECIPE */ |
574 | recipelist *fl; |
545 | recipelist *fl; |
575 | int numb = numb_ob_inside (cauldron); |
546 | int numb = numb_ob_inside (cauldron); |
576 | |
547 | |
… | |
… | |
578 | if (fl && (rp = get_random_recipe (fl))) |
549 | if (fl && (rp = get_random_recipe (fl))) |
579 | /* even though random, don't grant user any EXP for it */ |
550 | /* even though random, don't grant user any EXP for it */ |
580 | (void) attempt_recipe (op, cauldron, 1, rp, -1); |
551 | (void) attempt_recipe (op, cauldron, 1, rp, -1); |
581 | else |
552 | else |
582 | alchemy_failure_effect (op, cauldron, rp, level - 1); |
553 | alchemy_failure_effect (op, cauldron, rp, level - 1); |
583 | return; |
|
|
584 | |
|
|
585 | } |
554 | } |
586 | else if (level < 45) |
555 | else if (level < 45) |
587 | { /* INFURIATE NPC's */ |
556 | { /* INFURIATE NPC's */ |
588 | /* this is kind of kludgy I know... */ |
557 | /* this is kind of kludgy I know... */ |
589 | cauldron->enemy = op; |
558 | cauldron->enemy = op; |
590 | npc_call_help (cauldron); |
559 | npc_call_help (cauldron); |
591 | cauldron->enemy = NULL; |
560 | cauldron->enemy = NULL; |
592 | |
561 | |
593 | alchemy_failure_effect (op, cauldron, rp, level - 5); |
562 | alchemy_failure_effect (op, cauldron, rp, level - 5); |
594 | return; |
|
|
595 | } |
563 | } |
596 | else if (level < 50) |
564 | else if (level < 50) |
597 | { /* MINOR EXPLOSION/FIREBALL */ |
565 | { /* MINOR EXPLOSION/FIREBALL */ |
598 | object *tmp; |
566 | object *tmp; |
599 | |
567 | |
… | |
… | |
613 | tmp->stats.hp = random_roll (1, level, op, PREFER_LOW) / 10 + 2; |
581 | tmp->stats.hp = random_roll (1, level, op, PREFER_LOW) / 10 + 2; |
614 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s erupts in flame!", &cauldron->name); |
582 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s erupts in flame!", &cauldron->name); |
615 | break; |
583 | break; |
616 | } |
584 | } |
617 | |
585 | |
618 | op->insert_at (cauldron); |
586 | tmp->insert_at (cauldron); |
619 | return; |
|
|
620 | |
|
|
621 | } |
587 | } |
622 | else if (level < 60) |
588 | else if (level < 60) |
623 | { /* CREATE MONSTER */ |
589 | { /* CREATE MONSTER */ |
624 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s %s.", &cauldron->name, cauldron_sound ()); |
590 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s %s.", &cauldron->name, cauldron_sound ()); |
625 | remove_contents (cauldron->inv, NULL); |
591 | remove_contents (cauldron->inv, NULL); |
626 | return; |
|
|
627 | } |
592 | } |
628 | else if (level < 80) |
593 | else if (level < 80) |
629 | { /* MAJOR FIRE */ |
594 | { /* MAJOR FIRE */ |
630 | object *fb = get_archetype (SP_MED_FIREBALL); |
595 | object *fb = get_archetype (SP_MED_FIREBALL); |
631 | |
596 | |
632 | remove_contents (cauldron->inv, NULL); |
597 | remove_contents (cauldron->inv, NULL); |
633 | fire_arch_from_position (cauldron, cauldron, cauldron->x, cauldron->y, 0, fb); |
598 | fire_arch_from_position (cauldron, cauldron, cauldron->x, cauldron->y, 0, fb); |
634 | fb->destroy (); |
599 | fb->destroy (); |
635 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s erupts in flame!", &cauldron->name); |
600 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s erupts in flame!", &cauldron->name); |
636 | return; |
|
|
637 | |
|
|
638 | } |
601 | } |
639 | else if (level < 100) |
602 | else if (level < 100) |
640 | { /* WHAMMY the CAULDRON */ |
603 | { /* WHAMMY the CAULDRON */ |
641 | if (!QUERY_FLAG (cauldron, FLAG_CURSED)) |
604 | if (!QUERY_FLAG (cauldron, FLAG_CURSED)) |
642 | SET_FLAG (cauldron, FLAG_CURSED); |
605 | SET_FLAG (cauldron, FLAG_CURSED); |
643 | else |
606 | else |
644 | cauldron->magic--; |
607 | cauldron->magic--; |
|
|
608 | |
645 | cauldron->magic -= random_roll (0, 4, op, PREFER_LOW); |
609 | cauldron->magic -= random_roll (0, 4, op, PREFER_LOW); |
|
|
610 | |
646 | if (rndm (0, 1)) |
611 | if (rndm (0, 1)) |
647 | { |
612 | { |
648 | remove_contents (cauldron->inv, NULL); |
613 | remove_contents (cauldron->inv, NULL); |
649 | new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s turns darker then makes a gulping sound!", &cauldron->name); |
614 | new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s turns darker then makes a gulping sound!", &cauldron->name); |
650 | } |
615 | } |
651 | else |
616 | else |
652 | new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s becomes darker.", &cauldron->name); |
617 | new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s becomes darker.", &cauldron->name); |
653 | return; |
|
|
654 | |
|
|
655 | } |
618 | } |
656 | else if (level < 110) |
619 | else if (level < 110) |
657 | { /* SUMMON EVIL MONSTERS */ |
620 | { /* SUMMON EVIL MONSTERS */ |
658 | object *tmp = get_random_mon (level / 5); |
621 | object *tmp = get_random_mon (level / 5); |
659 | |
622 | |
660 | remove_contents (cauldron->inv, NULL); |
623 | remove_contents (cauldron->inv, NULL); |
|
|
624 | |
661 | if (!tmp) |
625 | if (!tmp) |
662 | alchemy_failure_effect (op, cauldron, rp, level); |
626 | alchemy_failure_effect (op, cauldron, rp, level); |
663 | else if (summon_hostile_monsters (cauldron, random_roll (1, 10, op, PREFER_LOW), tmp->arch->name)) |
627 | else if (summon_hostile_monsters (cauldron, random_roll (1, 10, op, PREFER_LOW), tmp->arch->archname)) |
664 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s %s and then pours forth monsters!", &cauldron->name, cauldron_sound ()); |
628 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s %s and then pours forth monsters!", &cauldron->name, cauldron_sound ()); |
665 | return; |
|
|
666 | |
|
|
667 | } |
629 | } |
668 | else if (level < 150) |
630 | else if (level < 150) |
669 | { /* COMBO EFFECT */ |
631 | { /* COMBO EFFECT */ |
670 | int roll = rndm (1, 3); |
632 | int roll = rndm (1, 3); |
671 | |
633 | |
672 | while (roll) |
634 | while (roll) |
673 | { |
635 | { |
674 | alchemy_failure_effect (op, cauldron, rp, level - 39); |
636 | alchemy_failure_effect (op, cauldron, rp, level - 39); |
675 | roll--; |
637 | roll--; |
676 | } |
638 | } |
677 | return; |
|
|
678 | } |
639 | } |
679 | else if (level == 151) |
640 | else if (level == 151) |
680 | { /* CREATE RANDOM ARTIFACT */ |
641 | { /* CREATE RANDOM ARTIFACT */ |
681 | object *tmp; |
642 | object *tmp; |
682 | |
643 | |
… | |
… | |
684 | * in this one, we allow *any* valid alchemy artifact |
645 | * in this one, we allow *any* valid alchemy artifact |
685 | * to be made (rather than only those on the given |
646 | * to be made (rather than only those on the given |
686 | * formulalist) */ |
647 | * formulalist) */ |
687 | if (!rp) |
648 | if (!rp) |
688 | rp = get_random_recipe ((recipelist *) NULL); |
649 | rp = get_random_recipe ((recipelist *) NULL); |
|
|
650 | |
689 | if (rp && (tmp = get_archetype (rp->arch_name[RANDOM () % rp->arch_names]))) |
651 | if (rp && (tmp = get_archetype (rp->arch_name [rndm (rp->arch_names)]))) |
690 | { |
652 | { |
691 | generate_artifact (tmp, random_roll (1, op->level / 2 + 1, op, PREFER_HIGH) + 1); |
653 | generate_artifact (tmp, random_roll (1, op->level / 2 + 1, op, PREFER_HIGH) + 1); |
692 | if ((tmp = insert_ob_in_ob (tmp, cauldron))) |
654 | if ((tmp = insert_ob_in_ob (tmp, cauldron))) |
693 | { |
655 | { |
694 | remove_contents (cauldron->inv, tmp); |
656 | remove_contents (cauldron->inv, tmp); |
695 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s %s.", &cauldron->name, cauldron_sound ()); |
657 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s %s.", &cauldron->name, cauldron_sound ()); |
696 | } |
658 | } |
697 | } |
659 | } |
698 | return; |
|
|
699 | } |
660 | } |
700 | else |
661 | else |
701 | { /* MANA STORM - watch out!! */ |
662 | { /* MANA STORM - watch out!! */ |
702 | object *tmp = get_archetype (LOOSE_MANA); |
663 | object *tmp = get_archetype (LOOSE_MANA); |
703 | |
664 | |
704 | new_draw_info (NDI_UNIQUE, 0, op, "You unwisely release potent forces!"); |
665 | new_draw_info (NDI_UNIQUE, 0, op, "You unwisely release potent forces!"); |
705 | remove_contents (cauldron->inv, NULL); |
666 | remove_contents (cauldron->inv, NULL); |
706 | cast_magic_storm (op, tmp, level); |
667 | cast_magic_storm (op, tmp, level); |
707 | return; |
|
|
708 | } |
668 | } |
709 | } |
669 | } |
710 | |
|
|
711 | |
670 | |
712 | /* |
671 | /* |
713 | * All but object "save_item" are elimentated from |
672 | * All but object "save_item" are elimentated from |
714 | * the container list. Note we have to becareful to remove the inventories |
673 | * the container list. Note we have to becareful to remove the inventories |
715 | * of objects in the cauldron inventory (ex icecube has stuff in it). |
674 | * of objects in the cauldron inventory (ex icecube has stuff in it). |
716 | */ |
675 | */ |
717 | |
|
|
718 | void |
676 | void |
719 | remove_contents (object *first_ob, object *save_item) |
677 | remove_contents (object *first_ob, object *save_item) |
720 | { |
678 | { |
|
|
679 | // this cries for a cleaner rewrite, removing save_item first possibly |
721 | object *next, *tmp = first_ob; |
680 | object *next, *tmp = first_ob; |
722 | |
681 | |
723 | while (tmp) |
682 | while (tmp) |
724 | { |
683 | { |
725 | next = tmp->below; |
684 | next = tmp->below; |
… | |
… | |
738 | tmp->destroy (); |
697 | tmp->destroy (); |
739 | tmp = next; |
698 | tmp = next; |
740 | } |
699 | } |
741 | } |
700 | } |
742 | |
701 | |
743 | /**
|
702 | /** |
744 | *"Danger" level, will determine how bad the backfire |
703 | *"Danger" level, will determine how bad the backfire |
745 | * could be if the user fails to concoct a recipe properly. Factors include |
704 | * could be if the user fails to concoct a recipe properly. Factors include |
746 | * the number of ingredients, the length of the name of each ingredient, |
705 | * the number of ingredients, the length of the name of each ingredient, |
747 | * the user's effective level, the user's Int and the enchantment on the |
706 | * the user's effective level, the user's Int and the enchantment on the |
748 | * mixing device (aka "cauldron"). Higher values of 'danger' indicate more |
707 | * mixing device (aka "cauldron"). Higher values of 'danger' indicate more |
749 | * danger. Note that we assume that we have had the caster ready the alchemy |
708 | * danger. Note that we assume that we have had the caster ready the alchemy |
750 | * skill *before* this routine is called. (no longer auto-readies that skill) |
709 | * skill *before* this routine is called. (no longer auto-readies that skill) |
751 | * -b.t. |
710 | * -b.t. |
752 | */ |
711 | */ |
753 | |
|
|
754 | int |
712 | int |
755 | calc_alch_danger (object *caster, object *cauldron, recipe *rp) |
713 | calc_alch_danger (object *caster, object *cauldron, recipe *rp) |
756 | { |
714 | { |
757 | object *item; |
715 | object *item; |
758 | char name[MAX_BUF]; |
716 | char name[MAX_BUF]; |
759 | int danger = 0, nrofi = 0; |
717 | int danger = 0, nrofi = 0; |
760 | |
718 | |
761 | /* Knowing alchemy skill reduces yer risk */ |
719 | /* Knowing alchemy skill reduces yer risk */ |
762 | danger -= caster->chosen_skill ? caster->chosen_skill->level : caster->level; |
720 | danger -= caster->chosen_skill ? caster->chosen_skill->level : caster->level; |
|
|
721 | |
|
|
722 | if (!caster->chosen_skill) |
|
|
723 | LOG (llevError | logBacktrace, "calc_alch_danger called without a chosen skill, caster %s, cauldron %s\n", |
|
|
724 | caster->debug_desc (), cauldron->debug_desc ()); |
763 | |
725 | |
764 | /* better cauldrons reduce risk */ |
726 | /* better cauldrons reduce risk */ |
765 | danger -= cauldron->magic; |
727 | danger -= cauldron->magic; |
766 | |
728 | |
767 | /* Higher Int, lower the risk */ |
729 | /* Higher Int, lower the risk */ |
… | |
… | |
777 | if (item->title) |
739 | if (item->title) |
778 | sprintf (name, "%s %s", &item->name, &item->title); |
740 | sprintf (name, "%s %s", &item->name, &item->title); |
779 | danger += (strtoint (name) / 1000) + 3; |
741 | danger += (strtoint (name) / 1000) + 3; |
780 | nrofi++; |
742 | nrofi++; |
781 | } |
743 | } |
|
|
744 | |
782 | if (rp == NULL) |
745 | if (rp == NULL) |
783 | danger += 110; |
746 | danger += 110; |
784 | else |
747 | else |
785 | danger += rp->diff * 3; |
748 | danger += rp->diff * 3; |
786 | |
749 | |
… | |
… | |
795 | #endif |
758 | #endif |
796 | |
759 | |
797 | return danger; |
760 | return danger; |
798 | } |
761 | } |
799 | |
762 | |
800 | /**
|
763 | /** |
801 | * Determines if ingredients in a container match the |
764 | * Determines if ingredients in a container match the |
802 | * proper ingredients for a recipe. |
765 | * proper ingredients for a recipe. |
803 | * |
766 | * |
804 | * rp is the recipe to check |
767 | * rp is the recipe to check |
805 | * cauldron is the container that holds the ingredients |
768 | * cauldron is the container that holds the ingredients |
… | |
… | |
854 | for (ob = cauldron->inv; ob != NULL; ob = ob->below) |
817 | for (ob = cauldron->inv; ob != NULL; ob = ob->below) |
855 | { |
818 | { |
856 | char name_ob[MAX_BUF]; |
819 | char name_ob[MAX_BUF]; |
857 | const char *name2; |
820 | const char *name2; |
858 | |
821 | |
859 | if (ob->title == NULL) |
822 | if (!ob->title) |
860 | name2 = ob->name; |
823 | name2 = ob->name; |
861 | else |
824 | else |
862 | { |
825 | { |
863 | snprintf (name_ob, sizeof (name_ob), "%s %s", &ob->name, &ob->title); |
826 | snprintf (name_ob, sizeof (name_ob), "%s %s", &ob->name, &ob->title); |
864 | name2 = name_ob; |
827 | name2 = name_ob; |
… | |
… | |
909 | LOG (llevDebug, "looking for formula %d:\n", formula); |
872 | LOG (llevDebug, "looking for formula %d:\n", formula); |
910 | #endif |
873 | #endif |
911 | result = NULL; |
874 | result = NULL; |
912 | recipes_matching = 0; |
875 | recipes_matching = 0; |
913 | transmute_found = 0; |
876 | transmute_found = 0; |
|
|
877 | |
914 | for (rp = fl->items; rp != NULL; rp = rp->next) |
878 | for (rp = fl->items; rp; rp = rp->next) |
915 | { |
879 | { |
916 | /* check if recipe matches at all */ |
880 | /* check if recipe matches at all */ |
917 | if (formula % rp->index != 0) |
881 | if (formula % rp->index != 0) |
918 | { |
882 | { |
919 | #ifdef EXTREME_ALCHEMY_DEBUG |
883 | #ifdef EXTREME_ALCHEMY_DEBUG |
920 | LOG (llevDebug, " formula %s of %s (%d) does not match\n", rp->arch_name[0], rp->title, rp->index); |
884 | LOG (llevDebug, " formula %s of %s (%d) does not match\n", rp->arch_name[0], &rp->title, rp->index); |
921 | #endif |
885 | #endif |
922 | continue; |
886 | continue; |
923 | } |
887 | } |
924 | |
888 | |
925 | if (rp->transmute && find_transmution_ob (ingredients, rp, &rp_arch_index, 0) != NULL) |
889 | if (rp->transmute && find_transmution_ob (ingredients, rp, &rp_arch_index, 0) != NULL) |
926 | { |
890 | { |
927 | #ifdef EXTREME_ALCHEMY_DEBUG |
891 | #ifdef EXTREME_ALCHEMY_DEBUG |
928 | LOG (llevDebug, " formula %s of %s (%d) is a matching transmuting formula\n", rp->arch_name[rp_arch_index], rp->title, rp->index); |
892 | LOG (llevDebug, " formula %s of %s (%d) is a matching transmuting formula\n", rp->arch_name[rp_arch_index], &rp->title, rp->index); |
929 | #endif |
893 | #endif |
930 | /* transmution recipe with matching base ingredient */ |
894 | /* transmution recipe with matching base ingredient */ |
931 | if (!transmute_found) |
895 | if (!transmute_found) |
932 | { |
896 | { |
933 | transmute_found = 1; |
897 | transmute_found = 1; |
… | |
… | |
935 | } |
899 | } |
936 | } |
900 | } |
937 | else if (transmute_found) |
901 | else if (transmute_found) |
938 | { |
902 | { |
939 | #ifdef EXTREME_ALCHEMY_DEBUG |
903 | #ifdef EXTREME_ALCHEMY_DEBUG |
940 | LOG (llevDebug, " formula %s of %s (%d) matches but is not a matching transmuting formula\n", rp->arch_name[0], rp->title, |
904 | LOG (llevDebug, " formula %s of %s (%d) matches but is not a matching transmuting formula\n", rp->arch_name[0], &rp->title, |
941 | rp->index); |
905 | rp->index); |
942 | #endif |
906 | #endif |
943 | /* "normal" recipe found after previous transmution recipe => ignore this recipe */ |
907 | /* "normal" recipe found after previous transmution recipe => ignore this recipe */ |
944 | continue; |
908 | continue; |
945 | } |
909 | } |
946 | #ifdef EXTREME_ALCHEMY_DEBUG |
910 | #ifdef EXTREME_ALCHEMY_DEBUG |
947 | else |
911 | else |
948 | { |
912 | { |
949 | LOG (llevDebug, " formula %s of %s (%d) matches\n", rp->arch_name[0], rp->title, rp->index); |
913 | LOG (llevDebug, " formula %s of %s (%d) matches\n", rp->arch_name[0], &rp->title, rp->index); |
950 | } |
914 | } |
951 | #endif |
915 | #endif |
952 | |
916 | |
953 | if (rndm (0, recipes_matching) == 0) |
917 | if (rndm (0, recipes_matching) == 0) |
954 | result = rp; |
918 | result = rp; |
… | |
… | |
964 | return NULL; |
928 | return NULL; |
965 | } |
929 | } |
966 | |
930 | |
967 | #ifdef ALCHEMY_DEBUG |
931 | #ifdef ALCHEMY_DEBUG |
968 | if (strcmp (result->title, "NONE") != 0) |
932 | if (strcmp (result->title, "NONE") != 0) |
969 | LOG (llevDebug, "got formula: %s of %s (nbatches:%d)\n", result->arch_name[0], result->title, formula / result->index); |
933 | LOG (llevDebug, "got formula: %s of %s (nbatches:%d)\n", result->arch_name[0], &result->title, formula / result->index); |
970 | else |
934 | else |
971 | LOG (llevDebug, "got formula: %s (nbatches:%d)\n", result->arch_name[0], formula / result->index); |
935 | LOG (llevDebug, "got formula: %s (nbatches:%d)\n", result->arch_name[0], formula / result->index); |
972 | #endif |
936 | #endif |
973 | return result; |
937 | return result; |
974 | } |
938 | } |