… | |
… | |
237 | { |
237 | { |
238 | object *walk; |
238 | object *walk; |
239 | |
239 | |
240 | /* check the inventory for symptoms */ |
240 | /* check the inventory for symptoms */ |
241 | for (walk = disease->env->inv; walk; walk = walk->below) |
241 | for (walk = disease->env->inv; walk; walk = walk->below) |
242 | if (!strcmp (walk->name, disease->name) && walk->type == SYMPTOM) |
242 | if (walk->name == disease->name && walk->type == SYMPTOM) |
243 | return walk; |
243 | return walk; |
244 | return NULL; |
244 | return NULL; |
245 | } |
245 | } |
246 | |
246 | |
247 | /* searches around for more victims to infect */ |
247 | /* searches around for more victims to infect */ |
… | |
… | |
325 | * if you diseased, you can't get diseased more. |
325 | * if you diseased, you can't get diseased more. |
326 | */ |
326 | */ |
327 | |
327 | |
328 | for ( /* tmp initialised in if, above */ ; tmp; tmp = tmp->below) |
328 | for ( /* tmp initialised in if, above */ ; tmp; tmp = tmp->below) |
329 | { |
329 | { |
330 | if (tmp->type == SIGN && !strcmp (tmp->name, disease->name) && tmp->level >= disease->level) |
330 | if (tmp->type == SIGN && tmp->name == disease->name && tmp->level >= disease->level) |
331 | return 0; /* Immune! */ |
331 | return 0; /* Immune! */ |
332 | else if (tmp->type == DISEASE && !strcmp (tmp->name, disease->name)) |
332 | else if (tmp->type == DISEASE && tmp->name == disease->name) |
333 | return 0; /* already diseased */ |
333 | return 0; /* already diseased */ |
334 | } |
334 | } |
335 | |
335 | |
336 | /* If we've gotten this far, go ahead and infect the victim. */ |
336 | /* If we've gotten this far, go ahead and infect the victim. */ |
337 | new_disease = disease->clone (); |
337 | new_disease = disease->clone (); |
… | |
… | |
435 | tmp = victim->inv; |
435 | tmp = victim->inv; |
436 | |
436 | |
437 | for ( /* tmp initialised in if, above */ ; tmp; tmp = tmp->below) |
437 | for ( /* tmp initialised in if, above */ ; tmp; tmp = tmp->below) |
438 | { |
438 | { |
439 | if (tmp->type == SIGN) /* possibly an immunity, or diseased */ |
439 | if (tmp->type == SIGN) /* possibly an immunity, or diseased */ |
440 | if (!strcmp (tmp->name, disease->name) && tmp->level >= disease->level) |
440 | if (tmp->name == disease->name && tmp->level >= disease->level) |
441 | return 0; /*Immune! */ |
441 | return 0; /*Immune! */ |
442 | } |
442 | } |
443 | |
443 | |
444 | new_symptom = get_archetype (ARCH_SYMPTOM); |
444 | new_symptom = get_archetype (ARCH_SYMPTOM); |
445 | |
445 | |
… | |
… | |
541 | if (disease->last_heal) |
541 | if (disease->last_heal) |
542 | return 0; |
542 | return 0; |
543 | /* first, search for an immunity of the same name */ |
543 | /* first, search for an immunity of the same name */ |
544 | for (walk = disease->env->inv; walk; walk = walk->below) |
544 | for (walk = disease->env->inv; walk; walk = walk->below) |
545 | { |
545 | { |
546 | if (walk->type == 98 && !strcmp (disease->name, walk->name)) |
546 | if (walk->type == 98 && disease->name == walk->name) |
547 | { |
547 | { |
548 | walk->level = disease->level; |
548 | walk->level = disease->level; |
549 | return 1; /* just update the existing immunity. */ |
549 | return 1; /* just update the existing immunity. */ |
550 | } |
550 | } |
551 | } |
551 | } |
… | |
… | |
611 | new_draw_info (NDI_UNIQUE | NDI_RED, 0, victim, symptom->msg); |
611 | new_draw_info (NDI_UNIQUE | NDI_RED, 0, victim, symptom->msg); |
612 | |
612 | |
613 | return 1; |
613 | return 1; |
614 | } |
614 | } |
615 | |
615 | |
616 | |
|
|
617 | /* possibly infect due to direct physical contact |
616 | /* possibly infect due to direct physical contact |
618 | i.e., AT_PHYSICAL-- called from "hit_player_attacktype" */ |
617 | * i.e., AT_PHYSICAL-- called from "hit_player_attacktype" */ |
619 | |
|
|
620 | int |
618 | int |
621 | check_physically_infect (object *victim, object *hitter) |
619 | check_physically_infect (object *victim, object *hitter) |
622 | { |
620 | { |
623 | object *walk; |
|
|
624 | |
|
|
625 | /* search for diseases, give every disease a chance to infect */ |
621 | /* search for diseases, give every disease a chance to infect */ |
626 | for (walk = hitter->inv; walk != NULL; walk = walk->below) |
622 | for (object *disease = hitter->inv; disease; disease = disease->below) |
627 | if (walk->type == DISEASE) |
623 | if (disease->type == DISEASE) |
628 | infect_object (victim, walk, 0); |
624 | infect_object (victim, disease, 0); |
|
|
625 | |
629 | return 1; |
626 | return 1; |
630 | } |
627 | } |
631 | |
628 | |
632 | /* find a disease in someone*/ |
629 | // find a disease in someone |
633 | object * |
630 | object * |
634 | find_disease (object *victim) |
631 | find_disease (object *victim) |
635 | { |
632 | { |
636 | object *walk; |
633 | for (object *disease = victim->inv; disease; disease = disease->below) |
637 | |
|
|
638 | for (walk = victim->inv; walk; walk = walk->below) |
|
|
639 | if (walk->type == DISEASE) |
634 | if (disease->type == DISEASE) |
640 | return walk; |
635 | return disease; |
|
|
636 | |
641 | return NULL; |
637 | return 0; |
642 | } |
638 | } |
643 | |
639 | |
644 | /* do the cure disease stuff, from the spell "cure disease" */ |
640 | /* do the cure disease stuff, from the spell "cure disease" */ |
645 | |
641 | |
646 | int |
642 | int |