From e9a58044e36966a261704a21681e1240f985ea45 Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 1 Jun 2009 17:58:23 +0000 Subject: 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 --- crawl-ref/source/fight.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/fight.cc') 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 -- cgit v1.2.3-54-g00ecf