MCPcopy Index your code
hub / github.com/NetHack/NetHack / dump_mongen

Function dump_mongen

src/makemon.c:1834–1866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1832extern struct enum_dump monsdump[]; /* allmain.c */
1833
1834void
1835dump_mongen(void)
1836{
1837 char mlet, prev_mlet = 0;
1838 int i, nmwidth = 27, special;
1839 char nmbuf[80];
1840
1841 monst_globals_init();
1842 init_mongen_order();
1843 raw_printf("int mongen_order[] = {");
1844 for (i = LOW_PM; i < SPECIAL_PM; ++i) {
1845 special = (mons[MONSi(i)].geno & (G_NOGEN | G_UNIQ));
1846 mlet = def_monsyms[(int) mons[MONSi(i)].mlet].sym;
1847 if (prev_mlet && prev_mlet != mlet)
1848 raw_print("");
1849 Snprintf(nmbuf, sizeof nmbuf, "PM_%s%s",
1850 monsdump[MONSi(i)].nm,
1851 (i == SPECIAL_PM - 1) ? "" : ",");
1852 raw_printf(" %*s /* %c seq=%3d, idx=%3d, sym='%c', diff=%2d, freq=%2d[%d] %s */",
1853 -nmwidth, nmbuf, (i == MONSi(i)) ? ' ' : '.', i, MONSi(i),
1854 mlet, (int) mons[MONSi(i)].difficulty,
1855 (int) (mons[MONSi(i)].geno & G_FREQ),
1856 (int) mclass_maxf[(int) mons[MONSi(i)].mlet],
1857 (special == (G_NOGEN | G_UNIQ)) ? "(G_NOGEN | G_UNIQ)"
1858 : (special == G_NOGEN) ? "(G_NOGEN)"
1859 : (special == G_UNIQ) ? "(G_UNIQ)"
1860 : "");
1861 prev_mlet = mlet;
1862 }
1863 raw_print("};");
1864 raw_print("");
1865 freedynamicdata();
1866}
1867
1868/* Make one of the multiple types of a given monster class.
1869 The second parameter specifies a special casing bit mask

Callers 1

argcheckFunction · 0.85

Calls 5

monst_globals_initFunction · 0.85
init_mongen_orderFunction · 0.85
raw_printFunction · 0.85
freedynamicdataFunction · 0.85
raw_printfFunction · 0.70

Tested by

no test coverage detected