diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-26 17:10:09 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-26 17:10:09 +0000 |
commit | a54d0315be1fae4bab7b05dbfe092f374ecfd991 (patch) | |
tree | fb625f3094bc9cb1c14c6d7bcac89b8e498e3f5a /crawl-ref/source/effects.cc | |
parent | 5c6b5260c78682faae4822494a61ccb173117d85 (diff) | |
download | crawl-ref-a54d0315be1fae4bab7b05dbfe092f374ecfd991.tar.gz crawl-ref-a54d0315be1fae4bab7b05dbfe092f374ecfd991.zip |
Add fountains of blood (as suggested by Lemuel), and tidy up
the existing fountains: change their order and remove all
those superfluous dry fountain types.
I couldn't find any place for random generation of fountains,
so if that is possible it will have to be disabled for blood
fountains outside the hells. I've added a shortcut (Y) for
vault creation, though. :)
Drinking from such a fountain has a 33% chance of leaving it
dry. I think that's it... for now.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3886 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r-- | crawl-ref/source/effects.cc | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 03293442c4..1285909186 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -2867,17 +2867,27 @@ void update_level( double elapsedTime ) delete_cloud( i ); } -static void _maybe_restart_fountain_flow(const int x, const int y, int tries) +static void _maybe_restart_fountain_flow(const int x, const int y, + const int tries) { - while (0 < tries--) + dungeon_feature_type grid = grd[x][y]; + if (grid < DNGN_DRY_FOUNTAIN_BLUE || grid > DNGN_DRY_FOUNTAIN_BLOOD) + { + return; + } + + int i = 0; + while (tries > i++) { if (!one_chance_in(100)) continue; - - if (grd[x][y] > DNGN_SPARKLING_FOUNTAIN) - grd[x][y] = static_cast<dungeon_feature_type>(grd[x][y] - 1); - else // grid == DNGN_DRY_FOUNTAIN_I - grd[x][y] = DNGN_BLUE_FOUNTAIN; + + // make it start flowing again + grd[x][y] = static_cast<dungeon_feature_type> (grid + - (DNGN_DRY_FOUNTAIN_BLUE - DNGN_FOUNTAIN_BLUE)); + + if ( is_terrain_seen(coord_def(x,y)) ) + set_envmap_obj(x, y, grd[x][y]); // clean bloody floor if (is_bloodcovered(x,y)) @@ -2893,6 +2903,8 @@ static void _maybe_restart_fountain_flow(const int x, const int y, int tries) env.map[x+i][y+j].property = FPROP_NONE; } } + + return; } } @@ -2973,9 +2985,8 @@ void update_corpses(double elapsedTime) for (cx = 0; cx < GXM; cx++) for (cy = 0; cy < GYM; cy++) { - if (grd[cx][cy] == DNGN_DRY_FOUNTAIN_I - || grd[cx][cy] > DNGN_SPARKLING_FOUNTAIN - && grd[cx][cy] < DNGN_PERMADRY_FOUNTAIN) + if (grd[cx][cy] >= DNGN_DRY_FOUNTAIN_BLUE + && grd[cx][cy] < DNGN_PERMADRY_FOUNTAIN) { _maybe_restart_fountain_flow(cx, cy, fountain_checks); } |