diff --git a/src/engine/wpak/EffectsParser.java b/src/engine/wpak/EffectsParser.java index f887394b..0d7999d7 100644 --- a/src/engine/wpak/EffectsParser.java +++ b/src/engine/wpak/EffectsParser.java @@ -12,7 +12,7 @@ import engine.gameManager.ConfigManager; import engine.mbEnums; import engine.wpak.data.ConditionEntry; import engine.wpak.data.Effect; -import engine.wpak.data.EffectModifier; +import engine.wpak.data.ModifierEntry; import org.pmw.tinylog.Logger; import java.io.IOException; @@ -116,8 +116,8 @@ public class EffectsParser { // Iterate effect entries from .wpak config data while (matcher.find()) { - EffectModifier effectModifier = parseModEntry(matcher.group()); - effect.mods.add(effectModifier); + ModifierEntry modifierEntry = parseModEntry(matcher.group()); + effect.mods.add(modifierEntry); } // Parse Conditions @@ -148,9 +148,9 @@ public class EffectsParser { return effect; } - private static EffectModifier parseModEntry(String modData) { + private static ModifierEntry parseModEntry(String modData) { - EffectModifier effectModifier = new EffectModifier(); + ModifierEntry modifierEntry = new ModifierEntry(); String[] modEntries = modData.trim().split("\n"); @@ -162,22 +162,22 @@ public class EffectsParser { while (matcher.find()) modValues.add(matcher.group().trim()); - effectModifier.type = mbEnums.ModType.valueOf(modValues.get(0).trim()); + modifierEntry.type = mbEnums.ModType.valueOf(modValues.get(0).trim()); - switch (effectModifier.type) { + switch (modifierEntry.type) { case AnimOverride: - effectModifier.min = Float.parseFloat(modValues.get(1).trim()); - effectModifier.max = Float.parseFloat(modValues.get(2).trim()); + modifierEntry.min = Float.parseFloat(modValues.get(1).trim()); + modifierEntry.max = Float.parseFloat(modValues.get(2).trim()); break; case Health: case Mana: case Stamina: - effectModifier.min = Float.parseFloat(modValues.get(1).trim()); - effectModifier.max = Float.parseFloat(modValues.get(2).trim()); - effectModifier.value = Float.parseFloat(modValues.get(3).trim()); + modifierEntry.min = Float.parseFloat(modValues.get(1).trim()); + modifierEntry.max = Float.parseFloat(modValues.get(2).trim()); + modifierEntry.value = Float.parseFloat(modValues.get(3).trim()); // Parameter 4 is always 0. - effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(5).trim()); - effectModifier.arg1 = modValues.get(6).trim(); + modifierEntry.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(5).trim()); + modifierEntry.arg1 = modValues.get(6).trim(); break; case Attr: case Resistance: @@ -192,12 +192,12 @@ public class EffectsParser { case Slay: case Fade: case Durability: - effectModifier.min = Float.parseFloat(modValues.get(1).trim()); - effectModifier.max = Float.parseFloat(modValues.get(2).trim()); - effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim()); + modifierEntry.min = Float.parseFloat(modValues.get(1).trim()); + modifierEntry.max = Float.parseFloat(modValues.get(2).trim()); + modifierEntry.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim()); if (modValues.size() > 4) - effectModifier.arg1 = modValues.get(4).trim(); // Some HeathFull entries do not have an argument + modifierEntry.arg1 = modValues.get(4).trim(); // Some HeathFull entries do not have an argument break; case MeleeDamageModifier: case OCV: @@ -222,32 +222,32 @@ public class EffectsParser { case ScanRange: case ScaleHeight: case ScaleWidth: - effectModifier.min = Float.parseFloat(modValues.get(1).trim()); - effectModifier.max = Float.parseFloat(modValues.get(2).trim()); - effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim()); + modifierEntry.min = Float.parseFloat(modValues.get(1).trim()); + modifierEntry.max = Float.parseFloat(modValues.get(2).trim()); + modifierEntry.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim()); break; case ItemName: case BlockedPowerType: case ImmuneTo: case BlackMantle: - effectModifier.arg1 = modValues.get(1).trim(); + modifierEntry.arg1 = modValues.get(1).trim(); // Some BlockedPowerType entries have only one argument if (modValues.size() > 2) - effectModifier.arg2 = modValues.get(2).trim(); + modifierEntry.arg2 = modValues.get(2).trim(); break; case NoMod: case ConstrainedAmbidexterity: case ProtectionFrom: case ExclusiveDamageCap: case IgnoreDamageCap: - effectModifier.arg1 = modValues.get(1).trim(); + modifierEntry.arg1 = modValues.get(1).trim(); break; case WeaponProc: - effectModifier.min = Float.parseFloat(modValues.get(1).trim()); - effectModifier.arg1 = modValues.get(2).trim(); - effectModifier.max = Float.parseFloat(modValues.get(3).trim()); + modifierEntry.min = Float.parseFloat(modValues.get(1).trim()); + modifierEntry.arg1 = modValues.get(2).trim(); + modifierEntry.max = Float.parseFloat(modValues.get(3).trim()); break; case BladeTrails: // These tags have no parms or are not parsed case ImmuneToAttack: @@ -268,12 +268,12 @@ public class EffectsParser { case SeeInvisible: break; default: - Logger.error("Unhandled type: " + effectModifier.type); + Logger.error("Unhandled type: " + modifierEntry.type); break; } } - return effectModifier; + return modifierEntry; } } diff --git a/src/engine/wpak/PowersParser.java b/src/engine/wpak/PowersParser.java index e336d89b..b722de3b 100644 --- a/src/engine/wpak/PowersParser.java +++ b/src/engine/wpak/PowersParser.java @@ -101,7 +101,7 @@ public class PowersParser { powerEntry.power_id = iterator.next(); powerEntry.power = iterator.next().replaceAll("\"", ""); - PowerData power = new PowerData(); + PowerEntry power = new PowerEntry(); power.power_type = mbEnums.PowerType.valueOf(iterator.next()); power.icon = Integer.parseInt(iterator.next()); power.powerBase = iterator.next().replaceAll("\"", ""); @@ -112,7 +112,7 @@ public class PowersParser { // Account for second definition if (nextValue.equals("SPELL") || nextValue.equals("SKILL")) { - power = new PowerData(); + power = new PowerEntry(); power.power_type = mbEnums.PowerType.valueOf(nextValue); power.icon = Integer.parseInt(iterator.next()); power.powerBase = iterator.next().replaceAll("\"", ""); diff --git a/src/engine/wpak/data/Effect.java b/src/engine/wpak/data/Effect.java index c24ac5c6..31c7af87 100644 --- a/src/engine/wpak/data/Effect.java +++ b/src/engine/wpak/data/Effect.java @@ -16,7 +16,7 @@ public class Effect { public String effect_name; public int icon; public HashSet sources = new HashSet<>(); - public ArrayList mods = new ArrayList<>(); + public ArrayList mods = new ArrayList<>(); public ArrayList conditions = new ArrayList<>(); // Additional variables outside of tags or parsed diff --git a/src/engine/wpak/data/EffectModifier.java b/src/engine/wpak/data/ModifierEntry.java similarity index 97% rename from src/engine/wpak/data/EffectModifier.java rename to src/engine/wpak/data/ModifierEntry.java index 1262cd8f..d67d8a00 100644 --- a/src/engine/wpak/data/EffectModifier.java +++ b/src/engine/wpak/data/ModifierEntry.java @@ -10,7 +10,7 @@ package engine.wpak.data; import engine.mbEnums; -public class EffectModifier { +public class ModifierEntry { public mbEnums.ModType type; public float min; public float max; diff --git a/src/engine/wpak/data/Power.java b/src/engine/wpak/data/Power.java index 01ea413c..90efcac5 100644 --- a/src/engine/wpak/data/Power.java +++ b/src/engine/wpak/data/Power.java @@ -17,7 +17,7 @@ import java.util.HashMap; public class Power { public String power_id; public String power; - public ArrayList powers = new ArrayList<>(); + public ArrayList powers = new ArrayList<>(); public mbEnums.PowerTargetType target_type; public int range; public mbEnums.AreaType areaType; diff --git a/src/engine/wpak/data/PowerData.java b/src/engine/wpak/data/PowerEntry.java similarity index 97% rename from src/engine/wpak/data/PowerData.java rename to src/engine/wpak/data/PowerEntry.java index af98c498..fb805faa 100644 --- a/src/engine/wpak/data/PowerData.java +++ b/src/engine/wpak/data/PowerEntry.java @@ -10,7 +10,7 @@ package engine.wpak.data; import engine.mbEnums; -public class PowerData { +public class PowerEntry { public mbEnums.PowerType power_type; public int icon; public String powerBase;