ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/recipe.C
(Generate patch)

Comparing deliantra/server/common/recipe.C (file contents):
Revision 1.46 by root, Wed Nov 16 23:41:59 2016 UTC vs.
Revision 1.47 by root, Sun Jan 29 02:47:04 2017 UTC

22 * The authors can be reached via e-mail to <support@deliantra.net> 22 * The authors can be reached via e-mail to <support@deliantra.net>
23 */ 23 */
24 24
25/* Basic stuff for use with the alchemy code. Clearly some of this stuff 25/* Basic stuff for use with the alchemy code. Clearly some of this stuff
26 * could go into server/alchemy, but I left it here just in case it proves 26 * could go into server/alchemy, but I left it here just in case it proves
27 * more generally useful. 27 * more generally useful.
28 * 28 *
29 * Nov 1995 - file created by b.t. thomas@astro.psu.edu 29 * Nov 1995 - file created by b.t. thomas@astro.psu.edu
30 */ 30 */
31 31
32 32
33/* Our definition of 'formula' is any product of an alchemical process. 33/* Our definition of 'formula' is any product of an alchemical process.
34 * Ingredients are just comma delimited list of archetype (or object) 34 * Ingredients are just comma delimited list of archetype (or object)
35 * names. 35 * names.
36 */ 36 */
37 37
38/* Example 'formula' entry in libdir/formulae: 38/* Example 'formula' entry in libdir/formulae:
39 * object transparency 39 * object transparency
40 * chance 10 40 * chance 10
102 } 102 }
103 103
104 return fl; 104 return fl;
105} 105}
106 106
107/* check_recipe() - makes sure we actually have the requested artifact 107/* check_recipe() - makes sure we actually have the requested artifact
108 * and archetype. */ 108 * and archetype. */
109static int 109static int
110check_recipe (const recipe *rp) 110check_recipe (const recipe *rp)
111{ 111{
112 size_t i; 112 size_t i;
166 LOG (llevDebug, "done.\n"); 166 LOG (llevDebug, "done.\n");
167 167
168} 168}
169 169
170/* 170/*
171 * init_formulae() - Builds up the lists of formula from the file in 171 * init_formulae() - Builds up the lists of formula from the file in
172 * the libdir. -b.t. 172 * the libdir. -b.t.
173 */ 173 */
174void 174void
175init_formulae () 175init_formulae ()
176{ 176{
177 static int has_been_done = 0; 177 static int has_been_done = 0;
243 tmp = new linked_char; 243 tmp = new linked_char;
244 244
245 tmp->name = cp; 245 tmp->name = cp;
246 tmp->next = formula->ingred; 246 tmp->next = formula->ingred;
247 formula->ingred = tmp; 247 formula->ingred = tmp;
248 /* each ingredient's ASCII value is coadded. Later on this 248 /* each ingredient's ASCII value is coadded. Later on this
249 * value will be used allow us to search the formula lists 249 * value will be used allow us to search the formula lists
250 * quickly for the right recipe. 250 * quickly for the right recipe.
251 */ 251 */
252 formula->index += strtoint (cp); 252 formula->index += strtoint (cp);
253 } 253 }
254 while ((cp = next)); 254 while ((cp = next));
255 255
345 else 345 else
346 return 1; 346 return 1;
347} 347}
348 348
349/* strtoint() - we use this to convert buf into an integer 349/* strtoint() - we use this to convert buf into an integer
350 * equal to the coadded sum of the (lowercase) character 350 * equal to the coadded sum of the (lowercase) character
351 * ASCII values in buf (times prepended integers). 351 * ASCII values in buf (times prepended integers).
352 * Some kind of hashing. 352 * Some kind of hashing.
353 */ 353 */
354int 354int
355strtoint (const char *buf) 355strtoint (const char *buf)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines