version 1.27 | | version 1.28 |
---|
| | |
/* | | /* |
* static char *rcsid_alchemy_c = | | * static char *rcsid_alchemy_c = |
* "$Id: alchemy.c,v 1.27 2006/04/06 21:18:35 tchize Exp $"; | | * "$Id: alchemy.c,v 1.28 2006/05/05 09:26:34 ryo_saeba Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
static int is_defined_recipe(const recipe *rp, const object *cauldron, object *caster); | | static int is_defined_recipe(const recipe *rp, const object *cauldron, object *caster); |
static recipe *find_recipe(recipelist *fl, int formula, object *ingredients); | | static recipe *find_recipe(recipelist *fl, int formula, object *ingredients); |
| | static int content_recipe_value (object *op); |
| | static int numb_ob_inside (object *op); |
| | static void alchemy_failure_effect(object *op,object *cauldron,recipe *rp,int danger); |
| | static object * attempt_recipe(object *caster, object *cauldron, int ability, recipe *rp, int nbatches); |
| | static int calc_alch_danger(object *caster,object *cauldron, recipe *rp); |
| | static object * make_item_from_recipe(object *cauldron, recipe *rp); |
| | static void remove_contents (object *first_ob, object *save_item); |
| | static void adjust_product(object *item, int lvl, int yield); |
| | static object * find_transmution_ob ( object *first_ingred, recipe *rp, size_t *rp_arch_index, int create_item); |
| | |
/** Returns a random selection from cauldron_effect[] */ | | /** Returns a random selection from cauldron_effect[] */ |
static const char *cauldron_sound(void) { | | static const char *cauldron_sound(void) { |
| | |
* ok, but the possibility of duplicate hashes is certainly possible - msw | | * ok, but the possibility of duplicate hashes is certainly possible - msw |
*/ | | */ |
| | |
int content_recipe_value (object *op) { | | static int content_recipe_value (object *op) { |
char name[MAX_BUF]; | | char name[MAX_BUF]; |
object *tmp=op->inv; | | object *tmp=op->inv; |
int tval=0, formula=0; | | int tval=0, formula=0; |
| | |
* Returns total number of items in op
| | * Returns total number of items in op
|
*/ | | */ |
| | |
int numb_ob_inside (object *op) { | | static int numb_ob_inside (object *op) { |
object *tmp=op->inv; | | object *tmp=op->inv; |
int number=0,o_number=0; | | int number=0,o_number=0; |
| | |
| | |
* failed recipe) | | * failed recipe) |
*/ | | */ |
| | |
object * attempt_recipe(object *caster, object *cauldron, int ability, recipe *rp, int nbatches) { | | static object * attempt_recipe(object *caster, object *cauldron, int ability, recipe *rp, int nbatches) { |
| | |
object *item=NULL, *skop; | | object *item=NULL, *skop; |
/* this should be passed to this fctn, not effiecent cpu use this way */ | | /* this should be passed to this fctn, not effiecent cpu use this way */ |
| | |
* on the item's default parameters, and the relevant caster skill level.
| | * on the item's default parameters, and the relevant caster skill level.
|
*/ | | */ |
| |
|
void adjust_product(object *item, int lvl, int yield) { | | static void adjust_product(object *item, int lvl, int yield) { |
int nrof=1; | | int nrof=1; |
| | |
if (!yield) | | if (!yield) |
| | |
* @return the newly created object, NULL if something failed | | * @return the newly created object, NULL if something failed |
*/ | | */ |
| | |
object * make_item_from_recipe(object *cauldron, recipe *rp) { | | static object * make_item_from_recipe(object *cauldron, recipe *rp) { |
artifact *art=NULL; | | artifact *art=NULL; |
object *item=NULL; | | object *item=NULL; |
size_t rp_arch_index; | | size_t rp_arch_index; |
| | |
* set to zero if not using a transmution formula | | * set to zero if not using a transmution formula |
*/ | | */ |
| | |
object * find_transmution_ob ( object *first_ingred, recipe *rp, size_t *rp_arch_index, int create_item) { | | static object * find_transmution_ob ( object *first_ingred, recipe *rp, size_t *rp_arch_index, int create_item) { |
object *item=NULL; | | object *item=NULL; |
| | |
*rp_arch_index = 0; | | *rp_arch_index = 0; |
| | |
* adjustment for playbalance. -b.t. | | * adjustment for playbalance. -b.t. |
*/ | | */ |
| | |
void alchemy_failure_effect(object *op,object *cauldron,recipe *rp,int danger) { | | static void alchemy_failure_effect(object *op,object *cauldron,recipe *rp,int danger) { |
int level=0; | | int level=0; |
| | |
if(!op || !cauldron) return; | | if(!op || !cauldron) return; |
| | |
* of objects in the cauldron inventory (ex icecube has stuff in it). | | * of objects in the cauldron inventory (ex icecube has stuff in it). |
*/ | | */ |
| | |
void remove_contents (object *first_ob, object *save_item) { | | static void remove_contents (object *first_ob, object *save_item) { |
object *next,*tmp=first_ob; | | object *next,*tmp=first_ob; |
| | |
while(tmp) { | | while(tmp) { |
| | |
* -b.t. | | * -b.t. |
*/ | | */ |
| | |
int calc_alch_danger(object *caster,object *cauldron, recipe *rp) { | | static int calc_alch_danger(object *caster,object *cauldron, recipe *rp) { |
object *item; | | object *item; |
char name[MAX_BUF]; | | char name[MAX_BUF]; |
int danger=0,nrofi=0; | | int danger=0,nrofi=0; |