From 46170e3ab7a7f560e437a6fba42f0e6a557d5031 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 29 Mar 2024 19:11:47 -0500 Subject: [PATCH] players can use weapon powers again --- src/engine/gameManager/CombatManager.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index 322767a3..c8875872 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -297,7 +297,19 @@ public enum CombatManager { TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) damage, attackAnim); DispatchMessage.sendToAllInRange(target, cmm); } + DeferredPowerJob dpj = null; + if (attacker.getObjectType().equals(Enum.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); + } + } //calculate next allowed attack and update the timestamp long delay = 20 * 100;