summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-11 02:04:06 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-11 02:04:06 +0000
commitda22878d26b040a59f621a3a79730ee4dd7f9816 (patch)
treef5685508acc38089b9248e2a908d00e3c912e53a /crawl-ref/source/mon-util.cc
parentc811dc1ac36c6e69df242cb04d5f7512d4fe4d5b (diff)
downloadcrawl-ref-da22878d26b040a59f621a3a79730ee4dd7f9816.tar.gz
crawl-ref-da22878d26b040a59f621a3a79730ee4dd7f9816.zip
Allow for the creation of named zombies and spectral things from named
non-unique monsters (including polymorphed uniques, so you can get things like "A rat shaped Royal Jelly zombie"). Include the name of unique and named monsters in their corpse names, for things like "The corpse of the Lernaean hydra" or "The human corpse of Sigmund". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8407 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc41
1 files changed, 27 insertions, 14 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 348e1598b1..8161cd0c9b 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -977,24 +977,37 @@ bool mons_enslaved_soul(const monsters *mon)
|| mons_enslaved_intact_soul(mon));
}
-bool name_zombified_unique(monsters *mon, int mc, const std::string mon_name)
+bool name_zombie(monsters *mon, int mc, const std::string mon_name)
{
- if (mons_is_unique(mc))
- {
- mon->mname = mon_name;
+ 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";
- // Also for the Lernaean hydra.
- else if (mc == MONS_LERNAEAN_HYDRA)
- mon->mname = "Lernaean hydra";
+ // 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";
+ // Also for the Lernaean hydra.
+ else if (mc == MONS_LERNAEAN_HYDRA)
+ mon->mname = "Lernaean hydra";
- return (true);
- }
+ if (starts_with(mon->mname, "shaped "))
+ mon->flags |= MF_NAME_SUFFIX;
- return (false);
+ return (true);
+}
+
+bool name_zombie(monsters *mon, const monsters* orig)
+{
+ if (!mons_is_unique(orig->type) && orig->mname.empty())
+ return (false);
+
+ std::string name;
+
+ if (!orig->mname.empty())
+ name = orig->mname;
+ else
+ name = mons_type_name(orig->type, DESC_PLAIN);
+
+ return name_zombie(mon, orig->type, name);
}
int downscale_zombie_damage(int damage)