summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/makeitem.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-19 09:52:46 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-19 09:52:46 -0600
commitfb463b88c07b86b44dbb460b06f068e9bf866351 (patch)
treee47be8427dbdfa77c63dad6804806f61b0674f42 /crawl-ref/source/makeitem.cc
parent208679e27f8585bb2ce75a5f16f565a5147f9b7a (diff)
downloadcrawl-ref-fb463b88c07b86b44dbb460b06f068e9bf866351.tar.gz
crawl-ref-fb463b88c07b86b44dbb460b06f068e9bf866351.zip
Simplify.
Diffstat (limited to 'crawl-ref/source/makeitem.cc')
-rw-r--r--crawl-ref/source/makeitem.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index 084beecd34..3a36c4a79a 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -1429,9 +1429,13 @@ static brand_type _determine_weapon_brand(const item_def& item, int item_level)
rc = SPWPN_VORPAL;
else
rc = SPWPN_SPEED;
- if (item.sub_type == WPN_HAND_CROSSBOW || item.sub_type == WPN_CROSSBOW)
- if (one_chance_in(5))
- rc = SPWPN_ELECTROCUTION;
+
+ if ((item.sub_type == WPN_HAND_CROSSBOW
+ || item.sub_type == WPN_CROSSBOW)
+ && one_chance_in(5))
+ {
+ rc = SPWPN_ELECTROCUTION;
+ }
break;
}
@@ -1537,7 +1541,8 @@ bool is_weapon_brand_ok(int type, int brand)
return (false);
if (skill != SK_POLEARMS && brand == SPWPN_DRAGON_SLAYING)
return (false);
- switch((brand_type)brand)
+
+ switch ((brand_type)brand)
{
// Universal brands.
case SPWPN_NORMAL:
@@ -1550,6 +1555,7 @@ bool is_weapon_brand_ok(int type, int brand)
case SPWPN_HOLY_WRATH:
case SPWPN_ELECTROCUTION:
break;
+
// Melee-only brands.
case SPWPN_FLAMING:
case SPWPN_FREEZING:
@@ -1565,6 +1571,7 @@ bool is_weapon_brand_ok(int type, int brand)
if (is_range_weapon(item))
return (false);
break;
+
// Ranged-only brands.
case SPWPN_FLAME:
case SPWPN_FROST:
@@ -1572,12 +1579,15 @@ bool is_weapon_brand_ok(int type, int brand)
if (!is_range_weapon(item))
return (false);
break;
+
case SPWPN_FORBID_BRAND:
case SPWPN_DEBUG_RANDART:
case NUM_SPECIAL_WEAPONS:
case SPWPN_DUMMY_CRUSHING:
ASSERT(!"invalid brand");
+ break;
}
+
if (brand == SPWPN_RETURNING && !is_throwable(&you, item, true))
return (false);