From 24a05543c8fa44a46ffc2cb842fe4971794b2941 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 20 Apr 2024 10:11:56 -0400 Subject: [PATCH] Item prefix and suffix applied --- src/engine/gameManager/ForgeManager.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 64f3873a..75d96b86 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -381,6 +381,7 @@ public enum ForgeManager implements Runnable { int modifier = 0; ModTypeTableEntry modTypeTableEntry = null; + ModTableEntry modRollEntry = null; int modifierRoll; switch (itemModType) { @@ -400,13 +401,14 @@ public enum ForgeManager implements Runnable { modifierRoll = ThreadLocalRandom.current().nextInt(1, 100 + 1); if (modifierRoll < 80) { - modifier = LootManager.TableRoll(vendor.getLevel(), false); - ModTableEntry modTableEntry = ModTableEntry.rollTable(modTable, modifier); - AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(modTableEntry.action); + modifierRoll = LootManager.TableRoll(vendor.getLevel(), false); + modRollEntry = ModTableEntry.rollTable(modTypeTableEntry.modTableID, modifierRoll); + } + + if (modRollEntry != null) { + AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(modRollEntry.action); modifier = abstractPowerAction.getEffectsBase().getToken(); } - else - modifier = 0; return modifier; }