summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-abil.cc
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-11-11 22:31:41 -0500
committerCharles Otto <ottochar@gmail.com>2009-11-11 23:04:23 -0500
commit37ba8b3ae6c9c7f6b39e372c4dd8f305f69923be (patch)
tree40564211ce358b7531089d895770d70334bb9470 /crawl-ref/source/mon-abil.cc
parent21cc906692321fd60c3fa6ab4780ce1fa0f083c6 (diff)
downloadcrawl-ref-37ba8b3ae6c9c7f6b39e372c4dd8f305f69923be.tar.gz
crawl-ref-37ba8b3ae6c9c7f6b39e372c4dd8f305f69923be.zip
Give giant spores a chance of spawning ballistos while wandering
Give giant spores a chance of creating a ballistomycete when they move while wandering. This ability is on a timer, so they can't create more than 1 ballisto per 20 turns. Numbers may need tweaking.
Diffstat (limited to 'crawl-ref/source/mon-abil.cc')
-rw-r--r--crawl-ref/source/mon-abil.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc
index 73d0547f6c..3c93b540a2 100644
--- a/crawl-ref/source/mon-abil.cc
+++ b/crawl-ref/source/mon-abil.cc
@@ -1435,4 +1435,39 @@ void mon_nearby_ability(monsters *monster)
}
}
+// When giant spores move (while wandering) maybe place a spore on the
+// square they move off of.
+void ballisto_on_move(monsters * monster, const coord_def & position)
+{
+ if (monster->type == MONS_GIANT_SPORE
+ && monster->behaviour == BEH_WANDER)
+ {
+ // The number field is used as a cooldown timer for this behavior.
+ if (monster->number <= 0)
+ {
+ if (one_chance_in(4))
+ {
+ int rc = create_monster(mgen_data(MONS_BALLISTOMYCETE,
+ SAME_ATTITUDE(monster),
+ 0,
+ 0,
+ position,
+ MHITNOT,
+ MG_FORCE_PLACE));
+
+ if (rc != -1 && you.can_see(&env.mons[rc]))
+ {
+ mprf("A ballistomycete grows in the wake of the spore.");
+ }
+ monster->number = 20;
+ }
+ }
+ else
+ {
+ monster->number--;
+ }
+
+ }
+}
+