potentially have a death message (or a message for when the monster is banished or a summon runs out of time).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8235 c06c8d41-db1a-0410-9941-cceddc491573
JHDGOKFOJXQQ46LHUWKS2T2Z4EHJRFFDQ4BY6KETX6IGFGKV6YYQC
I6UO62GLJASOSMHEV4M74WQ3U4YFUFLM4AUA6XGWROCIK2LVDA7QC
2UBGHTABAAOWTCULH7HWGSVXVCHJR3ZBTD3Q2YRULMK2J4DHMQ3AC
NLQNXH3SVJ52CWXEV35FSSZP32VHC4QFGN3HINF4KO5GZHZMOBKQC
3DQXSE4YGFBBDUWK4YEOFWW4UPWILWELFSLP37SL6BERGAZJC5YAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
AYU5OVG2HZO46KDAPKUWAVHS5HTYFKUWIMIRMTHAXVVFEDJE7YPAC
C5VA63WAQRWPENIMXRPUPZLZJMC77PL2B3A77HYFWDCZU5QDG7VQC
NG53L53MSFQZAIVKHG54IEMXNJ33AYVPF2OZM4MMJFDKEJCGPBSAC
2TFYJ7D72JY4DYQW3GSPEONA2WYIVHAJXTIQ2QRDIWF65XN2QFGAC
J6APXOT4QOGQFONWB7G546VTVF6QG42HVOROMHF7YBDJPR4K26OAC
72GIZBEMQLEF3TITOHABWHRLL5TE7KOUSVWOUEHFMO2OZQ4EIB7AC
S34LKQDIQJLIWVIPASOJBBZ6ZCXDHP5KPS7TRBZJSCDRVNCLK6UAC
AIIVH43Z5X3GTPFY4FXQRZPG6Y7QPH2KJ47VM2Q43PCGGD5MTMOAC
5XNQ3SSNBFXFNWA6DPM74W6FH65NX665P3DMH6YCWVFOPZTJSYCQC
5JS3QSE3EIXSBVI4DATH2EIFD7QN3POAFEUM7MK4NRMPH5JOPAAQC
OP6CTAKWCAU64JXQ3USQYR5E5IFHQHNCACII5UMVRXUTZXJQOAZAC
6GSGCC5JQJ5NOKX36UHRNOCXNHDBS2A2TDMAR34UBOGWE2DORXIQC
NVSFIV2ZKP44XHCSCXG6OZVGL67OIFINC34J2EMKTA4KULCERUEAC
BMHUBADDGIOZRVN4P3O5QKIDUYD4RFWBS7MP5X6LZWAYHUBRVD2QC
DAB4UJ6EPV46LAI7QWYRELMJ4ZCFNNR3KVQFIVMULDV3VHYYFQLAC
G7CTMQ3VNTAB73ZI3LNZHKTAJ5LEQEGG772MVFQQ5XXLCMJVORTQC
RV4L36J3DCVW3SONFFYAVK44XJQOFVNPGKHET7VOIFYHWZHCJRNAC
// Provide the player with an ingame clue to Boris' return. -- bwr
std::string msg = getSpeakString("Boris return_speech");
if (!msg.empty())
{
msg = do_mon_str_replacements(msg, monster);
mpr(msg.c_str(), MSGCH_TALK);
}
if (monster->type == MONS_BORIS && !in_transit)
{
// XXX: Actual blood curse effect for Boris? -- bwr
// Invisible monster tries to remain unnoticed. Unless they're
// confused, since then they're too confused to realize they
// should stay silent, but only if the player can see them, so as
// to not have to deal with cases of speaking monsters which the
// player can't see.
if (monster->invisible() && !(player_monster_visible(monster)
&& monster->has_ench(ENCH_CONFUSION)))
ASSERT(!invalid_monster_class(monster->type));
// Monsters always talk on death, even if invisible/silenced/etc
int duration = -1;
const bool force_speak = !monster->alive()
|| !(monster->flags & MF_BANISHED)
|| (monster->is_summoned(&duration) && duration <= 0);
if (!force_speak)
return (false);
}
// Invisible monster tries to remain unnoticed. Unless they're
// confused, since then they're too confused to realize they
// should stay silent, but only if the player can see them, so as
// to not have to deal with cases of speaking monsters which the
// player can't see.
if (monster->invisible() && !(player_monster_visible(monster)
&& monster->has_ench(ENCH_CONFUSION)))
{
return (false);
}
// Silenced monsters only "speak" 1/3 as often as non-silenced,
// unless they're normally silent (S_SILENT). Use
// get_monster_data(monster->type) to bypass mon_shouts()
// replacing S_RANDOM with a random value.
if (silenced(monster->pos())
&& get_monster_data(monster->type)->shouts != S_SILENT)
{
if (!one_chance_in(3))
return (false);
}
// Silenced monsters only "speak" 1/3 as often as non-silenced,
// unless they're normally silent (S_SILENT). Use
// get_monster_data(monster->type) to bypass mon_shouts()
// replacing S_RANDOM with a random value.
if (silenced(monster->pos())
&& get_monster_data(monster->type)->shouts != S_SILENT)
{
if (!one_chance_in(3))
// Berserk monsters just want your hide.
if (monster->has_ench(ENCH_BERSERK))
// Berserk monsters just want your hide.
if (monster->has_ench(ENCH_BERSERK))
return (false);
// Monsters in a battle frenzy are likewise occupied.
if (monster->has_ench(ENCH_BATTLE_FRENZY) && !one_chance_in(3))
return (false);
// 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);
}
// Charmed monsters aren't too expressive.
if (monster->has_ench(ENCH_CHARM) && !one_chance_in(3))
return (false);
The exception to the above is when the monster goes away due to dying, being
banished, or a summoned monster being abjured or having it's time run out. In
that case the monster always speaks if the player can see the grid the monster
is on (assuming that there's a speech entry defined for that occasion, of
course).
Death speech
------------
You can define messages for the monster to give for when it goes away in three
different manners:
* If it really died, then the game will look up a speech entry with the
same keys as usual, but with " killed" appended to all the keys.
* If it was banished, then the game will append " banished" to all the
lookup keys.
* If the monster was summoned and rather than being killed was abjured or
ran out of time, then the game will append " unsummoned" to all of the
lookup keys.
The game will always do a lookup in these circumstances if the player can see
the square the monster is on, so if you only want a death message to be given
occasionally then make one of the messages "__NONE" and give it a high weight.
Of course, if no keys with the given suffix are in the database then the
monster will say nothing in that circumstance.
Rarely, monster speech will also rely on hard-coded keys, such as
Boris' "return_speech". If such a hard-coded key is changed or removed,
the speech in question will simply not be printed. This may look odd in
the game, but will have no other effect. Sometimes, default messages
will be output instead.
Rarely, monster speech will also rely on hard-coded keys. If such a hard-coded
key is changed or removed, the speech in question will simply not be printed.
This may look odd in the game, but will have no other effect. Sometimes,
default messages will be output instead.