diff options
author | Chris Campbell <chriscampbell89@gmail.com> | 2014-07-09 11:57:30 +0100 |
---|---|---|
committer | Chris Campbell <chriscampbell89@gmail.com> | 2014-07-09 14:20:05 +0100 |
commit | 28beea6b951314f59ca6018dedc0d0cb87f0eac2 (patch) | |
tree | 9d14deef2eaeafecedfb7e7e386af1350c863fef /crawl-ref/source/player.cc | |
parent | 16e9270f56188ed993ec5a9755fe3874158ab40c (diff) | |
download | crawl-ref-28beea6b951314f59ca6018dedc0d0cb87f0eac2.tar.gz crawl-ref-28beea6b951314f59ca6018dedc0d0cb87f0eac2.zip |
Fix magical shields being unable to block most ranged attacks (#8772)
They checked that the player either had a shield equipped or had the
bone plates mutation, so TSO's divine shield, Qazlal shielding and
Condensation shield could all never block ranged attacks (except for those
from ranged weapons, since those now follow the same codepath as melee
attacks!).
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 71443e47fa..d545c27e51 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -6198,6 +6198,19 @@ bool player::liquefied_ground() const && ground_level() && !is_insubstantial(); } +/** + * Returns whether the player currently has any kind of shield. + */ +bool player::shielded() const +{ + return shield() + || duration[DUR_CONDENSATION_SHIELD] + || duration[DUR_MAGIC_SHIELD] + || duration[DUR_DIVINE_SHIELD] + || player_mutation_level(MUT_LARGE_BONE_PLATES) > 0 + || qazlal_sh_boost() > 0; +} + int player::shield_block_penalty() const { return 5 * shield_blocks * shield_blocks; |