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

Function e_jumps

src/dbridge.c:530–551  ·  view source on GitHub ↗

* Can etmp jump from death? */

Source from the content-addressed store, hash-verified

528 * Can etmp jump from death?
529 */
530staticfn boolean
531e_jumps(struct entity *etmp)
532{
533 int tmp = 4; /* out of 10 */
534
535 if (is_u(etmp) ? (Unaware || Fumbling)
536 : (helpless(etmp->emon)
537 || !etmp->edata->mmove || etmp->emon->wormno))
538 return FALSE;
539
540 if (is_u(etmp) ? Confusion : etmp->emon->mconf)
541 tmp -= 2;
542
543 if (is_u(etmp) ? Stunned : etmp->emon->mstun)
544 tmp -= 3;
545
546 if (is_db_wall(etmp->ex, etmp->ey))
547 tmp -= 2; /* less room to maneuver */
548
549 debugpline2("%s to jump (%d chances in 10)", E_phrase(etmp, "try"), tmp);
550 return (tmp >= rnd(10)) ? TRUE : FALSE;
551}
552
553staticfn void
554do_entity(struct entity *etmp)

Callers 1

do_entityFunction · 0.85

Calls 3

is_db_wallFunction · 0.85
E_phraseFunction · 0.85
rndFunction · 0.85

Tested by

no test coverage detected