summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/random.cc
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2010-01-22 01:48:11 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2010-01-22 03:06:59 +0530
commit141c1e7bbfe7f37ec291d1a14616f3e3c2efaff6 (patch)
treec57be2ff3950ff087f4c40486aee4f0892ce3d5c /crawl-ref/source/random.cc
parent18a740f01d1160c5afa76bb8afd1c1f413f0c425 (diff)
downloadcrawl-ref-141c1e7bbfe7f37ec291d1a14616f3e3c2efaff6.tar.gz
crawl-ref-141c1e7bbfe7f37ec291d1a14616f3e3c2efaff6.zip
Monster respawn rate reduces after 3k turns on level, respawning ends after 15k turns on level, monster level fuzz and super OOD rates increase with time spent beyond 3k turns on level.
The four hells, Zot, and all non-LEVEL_DUNGEON areas (Pan, Abyss and friends) are not affected by these changes. Monster level fuzz can now be up to +7 levels (was +4); this also applies to monsters placed during level-generation (14% chance per monster as before). Super OODs can now be up to +26 (random2avg(27, 2); was +11). Super OOD gen only begins after over 1k turns spent on level and is still quite rare initially (1 in 500, was 1 in 5000 in 0.5). Monster fuzz chances (chance of +0-7 to monster level) increase after 3k turns from 14% to 100% after 7.8k turns. Super OOD chances increase after 3k turns from 1 in 500 (0.2%) to 100% after 12k turns.
Diffstat (limited to 'crawl-ref/source/random.cc')
-rw-r--r--crawl-ref/source/random.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/crawl-ref/source/random.cc b/crawl-ref/source/random.cc
index ec1cb2bb42..eb6f8d95dc 100644
--- a/crawl-ref/source/random.cc
+++ b/crawl-ref/source/random.cc
@@ -12,10 +12,8 @@ int random_range(int low, int high)
int random_range(int low, int high, int nrolls)
{
ASSERT(nrolls > 0);
- int sum = 0;
- for (int i = 0; i < nrolls; ++i)
- sum += random_range(low, high);
- return (sum / nrolls);
+ const int roll = random2avg(high - low + 1, nrolls);
+ return low + roll;
}
// Chooses one of the numbers passed in at random. The list of numbers