From 62ba7977a2d7085a7ee0232fa317293c878f9365 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Thu, 27 Nov 2008 13:29:07 +0000 Subject: Giant spores and lightning balls exploding is now handled immediately inside of monster_die(), removing the need to ever check for "monster is dead but still present because it's about to explode". It also lets you get the credit (and blame) for any monsters the explosion hits if you attacking it triggered the explosion. While I was at it I made the death-cause display show if death from spore/ball explosion was due to an explosion triggered by the player or one of the player's pets. Also made it so that when similacrums and fire vortices are banished or wizard-command-genocided that they don't leave behind a freezing/burning cloud. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7653 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/beam.cc') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 04720fe360..cd600a3ba6 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3219,18 +3219,26 @@ static void _affect_place_explosion_clouds(bolt &beam, const coord_def& p) // A little helper function to handle the calling of ouch()... static void _beam_ouch(int dam, bolt &beam) { + monsters *monst = NULL; + if (!invalid_monster_index(beam.beam_source) + && menv[beam.beam_source].type != -1) + { + monst = &menv[beam.beam_source]; + } + // The order of this is important. - if (YOU_KILL(beam.thrower) && beam.aux_source.empty()) + if (monst && (monst->type == MONS_GIANT_SPORE + || monst->type == MONS_BALL_LIGHTNING)) + { + ouch(dam, beam.beam_source, KILLED_BY_SPORE, + beam.aux_source.c_str()); + } + else if (YOU_KILL(beam.thrower) && beam.aux_source.empty()) ouch(dam, NON_MONSTER, KILLED_BY_TARGETTING); else if (MON_KILL(beam.thrower)) { - if (beam.flavour == BEAM_SPORE) - ouch(dam, beam.beam_source, KILLED_BY_SPORE); - else - { - ouch(dam, beam.beam_source, KILLED_BY_BEAM, - beam.aux_source.c_str()); - } + ouch(dam, beam.beam_source, KILLED_BY_BEAM, + beam.aux_source.c_str()); } else // KILL_MISC || (YOU_KILL && aux_source) { -- cgit v1.2.3-54-g00ecf