summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_debug.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-24 01:00:14 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-24 03:19:36 -0800
commit2805b3beebfd7913794a412cc5a2d68042051257 (patch)
treedb1ae39d931770bcee89ed11f1f4c9d25a634451 /crawl-ref/source/l_debug.cc
parent6ca662b8cced71f9eb5938519540cd9aa2207c09 (diff)
downloadcrawl-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.cc17
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 }
};