Browse Source

attack speed calculations resolved

lakebane-recovery
FatBoy-DOTC 4 days ago
parent
commit
50008b30d6
  1. 55
      src/engine/objects/PlayerCombatStats.java

55
src/engine/objects/PlayerCombatStats.java

@ -657,43 +657,20 @@ public class PlayerCombatStats {
}else { }else {
weapon = this.owner.charItemManager.getEquipped(2); weapon = this.owner.charItemManager.getEquipped(2);
} }
float delayExtra = 0;
if(weapon == null) { speed = weapon.getModifiedSpeed();
speed = 20.0f;
}else{ for(String effID : this.owner.effects.keySet()){
speed = weapon.getItemBase().getSpeed(); Effect eff = this.owner.effects.get(effID);
for(Effect eff : weapon.effects.values()){ if(eff == null)
for(AbstractEffectModifier mod : eff.getEffectModifiers()){ continue;
if(mod.modType.equals(Enum.ModType.WeaponSpeed) || mod.modType.equals(Enum.ModType.AttackDelay)){ for(AbstractEffectModifier mod : eff.getEffectModifiers()){
float percent = mod.getPercentMod(); if(mod.modType.equals(Enum.ModType.AttackDelay) && !effID.contains("Stance")){
int trains = eff.getTrains(); float base = mod.getPercentMod();
float modValue = percent + (trains * mod.getRamp()); if(mod.getRamp() != 0)
speed *= 1 + (modValue * 0.01f); base += (mod.getRamp() * eff.getTrains());
} base *= 0.01f;
} speed *= (1 + base);
}
}
if(this.owner.charItemManager.getEquipped(1) != null){
for(Effect eff : this.owner.charItemManager.getEquipped(1).effects.values()){
for(AbstractEffectModifier mod : eff.getEffectModifiers()){
if(mod.modType.equals(Enum.ModType.AttackDelay)){
float percent = mod.getPercentMod();
int trains = eff.getTrains();
float modValue = percent + (trains * mod.getRamp());
delayExtra += modValue * 0.01f;
}
}
}
}
if(this.owner.charItemManager.getEquipped(2) != null){
for(Effect eff : this.owner.charItemManager.getEquipped(2).effects.values()){
for(AbstractEffectModifier mod : eff.getEffectModifiers()){
if(mod.modType.equals(Enum.ModType.AttackDelay)){
float percent = mod.getPercentMod();
int trains = eff.getTrains();
float modValue = percent + (trains * mod.getRamp());
delayExtra += modValue * 0.01f;
}
} }
} }
} }
@ -713,11 +690,7 @@ public class PlayerCombatStats {
} }
} }
} }
float bonusValues = 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.AttackDelay,Enum.SourceType.None);//1.0f;
bonusValues -= stanceValue + delayExtra; // take away stance modifier from alacrity bonus values
speed *= 1 + stanceValue; // apply stance bonus speed *= 1 + stanceValue; // apply stance bonus
speed *= bonusValues; // apply alacrity bonuses without stance mod
if(speed < 10.0f) if(speed < 10.0f)
speed = 10.0f; speed = 10.0f;

Loading…
Cancel
Save