summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells1.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-11-03 16:30:34 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-11-03 16:30:34 +0100
commit2cba7ec21c6dab38df61ee06c5dacc78c0b218c7 (patch)
tree4766f1552c31e1da45975299e4c2ea4fa3d5383e /crawl-ref/source/spells1.cc
parent41e35978a7f48612ef9d8017379f8b2536739e43 (diff)
downloadcrawl-ref-2cba7ec21c6dab38df61ee06c5dacc78c0b218c7.tar.gz
crawl-ref-2cba7ec21c6dab38df61ee06c5dacc78c0b218c7.zip
Make Chain Lightning a monster spell, add an user of it (Nikola).
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r--crawl-ref/source/spells1.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index 798b639003..0a304bc908 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -349,15 +349,15 @@ bool _lightning_los(const coord_def& source, const coord_def& target)
return (exists_ray(source, target, opc_solid, bds_maxlos));
}
-void cast_chain_lightning(int pow)
+void cast_chain_lightning(int pow, const actor *caster)
{
bolt beam;
// initialise beam structure
beam.name = "lightning arc";
beam.aux_source = "chain lightning";
- beam.beam_source = MHITYOU;
- beam.thrower = KILL_YOU_MISSILE;
+ beam.beam_source = caster->mindex();
+ beam.thrower = (caster == &you) ? KILL_YOU_MISSILE : KILL_MON_MISSILE;
beam.range = 8;
beam.hit = AUTOMATIC_HIT;
beam.type = dchar_glyph(DCHAR_FIRED_ZAP);
@@ -369,7 +369,7 @@ void cast_chain_lightning(int pow)
coord_def source, target;
- for (source = you.pos(); pow > 0; pow -= 8 + random2(13), source = target)
+ for (source = caster->pos(); pow > 0; pow -= 8 + random2(13), source = target)
{
// infinity as far as this spell is concerned
// (Range - 1) is used because the distance is randomised and
@@ -477,8 +477,8 @@ void cast_chain_lightning(int pow)
beam.colour = LIGHTBLUE;
beam.damage = calc_dice(5, 12 + pow * 2 / 3);
- // Be kinder to the player.
- if (target == you.pos())
+ // Be kinder to the caster.
+ if (target == caster->pos())
{
if (!(beam.damage.num /= 2))
beam.damage.num = 1;