Browse Source

Parsing cleanup work.

feature-config-parsing2
MagicBot 4 months ago
parent
commit
ecd7215003
  1. 12
      src/engine/wpak/EffectsParser.java
  2. 2
      src/engine/wpak/data/EffectModifier.java

12
src/engine/wpak/EffectsParser.java

@ -192,7 +192,7 @@ public class EffectsParser { @@ -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 { @@ -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 { @@ -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 { @@ -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);

2
src/engine/wpak/data/EffectModifier.java

@ -14,7 +14,7 @@ public class EffectModifier { @@ -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"

Loading…
Cancel
Save