Browse Source

apply weapon powers before early exit for defense of passives

postwipe-mines
FatBoy-DOTC 5 months ago
parent
commit
12e73d59c7
  1. 32
      src/engine/gameManager/CombatManager.java

32
src/engine/gameManager/CombatManager.java

@ -264,6 +264,22 @@ public enum CombatManager { @@ -264,6 +264,22 @@ public enum CombatManager {
atr = attacker.atrHandTwo;
}
//apply weapon powers before early exit for miss or passives
DeferredPowerJob dpj = null;
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
dpj = ((PlayerCharacter) attacker).getWeaponPower();
if (dpj != null) {
dpj.attack(target, attackRange);
if (dpj.getPower() != null && (dpj.getPowerToken() == -1851459567 || dpj.getPowerToken() == -1851489518))
((PlayerCharacter) attacker).setWeaponPower(dpj);
}
}
int def = 0;
if (AbstractCharacter.IsAbstractCharacter(target))
@ -446,20 +462,6 @@ public enum CombatManager { @@ -446,20 +462,6 @@ public enum CombatManager {
}
}
DeferredPowerJob dpj = null;
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
dpj = ((PlayerCharacter) attacker).getWeaponPower();
if (dpj != null) {
dpj.attack(target, attackRange);
if (dpj.getPower() != null && (dpj.getPowerToken() == -1851459567 || dpj.getPowerToken() == -1851489518))
((PlayerCharacter) attacker).setWeaponPower(dpj);
}
}
//set auto attack job
setAutoAttackJob(attacker, slot, delay);
@ -537,7 +539,7 @@ public enum CombatManager { @@ -537,7 +539,7 @@ public enum CombatManager {
}
//Item has no equipment slots and should not try to return an animation, return default instead
if(wb.item_eq_slots_or == null || wb.item_eq_slots_or.size() == 0){
if(wb.item_eq_slots_or == null || wb.item_eq_slots_or.isEmpty()){
return 75;
}

Loading…
Cancel
Save