summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/abyss.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-01 22:49:33 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-01 22:49:33 +0000
commit9d50c76de535f99c039fbd1250eadb8554cedcbb (patch)
tree587642b0ffc9642cd1198adc292699062b3b311b /crawl-ref/source/abyss.cc
parent633a81c7f6b92c1e85f9efde063a01bf3ac34f27 (diff)
downloadcrawl-ref-9d50c76de535f99c039fbd1250eadb8554cedcbb.tar.gz
crawl-ref-9d50c76de535f99c039fbd1250eadb8554cedcbb.zip
For Tiles, use some of the other wall types in the Abyss as well to make
it more interesting. The rest is mostly clean-up. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6307 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/abyss.cc')
-rw-r--r--crawl-ref/source/abyss.cc34
1 files changed, 23 insertions, 11 deletions
diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc
index 7c9b17cc0e..f0deac1c39 100644
--- a/crawl-ref/source/abyss.cc
+++ b/crawl-ref/source/abyss.cc
@@ -38,11 +38,13 @@
#include "view.h"
#include "xom.h"
+// If not_seen is true, don't place the feature where it can be seen from
+// the centre.
static bool _place_feature_near( const coord_def &centre,
int radius,
dungeon_feature_type candidate,
dungeon_feature_type replacement,
- int tries )
+ int tries, bool not_seen = false )
{
const int radius2 = radius * radius + 1;
for (int i = 0; i < tries; ++i)
@@ -50,9 +52,13 @@ static bool _place_feature_near( const coord_def &centre,
const coord_def &cp =
centre + coord_def(random_range(-radius, radius),
random_range(-radius, radius));
+
if (cp == centre || (cp - centre).abs() > radius2 || !in_bounds(cp))
continue;
+ if (not_seen && grid_see_grid(cp.x, cp.y, centre.x, centre.y))
+ continue;
+
if (grd(cp) == candidate)
{
#ifdef DEBUG_DIAGNOSTICS
@@ -97,8 +103,8 @@ void generate_abyss()
if (you.char_direction == GDT_GAME_START)
{
grd[45][35] = DNGN_ALTAR_LUGONU;
- _place_feature_near( coord_def(45, 35), LOS_RADIUS,
- DNGN_FLOOR, DNGN_EXIT_ABYSS, 50 );
+ _place_feature_near( coord_def(45, 35), LOS_RADIUS + 2,
+ DNGN_FLOOR, DNGN_EXIT_ABYSS, 50, true );
}
else
{
@@ -228,7 +234,7 @@ static void _generate_area(int gx1, int gy1, int gx2, int gy2,
thing_created = items(1, OBJ_MISCELLANY,
MISC_RUNE_OF_ZOT, true, 51, 51);
placed_abyssal_rune = true;
-#if DEBUG_ABYSS
+#ifdef DEBUG_ABYSS
mpr("Placing an Abyssal rune.", MSGCH_DIAGNOSTICS);
#endif
}
@@ -274,7 +280,7 @@ static void _generate_area(int gx1, int gy1, int gx2, int gy2,
{
grd[i][j] = DNGN_EXIT_ABYSS;
exits_wanted--;
-#if DEBUG_ABYSS
+#ifdef DEBUG_ABYSS
mpr("Placing Abyss exit.", MSGCH_DIAGNOSTICS);
#endif
}
@@ -303,7 +309,7 @@ static void _generate_area(int gx1, int gy1, int gx2, int gy2,
grd[i][j] = DNGN_ALTAR_LUGONU;
altars_wanted--;
-#if DEBUG_ABYSS
+#ifdef DEBUG_ABYSS
mpr("Placing altar.", MSGCH_DIAGNOSTICS);
#endif
}
@@ -423,7 +429,7 @@ static void _abyss_lose_monster(monsters &mons)
void area_shift(void)
/*******************/
{
-#if DEBUG_ABYSS
+#ifdef DEBUG_ABYSS
mpr("area_shift().", MSGCH_DIAGNOSTICS);
#endif
@@ -576,7 +582,7 @@ void abyss_teleport( bool new_area )
if (i < 100)
{
-#if DEBUG_ABYSS
+#ifdef DEBUG_ABYSS
mpr("Non-new area Abyss teleport.", MSGCH_DIAGNOSTICS);
#endif
you.moveto(x, y);
@@ -585,7 +591,7 @@ void abyss_teleport( bool new_area )
}
}
-#if DEBUG_ABYSS
+#ifdef DEBUG_ABYSS
mpr("New area Abyss teleport.", MSGCH_DIAGNOSTICS);
#endif
@@ -593,12 +599,13 @@ void abyss_teleport( bool new_area )
// Get new monsters and colours.
init_pandemonium();
+#ifdef USE_TILE
+ tile_init_flavor();
+#endif
for (i = 0; i < MAX_MONSTERS; ++i)
- {
if (menv[i].alive())
_abyss_lose_monster(menv[i]);
- }
// Orbs and fixed artefacts are marked as "lost in the abyss".
for (k = 0; k < MAX_ITEMS; ++k)
@@ -629,6 +636,11 @@ void abyss_teleport( bool new_area )
_generate_area(MAPGEN_BORDER, MAPGEN_BORDER,
GXM - MAPGEN_BORDER, GYM - MAPGEN_BORDER, true);
+#ifdef USE_TILE
+ // Update the wall colours.
+ TileLoadWall(true);
+#endif
+
_xom_check_nearness();
grd[you.x_pos][you.y_pos] = DNGN_FLOOR;