… | |
… | |
689 | * about 17 squares. Tune as needed. |
689 | * about 17 squares. Tune as needed. |
690 | */ |
690 | */ |
691 | op->set_speed (op->speed - 0.05); |
691 | op->set_speed (op->speed - 0.05); |
692 | |
692 | |
693 | /* if the arrow is moving too slow.. stop it. 0.5 was chosen as lower |
693 | /* if the arrow is moving too slow.. stop it. 0.5 was chosen as lower |
694 | values look rediculous. */ |
694 | values look ridiculous. */ |
695 | if (op->speed < (op->type == ARROW ? 0.5 : MIN_ACTIVE_SPEED)) |
695 | if (op->speed < (op->type == ARROW ? 0.5 : MIN_ACTIVE_SPEED)) |
696 | { |
696 | { |
697 | stop_arrow (op); |
697 | stop_arrow (op); |
698 | return; |
698 | return; |
699 | } |
699 | } |
… | |
… | |
713 | if (pos->flags () & P_IS_ALIVE) |
713 | if (pos->flags () & P_IS_ALIVE) |
714 | { |
714 | { |
715 | object *tmp; |
715 | object *tmp; |
716 | |
716 | |
717 | for (tmp = pos->bot; tmp; tmp = tmp->above) |
717 | for (tmp = pos->bot; tmp; tmp = tmp->above) |
718 | if (tmp->flag [FLAG_ALIVE]) |
718 | if (tmp->flag [FLAG_ALIVE] && tmp != op->owner) |
719 | break; |
719 | { |
720 | |
|
|
721 | /* Not really fair, but don't let monsters hit themselves with |
720 | /* Not really fair, but don't let monsters hit themselves with |
722 | * their own arrow - this can be because they fire it then |
721 | * their own arrow - this can be because they fire it then |
723 | * move into it. |
722 | * move into it. |
724 | */ |
723 | */ |
725 | if (tmp && tmp != op->owner) |
724 | |
726 | { |
|
|
727 | /* Found living object, but it is reflecting the missile. Update |
725 | /* Found living object, but it is reflecting the missile. Update |
728 | * as below. (Note that for living creatures there is a small |
726 | * as below. (Note that for living creatures there is a small |
729 | * chance that reflect_missile fails.) |
727 | * chance that reflect_missile fails.) |
730 | */ |
728 | */ |
731 | if (tmp->flag [FLAG_REFL_MISSILE] && (rndm (0, 99)) < (90 - op->level / 10)) |
729 | if (tmp->flag [FLAG_REFL_MISSILE] && (rndm (0, 99)) < (90 - op->level / 10)) |
732 | { |
730 | { |
733 | op->direction = absdir (op->direction + 4); |
731 | op->direction = absdir (op->direction + 4); |
734 | update_turn_face (op); |
732 | update_turn_face (op); |
735 | was_reflected = 1; /* skip normal movement calculations */ |
733 | was_reflected = 1; /* skip normal movement calculations */ |
736 | } |
734 | } |
737 | else |
735 | else |
738 | { |
736 | { |
739 | /* Attack the object. */ |
737 | /* Attack the object. */ |
740 | op = hit_with_arrow (op, tmp); |
738 | op = hit_with_arrow (op, tmp); |
741 | |
739 | |
742 | if (!op) |
740 | if (!op) |
743 | return; |
741 | return; |
744 | } |
742 | } |
745 | } /* if this is not hitting its owner */ |
743 | |
746 | } /* if there is something alive on this space */ |
744 | break; |
|
|
745 | } |
|
|
746 | } |
747 | |
747 | |
748 | if (OB_TYPE_MOVE_BLOCK (op, pos->move_block)) |
748 | if (OB_TYPE_MOVE_BLOCK (op, pos->move_block)) |
749 | { |
749 | { |
750 | int retry = 0; |
750 | int retry = 0; |
751 | |
751 | |