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

Function cloneu

src/mhitu.c:2615–2638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2613}
2614
2615struct monst *
2616cloneu(void)
2617{
2618 struct monst *mon;
2619 int mndx = monsndx(gy.youmonst.data);
2620
2621 if (u.mh <= 1)
2622 return (struct monst *) 0;
2623 if (svm.mvitals[mndx].mvflags & G_EXTINCT)
2624 return (struct monst *) 0;
2625 mon = makemon(gy.youmonst.data, u.ux, u.uy,
2626 NO_MINVENT | MM_EDOG | MM_NOMSG);
2627 if (!mon)
2628 return NULL;
2629 mon->mcloned = 1;
2630 mon = christen_monst(mon, svp.plname);
2631 initedog(mon, TRUE);
2632 mon->m_lev = gy.youmonst.data->mlevel;
2633 mon->mhpmax = u.mhmax;
2634 mon->mhp = u.mh / 2;
2635 u.mh -= mon->mhp;
2636 disp.botl = TRUE;
2637 return mon;
2638}
2639
2640#undef ld
2641

Callers 2

split_monFunction · 0.85
mhitm_ad_physFunction · 0.85

Calls 3

makemonFunction · 0.85
christen_monstFunction · 0.85
initedogFunction · 0.85

Tested by

no test coverage detected