summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-clouds.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2013-03-17 18:37:51 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2013-03-17 20:58:18 -0600
commit05cedd831912eda9ab8e8d68f9d4964dcd6cd747 (patch)
tree75947a591457143a86a1b14804e894870493fb74 /crawl-ref/source/spl-clouds.cc
parentd69e7a188639c39615e2d0b538ac1e61b193ed6f (diff)
downloadcrawl-ref-05cedd831912eda9ab8e8d68f9d4964dcd6cd747.tar.gz
crawl-ref-05cedd831912eda9ab8e8d68f9d4964dcd6cd747.zip
Tracers for cloud spells for both players (#2491) and monsters.
This updates the beam code to check for the impact of a cloud forming at the beam's endpoint, and updates the player implementations of the cloud spells to fire a tracer cloud at that endpoint; thus players will be warned for targetting themself and/or allies, and monsters will take allies into consideration when using cloud spells.
Diffstat (limited to 'crawl-ref/source/spl-clouds.cc')
-rw-r--r--crawl-ref/source/spl-clouds.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/crawl-ref/source/spl-clouds.cc b/crawl-ref/source/spl-clouds.cc
index de14fa00d3..7c218ef543 100644
--- a/crawl-ref/source/spl-clouds.cc
+++ b/crawl-ref/source/spl-clouds.cc
@@ -182,6 +182,37 @@ spret_type cast_big_c(int pow, cloud_type cty, const actor *caster, bolt &beam,
return SPRET_ABORT;
}
+ //XXX: there should be a better way to specify beam cloud types
+ switch(cty)
+ {
+ case CLOUD_POISON:
+ beam.flavour = BEAM_POISON;
+ beam.name = "blast of poison";
+ break;
+ case CLOUD_HOLY_FLAMES:
+ beam.flavour = BEAM_HOLY;
+ beam.origin_spell = SPELL_HOLY_BREATH;
+ break;
+ case CLOUD_COLD:
+ beam.flavour = BEAM_COLD;
+ beam.name = "freezing blast";
+ break;
+ default:
+ mpr("That kind of cloud doesn't exist!");
+ return SPRET_ABORT;
+ }
+
+ beam.thrower = KILL_YOU;
+ beam.hit = AUTOMATIC_HIT;
+ beam.damage = INSTANT_DEATH; // just a convenient non-zero
+ beam.is_big_cloud = true;
+ beam.is_tracer = true;
+ beam.use_target_as_pos = true;
+ beam.affect_endpoint();
+ if (beam.beam_cancelled)
+ return SPRET_ABORT;
+
+
fail_check();
big_cloud(cty, caster, beam.target, pow, 8 + random2(3), -1);