summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-06 16:47:42 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-06 16:47:42 +0000
commit58ac4b5e85d0d11952322ef72558f538519b77c0 (patch)
tree47c569cc2c7736516b21d49b12172e99dbe8fa6e /crawl-ref
parent097c7f86adf076d550b446212ac80bf1aa43715f (diff)
downloadcrawl-ref-58ac4b5e85d0d11952322ef72558f538519b77c0.tar.gz
crawl-ref-58ac4b5e85d0d11952322ef72558f538519b77c0.zip
Consolidate the routines for naming zombified uniques.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8270 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/mon-util.cc13
-rw-r--r--crawl-ref/source/mon-util.h1
-rw-r--r--crawl-ref/source/monstuff.cc12
-rw-r--r--crawl-ref/source/religion.cc11
-rw-r--r--crawl-ref/source/spells3.cc11
5 files changed, 19 insertions, 29 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index ccd4fdf97c..b69357040f 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -977,6 +977,19 @@ bool mons_enslaved_soul(const monsters *mon)
|| mons_enslaved_intact_soul(mon));
}
+void name_zombified_unique(monsters *mon, int mc, const std::string mon_name)
+{
+ if (mons_is_unique(mc))
+ {
+ mon->mname = mon_name;
+
+ // Special case for Blork the orc: shorten his name to "Blork"
+ // to avoid mentions of e.g "Blork the orc the orc zombie".
+ if (mc == MONS_BLORK_THE_ORC)
+ mon->mname = "Blork";
+ }
+}
+
int downscale_zombie_damage(int damage)
{
// These are cumulative, of course: {dlb}
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index f2d7fcb60c..2e40854be4 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -644,6 +644,7 @@ bool mons_enslaved_body_and_soul(const monsters *mon);
bool mons_enslaved_twisted_soul(const monsters *mon);
bool mons_enslaved_intact_soul(const monsters *mon);
bool mons_enslaved_soul(const monsters *mon);
+void name_zombified_unique(monsters *mon, int mc, const std::string mon_name);
// last updated 12may2000 {dlb}
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 46544bd533..2c3bf845af 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1323,16 +1323,8 @@ void monster_die(monsters *monster, killer_type killer,
if (death_message)
mpr("A glowing mist starts to gather...");
- if (mons_is_unique(monster->type))
- {
- menv[spectre].mname = monster->name(DESC_PLAIN);
-
- // Special case for Blork the orc: shorten
- // his name to "Blork" to avoid mentions of
- // "Blork the orc the spectral orc".
- if (monster->type == MONS_BLORK_THE_ORC)
- menv[spectre].mname = "Blork";
- }
+ name_zombified_unique(&menv[spectre], monster->type,
+ monster->name(DESC_PLAIN));
}
}
}
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 0ac7d2e314..9242fede60 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -5586,16 +5586,7 @@ void yred_make_enslaved_soul(monsters *mon, bool force_hostile,
mon->colour = EC_UNHOLY;
mon->flags |= MF_ENSLAVED_SOUL;
- if (mons_is_unique(type))
- {
- mon->mname = name_plain;
-
- // Special case for Blork the orc: shorten his name to "Blork"
- // to avoid mentions of "Blork the orc the spectral orc" or
- // "Blork the orc the small abomination".
- if (type == MONS_BLORK_THE_ORC)
- mon->mname = "Blork";
- }
+ name_zombified_unique(mon, type, name_plain);
// Wow, permanent enslaving!
mon->attitude = !force_hostile ? ATT_FRIENDLY : ATT_HOSTILE;
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 0e7f9fdefe..293a1995f5 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -830,15 +830,8 @@ static bool _raise_remains(const coord_def &a, int corps, beh_type beha,
{
const int monnum = item.orig_monnum - 1;
- if (mons_is_unique(monnum))
- {
- menv[monster].mname = origin_monster_name(item);
-
- // Special case for Blork the orc: shorten his name to "Blork"
- // to avoid mentions of "Blork the orc the orc skeleton".
- if (monnum == MONS_BLORK_THE_ORC)
- menv[monster].mname = "Blork";
- }
+ name_zombified_unique(&menv[monster], monnum,
+ origin_monster_name(item));
_equip_undead(a, corps, monster, monnum);