summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-15 20:45:21 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-15 20:45:21 +0000
commit32da929a4bcb1df6fd18310982abc041e8390907 (patch)
tree3ec5a6481e1befa954dd545fbd36f4a79b2410ba /crawl-ref/source/itemprop.cc
parent0a22591e3b05f479def2d67dc5c935aaddf072d1 (diff)
downloadcrawl-ref-32da929a4bcb1df6fd18310982abc041e8390907.tar.gz
crawl-ref-32da929a4bcb1df6fd18310982abc041e8390907.zip
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
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r--crawl-ref/source/itemprop.cc29
1 files changed, 24 insertions, 5 deletions
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))
{