diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-19 01:50:06 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-19 01:50:06 +0000 |
commit | 4a6720babaa50b72d8ed6ca575c1219b3ebe09bd (patch) | |
tree | 37c8d9b60ac99a62a002466ad5e4dd7d2d2619fd /crawl-ref/source/monstuff.h | |
parent | 01811808aa7c524e52cbd0c73c20b3888e939d29 (diff) | |
download | crawl-ref-4a6720babaa50b72d8ed6ca575c1219b3ebe09bd.tar.gz crawl-ref-4a6720babaa50b72d8ed6ca575c1219b3ebe09bd.zip |
Expand choose_random_nearby_monster() to optionally allow choosing only
particular types of monsters. Accordingly, make it global, and move it
from decks.cc to monstuff.cc.
In xom.cc, remove get_random_nearby_monster(), as it's duplicate code,
and replace it with a call to choose_random_nearby_monster(), filtering
out those monsters that shouldn't be mutated.
All this should eventually allow choosing a random friendly monster near
you, for the proposed TSO/Beogh blessings.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3714 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.h')
-rw-r--r-- | crawl-ref/source/monstuff.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/monstuff.h b/crawl-ref/source/monstuff.h index 034aabe13d..5e6c24697d 100644 --- a/crawl-ref/source/monstuff.h +++ b/crawl-ref/source/monstuff.h @@ -121,6 +121,11 @@ bool simple_monster_message(const monsters *monster, const char *event, int param = 0, description_level_type descrip = DESC_CAP_THE); +bool choose_any_monster(const monsters* mon); +int choose_random_nearby_monster(int weight, + bool (*suitable)(const monsters* mon) = + choose_any_monster); + /* *********************************************************************** * called from: acr * *********************************************************************** */ |