Browse Source

Item prefix and suffix applied

combat-2
MagicBot 8 months ago
parent
commit
c133b2da5c
  1. 7
      src/engine/gameManager/ForgeManager.java

7
src/engine/gameManager/ForgeManager.java

@ -291,18 +291,15 @@ public enum ForgeManager implements Runnable {
private static void applyItemEffects(Item forgedItem) { private static void applyItemEffects(Item forgedItem) {
ModTableEntry prefixEntry = ModTableEntry.rollTable(forgedItem.template.modTable, forgedItem.prefixToken);
ModTableEntry suffixEntry = ModTableEntry.rollTable(forgedItem.template.modTable, forgedItem.suffixToken);
if (forgedItem.prefixToken != 0) { if (forgedItem.prefixToken != 0) {
EffectsBase prefix = PowersManager.getEffectByIDString(prefixEntry.action); EffectsBase prefix = PowersManager.getEffectByToken(forgedItem.prefixToken);
AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(prefix.getIDString()); AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(prefix.getIDString());
abstractPowerAction.applyEffectForItem(forgedItem, 0); abstractPowerAction.applyEffectForItem(forgedItem, 0);
forgedItem.getEffectNames().add(prefix.getName()); forgedItem.getEffectNames().add(prefix.getName());
} }
if (forgedItem.prefixToken != 0) { if (forgedItem.prefixToken != 0) {
EffectsBase suffix = PowersManager.getEffectByIDString(suffixEntry.action); EffectsBase suffix = PowersManager.getEffectByToken(forgedItem.suffixToken);
AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(suffix.getIDString()); AbstractPowerAction abstractPowerAction = PowersManager.getPowerActionByIDString(suffix.getIDString());
abstractPowerAction.applyEffectForItem(forgedItem, 0); abstractPowerAction.applyEffectForItem(forgedItem, 0);
forgedItem.getEffectNames().add(suffix.getName()); forgedItem.getEffectNames().add(suffix.getName());

Loading…
Cancel
Save