Browse Source

PowerActionEntry parsing work.

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

9
src/engine/wpak/PowerActionParser.java

@ -103,6 +103,12 @@ public class PowerActionParser {
for (String bodyPart : arguments) for (String bodyPart : arguments)
powerActionEntry.bodyparts.add(Integer.parseInt(bodyPart)); powerActionEntry.bodyparts.add(Integer.parseInt(bodyPart));
break; break;
case "FEMALEBODYPARTS":
arguments = lineValues[1].trim().split("\\s+");
for (String bodyPart : arguments)
powerActionEntry.femaleBodyParts.add(Integer.parseInt(bodyPart));
break;
case "ISRESISTABLE": case "ISRESISTABLE":
powerActionEntry.isResistable = Boolean.parseBoolean(lineValues[1].trim()); powerActionEntry.isResistable = Boolean.parseBoolean(lineValues[1].trim());
break; break;
@ -130,6 +136,9 @@ public class PowerActionParser {
for (String bodyPart : arguments) for (String bodyPart : arguments)
powerActionEntry.attackAnimations.add(Integer.parseInt(bodyPart)); powerActionEntry.attackAnimations.add(Integer.parseInt(bodyPart));
break; break;
case "WEAROFFEFFECTOTHER": // Keys not parsed go here.
case "WEAROFFEFFECTSELF":
break;
default: default:
Logger.error("Unhandled variable type:" + key + " for powerAction: " + powerActionEntry.action_id); Logger.error("Unhandled variable type:" + key + " for powerAction: " + powerActionEntry.action_id);
} }

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

@ -21,6 +21,7 @@ public class PowerActionEntry {
// Additional variables after header go here. // Additional variables after header go here.
public ArrayList<Integer> bodyparts = new ArrayList<>(); public ArrayList<Integer> bodyparts = new ArrayList<>();
public ArrayList<Integer> femaleBodyParts = new ArrayList<>();
public boolean shouldShowWeapons = false; public boolean shouldShowWeapons = false;
public boolean shouldShowArmor = false; public boolean shouldShowArmor = false;
public boolean bladeTrails = false; public boolean bladeTrails = false;

Loading…
Cancel
Save