diff --git a/src/engine/wpak/PowerActionParser.java b/src/engine/wpak/PowerActionParser.java index b67ad40f..408bcc65 100644 --- a/src/engine/wpak/PowerActionParser.java +++ b/src/engine/wpak/PowerActionParser.java @@ -9,8 +9,10 @@ package engine.wpak; import engine.gameManager.ConfigManager; +import engine.mbEnums; import engine.wpak.data.EffectDescription; import engine.wpak.data.PowerActionEntry; +import engine.wpak.data.StatTransfer; import org.pmw.tinylog.Logger; import java.io.IOException; @@ -56,6 +58,7 @@ public class PowerActionParser { PowerActionEntry powerActionEntry = new PowerActionEntry(); EffectDescription effectDescription; + StatTransfer statTransfer; try { // Remove all lines that contain a # and leading/trailing blank lines @@ -110,8 +113,32 @@ public class PowerActionParser { powerActionEntry.effects.add(effectDescription); } break; - case "Teleport": - case "TreeChoke":// No arguments + case "TransferStat": + statTransfer = new StatTransfer(); + statTransfer.fromStat = mbEnums.CostType.valueOf(headerIterator.next()); + statTransfer.toStat = mbEnums.CostType.valueOf(headerIterator.next()); + statTransfer.fromStatValue = Integer.parseInt(headerIterator.next()); + statTransfer.fromCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next()); + statTransfer.toStatValue = Integer.parseInt(headerIterator.next()); + statTransfer.toCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next()); + statTransfer.fromStatBool = Boolean.parseBoolean(headerIterator.next()); + statTransfer.toStatBool = Boolean.parseBoolean(headerIterator.next()); + break; + case "TransferStatOT": + statTransfer = new StatTransfer(); + statTransfer.fromStat = mbEnums.CostType.valueOf(headerIterator.next()); + statTransfer.toStat = mbEnums.CostType.valueOf(headerIterator.next()); + statTransfer.fromStatValue = Integer.parseInt(headerIterator.next()); + statTransfer.fromCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next()); + statTransfer.toStatValue = Integer.parseInt(headerIterator.next()); + statTransfer.toCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next()); + statTransfer.fromStatBool = Boolean.parseBoolean(headerIterator.next()); + statTransfer.toStatBool = Boolean.parseBoolean(headerIterator.next()); + statTransfer.transfer_action = headerIterator.next(); + statTransfer.tranfer_ticks = Integer.parseInt(headerIterator.next()); + break; + case "Teleport":// No arguments for these tags + case "TreeChoke": break; default: Logger.error("Unhandled type " + powerActionEntry.action_type + " for Pow4erAction: " + powerActionEntry.action_id); diff --git a/src/engine/wpak/data/StatTransfer.java b/src/engine/wpak/data/StatTransfer.java index 2499a8ae..51a78567 100644 --- a/src/engine/wpak/data/StatTransfer.java +++ b/src/engine/wpak/data/StatTransfer.java @@ -20,5 +20,5 @@ public class StatTransfer { public boolean fromStatBool; public boolean toStatBool; public String transfer_action; - public int effect_duration; + public int tranfer_ticks; }