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

Function gainstr

src/attrib.c:202–217  ·  view source on GitHub ↗

strength gain */

Source from the content-addressed store, hash-verified

200
201/* strength gain */
202void
203gainstr(struct obj *otmp, int incr, boolean givemsg)
204{
205 int num = incr;
206
207 if (!num) {
208 if (ABASE(A_STR) < 18)
209 num = (rn2(4) ? 1 : rnd(6));
210 else if (ABASE(A_STR) < STR18(85))
211 num = rnd(10);
212 else
213 num = 1;
214 }
215 (void) adjattrib(A_STR, (otmp && otmp->cursed) ? -num : num,
216 givemsg ? -1 : 1);
217}
218
219/* strength loss, may kill you; cause may be poison or monster like 'a' */
220void

Callers 3

cpostfxFunction · 0.85
consume_tinFunction · 0.85
fpostfxFunction · 0.85

Calls 3

rn2Function · 0.85
rndFunction · 0.85
adjattribFunction · 0.85

Tested by

no test coverage detected