summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-06 02:10:08 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-06 02:13:04 -0800
commit8022157bc51f20d7f636c09cbd96ecc8f8958aeb (patch)
tree6d834287dfb31d955d99cc186ea0fe869338efec
parent634346b199170aa7aadf3055938363395f3507b2 (diff)
downloadcrawl-ref-8022157bc51f20d7f636c09cbd96ecc8f8958aeb.tar.gz
crawl-ref-8022157bc51f20d7f636c09cbd96ecc8f8958aeb.zip
Make monster name flags available to vaults
The monster name modifier flags MF_NAME_SUFFIX, MF_NAME_ADJECTIVE, and MF_NAME_REPLACE can be used by monster specs via the spec tags name_suffix, name_adjective and name_replace.
-rw-r--r--crawl-ref/docs/develop/level_design.txt20
-rw-r--r--crawl-ref/source/mapdef.cc7
2 files changed, 27 insertions, 0 deletions
diff --git a/crawl-ref/docs/develop/level_design.txt b/crawl-ref/docs/develop/level_design.txt
index cdeac74581..08edd20a1a 100644
--- a/crawl-ref/docs/develop/level_design.txt
+++ b/crawl-ref/docs/develop/level_design.txt
@@ -722,6 +722,26 @@ MONS: (list of monsters)
and then using the glyph '1' multiple times will result in multiple
"Durwent the Kobold"s).
+ There are three different modifiers that by used on a name:
+ name_adjective, name_suffix and name_replace. name_adjective
+ makes the name act as an adjective. For example:
+ MONS: kobold name:ugly name_adjective
+
+ Will cause "An ugly kobold", "The ugly kobold hits you",
+ and so on.
+
+ name_suffix does the same, but after the monster's base name:
+ MONS: kobold name:wearing_mittens name_suffix
+
+ Will give "A kobold wearing mittens", "The kobold wearing
+ mittens hits you", and so on.
+
+ name_replace causes the base name to be replaced by given
+ name, as if the monster was a unique:
+ MONS: kobold name:Durwent name_replace
+
+ Will result in "Durwent" rather than "Durwent the Kobold".
+
Monster names should be used very sparingly.
Overriding Monster Spells:
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index 402652713e..d047238bf6 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -2509,6 +2509,13 @@ mons_list::mons_spec_slot mons_list::parse_mons_spec(std::string spec)
{
name = replace_all_of(name, "_", " ");
mspec.monname = name;
+
+ if (strip_tag(mon_str, "name_suffix"))
+ mspec.extra_monster_flags |= MF_NAME_SUFFIX;
+ else if (strip_tag(mon_str, "name_adjective"))
+ mspec.extra_monster_flags |= MF_NAME_ADJECTIVE;
+ else if (strip_tag(mon_str, "name_replace"))
+ mspec.extra_monster_flags |= MF_NAME_REPLACE;
}
trim_string(mon_str);