diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-27 14:52:31 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-27 14:58:10 +1000 |
commit | 5194ce66d60829d7658eaf7c4e570bb88077d326 (patch) | |
tree | 9b44313f7b0cbfaa0b4d9512189867ba1fb36a1f /crawl-ref/source/dlua.cc | |
parent | 74685cd97420cc5c40d83cc1ea688863c4dd1751 (diff) | |
download | crawl-ref-5194ce66d60829d7658eaf7c4e570bb88077d326.tar.gz crawl-ref-5194ce66d60829d7658eaf7c4e570bb88077d326.zip |
New Lua library: feat.
Provides wrappers for all of the feat_is_XXX functions from terrain.cc,
as well as a few other functions. Also provides a macro which can wrap a
function to take:
* a set of co-ordinates (parsed with grd(coord_def(x, y)))
* a string (parsed with dungeon_feature_by_name)
* an integer (cast into dungeon_feature_type, can be fetched from
dgn.grid(x, y))
All of the feat library functions can be used in this manner. For
example:
* feat.is_wall(x, y)
* feat.is_wall(dgn.grid(x, y))
* feat.is_wall(7)
* feat.is_wall("rock_wall")
Diffstat (limited to 'crawl-ref/source/dlua.cc')
-rw-r--r-- | crawl-ref/source/dlua.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/dlua.cc b/crawl-ref/source/dlua.cc index 256f3210bf..12e3da2860 100644 --- a/crawl-ref/source/dlua.cc +++ b/crawl-ref/source/dlua.cc @@ -282,6 +282,7 @@ void init_dungeon_lua() luaL_openlib(dlua, "dgn", dgn_level_dlib, 0); luaL_openlib(dlua, "dgn", dgn_mons_dlib, 0); luaL_openlib(dlua, "dgn", dgn_tile_dlib, 0); + luaL_openlib(dlua, "feat", feat_dlib, 0); luaL_openlib(dlua, "debug", debug_dlib, 0); luaL_openlib(dlua, "los", los_dlib, 0); |