Browse Source

More PowerEntry work.

feature-config-parsing2
MagicBot 4 months ago
parent
commit
5cc979e2f3
  1. 15
      src/engine/wpak/PowersParser.java
  2. 1
      src/engine/wpak/data/PowerEntry.java

15
src/engine/wpak/PowersParser.java

@ -146,6 +146,8 @@ public class PowersParser { @@ -146,6 +146,8 @@ public class PowersParser {
String key = lineValues[0].trim();
PowerAction powerAction;
String[] arguments;
Matcher matcher1;
ArrayList<String> args;
switch (key) {
case "ACTION":
@ -192,11 +194,16 @@ public class PowersParser { @@ -192,11 +194,16 @@ public class PowersParser {
break;
case "EQPREREQ":
EquipmentPreReq equipmentPreReq = new EquipmentPreReq();
arguments = lineValues[1].trim().split(" ");
matcher1 = STRSPLIT_REGEX.matcher(lineValues[1].trim());
args = new ArrayList<>();
while (matcher1.find())
args.add(matcher.group().trim());
equipmentPreReq.slot = mbEnums.EquipSlotType.valueOf(arguments[0]);
equipmentPreReq.skill = arguments[1].trim();
equipmentPreReq.level = Integer.parseInt(arguments[2].trim());
equipmentPreReq.slot = mbEnums.EquipSlotType.valueOf(args.get(0));
equipmentPreReq.skill = args.get(1);
equipmentPreReq.level = Integer.parseInt(args.get(2));
powerEntry.equipmentPreReq = equipmentPreReq;
break;
case "CANCASTWHILEMOVING":
powerEntry.canCastWhileMoving = Boolean.parseBoolean(lineValues[1].trim());

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

@ -48,4 +48,5 @@ public class PowerEntry { @@ -48,4 +48,5 @@ public class PowerEntry {
public String category;
public boolean canCastWhileMoving = false;
public boolean bladeTrails = false;
public EquipmentPreReq equipmentPreReq;
}

Loading…
Cancel
Save