Browse Source

PowerAction parsing work.

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

8
src/engine/wpak/PowerActionParser.java

@ -86,11 +86,12 @@ public class PowerActionParser {
effectDescription.effect_id = headerIterator.next(); effectDescription.effect_id = headerIterator.next();
powerActionEntry.effects.add(effectDescription); powerActionEntry.effects.add(effectDescription);
case "CreateMob": case "CreateMob":
powerActionEntry.arg1 = Integer.parseInt(headerIterator.next()); powerActionEntry.petLevel = Integer.parseInt(headerIterator.next());
powerActionEntry.arg2 = Integer.parseInt(headerIterator.next()); powerActionEntry.petRace = Integer.parseInt(headerIterator.next());
break; break;
case "ApplyEffect": case "ApplyEffect":
case "DeferredPower ": case "DeferredPower":
case "DirectDamage":
while (headerIterator.hasNext()) { while (headerIterator.hasNext()) {
effectDescription = new EffectDescription(); effectDescription = new EffectDescription();
effectDescription.effect_id = headerIterator.next(); effectDescription.effect_id = headerIterator.next();
@ -98,7 +99,6 @@ public class PowerActionParser {
powerActionEntry.effects.add(effectDescription); powerActionEntry.effects.add(effectDescription);
} }
break; break;
default: default:
Logger.error("Unhandled type " + powerActionEntry.action_type + " for Pow4erAction: " + powerActionEntry.action_id); Logger.error("Unhandled type " + powerActionEntry.action_type + " for Pow4erAction: " + powerActionEntry.action_id);
break; break;

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

@ -33,7 +33,7 @@ public class PowerActionEntry {
public mbEnums.DamageType damageType; public mbEnums.DamageType damageType;
public boolean applyEffectBlank = false; public boolean applyEffectBlank = false;
public boolean wearOffEffectBlank = false; public boolean wearOffEffectBlank = false;
public int arg1; public int petLevel;
public int arg2; public int petRace;
} }

Loading…
Cancel
Save