diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-01 00:34:40 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-01 00:34:40 +0000 |
commit | 97fb0d78f692cb36873006a79446d011b4a3fb6b (patch) | |
tree | acf34c7a52d8a7795a76f72f4fab9674c14ebbfa /crawl-ref/source/effects.cc | |
parent | 845cc22c3950d9e3e1e8b27a11e4557b3bb0fddb (diff) | |
download | crawl-ref-97fb0d78f692cb36873006a79446d011b4a3fb6b.tar.gz crawl-ref-97fb0d78f692cb36873006a79446d011b4a3fb6b.zip |
* Rename beheld -> mesmerised.
* Fix forget_map routine for Tiles.
There are two problems remaining:
a) Calling forget_map every ~20 turns is fine for ASCII since it
mostly happens outside vision range anyway but looks really odd
and spurious when watched in the minimap.
Potential solution: Call the function more often.
b) The minimap currently does not recenter but of course it should
from time to time. The problem with this is that this is likely
to look wobbly.
Potential solution: Disable the minimap entirely while in
labyrinths.
I don't like the solutions I came up with, so if anyone has a better
idea please speak up.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7698 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r-- | crawl-ref/source/effects.cc | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 2d6da14541..8bddb089fd 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -2608,11 +2608,33 @@ void change_labyrinth(bool msg) env.map(p).property |= FPROP_HIGHLIGHT; #endif + // Shift blood some most of the time. + if (is_bloodcovered(c)) + { + if (one_chance_in(4)) + { + int wall_count = 0; + coord_def old_adj(c); + for (adjacent_iterator ai(c); ai; ++ai) + if (grid_is_wall(grd(*ai)) && one_chance_in(++wall_count)) + old_adj = *ai; + + if (old_adj != c) + { + if (!is_bloodcovered(old_adj)) + env.map(old_adj).property |= FPROP_BLOODY; + env.map(c).property &= (~FPROP_BLOODY); + } + } + } + else if (one_chance_in(750)) + { + // Sometimes (rarely) add blood randomly, accumulating with time... + env.map(p).property |= FPROP_BLOODY; + } + // Rather than use old_grid directly, replace with an adjacent // wall type, preferably stone, rock, or metal. - // TODO: Blood is currently left on the grid even though it turned - // into a wall or floor. Rather, it should be nudged aside to - // a grid of similar type. old_grid = grd[p.x-1][p.y]; if (!grid_is_wall(old_grid)) { @@ -2638,6 +2660,31 @@ void change_labyrinth(bool msg) old_grid = grd[p.x+1][p.y]; } grd(p) = old_grid; + + // Shift blood some of the time. + if (is_bloodcovered(p)) + { + if (one_chance_in(4)) + { + int floor_count = 0; + coord_def new_adj(p); + for (adjacent_iterator ai(c); ai; ++ai) + if (_is_floor(grd(*ai)) && one_chance_in(++floor_count)) + new_adj = *ai; + + if (new_adj != p) + { + if (!is_bloodcovered(new_adj)) + env.map(new_adj).property |= FPROP_BLOODY; + env.map(p).property &= (~FPROP_BLOODY); + } + } + } + else if (one_chance_in(150)) + { + // Occasionally add blood randomly, accumulating with time... + env.map(p).property |= FPROP_BLOODY; + } } // The directions are used to randomly decide where to place items that @@ -3464,7 +3511,7 @@ void update_corpses(double elapsedTime) // dry fountains may start flowing again if (fountain_checks > 0) { - for ( rectangle_iterator ri(1); ri; ++ri ) + for (rectangle_iterator ri(1); ri; ++ri) { if (grd(*ri) >= DNGN_DRY_FOUNTAIN_BLUE && grd(*ri) < DNGN_PERMADRY_FOUNTAIN) |