Browse Source

PowerAction parsing work.

feature-config-parsing2
MagicBot 3 months ago
parent
commit
825d7eb071
  1. 13
      src/engine/wpak/PowerActionParser.java
  2. 6
      src/engine/wpak/data/PowerActionEntry.java

13
src/engine/wpak/PowerActionParser.java

@ -82,12 +82,13 @@ public class PowerActionParser {
switch (powerActionEntry.action_type) { switch (powerActionEntry.action_type) {
case "RemoveEffect": case "RemoveEffect":
effectDescription = new EffectDescription(); powerActionEntry.effect_id = headerIterator.next();
effectDescription.effect_id = headerIterator.next(); break;
powerActionEntry.effects.add(effectDescription);
case "CreateMob": case "CreateMob":
powerActionEntry.petLevel = Integer.parseInt(headerIterator.next()); case "DamageOverTime":
powerActionEntry.petRace = Integer.parseInt(headerIterator.next()); powerActionEntry.effect_id = headerIterator.next();
powerActionEntry.arg1 = Integer.parseInt(headerIterator.next());
powerActionEntry.arg2 = Integer.parseInt(headerIterator.next());
break; break;
case "ApplyEffect": case "ApplyEffect":
case "DeferredPower": case "DeferredPower":
@ -99,6 +100,8 @@ public class PowerActionParser {
powerActionEntry.effects.add(effectDescription); powerActionEntry.effects.add(effectDescription);
} }
break; break;
case "Teleport": // No arguments
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;

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

@ -26,14 +26,14 @@ public class PowerActionEntry {
public boolean shouldShowArmor = false; public boolean shouldShowArmor = false;
public boolean bladeTrails = false; public boolean bladeTrails = false;
public boolean isResistable = false; public boolean isResistable = false;
public String effectID; public String effect_id;
public ArrayList<Float> scaleFactor = new ArrayList<>(); public ArrayList<Float> scaleFactor = new ArrayList<>();
public ArrayList<Integer> attackAnimations = new ArrayList<>(); public ArrayList<Integer> attackAnimations = new ArrayList<>();
public boolean isAggressive; public boolean isAggressive;
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 petLevel; public int arg1;
public int petRace; public int arg2;
} }

Loading…
Cancel
Save