version 1.129 | | version 1.130 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.129 2005/07/17 10:57:09 akirschbaum Exp $"; | | * "$Id: apply.c,v 1.130 2005/07/19 20:59:34 ryo_saeba Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
force=NULL; | | force=NULL; |
for (i=0; i<NROFATTACKS; i++) { | | for (i=0; i<NROFATTACKS; i++) { |
if (tmp->resist[i]) { | | if (tmp->resist[i]) { |
if (!force) force=get_archetype("force"); | | if (!force) force=get_archetype(FORCE_NAME); |
memcpy(force->resist, tmp->resist, sizeof(tmp->resist)); | | memcpy(force->resist, tmp->resist, sizeof(tmp->resist)); |
force->type=POTION_EFFECT; | | force->type=POTION_EFFECT; |
break; /* Only need to find one protection since we copy entire batch */ | | break; /* Only need to find one protection since we copy entire batch */ |
| | |
* This handles items of type 'transformer'. | | * This handles items of type 'transformer'. |
* Basically those items, used with a marked item, transform both items into something | | * Basically those items, used with a marked item, transform both items into something |
* else. | | * else. |
* "Transformer" item is removed too, unless the level is zero. | | * "Transformer" item has food decreased by 1, removed if 0 (0 at start means illimited).. |
* Change information is contained in the 'slaying' field of the marked item. | | * Change information is contained in the 'slaying' field of the marked item. |
* The format is as follow: transformer:[number ]yield[;transformer:...]. | | * The format is as follow: transformer:[number ]yield[;transformer:...]. |
* This way an item can be transformed in many things, and/or many objects. | | * This way an item can be transformed in many things, and/or many objects. |
* The 'slaying' field for transformer is used as verb for the action. | | * The 'slaying' field for transformer is used as verb for the action. |
* Created item is in the 'other_arch' field. | | |
*/ | | */ |
void apply_item_transformer( object* pl, object* transformer ) | | void apply_item_transformer( object* pl, object* transformer ) |
{ | | { |
| | |
/* Eat up one item */ | | /* Eat up one item */ |
decrease_ob_nr( marked, 1 ); | | decrease_ob_nr( marked, 1 ); |
/* Eat one transformer if needed */ | | /* Eat one transformer if needed */ |
if ( transformer->level ) | | if ( transformer->stats.food )
|
| | if ( --transformer->stats.food == 0 ) |
decrease_ob_nr( transformer, 1 ); | | decrease_ob_nr( transformer, 1 ); |
} | | } |