diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-11 05:03:06 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-11 05:03:06 +0000 |
commit | cefc04ea39dbf7ff9d434df3dddf427b23da6f8e (patch) | |
tree | 9be577f4ed8a55a545b33e985df387abef91754f /crawl-ref/source/itemname.cc | |
parent | d531426adb53352c85c8a411a60bee92cbc0a363 (diff) | |
download | crawl-ref-cefc04ea39dbf7ff9d434df3dddf427b23da6f8e.tar.gz crawl-ref-cefc04ea39dbf7ff9d434df3dddf427b23da6f8e.zip |
Added "items" boolean parameter to the player_res_foo() functions, which
when false makes equipped items be ignored when figuring reistance. Used
by is_useless_item() to avoid (for example) rings of poison reistance being
marked useless if the player equips one. Also mark rings of teleport
control as useless if the player has inate teleport control, and never
mark artifact jewellery as useless.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5725 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r-- | crawl-ref/source/itemname.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 7e7a897242..41fabbd8bc 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -2427,6 +2427,9 @@ bool is_useless_item(const item_def &item, bool temp) if (!item_type_known(item)) return (false); + if (is_artefact(item)) + return false; + if (is_bad_item(item, temp)) return (true); @@ -2450,7 +2453,7 @@ bool is_useless_item(const item_def &item, bool temp) return (player_mutation_level(MUT_ACUTE_VISION)); case RING_POISON_RESISTANCE: - return (player_res_poison() + return (player_res_poison(true, temp, false) && (temp || you.species != SP_VAMPIRE)); case AMU_CONTROLLED_FLIGHT: @@ -2459,6 +2462,9 @@ bool is_useless_item(const item_def &item, bool temp) case RING_WIZARDRY: return (you.religion == GOD_TROG); + case RING_TELEPORT_CONTROL: + return (player_control_teleport(true, temp, false)); + default: return (false); } |