From 92c8430031c4c027000999e39b5894a5cb267a7c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 20 Apr 2024 11:13:31 -0400 Subject: [PATCH] Item prefix and suffix applied --- src/engine/gameManager/ForgeManager.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index a59ebc66..86ffc095 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -379,12 +379,12 @@ public enum ForgeManager implements Runnable { switch (itemModType) { case PREFIX: - modifier = vendor.getModTypeTable().get(vendor.getItemModTable().indexOf(modTable)); - modTypeTableEntry = ModTypeTableEntry.rollTable(modifier, ThreadLocalRandom.current().nextInt(1, 100 + 1)); + int randomPrefix = vendor.getModTypeTable().get(vendor.getItemModTable().indexOf(modTable)); + modTypeTableEntry = ModTypeTableEntry.rollTable(randomPrefix, ThreadLocalRandom.current().nextInt(1, 100 + 1)); break; case SUFFIX: - modifier = vendor.getModSuffixTable().get(vendor.getItemModTable().indexOf(modTable)); - modTypeTableEntry = ModTypeTableEntry.rollTable(modifier, ThreadLocalRandom.current().nextInt(1, 100 + 1)); + int randomSuffix = vendor.getModSuffixTable().get(vendor.getItemModTable().indexOf(modTable)); + modTypeTableEntry = ModTypeTableEntry.rollTable(randomSuffix, ThreadLocalRandom.current().nextInt(1, 100 + 1)); break; } @@ -396,9 +396,6 @@ public enum ForgeManager implements Runnable { if (rollForModifier < 80) { int randomModifier = LootManager.TableRoll(vendor.getLevel(), false); modTableEntry = ModTableEntry.rollTable(modTypeTableEntry.modTableID, randomModifier); - } - - if (modTableEntry != null) { AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(modTableEntry.action); modifier = abstractPowerAction.getEffectsBase().getToken(); }