From 2805b3beebfd7913794a412cc5a2d68042051257 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Tue, 24 Nov 2009 01:00:14 -0800 Subject: 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. --- crawl-ref/source/ouch.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crawl-ref/source/ouch.cc') diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index da61e3fc34..4698c7f506 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -1137,6 +1137,15 @@ void ouch(int dam, int death_source, kill_method_type death_type, death_type = KILLED_BY_XOM; } +#if WIZARD || DEBUG + if (you.never_die) + { + mpr("you.never_die set to true, avoiding death", + MSGCH_DIAGNOSTICS); + return; + } +#endif + // Construct scorefile entry. scorefile_entry se(dam, death_source, death_type, aux); -- cgit v1.2.3-54-g00ecf