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

Function mk_roamer

src/priest.c:723–752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

721}
722
723struct monst *
724mk_roamer(struct permonst *ptr, aligntyp alignment, coordxy x, coordxy y,
725 boolean peaceful)
726{
727 struct monst *roamer;
728 boolean coaligned = (u.ualign.type == alignment);
729
730#if 0 /* this was due to permonst's pxlth field which is now gone */
731 if (ptr != &mons[PM_ALIGNED_CLERIC] && ptr != &mons[PM_ANGEL])
732 return (struct monst *) 0;
733#endif
734
735 if (MON_AT(x, y))
736 (void) rloc(m_at(x, y), RLOC_NOMSG); /* insurance */
737
738 if (!(roamer = makemon(ptr, x, y, MM_ADJACENTOK | MM_EMIN | MM_NOMSG)))
739 return (struct monst *) 0;
740
741 EMIN(roamer)->min_align = alignment;
742 EMIN(roamer)->renegade = (coaligned && !peaceful);
743 roamer->ispriest = 0;
744 roamer->isminion = 1;
745 mon_learns_traps(roamer, ALL_TRAPS); /* traps are known */
746 roamer->mpeaceful = peaceful;
747 roamer->msleeping = 0;
748 set_malign(roamer); /* peaceful may have changed */
749
750 /* MORE TO COME */
751 return roamer;
752}
753
754void
755reset_hostility(struct monst *roamer)

Callers 3

lose_guardian_angelFunction · 0.85
gain_guardian_angelFunction · 0.85
create_monsterFunction · 0.85

Calls 4

rlocFunction · 0.85
makemonFunction · 0.85
mon_learns_trapsFunction · 0.85
set_malignFunction · 0.85

Tested by

no test coverage detected