diff --git a/src/engine/wpak/PowerActionParser.java b/src/engine/wpak/PowerActionParser.java index d5b8b00b..a2e55654 100644 --- a/src/engine/wpak/PowerActionParser.java +++ b/src/engine/wpak/PowerActionParser.java @@ -11,6 +11,7 @@ package engine.wpak; import engine.gameManager.ConfigManager; import engine.wpak.data.EffectDescription; import engine.wpak.data.PowerActionEntry; +import org.pmw.tinylog.Logger; import java.io.IOException; import java.nio.file.Files; @@ -88,6 +89,52 @@ public class PowerActionParser { // Process key value pairs after header + + while (entryIterator.hasNext()) { + String lineValue = entryIterator.next(); + String[] lineValues = lineValue.split("="); + String key = lineValues[0].trim(); + String[] arguments; + + switch (key) { + case "BODYPARTS": + arguments = lineValues[1].trim().split("\\s+"); + + for (String bodyPart : arguments) + powerActionEntry.bodyparts.add(Integer.parseInt(bodyPart)); + break; + case "ISRESISTABLE": + powerActionEntry.isResistable = Boolean.parseBoolean(lineValues[1].trim()); + break; + case "ISAGGRESSIVE": + powerActionEntry.isAggressive = Boolean.parseBoolean(lineValues[1].trim()); + break; + case "BLADETRAILS": + powerActionEntry.bladeTrails = Boolean.parseBoolean(lineValues[1].trim()); + break; + case "SHOULDSHOWWEAPONS": + powerActionEntry.shouldShowWeapons = Boolean.parseBoolean(lineValues[1].trim()); + break; + case "SHOULDSHOWARMOR": + powerActionEntry.shouldShowArmor = Boolean.parseBoolean(lineValues[1].trim()); + break; + case "APPLYEFFECTBLANK": + powerActionEntry.applyEffectBlank = Boolean.parseBoolean(lineValues[1].trim()); + break; + case "WEAROFFEFFECTBLANK": + powerActionEntry.wearOffEffectBlank = Boolean.parseBoolean(lineValues[1].trim()); + break; + case "ATTACKANIMS": + arguments = lineValues[1].trim().split("\\s+"); + + for (String bodyPart : arguments) + powerActionEntry.attackAnimations.add(Integer.parseInt(bodyPart)); + break; + default: + Logger.error("Unhandled variable type:" + key + " for powerAction: " + powerActionEntry.action_id); + } + + } return powerActionEntry; } } diff --git a/src/engine/wpak/data/PowerActionEntry.java b/src/engine/wpak/data/PowerActionEntry.java index 5cd3aca1..0b84cd52 100644 --- a/src/engine/wpak/data/PowerActionEntry.java +++ b/src/engine/wpak/data/PowerActionEntry.java @@ -8,6 +8,8 @@ package engine.wpak.data; +import engine.mbEnums; + import java.util.ArrayList; public class PowerActionEntry { @@ -15,4 +17,23 @@ public class PowerActionEntry { public String action_id; public String action_type; public ArrayList effects; + + // Additional variables after header go here. + + public ArrayList bodyparts = new ArrayList<>(); + public boolean shouldShowWeapons = false; + public boolean shouldShowArmor = false; + public boolean bladeTrails = false; + public boolean isResistable = false; + public String effectID; + public ArrayList scaleFactor = new ArrayList<>(); + public ArrayList attackAnimations = new ArrayList<>(); + public boolean isAggressive; + public mbEnums.DamageType damageType; + public boolean applyEffectBlank = false; + public boolean wearOffEffectBlank = false; + + + + }