From 8022157bc51f20d7f636c09cbd96ecc8f8958aeb Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Fri, 6 Nov 2009 02:10:08 -0800 Subject: 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. --- crawl-ref/docs/develop/level_design.txt | 20 ++++++++++++++++++++ crawl-ref/source/mapdef.cc | 7 +++++++ 2 files changed, 27 insertions(+) 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); -- cgit v1.2.3-54-g00ecf