diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-08-13 16:33:05 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-08-13 16:33:05 +0000 |
commit | 7a1f76b86cb9719b7c610d5e2e3408290c6e628e (patch) | |
tree | 6335987dfc5d3e1d8fb6dfa64d78a5284ec1f1d9 /crawl-ref/source/monplace.cc | |
parent | 9b663069fe25975eadd0c85ea7a3af08dea32937 (diff) | |
download | crawl-ref-7a1f76b86cb9719b7c610d5e2e3408290c6e628e.tar.gz crawl-ref-7a1f76b86cb9719b7c610d5e2e3408290c6e628e.zip |
Accelerate monster generation in the Vestibule after the player spends enough
time there. Needs more tuning.
[1773000] Fixed tracer crash, mea culpa.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1995 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monplace.cc')
-rw-r--r-- | crawl-ref/source/monplace.cc | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index 2922a1949d..8b895fae7c 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -14,6 +14,7 @@ #include "monplace.h" #include "externs.h" +#include "lev-pand.h" #include "makeitem.h" #include "monstuff.h" #include "mon-pick.h" @@ -151,6 +152,81 @@ static int fuzz_mons_level(int level) return (level); } +static void hell_spawn_random_monsters() +{ + const int speedup_turn = 1339; + + // Monster generation in the Vestibule starts ratcheting up quickly + // after speedup_turn turns spent in the Vestibule. + int genodds = (you.char_direction == GDT_DESCENDING) ? 240 : 8; + if (env.turns_on_level > speedup_turn) + { + genodds -= (env.turns_on_level - speedup_turn) / 12; + if (genodds < 3) + genodds = 3; + } + + if (one_chance_in(genodds)) + { + int distance_odds = 10; + if (env.turns_on_level > speedup_turn) + distance_odds -= (env.turns_on_level - speedup_turn) / 100; + + if (distance_odds < 2) + distance_odds = 2; + + proximity_type prox = + (one_chance_in(distance_odds) ? PROX_NEAR_STAIRS + : PROX_AWAY_FROM_PLAYER); + mons_place( WANDERING_MONSTER, BEH_HOSTILE, MHITNOT, false, + 50, 50, LEVEL_DUNGEON, prox ); + viewwindow(true, false); + } +} + +void spawn_random_monsters() +{ + if (player_in_branch(BRANCH_VESTIBULE_OF_HELL)) + { + hell_spawn_random_monsters(); + return; + } + + // place normal dungeon monsters, but not in player LOS + if (you.level_type == LEVEL_DUNGEON + && !player_in_branch( BRANCH_ECUMENICAL_TEMPLE ) + && one_chance_in((you.char_direction == GDT_DESCENDING) ? 240 : 8)) + { + proximity_type prox = (one_chance_in(10) ? PROX_NEAR_STAIRS + : PROX_AWAY_FROM_PLAYER); + + // The rules change once the player has picked up the Orb... + if (you.char_direction == GDT_ASCENDING) + prox = (one_chance_in(6) ? PROX_CLOSE_TO_PLAYER : PROX_ANYWHERE); + + mons_place( WANDERING_MONSTER, BEH_HOSTILE, MHITNOT, false, + 50, 50, LEVEL_DUNGEON, prox ); + viewwindow(true, false); + } + + // place Abyss monsters. + if (you.level_type == LEVEL_ABYSS && one_chance_in(5)) + { + mons_place( WANDERING_MONSTER, BEH_HOSTILE, MHITNOT, false, + 50, 50, LEVEL_ABYSS, PROX_ANYWHERE ); + viewwindow(true, false); + } + + // place Pandemonium monsters + if (you.level_type == LEVEL_PANDEMONIUM && one_chance_in(50)) + { + pandemonium_mons(); + viewwindow(true, false); + } + + // No monsters in the Labyrinth, or the Ecumenical Temple, or in Bazaars. +} + monster_type pick_random_monster(const level_id &place, int power, int &lev_mons) |