summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/religion.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-22 22:38:49 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-22 22:38:49 +0000
commite4867cc9e9177abd5c949228568f4e3d993dade2 (patch)
tree16c10ab7e39b680727233942d2dc8e872b6d1941 /crawl-ref/source/religion.cc
parentd6b99cccc1c8dcdacd2c803211b29f395e7cd00d (diff)
downloadcrawl-ref-e4867cc9e9177abd5c949228568f4e3d993dade2.tar.gz
crawl-ref-e4867cc9e9177abd5c949228568f4e3d993dade2.zip
If you have 3 levels of the mutation resistance mutation, Zin's
retribution won't be able to unmutate you, so call can_safely_mutate() before trying that, and, if it returns false, fall through to the angel/pestilence retribution. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4496 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r--crawl-ref/source/religion.cc34
1 files changed, 18 insertions, 16 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 24ef310ce3..7a00610bdf 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -2768,24 +2768,26 @@ static bool _zin_retribution()
{
case 0: // remove good mutations (25%)
case 1:
- {
- simple_god_message(" draws some chaos from your body!", god);
- bool success = false;
- for (int i = 0; i < 7; i++)
- if (random2(10) > i
- && delete_mutation(RANDOM_MUTATION, true, true))
+ if (can_safely_mutate())
+ {
+ simple_god_message(" draws some chaos from your body!", god);
+ bool success = false;
+ for (int i = 0; i < 7; i++)
+ if (random2(10) > i
+ && delete_mutation(RANDOM_MUTATION, true, true))
+ {
+ success = true;
+ }
+
+ if (success && !count_mutations())
{
- success = true;
+ simple_god_message(" rids your body of chaos!");
+ // lower penance a bit more for being particularly successful
+ dec_penance(god, 1);
}
-
- if (success && !count_mutations())
- {
- simple_god_message(" rids your body of chaos!");
- // lower penance a bit more for being particularly successful
- dec_penance(god, 1);
- }
- break;
- }
+ break;
+ }
+ // deliberate fall through
case 2:
case 3:
case 4: // summon angels or bugs (pestilence), 3/8