Browse Source

More poweraction parsing work.

feature-config-parsing2
MagicBot 3 months ago
parent
commit
9d89f5d7f4
  1. 13
      src/engine/wpak/PowerActionParser.java
  2. 2
      src/engine/wpak/data/PowerActionEntry.java

13
src/engine/wpak/PowerActionParser.java

@ -178,8 +178,8 @@ public class PowerActionParser { @@ -178,8 +178,8 @@ public class PowerActionParser {
case "SCALEFACTOR":
arguments = lineValues[1].trim().split("\\s+");
for (String bodyPart : arguments)
powerActionEntry.scaleFactor.add(Float.parseFloat(bodyPart));
for (String scaleFactor : arguments)
powerActionEntry.scaleFactor.add(Float.parseFloat(scaleFactor));
break;
case "ISRESISTABLE":
powerActionEntry.isResistible = Boolean.parseBoolean(lineValues[1].trim());
@ -205,8 +205,8 @@ public class PowerActionParser { @@ -205,8 +205,8 @@ public class PowerActionParser {
case "ATTACKANIMS":
arguments = lineValues[1].trim().split("\\s+");
for (String bodyPart : arguments)
powerActionEntry.attackAnimations.add(Integer.parseInt(bodyPart));
for (String animation : arguments)
powerActionEntry.attackAnimations.add(Integer.parseInt(animation));
break;
case "REMOVEALL":
powerActionEntry.removeAll = Boolean.parseBoolean(lineValues[1].trim());
@ -216,6 +216,11 @@ public class PowerActionParser { @@ -216,6 +216,11 @@ public class PowerActionParser {
effectDescription.effect_id = lineValues[1].trim();
powerActionEntry.effects.add(effectDescription);
break;
case "LEVELCAP":
arguments = lineValues[1].trim().split("\\s+");
powerActionEntry.levelCap = Integer.parseInt(arguments[0]);
powerActionEntry.levelCurve = mbEnums.CompoundCurveType.valueOf(arguments[1]);
break;
case "WEAROFFEFFECTOTHER": // Keys not parsed go here.
case "WEAROFFEFFECTSELF":
break;

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

@ -22,6 +22,8 @@ public class PowerActionEntry { @@ -22,6 +22,8 @@ public class PowerActionEntry {
public int petLevel;
public int petRace;
public StatTransfer statTransfer;
public int levelCap;
public mbEnums.CompoundCurveType levelCurve;
// Additional variables after header go here.

Loading…
Cancel
Save