Browse Source

attack speed

lakebane-dex-penalty
FatBoy-DOTC 1 week ago
parent
commit
7964de1045
  1. 2
      src/engine/objects/PlayerBonuses.java
  2. 15
      src/engine/objects/PlayerCharacter.java

2
src/engine/objects/PlayerBonuses.java

@ -27,7 +27,7 @@ import java.util.concurrent.ConcurrentHashMap; @@ -27,7 +27,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class PlayerBonuses {
//First bonus set
private ConcurrentHashMap<AbstractEffectModifier, Float> bonusFloats = new ConcurrentHashMap<>();
ConcurrentHashMap<AbstractEffectModifier, Float> bonusFloats = new ConcurrentHashMap<>();
private ConcurrentHashMap<AbstractEffectModifier, DamageShield> bonusDamageShields = new ConcurrentHashMap<>();
private ConcurrentHashMap<AbstractEffectModifier, String> bonusStrings = new ConcurrentHashMap<>();
private ConcurrentHashMap<ModType, HashSet<SourceType>> bonusLists = new ConcurrentHashMap<>();

15
src/engine/objects/PlayerCharacter.java

@ -3970,8 +3970,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3970,8 +3970,7 @@ public class PlayerCharacter extends AbstractCharacter {
else
speed = 20f; //unarmed attack speed
//if (weapon != null) {
//speed *= (1 + this.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.None));
if(this.effects != null) {
for (Effect eff : this.effects.values()) {
for (AbstractEffectModifier mod : eff.getEffectModifiers()) {
if (mod.modType.equals(ModType.WeaponSpeed)) {
@ -3980,8 +3979,6 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3980,8 +3979,6 @@ public class PlayerCharacter extends AbstractCharacter {
}
}
}
//}
//speed *= (1 + this.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.None));
for (Effect eff : this.effects.values()) {
for (AbstractEffectModifier mod : eff.getEffectModifiers()) {
@ -3991,6 +3988,16 @@ public class PlayerCharacter extends AbstractCharacter { @@ -3991,6 +3988,16 @@ public class PlayerCharacter extends AbstractCharacter {
}
}
}
}
if(this.bonuses!= null){
for (AbstractEffectModifier mod : this.bonuses.bonusFloats.keySet()) {
if (mod.modType.equals(ModType.AttackDelay) || mod.modType.equals(ModType.WeaponSpeed)) {
float modValue = 1 + mod.getPercentMod() * 0.01f;
speed *= modValue;
}
}
}
if (speed < 10)
speed = 10;

Loading…
Cancel
Save