… | |
… | |
151 | if (disease->last_heal) |
151 | if (disease->last_heal) |
152 | return 0; |
152 | return 0; |
153 | |
153 | |
154 | /* first, search for an immunity of the same name */ |
154 | /* first, search for an immunity of the same name */ |
155 | for (walk = disease->env->inv; walk; walk = walk->below) |
155 | for (walk = disease->env->inv; walk; walk = walk->below) |
156 | if (walk->type == 98 && disease->name == walk->name) |
156 | if (disease->name == walk->name && walk->is_immunity ()) |
157 | { |
157 | { |
158 | walk->level = disease->level; |
158 | walk->level = disease->level; |
159 | return 1; /* just update the existing immunity. */ |
159 | return 1; /* just update the existing immunity. */ |
160 | } |
160 | } |
161 | |
161 | |
… | |
… | |
289 | return 0; |
289 | return 0; |
290 | |
290 | |
291 | /* check for an actual immunity */ |
291 | /* check for an actual immunity */ |
292 | /* do an immunity check */ |
292 | /* do an immunity check */ |
293 | for (tmp = victim->head_ ()->inv; tmp; tmp = tmp->below) |
293 | for (tmp = victim->head_ ()->inv; tmp; tmp = tmp->below) |
294 | if (tmp->type == SIGN) /* possibly an immunity, or diseased */ |
294 | if (tmp->name == disease->name && tmp->is_immunity ()) /* possibly an immunity, or diseased */ |
295 | if (tmp->name == disease->name && tmp->level >= disease->level) |
295 | if (tmp->level >= disease->level) |
296 | return 0; /* Immune! */ |
296 | return 0; /* Immune! */ |
297 | |
297 | |
298 | object *new_symptom = get_archetype (shstr_symptom); |
298 | object *new_symptom = get_archetype (shstr_symptom); |
299 | |
299 | |
300 | /* Something special done with dam. We want diseases to be more |
300 | /* Something special done with dam. We want diseases to be more |
… | |
… | |
459 | * they were cast in that same order. Instead, change it so that |
459 | * they were cast in that same order. Instead, change it so that |
460 | * if you diseased, you can't get diseased more. |
460 | * if you diseased, you can't get diseased more. |
461 | */ |
461 | */ |
462 | |
462 | |
463 | for (tmp = victim->head_ ()->inv; tmp; tmp = tmp->below) |
463 | for (tmp = victim->head_ ()->inv; tmp; tmp = tmp->below) |
464 | if (tmp->type == SIGN && tmp->name == disease->name && tmp->level >= disease->level) |
464 | if (tmp->name == disease->name && tmp->is_immunity () && tmp->level >= disease->level) |
465 | return 0; /* Immune! */ |
465 | return 0; /* Immune! */ |
466 | else if (tmp->type == DISEASE && tmp->name == disease->name) |
466 | else if (tmp->type == DISEASE && tmp->name == disease->name) |
467 | return 0; /* already diseased */ |
467 | return 0; /* already diseased */ |
468 | |
468 | |
469 | /* If we've gotten this far, go ahead and infect the victim. */ |
469 | /* If we've gotten this far, go ahead and infect the victim. */ |