MCPcopy Index your code
hub / github.com/NetHack/NetHack / rider_revival_time

Function rider_revival_time

src/mkobj.c:1370–1382  ·  view source on GitHub ↗

Return the number of turns after which a Rider corpse revives */

Source from the content-addressed store, hash-verified

1368
1369/* Return the number of turns after which a Rider corpse revives */
1370long
1371rider_revival_time(struct obj *body, boolean retry)
1372{
1373 long when;
1374 long minturn = retry ? 3L : (body->corpsenm == PM_DEATH) ? 6L : 12L;
1375
1376 /* Riders have a 1/3 chance per turn of reviving after 12, 6, or 3 turns.
1377 Always revive by 67. */
1378 for (when = minturn; when < 67L; when++)
1379 if (!rn2(3))
1380 break;
1381 return when;
1382}
1383
1384/*
1385 * Start a corpse decay or revive timer.

Callers 2

revive_monFunction · 0.85
start_corpse_timeoutFunction · 0.85

Calls 1

rn2Function · 0.85

Tested by

no test coverage detected