summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-02 07:25:05 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-02 07:25:05 +0000
commit94096b6785bedb7d82f63e0969400026e2f19965 (patch)
treeb8834b01fcd0db1e77e5b3c81b7ad8bdd0de18b1 /crawl-ref/source/beam.cc
parentb153e8bfc653f4ac0e28cfe7901d3f32006b06e9 (diff)
downloadcrawl-ref-94096b6785bedb7d82f63e0969400026e2f19965.tar.gz
crawl-ref-94096b6785bedb7d82f63e0969400026e2f19965.zip
Xom is stimulated/amused if a harmful beam ricochets and hits the originator
of the beam. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2294 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 486b27f959..14e42d849a 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3346,7 +3346,12 @@ static int affect_player( bolt &beam )
if (beam.attitude != ATT_HOSTILE)
{
beam.fr_hurt++;
- xom_is_stimulated(128);
+ if (beam.beam_source == NON_MONSTER)
+ // Beam from player rebounded and hit player
+ xom_is_stimulated(255);
+ else
+ // Beam from an ally
+ xom_is_stimulated(128);
}
else
beam.foe_hurt++;
@@ -3503,9 +3508,12 @@ static int affect_player( bolt &beam )
{
beam.fr_hurt++;
+ // Beam from player rebounded and hit player
+ if (beam.beam_source == NON_MONSTER)
+ xom_is_stimulated(255);
// Xom's ammusement at the player being damaged is handled
// elsewhere.
- if (was_affected)
+ else if (was_affected)
xom_is_stimulated(128);
}
else
@@ -3557,7 +3565,14 @@ static void update_hurt_or_helped(bolt &beam, monsters *mon)
else
{
if (nasty_beam(mon, beam))
+ {
beam.fr_hurt++;
+
+ // Harmful beam from this monster rebounded and hit the monster
+ int midx = (int) monster_index(mon);
+ if (midx == beam.beam_source)
+ xom_is_stimulated(128);
+ }
else if (nice_beam(mon, beam))
beam.fr_helped++;
}