From d17db3a1fd4e2ed0f73145793d533238215ce53c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 19 Aug 2024 06:15:50 -0400 Subject: [PATCH] More PowerEntry work. --- src/engine/wpak/PowersParser.java | 9 ++++++++- src/engine/wpak/data/PowerEntry.java | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/engine/wpak/PowersParser.java b/src/engine/wpak/PowersParser.java index fda1a415..b935bacc 100644 --- a/src/engine/wpak/PowersParser.java +++ b/src/engine/wpak/PowersParser.java @@ -162,7 +162,11 @@ public class PowersParser { case "HateValue": arguments = lineValues[1].trim().split(" "); powerEntry.hateValue = Integer.parseInt(arguments[0]); - powerEntry.hateCurve = mbEnums.CompoundCurveType.valueOf(arguments[1]); + + // Not all entries have a curve. Defaults to DefaultFlat; + + if (arguments.length > 1) + powerEntry.hateCurve = mbEnums.CompoundCurveType.valueOf(arguments[1]); break; case "LOOPANIMID": powerEntry.loopAnimID = Integer.parseInt(lineValues[1].trim()); @@ -196,6 +200,9 @@ public class PowersParser { powerEntry.bladeTrails = Boolean.parseBoolean(lineValues[1].trim()); break; case "SOUNDS": // Values not parsed + case "APPLYDAMAGECASTER": + case "APPLYDAMAGEOTHER": + case "APPLYDAMAGETARGET": case "APPLYEFFECTSELF": case "APPLYEFFECTOTHER": case "FIZZLEOTHER": diff --git a/src/engine/wpak/data/PowerEntry.java b/src/engine/wpak/data/PowerEntry.java index b4dd483b..e8129af0 100644 --- a/src/engine/wpak/data/PowerEntry.java +++ b/src/engine/wpak/data/PowerEntry.java @@ -39,7 +39,7 @@ public class PowerEntry { public ArrayList actions = new ArrayList<>(); public int maxLevel; public int hateValue; - public mbEnums.CompoundCurveType hateCurve; + public mbEnums.CompoundCurveType hateCurve = mbEnums.CompoundCurveType.DefaultFlat; public int loopAnimID; public String grantOverrideVar; public ArrayList description = new ArrayList<>();