summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/godpassive.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-04-28 15:59:08 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2014-05-07 18:23:26 -0600
commit25e634ccea69dcb1be8c2449bf8dcec9ea8c5a21 (patch)
treea1fe6317af3c68381347cc183beda20f18512715 /crawl-ref/source/godpassive.cc
parentdeb4de3a7a4bf8a603442e3d7d6572eb8b2e91b9 (diff)
downloadcrawl-ref-25e634ccea69dcb1be8c2449bf8dcec9ea8c5a21.tar.gz
crawl-ref-25e634ccea69dcb1be8c2449bf8dcec9ea8c5a21.zip
Adjust Qazlal cloud generation behaviour.
Since clouds are displaceable, we don't need to only place them in open areas; instead we just don't place them next to other clouds (so that if they place in a corridor you can still autotravel through the corridor). Also don't place clouds on firewood to reduce spamminess.
Diffstat (limited to 'crawl-ref/source/godpassive.cc')
-rw-r--r--crawl-ref/source/godpassive.cc24
1 files changed, 8 insertions, 16 deletions
diff --git a/crawl-ref/source/godpassive.cc b/crawl-ref/source/godpassive.cc
index daa7713852..4ef62919a4 100644
--- a/crawl-ref/source/godpassive.cc
+++ b/crawl-ref/source/godpassive.cc
@@ -711,16 +711,13 @@ void qazlal_storm_clouds()
for (radius_iterator ri(you.pos(), radius, C_ROUND, LOS_SOLID, true);
ri; ++ri)
{
- if (cell_is_solid(*ri) || env.cgrid(*ri) != EMPTY_CLOUD)
+ if (cell_is_solid(*ri) || env.cgrid(*ri) != EMPTY_CLOUD
+ || monster_at(*ri) && mons_is_firewood(monster_at(*ri)))
+ {
continue;
+ }
- int neighbours = 0;
- for (adjacent_iterator ai(*ri); ai; ++ai)
- if (feat_is_traversable(grd(*ai)))
- neighbours++;
-
- if (neighbours == 0 || neighbours > 6)
- candidates.push_back(*ri);
+ candidates.push_back(*ri);
}
const int count =
div_rand_round(radius * candidates.size() * you.time_taken,
@@ -731,18 +728,13 @@ void qazlal_storm_clouds()
int placed = 0;
for (unsigned int i = 0; placed < count && i < candidates.size(); i++)
{
- bool one = false, skip = false;
+ bool skip = false;
for (adjacent_iterator ai(candidates[i]); ai; ++ai)
{
if (env.cgrid(*ai) != EMPTY_CLOUD)
{
- if (one)
- {
- skip = true;
- break;
- }
- else
- one = true;
+ skip = true;
+ break;
}
}
if (skip)