summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemname.cc
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-07-12 20:16:45 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-07-13 00:33:57 -0700
commit9b6b733bccd0de2af35eb6c28e94e4708a92004d (patch)
tree30400b1991c700b09fff5dc4644dc43a2c693121 /crawl-ref/source/itemname.cc
parent3663d864c83a72c7cf624617e9a9a5b8b5deaf6a (diff)
downloadcrawl-ref-9b6b733bccd0de2af35eb6c28e94e4708a92004d.tar.gz
crawl-ref-9b6b733bccd0de2af35eb6c28e94e4708a92004d.zip
Refactor weapon_skill()
This function was misleadingly named (it only provided the skill used for melee weapons, not ranged weapons), and incomplete; code along the lines of "is_ranged_weapon(*it) ? range_skill(*it) : weapon_skill(*it)" was scattered in about half a dozen different functions. I've corrected both of those problems (renaming weapon_ skill() to melee_skill() and adding item_weapon_skill()), and also possibly fixed two bugs in the process - an l_you.cc function that claimed to provide the skill used for the starting weapon (but actually only gave the melee skill), and unrand creation code that checked if a potential unrand swap used the same (melee) skill as the weapon type being generated.
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r--crawl-ref/source/itemname.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index b2aff04408..0158b9e0c5 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -86,7 +86,7 @@ static const char* _interesting_origin(const item_def &item)
switch (item.orig_monnum)
{
case MONS_SONJA:
- if (weapon_skill(item) == SK_SHORT_BLADES)
+ if (melee_skill(item) == SK_SHORT_BLADES)
return "Sonja";
case MONS_PSYCHE:
if (item.base_type == OBJ_WEAPONS && item.sub_type == WPN_DAGGER)
@@ -1327,9 +1327,9 @@ string item_def::name_aux(description_level_type desc, bool terse, bool ident,
// need a separate flag for this, so they can still have
// their holy weapons.
buff << "Blessed ";
- if (weapon_skill(*this) == SK_MACES_FLAILS)
+ if (melee_skill(*this) == SK_MACES_FLAILS)
buff << "Scourge";
- else if (weapon_skill(*this) == SK_POLEARMS)
+ else if (melee_skill(*this) == SK_POLEARMS)
buff << "Trishula";
else
buff << "Blade";