diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-04-05 21:03:05 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-04-07 15:28:25 +0200 |
commit | bfa8fa32382c89259dbf4f9301b316b7e0239344 (patch) | |
tree | 9f28ea6c776acc2049af1fa7b12f45334ea5feff /src/lua_bind.c | |
parent | a77005060dac93cfdd5cdfdf7dc849e0f5207f60 (diff) |
Lua: Add functions to get GOD_* Lua variables from C code
Diffstat (limited to 'src/lua_bind.c')
-rw-r--r-- | src/lua_bind.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lua_bind.c b/src/lua_bind.c index 82b802f2..00a0e25b 100644 --- a/src/lua_bind.c +++ b/src/lua_bind.c @@ -608,6 +608,38 @@ void desc_god(int g_idx, int d, char *desc) strncpy(deity_info[g_idx].desc[d], desc, 79); } +static int get_god_theme(cptr name) +{ + if (game_module_idx == MODULE_THEME) + { + return exec_lua(format("return GOD_%s", name)); + } + else + { + return -1; + } +} + +s16b get_god_AULE() +{ + return get_god_theme("AULE"); +} + +s16b get_god_MANDOS() +{ + return get_god_theme("MANDOS"); +} + +s16b get_god_VARDA() +{ + return get_god_theme("VARDA"); +} + +s16b get_god_ULMO() +{ + return get_god_theme("ULMO"); +} + /* * Returns the direction of the compass that y2, x2 is from y, x * the return value will be one of the following: north, south, |