summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-30 14:24:50 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-30 14:24:50 +0000
commit9876ce66bfd29003796a8182b20696e57fe7add5 (patch)
treeecff8a89b72e683208e92897ee51356bc507b911 /crawl-ref
parent8f709e97f1d6483880922ba7c3a902c24c35c90b (diff)
downloadcrawl-ref-9876ce66bfd29003796a8182b20696e57fe7add5.tar.gz
crawl-ref-9876ce66bfd29003796a8182b20696e57fe7add5.zip
Simplify.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6243 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/fight.cc7
-rw-r--r--crawl-ref/source/itemprop.cc18
-rw-r--r--crawl-ref/source/itemprop.h16
-rw-r--r--crawl-ref/source/makeitem.cc6
4 files changed, 20 insertions, 27 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 11102b8cd7..52be3c7d62 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -1444,13 +1444,8 @@ int melee_attack::player_apply_weapon_bonuses(int damage)
}
// Demonspawn get a damage bonus for demonic weapons.
- if (you.species == SP_DEMONSPAWN
- && (weapon->sub_type == WPN_DEMON_BLADE
- || weapon->sub_type == WPN_DEMON_WHIP
- || weapon->sub_type == WPN_DEMON_TRIDENT))
- {
+ if (you.species == SP_DEMONSPAWN && is_demonic(*weapon))
damage += random2(3);
- }
}
return (damage);
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 6049435031..4bf5b79575 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -689,9 +689,7 @@ void set_equip_race( item_def &item, unsigned long flags )
|| item.sub_type == WPN_KNIFE
|| item.sub_type == WPN_QUARTERSTAFF
|| item.sub_type == WPN_SCYTHE
- || item.sub_type == WPN_DEMON_BLADE
- || item.sub_type == WPN_DEMON_WHIP
- || item.sub_type == WPN_DEMON_TRIDENT
+ || is_demonic(item)
|| is_blessed_blade(item))
{
return;
@@ -1452,9 +1450,9 @@ int weapon_rarity( int w_type )
case WPN_KNIFE:
case WPN_QUICK_BLADE:
case WPN_TRIPLE_SWORD:
- case WPN_DEMON_TRIDENT:
case WPN_DEMON_WHIP:
case WPN_DEMON_BLADE:
+ case WPN_DEMON_TRIDENT:
case WPN_BLESSED_FALCHION:
case WPN_BLESSED_LONG_SWORD:
case WPN_BLESSED_SCIMITAR:
@@ -1614,7 +1612,7 @@ int double_wpn_awkward_speed( const item_def &item )
return ((base * 30 + 10) / 20 + 2);
}
-bool is_demonic( const item_def &item )
+bool is_demonic(const item_def &item)
{
if (item.base_type == OBJ_WEAPONS)
{
@@ -1631,9 +1629,9 @@ bool is_demonic( const item_def &item )
}
return (false);
-} // end is_demonic()
+}
-bool is_blessed_blade( const item_def &item )
+bool is_blessed_blade(const item_def &item)
{
if (item.base_type == OBJ_WEAPONS)
{
@@ -1657,7 +1655,7 @@ bool is_blessed_blade( const item_def &item )
return (false);
} // end is_blessed_blade()
-bool is_convertible( const item_def &item )
+bool is_convertible(const item_def &item)
{
return (!is_artefact(item)
&& (item.base_type == OBJ_WEAPONS
@@ -1665,7 +1663,7 @@ bool is_convertible( const item_def &item )
|| weapon_skill(item) == SK_LONG_BLADES)));
} // end is_convertible()
-bool convert2good( item_def &item, bool allow_blessed )
+bool convert2good(item_def &item, bool allow_blessed)
{
if (item.base_type != OBJ_WEAPONS)
return (false);
@@ -1737,7 +1735,7 @@ bool convert2good( item_def &item, bool allow_blessed )
item.flags &= ~ISFLAG_RACIAL_MASK;
return (true);
-} // end convert2good()
+}
int weapon_str_weight( const item_def &wpn )
{
diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h
index 59e89f67ef..2dfc3e8f0c 100644
--- a/crawl-ref/source/itemprop.h
+++ b/crawl-ref/source/itemprop.h
@@ -667,14 +667,14 @@ 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_blessed_blade( const item_def &item );
-bool is_convertible( const item_def &item );
-bool convert2good( item_def &item, bool allow_blessed = true );
-
-int get_vorpal_type( const item_def &item );
-int get_damage_type( const item_def &item );
-bool does_damage_type( const item_def &item, int dam_type );
+bool is_demonic(const item_def &item);
+bool is_blessed_blade(const item_def &item);
+bool is_convertible(const item_def &item);
+bool convert2good(item_def &item, bool allow_blessed = true);
+
+int get_vorpal_type( const item_def &item );
+int get_damage_type( const item_def &item );
+bool does_damage_type( const item_def &item, int dam_type );
int weapon_str_weight( const item_def &wpn );
int weapon_dex_weight( const item_def &wpn );
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index 4a92ea8a1a..07b854f7be 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -1463,9 +1463,9 @@ static brand_type _determine_weapon_brand(const item_def& item, int item_level)
rc = SPWPN_VENOM;
break;
- case WPN_DEMON_TRIDENT:
case WPN_DEMON_WHIP:
case WPN_DEMON_BLADE:
+ case WPN_DEMON_TRIDENT:
if (one_chance_in(10))
rc = SPWPN_PAIN;
@@ -3497,11 +3497,11 @@ static item_make_species_type _give_weapon(monsters *mon, int level,
if (one_chance_in(7))
item.sub_type = WPN_BROAD_AXE;
if (one_chance_in(7))
- item.sub_type = WPN_DEMON_TRIDENT;
+ item.sub_type = WPN_DEMON_WHIP;
if (one_chance_in(7))
item.sub_type = WPN_DEMON_BLADE;
if (one_chance_in(7))
- item.sub_type = WPN_DEMON_WHIP;
+ item.sub_type = WPN_DEMON_TRIDENT;
if (one_chance_in(3))
set_item_ego_type( item, OBJ_WEAPONS, SPWPN_FLAMING );