diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-03-17 03:40:05 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-03-18 08:34:31 +0100 |
commit | 67c5791b6a4c811c635a761c869e678cc62fee50 (patch) | |
tree | be92837f1ad7baa2e6581dff53fc75d422a5eae1 /crawl-ref/source/mon-pick.cc | |
parent | 238fe701383a03c756432e68894ed9181bdf8b09 (diff) | |
download | crawl-ref-67c5791b6a4c811c635a761c869e678cc62fee50.tar.gz crawl-ref-67c5791b6a4c811c635a761c869e678cc62fee50.zip |
Cap OODs at the branch end.
This changes behaviour: before, except for a short range after the end of
data, monster picking code would loop failing until it decides to stop
caring about depth altogether, and pick a monster eligible for the current
branch using nothing but its rarity. Now, it will simply pick one from
Branch:$.
With four exceptions:
* D/Vaults: these rely heavily on the cap being at D:31; this is pretty
much the entire monster set for Vaults:$.
* Elf, Tomb: they had OODs defined past the branch's end. They'd pop up
for "mild" OODs but not for "super" OODs which would degenerate into
fully random search (and thus be usually weaker).
A bunch of other branches had data for a single level or so past the end,
but it doesn't appear to be meaningful.
Hells and Zot had OODs broken due to the old cap being shallower than around
half of the branch. This rewrite preserves monsters totally ineligible to
spawn but doesn't try to make the distribution identical. All real threat
comes from hell effects / Zot:5 vault anyway.
Diffstat (limited to 'crawl-ref/source/mon-pick.cc')
-rw-r--r-- | crawl-ref/source/mon-pick.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-pick.cc b/crawl-ref/source/mon-pick.cc index db13b2f0a2..cc344feefe 100644 --- a/crawl-ref/source/mon-pick.cc +++ b/crawl-ref/source/mon-pick.cc @@ -33,6 +33,25 @@ typedef struct #include "mon-pick-data.h" +int branch_ood_cap(branch_type branch) +{ + ASSERT(branch < NUM_BRANCHES); + + switch (branch) + { + case BRANCH_MAIN_DUNGEON: + return 31; + case BRANCH_VAULTS: + return 15; + case BRANCH_ELVEN_HALLS: + return 7; + case BRANCH_TOMB: + return 5; + default: + return branches[branch].numlevels; + } +} + // NOTE: The lower the level the earlier a monster may appear. int mons_depth(monster_type mcls, branch_type branch) { |