From 32da929a4bcb1df6fd18310982abc041e8390907 Mon Sep 17 00:00:00 2001 From: dolorous Date: Tue, 15 Apr 2008 20:45:21 +0000 Subject: Add more weapon blessing cleanups for TSO. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4248 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/itemprop.cc | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/itemprop.cc') diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index b8218a96b6..29575844e6 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1577,7 +1577,6 @@ int double_wpn_awkward_speed( const item_def &item ) return ((base * 30 + 10) / 20 + 2); } - bool is_demonic( const item_def &item ) { if (item.base_type == OBJ_WEAPONS) @@ -1597,7 +1596,24 @@ bool is_demonic( const item_def &item ) return (false); } // end is_demonic() -bool demonic2nondemonic( item_def &item, bool allow_blessed ) +bool is_blessed( const item_def &item ) +{ + if (item.base_type == OBJ_WEAPONS) + { + switch (item.sub_type) + { + case WPN_BLESSED_BLADE: + return (true); + + default: + break; + } + } + + return (false); +} // end is_demonic() + +bool normal2good( item_def &item, bool allow_blessed ) { if (item.base_type != OBJ_WEAPONS) return (false); @@ -1608,7 +1624,10 @@ bool demonic2nondemonic( item_def &item, bool allow_blessed ) return (false); case WPN_DEMON_BLADE: - item.sub_type = (allow_blessed) ? WPN_BLESSED_BLADE : WPN_SCIMITAR; + if (!allow_blessed) + item.sub_type = WPN_SCIMITAR; + else + item.sub_type = WPN_BLESSED_BLADE; break; case WPN_DEMON_WHIP: @@ -1621,7 +1640,7 @@ bool demonic2nondemonic( item_def &item, bool allow_blessed ) } return (true); -} // end demonic2nondemonic() +} // end normal2good() int weapon_str_weight( const item_def &wpn ) { @@ -1823,7 +1842,7 @@ bool check_weapon_shape( const item_def &item, bool quiet, bool check_id ) if ((!check_id || item_type_known( item )) && ((item.base_type == OBJ_WEAPONS - && item.sub_type == WPN_BLESSED_BLADE) + && is_blessed(item)) || brand == SPWPN_HOLY_WRATH) && (you.is_undead || you.species == SP_DEMONSPAWN)) { -- cgit v1.2.3-54-g00ecf