diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-18 23:10:43 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-18 23:10:43 +0000 |
commit | 892868004cdb7228bf4ec44cc791ed29c29fea97 (patch) | |
tree | a21b07626b4eda49fdbe45f87de12d4f1ce83e3c /crawl-ref/source/monstuff.cc | |
parent | 190bfa1c55dfc90851d5259f10ce6d7ff1485f86 (diff) | |
download | crawl-ref-892868004cdb7228bf4ec44cc791ed29c29fea97.tar.gz crawl-ref-892868004cdb7228bf4ec44cc791ed29c29fea97.zip |
Fix the check for the player's being undead when giving mutations from
Jiyva, and avoid "nothing has changed" message spam under those
circumstances.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10292 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index aa390087eb..935b0bd4ff 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -7816,29 +7816,30 @@ static bool _handle_pickup(monsters *monster) && random2(you.piety) > 50 && one_chance_in(4)) { - bool success = false; - if (!you.is_undead) + if (you.can_safely_mutate()) { simple_god_message(" alters your body."); more(); + bool success = false; const int rand = random2(100); + if (rand < 40) success = mutate(RANDOM_MUTATION); else if (rand < 60) success = delete_mutation(RANDOM_MUTATION); else success = mutate(RANDOM_GOOD_MUTATION); - } - if (success) - { - timeout = (100 + roll_dice(2, 4)); - you.num_gifts[you.religion]++; - take_note(Note(NOTE_GOD_GIFT, you.religion)); + if (success) + { + timeout = (100 + roll_dice(2, 4)); + you.num_gifts[you.religion]++; + take_note(Note(NOTE_GOD_GIFT, you.religion)); + } + else + mpr("You feel as though nothing has changed."); } - else - mpr("You feel as though nothing has changed."); } } |