From 501c68b1e36fc1e73841bdc417763cdf1b993992 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 20 Apr 2024 09:34:49 -0400 Subject: [PATCH] Item prefix and suffix applied --- src/engine/gameManager/ForgeManager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index e9a668f3..e36fda80 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -8,6 +8,7 @@ package engine.gameManager; +import engine.loot.ModTableEntry; import engine.loot.ModTypeTableEntry; import engine.loot.WorkOrder; import engine.mbEnums; @@ -290,16 +291,18 @@ public enum ForgeManager implements Runnable { private static void applyItemEffects(Item forgedItem) { - EffectsBase prefix = PowersManager.getEffectByToken(forgedItem.prefixToken); - EffectsBase suffix = PowersManager.getEffectByToken(forgedItem.suffixToken); + ModTableEntry prefixEntry = ModTableEntry.rollTable(forgedItem.template.modTable, forgedItem.prefixToken); + ModTableEntry suffixEntry = ModTableEntry.rollTable(forgedItem.template.modTable, forgedItem.suffixToken); if (forgedItem.prefixToken != 0) { + EffectsBase prefix = PowersManager.getEffectByIDString(prefixEntry.action); AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(prefix.getIDString()); abstractPowerAction.applyEffectForItem(forgedItem, 0); forgedItem.getEffectNames().add(prefix.getName()); } - if (forgedItem.suffixToken != 0) { + if (forgedItem.prefixToken != 0) { + EffectsBase suffix = PowersManager.getEffectByIDString(suffixEntry.action); AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(suffix.getIDString()); abstractPowerAction.applyEffectForItem(forgedItem, 0); forgedItem.getEffectNames().add(suffix.getName());