diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 8e044786..e9a668f3 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -15,6 +15,7 @@ import engine.net.DispatchMessage; import engine.net.client.msg.ItemProductionMsg; import engine.objects.*; import engine.powers.EffectsBase; +import engine.powers.poweractions.AbstractPowerAction; import org.pmw.tinylog.Logger; import java.util.ArrayList; @@ -289,20 +290,21 @@ public enum ForgeManager implements Runnable { private static void applyItemEffects(Item forgedItem) { - String prefixString; - String suffixString; - EffectsBase prefix = PowersManager.getEffectByToken(forgedItem.prefixToken); - EffectsBase prefixEffect = PowersManager.getEffectByIDString(prefix.getIDString() + 'A'); - EffectsBase suffix = PowersManager.getEffectByToken(forgedItem.suffixToken); - EffectsBase suffixEffect = PowersManager.getEffectByIDString(suffix.getIDString() + 'A'); - // if (forgedItem.prefixToken != 0) -// ItemManager.applyPrefixOrSuffix(forgedItem, prefixEffect.ac); + if (forgedItem.prefixToken != 0) { + AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(prefix.getIDString()); + abstractPowerAction.applyEffectForItem(forgedItem, 0); + forgedItem.getEffectNames().add(prefix.getName()); + } + + if (forgedItem.suffixToken != 0) { + AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(suffix.getIDString()); + abstractPowerAction.applyEffectForItem(forgedItem, 0); + forgedItem.getEffectNames().add(suffix.getName()); + } - // if (forgedItem.suffixToken != 0) - // ItemManager.applyPrefixOrSuffix(forgedItem, suffixEffect); } public static void completeWorkOrderBatch(WorkOrder workOrder) {