summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-damage.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-02-17 11:03:45 -0700
committerSteve Melenchuk <smelenchuk@gmail.com>2014-02-25 22:26:09 -0700
commitbfda3da51aaee884b17f1828b9c3c30042064e90 (patch)
tree907ea8905a1476399ad7f1cfb640cf0313f14016 /crawl-ref/source/spl-damage.cc
parent83eb72f014f1f7d467a9b883fd24879eeba70405 (diff)
downloadcrawl-ref-bfda3da51aaee884b17f1828b9c3c30042064e90.tar.gz
crawl-ref-bfda3da51aaee884b17f1828b9c3c30042064e90.zip
Glaciate.
Level 9 Conjuration/Ice; generates a cone-shaped great blast of ice around a specified target. The minimum range of the cone is 3, and the maximum is LOS at maximum spellpower; damage within a minimum-range cone is equivalent to Ice Storm, and falls off with the square of the distance for larger cones. Leaves freezing clouds over the affected area, like Ice Storm; they dissipate really quickly over large areas, though. Targets hit with Glaciate are flash-frozen; they are subject to slow movement for three turns. Targets killed with Glaciate have a 3/5 chance of becoming a block of ice (similar to a pillar of salt). Also contains a monster-castable version of the spell. Replaces Ice Storm; most of Ice Storm's code disappears (ZAP_ICE_STORM is TAG_MAJOR_VERSION == 34'd out). Go fight Lom Lobon to see the monster version. Large chunks of this either originate from a patch from Keanan Smith (Siegurt), seen at https://crawl.develz.org/mantis/view.php?id=7760, or from the following discussion on Tavern: https://crawl.develz.org/tavern/viewtopic.php?f=8&t=9854
Diffstat (limited to 'crawl-ref/source/spl-damage.cc')
-rw-r--r--crawl-ref/source/spl-damage.cc77
1 files changed, 77 insertions, 0 deletions
diff --git a/crawl-ref/source/spl-damage.cc b/crawl-ref/source/spl-damage.cc
index 6342ab2ad6..3fddc29c7a 100644
--- a/crawl-ref/source/spl-damage.cc
+++ b/crawl-ref/source/spl-damage.cc
@@ -2956,3 +2956,80 @@ void end_searing_ray()
you.props.erase("searing_ray_target");
you.props.erase("searing_ray_aimed_at_spot");
}
+
+spret_type cast_glaciate(actor *caster, int pow, coord_def aim, bool fail)
+{
+ targetter_cone hitfunc(caster, spell_range(SPELL_GLACIATE, pow));
+ hitfunc.set_aim(aim);
+ int range2 = 0;
+
+ if (caster->is_player())
+ {
+ if (stop_attack_prompt(hitfunc, "glaciate"))
+ return SPRET_ABORT;
+ }
+
+ fail_check();
+
+ if (you.can_see(caster) || caster->is_player())
+ {
+ mprf("%s %s a mighty blast of ice!",
+ caster->name(DESC_THE).c_str(),
+ caster->conj_verb("conjure").c_str());
+ }
+
+ bolt beam;
+ beam.name = "great icy blast";
+ beam.aux_source = "great icy blast";
+ beam.flavour = BEAM_ICE;
+ beam.glyph = dchar_glyph(DCHAR_EXPLOSION);
+ beam.colour = WHITE;
+ beam.range = 1;
+ beam.hit = AUTOMATIC_HIT;
+ beam.beam_source = caster->mindex();
+ beam.hit_verb = "engulfs";
+ beam.set_agent(caster);
+#ifdef USE_TILE
+ beam.tile_beam = -1;
+#endif
+ beam.draw_delay = 0;
+
+ for (map<coord_def, aff_type>::const_iterator p = hitfunc.zapped.begin();
+ p != hitfunc.zapped.end(); ++p)
+ {
+ if (p->second <= 0)
+ continue;
+
+ beam.draw(p->first);
+ }
+
+ delay(200);
+
+ beam.glyph = 0;
+
+ for (map<coord_def, aff_type>::const_iterator p = hitfunc.zapped.begin();
+ p != hitfunc.zapped.end(); ++p)
+ {
+ if (p->second <= 0)
+ continue;
+
+ range2 = max(9, (p->first - caster->pos()).abs());
+ // At or within range 3 (range2 9), this is equivalent to the
+ // old Ice Storm damage.
+ beam.damage = calc_dice(7, (198 + 9 * pow) / range2);
+
+ if (actor_at(p->first))
+ {
+ beam.source = beam.target = p->first;
+ beam.source.x -= sgn(beam.source.x - hitfunc.origin.x);
+ beam.source.y -= sgn(beam.source.y - hitfunc.origin.y);
+ beam.fire();
+ }
+ place_cloud(CLOUD_COLD, p->first,
+ (18 + random2avg(45,2)) / range2, caster);
+ }
+
+ noisy(25, hitfunc.origin);
+
+ return SPRET_SUCCESS;
+}