]> granicus.if.org Git - nethack/commitdiff
Disclose extinct species alongside genocided ones
authorPasi Kallinen <paxed@alt.org>
Fri, 10 Apr 2015 18:59:45 +0000 (21:59 +0300)
committerPasi Kallinen <paxed@alt.org>
Fri, 10 Apr 2015 19:00:33 +0000 (22:00 +0300)
doc/fixes35.0
src/end.c

index 93041e66903f5fdaa2cf6ddce7b6a7a5c3c9038e..44b891b764a276eaed2244de5bd3fbdaa7610f30 100644 (file)
@@ -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
index f7ef12a02a24f38d4c6fa956aad62c87ffb175c8..9767e04815c2ab3d2fc8d354b0ef42ca9c91f068 100644 (file)
--- 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);