summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-pick.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-03-18 20:33:13 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-03-18 20:33:13 +0100
commit220a2a026d0d831500c011ae4ab1473bfbe93263 (patch)
treefa75889522d641963d6b1b190e290a7d5a07052b /crawl-ref/source/mon-pick.cc
parentfa165602006363ee5eeea0197bf3b8d34d94ec64 (diff)
downloadcrawl-ref-220a2a026d0d831500c011ae4ab1473bfbe93263.tar.gz
crawl-ref-220a2a026d0d831500c011ae4ab1473bfbe93263.zip
Update the compat functions for UP and DOWN distributions.
Their focus is not in the center. In existing data, all UPs are at the high end of the range, all DOWNs at the low (shallowest) end, so they can be thought of as trimmed PEAKs.
Diffstat (limited to 'crawl-ref/source/mon-pick.cc')
-rw-r--r--crawl-ref/source/mon-pick.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/mon-pick.cc b/crawl-ref/source/mon-pick.cc
index 9b3033223f..d3dd4cc699 100644
--- a/crawl-ref/source/mon-pick.cc
+++ b/crawl-ref/source/mon-pick.cc
@@ -60,7 +60,13 @@ int mons_depth(monster_type mcls, branch_type branch)
// legacy function, until ZotDef is ported
for (const pop_entry *pe = population[branch].pop; pe->mons; pe++)
if (pe->mons == mcls)
+ {
+ if (pe->distrib == UP)
+ return pe->maxr;
+ else if (pe->distrib == DOWN)
+ return pe->minr;
return (pe->minr + pe->maxr) / 2;
+ }
return DEPTH_NOWHERE;
}
@@ -78,7 +84,7 @@ int mons_rarity(monster_type mcls, branch_type branch)
// the square of distance).
// The new data pretty accurately represents old state, but only
// if depth is known, and mons_rarity() doesn't receive it.
- static int fudge[3] = { 25, 12, 0 };
+ static int fudge[5] = { 25, 12, 0, 0, 0 };
int rare = pe->rarity;
if (rare < 500)
rare = isqrt_ceil(rare * 10);