summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monspeak.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-29 20:36:26 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-29 20:36:26 +0000
commitbfb78773d40980efe0925662d12128ae101a7729 (patch)
tree873ccd4c6c216704e04c2fe3583412ec3dd88184 /crawl-ref/source/monspeak.cc
parentbee19fd8b7da68818a8d6a2d1a204308fb602efc (diff)
downloadcrawl-ref-bfb78773d40980efe0925662d12128ae101a7729.tar.gz
crawl-ref-bfb78773d40980efe0925662d12128ae101a7729.zip
Add two new channels, MSGCH_FRIEND_SPELL and MSGCH_FRIEND_ENCHANT,
whose sole purpose is to not interrupt resting if it's a friend doing the spellcasting or enchanting. Unspam the message handling for orcs going in a battle frenzy, and allow the message back into normal game. Fix 1953632: Named monsters' names are shown for unseen invisible monsters. Change general monster name handling to refer to friendly monsters as "your monster" rather than "the monster", like was already the case for monster speech. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4769 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monspeak.cc')
-rw-r--r--crawl-ref/source/monspeak.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/crawl-ref/source/monspeak.cc b/crawl-ref/source/monspeak.cc
index 06910e7c50..6e207077a5 100644
--- a/crawl-ref/source/monspeak.cc
+++ b/crawl-ref/source/monspeak.cc
@@ -229,11 +229,15 @@ bool mons_speaks(const monsters *monster)
return false;
}
- // berserk monsters just want your hide.
+ // Berserk monsters just want your hide.
if (monster->has_ench(ENCH_BERSERK))
return false;
- // charmed monsters aren't too expressive
+ // Monsters in a battle frenzy are likewise occupied.
+ if (monster->has_ench(ENCH_BATTLE_FRENZY) && !one_chance_in(3))
+ return false;
+
+ // Charmed monsters aren't too expressive.
if (monster->has_ench(ENCH_CHARM) && !one_chance_in(3))
return false;
@@ -241,7 +245,7 @@ bool mons_speaks(const monsters *monster)
std::vector<std::string> prefixes;
if (mons_neutral(monster))
{
- if (coinflip()) // neutrals speak half as often
+ if (coinflip()) // Neutrals speak half as often.
return false;
prefixes.push_back("neutral");
@@ -520,9 +524,15 @@ bool mons_speaks(const monsters *monster)
else if (param == "VISUAL")
msg_type = MSGCH_TALK_VISUAL;
else if (param == "SPELL" && !silence || param == "VISUAL SPELL")
- msg_type = MSGCH_MONSTER_SPELL;
+ {
+ msg_type = mons_friendly(monster) ? MSGCH_FRIEND_SPELL
+ : MSGCH_MONSTER_SPELL;
+ }
else if (param == "ENCHANT" && !silence || param == "VISUAL ENCHANT")
- msg_type = MSGCH_MONSTER_ENCHANT;
+ {
+ msg_type = mons_friendly(monster) ? MSGCH_FRIEND_ENCHANT
+ : MSGCH_MONSTER_ENCHANT;
+ }
else if (param == "PLAIN")
msg_type = MSGCH_PLAIN;
else