Disclose extinct species alongside genocided ones

This commit is contained in:
Pasi Kallinen
2015-04-10 21:59:45 +03:00
parent cc1b5de2a8
commit dc63af1396
2 changed files with 39 additions and 9 deletions

View File

@@ -1112,6 +1112,7 @@ show more explicit reason why player was helpless at death
added new hallucinatory-only gods added new hallucinatory-only gods
options to create the character blind or nudist options to create the character blind or nudist
moving clouds on the plane of air moving clouds on the plane of air
disclose extinct species alongside genocided ones
Platform- and/or Interface-Specific New Features Platform- and/or Interface-Specific New Features

View File

@@ -1437,43 +1437,72 @@ num_genocides()
return n; return n;
} }
int
num_extinct()
{
int i, n = 0;
for (i = LOW_PM; i < NUMMONS; ++i)
if (!(mvitals[i].mvflags & G_GENOD) &&
(mvitals[i].mvflags & G_GONE) &&
!(mons[i].geno & G_UNIQ)) ++n;
return n;
}
STATIC_OVL void STATIC_OVL void
list_genocided(defquery, ask) list_genocided(defquery, ask)
char defquery; char defquery;
boolean ask; boolean ask;
{ {
register int i; register int i;
int ngenocided; int ngenocided, nextinct;
char c; char c;
winid klwin; winid klwin;
char buf[BUFSZ]; char buf[BUFSZ];
ngenocided = num_genocides(); ngenocided = num_genocides();
nextinct = num_extinct();
/* genocided species list */ /* genocided or extinct species list */
if (ngenocided != 0) { if (ngenocided != 0 || nextinct != 0) {
c = ask ? yn_function("Do you want a list of species genocided?", Sprintf(buf, "Do you want a list of %sspecies%s%s?",
ynqchars, defquery) : defquery; (nextinct && !ngenocided) ? "extinct " : "",
(ngenocided) ? " genocided" : "",
(nextinct && ngenocided) ? " and extinct" : "");
c = ask ? yn_function(buf, ynqchars, defquery) : defquery;
if (c == 'q') done_stopprint++; if (c == 'q') done_stopprint++;
if (c == 'y') { if (c == 'y') {
klwin = create_nhwindow(NHW_MENU); klwin = create_nhwindow(NHW_MENU);
putstr(klwin, 0, "Genocided species:"); Sprintf(buf, "%s%s species:",
(ngenocided) ? "Genocided" : "Extinct",
(nextinct && ngenocided) ? " or extinct" : "");
putstr(klwin, 0, buf);
putstr(klwin, 0, ""); putstr(klwin, 0, "");
for (i = LOW_PM; i < NUMMONS; i++) for (i = LOW_PM; i < NUMMONS; i++)
if (mvitals[i].mvflags & G_GENOD) { if (mvitals[i].mvflags & G_GONE && !(mons[i].geno & G_UNIQ)) {
if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST) if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST)
Sprintf(buf, "%s%s", Sprintf(buf, "%s%s",
!type_is_pname(&mons[i]) ? "" : "the ", !type_is_pname(&mons[i]) ? "" : "the ",
mons[i].mname); mons[i].mname);
else else
Strcpy(buf, makeplural(mons[i].mname)); Strcpy(buf, makeplural(mons[i].mname));
if (!(mvitals[i].mvflags & G_GENOD))
Strcat(buf, " (extinct)");
putstr(klwin, 0, buf); putstr(klwin, 0, buf);
} }
putstr(klwin, 0, ""); putstr(klwin, 0, "");
Sprintf(buf, "%d species genocided.", ngenocided); if (ngenocided > 0) {
putstr(klwin, 0, buf); Sprintf(buf, "%d species genocided.", ngenocided);
putstr(klwin, 0, buf);
}
if (nextinct > 0) {
Sprintf(buf, "%d species extinct.", nextinct);
putstr(klwin, 0, buf);
}
display_nhwindow(klwin, TRUE); display_nhwindow(klwin, TRUE);
destroy_nhwindow(klwin); destroy_nhwindow(klwin);