summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_dgntil.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2010-01-30 19:52:47 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2010-01-30 19:59:57 +1000
commit39fb33df3a9a53eab2c161f699a5605a63737fa4 (patch)
treeae4948a8d00cb85968a3725fb1e95b2a7e5816f8 /crawl-ref/source/l_dgntil.cc
parent2f29aed707301de7569f91d2d54a27385554344a (diff)
downloadcrawl-ref-39fb33df3a9a53eab2c161f699a5605a63737fa4.tar.gz
crawl-ref-39fb33df3a9a53eab2c161f699a5605a63737fa4.zip
Framework for portal vault entries having tiles; Volcano tile (purge).
Unfortunately, just using tile("O = <xyz>") is not enough, as the tile won't go away when the portal is actually removed; I've added a new Lua function "tile_feat_changed", which specifically alters env.tile_flv(gc).feat, allowing you to change the override feature tile on-the-fly. Probably could do with tile_wall_changed and tile_floor_changed variants, but they aren't needed at the minute and I'm not sure I can see a use for them just yet. I've also altered the 1way stair (and timed stair marker variants) to accept a "floor_tile" as well as a "floor" parameter. If provided, this will be the string value that is passed to tile_feat_changed when the marker times out (or the player uses the stair). If not provided, it will default to no tile (using the default tile of whatever feature is provided in "floor"). Finally, use Purge's dark tunnel tile for Volcano entry. Thank you!
Diffstat (limited to 'crawl-ref/source/l_dgntil.cc')
-rw-r--r--crawl-ref/source/l_dgntil.cc28
1 files changed, 25 insertions, 3 deletions
diff --git a/crawl-ref/source/l_dgntil.cc b/crawl-ref/source/l_dgntil.cc
index 4e68e8d782..572a5953be 100644
--- a/crawl-ref/source/l_dgntil.cc
+++ b/crawl-ref/source/l_dgntil.cc
@@ -6,9 +6,11 @@
#include "AppHdr.h"
#include "cluautil.h"
+#include "libutil.h"
#include "l_libs.h"
#include "branch.h"
+#include "coord.h"
#include "mapdef.h"
#ifdef USE_TILE
@@ -136,7 +138,7 @@ LUAFN(dgn_ftile)
#ifdef USE_TILE
return dgn_map_add_transform(ls, &map_lines::add_floortile);
#else
- return 0;
+ return (0);
#endif
}
@@ -145,7 +147,7 @@ LUAFN(dgn_rtile)
#ifdef USE_TILE
return dgn_map_add_transform(ls, &map_lines::add_rocktile);
#else
- return 0;
+ return (0);
#endif
}
@@ -154,10 +156,29 @@ LUAFN(dgn_tile)
#ifdef USE_TILE
return dgn_map_add_transform(ls, &map_lines::add_spec_tile);
#else
- return 0;
+ return (0);
#endif
}
+LUAFN(dgn_tile_feat_changed)
+{
+#ifdef USE_TILE
+ COORDS(c, 1, 2);
+
+ if (lua_isnil(ls, 3))
+ {
+ env.tile_flv(c).feat = 0;
+ return (0);
+ }
+
+ unsigned short tile = get_tile_idx(ls, 3);
+ if (tile)
+ env.tile_flv(c).feat = tile;
+#endif
+
+ return (0);
+}
+
const struct luaL_reg dgn_tile_dlib[] =
{
{ "lrocktile", dgn_lrocktile },
@@ -169,6 +190,7 @@ const struct luaL_reg dgn_tile_dlib[] =
{ "change_floor_tile", dgn_change_floor_tile },
{ "lev_floortile", dgn_lev_floortile },
{ "lev_rocktile", dgn_lev_rocktile },
+{ "tile_feat_changed", dgn_tile_feat_changed },
{ NULL, NULL }
};