version 1.21 | | version 1.22 |
---|
| | |
/* | | /* |
* static char *rcsid_disease_c = | | * static char *rcsid_disease_c = |
* "$Id: disease.c,v 1.21 2002/08/03 05:04:14 mwedel Exp $"; | | * "$Id: disease.c,v 1.22 2002/09/15 03:15:17 mwedel Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
} | | } |
| | |
int move_disease(object *disease) { | | int move_disease(object *disease) { |
| | |
/* first task is to determine if the disease is inside or outside of someone. | | /* first task is to determine if the disease is inside or outside of someone. |
If outside, we decrement 'hp' until we're gone. */ | | * If outside, we decrement 'hp' until we're gone. |
| | */ |
| | |
if(disease->env==NULL) { /* we're outside of someone */ | | if(disease->env==NULL) { /* we're outside of someone */ |
disease->value--; | | disease->value--; |
| | |
} else { | | } else { |
/* if we're inside a person, have the disease run its course */ | | /* if we're inside a person, have the disease run its course */ |
/* negative foods denote "perpetual" diseases. */ | | /* negative foods denote "perpetual" diseases. */ |
if(disease->stats.food>0 && is_susceptible_to_disease(disease->env, disease)) { | | if(disease->stats.food>0) { |
disease->stats.food--; | | disease->stats.food--; |
if(disease->stats.food==0) { | | if(disease->stats.food==0) { |
remove_symptoms(disease); /* remove the symptoms of this disease */ | | remove_symptoms(disease); /* remove the symptoms of this disease */ |
| | |
} | | } |
} | | } |
} | | } |
| | |
/* check to see if we infect others */ | | /* check to see if we infect others */ |
check_infection(disease); | | check_infection(disease); |
| | |
/* impose or modify the symptoms of the disease */ | | /* impose or modify the symptoms of the disease */ |
if(disease->env) | | if(disease->env && is_susceptible_to_disease(disease->env, disease)) |
do_symptoms(disease); | | do_symptoms(disease); |
| | |
return 0; | | return 0; |
| | |
/* argument is a disease */ | | /* argument is a disease */ |
object * find_symptom(object *disease) { | | object * find_symptom(object *disease) { |
object *walk; | | object *walk; |
char symptom_name[256]; | | |
sprintf(symptom_name,"%s",disease->name); | | |
| | |
/* check the inventory for symptoms */ | | /* check the inventory for symptoms */ |
for(walk=disease->env->inv;walk;walk = walk->below) | | for(walk=disease->env->inv;walk;walk = walk->below) |