From 13a75fcd5de811daa4a8bb142920ee8931a2c610 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 20 Apr 2024 09:10:31 -0400 Subject: [PATCH] Item prefix and suffix applied --- src/engine/gameManager/ForgeManager.java | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) 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) {