Browse Source

attack delay catching

combat-3
FatBoy-DOTC 6 months ago
parent
commit
c2ea4424cf
  1. 20
      src/engine/gameManager/CombatManager.java

20
src/engine/gameManager/CombatManager.java

@ -126,6 +126,24 @@ public enum CombatManager {
return; return;
} }
long delay = 0L;
if(attacker.getTimestamps().containsKey("Attack" + slot)){
if(attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)){
if(slot.equals(mbEnums.EquipSlotType.RHELD)){
delay = (long)(attacker.speedHandOne * 100L);
}else{
delay = (long)(attacker.speedHandTwo * 100L);
}
}
if(System.currentTimeMillis() < attacker.getTimestamps().get("Attack" + slot)){
return;
}
}
attacker.getTimestamps().put("Attack" + slot, System.currentTimeMillis() + delay);
target.combatLock.writeLock().lock(); target.combatLock.writeLock().lock();
// check if character is in range to attack target // check if character is in range to attack target
@ -194,7 +212,7 @@ public enum CombatManager {
} }
//get delay for the auto attack job //get delay for the auto attack job
long delay = 5000; delay = 5000;
//if (weapon != null) { //if (weapon != null) {

Loading…
Cancel
Save