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

Function levl_follower

src/mondata.c:1210–1226  ·  view source on GitHub ↗

used for nearby monsters when you go to another level */

Source from the content-addressed store, hash-verified

1208
1209/* used for nearby monsters when you go to another level */
1210boolean
1211levl_follower(struct monst *mtmp)
1212{
1213 if (mtmp == u.usteed)
1214 return TRUE;
1215
1216 /* Wizard with Amulet won't bother trying to follow across levels */
1217 if (mtmp->iswiz && mon_has_amulet(mtmp))
1218 return FALSE;
1219 /* some monsters will follow even while intending to flee from you */
1220 if (mtmp->mtame || mtmp->iswiz || is_fshk(mtmp))
1221 return TRUE;
1222 /* stalking types follow, but won't when fleeing unless you hold
1223 the Amulet */
1224 return (boolean) ((mtmp->data->mflags2 & M2_STALK)
1225 && (!mtmp->mflee || u.uhave.amulet));
1226}
1227
1228static const short grownups[][2] = {
1229 { PM_CHICKATRICE, PM_COCKATRICE },

Callers 1

keepdogsFunction · 0.85

Calls 2

mon_has_amuletFunction · 0.85
is_fshkFunction · 0.85

Tested by

no test coverage detected