… | |
… | |
1774 | |
1774 | |
1775 | /* how far to fly */ |
1775 | /* how far to fly */ |
1776 | throw_ob->last_sp = (eff_str * 3) / 5; |
1776 | throw_ob->last_sp = (eff_str * 3) / 5; |
1777 | |
1777 | |
1778 | /* speed */ |
1778 | /* speed */ |
1779 | throw_ob->speed = (speed_bonus[eff_str] + 1.0) / 1.5; |
1779 | throw_ob->set_speed (min (1.0, speed_bonus[eff_str] + 1.0) / 1.5); /* no faster than an arrow! */ |
1780 | throw_ob->speed = MIN (1.0, throw_ob->speed); /* no faster than an arrow! */ |
|
|
1781 | |
1780 | |
1782 | /* item damage. Eff_str and item weight influence damage done */ |
1781 | /* item damage. Eff_str and item weight influence damage done */ |
1783 | weight_f = (throw_ob->weight / 2000) > MAX_STAT ? MAX_STAT : (throw_ob->weight / 2000); |
1782 | weight_f = (throw_ob->weight / 2000) > MAX_STAT ? MAX_STAT : (throw_ob->weight / 2000); |
1784 | throw_ob->stats.dam += (dam / 3) + dam_bonus[weight_f] + (throw_ob->weight / 15000) - 2; |
1783 | throw_ob->stats.dam += (dam / 3) + dam_bonus[weight_f] + (throw_ob->weight / 15000) - 2; |
1785 | |
1784 | |
1786 | /* chance of breaking. Proportional to force used and weight of item */ |
1785 | /* chance of breaking. Proportional to force used and weight of item */ |
1787 | throw_ob->stats.food = (dam / 2) + (throw_ob->weight / 60000); |
1786 | throw_ob->stats.food = (dam / 2) + (throw_ob->weight / 60000); |
1788 | |
1787 | |
1789 | /* replace 25 with a call to clone.arch wc? messes up w/ NPC */ |
1788 | /* replace 25 with a call to clone.arch wc? messes up w/ NPC */ |
1790 | throw_ob->stats.wc = 25 - dex_bonus[op->stats.Dex] - thaco_bonus[eff_str] - skill->level; |
1789 | throw_ob->stats.wc = 25 - dex_bonus[op->stats.Dex] - thaco_bonus[eff_str] - skill->level; |
1791 | |
|
|
1792 | |
1790 | |
1793 | /* the properties of objects which are meant to be thrown (ie dart, |
1791 | /* the properties of objects which are meant to be thrown (ie dart, |
1794 | * throwing knife, etc) will differ from ordinary items. Lets tailor |
1792 | * throwing knife, etc) will differ from ordinary items. Lets tailor |
1795 | * this stuff in here. |
1793 | * this stuff in here. |
1796 | */ |
1794 | */ |
… | |
… | |
1810 | if (throw_ob->material & M_LEATHER) |
1808 | if (throw_ob->material & M_LEATHER) |
1811 | { |
1809 | { |
1812 | throw_ob->stats.dam -= 1; |
1810 | throw_ob->stats.dam -= 1; |
1813 | throw_ob->stats.food -= 10; |
1811 | throw_ob->stats.food -= 10; |
1814 | } |
1812 | } |
|
|
1813 | |
1815 | if (throw_ob->material & M_GLASS) |
1814 | if (throw_ob->material & M_GLASS) |
1816 | throw_ob->stats.food += 60; |
1815 | throw_ob->stats.food += 60; |
1817 | |
1816 | |
1818 | if (throw_ob->material & M_ORGANIC) |
1817 | if (throw_ob->material & M_ORGANIC) |
1819 | { |
1818 | { |
1820 | throw_ob->stats.dam -= 3; |
1819 | throw_ob->stats.dam -= 3; |
1821 | throw_ob->stats.food += 55; |
1820 | throw_ob->stats.food += 55; |
1822 | } |
1821 | } |
|
|
1822 | |
1823 | if (throw_ob->material & M_PAPER || throw_ob->material & M_CLOTH) |
1823 | if (throw_ob->material & M_PAPER || throw_ob->material & M_CLOTH) |
1824 | { |
1824 | { |
1825 | throw_ob->stats.dam -= 5; |
1825 | throw_ob->stats.dam -= 5; |
1826 | throw_ob->speed *= 0.8; |
1826 | throw_ob->speed *= 0.8; |
1827 | throw_ob->stats.wc += 3; |
1827 | throw_ob->stats.wc += 3; |
1828 | throw_ob->stats.food -= 30; |
1828 | throw_ob->stats.food -= 30; |
1829 | } |
1829 | } |
|
|
1830 | |
1830 | /* light obj have more wind resistance, fly slower */ |
1831 | /* light obj have more wind resistance, fly slower */ |
1831 | if (throw_ob->weight > 500) |
1832 | if (throw_ob->weight > 500) |
1832 | throw_ob->speed *= 0.8; |
1833 | throw_ob->speed *= 0.8; |
|
|
1834 | |
1833 | if (throw_ob->weight > 50) |
1835 | if (throw_ob->weight > 50) |
1834 | throw_ob->speed *= 0.5; |
1836 | throw_ob->speed *= 0.5; |
1835 | |
|
|
1836 | } /* else tailor thrown object */ |
1837 | } /* else tailor thrown object */ |
1837 | |
1838 | |
1838 | /* some limits, and safeties (needed?) */ |
1839 | /* some limits, and safeties (needed?) */ |
1839 | if (throw_ob->stats.dam < 0) |
1840 | if (throw_ob->stats.dam < 0) |
1840 | throw_ob->stats.dam = 0; |
1841 | throw_ob->stats.dam = 0; |
… | |
… | |
1860 | * In short summary, a throw can take anywhere between speed 5 and |
1861 | * In short summary, a throw can take anywhere between speed 5 and |
1861 | * speed 0.5 |
1862 | * speed 0.5 |
1862 | */ |
1863 | */ |
1863 | op->speed_left -= 50 / pause_f; |
1864 | op->speed_left -= 50 / pause_f; |
1864 | |
1865 | |
1865 | update_ob_speed (throw_ob); |
|
|
1866 | throw_ob->speed_left = 0; |
1866 | throw_ob->speed_left = 0; |
1867 | throw_ob->map = part->map; |
1867 | throw_ob->map = part->map; |
1868 | |
1868 | |
1869 | throw_ob->move_type = MOVE_FLY_LOW; |
1869 | throw_ob->move_type = MOVE_FLY_LOW; |
1870 | throw_ob->move_on = MOVE_FLY_LOW | MOVE_WALK; |
1870 | throw_ob->move_on = MOVE_FLY_LOW | MOVE_WALK; |