diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-08-07 15:06:00 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-08-07 15:06:00 +0000 |
commit | 60d8e93b1adada2500c8f282bc31dd04b17b0935 (patch) | |
tree | 4d19cffddfc4d11d7ab0e27e58fa0b701bd65f1e /crawl-ref/source/player.cc | |
parent | 3df5b1d3140e461c40fa88ab4f80554b9912372c (diff) | |
download | crawl-ref-60d8e93b1adada2500c8f282bc31dd04b17b0935.tar.gz crawl-ref-60d8e93b1adada2500c8f282bc31dd04b17b0935.zip |
Apply Haran's commits 6773 and 6777-6784 to 0.4.
* Fix 2037104: amulet of Controlled Flight not autoIDing.
* Fix 2038973: explosive tracers leaking information about invisible
monsters.
* Fix 2039217: check shield status for non-weapons before wielding
* Fix 2039734: non-Spriggan transmuters being cheated on UC
* Fix 2037845: unstackedness was overriding finishing a deck
* Fix 2038476: semicontrolled blink.
* Fix 2038962: casting Divine Shield wasn't refreshing AC.
* Fix 2038651: real/fake rakshasa identity being leaked in descriptions.
* Fix 2035976: doubled inscriptions in equipped items in dump.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6792 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index bf87fa062a..ea0f6fceb9 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -4233,37 +4233,37 @@ int player_mental_clarity(bool calc_unid, bool items) return ((ret > 3) ? 3 : ret); } -bool wearing_amulet(jewellery_type amulet, bool calc_unid) +// Returns whether the player has the effect of the amulet +// from a non-amulet source. +bool extrinsic_amulet_effect(jewellery_type amulet) { - if (amulet == AMU_CONTROLLED_FLIGHT - && (you.duration[DUR_CONTROLLED_FLIGHT] - || player_genus(GENPC_DRACONIAN) - || you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON - || you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)) + switch ( amulet ) { - return (true); + case AMU_CONTROLLED_FLIGHT: + return (you.duration[DUR_CONTROLLED_FLIGHT] + || player_genus(GENPC_DRACONIAN) + || you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON + || you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT); + case AMU_CLARITY: + return (player_mutation_level(MUT_CLARITY) > 0); + case AMU_RESIST_CORROSION: + case AMU_CONSERVATION: + return (player_equip_ego_type(EQ_CLOAK, SPARM_PRESERVATION) > 0); + default: + return false; } +} - if (amulet == AMU_CLARITY && player_mutation_level(MUT_CLARITY)) +bool wearing_amulet(jewellery_type amulet, bool calc_unid) +{ + if ( extrinsic_amulet_effect(amulet) ) return (true); - - if (amulet == AMU_RESIST_CORROSION || amulet == AMU_CONSERVATION) - { - // XXX: this is hackish {dlb} - if (player_equip_ego_type( EQ_CLOAK, SPARM_PRESERVATION )) - return (true); - } - + if (you.equip[EQ_AMULET] == -1) return (false); - if (you.inv[you.equip[EQ_AMULET]].sub_type == amulet - && ( calc_unid || item_type_known(you.inv[you.equip[EQ_AMULET]]) )) - { - return (true); - } - - return (false); + const item_def& amu(you.inv[you.equip[EQ_AMULET]]); + return (amu.sub_type == amulet && (calc_unid || item_type_known(amu))); } bool player_is_airborne(void) |