summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-27 13:48:58 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-27 13:48:58 +0000
commit2f4194a97fbe9e92b75688dae0511f51f73d7430 (patch)
treedc2cd2e853f8d0cbf7ca4784d8039ae942eb9d17 /crawl-ref/source/fight.cc
parent33cd5f7627dde3804aba172a68b994def4de896d (diff)
downloadcrawl-ref-2f4194a97fbe9e92b75688dae0511f51f73d7430.tar.gz
crawl-ref-2f4194a97fbe9e92b75688dae0511f51f73d7430.zip
Make sure that Xom and chaos weapons can only turn monsters with natural
holiness into shapeshifters. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10429 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 8f83f9570f..f6c7291ece 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -2264,6 +2264,8 @@ void melee_attack::chaos_affects_defender()
{
const bool mon = defender->atype() == ACT_MONSTER;
const bool immune = mon && mons_immune_magic(defender_as_monster());
+ const bool is_natural = mon && mons_holiness(defender_as_monster())
+ == MH_NATURAL;
const bool is_shifter = mon && mons_is_shapeshifter(defender_as_monster());
const bool can_clone = mon && !mons_is_holy(defender_as_monster())
&& mons_clonable(defender_as_monster(), true);
@@ -2271,11 +2273,11 @@ void melee_attack::chaos_affects_defender()
&& !immune);
const bool can_rage = defender->can_go_berserk();
- int clone_chance = can_clone ? 1 : 0;
- int poly_chance = can_poly ? 1 : 0;
- int poly_up_chance = can_poly && mon ? 1 : 0;
- int shifter_chance = can_poly && mon ? 1 : 0;
- int rage_chance = can_rage ? 10 : 0;
+ int clone_chance = can_clone ? 1 : 0;
+ int poly_chance = can_poly ? 1 : 0;
+ int poly_up_chance = can_poly && mon ? 1 : 0;
+ int shifter_chance = can_poly && is_natural && mon ? 1 : 0;
+ int rage_chance = can_rage ? 10 : 0;
int miscast_chance = 10;
// Already a shifter?