From a35c5ef3cc8f84a94ff67e1114971ec8fc179b2b Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 30 Dec 2022 07:39:23 -0500 Subject: [PATCH] Fix for weaponspeed effect modifier. --- src/engine/objects/PlayerCharacter.java | 2 +- .../effectmodifiers/WeaponSpeedEffectModifier.java | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 600af48b..d34aa21a 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -3885,7 +3885,7 @@ public void dismissNecroPets() { else speed = 20f; //unarmed attack speed 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)); if (speed < 10) speed = 10; diff --git a/src/engine/powers/effectmodifiers/WeaponSpeedEffectModifier.java b/src/engine/powers/effectmodifiers/WeaponSpeedEffectModifier.java index b47d8642..b108e691 100644 --- a/src/engine/powers/effectmodifiers/WeaponSpeedEffectModifier.java +++ b/src/engine/powers/effectmodifiers/WeaponSpeedEffectModifier.java @@ -30,7 +30,19 @@ public class WeaponSpeedEffectModifier extends AbstractEffectModifier { } @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 public void applyBonus(Item item, int trains) {