From 37ba8b3ae6c9c7f6b39e372c4dd8f305f69923be Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Wed, 11 Nov 2009 22:31:41 -0500 Subject: 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. --- crawl-ref/source/mon-abil.cc | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'crawl-ref/source/mon-abil.cc') 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--; + } + + } +} + -- cgit v1.2.3-54-g00ecf