summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-18 09:40:53 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-18 09:40:53 +0000
commite2cbc98a162d37386b3191ccf16c0d64ad7bb1b2 (patch)
tree3c3fc7e3c9e0cf7bfaded82101d233492dac2216 /crawl-ref/source/player.cc
parent8f675841ee07a21138fe098204f46018d28ea3b5 (diff)
downloadcrawl-ref-e2cbc98a162d37386b3191ccf16c0d64ad7bb1b2.tar.gz
crawl-ref-e2cbc98a162d37386b3191ccf16c0d64ad7bb1b2.zip
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
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc20
1 files changed, 11 insertions, 9 deletions
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);
}