… | |
… | |
1647 | op->update_stats (); |
1647 | op->update_stats (); |
1648 | } |
1648 | } |
1649 | |
1649 | |
1650 | SET_ANIMATION (arrow, arrow->direction); |
1650 | SET_ANIMATION (arrow, arrow->direction); |
1651 | |
1651 | |
1652 | arrow->stats.dam += op->stats.dam + arrow->magic; |
|
|
1653 | |
|
|
1654 | /* update the speed */ |
1652 | /* update the speed */ |
1655 | arrow->speed = ((bow->flag [FLAG_NO_STRENGTH] ? 0 : dam_bonus[op->stats.Str]) + bow->magic + arrow->magic) / 5.0 |
1653 | arrow->speed = ((bow->flag [FLAG_NO_STRENGTH] ? 0 : dam_bonus[op->stats.Str]) + bow->magic + arrow->magic) / 5.0 |
1656 | + bow->stats.dam / 7.0; |
1654 | + bow->stats.dam / 7.0; |
1657 | |
1655 | |
1658 | arrow->set_speed (max (arrow->speed, 2.0)); |
1656 | arrow->set_speed (max (arrow->speed, 2.0)); |
1659 | arrow->speed_left = 0; |
1657 | arrow->speed_left = 0; |
1660 | |
1658 | |
1661 | arrow->stats.wc = op->stats.wc + wc_mod - arrow->magic - arrow->stats.wc; |
1659 | int wc = op->stats.wc + wc_mod - arrow->magic - arrow->stats.wc; |
1662 | |
1660 | |
1663 | if (op->type == PLAYER) |
1661 | if (op->type == PLAYER) |
1664 | { |
1662 | { |
1665 | arrow->level = op->chosen_skill ? op->chosen_skill->level : op->level; |
1663 | arrow->level = op->chosen_skill ? op->chosen_skill->level : op->level; |
1666 | arrow->stats.wc -= dex_bonus[op->stats.Dex]; |
1664 | wc -= dex_bonus[op->stats.Dex]; |
1667 | |
1665 | |
1668 | if (!arrow->slaying) |
1666 | if (!arrow->slaying) |
1669 | arrow->slaying = op->slaying; |
1667 | arrow->slaying = op->slaying; |
1670 | |
1668 | |
1671 | arrow->attacktype |= op->attacktype; |
1669 | arrow->attacktype |= op->attacktype; |
… | |
… | |
1679 | arrow->slaying = bow->slaying; |
1677 | arrow->slaying = bow->slaying; |
1680 | |
1678 | |
1681 | arrow->attacktype |= bow->attacktype; |
1679 | arrow->attacktype |= bow->attacktype; |
1682 | } |
1680 | } |
1683 | |
1681 | |
1684 | arrow->stats.wc -= arrow->level; |
1682 | wc -= arrow->level; |
|
|
1683 | arrow->stats.dam = clamp (arrow->stats.dam + op->stats.dam + arrow->magic, MIN_DAM, MAX_DAM); |
1685 | |
1684 | |
|
|
1685 | arrow->stats.wc = clamp (wc, MIN_WC, MAX_WC); |
1686 | arrow->move_type = MOVE_FLY_LOW; |
1686 | arrow->move_type = MOVE_FLY_LOW; |
1687 | arrow->move_on = MOVE_FLY_LOW | MOVE_WALK; |
1687 | arrow->move_on = MOVE_FLY_LOW | MOVE_WALK; |
1688 | |
1688 | |
1689 | play_sound_map (op->map, op->x, op->y, SOUND_FIRE_ARROW); |
1689 | play_sound_map (op->map, op->x, op->y, SOUND_FIRE_ARROW); |
1690 | m->insert (arrow, sx, sy, op); |
1690 | m->insert (arrow, sx, sy, op); |