summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/mon-util.cc8
-rw-r--r--crawl-ref/source/mon-util.h1
-rw-r--r--crawl-ref/source/spells4.cc73
3 files changed, 44 insertions, 38 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 5b45335e41..9314094e1f 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -602,6 +602,14 @@ bool mons_is_icy(int mc)
|| mc == MONS_ICE_STATUE);
}
+bool mons_is_skeletal(int mc)
+{
+ return (mc == MONS_SKELETON_SMALL
+ || mc == MONS_SKELETON_LARGE
+ || mc == MONS_SKELETAL_DRAGON
+ || mc == MONS_SKELETAL_WARRIOR);
+}
+
bool invalid_monster(const monsters *mon)
{
return (!mon || mon->type == -1);
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index 751e4a8ec4..abd25adf7f 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -768,6 +768,7 @@ bool mons_is_evil(const monsters *mon);
bool mons_is_unholy(const monsters *mon);
bool mons_is_evil_or_unholy(const monsters *mon);
bool mons_is_icy(int mc);
+bool mons_is_skeletal(int mc);
bool mons_has_lifeforce(const monsters *mon);
monster_type mons_genus(int mc);
monster_type mons_species(int mc);
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;