Fix for weaponspeed effect modifier. #19

Merged
MagicBot merged 1 commits from EffectModifierFix into master 2 years ago
  1. 2
      src/engine/objects/PlayerCharacter.java
  2. 14
      src/engine/powers/effectmodifiers/WeaponSpeedEffectModifier.java

2
src/engine/objects/PlayerCharacter.java

@ -3885,7 +3885,7 @@ public void dismissNecroPets() {
else else
speed = 20f; //unarmed attack speed speed = 20f; //unarmed attack speed
if (weapon != null) if (weapon != null)
speed *= (1 + weapon.getBonusPercent(ModType.WeaponSpeed, SourceType.None)); speed *= (1 + this.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.None));
speed *= (1 + this.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.None)); speed *= (1 + this.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.None));
if (speed < 10) if (speed < 10)
speed = 10; speed = 10;

14
src/engine/powers/effectmodifiers/WeaponSpeedEffectModifier.java

@ -30,7 +30,19 @@ public class WeaponSpeedEffectModifier extends AbstractEffectModifier {
} }
@Override @Override
public void applyBonus(AbstractCharacter ac, int trains) {} public void applyBonus(AbstractCharacter ac, int trains) {
Float amount = 0f;
if (this.useRampAdd)
amount = this.percentMod + (this.ramp * trains);
else
amount = this.percentMod * (1 + (this.ramp * trains));
amount = amount/100;
ac.getBonuses().addFloat(this, amount);
}
@Override @Override
public void applyBonus(Item item, int trains) { public void applyBonus(Item item, int trains) {

Loading…
Cancel
Save