diff --git a/src/engine/ConfigParsing/EffectsParser.java b/src/engine/ConfigParsing/EffectsParser.java index 383d9ec3..8ed857f1 100644 --- a/src/engine/ConfigParsing/EffectsParser.java +++ b/src/engine/ConfigParsing/EffectsParser.java @@ -11,6 +11,8 @@ package engine.ConfigParsing; import engine.ConfigParsing.EffectEntry.EffectEntry; import engine.ConfigParsing.EffectEntry.EffectModifier; import engine.gameManager.ConfigManager; +import engine.mbEnums; +import org.pmw.tinylog.Logger; import java.io.IOException; import java.nio.file.Files; @@ -111,7 +113,25 @@ public class EffectsParser { private static EffectModifier parseModEntry(String modData) { EffectModifier effectModifier = new EffectModifier(); + ArrayList modValues = new ArrayList<>(); + Matcher matcher = STRSPLIT_REGEX.matcher(modData); + + while (matcher.find()) + modValues.add(matcher.group(1).trim()); + + effectModifier.type = mbEnums.ModType.valueOf(modValues.get(0)); + + switch (effectModifier.type) { + case AnimOverride: + effectModifier.min = Integer.parseInt(modValues.get(1)); + effectModifier.max = Integer.parseInt(modValues.get(2)); + break; + default: + Logger.error("Unhandled type: " + effectModifier.type); + break; + + } return effectModifier; }