summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/Kills.cc11
-rw-r--r--crawl-ref/source/Kills.h1
-rw-r--r--crawl-ref/source/mon-util.cc5
-rw-r--r--crawl-ref/source/monstuff.cc13
-rw-r--r--crawl-ref/source/religion.cc1
-rw-r--r--crawl-ref/source/tutorial.cc5
6 files changed, 23 insertions, 13 deletions
diff --git a/crawl-ref/source/Kills.cc b/crawl-ref/source/Kills.cc
index 733cd5c5ce..6da4e56a28 100644
--- a/crawl-ref/source/Kills.cc
+++ b/crawl-ref/source/Kills.cc
@@ -356,7 +356,16 @@ std::string apostrophise(const std::string &name)
return (name);
const char lastc = name[name.length() - 1];
- return (name + (lastc == 's' || lastc == 'x' ? "'" : "'s"));
+ return (name + (lastc == 's' ? "'" : "'s"));
+}
+
+std::string apostrophise_fixup(const std::string &msg)
+{
+ if (msg.empty())
+ return (msg);
+
+ // XXX: This is rather hackish.
+ return (replace_all(msg, "s's", "s'"));
}
// For monster names ending with these suffixes, we pluralise directly without
diff --git a/crawl-ref/source/Kills.h b/crawl-ref/source/Kills.h
index b610d41c86..0dd4cb9550 100644
--- a/crawl-ref/source/Kills.h
+++ b/crawl-ref/source/Kills.h
@@ -16,6 +16,7 @@
#include "enum.h"
std::string apostrophise(const std::string &name);
+std::string apostrophise_fixup(const std::string &sentence);
class monsters;
class reader;
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 65485c4b76..a24afa354b 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -8269,10 +8269,7 @@ std::string do_mon_str_replacements(const std::string &in_msg,
else
msg = replace_all(msg, "@says@", sound_list[s_type]);
- // The proper possessive for a word ending in an "s" is to
- // put an apostrophe after the "s": "Chris" -> "Chris'",
- // not "Chris" -> "Chris's". Stupid English language...
- msg = replace_all(msg, "s's", "s'");
+ msg = apostrophise_fixup(msg);
return (msg);
}
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index d2a7c40cf1..992c06637b 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -3969,8 +3969,10 @@ static void _handle_behaviour(monsters *mon)
mon->target = menv[mon->foe].pos();
}
- // Smart monsters, plants or nonliving monsters cannot flee.
+ // Smart monsters, zombified monsters other than spectral
+ // things, plants, and nonliving monsters cannot flee.
if (isHurt && !isSmart && isMobile
+ && (!mons_is_zombified(mon) || mon->type == MONS_SPECTRAL_THING)
&& mons_class_holiness(mon->type) != MH_PLANT
&& mons_class_holiness(mon->type) != MH_NONLIVING)
{
@@ -4269,15 +4271,14 @@ bool simple_monster_message(const monsters *monster, const char *event,
&& (channel == MSGCH_MONSTER_SPELL || channel == MSGCH_FRIEND_SPELL
|| player_monster_visible(monster) || crawl_state.arena))
{
- char buff[INFO_SIZE];
-
- snprintf(buff, sizeof(buff), "%s%s", monster->name(descrip).c_str(),
- event);
+ std::string msg = monster->name(descrip);
+ msg += event;
+ msg = apostrophise_fixup(msg);
if (channel == MSGCH_PLAIN && mons_wont_attack_real(monster))
channel = MSGCH_FRIEND_ACTION;
- mpr(buff, channel, param);
+ mpr(msg.c_str(), channel, param);
return (true);
}
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 2203692419..a9d702b595 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -6798,6 +6798,7 @@ void simple_god_message(const char *event, god_type which_deity)
{
std::string msg = god_name(which_deity);
msg += event;
+ msg = apostrophise_fixup(msg);
god_speaks(which_deity, msg.c_str());
}
diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc
index 47bd310ab4..691dc8296f 100644
--- a/crawl-ref/source/tutorial.cc
+++ b/crawl-ref/source/tutorial.cc
@@ -28,6 +28,7 @@ REVISION("$Rev$");
#include "itemname.h"
#include "itemprop.h"
#include "items.h"
+#include "Kills.h"
#include "menu.h"
#include "message.h"
#include "misc.h"
@@ -2418,8 +2419,8 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc)
&& you.hunger_state >= HS_SATIATED)
{
text << "\nAlso, with "
- << god_name(you.religion)
- << "'s support you can use your Berserk ability (<w>a</w>) "
+ << apostrophise(god_name(you.religion))
+ << " support you can use your Berserk ability (<w>a</w>) "
"to temporarily gain more hitpoints and greater "
"strength. ";
}