From 94096b6785bedb7d82f63e0969400026e2f19965 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Tue, 2 Oct 2007 07:25:05 +0000 Subject: 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 --- crawl-ref/source/beam.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/beam.cc') 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++; } -- cgit v1.2.3-54-g00ecf