summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-10 14:34:37 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-10 14:34:37 +0100
commit672df2f6a49ff8683255e5bad316674d16285f0c (patch)
treea3d04761b18fce07545c67f08f6c4471d31cd659 /crawl-ref/source/effects.cc
parentd2b8c2a72d975b9bf6a3f8ea41cff136adf8cb0a (diff)
downloadcrawl-ref-672df2f6a49ff8683255e5bad316674d16285f0c.tar.gz
crawl-ref-672df2f6a49ff8683255e5bad316674d16285f0c.zip
Add conditional bloodifying function and use it in some places.
This might help the reported blood-covered deep water, though I didn't see any obvious case that was a likely cause.
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index cc50b7c8c3..c3be41fa8b 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -3271,17 +3271,14 @@ void change_labyrinth(bool msg)
if (feat_is_wall(grd(*ai)) && one_chance_in(++wall_count))
old_adj = *ai;
- if (old_adj != c && !is_bloodcovered(old_adj))
- {
- env.pgrid(old_adj) |= FPROP_BLOODY;
+ if (old_adj != c && maybe_bloodify_square(old_adj))
env.pgrid(c) &= (~FPROP_BLOODY);
- }
}
}
else if (one_chance_in(500))
{
// Rarely add blood randomly, accumulating with time...
- env.pgrid(c) |= FPROP_BLOODY;
+ maybe_bloodify_square(c);
}
// Rather than use old_grid directly, replace with an adjacent
@@ -3323,17 +3320,14 @@ void change_labyrinth(bool msg)
if (_is_floor(grd(*ai)) && one_chance_in(++floor_count))
new_adj = *ai;
- if (new_adj != p && !is_bloodcovered(new_adj))
- {
- env.pgrid(new_adj) |= FPROP_BLOODY;
+ if (new_adj != p && maybe_bloodify_square(new_adj))
env.pgrid(p) &= (~FPROP_BLOODY);
- }
}
}
else if (one_chance_in(100))
{
// Occasionally add blood randomly, accumulating with time...
- env.pgrid(p) |= FPROP_BLOODY;
+ maybe_bloodify_square(p);
}
}