version 1.14 | | version 1.15 |
---|
| | |
/* | | /* |
* static char *rcsid_disease_c = | | * static char *rcsid_disease_c = |
* "$Id: disease.c,v 1.14 2000/12/17 00:39:16 cvs Exp $"; | | * "$Id: disease.c,v 1.15 2000/12/27 07:53:35 cvs Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
return 1; | | return 1; |
} | | } |
| | |
/* reduces disease progression: reduce_symptoms */ | | /* reduces disease progression: reduce_symptoms |
| | * return true if we actually reduce a disease. |
| | */ |
| | |
int reduce_symptoms(object *sufferer, int reduction) { | | int reduce_symptoms(object *sufferer, int reduction) { |
object *walk; | | object *walk; |
| | int success=0; |
| | |
for(walk=sufferer->inv;walk;walk=walk->below) { | | for(walk=sufferer->inv;walk;walk=walk->below) { |
if(walk->type==SYMPTOM) { | | if(walk->type==SYMPTOM) { |
if(walk->value > 0) | | if(walk->value > 0) { |
new_draw_info(NDI_UNIQUE,0,sufferer,"Your illness seems less severe."); | | success=1; |
walk->value = MAX(0,walk->value - 2*reduction); | | walk->value = MAX(0,walk->value - 2*reduction); |
walk->speed_left = 0; /* give the disease time to modify this symptom, | | /* give the disease time to modify this symptom, |
and reduce its severity. */ | | * and reduce its severity. */ |
| | walk->speed_left = 0; |
} | | } |
} | | } |
return 1; | | } |
| | if (success) |
| | new_draw_info(NDI_UNIQUE,0,sufferer,"Your illness seems less severe."); |
| | return success; |
} | | } |
| | |