diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-01-12 17:58:31 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-01-12 17:58:31 +0000 |
commit | 3947969b0bdd2e27e2e6c98efc4850e9caae974c (patch) | |
tree | 0585877eb95e84429f64bb98fb62a9dfc39aef96 /crawl-ref/source | |
parent | 7b83fd125f30d8479760be243d6c8cc83438b622 (diff) | |
download | crawl-ref-3947969b0bdd2e27e2e6c98efc4850e9caae974c.tar.gz crawl-ref-3947969b0bdd2e27e2e6c98efc4850e9caae974c.zip |
Fixed shield bonus when confused (syllogism).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3259 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/externs.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 4 |
3 files changed, 9 insertions, 1 deletions
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index c6e372094e..e463b9b000 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -202,7 +202,7 @@ public: virtual bool incapacitated() const { - return paralysed() || confused() || caught(); + return paralysed() || asleep() || confused() || caught(); } virtual int holy_aura() const diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index bc321043ec..f74b9c364a 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -3533,6 +3533,10 @@ int monsters::shield_bonus() const const item_def *shld = const_cast<monsters*>(this)->shield(); if (shld) { + // Note that 0 is not quite no-blocking. + if (incapacitated()) + return (0); + const int shld_c = property(*shld, PARM_AC); return (random2(1 + shld_c) + random2(hit_dice / 2)); } diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index ed1f96de09..8ce441481a 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5874,6 +5874,10 @@ int player::shield_bonus() const const int shield_class = player_shield_class(); if (!shield_class) return (-100); + + // Note that 0 is not quite no-blocking. + if (incapacitated()) + return (0); int stat = 0; if (const item_def *sh = const_cast<player*>(this)->shield()) |