… | |
… | |
521 | { /* outside a monster/player, die immediately */ |
521 | { /* outside a monster/player, die immediately */ |
522 | symptom->destroy (); |
522 | symptom->destroy (); |
523 | return 0; |
523 | return 0; |
524 | } |
524 | } |
525 | |
525 | |
526 | int damage = |
|
|
527 | symptom->stats.dam > 0 |
|
|
528 | ? symptom->stats.dam |
|
|
529 | : max (1, victim->stats.maxhp * -symptom->stats.dam / 100); |
|
|
530 | |
|
|
531 | hit_player (victim, damage, symptom, symptom->attacktype, 1); |
|
|
532 | |
|
|
533 | int sp_reduce = |
|
|
534 | symptom->stats.maxsp > 0 |
|
|
535 | ? symptom->stats.maxsp |
|
|
536 | : max (1, victim->stats.maxsp * -symptom->stats.maxsp / 100); |
|
|
537 | |
|
|
538 | victim->stats.sp = max (0, victim->stats.sp - sp_reduce); |
|
|
539 | |
|
|
540 | /* create the symptom "other arch" object and drop it here |
526 | /* create the symptom "other arch" object and drop it here |
541 | * under every part of the monster |
527 | * under every part of the monster |
542 | * The victim may well have died. |
528 | * The victim may well have died. |
543 | */ |
529 | */ |
544 | if (victim->map) |
530 | if (victim->map) |
… | |
… | |
546 | victim->play_sound (symptom->sound); |
532 | victim->play_sound (symptom->sound); |
547 | |
533 | |
548 | if (symptom->other_arch) |
534 | if (symptom->other_arch) |
549 | for (object *tmp = victim->head_ (); tmp; tmp = tmp->more) |
535 | for (object *tmp = victim->head_ (); tmp; tmp = tmp->more) |
550 | { |
536 | { |
551 | object *new_ob = arch_to_object (symptom->other_arch); |
537 | object *new_ob = symptom->other_arch->instance (); |
552 | new_ob->x = tmp->x; |
538 | new_ob->x = tmp->x; |
553 | new_ob->y = tmp->y; |
539 | new_ob->y = tmp->y; |
554 | new_ob->map = victim->map; |
540 | new_ob->map = victim->map; |
555 | insert_ob_in_map (new_ob, victim->map, victim, 0); |
541 | insert_ob_in_map (new_ob, victim->map, victim, 0); |
556 | } |
542 | } |
557 | } |
543 | } |
|
|
544 | |
|
|
545 | int damage = |
|
|
546 | symptom->stats.dam > 0 |
|
|
547 | ? symptom->stats.dam |
|
|
548 | : max (1, victim->stats.maxhp * -symptom->stats.dam / 100); |
|
|
549 | |
|
|
550 | hit_player (victim, damage, symptom, symptom->attacktype, 1); |
|
|
551 | |
|
|
552 | int sp_reduce = |
|
|
553 | symptom->stats.maxsp > 0 |
|
|
554 | ? symptom->stats.maxsp |
|
|
555 | : max (1, victim->stats.maxsp * -symptom->stats.maxsp / 100); |
|
|
556 | |
|
|
557 | victim->stats.sp = max (0, victim->stats.sp - sp_reduce); |
558 | |
558 | |
559 | new_draw_info (NDI_UNIQUE | NDI_RED, 0, victim, symptom->msg); |
559 | new_draw_info (NDI_UNIQUE | NDI_RED, 0, victim, symptom->msg); |
560 | |
560 | |
561 | return 1; |
561 | return 1; |
562 | } |
562 | } |