Browse Source

Item prefix and suffix applied

combat-2
MagicBot 7 months ago
parent
commit
171c79dcf6
  1. 18
      src/engine/gameManager/ForgeManager.java

18
src/engine/gameManager/ForgeManager.java

@ -374,8 +374,8 @@ public enum ForgeManager implements Runnable { @@ -374,8 +374,8 @@ public enum ForgeManager implements Runnable {
int modifier = 0;
ModTypeTableEntry modTypeTableEntry = null;
ModTableEntry modRollEntry = null;
int modifierRoll;
ModTableEntry modTableEntry = null;
int rollForModifier;
switch (itemModType) {
case PREFIX:
@ -391,16 +391,16 @@ public enum ForgeManager implements Runnable { @@ -391,16 +391,16 @@ public enum ForgeManager implements Runnable {
if (modTypeTableEntry == null)
return 0;
modifierRoll = ThreadLocalRandom.current().nextInt(1, 100 + 1);
rollForModifier = ThreadLocalRandom.current().nextInt(1, 100 + 1);
if (modifierRoll < 80) {
modifierRoll = LootManager.TableRoll(vendor.getLevel(), false);
modRollEntry = ModTableEntry.rollTable(modTypeTableEntry.modTableID, modifierRoll);
if (rollForModifier < 80) {
rollForModifier = LootManager.TableRoll(vendor.getLevel(), false);
modTableEntry = ModTableEntry.rollTable(modTypeTableEntry.modTableID, rollForModifier);
}
if (modRollEntry != null) {
AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(modRollEntry.action);
modifier = abstractPowerAction.getParent().token;
if (modTableEntry != null) {
AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(modTableEntry.action);
modifier = abstractPowerAction.getEffectsBase().getToken();
}
return modifier;

Loading…
Cancel
Save