… | |
… | |
427 | sprintf (buf1, "missed %s", &op->name); |
427 | sprintf (buf1, "missed %s", &op->name); |
428 | sprintf (buf2, " misses"); |
428 | sprintf (buf2, " misses"); |
429 | found++; |
429 | found++; |
430 | } |
430 | } |
431 | else if ((hitter->type == DISEASE || hitter->type == SYMPTOM || |
431 | else if ((hitter->type == DISEASE || hitter->type == SYMPTOM || |
432 | hitter->type == POISONING || (type & AT_POISON && IS_LIVE (op))) && !found) |
432 | hitter->type == POISONING || (type & AT_POISON && op->is_alive ())) && !found) |
433 | { |
433 | { |
434 | for (i = 0; i < MAXATTACKMESS && attack_mess[ATM_SUFFER][i].level != -1; i++) |
434 | for (i = 0; i < MAXATTACKMESS && attack_mess[ATM_SUFFER][i].level != -1; i++) |
435 | if (dam < attack_mess[ATM_SUFFER][i].level || attack_mess[ATM_SUFFER][i + 1].level == -1) |
435 | if (dam < attack_mess[ATM_SUFFER][i].level || attack_mess[ATM_SUFFER][i + 1].level == -1) |
436 | { |
436 | { |
437 | sprintf (buf1, "%s %s%s", attack_mess[ATM_SUFFER][i].buf1, &op->name, attack_mess[ATM_SUFFER][i].buf2); |
437 | sprintf (buf1, "%s %s%s", attack_mess[ATM_SUFFER][i].buf1, &op->name, attack_mess[ATM_SUFFER][i].buf2); |
… | |
… | |
449 | strcpy (buf2, attack_mess[ATM_DOOR][i].buf3); |
449 | strcpy (buf2, attack_mess[ATM_DOOR][i].buf3); |
450 | found++; |
450 | found++; |
451 | break; |
451 | break; |
452 | } |
452 | } |
453 | } |
453 | } |
454 | else if (hitter->type == PLAYER && IS_LIVE (op)) |
454 | else if (hitter->type == PLAYER && op->is_alive ()) |
455 | { |
455 | { |
456 | if (USING_SKILL (hitter, SK_KARATE)) |
456 | if (USING_SKILL (hitter, SK_KARATE)) |
457 | { |
457 | { |
458 | for (i = 0; i < MAXATTACKMESS && attack_mess[ATM_KARATE][i].level != -1; i++) |
458 | for (i = 0; i < MAXATTACKMESS && attack_mess[ATM_KARATE][i].level != -1; i++) |
459 | if (dam < attack_mess[ATM_KARATE][i].level || attack_mess[ATM_KARATE][i + 1].level == -1) |
459 | if (dam < attack_mess[ATM_KARATE][i].level || attack_mess[ATM_KARATE][i + 1].level == -1) |
… | |
… | |
485 | found++; |
485 | found++; |
486 | break; |
486 | break; |
487 | } |
487 | } |
488 | } |
488 | } |
489 | } |
489 | } |
|
|
490 | |
490 | if (found) |
491 | if (found) |
491 | { |
492 | { |
492 | /* done */ |
493 | /* done */ |
493 | } |
494 | } |
494 | else if (IS_ARROW (hitter) && (type == AT_PHYSICAL || type == AT_MAGIC)) |
495 | else if (hitter->is_arrow () && (type == AT_PHYSICAL || type == AT_MAGIC)) |
495 | { |
496 | { |
496 | sprintf (buf1, "hit"); /* just in case */ |
497 | sprintf (buf1, "hit"); /* just in case */ |
497 | for (i = 0; i < MAXATTACKMESS; i++) |
498 | for (i = 0; i < MAXATTACKMESS; i++) |
498 | if (dam < attack_mess[ATM_ARROW][i].level || attack_mess[ATM_ARROW][i + 1].level == -1) |
499 | if (dam < attack_mess[ATM_ARROW][i].level || attack_mess[ATM_ARROW][i + 1].level == -1) |
499 | { |
500 | { |
500 | strcpy (buf2, attack_mess[ATM_ARROW][i].buf3); |
501 | strcpy (buf2, attack_mess[ATM_ARROW][i].buf3); |
501 | found++; |
502 | found++; |
502 | break; |
503 | break; |
503 | } |
504 | } |
504 | } |
505 | } |
505 | else if (type & AT_DRAIN && IS_LIVE (op)) |
506 | else if (type & AT_DRAIN && op->is_alive ()) |
506 | { |
507 | { |
507 | /* drain is first, because some items have multiple attypes */ |
508 | /* drain is first, because some items have multiple attypes */ |
508 | for (i = 0; i < MAXATTACKMESS && attack_mess[ATM_DRAIN][i].level != -1; i++) |
509 | for (i = 0; i < MAXATTACKMESS && attack_mess[ATM_DRAIN][i].level != -1; i++) |
509 | if (dam < attack_mess[ATM_DRAIN][i].level || attack_mess[ATM_DRAIN][i + 1].level == -1) |
510 | if (dam < attack_mess[ATM_DRAIN][i].level || attack_mess[ATM_DRAIN][i + 1].level == -1) |
510 | { |
511 | { |
… | |
… | |
512 | strcpy (buf2, attack_mess[ATM_DRAIN][i].buf3); |
513 | strcpy (buf2, attack_mess[ATM_DRAIN][i].buf3); |
513 | found++; |
514 | found++; |
514 | break; |
515 | break; |
515 | } |
516 | } |
516 | } |
517 | } |
517 | else if (type & AT_ELECTRICITY && IS_LIVE (op)) |
518 | else if (type & AT_ELECTRICITY && op->is_alive ()) |
518 | { |
519 | { |
519 | for (i = 0; i < MAXATTACKMESS && attack_mess[ATM_ELEC][i].level != -1; i++) |
520 | for (i = 0; i < MAXATTACKMESS && attack_mess[ATM_ELEC][i].level != -1; i++) |
520 | if (dam < attack_mess[ATM_ELEC][i].level || attack_mess[ATM_ELEC][i + 1].level == -1) |
521 | if (dam < attack_mess[ATM_ELEC][i].level || attack_mess[ATM_ELEC][i + 1].level == -1) |
521 | { |
522 | { |
522 | sprintf (buf1, "%s %s%s", attack_mess[ATM_ELEC][i].buf1, &op->name, attack_mess[ATM_ELEC][i].buf2); |
523 | sprintf (buf1, "%s %s%s", attack_mess[ATM_ELEC][i].buf1, &op->name, attack_mess[ATM_ELEC][i].buf2); |
523 | strcpy (buf2, attack_mess[ATM_ELEC][i].buf3); |
524 | strcpy (buf2, attack_mess[ATM_ELEC][i].buf3); |
524 | found++; |
525 | found++; |
525 | break; |
526 | break; |
526 | } |
527 | } |
527 | } |
528 | } |
528 | else if (type & AT_COLD && IS_LIVE (op)) |
529 | else if (type & AT_COLD && op->is_alive ()) |
529 | { |
530 | { |
530 | for (i = 0; i < MAXATTACKMESS && attack_mess[ATM_COLD][i].level != -1; i++) |
531 | for (i = 0; i < MAXATTACKMESS && attack_mess[ATM_COLD][i].level != -1; i++) |
531 | if (dam < attack_mess[ATM_COLD][i].level || attack_mess[ATM_COLD][i + 1].level == -1) |
532 | if (dam < attack_mess[ATM_COLD][i].level || attack_mess[ATM_COLD][i + 1].level == -1) |
532 | { |
533 | { |
533 | sprintf (buf1, "%s %s%s", attack_mess[ATM_COLD][i].buf1, &op->name, attack_mess[ATM_COLD][i].buf2); |
534 | sprintf (buf1, "%s %s%s", attack_mess[ATM_COLD][i].buf1, &op->name, attack_mess[ATM_COLD][i].buf2); |