diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index 03986464..4ad5cb63 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -64,10 +64,12 @@ public enum PowersManager { public static void initPowersManager(boolean fullPowersLoad) { - if (fullPowersLoad) - PowersManager.InitializePowers(); - else + if (fullPowersLoad) { + //PowersManager.InitializePowers(); + WpakPowerManager.init(); + }else { PowersManager.InitializeLoginPowers(); + } PowersManager.js = JobScheduler.getInstance(); diff --git a/src/engine/wpak/WpakPowerManager.java b/src/engine/wpak/WpakPowerManager.java index 8c4831de..7d3850d4 100644 --- a/src/engine/wpak/WpakPowerManager.java +++ b/src/engine/wpak/WpakPowerManager.java @@ -5,7 +5,6 @@ import engine.gameManager.*; import engine.job.JobContainer; import engine.job.JobScheduler; import engine.jobs.FinishRecycleTimeJob; -import engine.jobs.UsePowerJob; import engine.jobs.WpakUsePowerJob; import engine.math.Vector3fImmutable; import engine.mbEnums; @@ -16,14 +15,11 @@ import engine.net.client.msg.PerformActionMsg; import engine.net.client.msg.RecyclePowerMsg; import engine.net.client.msg.UpdateStateMsg; import engine.objects.*; -import engine.powers.PowersBase; import engine.server.MBServerStatics; import engine.util.Hasher; import engine.wpak.data.*; import engine.wpak.data.Effect; import org.pmw.tinylog.Logger; - -import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -31,42 +27,18 @@ import static engine.math.FastMath.sqr; public class WpakPowerManager { public static HashMap effect_data = new HashMap<>(); - public static HashMap power_actions= new HashMap<>(); - public static HashMap powers= new HashMap<>(); + public static HashMap power_actions = new HashMap<>(); + public static HashMap powers = new HashMap<>(); private static JobScheduler js; - public static void usePower(final PerformActionMsg msg, ClientConnection origin, boolean sendCastToSelf) { + public static void init(){ + EffectsParser.parseWpakFile(); + PowersParser.parseWpakFile(); + PowerActionParser.parseWpakFile(); + } - if (ConfigManager.MB_RULESET.getValue().equals("LORE")) { - PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID()); - PlayerCharacter caster = origin.getPlayerCharacter(); - PlayerCharacter target = PlayerCharacter.getFromCache(msg.getTargetID()); - if (pb != null && pb.enforceLore()) { - //if (caster.guild.equals(Guild.getErrantGuild())) - // return; - - if (target != null && caster.guild.getGuildType().equals(target.guild.getGuildType()) == false && target.getObjectType().equals(mbEnums.GameObjectType.Building) == false) { - RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID()); - Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg); - DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); - - // Send Fail to cast message - PlayerCharacter pc = SessionManager - .getPlayerCharacter(origin); - - if (pc != null) { - sendPowerMsg(pc, 2, msg); - if (pc.isCasting()) { - pc.update(); - } - - pc.setIsCasting(false); - } - return; - } - } - } + public static void usePower(final PerformActionMsg msg, ClientConnection origin, boolean sendCastToSelf) { if (castPower(msg, origin, sendCastToSelf)) { // Cast failed for some reason, reset timer @@ -87,7 +59,6 @@ public class WpakPowerManager { pc.setIsCasting(false); } - } }