diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-06 22:20:05 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-06 22:20:05 +1000 |
commit | cddc002566e2f235a3785e12d534ebc0202bb53e (patch) | |
tree | 56096ab844926ce1b43281ea9cba7932a2decd8e | |
parent | c1a16aada6ce335045374b0451c99ac1f47c4cf6 (diff) | |
download | crawl-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.
-rw-r--r-- | crawl-ref/source/acr.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 5 | ||||
-rw-r--r-- | crawl-ref/source/mon-cast.cc | 23 | ||||
-rw-r--r-- | crawl-ref/source/spl-data.h | 39 |
4 files changed, 66 insertions, 3 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 290a3bf5aa..56c5e2a908 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -4372,7 +4372,7 @@ static void _compile_time_asserts() COMPILE_CHECK(SP_VAMPIRE == 30 , c3); COMPILE_CHECK(SPELL_DEBUGGING_RAY == 103 , c4); COMPILE_CHECK(SPELL_PETRIFY == 156 , c5); - COMPILE_CHECK(NUM_SPELLS == 203 , c6); + COMPILE_CHECK(NUM_SPELLS == 206 , c6); //jmf: NEW ASSERTS: we ought to do a *lot* of these COMPILE_CHECK(NUM_SPECIES < SP_UNKNOWN , c7); diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index b995c6416e..c03710cc0b 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -2889,8 +2889,11 @@ enum spell_type SPELL_TOMB_OF_DOROKLOHE, // 200 SPELL_SUMMON_EYEBALLS, SPELL_HASTE_OTHER, + SPELL_FIRE_ELEMENTALS, + SPELL_EARTH_ELEMENTALS, + SPELL_AIR_ELEMENTALS, // 205 - NUM_SPELLS // 203 + NUM_SPELLS // 206 }; enum slot_select_mode 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; diff --git a/crawl-ref/source/spl-data.h b/crawl-ref/source/spl-data.h index 289160c710..bc24aad311 100644 --- a/crawl-ref/source/spl-data.h +++ b/crawl-ref/source/spl-data.h @@ -2408,6 +2408,45 @@ }, { + SPELL_EARTH_ELEMENTALS, "Summon Earth Elementals", + SPTYP_SUMMONING, + SPFLAG_MONSTER, + 5, + 0, + -1, -1, + 0, + NULL, + false, + false +}, + +{ + SPELL_AIR_ELEMENTALS, "Summon Air Elementals", + SPTYP_SUMMONING, + SPFLAG_MONSTER, + 5, + 0, + -1, -1, + 0, + NULL, + false, + false +}, + +{ + SPELL_FIRE_ELEMENTALS, "Summon Fire Elementals", + SPTYP_SUMMONING, + SPFLAG_MONSTER, + 5, + 0, + -1, -1, + 0, + NULL, + false, + false +}, + +{ SPELL_NO_SPELL, "nonexistent spell", 0, SPFLAG_TESTING, |