summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-01 17:58:23 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-01 17:58:23 +0000
commite9a58044e36966a261704a21681e1240f985ea45 (patch)
tree004a32ac09987e6ca2f0bfffcf921b7330bc65da /crawl-ref/source/fight.cc
parentd813da0afb4ebeea2c25dbdae36060eee5424d45 (diff)
downloadcrawl-ref-e9a58044e36966a261704a21681e1240f985ea45.tar.gz
crawl-ref-e9a58044e36966a261704a21681e1240f985ea45.zip
Fix [2794986]: Special damage descriptions weren't being displayed for
weapons with multiple damage types. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9876 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 2f1b22783f..9900d9a501 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -1683,14 +1683,14 @@ int melee_attack::player_weapon_type_modify(int damage)
if (!weapon)
weap_type = WPN_UNARMED;
- else if (item_is_staff( *weapon ))
+ else if (item_is_staff(*weapon))
weap_type = WPN_QUARTERSTAFF;
else if (weapon->base_type == OBJ_WEAPONS)
weap_type = weapon->sub_type;
// All weak hits look the same, except for when the player
- // has a non-weapon in hand. -- bwr
- // Exception: vampire bats only _bite_ to allow for drawing blood
+ // has a non-weapon in hand. - bwr
+ // Exception: vampire bats only bite to allow for drawing blood.
if (damage < HIT_WEAK
&& (you.species != SP_VAMPIRE || !player_in_bat_form()))
{
@@ -1759,7 +1759,10 @@ int melee_attack::player_weapon_type_modify(int damage)
return (damage);
}
- switch (weapon ? get_damage_type(*weapon) : -1)
+ // Take normal hits into account. If the hit is from a weapon with
+ // more than one damage type, randomly choose one damage type from
+ // it.
+ switch (weapon ? single_damage_type(*weapon) : -1)
{
case DAM_PIERCE:
if (damage < HIT_MED)
@@ -1794,7 +1797,7 @@ int melee_attack::player_weapon_type_modify(int damage)
case DAM_BLUDGEON:
if (damage < HIT_MED)
- attack_verb = one_chance_in(4)? "thump" : "sock";
+ attack_verb = one_chance_in(4) ? "thump" : "sock";
else if (damage < HIT_STRONG)
attack_verb = "bludgeon";
else