summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-06 00:40:24 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-06 00:40:24 +0000
commit8e7ee98e5431a1bae43b253848a10e2ec2cb12b5 (patch)
tree0a2265b64124b33a65017e9110134806666ba4f2 /crawl-ref
parente84562b1b71f7d9c094d1da7f4e8753ab37550d8 (diff)
downloadcrawl-ref-8e7ee98e5431a1bae43b253848a10e2ec2cb12b5.tar.gz
crawl-ref-8e7ee98e5431a1bae43b253848a10e2ec2cb12b5.zip
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
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/item_use.cc2
-rw-r--r--crawl-ref/source/itemprop.cc16
2 files changed, 12 insertions, 6 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index cbe90a4083..266d4fef52 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -136,8 +136,6 @@ bool can_wield(item_def *weapon, bool say_reason,
// Small species wielding large weapons...
if (player_size(PSIZE_BODY) < SIZE_MEDIUM
- && weapon_skill(*weapon) != SK_STAVES
- && weapon->sub_type != WPN_BOW
&& !check_weapon_wieldable_size(*weapon, player_size(PSIZE_BODY)))
{
SAY(mpr("That's too large for you to wield."));
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