summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authormtitus_613 <mtitus_613@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-06 20:10:31 +0000
committermtitus_613 <mtitus_613@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-06 20:10:31 +0000
commit2b214aa07350746941caddf337ab4cd5bc82203d (patch)
tree474cfa4a3076878ed6ecc5d7c984cd50587ebb20 /crawl-ref/source/player.cc
parentbd1d91f4b91afaf8dd80c329c78b775f43382b87 (diff)
downloadcrawl-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/player.cc')
-rw-r--r--crawl-ref/source/player.cc6
1 files changed, 6 insertions, 0 deletions
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;