metal walls closest to the minotaur vault.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1620 c06c8d41-db1a-0410-9941-cceddc491573
R5JKQLY5QE6UBG3RH3Y5ZRSX6H35CHYI2HYNDZF6ZHVRULUORXBQC JYCMD6WMNHXA53K4LLKVTNX6PLRLU25F6J2TYMPQXM2ENAE66NIAC ITUTGFJ56GR7FWMC5Y7XKUJJ4Z35I6BMOHCPCW3W5MKDQGVOGM4AC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC RISMOCQM6BKK4XSIRKYLOBB2UPDYJNDAL6OGIIR5GGNZQAK5YSZAC SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC GVCGKTH5IJ4VSQEIN4CRC7ZFVZW26JPIYNCPTO7GY66CSZZEW3ZQC MSQI3TH6T62JAXQGLL52QZCWAMC372TGB6ZNNRDGUGMJKBNNV2VAC KCHX2F3JFEWOZT3WMJVZAAQUU2QSZ5Q7RDCD7WUJ7VE65J52JFUQC 56C44YMFHZ62GXAAOLYSLLGBVGRWXB53W2VI37Q26ZECEK2XG5SQC OY7KHQPESOUHPBXRZ2JSNUKPAC7DCDY73TAUHCSJG5V6TPAHBVYQC KFULGQQOHWUTXOM3BXCCYPGGVGGY4Z6265XUFRCBPNLTZAEHJZSQC }}}static void change_walls_from_centre(const dgn_region ®ion,const coord_def ¢re,bool rectangular,const dgn_region_list &forbidden,dungeon_feature_type wall,const std::vector<dist_feat> &ldist){if (ldist.empty())return;const coord_def &end = region.pos + region.size;for (int y = region.pos.y; y < end.y; ++y){for (int x = region.pos.x; x < end.x; ++x){const coord_def c(x, y);if (grd(c) != wall || !unforbidden(c, forbidden))continue;const int distance =rectangular? (c - centre).rdist() : (c - centre).abs();for (int i = 0, size = ldist.size(); i < size; ++i){if (distance <= ldist[i].dist){grd(c) = ldist[i].feat;break;}}
}}// Called as:// change_walls_from_centre( region_affected, centre, rectangular, wall,// dist1, feat1, dist2, feat2, ..., 0 )// What it does:// Examines each square in region_affected, calculates its distance from// "centre" (the centre need not be in region_affected). If the distance is// less than or equal to dist1, and the feature == wall, then it is replaced// by feat1. Otherwise, if the distance <= dist2 and feature == wall, it is// replaced by feat2, and so on. A distance of 0 indicates the end of the// list of distances.//static void change_walls_from_centre(const dgn_region ®ion,const coord_def &c,bool rectangular,const dgn_region_list &forbidden,dungeon_feature_type wall,...){std::vector<dist_feat> ldist;va_list args;va_start(args, wall);while (true){const int dist = va_arg(args, int);if (!dist)break;const dungeon_feature_type feat =static_cast<dungeon_feature_type>( va_arg(args, int) );ldist.push_back(dist_feat(dist, feat));
// turn rock walls into undiggable stone or metal:dungeon_feature_type wall_xform =((random2(50) > 10) ? DNGN_STONE_WALL // 78.0%: DNGN_METAL_WALL); // 22.0%dgn_region_list vaults;vaults.push_back(dgn_region(place.x, place.y, place.width, place.height));
change_walls_from_centre(lab, end, false, vaults, DNGN_ROCK_WALL,15 * 15, DNGN_METAL_WALL,34 * 34, DNGN_STONE_WALL,0);
replace_area(0, 0, GXM - 1, GYM - 1, DNGN_ROCK_WALL, wall_xform, vaults);
// turn rock walls into undiggable stone or metal:// dungeon_feature_type wall_xform =// ((random2(50) > 10) ? DNGN_STONE_WALL // 78.0%// : DNGN_METAL_WALL); // 22.0%//replace_area(0, 0, GXM - 1, GYM - 1, DNGN_ROCK_WALL, wall_xform, vaults);