From e2cbc98a162d37386b3191ccf16c0d64ad7bb1b2 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 18 May 2008 09:40:53 +0000 Subject: Pull code from mon->can_see(target) into a new function mon->see_grid() and use it in the checks for monster/monster visibility. I didn't have the time to test it but it should at least solve part of the problem of monsters firing through walls (if monster visibility is even checked there, which I don't know). Also (as usually), more code cleanup. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5117 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index b76c36349c..7fdcf0a035 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -4931,8 +4931,8 @@ bool poison_player( int amount, bool force ) if (you.duration[DUR_POISONING] > old_value) { - // XXX: which message channel for this message? - mprf("You are %spoisoned.", (old_value > 0) ? "more " : "" ); + mprf(MSGCH_WARN, "You are %spoisoned.", + (old_value > 0) ? "more " : "" ); learned_something_new(TUT_YOU_POISON); } return true; @@ -4975,9 +4975,9 @@ bool confuse_player( int amount, bool resistable ) if (you.duration[DUR_CONF] > old_value) { - // XXX: which message channel for this message? you.check_awaken(500); - mprf("You are %sconfused.", (old_value > 0) ? "more " : "" ); + mprf(MSGCH_WARN, "You are %sconfused.", + (old_value > 0) ? "more " : "" ); learned_something_new(TUT_YOU_ENCHANTED); xom_is_stimulated(you.duration[DUR_CONF] - old_value); @@ -5950,9 +5950,9 @@ void player::attacking(actor *other) pet_target = monster_index(mons); } - if (mutation[MUT_BERSERK] && - (random2(100) < (mutation[MUT_BERSERK] * 10) - 5) - || _equipment_make_berserk()) + if (mutation[MUT_BERSERK] + && (random2(100) < (mutation[MUT_BERSERK] * 10) - 5) + || _equipment_make_berserk()) { go_berserk(false); } @@ -5982,15 +5982,17 @@ bool player::can_go_berserk(bool verbose) const { if (verbose) mpr("You're too exhausted to go berserk."); + // or else they won't notice -- no message here return (false); } - if (you.is_undead && - (you.species != SP_VAMPIRE || you.hunger_state <= HS_SATIATED)) + if (you.is_undead + && (you.is_undead != US_SEMI_UNDEAD || you.hunger_state <= HS_SATIATED)) { if (verbose) mpr("You cannot raise a blood rage in your lifeless body."); + // or else you won't notice -- no message here return (false); } -- cgit v1.2.3-54-g00ecf