summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/it_use2.cc6
-rw-r--r--crawl-ref/source/mutation.cc17
-rw-r--r--crawl-ref/source/mutation.h2
3 files changed, 14 insertions, 11 deletions
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index 9ea96cb109..f6f323e511 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -147,17 +147,17 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known )
}
case POT_GAIN_STRENGTH:
- if (mutate(MUT_STRONG))
+ if (mutate(MUT_STRONG, true, false, false, true))
learned_something_new(TUT_YOU_MUTATED);
break;
case POT_GAIN_DEXTERITY:
- if (mutate(MUT_AGILE))
+ if (mutate(MUT_AGILE, true, false, false, true))
learned_something_new(TUT_YOU_MUTATED);
break;
case POT_GAIN_INTELLIGENCE:
- if (mutate(MUT_CLEVER))
+ if (mutate(MUT_CLEVER, true, false, false, true))
learned_something_new(TUT_YOU_MUTATED);
break;
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index 5cffeac882..214b5414c6 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -1691,7 +1691,7 @@ static mutation_type get_random_mutation(bool prefer_good,
bool mutate(mutation_type which_mutation, bool failMsg,
bool force_mutation, bool god_gift,
- bool demonspawn)
+ bool stat_gain_potion, bool demonspawn)
{
if (demonspawn)
force_mutation = true;
@@ -1701,9 +1701,11 @@ bool mutate(mutation_type which_mutation, bool failMsg,
if (!force_mutation)
{
// God gifts override all sources of mutation resistance other
- // than the mutation resistance mutation and divine protection.
+ // than the mutation resistance mutation and divine protection,
+ // and stat gain potions override all sources of mutation
+ // resistance other than the mutation resistance mutation.
if (wearing_amulet(AMU_RESIST_MUTATION)
- && !one_chance_in(10) && !god_gift
+ && !one_chance_in(10) && !god_gift && !stat_gain_potion
|| player_mutation_level(MUT_MUTATION_RESISTANCE) == 3
|| player_mutation_level(MUT_MUTATION_RESISTANCE)
&& !one_chance_in(3))
@@ -1714,7 +1716,8 @@ bool mutate(mutation_type which_mutation, bool failMsg,
}
// Zin's protection.
- if (you.religion == GOD_ZIN && x_chance_in_y(you.piety, MAX_PIETY))
+ if (you.religion == GOD_ZIN && x_chance_in_y(you.piety, MAX_PIETY)
+ && !stat_gain_potion)
{
simple_god_message(" protects your body from chaos!");
return (false);
@@ -2801,13 +2804,13 @@ bool perma_mutate(mutation_type which_mut, int how_much)
how_much = std::min(static_cast<short>(how_much),
mutation_defs[which_mut].levels);
- if (mutate(which_mut, false, true, false, true))
+ if (mutate(which_mut, false, true, false, false, true))
levels++;
- if (how_much >= 2 && mutate(which_mut, false, true, false, true))
+ if (how_much >= 2 && mutate(which_mut, false, true, false, false, true))
levels++;
- if (how_much >= 3 && mutate(which_mut, false, true, false, true))
+ if (how_much >= 3 && mutate(which_mut, false, true, false, false, true))
levels++;
you.demon_pow[which_mut] = levels;
diff --git a/crawl-ref/source/mutation.h b/crawl-ref/source/mutation.h
index 5c46d51e42..b49e2c2110 100644
--- a/crawl-ref/source/mutation.h
+++ b/crawl-ref/source/mutation.h
@@ -34,7 +34,7 @@ void fixup_mutations();
* *********************************************************************** */
bool mutate(mutation_type which_mutation, bool failMsg = true,
bool force_mutation = false, bool god_gift = false,
- bool demonspawn = false);
+ bool stat_gain_potion = false, bool demonspawn = false);
// last updated 12may2000 {dlb}
/* ***********************************************************************