V0.2.0: refactored/corrected Ring of Sharpshooting logic

This commit is contained in:
Evan Debenham
2014-09-12 11:07:27 -04:00
parent 5eea9c6cfc
commit 04b1ace7a7
4 changed files with 21 additions and 12 deletions
@@ -257,14 +257,8 @@ public class Hero extends Char {
@Override
public int attackSkill( Char target ) {
if (belongings.weapon != null && !usingRanged) {
if (belongings.weapon != null) {
return (int) (attackSkill * belongings.weapon.acuracyFactor(this));
} else if (usingRanged){
int bonus = 0;
for (Buff buff : buffs(RingOfSharpshooting.Aim.class)) {
bonus += ((RingOfSharpshooting.Aim)buff).level;
}
return (int)(attackSkill * Math.pow(1.1, bonus));
} else {
return attackSkill;
}