add #genocided command

Comparable to #vanquished, be able to view info normally available
during end of game disclosure while the game is still in progress.
The new #genocided command lists all genocided and extincted types
of monsters.  Unlike #vanquished, there aren't any sorting choices.

Potential future enhancement:  provide a way to view the genocided
list at the "what do you want to genocide?" prompt.
This commit is contained in:
PatR
2023-02-11 11:35:06 -08:00
parent df18c96840
commit 6fd0047784
6 changed files with 37 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ extern int dofire(void); /**/
extern int dothrow(void); /**/
extern int doeat(void); /**/
extern int done2(void); /**/
extern int vanquished(void); /**/
extern int dovanquished(void); /**/
extern int doengrave(void); /**/
extern int dopickup(void); /**/
extern int ddoinv(void); /**/
@@ -2567,6 +2567,9 @@ struct ext_func_tab extcmdlist[] = {
doforce, AUTOCOMPLETE, NULL },
{ ';', "glance", "show what type of thing a map symbol corresponds to",
doquickwhatis, IFBURIED | GENERALCMD, NULL },
{ M('g'), "genocided",
"list monsters that have been genocided or become extinct",
dogenocided, IFBURIED | AUTOCOMPLETE, NULL },
{ '?', "help", "give a help message",
dohelp, IFBURIED | GENERALCMD, NULL },
{ '\0', "herecmdmenu", "show menu of commands you can do here",

View File

@@ -2826,7 +2826,7 @@ list_vanquished(char defquery, boolean ask)
* which needs putstr() and past tense.
*/
} else if (!gp.program_state.gameover) {
/* #dovanquished rather than final disclosure, so pline() is ok */
/* #vanquished rather than final disclosure, so pline() is ok */
pline("No creatures have been vanquished.");
#ifdef DUMPLOG
} else if (dumping) {
@@ -2852,6 +2852,7 @@ num_genocides(void)
return n;
}
/* return a count of the number of extinct species */
static int
num_extinct(void)
{
@@ -2866,6 +2867,8 @@ num_extinct(void)
return n;
}
/* show genocided and extinct monster types for final disclosure/dumplog
or for the #genocided command */
void
list_genocided(char defquery, boolean ask)
{
@@ -2933,6 +2936,11 @@ list_genocided(char defquery, boolean ask)
display_nhwindow(klwin, TRUE);
destroy_nhwindow(klwin);
}
/* See the comment for similar code near the end of list_vanquished(). */
} else if (!gp.program_state.gameover) {
/* #genocided rather than final disclosure, so pline() is ok */
pline("No creatures have been genocided or become extinct.");
#ifdef DUMPLOG
} else if (dumping) {
putstr(0, 0, "No species were genocided or became extinct.");
@@ -2940,6 +2948,14 @@ list_genocided(char defquery, boolean ask)
}
}
/* M-g - #genocided command */
int
dogenocided(void)
{
list_genocided('y', FALSE);
return ECMD_OK;
}
/*
* align_str(), piousness(), mstatusline() and ustatusline() once resided
* in pline.c, then got moved to priest.c just to be out of there. They