fake monsters used to be in a hard-coded array, now in a data file */
| 1366 | |
| 1367 | /* fake monsters used to be in a hard-coded array, now in a data file */ |
| 1368 | char * |
| 1369 | bogusmon(char *buf, char *code) |
| 1370 | { |
| 1371 | char *mnam = buf; |
| 1372 | |
| 1373 | if (code) |
| 1374 | *code = '\0'; |
| 1375 | /* might fail (return empty buf[]) if the file isn't available */ |
| 1376 | get_rnd_text(BOGUSMONFILE, buf, rn2_on_display_rng, MD_PAD_BOGONS); |
| 1377 | if (!*mnam) { |
| 1378 | Strcpy(buf, "bogon"); |
| 1379 | } else if (strchr(bogon_codes, *mnam)) { /* strip prefix if present */ |
| 1380 | if (code) |
| 1381 | *code = *mnam; |
| 1382 | ++mnam; |
| 1383 | } |
| 1384 | return mnam; |
| 1385 | } |
| 1386 | |
| 1387 | /* return a random monster name, for hallucination */ |
| 1388 | char * |
no test coverage detected