X Tutup
Skip to content

Commit 6fd0047

Browse files
author
PatR
committed
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.
1 parent df18c96 commit 6fd0047

File tree

6 files changed

+37
-2
lines changed

6 files changed

+37
-2
lines changed

dat/hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ M-C conduct view optional challenges
124124
M-d dip dip an object into something
125125
M-e enhance show weapon and spell skills, can improve them if eligible
126126
M-f force force a lock
127+
M-g genocided list genocided and extinct monster types, if any
127128
M-i invoke invoke an object's special powers
128129
M-j jump jump to another location
129130
M-l loot loot a box on the floor

doc/Guidebook.mn

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,10 @@ Default key is \(oqf\(cq.
12981298
Force a lock.
12991299
Autocompletes.
13001300
Default key is \(oqM-f\(cq.
1301+
.lp #genocided
1302+
List any monster types which have been genocided or become extinct.
1303+
Autocompletes.
1304+
Default key is \(oqM-g\(cq.
13011305
.lp "#glance "
13021306
Show what type of thing a map symbol corresponds to.
13031307
Default key is \(oq;\(cq.
@@ -1867,6 +1871,8 @@ option is enabled)
18671871
#enhance
18681872
.lp M-f
18691873
#force
1874+
.lp M-g
1875+
#genocided
18701876
.lp M-i
18711877
#invoke
18721878
.lp M-j

doc/Guidebook.tex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,11 @@ \section{Commands}
14071407
\item[\tb{\#force}]
14081408
Force a lock. Autocompletes. Default key is `{\tt M-f}'.
14091409
%.lp
1410+
\item[\tb{\#genocided}]
1411+
List any monster types which have been genocided or become extinct.
1412+
Autocompletes.
1413+
Default key is `{\tt M-g}'.
1414+
%.lp
14101415
\item[\tb{\#glance}]
14111416
Show what type of thing a map symbol corresponds to. Default key is `{\tt ;}'.
14121417
%.lp
@@ -2022,6 +2027,9 @@ \section{Commands}
20222027
\item[\tb{M-f}]
20232028
{\tt\#force}
20242029
%.lp
2030+
\item[\tb{M-g}]
2031+
{\tt\#genocided}
2032+
%.lp
20252033
\item[\tb{M-i}]
20262034
{\tt\#invoke}
20272035
%.lp

include/extern.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,7 @@ extern int doborn(void);
11051105
extern void list_vanquished(char, boolean);
11061106
extern int num_genocides(void);
11071107
extern void list_genocided(char, boolean);
1108+
extern int dogenocided(void);
11081109
extern const char *align_str(aligntyp);
11091110
extern char *piousness(boolean, const char *);
11101111
extern void mstatusline(struct monst *);

src/cmd.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extern int dofire(void); /**/
4343
extern int dothrow(void); /**/
4444
extern int doeat(void); /**/
4545
extern int done2(void); /**/
46-
extern int vanquished(void); /**/
46+
extern int dovanquished(void); /**/
4747
extern int doengrave(void); /**/
4848
extern int dopickup(void); /**/
4949
extern int ddoinv(void); /**/
@@ -2567,6 +2567,9 @@ struct ext_func_tab extcmdlist[] = {
25672567
doforce, AUTOCOMPLETE, NULL },
25682568
{ ';', "glance", "show what type of thing a map symbol corresponds to",
25692569
doquickwhatis, IFBURIED | GENERALCMD, NULL },
2570+
{ M('g'), "genocided",
2571+
"list monsters that have been genocided or become extinct",
2572+
dogenocided, IFBURIED | AUTOCOMPLETE, NULL },
25702573
{ '?', "help", "give a help message",
25712574
dohelp, IFBURIED | GENERALCMD, NULL },
25722575
{ '\0', "herecmdmenu", "show menu of commands you can do here",

src/insight.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2826,7 +2826,7 @@ list_vanquished(char defquery, boolean ask)
28262826
* which needs putstr() and past tense.
28272827
*/
28282828
} else if (!gp.program_state.gameover) {
2829-
/* #dovanquished rather than final disclosure, so pline() is ok */
2829+
/* #vanquished rather than final disclosure, so pline() is ok */
28302830
pline("No creatures have been vanquished.");
28312831
#ifdef DUMPLOG
28322832
} else if (dumping) {
@@ -2852,6 +2852,7 @@ num_genocides(void)
28522852
return n;
28532853
}
28542854

2855+
/* return a count of the number of extinct species */
28552856
static int
28562857
num_extinct(void)
28572858
{
@@ -2866,6 +2867,8 @@ num_extinct(void)
28662867
return n;
28672868
}
28682869

2870+
/* show genocided and extinct monster types for final disclosure/dumplog
2871+
or for the #genocided command */
28692872
void
28702873
list_genocided(char defquery, boolean ask)
28712874
{
@@ -2933,13 +2936,26 @@ list_genocided(char defquery, boolean ask)
29332936
display_nhwindow(klwin, TRUE);
29342937
destroy_nhwindow(klwin);
29352938
}
2939+
2940+
/* See the comment for similar code near the end of list_vanquished(). */
2941+
} else if (!gp.program_state.gameover) {
2942+
/* #genocided rather than final disclosure, so pline() is ok */
2943+
pline("No creatures have been genocided or become extinct.");
29362944
#ifdef DUMPLOG
29372945
} else if (dumping) {
29382946
putstr(0, 0, "No species were genocided or became extinct.");
29392947
#endif
29402948
}
29412949
}
29422950

2951+
/* M-g - #genocided command */
2952+
int
2953+
dogenocided(void)
2954+
{
2955+
list_genocided('y', FALSE);
2956+
return ECMD_OK;
2957+
}
2958+
29432959
/*
29442960
* align_str(), piousness(), mstatusline() and ustatusline() once resided
29452961
* in pline.c, then got moved to priest.c just to be out of there. They

0 commit comments

Comments
 (0)
X Tutup