diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-26 03:20:58 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-26 03:20:58 +0000 |
commit | 8467370eab3f93700463df6bc3bcfedba25b2f9c (patch) | |
tree | 825f5b2540364c135342c7f0379bea2dedd78013 /crawl-ref/source/itemprop.cc | |
parent | d64fd2263baaae9c832323b54097654ad2c2be81 (diff) | |
download | crawl-ref-8467370eab3f93700463df6bc3bcfedba25b2f9c.tar.gz crawl-ref-8467370eab3f93700463df6bc3bcfedba25b2f9c.zip |
Clean up item handling a bit, and don't give uniques potions if they
won't be able to drink them.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8761 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r-- | crawl-ref/source/itemprop.cc | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index aa85b91288..4bbbbec68d 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1709,7 +1709,7 @@ bool is_blessed_blade(const item_def &item) return (false); } -bool is_convertible(const item_def &item) +bool is_blessed_blade_convertible(const item_def &item) { return (!is_artefact(item) && (item.base_type == OBJ_WEAPONS @@ -1791,6 +1791,52 @@ bool convert2good(item_def &item, bool allow_blessed) return (true); } +bool convert2bad(item_def &item) +{ + if (item.base_type != OBJ_WEAPONS) + return (false); + + switch (item.sub_type) + { + default: + return (false); + + case WPN_BLESSED_FALCHION: + item.sub_type = WPN_FALCHION; + break; + + case WPN_BLESSED_LONG_SWORD: + item.sub_type = WPN_LONG_SWORD; + break; + + case WPN_BLESSED_SCIMITAR: + item.sub_type = WPN_SCIMITAR; + break; + + case WPN_BLESSED_EUDEMON_BLADE: + item.sub_type = WPN_DEMON_BLADE; + break; + + case WPN_BLESSED_KATANA: + item.sub_type = WPN_KATANA; + break; + + case WPN_BLESSED_DOUBLE_SWORD: + item.sub_type = WPN_DOUBLE_SWORD; + break; + + case WPN_BLESSED_GREAT_SWORD: + item.sub_type = WPN_GREAT_SWORD; + break; + + case WPN_BLESSED_TRIPLE_SWORD: + item.sub_type = WPN_TRIPLE_SWORD; + break; + } + + return (true); +} + int weapon_str_weight( const item_def &wpn ) { ASSERT (wpn.base_type == OBJ_WEAPONS || wpn.base_type == OBJ_STAVES); |