summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-13 16:33:05 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-13 16:33:05 +0000
commit7a1f76b86cb9719b7c610d5e2e3408290c6e628e (patch)
tree6335987dfc5d3e1d8fb6dfa64d78a5284ec1f1d9 /crawl-ref/source
parent9b663069fe25975eadd0c85ea7a3af08dea32937 (diff)
downloadcrawl-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')
-rw-r--r--crawl-ref/source/acr.cc35
-rw-r--r--crawl-ref/source/monplace.cc76
-rw-r--r--crawl-ref/source/monplace.h2
-rw-r--r--crawl-ref/source/view.cc2
4 files changed, 80 insertions, 35 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index a7fcbc31d8..aa3d87f99e 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -2248,40 +2248,7 @@ static void world_reacts()
if (you.duration[DUR_PARALYSIS] > 0 && any_messages())
more();
- // 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.
- return;
+ spawn_random_monsters();
}
#ifdef DGL_SIMPLE_MESSAGING
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)
diff --git a/crawl-ref/source/monplace.h b/crawl-ref/source/monplace.h
index 1de7d3ba80..1869b7cfdb 100644
--- a/crawl-ref/source/monplace.h
+++ b/crawl-ref/source/monplace.h
@@ -103,4 +103,6 @@ bool monster_habitable_grid(const monsters *m, int actual_grid);
bool monster_can_submerge(int monster_class, int grid);
coord_def find_newmons_square(int mons_class, int x, int y);
+void spawn_random_monsters();
+
#endif // MONPLACE_H
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 7e60bc3a63..d3ebdccfe4 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -1389,7 +1389,7 @@ void ray_def::advance_and_bounce()
};
int oldx = x(), oldy = y();
const double oldaccx = accx, oldaccy = accy;
- int rc = advance(true);
+ int rc = advance(false);
int newx = x(), newy = y();
ASSERT( grid_is_solid(grd[newx][newy]) );