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

Function mon_escape

src/muse.c:779–789  ·  view source on GitHub ↗

Monsters without the Amulet escape the dungeon and * are gone for good when they leave up the up stairs. * A monster with the Amulet would leave it behind * (mongone -> mdrop_special_objs) but we force any * monster who manages to acquire it or the invocation * tools to stick around instead of letting it escape. * Don't let the Wizard escape even when not carrying * anything of interest unl

Source from the content-addressed store, hash-verified

777 * of him.
778 */
779staticfn int
780mon_escape(struct monst *mtmp, boolean vismon)
781{
782 if (mon_has_special(mtmp)
783 || (mtmp->iswiz && svc.context.no_of_wizards < 2))
784 return 0;
785 if (vismon)
786 pline_mon(mtmp, "%s escapes the dungeon!", Monnam(mtmp));
787 mongone(mtmp);
788 return 2;
789}
790
791/* Perform a defensive action for a monster. Must be called immediately
792 * after find_defensive(). Return values are 0: did something, 1: died,

Callers 1

use_defensiveFunction · 0.85

Calls 4

mon_has_specialFunction · 0.85
pline_monFunction · 0.85
MonnamFunction · 0.85
mongoneFunction · 0.85

Tested by

no test coverage detected