Browse Source

Support for multiple pre-reqs

feature-config-parsing2
MagicBot 4 months ago
parent
commit
d3ef0c828d
  1. 13
      src/engine/wpak/PowersParser.java
  2. 2
      src/engine/wpak/data/EquipmentPreReq.java
  3. 2
      src/engine/wpak/data/PowerEntry.java

13
src/engine/wpak/PowersParser.java

@ -61,7 +61,8 @@ public class PowersParser { @@ -61,7 +61,8 @@ public class PowersParser {
StringBuilder powerBuilder = new StringBuilder();
String conditionString;
String powerString;
java.util.Iterator<String> iterator;
java.util.Iterator<String> argumentIterator;
int endPos = 0;
// Separate out any conditions from the power data
@ -95,7 +96,7 @@ public class PowersParser { @@ -95,7 +96,7 @@ public class PowersParser {
while (matcher.find())
powerHeader.add(matcher.group().trim());
java.util.Iterator<String> iterator = powerHeader.iterator();
iterator = powerHeader.iterator();
powerEntry.power_id = iterator.next();
powerEntry.power = iterator.next().replaceAll("\"", "");
@ -202,10 +203,14 @@ public class PowersParser { @@ -202,10 +203,14 @@ public class PowersParser {
while (matcher1.find())
arguments.add(matcher1.group().trim());
argumentIterator = arguments.iterator();
while (argumentIterator.hasNext()) {
equipmentPreReq.slot = mbEnums.EquipSlotType.valueOf(arguments.get(0));
equipmentPreReq.skill = arguments.get(1).replaceAll("\"", "");
equipmentPreReq.level = Integer.parseInt(arguments.get(2));
powerEntry.equipmentPreReq = equipmentPreReq;
equipmentPreReq.required = Integer.parseInt(arguments.get(2));
powerEntry.equipmentPreReq.add(equipmentPreReq);
}
break;
case "CANCASTWHILEMOVING":
powerEntry.canCastWhileMoving = Boolean.parseBoolean(lineValues.get(1).trim());

2
src/engine/wpak/data/EquipmentPreReq.java

@ -14,6 +14,6 @@ public class EquipmentPreReq { @@ -14,6 +14,6 @@ public class EquipmentPreReq {
public mbEnums.EquipSlotType slot;
public String skill;
public int level;
public int required;
}

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

@ -50,7 +50,7 @@ public class PowerEntry { @@ -50,7 +50,7 @@ public class PowerEntry {
public boolean canCastWhileMoving = false;
public boolean bladeTrails = false;
public ArrayList<EffectDescription> effectPreReqs = new ArrayList<>();
public EquipmentPreReq equipmentPreReq;
public ArrayList<EquipmentPreReq> equipmentPreReq = new ArrayList<>();
public EnumSet<mbEnums.MonsterType> monsterRestricts = EnumSet.noneOf(mbEnums.MonsterType.class);
public EnumSet<mbEnums.MonsterType> monsterPrereqs = EnumSet.noneOf(mbEnums.MonsterType.class);
public boolean shouldCheckPath = false;

Loading…
Cancel
Save