MCPcopy Create free account
hub / github.com/NetHack/NetHack / invoke_healing

Function invoke_healing

src/artifact.c:1779–1815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1777}
1778
1779staticfn int
1780invoke_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
1817staticfn int
1818invoke_energy_boost(struct obj *obj)

Callers 1

arti_invokeFunction · 0.85

Calls 5

You_feelFunction · 0.85
nothing_specialFunction · 0.85
make_sickFunction · 0.85
make_slimedFunction · 0.85
make_blindedFunction · 0.85

Tested by

no test coverage detected