|
|
@ -35,8 +35,7 @@ public class PowerActionParser { |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
fileData = Files.readAllBytes(Paths.get(powerActionPath)); |
|
|
|
fileData = Files.readAllBytes(Paths.get(powerActionPath)); |
|
|
|
} catch ( |
|
|
|
} catch (IOException e) { |
|
|
|
IOException e) { |
|
|
|
|
|
|
|
throw new RuntimeException(e); |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -78,19 +77,35 @@ public class PowerActionParser { |
|
|
|
headerData.add(matcher.group().trim()); |
|
|
|
headerData.add(matcher.group().trim()); |
|
|
|
|
|
|
|
|
|
|
|
Iterator<String> headerIterator = headerData.iterator(); |
|
|
|
Iterator<String> headerIterator = headerData.iterator(); |
|
|
|
|
|
|
|
|
|
|
|
powerActionEntry.action_id = headerIterator.next(); |
|
|
|
powerActionEntry.action_id = headerIterator.next(); |
|
|
|
powerActionEntry.action_type = 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()) { |
|
|
|
while (headerIterator.hasNext()) { |
|
|
|
effectDescription = new EffectDescription(); |
|
|
|
effectDescription = new EffectDescription(); |
|
|
|
effectDescription.effect_id = headerIterator.next(); |
|
|
|
effectDescription.effect_id = headerIterator.next(); |
|
|
|
effectDescription.level = Integer.parseInt(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
|
|
|
|
// Process key value pairs after header
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (entryIterator.hasNext()) { |
|
|
|
while (entryIterator.hasNext()) { |
|
|
|
String lineValue = entryIterator.next(); |
|
|
|
String lineValue = entryIterator.next(); |
|
|
|
String[] lineValues = lineValue.split("="); |
|
|
|
String[] lineValues = lineValue.split("="); |
|
|
|