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

Function leppie_avoidance

src/monmove.c:1138–1150  ·  view source on GitHub ↗

does leprechaun want to avoid the hero? */

Source from the content-addressed store, hash-verified

1136
1137/* does leprechaun want to avoid the hero? */
1138staticfn boolean
1139leppie_avoidance(struct monst *mtmp)
1140{
1141 struct obj *lepgold, *ygold;
1142
1143 if (mtmp->data == &mons[PM_LEPRECHAUN]
1144 && ((lepgold = findgold(mtmp->minvent))
1145 && (lepgold->quan
1146 > ((ygold = findgold(gi.invent)) ? ygold->quan : 0L))))
1147 return TRUE;
1148
1149 return FALSE;
1150}
1151
1152/* unseen leprechaun with gold might stash it */
1153staticfn void

Callers 1

m_moveFunction · 0.85

Calls 1

findgoldFunction · 0.85

Tested by

no test coverage detected