From: <gi...@cr...> - 2012-06-28 20:08:10
|
via 0535df25186bbdd7f56777a74c36acc9b9b1a738 (commit) via dcbd244a42988aaf7f062f36152c212e6b0f13c0 (commit) from c8f20abad965617ace8cc3f75528733fd259ad4a (commit) ----------------------------------------------------------------------- commit 0535df25186bbdd7f56777a74c36acc9b9b1a738 Author: Adam Borowski <kil...@an...> Date: Thu Jun 28 22:01:20 2012 +0200 Autosave on a felid death, to make crash-scumming more risky. Bastards can just trigger a crash one turn earlier, but that's nowhere as reliable as crashing afterwards. commit dcbd244a42988aaf7f062f36152c212e6b0f13c0 Author: Adam Borowski <kil...@an...> Date: Thu Jun 28 17:31:24 2012 +0200 clua: crawl.hints_type() ----------------------------------------------------------------------- Summary of changes: crawl-ref/source/l_crawl.cc | 25 +++++++++++++++++++++++++ crawl-ref/source/ouch.cc | 4 ++++ 2 files changed, 29 insertions(+), 0 deletions(-) diff --git a/crawl-ref/source/l_crawl.cc b/crawl-ref/source/l_crawl.cc index 7f96a13..8c502b4 100644 --- a/crawl-ref/source/l_crawl.cc +++ b/crawl-ref/source/l_crawl.cc @@ -1020,6 +1020,30 @@ LUAFN(_crawl_set_max_runes) LUAWRAP(_crawl_mark_game_won, crawl_state.mark_last_game_won()) +LUAFN(crawl_hints_type) +{ + if (crawl_state.game_is_tutorial()) + lua_pushstring(ls, "tutorial"); + else if (!crawl_state.game_is_hints()) + lua_pushstring(ls, ""); + else + switch (Hints.hints_type) + { + case HINT_BERSERK_CHAR: + lua_pushstring(ls, "berserk"); + break; + case HINT_RANGER_CHAR: + lua_pushstring(ls, "ranger"); + break; + case HINT_MAGIC_CHAR: + lua_pushstring(ls, "magic"); + break; + default: + die("invalid hints_type"); + } + return 1; +} + static const struct luaL_reg crawl_dlib[] = { { "args", _crawl_args }, @@ -1036,6 +1060,7 @@ static const struct luaL_reg crawl_dlib[] = { "tutorial_skill", crawl_tutorial_skill }, { "tutorial_hint", crawl_tutorial_hint }, { "mark_game_won", _crawl_mark_game_won }, +{ "hints_type", crawl_hints_type }, { NULL, NULL } }; diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 18acc62..d80dfac 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -1344,6 +1344,10 @@ void ouch(int dam, int death_source, kill_method_type death_type, stop_delay(true); + // You wouldn't want to lose this accomplishment to a crash, would you? + // Especially if you manage to trigger one via lua somehow... + save_game(false); + mprnojoin("You die..."); xom_death_message((kill_method_type) se.get_death_type()); more(); -- Dungeon Crawl Stone Soup |