summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-cast.cc
diff options
context:
space:
mode:
authorChris Campbell <chriscampbell89@gmail.com>2014-05-06 21:23:43 +0100
committerChris Campbell <chriscampbell89@gmail.com>2014-05-06 21:58:47 +0100
commitf6694988d39908c035bb559df60ab662fdbfe85d (patch)
tree55b35714f8e555d3fb61efd63de12b6f3cf3f4ec /crawl-ref/source/mon-cast.cc
parente292186e3781b43b169c203cb8268733566cef39 (diff)
downloadcrawl-ref-f6694988d39908c035bb559df60ab662fdbfe85d.tar.gz
crawl-ref-f6694988d39908c035bb559df60ab662fdbfe85d.zip
Remove the Summon Elemental spell
It was fairly fiddly and unclear in its mechanics, and elemental summoning is now covered by the elemental evokers (and possibly the storm god at some point in the future too)ยท Moved Summon Forest from the book of the Warp to replace it in the book of Summonings, and added Dispersal to replace it in the book of Wizardry.
Diffstat (limited to 'crawl-ref/source/mon-cast.cc')
-rw-r--r--crawl-ref/source/mon-cast.cc92
1 files changed, 42 insertions, 50 deletions
diff --git a/crawl-ref/source/mon-cast.cc b/crawl-ref/source/mon-cast.cc
index 9325d0abce..d26e1c4b76 100644
--- a/crawl-ref/source/mon-cast.cc
+++ b/crawl-ref/source/mon-cast.cc
@@ -1219,7 +1219,9 @@ bool setup_mons_cast(monster* mons, bolt &pbolt, spell_type spell_cast,
case SPELL_AIR_ELEMENTALS:
case SPELL_EARTH_ELEMENTALS:
case SPELL_IRON_ELEMENTALS:
+#if TAG_MAJOR_VERSION == 34
case SPELL_SUMMON_ELEMENTAL:
+#endif
case SPELL_CREATE_TENTACLES:
case SPELL_BLINK:
case SPELL_CONTROLLED_BLINK:
@@ -2023,6 +2025,7 @@ static bool _ms_waste_of_time(const monster* mon, spell_type monspell)
case SPELL_SHAFT_SELF:
case SPELL_MISLEAD:
case SPELL_SUMMON_SCORPIONS:
+ case SPELL_SUMMON_ELEMENTAL:
#endif
case SPELL_NO_SPELL:
ret = true;
@@ -3655,6 +3658,27 @@ static void _do_high_level_summon(monster* mons, bool monsterNearby,
}
}
+static void _mons_summon_elemental(monster* mons,
+ bool monsterNearby,
+ spell_type spell_cast,
+ monster_type elemental,
+ god_type god)
+{
+ if (_mons_abjured(mons, monsterNearby))
+ return;
+
+ const int count = 1 + (mons->spell_hd(spell_cast) > 15)
+ + random2(mons->spell_hd(spell_cast) / 7 + 1);
+
+ for (int i = 0; i < count; i++)
+ {
+ create_monster(
+ mgen_data(elemental, SAME_ATTITUDE(mons), mons,
+ 3, spell_cast, mons->pos(), mons->foe, 0, god));
+ }
+ return;
+}
+
// Returns true if a message referring to the player's legs makes sense.
static bool _legs_msg_applicable()
{
@@ -4669,9 +4693,6 @@ void mons_cast(monster* mons, bolt &pbolt, spell_type spell_cast,
_mons_set_priest_wizard_god(mons, priest, wizard, god);
- // Used for summon X elemental and nothing else. {bookofjude}
- monster_type summon_type = MONS_NO_MONSTER;
-
switch (spell_cast)
{
default:
@@ -4848,58 +4869,29 @@ void mons_cast(monster* mons, bolt &pbolt, spell_type spell_cast,
}
case SPELL_WATER_ELEMENTALS:
- if (summon_type == MONS_NO_MONSTER)
- summon_type = MONS_WATER_ELEMENTAL;
- // Deliberate fall through
- case SPELL_EARTH_ELEMENTALS:
- if (summon_type == MONS_NO_MONSTER)
- summon_type = MONS_EARTH_ELEMENTAL;
- // Deliberate fall through
- case SPELL_IRON_ELEMENTALS:
- if (summon_type == MONS_NO_MONSTER)
- summon_type = MONS_IRON_ELEMENTAL;
- // Deliberate fall through
- case SPELL_AIR_ELEMENTALS:
- if (summon_type == MONS_NO_MONSTER)
- summon_type = MONS_AIR_ELEMENTAL;
- // Deliberate fall through
- case SPELL_FIRE_ELEMENTALS:
- if (summon_type == MONS_NO_MONSTER)
- summon_type = MONS_FIRE_ELEMENTAL;
- // Deliberate fall through
- case SPELL_SUMMON_ELEMENTAL:
- {
- if (summon_type == MONS_NO_MONSTER)
- summon_type = random_choose(
- MONS_EARTH_ELEMENTAL, MONS_FIRE_ELEMENTAL,
- MONS_AIR_ELEMENTAL, MONS_WATER_ELEMENTAL,
- -1);
+ _mons_summon_elemental(mons, monsterNearby, spell_cast,
+ MONS_WATER_ELEMENTAL, god);
+ return;
- if (_mons_abjured(mons, monsterNearby))
- return;
+ case SPELL_EARTH_ELEMENTALS:
+ _mons_summon_elemental(mons, monsterNearby, spell_cast,
+ MONS_EARTH_ELEMENTAL, god);
+ return;
- int dur;
+ case SPELL_IRON_ELEMENTALS:
+ _mons_summon_elemental(mons, monsterNearby, spell_cast,
+ MONS_IRON_ELEMENTAL, god);
+ return;
- if (spell_cast == SPELL_SUMMON_ELEMENTAL)
- {
- sumcount2 = 1;
- dur = min(2 + mons->spell_hd(spell_cast) / 10, 6);
- }
- else
- {
- sumcount2 = 1 + (mons->spell_hd(spell_cast) > 15)
- + random2(mons->spell_hd(spell_cast) / 7 + 1);
- dur = 3;
- }
+ case SPELL_AIR_ELEMENTALS:
+ _mons_summon_elemental(mons, monsterNearby, spell_cast,
+ MONS_AIR_ELEMENTAL, god);
+ return;
- for (sumcount = 0; sumcount < sumcount2; sumcount++)
- {
- create_monster(
- mgen_data(summon_type, SAME_ATTITUDE(mons), mons,
- dur, spell_cast, mons->pos(), mons->foe, 0, god));
- }
+ case SPELL_FIRE_ELEMENTALS:
+ _mons_summon_elemental(mons, monsterNearby, spell_cast,
+ MONS_FIRE_ELEMENTAL, god);
return;
- }
case SPELL_SUMMON_ILLUSION:
_mons_cast_summon_illusion(mons, spell_cast);