From 9d89f5d7f480797604ee609831087a34467730cd Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 20 Aug 2024 17:07:00 -0400 Subject: [PATCH] More poweraction parsing work. --- src/engine/wpak/PowerActionParser.java | 13 +++++++++---- src/engine/wpak/data/PowerActionEntry.java | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/engine/wpak/PowerActionParser.java b/src/engine/wpak/PowerActionParser.java index 646f7f2f..97c040ff 100644 --- a/src/engine/wpak/PowerActionParser.java +++ b/src/engine/wpak/PowerActionParser.java @@ -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 { 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 { 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; diff --git a/src/engine/wpak/data/PowerActionEntry.java b/src/engine/wpak/data/PowerActionEntry.java index fd95f82a..4f4ff2b1 100644 --- a/src/engine/wpak/data/PowerActionEntry.java +++ b/src/engine/wpak/data/PowerActionEntry.java @@ -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.