summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-cast.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-11-06 22:20:05 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-11-06 22:20:05 +1000
commitcddc002566e2f235a3785e12d534ebc0202bb53e (patch)
tree56096ab844926ce1b43281ea9cba7932a2decd8e /crawl-ref/source/mon-cast.cc
parentc1a16aada6ce335045374b0451c99ac1f47c4cf6 (diff)
downloadcrawl-ref-cddc002566e2f235a3785e12d534ebc0202bb53e.tar.gz
crawl-ref-cddc002566e2f235a3785e12d534ebc0202bb53e.zip
Full set of (monster) summon elemental spells (Mu).
It's somewhat hackish; the monster summon system could do with a bit of an overhaul, but that should wait until after the summoning nerf.
Diffstat (limited to 'crawl-ref/source/mon-cast.cc')
-rw-r--r--crawl-ref/source/mon-cast.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/crawl-ref/source/mon-cast.cc b/crawl-ref/source/mon-cast.cc
index cc51dc36aa..a309df03b0 100644
--- a/crawl-ref/source/mon-cast.cc
+++ b/crawl-ref/source/mon-cast.cc
@@ -766,6 +766,9 @@ void setup_mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast)
case SPELL_CANTRIP:
case SPELL_BERSERKER_RAGE:
case SPELL_WATER_ELEMENTALS:
+ case SPELL_FIRE_ELEMENTALS:
+ case SPELL_AIR_ELEMENTALS:
+ case SPELL_EARTH_ELEMENTALS:
case SPELL_KRAKEN_TENTACLES:
case SPELL_BLINK:
case SPELL_CONTROLLED_BLINK:
@@ -1559,6 +1562,9 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
const bool wizard = monster->is_actual_spellcaster();
god_type god = (priest || !(priest || wizard)) ? monster->god : GOD_NO_GOD;
+ // Used for summon X elemental, and nothing else. {bookofjude}
+ monster_type el_summon_type = MONS_NO_MONSTER;
+
switch (spell_cast)
{
default:
@@ -1610,6 +1616,21 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
return;
case SPELL_WATER_ELEMENTALS:
+ if (el_summon_type == MONS_NO_MONSTER)
+ el_summon_type = MONS_WATER_ELEMENTAL;
+ // Deliberate fall through
+ case SPELL_EARTH_ELEMENTALS:
+ if (el_summon_type == MONS_NO_MONSTER)
+ el_summon_type = MONS_EARTH_ELEMENTAL;
+ // Deliberate fall through
+ case SPELL_AIR_ELEMENTALS:
+ if (el_summon_type == MONS_NO_MONSTER)
+ el_summon_type = MONS_AIR_ELEMENTAL;
+ // Deliberate fall through
+ case SPELL_FIRE_ELEMENTALS:
+ if (el_summon_type == MONS_NO_MONSTER)
+ el_summon_type = MONS_FIRE_ELEMENTAL;
+
if (_mons_abjured(monster, monsterNearby))
return;
@@ -1618,7 +1639,7 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
for (sumcount = 0; sumcount < sumcount2; sumcount++)
{
create_monster(
- mgen_data(MONS_WATER_ELEMENTAL, SAME_ATTITUDE(monster),
+ mgen_data(el_summon_type, SAME_ATTITUDE(monster),
3, spell_cast, monster->pos(), monster->foe, 0, god));
}
return;