diff options
-rw-r--r-- | crawl-ref/source/libutil.cc | 10 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc index 1b4826c8ca..0175291628 100644 --- a/crawl-ref/source/libutil.cc +++ b/crawl-ref/source/libutil.cc @@ -15,6 +15,7 @@ #include "defines.h" #include "directn.h" #include "initfile.h" +#include "itemname.h" // is_vowel() #include "libutil.h" #include "externs.h" #include "macro.h" @@ -332,7 +333,14 @@ std::string pluralise(const std::string &name, } else if (ends_with(name, "y")) { - return name.substr(0, name.length() - 1) + "ies"; + if (name == "y") + return ("ys"); + // day -> days, boy -> boys, etc + else if (is_vowel(name[name.length() - 2])) + return name + "s"; + // jelly -> jellies + else + return name.substr(0, name.length() - 1) + "ies"; } else if (ends_with(name, "fe")) { diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 525ee2681a..c4431e63eb 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -4356,6 +4356,12 @@ std::string monsters::conj_verb(const std::string &verb) const if (verb == "are") return ("is"); + if (ends_with(verb, "f") || ends_with(verb, "fe") + || ends_with(verb, "y")) + { + return (verb + "s"); + } + return (pluralise(verb)); } |