summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-01 10:29:29 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-01 10:29:29 +0000
commit2b9197efde1c28e983c988def8f7d673f8699ebe (patch)
tree3fc36b49afa56a05a2f66b11d8caf3df1b0b5973 /crawl-ref/source/item_use.cc
parent8f9d46bf1414be7cbe44a9c38689879ab8eb4031 (diff)
downloadcrawl-ref-2b9197efde1c28e983c988def8f7d673f8699ebe.tar.gz
crawl-ref-2b9197efde1c28e983c988def8f7d673f8699ebe.zip
[1804917] Berserkers no longer get Polearms skill for their throwing spears, since the spears use only Throwing.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2282 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc29
1 files changed, 9 insertions, 20 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 18d4c1ffe5..e1cdbb2bce 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1561,9 +1561,10 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
dist *target)
{
dist thr;
- char shoot_skill = 0;
+ int shoot_skill = 0;
- char lnchClass, lnchType; // launcher class and type
+ // launcher weapon sub-type
+ weapon_type lnchType;
int baseHit = 0, baseDam = 0; // from thrown or ammo
int ammoHitBonus = 0, ammoDamBonus = 0; // from thrown or ammo
@@ -1656,17 +1657,10 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
// get the launcher class,type. Convenience.
if (you.equip[EQ_WEAPON] < 0)
- {
- lnchClass = -1;
- // set lnchType to 0 so the 'figure out if launched'
- // code doesn't break
- lnchType = 0;
- }
+ lnchType = NUM_WEAPONS;
else
- {
- lnchClass = you.inv[you.equip[EQ_WEAPON]].base_type;
- lnchType = you.inv[you.equip[EQ_WEAPON]].sub_type;
- }
+ lnchType =
+ static_cast<weapon_type>( you.inv[you.equip[EQ_WEAPON]].sub_type );
// baseHit and damage for generic objects
baseHit = you.strength - item_mass(item) / 10;
@@ -1705,7 +1699,6 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
const int bow_brand = get_weapon_brand( launcher );
const int ammo_brand = get_ammo_brand( item );
bool poisoned = (ammo_brand == SPMSL_POISONED);
-// const int throw_skill = you.skills[SK_THROWING];
const int item_base_dam = property( item, PWPN_DAMAGE );
const int lnch_base_dam = property( launcher, PWPN_DAMAGE );
@@ -1773,7 +1766,6 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
// i.e. not launched ones. (Sep 10, 2007)
shoot_skill = you.skills[launcher_skill];
-// effSkill = (shoot_skill * 2 + throw_skill) / 3;
effSkill = shoot_skill;
const int speed = launcher_final_speed(launcher, player_shield());
@@ -1782,9 +1774,6 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
#endif
you.time_taken = speed * you.time_taken / 100;
- // effSkill = you.skills[SK_THROWING] * 2 + 1;
- // effSkill = (shoot_skill > effSkill) ? effSkill : shoot_skill;
-
// [dshaligram] Improving missile weapons:
// - Remove the strength/enchantment cap where you need to be strong
// to exploit a launcher bonus.
@@ -1995,7 +1984,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
}
else if (random2(100) < shoot_skill)
{
- item_def& weapon = you.inv[you.equip[EQ_WEAPON]];
+ item_def& weapon = you.inv[you.equip[EQ_WEAPON]];
set_ident_flags(weapon, ISFLAG_KNOW_PLUSES);
mprf("You are wielding %s.", weapon.name(DESC_NOCAP_A).c_str());
@@ -2077,7 +2066,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
exercise(SK_DARTS, 1 + random2avg(3, 2));
break;
case MI_JAVELIN:
- // Javelins use polearm and throwing skills.
+ // Javelins use throwing skill.
baseHit = -1;
baseDam = property( item, PWPN_DAMAGE );
exHitBonus += (skill_bump(SK_THROWING) * 7 / 2);
@@ -2108,7 +2097,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
// Nets train throwing
exercise(SK_THROWING, 1);
- break;
+ break;
}
}