Debug code added

This commit is contained in:
2024-08-20 15:01:28 -04:00
parent a8ea778c6e
commit 502dda0b3b
2 changed files with 97 additions and 80 deletions
+19 -4
View File
@@ -35,8 +35,7 @@ public class PowerActionParser {
try {
fileData = Files.readAllBytes(Paths.get(powerActionPath));
} catch (
IOException e) {
} catch (IOException e) {
throw new RuntimeException(e);
}
@@ -78,19 +77,35 @@ public class PowerActionParser {
headerData.add(matcher.group().trim());
Iterator<String> headerIterator = headerData.iterator();
powerActionEntry.action_id = headerIterator.next();
powerActionEntry.action_type = headerIterator.next();
switch (powerActionEntry.action_type) {
case "RemoveEffect":
effectDescription = new EffectDescription();
effectDescription.effect_id = headerIterator.next();
powerActionEntry.effects.add(effectDescription);
case "CreateMob":
powerActionEntry.arg1 = Integer.parseInt(headerIterator.next());
powerActionEntry.arg2 = Integer.parseInt(headerIterator.next());
break;
case "ApplyEffect":
case "DeferredPower ":
while (headerIterator.hasNext()) {
effectDescription = new EffectDescription();
effectDescription.effect_id = headerIterator.next();
effectDescription.level = Integer.parseInt(headerIterator.next());
powerActionEntry.effects.add(effectDescription);
}
break;
default:
Logger.error("Unhandled type " + powerActionEntry.action_type + " for Pow4erAction: " + powerActionEntry.action_id);
break;
}
// Process key value pairs after header
while (entryIterator.hasNext()) {
String lineValue = entryIterator.next();
String[] lineValues = lineValue.split("=");
@@ -33,5 +33,7 @@ public class PowerActionEntry {
public mbEnums.DamageType damageType;
public boolean applyEffectBlank = false;
public boolean wearOffEffectBlank = false;
public int arg1;
public int arg2;
}