diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-11 22:22:08 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-11 22:22:08 +1000 |
commit | 85b70c927bf2e95c88530500d01a6ba5f1a9acb7 (patch) | |
tree | 6fc471f28b0beaf1723f6388f4605456fa7e1a18 /crawl-ref/source/mon-abil.cc | |
parent | e4d5c6039f79b6952919882a74482695bffba6f9 (diff) | |
download | crawl-ref-85b70c927bf2e95c88530500d01a6ba5f1a9acb7.tar.gz crawl-ref-85b70c927bf2e95c88530500d01a6ba5f1a9acb7.zip |
Move monster speech calculations to monspeak.cc. Make Yiuf chattier.
Crazy Yiuf now speaks with more regularity than normal; this is a
special case, and could probably be converted to a flag (M_CHATTY) or
something similar for other uniques.
The monster-speaking chance code seems to make more sense being in
monspeak.cc, so moved it there under maybe_mons_speaks.
Diffstat (limited to 'crawl-ref/source/mon-abil.cc')
-rw-r--r-- | crawl-ref/source/mon-abil.cc | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc index 73d0547f6c..7067112d6e 100644 --- a/crawl-ref/source/mon-abil.cc +++ b/crawl-ref/source/mon-abil.cc @@ -1306,46 +1306,7 @@ void mon_nearby_ability(monsters *monster) return; } -#define MON_SPEAK_CHANCE 21 - - if (monster->is_patrolling() || mons_is_wandering(monster) - || monster->attitude == ATT_NEUTRAL) - { - // Very fast wandering/patrolling monsters might, in one monster turn, - // move into the player's LOS and then back out (or the player - // might move into their LOS and the monster move back out before - // the player's view has a chance to update) so prevent them - // from speaking. - ; - } - else if ((mons_class_flag(monster->type, M_SPEAKS) - || !monster->mname.empty()) - && one_chance_in(MON_SPEAK_CHANCE)) - { - mons_speaks(monster); - } - else if (get_mon_shape(monster) >= MON_SHAPE_QUADRUPED) - { - // Non-humanoid-ish monsters have a low chance of speaking - // without the M_SPEAKS flag, to give the dungeon some - // atmosphere/flavour. - int chance = MON_SPEAK_CHANCE * 4; - - // Band members are a lot less likely to speak, since there's - // a lot of them. - if (testbits(monster->flags, MF_BAND_MEMBER)) - chance *= 10; - - // However, confused and fleeing monsters are more interesting. - if (mons_is_fleeing(monster)) - chance /= 2; - if (monster->has_ench(ENCH_CONFUSION)) - chance /= 2; - - if (one_chance_in(chance)) - mons_speaks(monster); - } - // Okay then, don't speak. + maybe_mons_speaks(monster); if (monster_can_submerge(monster, grd(monster->pos())) && !monster->caught() // No submerging while caught. |