summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-19 21:59:56 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-19 21:59:56 +0000
commitf2e1abc584a801b0ebf3c595d63752f5eda7708b (patch)
tree5660c08bc834b0287238d4f5e5eba5d9d1e8c91f /crawl-ref/source/effects.cc
parent96edac1d649d50f9cfacf317c88007783657c55f (diff)
downloadcrawl-ref-f2e1abc584a801b0ebf3c595d63752f5eda7708b.tar.gz
crawl-ref-f2e1abc584a801b0ebf3c595d63752f5eda7708b.zip
Expand immolation and cleansing flame as well, so that monsters may be
able to use scrolls of immolation or holy word in the future. Also, add a power parameter to immolation, so that it can be reused for an exploding Tome of Destruction. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8599 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc58
1 files changed, 48 insertions, 10 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 5ffd192a96..e35c802bfa 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -290,7 +290,8 @@ 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)
+void immolation(int pow, int caster, coord_def where, bool known,
+ actor *attacker)
{
ASSERT(!crawl_state.arena);
@@ -309,27 +310,49 @@ void immolation(int caster, bool known)
case IMMOLATION_SPELL:
aux = "a fiery explosion";
break;
+
+ case IMMOLATION_TOME:
+ aux = "an exploding Tome of Destruction";
+ break;
}
}
beam.flavour = BEAM_FIRE;
beam.type = dchar_glyph(DCHAR_FIRED_BURST);
- beam.damage = dice_def(3, 10);
- beam.target = you.pos();
+ beam.damage = dice_def(3, pow);
+ beam.target = where;
beam.name = "fiery explosion";
beam.colour = RED;
- beam.beam_source = NON_MONSTER;
- beam.thrower = (caster == IMMOLATION_GENERIC) ? KILL_MISC : KILL_YOU;
beam.aux_source = aux;
beam.ex_size = 2;
beam.is_explosion = true;
beam.effect_known = known;
beam.affects_items = (caster != IMMOLATION_SCROLL);
+ const monsters *atk = (attacker->atype() == ACT_PLAYER ? NULL :
+ dynamic_cast<const monsters*>(attacker));
+
+ if (caster == IMMOLATION_GENERIC)
+ {
+ beam.thrower = KILL_MISC;
+ beam.beam_source = NON_MONSTER;
+ }
+ else if (attacker == NULL)
+ {
+ beam.thrower = KILL_YOU;
+ beam.beam_source = NON_MONSTER;
+ }
+ else
+ {
+ beam.thrower = KILL_MON;
+ beam.beam_source = monster_index(atk);
+ }
+
beam.explode();
}
-void cleansing_flame(int pow, int caster)
+void cleansing_flame(int pow, int caster, coord_def where,
+ actor *attacker)
{
ASSERT(!crawl_state.arena);
@@ -353,14 +376,29 @@ void cleansing_flame(int pow, int caster)
beam.target = you.pos();
beam.name = "golden flame";
beam.colour = YELLOW;
- beam.thrower = (caster == CLEANSING_FLAME_GENERIC
- || caster == CLEANSING_FLAME_TSO) ? KILL_MISC
- : KILL_YOU;
- beam.beam_source = NON_MONSTER;
beam.aux_source = aux;
beam.ex_size = 2;
beam.is_explosion = true;
+ const monsters *atk = (attacker->atype() == ACT_PLAYER ? NULL :
+ dynamic_cast<const monsters*>(attacker));
+
+ if (caster == CLEANSING_FLAME_GENERIC || caster == CLEANSING_FLAME_TSO)
+ {
+ beam.thrower = KILL_MISC;
+ beam.beam_source = NON_MONSTER;
+ }
+ else if (attacker == NULL)
+ {
+ beam.thrower = KILL_YOU;
+ beam.beam_source = NON_MONSTER;
+ }
+ else
+ {
+ beam.thrower = KILL_MON;
+ beam.beam_source = monster_index(atk);
+ }
+
beam.explode();
}