summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-26 17:10:09 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-26 17:10:09 +0000
commita54d0315be1fae4bab7b05dbfe092f374ecfd991 (patch)
treefb625f3094bc9cb1c14c6d7bcac89b8e498e3f5a /crawl-ref/source/item_use.cc
parent5c6b5260c78682faae4822494a61ccb173117d85 (diff)
downloadcrawl-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/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc44
1 files changed, 29 insertions, 15 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index b3895f384a..61003814bd 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -3561,8 +3561,8 @@ void drink( int slot )
if (slot == -1)
{
- if (grd[you.x_pos][you.y_pos] == DNGN_BLUE_FOUNTAIN
- || grd[you.x_pos][you.y_pos] == DNGN_SPARKLING_FOUNTAIN)
+ if (grd[you.x_pos][you.y_pos] >= DNGN_FOUNTAIN_BLUE
+ && grd[you.x_pos][you.y_pos] <= DNGN_FOUNTAIN_BLOOD)
{
if (drink_fountain())
return;
@@ -3644,7 +3644,7 @@ bool drink_fountain()
{
const dungeon_feature_type feat = grd[you.x_pos][you.y_pos];
- if ( feat != DNGN_BLUE_FOUNTAIN && feat != DNGN_SPARKLING_FOUNTAIN )
+ if ( feat < DNGN_FOUNTAIN_BLUE || feat > DNGN_FOUNTAIN_BLOOD )
return false;
if (you.flight_mode() == FL_LEVITATE)
@@ -3654,17 +3654,26 @@ bool drink_fountain()
}
potion_type fountain_effect = POT_WATER;
- if ( feat == DNGN_BLUE_FOUNTAIN )
+ if ( feat == DNGN_FOUNTAIN_BLUE )
{
if (!yesno("Drink from the fountain?"))
return false;
- else
- mpr("You drink the pure, clear water.");
+
+ mpr("You drink the pure, clear water.");
+ }
+ else if ( feat == DNGN_FOUNTAIN_BLOOD )
+ {
+ if (!yesno("Drink from the fountain of blood?"))
+ return false;
+
+ mpr("You drink the blood.");
+ fountain_effect = POT_BLOOD;
}
else // sparkling fountain
{
if (!yesno("Drink from the sparkling fountain?"))
return false;
+
mpr("You drink the sparkling water.");
const potion_type effects[] =
@@ -3692,24 +3701,30 @@ bool drink_fountain()
weights + ARRAYSIZE(weights))];
}
- if (fountain_effect != POT_WATER)
+ if (fountain_effect != POT_WATER && fountain_effect != POT_BLOOD)
xom_is_stimulated(64);
- potion_effect(fountain_effect, 100);
+ // good gods do not punish for bad random effects
+ potion_effect(fountain_effect, 100, feat != DNGN_FOUNTAIN_SPARKLING);
bool gone_dry = false;
- if ( feat == DNGN_BLUE_FOUNTAIN )
+ if ( feat == DNGN_FOUNTAIN_BLUE )
{
if ( one_chance_in(20) )
gone_dry = true;
}
+ else if ( feat == DNGN_FOUNTAIN_BLOOD )
+ {
+ if ( one_chance_in(3) )
+ gone_dry = true;
+ }
else // sparkling fountain
{
if (one_chance_in(10))
gone_dry = true;
else if ( random2(50) > 40 ) // no message!
{
- grd[you.x_pos][you.y_pos] = DNGN_BLUE_FOUNTAIN;
+ grd[you.x_pos][you.y_pos] = DNGN_FOUNTAIN_BLUE;
set_terrain_changed(you.x_pos, you.y_pos);
}
}
@@ -3717,11 +3732,10 @@ bool drink_fountain()
if (gone_dry)
{
mpr("The fountain dries up!");
- if (feat == DNGN_BLUE_FOUNTAIN)
- grd[you.x_pos][you.y_pos] = DNGN_DRY_FOUNTAIN_I;
- else
- grd[you.x_pos][you.y_pos] = DNGN_DRY_FOUNTAIN_II;
-
+
+ grd[you.x_pos][you.y_pos] = static_cast<dungeon_feature_type>(feat
+ + DNGN_DRY_FOUNTAIN_BLUE - DNGN_FOUNTAIN_BLUE);
+
set_terrain_changed(you.x_pos, you.y_pos);
crawl_state.cancel_cmd_repeat();