diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-16 23:03:47 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-16 23:03:47 +0000 |
commit | e5333083bde06b3049628ef62785215e07129281 (patch) | |
tree | db56a0b9df058cab009b2cf265e2a45cc86569d2 /crawl-ref/source/itemprop.cc | |
parent | adf985cc8e1096d10c988cdf65fb0f13e280e42e (diff) | |
download | crawl-ref-e5333083bde06b3049628ef62785215e07129281.tar.gz crawl-ref-e5333083bde06b3049628ef62785215e07129281.zip |
Add weapon blessing-related cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4276 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r-- | crawl-ref/source/itemprop.cc | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index de734bd793..d5a177b8f7 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1624,20 +1624,20 @@ bool is_demonic( const item_def &item ) return (false); } // end is_demonic() -bool is_blessed( const item_def &item ) +bool is_unblessed( const item_def &item ) { if (item.base_type == OBJ_WEAPONS) { switch (item.sub_type) { - case WPN_BLESSED_FALCHION: - case WPN_BLESSED_LONG_SWORD: - case WPN_BLESSED_SCIMITAR: - case WPN_BLESSED_KATANA: - case WPN_BLESSED_BLADE: - case WPN_BLESSED_DOUBLE_SWORD: - case WPN_BLESSED_GREAT_SWORD: - case WPN_BLESSED_TRIPLE_SWORD: + case WPN_FALCHION: + case WPN_LONG_SWORD: + case WPN_SCIMITAR: + case WPN_KATANA: + case WPN_DEMON_BLADE: + case WPN_DOUBLE_SWORD: + case WPN_GREAT_SWORD: + case WPN_TRIPLE_SWORD: return (true); default: @@ -1646,25 +1646,22 @@ bool is_blessed( const item_def &item ) } return (false); -} // end is_blessed() +} // end is_unblessed() -bool is_blessable( const item_def &item ) +bool is_blessed( const item_def &item ) { - if (is_blessed(item) && !is_artefact(item)) - return (true); - if (item.base_type == OBJ_WEAPONS) { switch (item.sub_type) { - case WPN_FALCHION: - case WPN_LONG_SWORD: - case WPN_SCIMITAR: - case WPN_KATANA: - case WPN_DEMON_BLADE: - case WPN_DOUBLE_SWORD: - case WPN_GREAT_SWORD: - case WPN_TRIPLE_SWORD: + case WPN_BLESSED_FALCHION: + case WPN_BLESSED_LONG_SWORD: + case WPN_BLESSED_SCIMITAR: + case WPN_BLESSED_KATANA: + case WPN_BLESSED_BLADE: + case WPN_BLESSED_DOUBLE_SWORD: + case WPN_BLESSED_GREAT_SWORD: + case WPN_BLESSED_TRIPLE_SWORD: return (true); default: @@ -1673,6 +1670,11 @@ bool is_blessable( const item_def &item ) } return (false); +} // end is_blessed() + +bool is_blessable( const item_def &item ) +{ + return ((is_unblessed(item) || is_blessed(item)) && !is_artefact(item)); } // end is_blessable() bool normal2good( item_def &item, bool allow_blessed ) |