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 {
case Stamina: case Stamina:
effectModifier.min = Float.parseFloat(modValues.get(1).trim()); effectModifier.min = Float.parseFloat(modValues.get(1).trim());
effectModifier.max = Float.parseFloat(modValues.get(2).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. // Parameter 4 is always 0.
effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(5).trim()); effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(5).trim());
effectModifier.arg1 = modValues.get(6).trim(); effectModifier.arg1 = modValues.get(6).trim();
@ -211,7 +211,7 @@ public class EffectsParser {
case Fade: case Fade:
case Durability: case Durability:
effectModifier.min = Float.parseFloat(modValues.get(1).trim()); 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()); effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim());
if (modValues.size() > 4) if (modValues.size() > 4)
@ -238,14 +238,10 @@ public class EffectsParser {
case Dodge: case Dodge:
case WeaponRange: case WeaponRange:
case ScanRange: 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 ScaleHeight:
case ScaleWidth: case ScaleWidth:
effectModifier.min = Float.parseFloat(modValues.get(1).trim()); 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()); effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim());
break; break;
case ItemName: case ItemName:
@ -269,7 +265,7 @@ public class EffectsParser {
case WeaponProc: case WeaponProc:
effectModifier.min = Float.parseFloat(modValues.get(1).trim()); effectModifier.min = Float.parseFloat(modValues.get(1).trim());
effectModifier.arg1 = modValues.get(2).trim(); effectModifier.arg1 = modValues.get(2).trim();
effectModifier.scale = Float.parseFloat(modValues.get(3).trim()); effectModifier.max = Float.parseFloat(modValues.get(3).trim());
break; break;
default: default:
Logger.error("Unhandled type: " + effectModifier.type); Logger.error("Unhandled type: " + effectModifier.type);

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

@ -14,7 +14,7 @@ public class EffectModifier {
public mbEnums.ModType type; public mbEnums.ModType type;
public float min; public float min;
public float max; public float max;
public float scale; public float value;
public mbEnums.CompoundCurveType compoundCurveType; public mbEnums.CompoundCurveType compoundCurveType;
public String arg1; // ItemName "Masterwork" "" public String arg1; // ItemName "Masterwork" ""
public String arg2; // ItemName "" "of the Defender" public String arg2; // ItemName "" "of the Defender"

Loading…
Cancel
Save