Browse Source

attack delay catching

combat-3
FatBoy-DOTC 7 months ago
parent
commit
0c00832264
  1. 9
      src/engine/gameManager/CombatManager.java
  2. 4
      src/engine/net/client/handlers/AttackCmdMsgHandler.java

9
src/engine/gameManager/CombatManager.java

@ -126,13 +126,6 @@ public enum CombatManager {
return; return;
} }
if (attacker.getTimers().containsKey("Attack" + slot)) {
AttackJob ajR = ((AttackJob)attacker.getTimers().get("Attack" + slot).getJob());
if(ajR.target.equals(target)){
return;
}
}
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
@ -229,7 +222,7 @@ public enum CombatManager {
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob)) if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
((Mob) attacker).nextAttackTime = System.currentTimeMillis() + delay; ((Mob) attacker).nextAttackTime = System.currentTimeMillis() + delay;
delay += addedDelay;
if (inRange) { if (inRange) {
//handle retaliate //handle retaliate

4
src/engine/net/client/handlers/AttackCmdMsgHandler.java

@ -91,6 +91,8 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler {
playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).cancelJob(); playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).cancelJob();
addedDelay = ajR.getStopTime() - System.currentTimeMillis(); addedDelay = ajR.getStopTime() - System.currentTimeMillis();
} }
}else{
return true;
} }
if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.LHELD)) { if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.LHELD)) {
@ -99,6 +101,8 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler {
playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).cancelJob(); playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).cancelJob();
addedDelay = ajL.getStopTime() - System.currentTimeMillis(); addedDelay = ajL.getStopTime() - System.currentTimeMillis();
} }
}else{
return true;
} }
CombatManager.combatCycle(playerCharacter, target, addedDelay); CombatManager.combatCycle(playerCharacter, target, addedDelay);

Loading…
Cancel
Save