summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dat/clua
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-24 03:16:45 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-24 03:19:36 -0800
commit6a454cd127ee5cbae32c9ed9e9fe35218c179379 (patch)
treea18fd711c1df15d46498511eb32050c0ad7e8f36 /crawl-ref/source/dat/clua
parentabc9ebbd1bff0f3916cd7ff36e7cbd119050407f (diff)
downloadcrawl-ref-6a454cd127ee5cbae32c9ed9e9fe35218c179379.tar.gz
crawl-ref-6a454cd127ee5cbae32c9ed9e9fe35218c179379.zip
Debugging functions to call from &^T
Currently only holds "debug_wrath()". After pressing "&^T", etner "debug_wrath()" to repeatedly throw divine wrath the player, without the player dying; stops when any key is pressed.
Diffstat (limited to 'crawl-ref/source/dat/clua')
-rw-r--r--crawl-ref/source/dat/clua/debug.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/crawl-ref/source/dat/clua/debug.lua b/crawl-ref/source/dat/clua/debug.lua
new file mode 100644
index 0000000000..e5de91d930
--- /dev/null
+++ b/crawl-ref/source/dat/clua/debug.lua
@@ -0,0 +1,29 @@
+------------------------------------------------------------------------------
+-- debug.lua
+-- Debugging functions to call from the wizard lua interpreter.
+------------------------------------------------------------------------------
+
+require('clua/userbase.lua')
+
+function debug_wrath()
+ debug.never_die(true)
+
+ while crawl.kbhit() == 0 do
+ -- Remove non-near monsters if menv[] full.
+ debug.cull_monsters()
+
+ -- Dismiss adjacent monsters to make room for wrath sending in
+ -- more monsters.
+ debug.dismiss_adjacent()
+
+ -- Draw the wrath card
+ crawl.process_keys("&cwrath\r")
+
+ -- Redraw screen.
+ crawl.redraw_view()
+ crawl.redraw_stats()
+ end
+
+ crawl.flush_input()
+ debug.never_die(false)
+end