diff options
author | Vsevolod Kozlov <zaba@wybt.net> | 2011-03-16 20:31:32 +0300 |
---|---|---|
committer | Vsevolod Kozlov <zaba@wybt.net> | 2011-03-16 20:46:25 +0300 |
commit | 8181c35602f0dea09f2dcb505d8fb292d6880221 (patch) | |
tree | 16aa4975ca008acb842a34dd9d9c76c78c34fb3c /crawl-ref/source/l_dgnbld.cc | |
parent | 8f521e6de0e0c4d3a94df11c388a8e62d801097a (diff) | |
download | crawl-ref-8181c35602f0dea09f2dcb505d8fb292d6880221.tar.gz crawl-ref-8181c35602f0dea09f2dcb505d8fb292d6880221.zip |
Choose dungeon layouts by picking a vault with tag "layout".
This affects the distribution of the layouts in the game. The hell has broken
loose.
But the good thing is that one can now change their distribution by simply
adjusting the WEIGHT/DEPTH/CHANCE of the vaults in layout.des.
Areas that now require cleanup include _builder_by_type and the functions that
it calls (_pan_level in particular).
Diffstat (limited to 'crawl-ref/source/l_dgnbld.cc')
-rw-r--r-- | crawl-ref/source/l_dgnbld.cc | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/crawl-ref/source/l_dgnbld.cc b/crawl-ref/source/l_dgnbld.cc index 1ccba70a5e..acf2daa7a4 100644 --- a/crawl-ref/source/l_dgnbld.cc +++ b/crawl-ref/source/l_dgnbld.cc @@ -7,6 +7,9 @@ #include <cmath> +#include "dungeon.h" +#include "dgn-shoals.h" +#include "dgn-swamp.h" #include "cluautil.h" #include "coord.h" #include "coordit.h" @@ -889,6 +892,45 @@ static int dgn_width(lua_State *ls) PLUARET(number, lines.width()); } +LUAFN(dgn_layout_type) +{ + env.level_layout_types.insert(luaL_checkstring(ls, 2)); + return 0; +} + +/* Wrappers for C++ layouts, to facilitate choosing of layouts by weight and + * depth */ + +LUAFN(dgn_layout_basic) +{ + builder_basic(you.absdepth0); + return 0; +} + +LUAFN(dgn_layout_bigger_room) +{ + bigger_room(); + return 0; +} + +LUAFN(dgn_layout_plan_4) +{ + plan_4(NUM_FEATURES); + return 0; +} + +LUAFN(dgn_layout_shoals) +{ + dgn_build_shoals_level(you.absdepth0); + return 0; +} + +LUAFN(dgn_layout_swamp) +{ + dgn_build_swamp_level(you.absdepth0); + return 0; +} + const struct luaL_reg dgn_build_dlib[] = { { "count_feature_in_box", &dgn_count_feature_in_box }, @@ -917,6 +959,13 @@ const struct luaL_reg dgn_build_dlib[] = { "smear_map", &dgn_smear_map }, { "spotty_map", &dgn_spotty_map }, { "width", dgn_width }, + { "layout_type", &dgn_layout_type }, + + { "layout_basic", &dgn_layout_basic }, + { "layout_bigger_room", &dgn_layout_bigger_room }, + { "layout_plan_4", &dgn_layout_plan_4 }, + { "layout_shoals", &dgn_layout_shoals }, + { "layout_swamp", &dgn_layout_swamp }, { NULL, NULL } }; |