From 6235210791fbc6a6b61d8d7975ab425a9e90e68a Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 31 Mar 2008 19:52:18 +0000 Subject: Ha, I knew there was a reason to cleaning up dungeon.cc - learning by osmosis... :p Anyway, killing the royal jelly now turns all stone walls on the level into clear rock, together with a cute message. This currently only works if you actually kill it on the bottom level - other than the lua magic, which sets a marker to work no matter where you kill the jelly (I think). Still, it's better than nothing. Instead of introducing a wrapper function I probably should have made replace_area non-static, but I wasn't sure if there might be a better way to do this, and wanted to avoid having to change (and then possibly change back) all calls and their indenting. I would have changed the rune probability as well, but I wasn't entirely sure, how. If I had to guess, I'd say that changing P -> O on the branch map is the way to go. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3986 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/dungeon.cc | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/dungeon.cc') diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index f49b9b619e..3e7668874f 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -65,6 +65,7 @@ #include "stuff.h" #include "tags.h" #include "terrain.h" +#include "tiles.h" #include "traps.h" #include "travel.h" #include "view.h" @@ -120,7 +121,7 @@ static bool _make_box(int room_x1, int room_y1, int room_x2, int room_y2, static void _replace_area(int sx, int sy, int ex, int ey, dungeon_feature_type replace, dungeon_feature_type feature, - unsigned mmask = 0); + unsigned mmask = 0, bool needs_update = false); static builder_rc_type _builder_by_type(int level_number, char level_type); static builder_rc_type _builder_by_branch(int level_number); static builder_rc_type _builder_normal(int level_number, char level_type, @@ -1490,7 +1491,7 @@ static void _prepare_shoals(int level_number) if ( at_bottom ) { // Put all the stairs on one island - grd[centres[0].x][centres[0].y] = DNGN_STONE_STAIRS_UP_I; + grd[centres[0].x ][centres[0].y] = DNGN_STONE_STAIRS_UP_I; grd[centres[0].x+1][centres[0].y] = DNGN_STONE_STAIRS_UP_II; grd[centres[0].x-1][centres[0].y] = DNGN_STONE_STAIRS_UP_III; @@ -4675,7 +4676,7 @@ static int _vault_grid( vault_placement &place, } which_class = OBJ_MISCELLANY; - which_type = MISC_RUNE_OF_ZOT; + which_type = MISC_RUNE_OF_ZOT; num_runes++; if (you.level_type == LEVEL_PANDEMONIUM) @@ -4756,16 +4757,36 @@ static int _vault_grid( vault_placement &place, return (altar_count); } // end vault_grid() +// Currently only used for Slime: branch end +// where it will turn the stone walls into clear rock walls +// once the royal jelly has been killed. +void replace_area_wrapper(dungeon_feature_type old_feat, + dungeon_feature_type new_feat) +{ + ASSERT(old_feat != new_feat); + _replace_area(0, 0, GXM-1, GYM-1, old_feat, new_feat, 0, true); +} + static void _replace_area( int sx, int sy, int ex, int ey, dungeon_feature_type replace, - dungeon_feature_type feature, unsigned mapmask) + dungeon_feature_type feature, unsigned mapmask, + bool needs_update) { int x,y; for (x = sx; x <= ex; x++) for (y = sy; y <= ey; y++) { if (grd[x][y] == replace && unforbidden(coord_def(x, y), mapmask)) + { grd[x][y] = feature; + if ( needs_update && is_terrain_seen(coord_def(x,y)) ) + { + set_envmap_obj(x, y, feature); +#ifdef USE_TILE + tile_place_tile_bk(x, y, feature); +#endif + } + } } } -- cgit v1.2.3-54-g00ecf