From 8e7ee98e5431a1bae43b253848a10e2ec2cb12b5 Mon Sep 17 00:00:00 2001 From: dolorous Date: Fri, 6 Feb 2009 00:40:24 +0000 Subject: In check_weapon_wieldable_size(), adjust fit a bit depending on size. To compensate for this, make quarterstaves and lajatangs medium instead of large, and dire flails large instead of medium. This eliminates the need for special cases when small races wield quarterstaves, lajatangs, or bows, and also hopefully restores 0.4's behavior regarding wieldable weapons, fixing [2569070]. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8915 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/itemprop.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/itemprop.cc') diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 4a079e1501..f7f7e7dd56 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -209,7 +209,7 @@ static weapon_def Weapon_prop[NUM_WEAPONS] = SK_MACES_FLAILS, HANDS_ONE, SIZE_MEDIUM, MI_NONE, false, DAMV_PIERCING | DAM_BLUDGEON, 2 }, { WPN_DIRE_FLAIL, "dire flail", 13, -3, 14, 240, 9, - SK_MACES_FLAILS, HANDS_DOUBLE, SIZE_MEDIUM, MI_NONE, false, + SK_MACES_FLAILS, HANDS_DOUBLE, SIZE_LARGE, MI_NONE, false, DAMV_PIERCING | DAM_BLUDGEON, 10 }, { WPN_GREAT_MACE, "great mace", 16, -4, 18, 270, 9, SK_MACES_FLAILS, HANDS_TWO, SIZE_LARGE, MI_NONE, false, @@ -330,10 +330,10 @@ static weapon_def Weapon_prop[NUM_WEAPONS] = // Staves { WPN_QUARTERSTAFF, "quarterstaff", 7, 6, 12, 180, 7, - SK_STAVES, HANDS_DOUBLE, SIZE_LARGE, MI_NONE, false, + SK_STAVES, HANDS_DOUBLE, SIZE_MEDIUM, MI_NONE, false, DAMV_CRUSHING, 10 }, { WPN_LAJATANG, "lajatang", 14, -3, 14, 200, 3, - SK_STAVES, HANDS_DOUBLE, SIZE_LARGE, MI_NONE, false, + SK_STAVES, HANDS_DOUBLE, SIZE_MEDIUM, MI_NONE, false, DAMV_SLICING, 2 }, // Range weapons @@ -2026,7 +2026,15 @@ bool check_weapon_wieldable_size( const item_def &item, size_type size ) { ASSERT( item.base_type == OBJ_WEAPONS || item.base_type == OBJ_STAVES ); - return (fit_weapon_wieldable_size( item, size ) == 0); + int fit = fit_weapon_wieldable_size( item, size ); + + // Adjust fit for size. + if (size < SIZE_MEDIUM && fit > 0) + fit--; + else if (size > SIZE_MEDIUM && fit < 0) + fit++; + + return (fit == 0); } // Note that this function is used to check validity of equipment -- cgit v1.2.3-54-g00ecf