summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/dat/float.des20
-rw-r--r--crawl-ref/source/dat/mini.des6
-rw-r--r--crawl-ref/source/enum.h9
-rw-r--r--crawl-ref/source/mapdef.cc13
-rw-r--r--crawl-ref/source/monster.cc14
5 files changed, 46 insertions, 16 deletions
diff --git a/crawl-ref/source/dat/float.des b/crawl-ref/source/dat/float.des
index 786194e870..3402eba9e0 100644
--- a/crawl-ref/source/dat/float.des
+++ b/crawl-ref/source/dat/float.des
@@ -958,25 +958,25 @@ ORIENT: float
FLAGS: no_item_gen no_monster_gen
KFEAT: ABCDEFG = metal_wall
KMONS: 1 = col:gold skeletal warrior name:ancient_champion name_replace \
- spells:iron_shot;.;haste;pain;.;. actual_spells \
+ name_descriptor spells:iron_shot;.;haste;pain;.;. actual_spells \
; plate mail ego:fire_resistance | plate mail ego:cold_resistance . \
great sword ego:pain | great sword ego:draining | great sword \
ego:flaming | w:3 triple sword ego:vorpal
KMONS: 2 = col:gold skeletal warrior name:ancient_champion name_replace \
- spells:bolt_of_draining;.;haste;throw_frost;.;. actual_spells \
- ; plate mail ego:fire_resistance | plate mail ego:cold_resistance . \
- great mace ego:vorpal | great mace ego:draining
+ name_descriptor spells:bolt_of_draining;.;haste;throw_frost;.;. \
+ actual_spells ; plate mail ego:fire_resistance | plate mail \
+ ego:cold_resistance . great mace ego:vorpal | great mace ego:draining
KMONS: 3 = col:gold skeletal warrior name:ancient_champion name_replace \
- spells:venom_bolt;.;haste;haunt;.;. actual_spells \
+ name_descriptor spells:venom_bolt;.;haste;haunt;.;. actual_spells \
; plate mail ego:fire_resistance | plate mail ego:cold_resistance . \
battleaxe ego:vorpal | battleaxe ego:pain | \
w:3 executioner's axe ego:vorpal
KMONS: 4 = col:gold skeletal warrior name:ancient_champion name_replace \
- spells:iskenderun's_mystic_blast;slow;haste;.;.;. actual_spells \
- ; plate mail ego:fire_resistance | plate mail ego:cold_resistance . \
- great sword ego:pain | great sword ego:draining | great sword \
- ego:flaming | battleaxe ego:vorpal | battleaxe ego:pain | \
- triple sword ego:vorpal | executioner's axe ego:vorpal
+ name_descriptor spells:iskenderun's_mystic_blast;slow;haste;.;.;. \
+ actual_spells ; plate mail ego:fire_resistance | plate mail \
+ ego:cold_resistance . great sword ego:pain | great sword ego:draining \
+ | great sword ego:flaming | battleaxe ego:vorpal | battleaxe ego:pain \
+ | triple sword ego:vorpal | executioner's axe ego:vorpal
SHUFFLE: 123
KPROP: ]v.1234+ABCDEFG!n$wr|" = no_rtele_into
KITEM: w = acquire weapon
diff --git a/crawl-ref/source/dat/mini.des b/crawl-ref/source/dat/mini.des
index b27857e9fc..da3db7bd69 100644
--- a/crawl-ref/source/dat/mini.des
+++ b/crawl-ref/source/dat/mini.des
@@ -35,6 +35,12 @@ default-depth: D:8-27
##############################################################################
# Minivault balancer
#
+NAME: mini_test
+MONS: skeletal warrior name:ancient_champion name_replace name_descriptor name_definite
+MAP
+1
+ENDMAP
+
NAME: mini_dummy
DEPTH: 1-50, !D:1-27
TAGS: dummy
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index d33a2ec149..5234f373b1 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -2158,7 +2158,14 @@ enum monster_flag_type
MF_PRIEST = 0x800000, // Is a priest (divine spells)
// for the conduct.
- MF_GOING_BERSERK = 0x1000000 // Is about to go berserk!
+ MF_GOING_BERSERK = 0x1000000,// Is about to go berserk!
+
+ MF_NAME_DESCRIPTOR = 0x2000000,// mname should be treated with normal
+ // grammar, ie, prevent "You hit red rat"
+ // and other such constructs.
+ MF_NAME_DEFINITE = 0x4000000 // give this monster the definite "the"
+ // article, instead of the indefinite "a"
+ // article.
};
// Adding slots breaks saves. YHBW.
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index bfa32eed3b..0ff5a83843 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -2603,6 +2603,19 @@ mons_list::mons_spec_slot mons_list::parse_mons_spec(std::string spec)
mspec.extra_monster_flags |= MF_NAME_ADJECTIVE;
else if (strip_tag(mon_str, "name_replace"))
mspec.extra_monster_flags |= MF_NAME_REPLACE;
+
+ // We should be able to combine this with name_replace.
+ if (strip_tag(mon_str, "name_descriptor"))
+ mspec.extra_monster_flags |= MF_NAME_DESCRIPTOR;
+ // Reasoning for this setting both flags: it does nothing with the
+ // description unless NAME_DESCRIPTOR is also set; thus, you end up
+ // with bloated vault description lines akin to: "name:blah_blah
+ // name_replace name_descrpitor name_definite".
+ if (strip_tag(mon_str, "name_definite"))
+ {
+ mspec.extra_monster_flags |= MF_NAME_DEFINITE;
+ mspec.extra_monster_flags |= MF_NAME_DESCRIPTOR;
+ }
}
trim_string(mon_str);
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 3b3fab4bee..ab2e7f78b1 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -2051,7 +2051,8 @@ static std::string _str_monam(const monsters& mon, description_level_type desc,
// If the monster has an explicit name, return that, handling it like
// a unique's name. Special handling for named hydras.
if (desc != DESC_BASENAME && !mon.mname.empty()
- && mons_genus(nametype) != MONS_HYDRA)
+ && mons_genus(nametype) != MONS_HYDRA
+ && !testbits(mon.flags, MF_NAME_DESCRIPTOR))
{
return (mon.mname);
}
@@ -2063,7 +2064,8 @@ static std::string _str_monam(const monsters& mon, description_level_type desc,
// Start with the prefix.
// (Uniques don't get this, because their names are proper nouns.)
if (!mons_is_unique(nametype)
- && (mon.mname.empty() || mons_genus(nametype) == MONS_HYDRA))
+ && ((mon.mname.empty() || testbits(mon.flags, MF_NAME_DESCRIPTOR))
+ || mons_genus(nametype) == MONS_HYDRA))
{
const bool use_your = mon.friendly();
switch (desc)
@@ -2075,13 +2077,15 @@ static std::string _str_monam(const monsters& mon, description_level_type desc,
result = (use_your ? "your " : "the ");
break;
case DESC_CAP_A:
- if (mon.mname.empty())
+ if (mon.mname.empty() || (testbits(mon.flags, MF_NAME_DESCRIPTOR)
+ && !testbits(mon.flags, MF_NAME_DEFINITE)))
result = "A ";
else
result = "The ";
break;
case DESC_NOCAP_A:
- if (mon.mname.empty())
+ if (mon.mname.empty() || (testbits(mon.flags, MF_NAME_DESCRIPTOR)
+ && !testbits(mon.flags, MF_NAME_DEFINITE)))
result = "a ";
else
result = "the ";
@@ -2272,7 +2276,7 @@ std::string monsters::full_name(description_level_type desc,
const unsigned long flag = flags & MF_NAME_MASK;
- if (flag == MF_NAME_REPLACE)
+ if (flag == MF_NAME_REPLACE && !testbits(flags, MF_NAME_DESCRIPTOR))
{
switch(desc)
{