diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-23 00:51:29 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-23 00:51:29 +0000 |
commit | 8a2dfbcb11bd09dab998a6b81e8c7407a3c4c42a (patch) | |
tree | 3df55b11e9678b3754feb19b6307301cb7ec660e /crawl-ref/source/mon-util.cc | |
parent | 435e410c4c086fa96d6068c1f7da3bd7f16f7a1c (diff) | |
download | crawl-ref-8a2dfbcb11bd09dab998a6b81e8c7407a3c4c42a.tar.gz crawl-ref-8a2dfbcb11bd09dab998a6b81e8c7407a3c4c42a.zip |
Modify database lookup to allow for lookup of the nth entry for a
given keyword. Used for more varied recite speech, so that the same
prechosen synonym can be used for all of start/continue/stop/finish
reciting. The number of the entry is calculated in an embarassingly
hacky way:
(recite power + hp at beginning of recite + x_pos + y_pos)
modulo total weight of the keyword.
This makes sure that different synonyms get used, though always the
same one (plus its shorter variant) during one round of recite, but
it's not as random as I'd like. It works well enough for now, though,
and adds some much needed flavour to Zin.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3818 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index a9a338fdb7..1b9d9a244f 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -263,7 +263,7 @@ void init_monster_symbols() const monsterentry *me = get_monster_data(i); if (me) { - md.glyph = me->showchar; + md.glyph = me->showchar; md.colour = me->colour; } } @@ -328,7 +328,7 @@ bool mons_class_flag(int mc, int bf) return (false); return ((me->bitfields & bf) != 0); -} // end mons_class_flag() +} static int _scan_mon_inv_randarts( const monsters *mon, randart_prop_type ra_prop) @@ -590,7 +590,7 @@ shout_type mons_shouts(int mc) u = static_cast<shout_type>(random2(NUM_SHOUTS)); return (u); -} // end mons_shouts() +} bool mons_is_unique( int mc ) { |