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

Function mon_aligntyp

src/priest.c:279–289  ·  view source on GitHub ↗

get a monster's alignment type without caller needing EPRI & EMIN */

Source from the content-addressed store, hash-verified

277
278/* get a monster's alignment type without caller needing EPRI & EMIN */
279aligntyp
280mon_aligntyp(struct monst *mon)
281{
282 aligntyp algn = mon->ispriest ? EPRI(mon)->shralign
283 : mon->isminion ? EMIN(mon)->min_align
284 : mon->data->maligntyp;
285
286 if (algn == A_NONE)
287 return A_NONE; /* negative but differs from chaotic */
288 return (algn > 0) ? A_LAWFUL : (algn < 0) ? A_CHAOTIC : A_NEUTRAL;
289}
290
291/*
292 * Specially aligned monsters are named specially.

Callers 4

touch_artifactFunction · 0.85
mstatuslineFunction · 0.85
priestnameFunction · 0.85
p_coalignedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected