diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-31 19:52:18 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-31 19:52:18 +0000 |
commit | 6235210791fbc6a6b61d8d7975ab425a9e90e68a (patch) | |
tree | 2746db08081b793e1da0ca0b93f7f9ca6b245eb2 /crawl-ref/source/dungeon.cc | |
parent | 3846460d200480f3af4c345c4137f9bbee818b24 (diff) | |
download | crawl-ref-6235210791fbc6a6b61d8d7975ab425a9e90e68a.tar.gz crawl-ref-6235210791fbc6a6b61d8d7975ab425a9e90e68a.zip |
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
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r-- | crawl-ref/source/dungeon.cc | 29 |
1 files changed, 25 insertions, 4 deletions
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 + } + } } } |