combat manager fix
This commit is contained in:
@@ -65,6 +65,9 @@ public enum CombatManager {
|
|||||||
} else if (mainWeapon == null && offWeapon != null && offWeapon.template.item_skill_required.containsKey("Block") == false) {
|
} else if (mainWeapon == null && offWeapon != null && offWeapon.template.item_skill_required.containsKey("Block") == false) {
|
||||||
//swing left hand only
|
//swing left hand only
|
||||||
processAttack(attacker, target, Enum.EquipSlotType.LHELD);
|
processAttack(attacker, target, Enum.EquipSlotType.LHELD);
|
||||||
|
} else if (mainWeapon != null && offWeapon == null) {
|
||||||
|
//swing left hand only
|
||||||
|
processAttack(attacker, target, Enum.EquipSlotType.RHELD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,7 +149,10 @@ public enum CombatManager {
|
|||||||
if (target.getObjectType() == Enum.GameObjectType.Building)
|
if (target.getObjectType() == Enum.GameObjectType.Building)
|
||||||
hitChance = 100;
|
hitChance = 100;
|
||||||
|
|
||||||
int passiveAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template, null, true);
|
int passiveAnim = getSwingAnimation(null, null, slot.equals(Enum.EquipSlotType.RHELD));
|
||||||
|
if(attacker.charItemManager.getEquipped().get(slot) != null){
|
||||||
|
passiveAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template, null, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (ThreadLocalRandom.current().nextInt(100) > hitChance) {
|
if (ThreadLocalRandom.current().nextInt(100) > hitChance) {
|
||||||
TargetedActionMsg msg = new TargetedActionMsg(attacker, target, 0f, passiveAnim);
|
TargetedActionMsg msg = new TargetedActionMsg(attacker, target, 0f, passiveAnim);
|
||||||
@@ -282,7 +288,11 @@ public enum CombatManager {
|
|||||||
else
|
else
|
||||||
((Building) target).setCurrentHitPoints(target.getCurrentHitpoints() - damage);
|
((Building) target).setCurrentHitPoints(target.getCurrentHitpoints() - damage);
|
||||||
|
|
||||||
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) damage, 0);
|
int attackAnim = getSwingAnimation(null,null,slot.equals(Enum.EquipSlotType.RHELD));
|
||||||
|
if (attacker.charItemManager.getEquipped().get(slot) != null) {
|
||||||
|
attackAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template,null,slot.equals(Enum.EquipSlotType.RHELD));
|
||||||
|
}
|
||||||
|
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) damage, attackAnim);
|
||||||
DispatchMessage.sendToAllInRange(target, cmm);
|
DispatchMessage.sendToAllInRange(target, cmm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user