… | |
… | |
1590 | if (op->type == PLAYER) |
1590 | if (op->type == PLAYER) |
1591 | new_draw_info_format (NDI_UNIQUE, 0, op, "You have no %s left.", &bow->race); |
1591 | new_draw_info_format (NDI_UNIQUE, 0, op, "You have no %s left.", &bow->race); |
1592 | /* FLAG_READY_BOW will get reset if the monsters picks up some arrows */ |
1592 | /* FLAG_READY_BOW will get reset if the monsters picks up some arrows */ |
1593 | else |
1593 | else |
1594 | CLEAR_FLAG (op, FLAG_READY_BOW); |
1594 | CLEAR_FLAG (op, FLAG_READY_BOW); |
|
|
1595 | |
1595 | return 0; |
1596 | return 0; |
1596 | } |
1597 | } |
1597 | } |
1598 | } |
1598 | |
1599 | |
1599 | mflags = get_map_flags (op->map, &m, sx, sy, &sx, &sy); |
1600 | mflags = get_map_flags (op->map, &m, sx, sy, &sx, &sy); |
… | |
… | |
1630 | op->speed_left = 0.01 - (float) FABS (op->speed) * 100 / bowspeed; |
1631 | op->speed_left = 0.01 - (float) FABS (op->speed) * 100 / bowspeed; |
1631 | op->update_stats (); |
1632 | op->update_stats (); |
1632 | } |
1633 | } |
1633 | |
1634 | |
1634 | SET_ANIMATION (arrow, arrow->direction); |
1635 | SET_ANIMATION (arrow, arrow->direction); |
|
|
1636 | |
1635 | arrow->stats.sp = arrow->stats.wc; /* save original wc and dam */ |
1637 | arrow->stats.sp = arrow->stats.wc; /* save original wc and dam */ |
1636 | arrow->stats.hp = arrow->stats.dam; |
1638 | arrow->stats.hp = arrow->stats.dam; |
1637 | arrow->stats.grace = arrow->attacktype; |
1639 | arrow->stats.grace = arrow->attacktype; |
|
|
1640 | |
1638 | if (arrow->slaying != NULL) |
1641 | if (arrow->slaying) |
1639 | arrow->spellarg = strdup (arrow->slaying); |
1642 | arrow->spellarg = strdup (arrow->slaying); |
1640 | |
1643 | |
1641 | /* Note that this was different for monsters - they got their level |
1644 | arrow->stats.dam += op->stats.dam + arrow->magic; |
1642 | * added to the damage. I think the strength bonus is more proper. |
|
|
1643 | */ |
|
|
1644 | |
|
|
1645 | arrow->stats.dam += (QUERY_FLAG (bow, FLAG_NO_STRENGTH) ? 0 : dam_bonus[op->stats.Str]) + bow->stats.dam + bow->magic + arrow->magic; |
|
|
1646 | |
1645 | |
1647 | /* update the speed */ |
1646 | /* update the speed */ |
1648 | arrow->speed = (float) ((QUERY_FLAG (bow, FLAG_NO_STRENGTH) ? |
1647 | arrow->speed = (float) ((QUERY_FLAG (bow, FLAG_NO_STRENGTH) ? |
1649 | 0 : dam_bonus[op->stats.Str]) + bow->magic + arrow->magic) / 5.0 + (float) bow->stats.dam / 7.0; |
1648 | 0 : dam_bonus[op->stats.Str]) + bow->magic + arrow->magic) / 5.0 + (float) bow->stats.dam / 7.0; |
1650 | |
1649 | |
1651 | arrow->set_speed (max (arrow->speed, 1.0)); |
1650 | arrow->set_speed (max (arrow->speed, 1.0)); |
1652 | arrow->speed_left = 0; |
1651 | arrow->speed_left = 0; |
1653 | |
1652 | |
|
|
1653 | arrow->stats.wc = op->stats.wc + wc_mod - arrow->magic - arrow->stats.wc; |
|
|
1654 | |
1654 | if (op->type == PLAYER) |
1655 | if (op->type == PLAYER) |
1655 | { |
1656 | { |
1656 | arrow->stats.wc = 20 - bow->magic - arrow->magic - |
|
|
1657 | (op->chosen_skill ? op->chosen_skill->level : op->level) - |
|
|
1658 | dex_bonus[op->stats.Dex] - thaco_bonus[op->stats.Str] - arrow->stats.wc - bow->stats.wc + wc_mod; |
|
|
1659 | |
|
|
1660 | arrow->level = op->chosen_skill ? op->chosen_skill->level : op->level; |
1657 | arrow->level = op->chosen_skill ? op->chosen_skill->level : op->level; |
|
|
1658 | arrow->stats.wc -= dex_bonus[op->stats.Dex]; |
|
|
1659 | |
|
|
1660 | if (!arrow->slaying) |
|
|
1661 | arrow->slaying = op->slaying; |
1661 | } |
1662 | } |
1662 | else |
1663 | else |
1663 | { |
1664 | { |
1664 | arrow->stats.wc = op->stats.wc - bow->magic - arrow->magic - arrow->stats.wc + wc_mod; |
|
|
1665 | arrow->level = op->level; |
1665 | arrow->level = op->level; |
1666 | } |
1666 | arrow->stats.wc -= bow->magic; |
1667 | |
1667 | |
1668 | if (arrow->attacktype == AT_PHYSICAL) |
1668 | if (!arrow->slaying) |
|
|
1669 | arrow->slaying = bow->slaying; |
|
|
1670 | } |
|
|
1671 | |
|
|
1672 | arrow->stats.wc -= arrow->level; |
|
|
1673 | |
1669 | arrow->attacktype |= bow->attacktype; |
1674 | arrow->attacktype |= bow->attacktype; |
1670 | |
|
|
1671 | if (bow->slaying) |
|
|
1672 | arrow->slaying = bow->slaying; |
|
|
1673 | |
1675 | |
1674 | arrow->move_type = MOVE_FLY_LOW; |
1676 | arrow->move_type = MOVE_FLY_LOW; |
1675 | arrow->move_on = MOVE_FLY_LOW | MOVE_WALK; |
1677 | arrow->move_on = MOVE_FLY_LOW | MOVE_WALK; |
1676 | |
1678 | |
1677 | play_sound_map (op->map, op->x, op->y, SOUND_FIRE_ARROW); |
1679 | play_sound_map (op->map, op->x, op->y, SOUND_FIRE_ARROW); |