From 8467370eab3f93700463df6bc3bcfedba25b2f9c Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 26 Jan 2009 03:20:58 +0000 Subject: 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 --- crawl-ref/source/itemprop.cc | 48 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/itemprop.cc') 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); -- cgit v1.2.3-54-g00ecf