10 + random2(40) turns. Rareness roughly equivalent to levitation. This is FR 1756363. The potion does not give MR. Rewrote some vampire potion handling, including some changes: e.g. vampires can now be paralysed by potions of paralysis (I don't see why they shouldn't be.) For now there is no status message for fire/cold resist; will change soon.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1918 c06c8d41-db1a-0410-9941-cceddc491573
JK3HFJG76OOQHJMXJUSZRTR5CX5ZMS52LRVBLOR7E2NBI6PRSHHAC
CMNLYUECIMEZSOYG4KOSINOPER5OM7PPCGIHCM7LQVWEO77XFUYQC
KX23OEQBBLMQHTFCA4TYYEGLHCETXVZCXALYR5U5RELKJMMB66SAC
JXOE7KJIEAJHPLMZAJ6O4YHDTRB6BGNP6XT3ZSEFYGSIUMHR77KQC
5V47S4NNTHWTSAHV3YLO2VGH7JTUIYJ3GBPDN5ZM4UQALT2ZEXDQC
OYTCBRC7LE44EUVRZVYTOOVKQWJ6P6YE3FXTOGUTNKEMLNWPHKSQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
DTO3EUKWHZ5RJNGNCFYXSOVTIPVXPP637F2W7WFGYKJ7JK7VNKNQC
P2ZCF3BBG523ZEOD6XQA4X5YEHBTWH3IM33YVHXP2SQ5POXZIH4QC
VNHFP63ZLLZU3A3PLXP4BITX57DUIYDHFOHQYK3BOBHV3S64G26QC
3KAINFIXO7WNWGUGZB43EUNFRS2ZPBLQZDTY456QACMRHYIJ7WDAC
ILOED4VB4I6VPAUTR75ZWX6MXDYXB5DO2EDK2UH67O3HNKWV23RQC
I2B33Z7NZGC33AMDSSK446AZZYWKPHWLAGULVHKKZU4MVB4BNJOAC
QDTVLBRGHDTRUVT7I3O72K6TMOYAUSAJBZUHGOEFU2RKJNUPWZSQC
7CHVBETGMBRTJDALOUETMRLY2APEK5HSV5ZUKX4ZVV66RURNV4NAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
KFULGQQOHWUTXOM3BXCCYPGGVGGY4Z6265XUFRCBPNLTZAEHJZSQC
IHIJSWVOONSTA2WCHKW3YKBLETUQECFVBVLMET5SGQZ4C6U3GCUQC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
bool gone_dry = false;
int temp_rand; // for probability determinations {dlb}
potion_type fountain_effect = POT_WATER; // for fountain effects {dlb}
const dungeon_feature_type feat = grd[you.x_pos][you.y_pos];
if ( feat != DNGN_BLUE_FOUNTAIN && feat != DNGN_SPARKLING_FOUNTAIN )
return false;
default:
break;
}
const potion_type effects[] =
{ POT_WATER, POT_DECAY,
POT_MUTATION, POT_HEALING, POT_HEAL_WOUNDS, POT_SPEED, POT_MIGHT,
POT_DEGENERATION,
POT_LEVITATION, POT_POISON, POT_SLOWING,
POT_PARALYSIS, POT_CONFUSION, POT_INVISIBILITY,
POT_MAGIC, POT_RESTORE_ABILITIES, POT_RESISTANCE,
POT_STRONG_POISON, POT_BERSERK_RAGE,
POT_GAIN_STRENGTH, POT_GAIN_INTELLIGENCE, POT_GAIN_DEXTERITY };
fountain_effect = ((temp_rand > 2399) ? POT_WATER : // 46.7%
(temp_rand > 2183) ? POT_DECAY : // 4.8%
(temp_rand > 2003) ? POT_MUTATION : // 4.0%
(temp_rand > 1823) ? POT_HEALING : // 4.0%
(temp_rand > 1643) ? POT_HEAL_WOUNDS :// 4.0%
(temp_rand > 1463) ? POT_SPEED : // 4.0%
(temp_rand > 1283) ? POT_MIGHT : // 4.0%
(temp_rand > 1139) ? POT_DEGENERATION ://3.2%
(temp_rand > 1019) ? POT_LEVITATION :// 2.7%
(temp_rand > 899) ? POT_POISON : // 2.7%
(temp_rand > 779) ? POT_SLOWING : // 2.7%
(temp_rand > 659) ? POT_PARALYSIS : // 2.7%
(temp_rand > 539) ? POT_CONFUSION : // 2.7%
(temp_rand > 419) ? POT_INVISIBILITY :// 2.7%
(temp_rand > 329) ? POT_MAGIC : // 2.0%
(temp_rand > 239) ? POT_RESTORE_ABILITIES :// 2.0%
(temp_rand > 149) ? POT_STRONG_POISON ://2.0%
(temp_rand > 59) ? POT_BERSERK_RAGE : //2.0%
(temp_rand > 39) ? POT_GAIN_STRENGTH : //0.4%
(temp_rand > 19) ? POT_GAIN_DEXTERITY //0.4%
: POT_GAIN_INTELLIGENCE);//0.4%
ASSERT( ARRAYSIZE(weights) == ARRAYSIZE(effects) );
fountain_effect = effects[weighted_random(weights,ARRAYSIZE(weights))];
break;
}
else
{
temp_rand = random2(50);
// you won't know it (yet)
if (temp_rand > 40) // 18% probability
grd[you.x_pos][you.y_pos] = DNGN_BLUE_FOUNTAIN;
}
break;
default:
break;
else if ( random2(50) > 40 ) // no message!
grd[you.x_pos][you.y_pos] = DNGN_BLUE_FOUNTAIN;
unrot_hp(1);
set_hp(you.hp_max, false);
// only fix rot when healed to full
if (you.hp == you.hp_max)
{
unrot_hp(1);
set_hp(you.hp_max, false);
}
you.duration[DUR_POISONING] = 0;
you.rotting = 0;
you.disease = 0;
you.duration[DUR_CONF] = 0;
you.duration[DUR_POISONING] = 0;
you.rotting = 0;
you.disease = 0;
you.duration[DUR_CONF] = 0;
if (!were_mighty)
mpr( "You feel very mighty all of a sudden." );
else
{
mpr( "You feel mightier all of a sudden." );
contaminate_player(1);
}
// conceivable max gain of +184 {dlb}
you.duration[DUR_MIGHT] += 35 + random2(pow);
if ( were_mighty )
contaminate_player(1);
else
modify_stat(STAT_STRENGTH, 5, true);
if (!were_mighty)
modify_stat(STAT_STRENGTH, 5, true);
// files.cc permits values up to 215, but ... {dlb}
if (you.duration[DUR_MIGHT] > 80)
you.duration[DUR_MIGHT] = 80;
// conceivable max gain of +184 {dlb}
you.duration[DUR_MIGHT] += 35 + random2(pow);
// files.cc permits values up to 215, but ... {dlb}
if (you.duration[DUR_MIGHT] > 80)
you.duration[DUR_MIGHT] = 80;
if (you.species == SP_VAMPIRE)
{
slow_player( (10 + random2(pow)) / 2 );
xom_is_stimulated(32);
break;
}
slow_player( 10 + random2(pow) );
xom_is_stimulated(64);
slow_player( (10 + random2(pow)) / factor );
xom_is_stimulated(64 / factor);
if (you.species == SP_VAMPIRE)
{
confuse_player( (3 + random2(8)) / 2 );
xom_is_stimulated(54);
break;
}
confuse_player( 3 + random2(8) );
xom_is_stimulated(128);
confuse_player( (3 + random2(8)) / factor );
xom_is_stimulated(128 / factor);
// messaging taken care of within function {dlb}
// not quite true... if no stat's are restore = no message, and
// that's just confusing when trying out random potions (this one
// still auto-identifies so we know what the effect is, but it
// shouldn't require bringing up the descovery screen to do that -- bwr
if (restore_stat(STAT_ALL, false) == false)
// give a message if restore_stat doesn't
if (!restore_stat(STAT_ALL, false))