diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-25 17:13:42 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-25 17:13:42 +0000 |
commit | 447aafdcc3aff11d1c3a30965077cddb8001b4e8 (patch) | |
tree | 4d4cd671091c03bc909d194f557d7bc0edc42d40 /crawl-ref/source/effects.cc | |
parent | 1bb43d66dd5614be3b29c8f827363ef30ec56e44 (diff) | |
download | crawl-ref-447aafdcc3aff11d1c3a30965077cddb8001b4e8.tar.gz crawl-ref-447aafdcc3aff11d1c3a30965077cddb8001b4e8.zip |
Consolidate the two immolation routines (the scroll and the effect when
affixing a fire brand) into one function.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7615 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r-- | crawl-ref/source/effects.cc | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 43a035a98e..8b6688ec85 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -264,9 +264,47 @@ int torment(int caster, const coord_def& where) return apply_area_within_radius(torment_monsters, where, 0, 8, caster); } +void immolation(int caster, bool known) +{ + const char *aux = "immolation"; + + if (caster < 0) + { + switch (caster) + { + case IMMOLATION_SCROLL: + aux = "scroll of immolation"; + break; + + case IMMOLATION_SPELL: + aux = "a fiery explosion"; + break; + } + + caster = IMMOLATION_GENERIC; + } + + bolt beam; + beam.flavour = BEAM_FIRE; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); + beam.damage = dice_def(3, 10); + beam.target = you.pos(); + beam.name = "fiery explosion"; + beam.colour = RED; + beam.thrower = (caster == IMMOLATION_GENERIC) ? KILL_MISC : KILL_YOU; + beam.aux_source = aux; + beam.ex_size = 2; + beam.is_tracer = false; + beam.is_explosion = true; + beam.effect_known = known; + + explosion(beam, false, false, true, true, true, + caster != IMMOLATION_SCROLL); +} + static std::string _who_banished(const std::string &who) { - return (who.empty()? who : " (" + who + ")"); + return (who.empty() ? who : " (" + who + ")"); } void banished(dungeon_feature_type gate_type, const std::string &who) |