From ecd72150038ffbd861c1d9b1db0ed83b1969bff0 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 22 Aug 2024 16:01:42 -0400 Subject: [PATCH] Parsing cleanup work. --- src/engine/wpak/EffectsParser.java | 12 ++++-------- src/engine/wpak/data/EffectModifier.java | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/engine/wpak/EffectsParser.java b/src/engine/wpak/EffectsParser.java index 4244d921..36b55f85 100644 --- a/src/engine/wpak/EffectsParser.java +++ b/src/engine/wpak/EffectsParser.java @@ -192,7 +192,7 @@ public class EffectsParser { case Stamina: effectModifier.min = Float.parseFloat(modValues.get(1).trim()); effectModifier.max = Float.parseFloat(modValues.get(2).trim()); - effectModifier.scale = Float.parseFloat(modValues.get(3).trim()); + effectModifier.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(); @@ -211,7 +211,7 @@ public class EffectsParser { case Fade: case Durability: effectModifier.min = Float.parseFloat(modValues.get(1).trim()); - effectModifier.scale = Float.parseFloat(modValues.get(2).trim()); + effectModifier.max = Float.parseFloat(modValues.get(2).trim()); effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim()); if (modValues.size() > 4) @@ -238,14 +238,10 @@ public class EffectsParser { case Dodge: case WeaponRange: case ScanRange: - 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()); - break; case ScaleHeight: case ScaleWidth: effectModifier.min = Float.parseFloat(modValues.get(1).trim()); - effectModifier.scale = Float.parseFloat(modValues.get(2).trim()); + effectModifier.max = Float.parseFloat(modValues.get(2).trim()); effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim()); break; case ItemName: @@ -269,7 +265,7 @@ public class EffectsParser { case WeaponProc: effectModifier.min = Float.parseFloat(modValues.get(1).trim()); effectModifier.arg1 = modValues.get(2).trim(); - effectModifier.scale = Float.parseFloat(modValues.get(3).trim()); + effectModifier.max = Float.parseFloat(modValues.get(3).trim()); break; default: Logger.error("Unhandled type: " + effectModifier.type); diff --git a/src/engine/wpak/data/EffectModifier.java b/src/engine/wpak/data/EffectModifier.java index abb1b3ff..1262cd8f 100644 --- a/src/engine/wpak/data/EffectModifier.java +++ b/src/engine/wpak/data/EffectModifier.java @@ -14,7 +14,7 @@ public class EffectModifier { public mbEnums.ModType type; public float min; public float max; - public float scale; + public float value; public mbEnums.CompoundCurveType compoundCurveType; public String arg1; // ItemName "Masterwork" "" public String arg2; // ItemName "" "of the Defender"