summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-10 11:13:10 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-10 11:13:10 +0000
commit383d392c17f076384fc37e631b6506739ca634fe (patch)
treebfbe8aae5e4e385a6f7989b236d733611d7e9f35 /crawl-ref/source/effects.cc
parentf9a588e06301bb545bff1f9eadac78af6bf1cfbd (diff)
downloadcrawl-ref-383d392c17f076384fc37e631b6506739ca634fe.tar.gz
crawl-ref-383d392c17f076384fc37e631b6506739ca634fe.zip
Make sure toadstools don't pop up on really fresh corpses.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10647 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc26
1 files changed, 12 insertions, 14 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index c1f25c48cb..9576d5b95e 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -4313,14 +4313,14 @@ static int _mushroom_ring(item_def &corpse, int & seen_count)
return (0);
mgen_data temp(MONS_TOADSTOOL,
- BEH_HOSTILE, 0, 0,
- coord_def(),
- MHITNOT,
- MG_FORCE_PLACE,
- GOD_NO_GOD,
- MONS_PROGRAM_BUG,
- 0,
- corpse.colour);
+ BEH_HOSTILE, 0, 0,
+ coord_def(),
+ MHITNOT,
+ MG_FORCE_PLACE,
+ GOD_NO_GOD,
+ MONS_PROGRAM_BUG,
+ 0,
+ corpse.colour);
float target_arc_len = 2 * sqrtf(2.0f);
@@ -4529,9 +4529,9 @@ static void _maybe_spawn_mushroom(item_def & corpse, int rot_time)
// We won't spawn a mushroom within 10 turns of the corpse's being created
// or rotting away.
int low_threshold = 5;
- int high_threshold = FRESHEST_CORPSE - 5;
+ int high_threshold = FRESHEST_CORPSE - 15;
- if (corpse.special < low_threshold)
+ if (corpse.special < low_threshold || corpse.special > high_threshold)
return;
int spawn_time = (rot_time > corpse.special ? corpse.special : rot_time);
@@ -4542,10 +4542,8 @@ static void _maybe_spawn_mushroom(item_def & corpse, int rot_time)
int step_size = 10;
int current_trials = spawn_time / step_size;
-
- int trial_prob = mushroom_prob(corpse);
-
- int success_count = binomial_generator(current_trials, trial_prob);
+ int trial_prob = mushroom_prob(corpse);
+ int success_count = binomial_generator(current_trials, trial_prob);
int seen_spawns;
spawn_corpse_mushrooms(corpse, success_count, seen_spawns);