summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-cast.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-12-19 19:05:42 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-12-19 19:05:42 +1000
commit5502e2dc99803ff007db547354bedffcb58baa9d (patch)
treeec76285f6008295d67447afde9542657e6a0ea92 /crawl-ref/source/mon-cast.cc
parent76fbdc86b30bad4fcff9021dec832b1ff327107e (diff)
downloadcrawl-ref-5502e2dc99803ff007db547354bedffcb58baa9d.tar.gz
crawl-ref-5502e2dc99803ff007db547354bedffcb58baa9d.zip
Implement Summon Butterflies as a monster spell.
Diffstat (limited to 'crawl-ref/source/mon-cast.cc')
-rw-r--r--crawl-ref/source/mon-cast.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-cast.cc b/crawl-ref/source/mon-cast.cc
index bd12bdb14c..ba5982b8c4 100644
--- a/crawl-ref/source/mon-cast.cc
+++ b/crawl-ref/source/mon-cast.cc
@@ -813,6 +813,7 @@ bool setup_mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
case SPELL_TOMB_OF_DOROKLOHE:
case SPELL_CHAIN_LIGHTNING: // the only user is reckless
case SPELL_SUMMON_EYEBALLS:
+ case SPELL_SUMMON_BUTTERFLIES:
return (true);
default:
if (check_validity)
@@ -2157,6 +2158,19 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
spell_cast, monster->pos(), monster->foe, 0, god));
}
return;
+ case SPELL_SUMMON_BUTTERFLIES:
+ if (_mons_abjured(monster, monsterNearby))
+ return;
+
+ duration = std::min(2 + monster->hit_dice / 5, 6);
+ for (int i = 0; i < 15; ++i)
+ {
+ create_monster(
+ mgen_data(MONS_BUTTERFLY, SAME_ATTITUDE(monster),
+ monster, duration, spell_cast, monster->pos(),
+ monster->foe, 0, god));
+ }
+ return;
}
// If a monster just came into view and immediately cast a spell,