Browse Source

attack speed calculations resolved

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

53
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)){
float percent = mod.getPercentMod();
int trains = eff.getTrains();
float modValue = percent + (trains * mod.getRamp());
speed *= 1 + (modValue * 0.01f);
}
}
}
}
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()){ for(AbstractEffectModifier mod : eff.getEffectModifiers()){
if(mod.modType.equals(Enum.ModType.AttackDelay)){ if(mod.modType.equals(Enum.ModType.AttackDelay) && !effID.contains("Stance")){
float percent = mod.getPercentMod(); float base = mod.getPercentMod();
int trains = eff.getTrains(); if(mod.getRamp() != 0)
float modValue = percent + (trains * mod.getRamp()); base += (mod.getRamp() * eff.getTrains());
delayExtra += modValue * 0.01f; base *= 0.01f;
} speed *= (1 + base);
} }
} }
} }
@ -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