summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-pick.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-08-23 01:57:16 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-08-26 13:20:53 +0200
commit2dfbc2c440f6ce3efd2ae5fdafdf311015b07079 (patch)
tree316ac12828375d1f3ecd9e0feb9990f36db93a09 /crawl-ref/source/mon-pick.cc
parentc1fbd6fca26203ea64b592e144151d560628983f (diff)
downloadcrawl-ref-2dfbc2c440f6ce3efd2ae5fdafdf311015b07079.tar.gz
crawl-ref-2dfbc2c440f6ce3efd2ae5fdafdf311015b07079.zip
Don't use internal data of mon-pick from the outside.
Diffstat (limited to 'crawl-ref/source/mon-pick.cc')
-rw-r--r--crawl-ref/source/mon-pick.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-pick.cc b/crawl-ref/source/mon-pick.cc
index b59cd23906..40d7a0d3ec 100644
--- a/crawl-ref/source/mon-pick.cc
+++ b/crawl-ref/source/mon-pick.cc
@@ -27,6 +27,24 @@ int mons_rarity(monster_type mcls, const level_id &place)
return branches[place.branch].mons_rarity_function(mcls);
}
+// only Pan currently
+monster_type pick_monster_no_rarity(const level_id &place)
+{
+ if (branches[place.branch].mons_rarity_function == mons_null_rare)
+ return MONS_0;
+
+ monster_type mons;
+ do mons = (monster_type)random2(NUM_MONSTERS);
+ while (!branches[place.branch].mons_rarity_function(mons));
+
+ return mons;
+}
+
+bool branch_has_monsters(branch_type branch)
+{
+ return branches[branch].mons_rarity_function != mons_null_rare;
+}
+
#if defined(DEBUG_DIAGNOSTICS) || defined(DEBUG_TESTS)
void debug_monpick()
{