diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-27 13:29:07 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-27 13:29:07 +0000 |
commit | 62ba7977a2d7085a7ee0232fa317293c878f9365 (patch) | |
tree | 172223027970cb8d574af7947e8b6eaa63c493da /crawl-ref/source/beam.cc | |
parent | 0566854703cbf6aef6623f44fde4bd5becb16854 (diff) | |
download | crawl-ref-62ba7977a2d7085a7ee0232fa317293c878f9365.tar.gz crawl-ref-62ba7977a2d7085a7ee0232fa317293c878f9365.zip |
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
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r-- | crawl-ref/source/beam.cc | 24 |
1 files changed, 16 insertions, 8 deletions
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) { |