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

Function deadbook_pacify_undead

src/spell.c:210–226  ·  view source on GitHub ↗

pacify or tame an undead monster */

Source from the content-addressed store, hash-verified

208
209/* pacify or tame an undead monster */
210staticfn void
211deadbook_pacify_undead(struct monst *mtmp)
212{
213 if ((is_undead(mtmp->data) || is_vampshifter(mtmp))
214 && cansee(mtmp->mx, mtmp->my)) {
215 mtmp->mpeaceful = TRUE;
216 if (sgn(mtmp->data->maligntyp) == sgn(u.ualign.type)
217 && mdistu(mtmp) < 4)
218 if (mtmp->mtame) {
219 if (mtmp->mtame < 20)
220 mtmp->mtame++;
221 } else
222 (void) tamedog(mtmp, (struct obj *) 0, TRUE);
223 else
224 monflee(mtmp, 0, FALSE, TRUE);
225 }
226}
227
228/* special effects for the Book of the Dead; reading it while blind is
229 allowed so that needs to be taken into account too */

Callers

nothing calls this directly

Calls 3

sgnFunction · 0.85
tamedogFunction · 0.85
monfleeFunction · 0.85

Tested by

no test coverage detected