| 1780 | } |
| 1781 | |
| 1782 | void |
| 1783 | curse(struct obj *otmp) |
| 1784 | { |
| 1785 | unsigned already_cursed; |
| 1786 | int old_light = 0; |
| 1787 | |
| 1788 | if (otmp->oclass == COIN_CLASS) |
| 1789 | return; |
| 1790 | if (otmp->lamplit) |
| 1791 | old_light = arti_light_radius(otmp); |
| 1792 | already_cursed = otmp->cursed; |
| 1793 | otmp->blessed = 0; |
| 1794 | otmp->cursed = 1; |
| 1795 | /* welded two-handed weapon interferes with some armor removal */ |
| 1796 | if (otmp == uwep && bimanual(uwep)) |
| 1797 | reset_remarm(); |
| 1798 | /* rules at top of wield.c state that twoweapon cannot be done |
| 1799 | with cursed alternate weapon */ |
| 1800 | if (otmp == uswapwep && u.twoweap) |
| 1801 | drop_uswapwep(); |
| 1802 | /* some cursed items need immediate updating */ |
| 1803 | if (carried(otmp) && confers_luck(otmp)) { |
| 1804 | set_moreluck(); |
| 1805 | } else if (otmp->otyp == BAG_OF_HOLDING) { |
| 1806 | otmp->owt = weight(otmp); |
| 1807 | } else if (otmp->otyp == FIGURINE) { |
| 1808 | if (otmp->corpsenm != NON_PM && !dead_species(otmp->corpsenm, TRUE) |
| 1809 | && (carried(otmp) || mcarried(otmp))) |
| 1810 | attach_fig_transform_timeout(otmp); |
| 1811 | } else if (otmp->oclass == SPBOOK_CLASS) { |
| 1812 | /* if book hero is reading becomes cursed, interrupt */ |
| 1813 | if (!already_cursed) |
| 1814 | book_cursed(otmp); |
| 1815 | } |
| 1816 | if (otmp->lamplit) |
| 1817 | maybe_adjust_light(otmp, old_light); |
| 1818 | return; |
| 1819 | } |
| 1820 | |
| 1821 | void |
| 1822 | uncurse(struct obj *otmp) |
no test coverage detected