version 1.17 | | version 1.18 |
---|
| | |
/* | | /* |
* static char *rcsid_disease_c = | | * static char *rcsid_disease_c = |
* "$Id: disease.c,v 1.17 2001/07/14 04:11:18 mwedel Exp $"; | | * "$Id: disease.c,v 1.18 2001/09/26 21:34:08 garbled Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
if(!is_susceptible_to_disease(victim, disease)) return 0; | | if(!is_susceptible_to_disease(victim, disease)) return 0; |
| | |
/* roll the dice on infection before doing the inventory check! */ | | /* roll the dice on infection before doing the inventory check! */ |
if(!force && (RANDOM() % 127 >= disease->stats.wc)) return 0; | | if(!force && (random_roll(0, 126, victim, PREFER_HIGH) >= disease->stats.wc)) |
| | return 0; |
| | |
/* do an immunity check */ | | /* do an immunity check */ |
if(victim->head) tmp = victim->head->inv; | | if(victim->head) tmp = victim->head->inv; |
| | |
if(disease->stats.dam != 0) { | | if(disease->stats.dam != 0) { |
int dam = disease->stats.dam; | | int dam = disease->stats.dam; |
/* reduce the damage, on average, 50%, and making things random. */ | | /* reduce the damage, on average, 50%, and making things random. */ |
dam = RANDOM() % dam +1; | | dam = random_roll(1, dam, victim, PREFER_LOW); |
if(disease->stats.dam < 0) dam = -dam; | | if(disease->stats.dam < 0) dam = -dam; |
new_symptom->stats.dam = dam; | | new_symptom->stats.dam = dam; |
} | | } |
| | |
* is 1 in 5. | | * is 1 in 5. |
*/ | | */ |
if ((casting_level >= disease->level) || | | if ((casting_level >= disease->level) || |
( ! (RANDOM() % ( disease->level - casting_level)))) { | | ( ! (random_roll(0, (disease->level - casting_level - 1), |
| | caster, PREFER_LOW) ))) { |
| | |
remove_symptoms(disease); | | remove_symptoms(disease); |
remove_ob(disease); | | remove_ob(disease); |