summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-28 22:23:03 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-28 22:23:03 +0000
commit4033ebc58ba40784a7ef241edc17fd3e940c23e2 (patch)
treeabb1a6e24d52d7322a02f83dee1c309058ac05e3 /crawl-ref/source/beam.cc
parentfc09d2de4c77399a6562507ad99c394d93c5cee9 (diff)
downloadcrawl-ref-4033ebc58ba40784a7ef241edc17fd3e940c23e2.tar.gz
crawl-ref-4033ebc58ba40784a7ef241edc17fd3e940c23e2.zip
In response to BR 2005224 (TSO penance from shooting unseen underwater
enemies) use player_visible_monster() as parameter known when setting conducts in beam.cc, so the player isn't punished for attacking monsters he didn't know were there, or if he did, had no idea about their current behaviour (fleeing perhaps?) Might be too nice, again, but I think it's okay. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6190 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 160113b9dd..f3c6a68ea5 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -4386,7 +4386,7 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item)
remove_sanctuary(true);
}
- set_attack_conducts(conducts, mon);
+ set_attack_conducts(conducts, mon, player_monster_visible(mon));
if (you.religion == GOD_BEOGH
&& mons_species(mon->type) == MONS_ORC
@@ -4562,9 +4562,12 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item)
{
if (YOU_KILL(beam.thrower) && hurt_final > 0)
{
+ // It's not the player's fault if he didn't see the monster or
+ // the monster was caught in an unexpected blast of ?immolation.
const bool okay =
- (beam.aux_source == "reading a scroll of immolation"
- && !beam.effect_known);
+ (!player_monster_visible(mon)
+ || beam.aux_source == "reading a scroll of immolation"
+ && !beam.effect_known);
if (is_sanctuary(mon->x, mon->y)
|| is_sanctuary(you.x_pos, you.y_pos))