From 2b214aa07350746941caddf337ab4cd5bc82203d Mon Sep 17 00:00:00 2001 From: mtitus_613 Date: Tue, 6 Mar 2007 20:10:31 +0000 Subject: 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 --- crawl-ref/source/player.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 08a4d1cd98..1cf91f9dd8 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -3790,6 +3790,12 @@ void dec_mp(int mp_loss) if (you.magic_points < 0) you.magic_points = 0; + if (you.magic_points > 0 && Options.magic_point_warning + && you.magic_points <= (you.max_magic_points * Options.magic_point_warning) / 100) + { + mpr( "* * * LOW MAGIC WARNING * * *", MSGCH_DANGER_MAGIC ); + } + take_note(Note(NOTE_MP_CHANGE, you.magic_points, you.max_magic_points)); you.redraw_magic_points = 1; -- cgit v1.2.3-54-g00ecf