diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-24 01:00:14 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-24 03:19:36 -0800 |
commit | 2805b3beebfd7913794a412cc5a2d68042051257 (patch) | |
tree | db1ae39d931770bcee89ed11f1f4c9d25a634451 /crawl-ref/source/l_debug.cc | |
parent | 6ca662b8cced71f9eb5938519540cd9aa2207c09 (diff) | |
download | crawl-ref-2805b3beebfd7913794a412cc5a2d68042051257.tar.gz crawl-ref-2805b3beebfd7913794a412cc5a2d68042051257.zip |
you.never_die (player::never_die)
If the macros DEBUG or WIZARD are defined, then class player will have
the member never_die, which if set to true makes any deadly calls to
ouch() return without the game ending.
Diffstat (limited to 'crawl-ref/source/l_debug.cc')
-rw-r--r-- | crawl-ref/source/l_debug.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crawl-ref/source/l_debug.cc b/crawl-ref/source/l_debug.cc index 1e961152fa..defa56bdbc 100644 --- a/crawl-ref/source/l_debug.cc +++ b/crawl-ref/source/l_debug.cc @@ -107,6 +107,22 @@ LUAFN(debug_bouncy_beam) return (0); } +LUAFN(debug_never_die) +{ +#if WIZARD || DEBUG + if (lua_isnone(ls, 1)) + { + luaL_argerror(ls, 1, "needs a boolean argument"); + return (0); + } + you.never_die = lua_toboolean(ls, 1); +#else + luaL_error(ls, "only works if DEBUG or WIZARD is defined"); +#endif + + return (0); +} + const struct luaL_reg debug_dlib[] = { { "goto_place", debug_goto_place }, @@ -115,6 +131,7 @@ const struct luaL_reg debug_dlib[] = { "dump_map", debug_dump_map }, { "test_explore", _debug_test_explore }, { "bouncy_beam", debug_bouncy_beam }, +{ "never_die", debug_never_die }, { NULL, NULL } }; |