v0.6.3a: fixed imbues and sharpshooting sometimes affecting str bonus

This commit is contained in:
Evan Debenham 2018-02-19 13:47:04 -05:00
parent 4f5355bca4
commit c892fb30cf
3 changed files with 12 additions and 10 deletions

View File

@ -52,8 +52,8 @@ public class MeleeWeapon extends Weapon {
@Override @Override
public int damageRoll(Char owner) { public int damageRoll(Char owner) {
int damage = super.damageRoll( owner ); int damage = imbue.damageFactor(super.damageRoll( owner ));
if (owner instanceof Hero) { if (owner instanceof Hero) {
int exStr = ((Hero)owner).STR() - STRReq(); int exStr = ((Hero)owner).STR() - STRReq();
if (exStr > 0) { if (exStr > 0) {
@ -61,7 +61,7 @@ public class MeleeWeapon extends Weapon {
} }
} }
return imbue.damageFactor(damage); return damage;
} }
@Override @Override

View File

@ -164,7 +164,8 @@ abstract public class MissileWeapon extends Weapon {
@Override @Override
public int damageRoll(Char owner) { public int damageRoll(Char owner) {
int damage = super.damageRoll( owner ); int damage = imbue.damageFactor(super.damageRoll( owner ));
damage = Math.round( damage * RingOfSharpshooting.damageMultiplier( owner ));
if (owner instanceof Hero && if (owner instanceof Hero &&
((Hero)owner).heroClass == HeroClass.HUNTRESS) { ((Hero)owner).heroClass == HeroClass.HUNTRESS) {
@ -174,7 +175,7 @@ abstract public class MissileWeapon extends Weapon {
} }
} }
return (int)(imbue.damageFactor(damage) * RingOfSharpshooting.damageMultiplier( owner )); return damage;
} }
@Override @Override
@ -234,8 +235,8 @@ abstract public class MissileWeapon extends Weapon {
String info = desc(); String info = desc();
info += "\n\n" + Messages.get( MissileWeapon.class, "stats", info += "\n\n" + Messages.get( MissileWeapon.class, "stats",
(int)(imbue.damageFactor(min()) * RingOfSharpshooting.damageMultiplier( Dungeon.hero )), Math.round(imbue.damageFactor(min()) * RingOfSharpshooting.damageMultiplier( Dungeon.hero )),
(int)(imbue.damageFactor(max()) * RingOfSharpshooting.damageMultiplier( Dungeon.hero )), Math.round(imbue.damageFactor(max()) * RingOfSharpshooting.damageMultiplier( Dungeon.hero )),
STRReq()); STRReq());
if (STRReq() > Dungeon.hero.STR()) { if (STRReq() > Dungeon.hero.STR()) {

View File

@ -69,14 +69,15 @@ public class ThrowingKnife extends MissileWeapon {
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) { if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
//deals 75% toward max to max on surprise, instead of min to max. //deals 75% toward max to max on surprise, instead of min to max.
int diff = max() - min(); int diff = max() - min();
int damage = Random.NormalIntRange( int damage = imbue.damageFactor(Random.NormalIntRange(
min() + Math.round(diff*0.75f), min() + Math.round(diff*0.75f),
max()); max()));
damage = Math.round(damage * RingOfSharpshooting.damageMultiplier( hero ));
int exStr = hero.STR() - STRReq(); int exStr = hero.STR() - STRReq();
if (exStr > 0 && hero.heroClass == HeroClass.HUNTRESS) { if (exStr > 0 && hero.heroClass == HeroClass.HUNTRESS) {
damage += Random.IntRange(0, exStr); damage += Random.IntRange(0, exStr);
} }
return (int)(imbue.damageFactor(damage) * RingOfSharpshooting.damageMultiplier( hero )); return damage;
} }
} }
return super.damageRoll(owner); return super.damageRoll(owner);