diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-27 22:57:53 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-27 22:57:53 +0000 |
commit | e1862125ea4fce442dd14faf3c1668a866876964 (patch) | |
tree | 00af2a10a40fb00cc932521dabc8692724ec1598 /crawl-ref/source/describe.cc | |
parent | 1e9759d7afc0d4b75b3d5a3c7af2adebf99c99ab (diff) | |
download | crawl-ref-e1862125ea4fce442dd14faf3c1668a866876964.tar.gz crawl-ref-e1862125ea4fce442dd14faf3c1668a866876964.zip |
Implement the first part of FR 2055862: Make the database search also
output AC/EV and damage/accuracy/speed for armour and weapons,
respectively.
Also, you can now wish for specific fixed and randarts in wizard mode
via the 'o' command. (I was getting annoyed at always having to create
all of them whenever I wanted to play around with the Singing Sword.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7048 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r-- | crawl-ref/source/describe.cc | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 1820667afc..034c12b027 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -782,6 +782,20 @@ static std::string _describe_demon(const monsters &mons) return description.str(); } +void append_weapon_stats(std::string &description, const item_def &item) +{ + description += "$Damage rating: "; + _append_value(description, property( item, PWPN_DAMAGE ), false); + description += " "; + + description += "Accuracy rating: "; + _append_value(description, property( item, PWPN_HIT ), true); + description += " "; + + description += "Base attack delay: "; + _append_value(description, property( item, PWPN_SPEED ) * 10, false); + description += "%"; +} //--------------------------------------------------------------- // @@ -883,19 +897,7 @@ static std::string _describe_weapon( const item_def &item, bool verbose) } if (verbose) - { - description += "$Damage rating: "; - _append_value(description, property( item, PWPN_DAMAGE ), false); - description += " "; - - description += "Accuracy rating: "; - _append_value(description, property( item, PWPN_HIT ), true); - description += " "; - - description += "Base attack delay: "; - _append_value(description, property( item, PWPN_SPEED ) * 10, false); - description += "%"; - } + append_weapon_stats(description, item); if (!is_fixed_artefact( item )) { @@ -1216,6 +1218,15 @@ static std::string _describe_ammo( const item_def &item ) return (description); } +void append_armour_stats(std::string &description, const item_def &item) +{ + description += "$Armour rating: "; + _append_value(description, property( item, PARM_AC ), false); + description += " "; + + description += "Evasion modifier: "; + _append_value(description, property( item, PARM_EVASION ), true); +} //--------------------------------------------------------------- // @@ -1233,12 +1244,7 @@ static std::string _describe_armour( const item_def &item, bool verbose ) && item.sub_type != ARM_BUCKLER && item.sub_type != ARM_LARGE_SHIELD) { - description += "$Armour rating: "; - _append_value(description, property( item, PARM_AC ), false); - description += " "; - - description += "Evasion modifier: "; - _append_value(description, property( item, PARM_EVASION ), true); + append_armour_stats(description, item); } const int ego = get_armour_ego_type( item ); |