summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-05 12:43:12 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-05 12:43:12 +0000
commit08935d76ee9dd29ad5f4c8a80f999df151a63f2c (patch)
treefa108607f3beb521f8ddc55e3f3396dddb7fc16f /crawl-ref/source/beam.cc
parent722e5bdfccde8ba11f8fc82c70ff9ba0c48ba34e (diff)
downloadcrawl-ref-08935d76ee9dd29ad5f4c8a80f999df151a63f2c.tar.gz
crawl-ref-08935d76ee9dd29ad5f4c8a80f999df151a63f2c.zip
Apply caotto's fungus lifecycle patch in [2850879].
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10623 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 735bb18e1a..2cab1bce09 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -2991,9 +2991,31 @@ void bolt::affect_ground()
if (is_tracer)
return;
+ // Spore explosions might spawn a fungus. The spore explosion
+ // covers 21 tiles in open space, so the expected number of spores
+ // produced is the x in x_chance_in_y() in the conditional below.
+ if (is_explosion && this->flavour == BEAM_SPORE
+ && x_chance_in_y(2, 21)
+ && mons_class_can_pass(MONS_FUNGUS, env.grid(pos()))
+ && !actor_at(pos()))
+ {
+ int rc = create_monster(mgen_data(MONS_FUNGUS,
+ BEH_HOSTILE,
+ 0,
+ 0,
+ pos(),
+ MHITNOT,
+ MG_FORCE_PLACE));
+
+ if (rc != -1 && see_grid(pos()))
+ mpr("A fungus suddenly grows.");
+ }
+
if (affects_items)
{
- const int burn_power = (is_explosion) ? 5 : (is_beam) ? 3 : 2;
+ const int burn_power = is_explosion ? 5 :
+ is_beam ? 3
+ : 2;
expose_items_to_element(flavour, pos(), burn_power);
affect_place_clouds();
}