summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/decks.cc3
-rw-r--r--crawl-ref/source/mutation.cc6
-rw-r--r--crawl-ref/source/mutation.h2
-rw-r--r--crawl-ref/source/religion.cc4
4 files changed, 9 insertions, 6 deletions
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index 825ce9601f..ff625495de 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -2195,7 +2195,8 @@ static void _experience_card(int power, deck_rarity_type rarity)
static void _remove_bad_mutation()
{
- if (!delete_mutation(RANDOM_BAD_MUTATION, false))
+ // Ensure that only bad mutations are removed.
+ if (!delete_mutation(RANDOM_BAD_MUTATION, false, false, false, true))
mpr("You feel transcendent for a moment.");
}
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index c8561d0878..4d9ea1e480 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -2142,7 +2142,7 @@ bool mutate(mutation_type which_mutation, bool failMsg,
return (false);
else
return (delete_mutation(RANDOM_MUTATION, failMsg,
- force_mutation, non_fatal));
+ force_mutation, false, non_fatal));
}
}
@@ -2401,7 +2401,7 @@ static bool _delete_single_mutation_level(mutation_type mutat)
bool delete_mutation(mutation_type which_mutation, bool failMsg,
bool force_mutation, bool god_gift,
- bool non_fatal)
+ bool disallow_mismatch, bool non_fatal)
{
ASSERT(!non_fatal || _is_random(which_mutation));
@@ -2470,7 +2470,7 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg,
(which_mutation == RANDOM_GOOD_MUTATION && mdef.bad)
|| (which_mutation == RANDOM_BAD_MUTATION && !mdef.bad);
- if (mismatch && !one_chance_in(10))
+ if (mismatch && (disallow_mismatch || !one_chance_in(10)))
continue;
break;
diff --git a/crawl-ref/source/mutation.h b/crawl-ref/source/mutation.h
index 0a1d3b082d..a538d01e68 100644
--- a/crawl-ref/source/mutation.h
+++ b/crawl-ref/source/mutation.h
@@ -45,7 +45,7 @@ formatted_string describe_mutations();
bool delete_mutation(mutation_type which_mutation, bool failMsg = true,
bool force_mutation = false, bool god_gift = false,
- bool non_fatal = false);
+ bool disallow_mismatch = false, bool non_fatal = false);
bool delete_all_mutations();
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index eb774003c0..032385ecd9 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -4434,8 +4434,10 @@ static void _zin_remove_good_mutations()
for (int i = 7; i >= 0; --i)
{
+ // Ensure that only good mutations are removed.
if (i <= random2(10)
- && delete_mutation(RANDOM_GOOD_MUTATION, failMsg, false, true))
+ && delete_mutation(RANDOM_GOOD_MUTATION, failMsg, false, true,
+ true))
{
success = true;
}