diff options
author | mtitus_613 <mtitus_613@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-06 20:10:31 +0000 |
---|---|---|
committer | mtitus_613 <mtitus_613@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-06 20:10:31 +0000 |
commit | 2b214aa07350746941caddf337ab4cd5bc82203d (patch) | |
tree | 474cfa4a3076878ed6ecc5d7c984cd50587ebb20 /crawl-ref/source/initfile.cc | |
parent | bd1d91f4b91afaf8dd80c329c78b775f43382b87 (diff) | |
download | crawl-ref-2b214aa07350746941caddf337ab4cd5bc82203d.tar.gz crawl-ref-2b214aa07350746941caddf337ab4cd5bc82203d.zip |
Add LOW MAGIC WARNING. This involved creating a channel, modifying init.txt, and the crawl_options.txt docs. Message will trigger when player's magic drops below the percentage set in init.txt (default 10%). Nice for making sure casters don't run around with low magic amounts.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@988 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r-- | crawl-ref/source/initfile.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 19296c5644..790bfbfcd5 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -148,7 +148,8 @@ static const std::string message_channel_names[ NUM_MESSAGE_CHANNELS ] = "plain", "prompt", "god", "pray", "duration", "danger", "warning", "food", "recovery", "sound", "talk", "intrinsic_gain", "mutation", "monster_spell", "monster_enchant", "monster_damage", "monster_target", - "rotten_meat", "equipment", "floor", "multiturn", "diagnostic", + "rotten_meat", "equipment", "floor", "multiturn", "diagnostic","tutorial", + "magic_warning", }; // returns -1 if unmatched else returns 0--(NUM_MESSAGE_CHANNELS-1) @@ -591,6 +592,7 @@ void game_options::reset_options() easy_confirm = CONFIRM_SAFE_EASY; easy_quit_item_prompts = true; hp_warning = 10; + magic_point_warning = 10; confirm_self_target = true; default_target = false; safe_autopickup = true; @@ -1672,6 +1674,16 @@ void game_options::read_option_line(const std::string &str, bool runscript) field.c_str() ); } } + else if (key == "mp_warning") + { + magic_point_warning = atoi( field.c_str() ); + if (magic_point_warning < 0 || magic_point_warning > 100) + { + magic_point_warning = 0; + fprintf( stderr, "Bad MP warning percentage -- %s\n", + field.c_str() ); + } + } else if (key == "ood_interesting") { ood_interesting = atoi( field.c_str() ); |