If the monster's casting would be affected by Silence then attempt to indicate that the monster is using words.
Allow for different messages for targeted spells vs untargeted spells.
Provide some special messages for the Animate Dead spell.
Don't let sphinxes gesture or point.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8007 c06c8d41-db1a-0410-9941-cceddc491573
774O5HM4CU5QYP4MPKKLHIVZQ5JLLZETYIDZZYBAPOJSO6ILC5RAC
AJHVP42Y67SB4NKFMZB24524PGX2XA5WLFNEFV52MIGTS47ALMVQC
3DQXSE4YGFBBDUWK4YEOFWW4UPWILWELFSLP37SL6BERGAZJC5YAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
R22TTMI6WXWULC7ODKFF3QCB7MOTETQQ6IR4BUCUPOCQKQNCTT5AC
JWJGOMVBPZRSP2VSHLFFFDIF2CS6UPBA6AHL7DAJWGBCHAV3PJDQC
ZEFGFQHN6J2S6EIPX7EPDG22C5YXTI6DMKQHHRCLWN5MQC44KY3AC
S7KC3IFKCUNBO3XO4TV3KEQEIDZWSRJSKXY65DPONKMG54VHU3UQC
R2DQBWKIW7YUJB5SOQ7J274JIYRVX4H3ISFRPAL5RG2RVVP4G2KAC
JI4NDSOXGGZ7QHXXFB3ZTHAKHABXYBZXPDGLUFV5SKYEOL5FT7JQC
QDTVLBRGHDTRUVT7I3O72K6TMOYAUSAJBZUHGOEFU2RKJNUPWZSQC
FCZSQBKDNMJZRJS2LWQQWLUFGOXSKXDJZQIHC7L5S7HXCXQPOMMAC
EIJQB5HNBFGK6MQ7OOM6TC3BKONFXF3CIDM7HTL7VKE44ZM6ACJQC
const bool unseen = !you.can_see(monster);
const bool silent = silenced(monster->pos()) || force_silent;
const bool unseen = !you.can_see(monster);
const bool silent = silenced(monster->pos()) || force_silent;
const bool no_silent = mons_class_flag(monster->type, M_SPELL_NO_SILENT);
key = mons_type_name(monster->type, DESC_PLAIN);
key += cast_str;
msg = getSpeakString(key + suffix);
if (msg.empty() && silent)
msg = getSpeakString(key);
if (priest || wizard)
key_list.push_back(spell_name + cast_str + " real");
if (mons_intel(monster) >= I_NORMAL)
key_list.push_back(spell_name + cast_str + " gestures");
key += cast_str;
msg = getSpeakString(key + suffix);
// Next the monster type name, then species name, then genus name.
key_list.push_back(mons_type_name(monster->type, DESC_PLAIN) + cast_str);
key_list.push_back(mons_type_name(mons_species(monster->type), DESC_PLAIN)
+ cast_str);
key_list.push_back(mons_type_name(mons_genus(monster->type), DESC_PLAIN)
+ cast_str);
if (msg.empty() && silent)
msg = getSpeakString(key);
}
// Last, generic wizard, priest or demon.
if (wizard)
key_list.push_back("wizard" + cast_str);
else if (priest)
key_list.push_back("priest" + cast_str);
else if (mons_is_demon(monster->type))
key_list.push_back("demon" + cast_str);
key = mons_type_name(mons_species(monster->type), DESC_PLAIN);
key += cast_str;
msg = getSpeakString(key + suffix);
if (msg.empty() && silent)
msg = getSpeakString(key);
for (unsigned int i = key_list.size() - 1; i >= num_spell_keys; i--)
{
std::string str = key_list[i] + " targeted";
key_list.insert(key_list.begin() + i, str);
}
if (msg.empty() && silent)
msg = getSpeakString(key);
}
msg = getSpeakString(prefix + key);
if (msg == "__NONE")
{
msg = "";
break;
}
else if (msg == "__NEXT")
{
msg = "";
if (i < num_spell_keys)
i = num_spell_keys - 1;
else if (ends_with(key, " targeted"))
i++;
continue;
}
else if (!msg.empty())
break;
// Lastly, maybe it's a demon.
if (msg.empty() && mons_is_demon(monster->type))
{
key = "demon";
key += cast_str;
msg = getSpeakString(key + suffix);
// If we got no message and we're using the silent prefix, then
// try again without the prefix.
if (prefix != "silent")
continue;
if (msg.empty() && silent)
msg = getSpeakString(key);
msg = getSpeakString(key);
if (msg == "__NONE")
{
msg = "";
break;
}
else if (msg == "__NEXT")
{
msg = "";
if (i < num_spell_keys)
i = num_spell_keys - 1;
else if (ends_with(key, " targeted"))
i++;
continue;
}
else if (!msg.empty())
break;
if (can_plural != NULL)
*can_plural = true;
std::string str;
switch(mons_genus(type))
{
case MONS_NAGA:
case MONS_DRACONIAN: str = "scaled arm"; break;
case MONS_MUMMY: str = "bandaged wrapped arm"; break;
case MONS_SKELETAL_WARRIOR:
case MONS_LICH: str = "bony arm"; break;
default: str = "arm"; break;
}
if (plural)
str = pluralise(str);
return (str);
}
// Body parts.
bool can_plural = false;
std::string part_str = monster->hand_name(false, &can_plural);
msg = replace_all(msg, "@hand@", part_str);
msg = replace_all(msg, "@Hand@", upcase_first(part_str));
if (!can_plural)
part_str = "NO PLURAL HANDS";
else
part_str = monster->hand_name(true);
msg = replace_all(msg, "@hands@", part_str);
msg = replace_all(msg, "@Hands@", upcase_first(part_str));
can_plural = false;
part_str = monster->arm_name(false, &can_plural);
msg = replace_all(msg, "@arm@", part_str);
msg = replace_all(msg, "@Arm@", upcase_first(part_str));
if (!can_plural)
part_str = "NO PLURAL ARMS";
else
part_str = monster->arm_name(true);
msg = replace_all(msg, "@arms@", part_str);
msg = replace_all(msg, "@Arms@", upcase_first(part_str));
can_plural = false;
part_str = monster->foot_name(false, &can_plural);
msg = replace_all(msg, "@foot@", part_str);
msg = replace_all(msg, "@Foot@", upcase_first(part_str));
if (!can_plural)
part_str = "NO PLURAL FOOT";
else
part_str = monster->foot_name(true);
msg = replace_all(msg, "@feet@", part_str);
msg = replace_all(msg, "@Feet@", upcase_first(part_str));
# This file contains the messages used to "announce" a spell, like
# "The wizard mumbles some strange words." The messages are looked
# up in the following order by the following keys:
#
# 1) The name of the spell being cast:
# a) If being cast by a wizard or priest monster with arms, first try
# with the suffix "real".
# b) If being cast by a monster of normal or higher intelligence with arms,
# try with the suffix "gestures".
# c) Next, try without any suffix.
# 2) The name of the monster's type.
# 3) The name of the monster's species.
# 4) The name of the monster's genus.
# 5) "priest" if the monster is a priest type, "wizard" if it's a wizard type,
# or "demon" if it's demonic.
#
# For 2 to 5, if the spell has a target it will first add the suffix
# "targeted" to the lookup key before trying without the suffix.
#
# For all lookups, if the monster is unseen by the player it will add the
# prefix "unseen" to the key, or if the player or monster is silenced
# it will prefix "silent" to the key (if the monster is both unseen and
# unheard no message is ever given). If using the prefix "silent" gives
# no results it will try again without the prefix, assuming that the
# spell has no sound component.
#
# To give no message use the string "__NONE", and to skip the current
# lookup method and move onto the next one use the string "__NEXT".
Animate Dead cast gestures
@The_monster@ gestures at the surounding.
@The_monster@ throws @possessive@ @arms@ wide.
%%%%
Symbol of Torment cast
@The_monster@ calls on the powers of Hell!
%%%%
unseen Symbol of Torment cast
@The_something@ calls on the powers of Hell!
#####################################################
# Individual innate spells (breathing and spitting).
#####################################################
%%%%
@The_something@ calls on the powers of Hell!
#####################################################
# Priest and wizard casting messages.
#####################################################
You hear a weird and mournful sound.
%%%%
giant orange brain cast
@The_monster@ pulsates.
@The_monster@ gazes.
########################################################################
# Individual monsters
########################################################################
@The_monster@ looks around.
######################################################
# Generic priest, wizard and demonic casting messages.
######################################################
demon cast targeted
@The_monster@ gestures at @target@.
%%%%
demon cast
@The_monster@ gestures.
%%%%