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

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

@ -26,14 +26,14 @@ public class PowerActionEntry { @@ -26,14 +26,14 @@ public class PowerActionEntry {
public boolean shouldShowArmor = false;
public boolean bladeTrails = false;
public boolean isResistable = false;
public String effectID;
public String effect_id;
public ArrayList<Float> scaleFactor = new ArrayList<>();
public ArrayList<Integer> attackAnimations = new ArrayList<>();
public boolean isAggressive;
public mbEnums.DamageType damageType;
public boolean applyEffectBlank = false;
public boolean wearOffEffectBlank = false;
public int petLevel;
public int petRace;
public int arg1;
public int arg2;
}

Loading…
Cancel
Save