Browse Source

min/max are floats

feature-config-parsing2
MagicBot 3 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;
public class EffectModifier { public class EffectModifier {
public mbEnums.ModType type; public mbEnums.ModType type;
public int min; public float min;
public int max; public float max;
public float scale; public float scale;
public mbEnums.CompoundCurveType compoundCurveType; public mbEnums.CompoundCurveType compoundCurveType;
public String arg1; // ItemName "Masterwork" "" public String arg1; // ItemName "Masterwork" ""

12
src/engine/ConfigParsing/EffectsParser.java

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

Loading…
Cancel
Save