summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/itemprop.cc46
-rw-r--r--crawl-ref/source/itemprop.h1
-rw-r--r--crawl-ref/source/religion.cc12
3 files changed, 28 insertions, 31 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 )
diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h
index ab8b39bbdf..33d4f2efb9 100644
--- a/crawl-ref/source/itemprop.h
+++ b/crawl-ref/source/itemprop.h
@@ -668,6 +668,7 @@ bool is_double_ended( const item_def &item );
int double_wpn_awkward_speed( const item_def &item );
bool is_demonic( const item_def &item );
+bool is_unblessed( const item_def &item );
bool is_blessed( const item_def &item );
bool is_blessable( const item_def &item );
bool normal2good( item_def &item, bool allow_blessed = true );
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 88e1183317..218b315ab0 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -900,11 +900,8 @@ static bool _tso_blessing_holy_wpn(monsters *mon)
item_def& wpn(mitm[weapon]);
- if (is_fixed_artefact(wpn) || is_random_artefact(wpn)
- || get_weapon_brand(wpn) == SPWPN_HOLY_WRATH)
- {
+ if (is_artefact(wpn) || get_weapon_brand(wpn) == SPWPN_HOLY_WRATH)
return false;
- }
// And make it holy.
set_equip_desc(wpn, ISFLAG_GLOWING);
@@ -4050,10 +4047,7 @@ static bool _bless_weapon( god_type god, int brand, int colour )
{
const int wpn = get_player_wielded_weapon();
- // Assuming the type of weapon is correct, we only need to check
- // to see if it's an artefact we can successfully clobber:
- if (!is_fixed_artefact( you.inv[wpn] )
- && !is_random_artefact( you.inv[wpn] ))
+ if (!is_artefact( you.inv[wpn] ))
{
you.duration[DUR_WEAPON_BRAND] = 0; // just in case
@@ -4069,7 +4063,7 @@ static bool _bless_weapon( god_type god, int brand, int colour )
{
normal2good(you.inv[wpn]);
- if (is_blessed(you.inv[wpn]))
+ if (is_blessable(you.inv[wpn]))
{
origin_acquired(you.inv[wpn], GOD_SHINING_ONE);
make_item_randart(you.inv[wpn]);