genociding mindflayers

When looking at name_to_mon() to teach it how to cope with possessive
suffices, I discovered that it already knows how.  But while looking at
it, I remembered a newsgroup complaint from a while back by someone who
accidentally committed suicide by attempting to genocide "master mindflayers"
(when he meant "master mind flayers").  name_to_mon() didn't recognize that
misspelling but it did match "master" as a role title.  Unfortunately for
the player, his character was a monk; the game allowed him to genocide his
own role and he died.  That's kind of harsh for such a likely misspelling.
(I don't think a monk is very likely to ever use "master thief" as a mistake
for "master of thieves", but catch that one too just in case.  Conversely,
recognize "master of assassins" as an alternate for "master assassin".)

     Also, wishing for "the <something>" strips off "the" and finds (or not)
<something>, but genociding didn't.  You could specify "a wolf" to wipe out
all wolves, but "the wolf" yielded "such creatures don't exist", and ^G had
similar unfriendly behavior.  This extends name_to_mon() to handle it.
This commit is contained in:
nethack.rankin
2005-12-31 06:19:04 +00:00
parent 40dd607233
commit fe5d79c859
2 changed files with 10 additions and 2 deletions

View File

@@ -517,6 +517,7 @@ const char *in_str;
if (!strncmp(str, "a ", 2)) str += 2;
else if (!strncmp(str, "an ", 3)) str += 3;
else if (!strncmp(str, "the ", 4)) str += 4;
slen = strlen(str);
term = str + slen;
@@ -542,6 +543,14 @@ const char *in_str;
{ "grey unicorn", PM_GRAY_UNICORN },
{ "grey ooze", PM_GRAY_OOZE },
{ "gray-elf", PM_GREY_ELF },
{ "mindflayer", PM_MIND_FLAYER },
{ "master mindflayer", PM_MASTER_MIND_FLAYER },
/* Inappropriate singularization by -ves check above */
{ "master of thief", PM_MASTER_OF_THIEVES },
/* Potential misspellings where we want to avoid falling back
to the rank title prefix (input has been singularized) */
{ "master thief", PM_MASTER_OF_THIEVES },
{ "master of assassin", PM_MASTER_ASSASSIN },
/* Hyphenated names */
{ "ki rin", PM_KI_RIN },
{ "uruk hai", PM_URUK_HAI },
@@ -568,8 +577,6 @@ const char *in_str;
{ "djinn", PM_DJINNI },
{ "mumakil", PM_MUMAK },
{ "erinyes", PM_ERINYS },
/* falsely caught by -ves check above */
{ "master of thief", PM_MASTER_OF_THIEVES },
/* end of list */
{ 0, 0 }
};