Browse Source

min/max are floats

feature-config-parsing2
MagicBot 4 months ago
parent
commit
eda27b2e9c
  1. 4
      src/engine/ConfigParsing/EffectEntry/EffectModifier.java
  2. 12
      src/engine/ConfigParsing/EffectsParser.java

4
src/engine/ConfigParsing/EffectEntry/EffectModifier.java

@ -4,8 +4,8 @@ import engine.mbEnums; @@ -4,8 +4,8 @@ import engine.mbEnums;
public class EffectModifier {
public mbEnums.ModType type;
public int min;
public int max;
public float min;
public float max;
public float scale;
public mbEnums.CompoundCurveType compoundCurveType;
public String arg1; // ItemName "Masterwork" ""

12
src/engine/ConfigParsing/EffectsParser.java

@ -132,14 +132,14 @@ public class EffectsParser { @@ -132,14 +132,14 @@ public class EffectsParser {
switch (effectModifier.type) {
case AnimOverride:
effectModifier.min = Integer.parseInt(modValues.get(1).trim());
effectModifier.max = Integer.parseInt(modValues.get(2).trim());
effectModifier.min = Float.parseFloat(modValues.get(1).trim());
effectModifier.max = Float.parseFloat(modValues.get(2).trim());
break;
case Health:
case Mana:
case Stamina:
effectModifier.min = Integer.parseInt(modValues.get(1).trim());
effectModifier.max = Integer.parseInt(modValues.get(2).trim());
effectModifier.min = Float.parseFloat(modValues.get(1).trim());
effectModifier.max = Float.parseFloat(modValues.get(2).trim());
effectModifier.scale = Float.parseFloat(modValues.get(3).trim());
// Parameter 4 is always 0.
effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(5).trim());
@ -153,7 +153,7 @@ public class EffectsParser { @@ -153,7 +153,7 @@ public class EffectsParser {
case StaminaRecoverRate:
case DamageShield:
case HealthFull:
effectModifier.min = Integer.parseInt(modValues.get(1).trim());
effectModifier.min = Float.parseFloat(modValues.get(1).trim());
effectModifier.scale = Float.parseFloat(modValues.get(2).trim());
effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim());
effectModifier.arg1 = modValues.get(4).trim();
@ -175,7 +175,7 @@ public class EffectsParser { @@ -175,7 +175,7 @@ public class EffectsParser {
case PowerDamageModifier:
case DR:
case PassiveDefense:
effectModifier.min = Integer.parseInt(modValues.get(1).trim());
effectModifier.min = Float.parseFloat(modValues.get(1).trim());
effectModifier.scale = Float.parseFloat(modValues.get(2).trim());
effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim());
break;

Loading…
Cancel
Save