diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index 8797adac..07b17f3f 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -850,6 +850,9 @@ public enum PowersManager { // return; //} + if(HandleItemEnchantments(playerCharacter, msg)) + return; + PerformActionMsg performActionMsg; Dispatch dispatch; @@ -3112,6 +3115,42 @@ public enum PowersManager { return true; } + public static boolean HandleItemEnchantments(PlayerCharacter pc, PerformActionMsg msg){ + switch(msg.getPowerUsedID()){ + case 429505998: // Reinforce Item + case 429407694: // hone weapon + case 429440462: // hone armor + case 429016905: //poison blade + case 429505610: // poison blade + case 427908971: // consecrate weapon + case 429439055: // mark of slaying + case 429605702: // annoint blade + case 429414682: // slay rat + case 429594877: // consecrate weapon + case 429440895: // charm of slaying + case 429491437: // infuse with power + PowersBase pb = PowersManager.getPowerByToken(msg.getPowerUsedID()); + if(pb == null) + return false; + for (ActionsBase action : pb.getActions()){ + try { + EffectsBase eb = action.getPowerAction().getEffectsBase(); + if(eb == null) + return false; + Effect eff = pc.addEffectNoTimer(eb.getName(),eb,msg.getNumTrains(),false); + if(eff == null){ + Logger.error(pc.getFirstName() + " failed to apply self buff: " + msg.getPowerUsedID()); + } + } + catch(Exception e){ + + } + } + return true; + } + return false; + } + }