| 1777 | } |
| 1778 | |
| 1779 | staticfn int |
| 1780 | invoke_healing(struct obj *obj) |
| 1781 | { |
| 1782 | int healamt = (u.uhpmax + 1 - u.uhp) / 2; |
| 1783 | long creamed = (long) u.ucreamed; |
| 1784 | |
| 1785 | if (Upolyd) |
| 1786 | healamt = (u.mhmax + 1 - u.mh) / 2; |
| 1787 | if (healamt || Sick || Slimed || Blinded > creamed) |
| 1788 | You_feel("better."); |
| 1789 | if (healamt || Sick || Slimed || BlindedTimeout > creamed) |
| 1790 | You_feel("%sbetter.", |
| 1791 | (!healamt && !Sick && !Slimed |
| 1792 | /* when healing temporary blindness (aside from |
| 1793 | goop covering face), might still be blind |
| 1794 | due to PermaBlind or eyeless polymorph; |
| 1795 | vary the message in that situation */ |
| 1796 | && (HBlinded & ~TIMEOUT) != 0L) ? "slightly " : ""); |
| 1797 | else { |
| 1798 | nothing_special(obj); |
| 1799 | return ECMD_TIME; |
| 1800 | } |
| 1801 | if (healamt > 0) { |
| 1802 | if (Upolyd) |
| 1803 | u.mh += healamt; |
| 1804 | else |
| 1805 | u.uhp += healamt; |
| 1806 | } |
| 1807 | if (Sick) |
| 1808 | make_sick(0L, (char *) 0, FALSE, SICK_ALL); |
| 1809 | if (Slimed) |
| 1810 | make_slimed(0L, (char *) 0); |
| 1811 | if (BlindedTimeout > creamed) |
| 1812 | make_blinded(creamed, FALSE); |
| 1813 | disp.botl = TRUE; |
| 1814 | return ECMD_TIME; |
| 1815 | } |
| 1816 | |
| 1817 | staticfn int |
| 1818 | invoke_energy_boost(struct obj *obj) |
no test coverage detected