diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-18 22:46:55 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-18 22:46:55 +0000 |
commit | 675a800e7a1af244c8cf55f9124ff3293c7f46d5 (patch) | |
tree | 131db46131f9a40072936c9f9c810d5a3d0bb356 /crawl-ref | |
parent | 093500fbbed0601d61ce06584b505a38ddb8b2de (diff) | |
download | crawl-ref-675a800e7a1af244c8cf55f9124ff3293c7f46d5.tar.gz crawl-ref-675a800e7a1af244c8cf55f9124ff3293c7f46d5.zip |
Apply trunk r10287 to 0.5.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10288 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/decks.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/mutation.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/mutation.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 4 |
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 b4af6c1e12..952d405459 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -4237,8 +4237,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; } |