… | |
… | |
1800 | if (!dir) |
1800 | if (!dir) |
1801 | { |
1801 | { |
1802 | new_draw_info (NDI_UNIQUE, 0, op, "You can't shoot yourself!"); |
1802 | new_draw_info (NDI_UNIQUE, 0, op, "You can't shoot yourself!"); |
1803 | return 0; |
1803 | return 0; |
1804 | } |
1804 | } |
|
|
1805 | |
1805 | if (op->type == PLAYER) |
1806 | if (op->type == PLAYER) |
1806 | bow = op->contr->ranges[range_bow]; |
1807 | bow = op->contr->ranges[range_bow]; |
1807 | else |
1808 | else |
1808 | { |
1809 | { |
1809 | for (bow = op->inv; bow; bow = bow->below) |
1810 | for (bow = op->inv; bow; bow = bow->below) |
… | |
… | |
1817 | { |
1818 | { |
1818 | LOG (llevError, "Range: bow without activated bow (%s).\n", &op->name); |
1819 | LOG (llevError, "Range: bow without activated bow (%s).\n", &op->name); |
1819 | return 0; |
1820 | return 0; |
1820 | } |
1821 | } |
1821 | } |
1822 | } |
|
|
1823 | |
1822 | if (!bow->race || !bow->skill) |
1824 | if (!bow->race || !bow->skill) |
1823 | { |
1825 | { |
1824 | new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s is broken.", &bow->name); |
1826 | new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s is broken.", &bow->name); |
1825 | return 0; |
1827 | return 0; |
1826 | } |
1828 | } |
… | |
… | |
1828 | bowspeed = bow->stats.sp + dex_bonus[op->stats.Dex]; |
1830 | bowspeed = bow->stats.sp + dex_bonus[op->stats.Dex]; |
1829 | |
1831 | |
1830 | /* penalize ROF for bestarrow */ |
1832 | /* penalize ROF for bestarrow */ |
1831 | if (op->type == PLAYER && op->contr->bowtype == bow_bestarrow) |
1833 | if (op->type == PLAYER && op->contr->bowtype == bow_bestarrow) |
1832 | bowspeed -= dex_bonus[op->stats.Dex] + 5; |
1834 | bowspeed -= dex_bonus[op->stats.Dex] + 5; |
|
|
1835 | |
1833 | if (bowspeed < 1) |
1836 | if (bowspeed < 1) |
1834 | bowspeed = 1; |
1837 | bowspeed = 1; |
1835 | |
1838 | |
1836 | if (arrow == NULL) |
1839 | if (arrow == NULL) |
1837 | { |
1840 | { |
… | |
… | |
1843 | else |
1846 | else |
1844 | CLEAR_FLAG (op, FLAG_READY_BOW); |
1847 | CLEAR_FLAG (op, FLAG_READY_BOW); |
1845 | return 0; |
1848 | return 0; |
1846 | } |
1849 | } |
1847 | } |
1850 | } |
|
|
1851 | |
1848 | mflags = get_map_flags (op->map, &m, sx, sy, &sx, &sy); |
1852 | mflags = get_map_flags (op->map, &m, sx, sy, &sx, &sy); |
1849 | if (mflags & P_OUT_OF_MAP) |
1853 | if (mflags & P_OUT_OF_MAP) |
1850 | { |
|
|
1851 | return 0; |
1854 | return 0; |
1852 | } |
1855 | |
1853 | if (GET_MAP_MOVE_BLOCK (m, sx, sy) == MOVE_FLY_LOW) |
1856 | if (GET_MAP_MOVE_BLOCK (m, sx, sy) == MOVE_FLY_LOW) |
1854 | { |
1857 | { |
1855 | new_draw_info (NDI_UNIQUE, 0, op, "Something is in the way."); |
1858 | new_draw_info (NDI_UNIQUE, 0, op, "Something is in the way."); |
1856 | return 0; |
1859 | return 0; |
1857 | } |
1860 | } |
… | |
… | |
1863 | return 0; |
1866 | return 0; |
1864 | } |
1867 | } |
1865 | |
1868 | |
1866 | left = arrow; /* these are arrows left to the player */ |
1869 | left = arrow; /* these are arrows left to the player */ |
1867 | arrow = get_split_ob (arrow, 1); |
1870 | arrow = get_split_ob (arrow, 1); |
1868 | if (arrow == NULL) |
1871 | if (!arrow) |
1869 | { |
1872 | { |
1870 | new_draw_info_format (NDI_UNIQUE, 0, op, "You have no %s left.", &bow->race); |
1873 | new_draw_info_format (NDI_UNIQUE, 0, op, "You have no %s left.", &bow->race); |
1871 | return 0; |
1874 | return 0; |
1872 | } |
1875 | } |
|
|
1876 | |
1873 | arrow->set_owner (op); |
1877 | arrow->set_owner (op); |
1874 | arrow->skill = bow->skill; |
1878 | arrow->skill = bow->skill; |
1875 | |
1879 | |
1876 | arrow->direction = dir; |
1880 | arrow->direction = dir; |
1877 | arrow->x = sx; |
1881 | arrow->x = sx; |
… | |
… | |
1920 | } |
1924 | } |
1921 | |
1925 | |
1922 | if (arrow->attacktype == AT_PHYSICAL) |
1926 | if (arrow->attacktype == AT_PHYSICAL) |
1923 | arrow->attacktype |= bow->attacktype; |
1927 | arrow->attacktype |= bow->attacktype; |
1924 | |
1928 | |
1925 | if (bow->slaying != NULL) |
1929 | if (bow->slaying) |
1926 | arrow->slaying = bow->slaying; |
1930 | arrow->slaying = bow->slaying; |
1927 | |
1931 | |
1928 | arrow->map = m; |
1932 | arrow->map = m; |
1929 | arrow->move_type = MOVE_FLY_LOW; |
1933 | arrow->move_type = MOVE_FLY_LOW; |
1930 | arrow->move_on = MOVE_FLY_LOW | MOVE_WALK; |
1934 | arrow->move_on = MOVE_FLY_LOW | MOVE_WALK; |