From 550af32eec0e42c1c8e3228221914934d20c3244 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sat, 14 Nov 2009 19:03:54 +1000 Subject: Allow portal vaults to specify fill and border glyph. Also move dungeon_feature_by_name into terrain.cc, as it does not make sense it being in l_dgngrd.cc. The Lua function "set_border_fill_type(feature)" will replace the default DNGN_ROCK_WALL fill of a portal vault with the specified feature. This could be abused, and should probably only be limited to floor, water and sea, different types of walls, trees and lava; there are no sanity checks for endless traps, statues, stairs, etc. Finally, apply this to the island Trove, giving endless water effect. --- crawl-ref/source/l_dgn.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'crawl-ref/source/l_dgn.cc') diff --git a/crawl-ref/source/l_dgn.cc b/crawl-ref/source/l_dgn.cc index 86fee24781..39a12b9051 100644 --- a/crawl-ref/source/l_dgn.cc +++ b/crawl-ref/source/l_dgn.cc @@ -896,6 +896,21 @@ static int lua_dgn_set_lt_callback(lua_State *ls) return (0); } +static int lua_dgn_set_border_fill_type (lua_State *ls) +{ + MAP(ls, 1, map); + if (lua_gettop(ls) != 2) + luaL_error(ls, "set_border_fill_type requires a feature."); + + dungeon_feature_type fill_type = + dungeon_feature_by_name(luaL_checkstring(ls, 2)); + + if (fill_type != DNGN_UNSEEN) + map->border_fill_type = fill_type; + + return (0); +} + static int dgn_fixup_stairs(lua_State *ls) { const dungeon_feature_type up_feat = @@ -1612,6 +1627,7 @@ const struct luaL_reg dgn_dlib[] = { "change_floor_colour", dgn_change_floor_colour }, { "change_rock_colour", dgn_change_rock_colour }, { "set_lt_callback", lua_dgn_set_lt_callback }, +{ "set_border_fill_type", lua_dgn_set_border_fill_type }, { "fixup_stairs", dgn_fixup_stairs }, { "floor_halo", dgn_floor_halo }, { "random_walk", dgn_random_walk }, -- cgit v1.2.3-54-g00ecf