summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-31 03:59:21 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-31 03:59:21 +0000
commit173be6333490d4cf0e57a021b3159a8d257222ad (patch)
tree82d99c7387b046100be25d202255d9812d986b7e /crawl-ref/source/spells4.cc
parent7b01d6eec2c97936fc50fb67262985d0e9eab7b9 (diff)
downloadcrawl-ref-173be6333490d4cf0e57a021b3159a8d257222ad.tar.gz
crawl-ref-173be6333490d4cf0e57a021b3159a8d257222ad.zip
Make the tests for icy and skeletal monsters in Lee's Rapid
Deconstruction more generic. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8050 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc73
1 files changed, 35 insertions, 38 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 5308076b90..8fb66e66a6 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -1709,44 +1709,6 @@ bool cast_fragmentation(int pow, const dist& spd)
switch (mon->type)
{
- case MONS_ICE_STATUE: // blast of ice fragments
- case MONS_ICE_BEAST:
- case MONS_SIMULACRUM_SMALL:
- case MONS_SIMULACRUM_LARGE:
- explode = true;
- beam.name = "icy blast";
- beam.colour = WHITE;
- beam.damage.num = 2;
- beam.flavour = BEAM_ICE;
- if (player_hurt_monster(midx, beam.damage.roll()))
- beam.damage.num++;
- break;
-
- case MONS_FLYING_SKULL: // blast of bone
- case MONS_SKELETON_SMALL:
- case MONS_SKELETON_LARGE:
- case MONS_SKELETAL_DRAGON:
- case MONS_SKELETAL_WARRIOR:
- mprf("The %s explodes into sharp fragments of bone!",
- (mon->type == MONS_FLYING_SKULL) ? "skull" : "skeleton");
-
- explode = true;
- beam.name = "blast of bone shards";
- beam.colour = LIGHTGREY;
-
- if (x_chance_in_y(pow / 5, 50)) // potential insta-kill
- {
- monster_die(mon, KILL_YOU, NON_MONSTER);
- beam.damage.num = 4;
- }
- else
- {
- beam.damage.num = 2;
- if (player_hurt_monster(midx, beam.damage.roll()))
- beam.damage.num += 2;
- }
- goto all_done; // i.e. no "Foo Explodes!"
-
case MONS_WOOD_GOLEM:
simple_monster_message(mon, " shudders violently!");
@@ -1819,6 +1781,41 @@ bool cast_fragmentation(int pow, const dist& spd)
break;
default:
+ if (mons_is_icy(mon->type)) // blast of ice
+ {
+ explode = true;
+ beam.name = "icy blast";
+ beam.colour = WHITE;
+ beam.damage.num = 2;
+ beam.flavour = BEAM_ICE;
+ if (player_hurt_monster(midx, beam.damage.roll()))
+ beam.damage.num++;
+ break;
+ }
+ else if (mons_is_skeletal(mon->type)
+ || mon->type == MONS_FLYING_SKULL) // blast of bone
+ {
+ mprf("The %s explodes into sharp fragments of bone!",
+ (mon->type == MONS_FLYING_SKULL) ? "skull" : "skeleton");
+
+ explode = true;
+ beam.name = "blast of bone shards";
+ beam.colour = LIGHTGREY;
+
+ if (x_chance_in_y(pow / 5, 50)) // potential insta-kill
+ {
+ monster_die(mon, KILL_YOU, NON_MONSTER);
+ beam.damage.num = 4;
+ }
+ else
+ {
+ beam.damage.num = 2;
+ if (player_hurt_monster(midx, beam.damage.roll()))
+ beam.damage.num += 2;
+ }
+ goto all_done; // i.e., no "Foo Explodes!"
+ }
+ else
{
const bool petrifying = mons_is_petrifying(mon);
const bool petrified = mons_is_petrified(mon) && !petrifying;