From: Pasi Kallinen Date: Fri, 10 Apr 2015 18:59:45 +0000 (+0300) Subject: Disclose extinct species alongside genocided ones X-Git-Tag: NetHack-3.6.0_RC01~414^2~41^2~8^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc63af1396427c994d88a1bc3cd18ec7e098aef4;p=nethack Disclose extinct species alongside genocided ones --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 93041e669..44b891b76 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1112,6 +1112,7 @@ show more explicit reason why player was helpless at death added new hallucinatory-only gods options to create the character blind or nudist moving clouds on the plane of air +disclose extinct species alongside genocided ones Platform- and/or Interface-Specific New Features diff --git a/src/end.c b/src/end.c index f7ef12a02..9767e0481 100644 --- a/src/end.c +++ b/src/end.c @@ -1437,43 +1437,72 @@ num_genocides() 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 list_genocided(defquery, ask) char defquery; boolean ask; { register int i; - int ngenocided; + int ngenocided, nextinct; char c; winid klwin; char buf[BUFSZ]; ngenocided = num_genocides(); - - /* genocided species list */ - if (ngenocided != 0) { - c = ask ? yn_function("Do you want a list of species genocided?", - ynqchars, defquery) : defquery; + nextinct = num_extinct(); + + /* genocided or extinct species list */ + if (ngenocided != 0 || nextinct != 0) { + Sprintf(buf, "Do you want a list of %sspecies%s%s?", + (nextinct && !ngenocided) ? "extinct " : "", + (ngenocided) ? " genocided" : "", + (nextinct && ngenocided) ? " and extinct" : ""); + c = ask ? yn_function(buf, ynqchars, defquery) : defquery; if (c == 'q') done_stopprint++; if (c == 'y') { 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, ""); 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) Sprintf(buf, "%s%s", !type_is_pname(&mons[i]) ? "" : "the ", mons[i].mname); else Strcpy(buf, makeplural(mons[i].mname)); + if (!(mvitals[i].mvflags & G_GENOD)) + Strcat(buf, " (extinct)"); putstr(klwin, 0, buf); } putstr(klwin, 0, ""); - Sprintf(buf, "%d species genocided.", ngenocided); - putstr(klwin, 0, buf); + if (ngenocided > 0) { + 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); destroy_nhwindow(klwin);